# Perform a Calculation The calculations endpoint can calculate carbon emissions for one or multiple activities. The carbon footprint or your journey consisting of, for example, a return flight, two cab rides, and a hotel stay can be computed all at once, passing all five activities in the items array. Include the string literal "items" in the "expand" array to retrieve values for each item separately in addition to the total carbon quantity. This is a low-latency endpoint. SQUAKE does not provide you with a unique identifier for any calculation results. You must quote a price on the pricing endpoint to purchase compensation for your carbon emissions. Some data sets are extensive and thus documented separately here. Endpoint: POST /v2/calculations Security: Bearer-Auth ## Request fields (application/json): - `expand` (array) Include to return emissions per item (in addition to the total). Include to return per-leg rows for flight items that use (multi-leg itineraries). is only meaningful when combined with . See [Flight routing](https://docs-integration.squake.earth/api-calculations-request-response/travel/flight/flight-routing). Enum: "items", "legs" - `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" - `audit_for` (string) Provide when calculating on behalf of a specific Auditable entity; otherwise omit. If you make a calculation on behalf of a specific legal entity, you can specify the ID of the auditable entity. This will associate all audit logs created for that calculation with the given Auditable entity. - `items` (array, required) ## Response 200 fields (application/json): - `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" - `items` (array) Present when includes . Per-item emissions; for routed flights, include in to also receive and per-leg rows on the item. - `items.audit_id` (string) If the item was audited, this is the ID of the audit. This is only present if the item was audited. - `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 (e.g. flight); 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) Echoes the submitted routing chain when the item 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. ## 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)