Quote a 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=enfor 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.'
Bearer-AuthAuthorizationBearer <token>filter?|OK
application/json- response
foobarbaz
id*stringA 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?stringprice*|product*|valid_until*ISO-8601-DateBy 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.
^\d{4}-\d{2}-\d{2}$datecarbon_quantity*numberVolume of carbon emissions
carbon_unit*Carbon UnitSQUAKE uses The International System of Units (SI), commonly referred to as "metric system".
"tonne""kilogram""gram"currency*Currency3-letter ISO 4217 alpha code of the currency.
^[A-Z]{3}$3 <= length <= 3"EUR""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*integerThe total amount in the lower denomination of the currency; e.g. 12.34 USD would be 1234.
curl -X GET 'https://api.sandbox.squake.earth/v2/pricing?expand%5B%5D=price&product=product_123ab&carbon_quantity=0.123&carbon_unit=tonne'{ "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}Perform a Calculation including a Price Quote
Convenience all-in-one endpoint to perform carbon calculation and pricing. A purchase can be performed via API or SQUAKE's checkout page using the returned `payment_link`. <br><br> All features supported by either the `/calculations` or `/pricing` endpoint are equally valid for this combined endpoint. Please read the respective descriptions for details. <br><br> If you need only either pricing or carbon emissions, SQUAKE advises using the specific endpoints for lower latency and reduced implementation complexity.'
Retrieve a Purchase
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.