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=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.
-
The quantity of carbon to base the pricing on. Mutually exclusive with fixed_total.
-
The unit of the carbon quantity. Mutually exclusive with fixed_total.
Values are
tonne
,kilogram
, orgram
. -
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 is3
. Format should match the following pattern:^[A-Z]{3}$
. Values areAED
,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
, orZAR
. Default value isEUR
. -
expand[] array
Include the price or product as objects in the response (ID if omitted).
-
payment_link_return_url string
If the customer does not exit the browser after the purchase, on success, SQUAKE will redirect the customer to this link. This is used when you want your customer to use the SQUAKE checkout page for the purchase.
curl \
-X GET https://api.squake.earth/v2/pricing?carbon_quantity=42.0&carbon_unit=tonne&fixed_total=42 \
-H "Authorization: Bearer $ACCESS_TOKEN"
# 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
}
# Headers
SQUAKE-Request-Id: req_70394c00-728e-4d70-90bc-2b589c9ebdf8
# Payload
[
{
"code": "field_validation_error",
"detail": "string",
"source": {
"id": "string",
"attribute": "string",
"model": "string"
}
}
]
# Headers
SQUAKE-Request-Id: req_70394c00-728e-4d70-90bc-2b589c9ebdf8
# Payload
[
{
"code": "field_validation_error",
"detail": "string",
"source": {
"id": "string",
"attribute": "string",
"model": "string"
}
}
]