SQUAKE API Documentation

Introduction

Trusted technology to achieve your carbon targets.

The SQUAKE Solution Suite is live with industry leaders from several travel and logistics segments and performs accurate carbon calculations for all types of activities (e.g. flights, road, accommodation amongst others) according to national and international standards. It automates carbon reductions and/or compensations along the supply chain, from supplier selection (SAF, DAC, ecological restoration) to inventory management, invoicing and credit retirement.

Customer Support

For any issues or inquiries, you can reach our dedicated customer support team through our Support Page. This is the best place to ask questions, report incidents, or get assistance with integrating or using SQUAKE's solutions.

Contact Forms

Our contact forms are designed to help you communicate with us effectively. Whether you want to get in contact with our support team or need to report an incident, we've got you covered. Please use the appropriate form below:

  • Contact Form: Get in contact with our customer support team or share your thoughts and suggestions about our services and processes.
  • Incident Form: Report any issues or incidents you've encountered, and our support team will respond as soon as possible.

Authentication

SQUAKE uses API keys to authenticate requests. You can create and revoke API keys in the Dashboard, which you can access by contacting us under product@squake.earth. You should securely store your API keys; and encrypt them on rest if possible. Be aware that each API key is shown exactly once in the UI during creation. SQUAKE advises rotating API keys on a regular basis.

To use the sandbox environment, a separate API key must be created. Switch to sandbox mode in the dashboard, then create an API key.

All requests must be authenticated and made over HTTPS. SQUAKE supports TLS 1.2 - TLS 1.3. Requests without authentication or via plain HTTP result in an error.

When using HTTP Basic Auth, the API key is the username; leave the password blank. For bearer auth, pass the API key as the token.

Example using HTTP Basic Auth (note: there is no password, but a colon is still required):

curl https://api.squake.earth/v2/pricing -u <YOUR_API_KEY>

Example using bearer auth:

curl https://api.squake.earth/v2/pricing -H "Authorization: Bearer <YOUR_API_KEY>"

Request ID

SQUAKE associates each API request with a unique identifier. Find this value in the SQUAKE-Request-Id header. If you need to contact us regarding a specific request, providing the request identifier helps the resolution process.

Uptime Monitoring

Please visit status.squake.earth to check our uptime monitor. You can subscribe to events to stay informed of any service disruption. We will also publish a post-mortem about any incident should one occur.

You can programmatically check if servers are reachable. Read the documentation of the Health Check endpoints for details. The health check endpoints are the only endpoints that do not require authentication.

Sandbox

There is a sandbox server available for testing at

https://api.sandbox.squake.earth

Sandbox and production are separate systems and share no data. Sandbox uses less computing power and may be slower than production. Both sandbox and production environments run the same version of the API; thus, they share the same feature set.

To use the sandbox environment, a separate API key must be created. Switch to sandbox mode in the dashboard, then create an API key.

Static IP Addresses

All outgoing traffic originates from one of the following static IP addresses. SQUAKE owns these IP addresses and never shares them for any other traffic.

EnvironmentIP AddressGeo Region
Production52.59.66.213Europa/Germany
Production52.7.39.159USA
Sandbox18.197.251.125Europa/Germany

Getting Started with SQUAKE API

This guide will help you make requests to the SQUAKE API in order to calculate emissions for a travel journey.

Choose a group of Endpoints

SQUAKE API has the following group of endpoints:

  • Calculations - Calculates carbon emissions for various activities in a low-latency process.
  • Pricing - Returns pricing for a given product and carbon quantity, valid for two weeks by default.
  • Combined Calculation & Pricing - Performs carbon calculation and pricing in a single call for convenience.
  • Carbon Comparison - Compares carbon quantities to recognizable items like cars or light bulbs.
  • Purchases - Registers a purchase to compensate for carbon emissions, requiring a prior pricing quote.
  • Products - Lists purchasable compensation options, including single climate projects and bundles.
  • Files - Manages file attachments related to purchases, such as compensation confirmations.
  • Webhooks - Allows you to receive notifications about events happening in SQUAKE.
  • Audits - Provides a list of audits or a specific audit for calculations.
  • Health Check - Verifies if SQUAKE's server is reachable.

