Lune Docs Logo

Passenger transportation

Create a passenger transportation emission estimate

HTTP POST to /v1/estimates/passenger-transportationEstimate emissions produced by passenger transportation, for instance commercial flight, rail, road.
Request body

Parameters for estimating emissions for passenger transportation

Number of passengers the calculation should be applied to.

An array representing all passenger travel legs.

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.

Maps a bundle id to an allocation ratio

The bundle's unique identifier

Selects to which precision to truncate quantities specific to carbon offsetting.

g
kg
t

A name 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:

  1. Clients can safely retry estimate requests without accidentally performing the same operation multiple times.
  2. Clients can use idempotency_key to reconcile estimates with entities on their system.
Response

An emission estimate result for passenger transport involving multiple legs.

Lune's API returns both the total emissions and per-leg emissions (in the legs property).

The ordering of the legs in the estimate is the same as the ordering of the inputs.

An error with estimating any of the legs will result in the whole estimation process failing completely (we don't provide partial estimates in light of a failure).

Pattern: ^[0-9]+(\.[0-9]+)?$

Unit, t for tonne, kg for kilogram, g for gram, mg for milligram

mg
g
kg
t

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:

  1. Clients can safely retry estimate requests without accidentally performing the same operation multiple times.
  2. Clients can use idempotency_key to reconcile estimates with entities on their system.

The emission calculation unique identifier

Pattern: ^[0-9]+(\.[0-9]+)?$

Unit, t for tonne, kg for kilogram, g for gram, mg for milligram

mg
g
kg
t

Pattern: ^[0-9]+(\.[0-9]+)?$

Unit, km for kilometers, mi for miles

km
mi
nm

This property is null for any estimate created before 01/12/2024

The emission factor unique identifier

The emission factor name

epa
exiobase
ecoinvent
beis
lune

Source version of the emission factor.

Publication year of the emission factor

Unit, t for tonne, kg for kilogram, g for gram

g
kg
t

Denominator unit of the emission factor

Date of creation of the emission factor

The name of the region that the emission factor covers.

A category that describes the emission factor.

Detailed information about the gas emissions.

This property is always set as of March 2024.

Pattern: ^[0-9]+(\.[0-9]+)?$

Amount of CO₂ equivalent gas. All gas emissions are accounted here.

Pattern: ^[0-9]+(\.[0-9]+)?$

Amount of CO₂ gas.

Pattern: ^[0-9]+(\.[0-9]+)?$

Amount of methane gas.

Pattern: ^[0-9]+(\.[0-9]+)?$

Amount of nitrous oxide gas.

Pattern: ^[0-9]+(\.[0-9]+)?$

Amount of other greenhouse gases.

Parameters for estimating emissions for passenger transportation

Number of passengers the calculation should be applied to.

An array representing all passenger travel legs.

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.

Maps a bundle id to an allocation ratio

The bundle's unique identifier

Selects to which precision to truncate quantities specific to carbon offsetting.

g
kg
t

A name 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:

  1. Clients can safely retry estimate requests without accidentally performing the same operation multiple times.
  2. Clients can use idempotency_key to reconcile estimates with entities on their system.
Errors
This API operation can return the following errors:
HTTP status codeError code
400
api_version_invalid
400
bundle_selection_ratios_invalid
400
bundle_selection_bundle_invalid
400
order_value_invalid
400
bundle_id_invalid
400
id_invalid
400
distance_invalid
400
test_account_name_update_disallowed
400
bundle_selection_ratios_invalid_format
400
address_not_found

Get a passenger transportation emission estimate

HTTP GET to /v1/estimates/passenger-transportation/{id}Returns a passenger transportation emission estimate.
Query parameters

The estimate's unique identifier

Response

An emission estimate result for passenger transport involving multiple legs.

Lune's API returns both the total emissions and per-leg emissions (in the legs property).

The ordering of the legs in the estimate is the same as the ordering of the inputs.

An error with estimating any of the legs will result in the whole estimation process failing completely (we don't provide partial estimates in light of a failure).

Pattern: ^[0-9]+(\.[0-9]+)?$

Unit, t for tonne, kg for kilogram, g for gram, mg for milligram

mg
g
kg
t

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:

  1. Clients can safely retry estimate requests without accidentally performing the same operation multiple times.
  2. Clients can use idempotency_key to reconcile estimates with entities on their system.

The emission calculation unique identifier

Pattern: ^[0-9]+(\.[0-9]+)?$

Unit, t for tonne, kg for kilogram, g for gram, mg for milligram

mg
g
kg
t

Pattern: ^[0-9]+(\.[0-9]+)?$

Unit, km for kilometers, mi for miles

km
mi
nm

This property is null for any estimate created before 01/12/2024

The emission factor unique identifier

The emission factor name

epa
exiobase
ecoinvent
beis
lune

Source version of the emission factor.

Publication year of the emission factor

Unit, t for tonne, kg for kilogram, g for gram

g
kg
t

Denominator unit of the emission factor

Date of creation of the emission factor

The name of the region that the emission factor covers.

A category that describes the emission factor.

Detailed information about the gas emissions.

This property is always set as of March 2024.

Pattern: ^[0-9]+(\.[0-9]+)?$

Amount of CO₂ equivalent gas. All gas emissions are accounted here.

Pattern: ^[0-9]+(\.[0-9]+)?$

Amount of CO₂ gas.

Pattern: ^[0-9]+(\.[0-9]+)?$

Amount of methane gas.

Pattern: ^[0-9]+(\.[0-9]+)?$

Amount of nitrous oxide gas.

Pattern: ^[0-9]+(\.[0-9]+)?$

Amount of other greenhouse gases.

Parameters for estimating emissions for passenger transportation

Number of passengers the calculation should be applied to.

An array representing all passenger travel legs.

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.

Maps a bundle id to an allocation ratio

The bundle's unique identifier

Selects to which precision to truncate quantities specific to carbon offsetting.

g
kg
t

A name 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:

  1. Clients can safely retry estimate requests without accidentally performing the same operation multiple times.
  2. Clients can use idempotency_key to reconcile estimates with entities on their system.
Errors
This API operation can return the following errors:
HTTP status codeError code
401
404
429
503
service_unavailable