Quote a Pricing

GET /v2/pricing

Returns pricing for a given product and carbon quantity (or a fixed total amount in any supported currency).

By default, requested pricing is valid for two weeks starting the moment you request it. Expired pricings can still be used as long as the underlying price hasn't changed for your convenience.

Repeated purchases using the same pricing are possible via API and the checkout page using the pricing id or payment_link, respectively.

You can append additional parameters to the payment_link; SQUAKE's checkout page supports the following:

  • localization: Please use a two-letter ISO 639-1 code, for example: &locale=en for English.
  • utm_*: any valid UTM tracking parameters, e.g., &utm_medium=email.

This is a low-latency endpoint, useful for previewing pricing before making a purchase either via API or on the SQUAKE checkout page via the returned payment_link.

Query parameters

  • product string

    The product to calculate pricing for. If omitted, the default product for your account is used.

  • carbon_quantity number Required

    The quantity of carbon to base the pricing on. Mutually exclusive with fixed_total.

  • carbon_unit string Required

    The unit of the carbon quantity. Mutually exclusive with fixed_total.

    Values are tonne, kilogram, or gram.

  • fixed_total integer Required

    A fixed amount to compensate for emissions. The number refers to the lowest denomination of the chosen currency, for example sending 1234 EUR means 12.34 EUR. Mutually exclusive with carbon_quantity & carbon_unit.

  • currency string

    3-letter ISO 4217 alpha code of the currency.

    Minimum length is 3, maximum length is 3. Format should match the following pattern: ^[A-Z]{3}$. Values are AED, AMD, ARS, AUD, AZN, BAM, BGN, BHD, BRL, CAD, CHF, CLP, CNY, COP, CRC, CZK, DKK, DZD, EGP, ETB, EUR, GBP, GEL, HKD, HUF, IDR, INR, ISK, JMD, JOD, JPY, KES, KRW, KWD, KZT, LKR, LYD, MAD, MUR, MXN, MYR, NOK, NZD, OMR, PHP, PKR, PLN, QAR, RSD, RUB, SAR, SEK, SGD, SYP, THB, TND, TRY, TTD, TWD, UAH, USD, VND, XAF, XOF, or ZAR. Default value is EUR.

  • Include the price or product as objects in the response (ID if omitted).

Responses

  • 200 application/json

    OK

    Hide headers attribute Show headers attribute
    • 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.

    Hide response attributes Show response attributes object
    • id string Required

      A token encoding the pricing; used to make a purchase. Requests for the same product and carbon quantity (or fixed total) may result in the same id. A pricing is valid for multiple purchases (the purchase endpoint is idempotent if you add an external_reference to the purchase call).

    • price string | object Required

      One of:

      ID of a price.

      Format should match the following pattern: price_[A-Za-z0-9]*.

    • product string | object Required

      Any of:

      ID of a product.

      Format should match the following pattern: product_[A-Za-z0-9]*.

    • valid_until string(date) Required

      Used for TIM, GATE4 and IATA.

      Format should match the following pattern: ^\d{4}-\d{2}-\d{2}$.

    • carbon_quantity number Required

      Volume of carbon emissions

    • carbon_unit string Required

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

      Values are tonne, kilogram, or gram.

    • currency string Required

      3-letter ISO 4217 alpha code of the currency.

      Minimum length is 3, maximum length is 3. Format should match the following pattern: ^[A-Z]{3}$. Values are AED, AMD, ARS, AUD, AZN, BAM, BGN, BHD, BRL, CAD, CHF, CLP, CNY, COP, CRC, CZK, DKK, DZD, EGP, ETB, EUR, GBP, GEL, HKD, HUF, IDR, INR, ISK, JMD, JOD, JPY, KES, KRW, KWD, KZT, LKR, LYD, MAD, MUR, MXN, MYR, NOK, NZD, OMR, PHP, PKR, PLN, QAR, RSD, RUB, SAR, SEK, SGD, SYP, THB, TND, TRY, TTD, TWD, UAH, USD, VND, XAF, XOF, or ZAR. Default value is EUR.

    • total integer Required

      The total amount in the lower denomination of the currency; e.g. 12.34 USD would be 1234.

  • 400 application/json

    Example response

    Hide headers attribute Show headers attribute
    • 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.

      Format should match the following pattern: req_[a-zA-Z0-9-]+.

    Hide response attributes Show response attributes object
    • code string Required

      An application-specific error code, expressed as a string value.

      Values are field_validation_error, server_error, not_authorized, not_found, invalid_methodology, or invalid_type.

    • detail string

      A human-readable explanation specific to this occurrence of the problem. Like title, this field's value can be localized.

    • source object

      An object containing references to the primary source of the error

      Additional properties are allowed.

      Hide source attributes Show source attributes object
  • 401 application/json

    Example response

    Hide headers attribute Show headers attribute
    • 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.

      Format should match the following pattern: req_[a-zA-Z0-9-]+.

    Hide response attributes Show response attributes object
    • code string Required

      An application-specific error code, expressed as a string value.

      Values are field_validation_error, server_error, not_authorized, not_found, invalid_methodology, or invalid_type.

    • detail string

      A human-readable explanation specific to this occurrence of the problem. Like title, this field's value can be localized.

    • source object

      An object containing references to the primary source of the error

      Additional properties are allowed.

      Hide source attributes Show source attributes object
GET /v2/pricing
curl \
 -X GET https://api.sandbox.squake.earth/v2/pricing?carbon_quantity=42.0&carbon_unit=tonne&fixed_total=42 \
 -H "Authorization: Bearer $ACCESS_TOKEN"
Response examples (200)
# Headers

# Payload
{
  "id": "string",
  "payment_link": "string",
  "price": "price_1MMroL2eZvKYlo2CxbxAACvb",
  "product": "product_01fa2d8f04e424",
  "valid_until": "2023-01-28",
  "carbon_quantity": 42.0,
  "carbon_unit": "tonne",
  "currency": "EUR",
  "total": 42
}
Response examples (400)
# Headers
SQUAKE-Request-Id: req_70394c00-728e-4d70-90bc-2b589c9ebdf8

# Payload
[
  {
    "code": "field_validation_error",
    "detail": "string",
    "source": {
      "id": "string",
      "attribute": "string",
      "model": "string"
    }
  }
]
Response examples (401)
# Headers
SQUAKE-Request-Id: req_70394c00-728e-4d70-90bc-2b589c9ebdf8

# Payload
[
  {
    "code": "field_validation_error",
    "detail": "string",
    "source": {
      "id": "string",
      "attribute": "string",
      "model": "string"
    }
  }
]