Precision of Calculations

Bus Databases

If you want operator-specific calculations for buses, then use the following dataset supported by SQUAKE's methodology.

Car Databases

If you have specific information about car models, then use one of the following methodologies: ADEME (France), US-EPA (USA) and EU-EEA (EU).

Hotel Databases

Use the HCMI and SQUAKE methodologies database to obtain more accurate emissions. If you know an eco-label, use SQUAKE's eco-label dataset.

GLEC Databases

For road and sea logistics activities according to GLEC, use the GLEC dataset.

Train Databases

For operator-specific calculations for trains, use the train dataset.

Van Databases

For van calculations, use the EU-EEA supported dataset.

Carbon Comparison

Compare carbon quantities to more recognizable items like cars or kettles. View accepted units in this comparison database.


Download OpenAPI description
Languages
Servers
Production

https://api.squake.earth/

Sandbox

https://api.sandbox.squake.earth/

Calculations

Operations

Pricing

Operations

Combined Calculation & Pricing

Operations

Carbon Comparison

Operations

Purchases

Operations

Create a Purchase

Request

You can register a purchase programmatically to compensate for carbon emissions on this endpoint. You must quote for pricing beforehand and pass the returned pricing ID as a parameter.

Alternatively, you can use the payment_link from the pricing endpoint to finalize the purchase using SQUAKE's provided checkout page.

Lifecycle

When purchasing via API (this endpoint)

  • reserved: A successful purchase starts in the state "reserved"; SQUAKE registered your purchase and reserved carbon credits accordingly.

  • canceled: SQUAKE offers 14 days to cancel a purchase worry-free. This is a terminal state.

  • confirmed: The refundable period has passed. If you need to cancel the purchase beyond this point, please request a refund on the refunds endpoint.

  • invoiced: Without further action, a purchase is invoiced after the grace period and transitions to "invoiced".

When purchasing via the checkout page

  • payment_initiated: the end customer entered the payment flow on the checkout page

  • payment_aborted: the payment failed permanently, for example, because the customer exited the page without finalizing the payment and didn''t return before the pricing''s validity ended. This is a terminal state.

  • confirmed: the payment provider informed SQUAKE about the successful payment. In this flow, this state exists only for a short time; the purchase immediately continues to "settled".

Both

  • settled: SQUAKE has received the payment.

  • refunded: a refund request was successfully processed. This is a terminal state.

  • certificates_confirmed: all certificates for the carbon credits have been confirmed from all project partners related to the purchase.

  • certificates_retired: all certificates have been retired in the corresponding registries. This is a terminal state.

Security
Bearer-Auth
Bodyapplication/json
pricingstringrequired

The ID from the pricing endpoint

confirmation_documentobject(Confirmation-Document)
certificate_documentobject(Certificate-Document)
expandArray of any

Receive either the file-id, or the file-object of a requested document. If omitted, only IDs are returned.

metadataobject(Metadata)

A set of key-value pairs of yours that helps you link this record in your system. Never displayed to users.

external_referencestring

If given, this reference must be unique. Suppose you need idempotency on the purchase endpoint: in that case, the external reference must be provided, meaning you can retry a purchase call with the same pricing id multiple times without registering multiple purchases, e.g., to recover from a network failure. Remember: with a valid pricing id, you can register as many purchases as you need. The reference should have enough entropy; a great choice is a V4 UUID.

curl -i -X POST \
  https://api.squake.earth/v2/purchases \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>' \
  -H 'Content-Type: application/json' \
  -d '{
    "pricing": "string",
    "confirmation_document": {
      "full_name": "string",
      "address": {
        "city": "string",
        "country": "DE",
        "line1": "string",
        "line2": "string",
        "postal_code": "string",
        "state": "string"
      },
      "email": "user@example.com",
      "on_behalf_of": {
        "full_name": "string",
        "address": {
          "city": "string",
          "country": "DE",
          "line1": "string",
          "line2": "string",
          "postal_code": "string",
          "state": "string"
        }
      },
      "locale": "en"
    },
    "certificate_document": {
      "full_name": "string",
      "address": {
        "city": "string",
        "country": "DE",
        "line1": "string",
        "line2": "string",
        "postal_code": "string",
        "state": "string"
      },
      "email": "user@example.com",
      "flags": [
        "with_attribution"
      ],
      "locale": "en"
    },
    "expand": [
      "files"
    ],
    "metadata": {},
    "external_reference": "string"
  }'

