# 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 . All features supported by either the or endpoint are equally valid for this combined endpoint. Please read the respective descriptions for details. If you need only either pricing or carbon emissions, SQUAKE advises using the specific endpoints for lower latency and reduced implementation complexity.' Endpoint: POST /v2/calculations-with-pricing Security: Bearer-Auth ## Request fields (application/json): - `expand` (array) If you include , SQUAKE returns emissions per item. Include for per-leg flight rows when using . If you include a pricing token will be returned for each item. Enum: "items", "legs", "product", "price", "items.pricing" - `items` (array, required) - `product` (string, required) - `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. - `currency` (string) 3-letter ISO 4217 alpha code of the currency. Enum: "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" - `carbon_unit` (string) SQUAKE uses The International System of Units (SI), commonly referred to as "metric system". Enum: "tonne", "kilogram", "gram" - `distance_unit` (string) SQUAKE uses common distance units Enum: "meter", "kilometer", "feet", "mile", "nautical_mile" - `payment_method` (string) Controls the way you want to process the purchase. If is used then you''ll receive a in response. If is used, then you''ll have to use endpoint to finalise the purchase. Enum: "stripe", "batch_settlement" ## Response 200 fields (application/json): - `id` (string, required) A token encoding the pricing. Used to make a purchase. - `carbon_quantity` (number, required) - `carbon_unit` (string, required) SQUAKE uses The International System of Units (SI), commonly referred to as "metric system". Enum: "tonne", "kilogram", "gram" - `payment_link` (string) - `price` (any, required) - `product` (any, required) - `valid_from` (string, required) Date in ISO 8601 notation. - `valid_until` (string, required) Date in ISO 8601 notation. - `currency` (string, required) 3-letter ISO 4217 alpha code of the currency. Enum: "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, required) The total amount in the lower denomination of the currency; e.g. 12.34 USD would be 1234. - `items` (array) Expand items to receive emissions per item. By default, this is not included. - `items.external_reference` (string) - `items.type` (string, required) Enum: "accommodation", "air_freight", "bus", "camping_site", "car", "co2_amount", "coffee_production", "cruise", "expenditure", "ferry", "flight", "general", "hotel", "logistics", "logistics_site", "money_amount", "private_jet", "sea_freight", "inland_waterways", "train", "rail_freight", "road_freight", "van" - `items.methodology` (string, required) Enum: "ACRISS", "ADEME", "BASIC", "CLEAN-CARGO", "CO2-EMISSIEFACTOREN-NL", "DIN-EN-16258", "DEFRA", "EU-EEA", "EU-EMSA", "US-EPA", "HCMI", "OFNK", "ECTA", "GLEC", "ICAO", "TIM", "SQUAKE" - `items.methodology_version` (string) The version of the methodology used for the calculation. Only present if the methodology is a versioned methodology. - `items.distance` (number) Total distance for the item when applicable; for , equals the sum of leg distances. - `items.distance_unit` (string) SQUAKE uses common distance units Enum: "meter", "kilometer", "feet", "mile", "nautical_mile" - `items.routing` (string) Present when the flight used and includes . - `items.legs` (array) Per-leg breakdown when the flight used and includes . - `items.legs.distance` (number) Leg distance in the response of the calculation. - `items.legs.methodology` (string) Methodology used for this leg (matches parent flight item). - `items.legs.audit` (object) Present on legs when audit mode is enabled for the item. - `items.legs.emission_factors` (object) Present on legs when audit mode is enabled for the item. - `items.pricing` (object) Only included if includes ## Response 400 fields (application/json): - `errors` (array) - `errors.code` (string, required) An application-specific error code, expressed as a string value. Enum: "field_validation_error", "invalid_params", "server_error", "not_authorized", "not_found", "invalid_methodology", "invalid_type" - `errors.detail` (string) A human-readable explanation specific to this occurrence of the problem. Like title, this field's value can be localized. - `errors.source` (object) An object containing references to the primary source of the error - `errors.source.id` (string) - `errors.source.attribute` (string, required) - `errors.source.model` (string) ## Response 401 fields (application/json): - `errors` (array) - `errors.code` (string, required) An application-specific error code, expressed as a string value. Enum: "field_validation_error", "invalid_params", "server_error", "not_authorized", "not_found", "invalid_methodology", "invalid_type" - `errors.detail` (string) A human-readable explanation specific to this occurrence of the problem. Like title, this field's value can be localized. - `errors.source` (object) An object containing references to the primary source of the error - `errors.source.id` (string) - `errors.source.attribute` (string, required) - `errors.source.model` (string)