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.'

Authorization

Bearer-Auth
headerAuthorizationBearer <token>

Query Parameters

filter?|

Response Body

OK

application/json
  1. response

foobarbaz

id*string

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).

payment_link?string
price*|
product*|
valid_until*ISO-8601-Date

By default, a price quote is valid from the moment you request it for two weeks. Expired price quotes are accepted if the underlying price hasn't changed.

Match^\d{4}-\d{2}-\d{2}$
Formatdate
carbon_quantity*number

Volume of carbon emissions

carbon_unit*Carbon Unit

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

Value in"tonne""kilogram""gram"
currency*Currency

3-letter ISO 4217 alpha code of the currency.

Match^[A-Z]{3}$
Length3 <= length <= 3
Default"EUR"
Value in"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""ZAR"
total*integer

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

Example Request
curl -X GET 'https://api.sandbox.squake.earth/v2/pricing?expand%5B%5D=price&product=product_123ab&carbon_quantity=0.123&carbon_unit=tonne'
Example Response
{  "id": "string",  "payment_link": "string",  "price": "price_1MMroL2eZvKYlo2CxbxAACvb",  "product": "product_01fa2d8f04e424",  "valid_until": "2023-01-28",  "carbon_quantity": 0,  "carbon_unit": "tonne",  "currency": "EUR",  "total": 0}