Responses

Created

Headers
SQUAKE-Request-Idany(SQUAKE-Request-Id)

Unique identifier linked to this API request. If you need to contact us regarding a specific request, providing the request identifier helps the resolution process.

Bodyapplication/json
idstringpurchase_[a-zA-Z0-9]*required
filesArray of strings or File (object)unique

Contains for example the certificate document if it was requested during the purchase.

payment_methodstring(Payment-Method)required

Mode of payment. The batch settlement means SQUAKE will invoice you regularly for a batch of purchases. The checkout page is SQUAKEs self-fulfillment solution where end-customers can purchase a product directly from SQUAKE as the merchant of record.

Enum"batch_settlement""stripe"
statestring(Purchase-State)required
Enum"reserved""confirmed""invoiced""settled""certificates_confirmed""certificates_retired""payment_initiated""canceled""voided""refunded"
metadataobject(Metadata)

A set of key-value pairs of yours that helps you link this record in your system. Never displayed to users.

checkout_pageobject

Present if the payment method is stripe, meaning self-fulfillment by the customer on SQUAKEs payment page.

carbon_quantitynumberrequired
carbon_unitstring(carbon_unit)required

SQUAKE uses The International System of Units (SI), commonly referred to as "metric system".

Enum"tonne""kilogram""gram"
totalintegerrequired
currencystring(currency)= 3 characters^[A-Z]{3}$required

3-letter ISO 4217 alpha code of the currency.

Enum"AED""AMD""ARS""AUD""AZN""BAM""BGN""BHD""BRL""CAD"
external_referencestring

Unique identifier from your system; used as idempotency when creating this resource.

cancellable_untilstring(date-time)

The date until which purchase can be cancelled

Example: "2025-01-01T15:00:00+00:00"
Response
application/json
{ "id": "purchase_sd234asdfl23", "files": [ "file_34sdfgJH9df4g35" ], "payment_method": "batch_settlement", "state": "reserved", "metadata": {}, "checkout_page": { "url": "https://checkout.squake.earth", "return_url": "https://example.com" }, "carbon_quantity": 0, "carbon_unit": "tonne", "total": 0, "currency": "EUR", "external_reference": "string", "cancellable_until": "2025-01-01T15:00:00+00:00" }

Retrieve a Purchase

Request

Retrieve a purchase placed earlier. Useful to check for its state. To avoid short polling, you can register a webhook to stay informed about all your purchases automatically.

You can use the external_reference as ID as well for the lookup; i.e. your unique identifier.

Security
Bearer-Auth
Path
idstringrequired
Query
expand[]string

Include e.g. "files" to retrieve files as a full object (defaults to just their IDs)

curl -i -X GET \
  'https://api.squake.earth/v2/purchases/{id}?expand%5B%5D=string' \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>'

Responses

OK

Headers
SQUAKE-Request-Idany(SQUAKE-Request-Id)

Unique identifier linked to this API request. If you need to contact us regarding a specific request, providing the request identifier helps the resolution process.

Bodyapplication/json
idstringpurchase_[a-zA-Z0-9]*required
filesArray of strings or File (object)unique

Contains for example the certificate document if it was requested during the purchase.

payment_methodstring(Payment-Method)required

Mode of payment. The batch settlement means SQUAKE will invoice you regularly for a batch of purchases. The checkout page is SQUAKEs self-fulfillment solution where end-customers can purchase a product directly from SQUAKE as the merchant of record.

Enum"batch_settlement""stripe"
statestring(Purchase-State)required
Enum"reserved""confirmed""invoiced""settled""certificates_confirmed""certificates_retired""payment_initiated""canceled""voided""refunded"
metadataobject(Metadata)

