Create a flight emission estimate
Estimate emissions produced by passengers in a commercial airflight.
Parameters
Either the flight distance or the start/destination airport code (ICAO or IATA).
One of
Cabin of class to be used for the specified passengers. Higher classes account for more emissions since total weight and volume necessary to accomodate the class is higher. This parameter defaults to first.
- economy
- business
- first
Number of passengers the calculation should be applied to. This parameter defaults to 1.
Bundle selection percentages.
The sum of all percentages must equal 100.
If not specified, the preconfigured allocation ratios are going to be used.
If, for each selection, percentage
is not provided, the selection is divided equally (best effort) between bundles. percentage
must be provided for all or none of the bundles.
A name used to reference this calculation.
An arbitrary dictionary (key-value pairs) to store application-specific information.
Lune doesn't use this information for order processing. Its purpose is for the API clients to be able to attach arbitrary information (to an order for example) and then retrieve it.
Account-unique identifier provided by the client.
idempotency_key
has two purposes:
- Clients can safely retry estimate requests without accidentally performing the same operation multiple times.
- Clients can use
idempotency_key
to reconcile estimates with entities on their system.
Returns
An arbitrary dictionary (key-value pairs) to store application-specific information.
Lune doesn't use this information for order processing. Its purpose is for the API clients to be able to attach arbitrary information (to an order for example) and then retrieve it.
Account-unique identifier provided by the client.
idempotency_key
has two purposes:
- Clients can safely retry estimate requests without accidentally performing the same operation multiple times.
- Clients can use
idempotency_key
to reconcile estimates with entities on their system.
The emission calculation unique identifier
One of
Parameters for estimating emissions for commercial plane travel
curl 'https://api.lune.co/v1/estimates/flight' \
-H 'Authorization: Bearer <API_KEY>' \
-H 'Content-Type: application/json' \
-X POST \
-d '{
"route": {
"amount": "40.501",
"unit": "km"
}
}'
{
"mass": {
"amount": "40.501",
"unit": "t"
},
"idempotency_key": "5bd808a954e",
"id": "90ng23MKvLqbkpMwMw7yMBD4wJQrV6O6",
"quote": {
"errors": [
{
"error_code": "account_suspended",
"message": "message"
}
],
"error": {
"error_code": "account_suspended",
"message": "message"
}
},
"request": {
"route": {
"amount": "40.501",
"unit": "km"
},
"cabin_class": "economy",
"passengers": 1,
"bundle_selection": [
{
"bundle_id": "BmWxrvXo29eGqzA1qjANL5PwnkgaO8R3",
"percentage": 34
},
{
"bundle_id": "VndoQ0PZjGMzvYOZGwqy6kbgN1eOJx9B",
"percentage": 66
}
],
"quantity_trunc": "t",
"name": "name",
"idempotency_key": "5bd808a954e"
}
}