A set of key-value pairs of yours that helps you link this record in your system. Never displayed to users.

checkout_pageobject

Present if the payment method is stripe, meaning self-fulfillment by the customer on SQUAKEs payment page.

carbon_quantitynumberrequired
carbon_unitstring(carbon_unit)required

SQUAKE uses The International System of Units (SI), commonly referred to as "metric system".

Enum"tonne""kilogram""gram"
totalintegerrequired
currencystring(currency)= 3 characters^[A-Z]{3}$required

3-letter ISO 4217 alpha code of the currency.

Enum"AED""AMD""ARS""AUD""AZN""BAM""BGN""BHD""BRL""CAD"
external_referencestring

Unique identifier from your system; used as idempotency when creating this resource.

cancellable_untilstring(date-time)

The date until which purchase can be cancelled

Example: "2025-01-01T15:00:00+00:00"
Response
application/json
{ "id": "purchase_sd234asdfl23", "files": [ "file_34sdfgJH9df4g35" ], "payment_method": "batch_settlement", "state": "reserved", "metadata": {}, "checkout_page": { "url": "https://checkout.squake.earth", "return_url": "https://example.com" }, "carbon_quantity": 0, "carbon_unit": "tonne", "total": 0, "currency": "EUR", "external_reference": "string", "cancellable_until": "2025-01-01T15:00:00+00:00" }

Update a Purchase

Request

Update a purchase placed earlier.

You can use the external_reference as ID as well for the lookup; i.e. your unique identifier.

Omitted keys will not affect any present data. To remove optional data you must explicitly set the value to null.

Security
Bearer-Auth
Path
idstringrequired
Bodyapplication/json
confirmation_documentobject(Confirmation-Document)
certificate_documentobject(Certificate-Document)
expandArray of any

Receive either the file-id, or the file-object of a requested document. If omitted, only IDs are returned.

metadataobject(Metadata)

A set of key-value pairs of yours that helps you link this record in your system. Never displayed to users.

external_referencestring
curl -i -X PATCH \
  'https://api.squake.earth/v2/purchases/{id}' \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>' \
  -H 'Content-Type: application/json' \
  -d '{
    "confirmation_document": {
      "full_name": "string",
      "address": {
        "city": "string",
        "country": "DE",
        "line1": "string",
        "line2": "string",
        "postal_code": "string",
        "state": "string"
      },
      "email": "user@example.com",
      "on_behalf_of": {
        "full_name": "string",
        "address": {
          "city": "string",
          "country": "DE",
          "line1": "string",
          "line2": "string",
          "postal_code": "string",
          "state": "string"
        }
      },
      "locale": "en"
    },
    "certificate_document": {
      "full_name": "string",
      "address": {
        "city": "string",
        "country": "DE",
        "line1": "string",
        "line2": "string",
        "postal_code": "string",
        "state": "string"
      },
      "email": "user@example.com",
      "flags": [
        "with_attribution"
      ],
      "locale": "en"
    },
    "expand": [
      "files"
    ],
    "metadata": {},
    "external_reference": "string"
  }'

Responses

OK

Headers
SQUAKE-Request-Idany(SQUAKE-Request-Id)

Unique identifier linked to this API request. If you need to contact us regarding a specific request, providing the request identifier helps the resolution process.

Bodyapplication/json
idstringpurchase_[a-zA-Z0-9]*required
filesArray of strings or File (object)unique

Contains for example the certificate document if it was requested during the purchase.

payment_methodstring(Payment-Method)required

Mode of payment. The batch settlement means SQUAKE will invoice you regularly for a batch of purchases. The checkout page is SQUAKEs self-fulfillment solution where end-customers can purchase a product directly from SQUAKE as the merchant of record.

Enum"batch_settlement""stripe"
statestring(Purchase-State)required
Enum"reserved""confirmed""invoiced""settled""certificates_confirmed""certificates_retired""payment_initiated""canceled""voided""refunded"
metadataobject(Metadata)

A set of key-value pairs of yours that helps you link this record in your system. Never displayed to users.

checkout_pageobject

Present if the payment method is stripe, meaning self-fulfillment by the customer on SQUAKEs payment page.

carbon_quantitynumberrequired
carbon_unitstring(carbon_unit)required

SQUAKE uses The International System of Units (SI), commonly referred to as "metric system".

Enum"tonne""kilogram""gram"
totalintegerrequired
currencystring(currency)= 3 characters^[A-Z]{3}$required

3-letter ISO 4217 alpha code of the currency.

Enum"AED""AMD""ARS""AUD""AZN""BAM""BGN""BHD""BRL""CAD"
external_referencestring

Unique identifier from your system; used as idempotency when creating this resource.

cancellable_untilstring(date-time)

The date until which purchase can be cancelled

Example: "2025-01-01T15:00:00+00:00"
Response
application/json
{ "id": "purchase_sd234asdfl23", "files": [ "file_34sdfgJH9df4g35" ], "payment_method": "batch_settlement", "state": "reserved", "metadata": {}, "checkout_page": { "url": "https://checkout.squake.earth", "return_url": "https://example.com" }, "carbon_quantity": 0, "carbon_unit": "tonne", "total": 0, "currency": "EUR", "external_reference": "string", "cancellable_until": "2025-01-01T15:00:00+00:00" }

Cancel a Purchase

Request

A purchase can be canceled as long as it is not confirmed; this is in the state reserved. After the cancelation period passes, the purchase transitions to confirmed. Confirmed purchases go to the batch settlement.

Security
Bearer-Auth
Path
idstringrequired
curl -i -X POST \
  'https://api.squake.earth/v2/purchases/{id}/cancel' \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>'

Responses

OK

Headers
SQUAKE-Request-Idany(SQUAKE-Request-Id)

Unique identifier linked to this API request. If you need to contact us regarding a specific request, providing the request identifier helps the resolution process.

Bodyapplication/json
idstringpurchase_[a-zA-Z0-9]*required
filesArray of strings or File (object)unique

Contains for example the certificate document if it was requested during the purchase.

payment_methodstring(Payment-Method)required

Mode of payment. The batch settlement means SQUAKE will invoice you regularly for a batch of purchases. The checkout page is SQUAKEs self-fulfillment solution where end-customers can purchase a product directly from SQUAKE as the merchant of record.

Enum"batch_settlement""stripe"
statestring(Purchase-State)required
Enum"reserved""confirmed""invoiced""settled""certificates_confirmed""certificates_retired""payment_initiated""canceled""voided""refunded"
metadataobject(Metadata)

A set of key-value pairs of yours that helps you link this record in your system. Never displayed to users.

checkout_pageobject

Present if the payment method is stripe, meaning self-fulfillment by the customer on SQUAKEs payment page.

carbon_quantitynumberrequired
carbon_unitstring(carbon_unit)required

SQUAKE uses The International System of Units (SI), commonly referred to as "metric system".

Enum"tonne""kilogram""gram"
totalintegerrequired
currencystring(currency)= 3 characters^[A-Z]{3}$required

3-letter ISO 4217 alpha code of the currency.

Enum"AED""AMD""ARS""AUD""AZN""BAM""BGN""BHD""BRL""CAD"
external_referencestring

Unique identifier from your system; used as idempotency when creating this resource.

cancellable_untilstring(date-time)

The date until which purchase can be cancelled

Example: "2025-01-01T15:00:00+00:00"
Response
application/json
{ "id": "purchase_sd234asdfl23", "files": [ "file_34sdfgJH9df4g35" ], "payment_method": "batch_settlement", "state": "reserved", "metadata": {}, "checkout_page": { "url": "https://checkout.squake.earth", "return_url": "https://example.com" }, "carbon_quantity": 0, "carbon_unit": "tonne", "total": 0, "currency": "EUR", "external_reference": "string", "cancellable_until": "2025-01-01T15:00:00+00:00" }

Products

Operations

Files

Operations

Webhooks

Operations

Audits

Audit logs are created when enabled on calculation requests.

ℹ️ To use this feature you need to have it enabled for your account, please contact us for more information.
Operations

Health Check

Check if SQUAKE's server can be reached.

Operations