By transaction details
Create an emission estimate for a single transaction
POST
to /v1/estimates/transactions
Request body
namestring
A name to reference this calculation.
valueobjectrequired
Specify the monetary value of the transaction, excluding shipping and taxes.
valuestringrequired
Pattern: ^[0-9]+(\.[0-9]+)?$
Specify the monetary value in the currency defined by the currency_code
property in the request. If no currency_code
is provided, the currency will default to that of the associated account.
currencystringrequired
ISO 4217 3 character currency code.
Note: Lune supports most but not all currency codes.
AED
AFN
ALL
AMD
ANG
merchantoneOfrequired
The merchant from whom the goods or services were purchased.
dietstring
Specify individual dietary preferences to improve estimates for food-related purchases.
high_meat_eater
medium_meat_eater
low_meat_eater
fish_eater
vegetarian
bundle_selectionarray
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.
object
Maps a bundle id to an allocation ratio
bundle_idstringrequired
The bundle's unique identifier
percentageoneOf
quantity_truncstring
Selects to which precision to truncate quantities specific to carbon offsetting.
g
kg
t
metadataobject
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.
region_fallbackstring
Specify how geographical constraints (e.g., country_code
, region
) should be handled when matching emission factors, and if fallbacks should be used.
Defaults to never
, meaning only emission factors that exactly match the specified geography are used. No fallbacks are applied.
never
always
idempotency_keystring
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.
is_transactionboolean
Use to distinguish confirmed transactions from quotes or forecasts. Defaults to false
when omitted. Can be updated at any point.
When true
, the estimate represents an actual transaction for purchased goods and services and will be included in Lune analytics.
transaction_processed_atstring (date-time)
Provide the date and time that the transaction is processed, as an RFC 3339 timestamp.
If omitted, the property defaults to the time of request. Used only for analytics, with no impact on the actual estimate calculation.
client_accountoneOf
Perform the estimate request on behalf of a client account.
The client account is identfied by the handle
or idempotency_key
.
The client account is created if it does not exist.
For existing client accounts, if both handle
and idempotency_key
are provided,
they must be consistent with the existing client account. Other properties are ignored.
Response
massobjectrequired
amountstringrequired
Pattern: ^[0-9]+(\.[0-9]+)?$
unitstringrequired
Unit, t
for tonne, kg
for kilogram, g
for gram, mg
for milligram
mg
g
kg
t
metadataobject
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.
idempotency_keystring
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.
idstringrequired
The emission calculation unique identifier
quoteoneOfrequired
search_term_matchstringrequirednullable
The most accurate term matching the search.
The emission factor for this term is used to compute the emission estimate.
search_term_match_scorenumber (float)requirednullable
Populated if semantic search was used to find a match to the provided search term or category Indicates confidence in the match from 0 - 2, 0 being most confident.
semantic_matching_modelstringrequirednullable
The text embedding model used to support semantic search
emission_factorobjectrequirednullable
This property is null
for any estimate created before 01/03/2024
idstringrequired
The emission factor unique identifier
namestringrequired
The emission factor name
sourcestringrequired
epa
exiobase
ecoinvent
beis
lune
source_versionstringrequired
Source version of the emission factor.
publication_yearnumberrequired
Publication year of the emission factor
numerator_unitstringrequired
Unit, t
for tonne, kg
for kilogram, g
for gram
g
kg
t
denominator_unitoneOfrequired
Denominator unit of the emission factor
created_atstring (date-time)required
Date of creation of the emission factor
regionstringrequired
The name of the region that the emission factor covers.
categorystringrequirednullable
A category that describes the emission factor.
gas_emissionsobjectrequirednullable
Detailed information about the gas emissions.
This property is always set as of March 2024.
co2estringrequired
Pattern: ^[0-9]+(\.[0-9]+)?$
Amount of CO₂ equivalent gas. All gas emissions are accounted here.
co2string
Pattern: ^[0-9]+(\.[0-9]+)?$
Amount of CO₂ gas.
methanestring
Pattern: ^[0-9]+(\.[0-9]+)?$
Amount of methane gas.
nitrous_oxidestring
Pattern: ^[0-9]+(\.[0-9]+)?$
Amount of nitrous oxide gas.
otherstring
Pattern: ^[0-9]+(\.[0-9]+)?$
Amount of CO₂ equivalent gas contributed by other greenhouse gases.
wtw_breakdownobject
sourcestringrequired
direct_from_source
inferred_from_fuel
global_fuel_mix_inferred
wtt_co2estringrequired
Pattern: ^[0-9]+(\.[0-9]+)?$
Amount of CO₂ equivalent for the WTT (Well-To-Tank) stage. All gas emissions are accounted here.
ttw_co2estringrequired
Pattern: ^[0-9]+(\.[0-9]+)?$
Amount of CO₂ equivalent for the TTW (Tank-To-Wheel) stage. All gas emissions are accounted here.
diet_factorstringrequirednullable
Pattern: ^[0-9]+(\.[0-9]+)?$
exchange_ratestringrequirednullable
Pattern: ^[0-9]+(\.[0-9]+)?$
exchange_rate_datestring (date)requirednullable
requestobjectrequired
Properties for estimating emissions associated with purchasing goods or services.
namestring
A name to reference this calculation.
valueobjectrequired
Specify the monetary value of the transaction, excluding shipping and taxes.
valuestringrequired
Pattern: ^[0-9]+(\.[0-9]+)?$
Specify the monetary value in the currency defined by the currency_code
property in the request. If no currency_code
is provided, the currency will default to that of the associated account.
currencystringrequired
ISO 4217 3 character currency code.
Note: Lune supports most but not all currency codes.
AED
AFN
ALL
AMD
ANG
merchantoneOfrequired
The merchant from whom the goods or services were purchased.
dietstring
Specify individual dietary preferences to improve estimates for food-related purchases.
high_meat_eater
medium_meat_eater
low_meat_eater
fish_eater
vegetarian
bundle_selectionarray
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.
object
Maps a bundle id to an allocation ratio
bundle_idstringrequired
The bundle's unique identifier
percentageoneOf
quantity_truncstring
Selects to which precision to truncate quantities specific to carbon offsetting.
g
kg
t
metadataobject
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.
region_fallbackstring
Specify how geographical constraints (e.g., country_code
, region
) should be handled when matching emission factors, and if fallbacks should be used.
Defaults to never
, meaning only emission factors that exactly match the specified geography are used. No fallbacks are applied.
never
always
idempotency_keystring
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.
is_transactionboolean
Use to distinguish confirmed transactions from quotes or forecasts. Defaults to false
when omitted. Can be updated at any point.
When true
, the estimate represents an actual transaction for purchased goods and services and will be included in Lune analytics.
transaction_processed_atstring (date-time)
Provide the date and time that the transaction is processed, as an RFC 3339 timestamp.
If omitted, the property defaults to the time of request. Used only for analytics, with no impact on the actual estimate calculation.
external_estimate_urlstring (https-url)requirednullable
An external accessible URL linking to a detailed page that provides complete information about the estimate.
is_transactionbooleanrequirednullable
transaction_processed_atstring (date-time)requirednullable
Errors
This API operation can return the following errors:204
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
Get a transaction emission estimate
GET
to /v1/estimates/transactions/{id}
Query parameters
idstringrequired
The estimate's unique identifier
Response
massobjectrequired
amountstringrequired
Pattern: ^[0-9]+(\.[0-9]+)?$
unitstringrequired
Unit, t
for tonne, kg
for kilogram, g
for gram, mg
for milligram
mg
g
kg
t
metadataobject
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.
idempotency_keystring
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.
idstringrequired
The emission calculation unique identifier
quoteoneOfrequired
search_term_matchstringrequirednullable
The most accurate term matching the search.
The emission factor for this term is used to compute the emission estimate.
search_term_match_scorenumber (float)requirednullable
Populated if semantic search was used to find a match to the provided search term or category Indicates confidence in the match from 0 - 2, 0 being most confident.
semantic_matching_modelstringrequirednullable
The text embedding model used to support semantic search
emission_factorobjectrequirednullable
This property is null
for any estimate created before 01/03/2024
idstringrequired
The emission factor unique identifier
namestringrequired
The emission factor name
sourcestringrequired
epa
exiobase
ecoinvent
beis
lune
source_versionstringrequired
Source version of the emission factor.
publication_yearnumberrequired
Publication year of the emission factor
numerator_unitstringrequired
Unit, t
for tonne, kg
for kilogram, g
for gram
g
kg
t
denominator_unitoneOfrequired
Denominator unit of the emission factor
created_atstring (date-time)required
Date of creation of the emission factor
regionstringrequired
The name of the region that the emission factor covers.
categorystringrequirednullable
A category that describes the emission factor.
gas_emissionsobjectrequirednullable
Detailed information about the gas emissions.
This property is always set as of March 2024.
co2estringrequired
Pattern: ^[0-9]+(\.[0-9]+)?$
Amount of CO₂ equivalent gas. All gas emissions are accounted here.
co2string
Pattern: ^[0-9]+(\.[0-9]+)?$
Amount of CO₂ gas.
methanestring
Pattern: ^[0-9]+(\.[0-9]+)?$
Amount of methane gas.
nitrous_oxidestring
Pattern: ^[0-9]+(\.[0-9]+)?$
Amount of nitrous oxide gas.
otherstring
Pattern: ^[0-9]+(\.[0-9]+)?$
Amount of CO₂ equivalent gas contributed by other greenhouse gases.
wtw_breakdownobject
sourcestringrequired
direct_from_source
inferred_from_fuel
global_fuel_mix_inferred
wtt_co2estringrequired
Pattern: ^[0-9]+(\.[0-9]+)?$
Amount of CO₂ equivalent for the WTT (Well-To-Tank) stage. All gas emissions are accounted here.
ttw_co2estringrequired
Pattern: ^[0-9]+(\.[0-9]+)?$
Amount of CO₂ equivalent for the TTW (Tank-To-Wheel) stage. All gas emissions are accounted here.
diet_factorstringrequirednullable
Pattern: ^[0-9]+(\.[0-9]+)?$
exchange_ratestringrequirednullable
Pattern: ^[0-9]+(\.[0-9]+)?$
exchange_rate_datestring (date)requirednullable
requestobjectrequired
Properties for estimating emissions associated with purchasing goods or services.
namestring
A name to reference this calculation.
valueobjectrequired
Specify the monetary value of the transaction, excluding shipping and taxes.
valuestringrequired
Pattern: ^[0-9]+(\.[0-9]+)?$
Specify the monetary value in the currency defined by the currency_code
property in the request. If no currency_code
is provided, the currency will default to that of the associated account.
currencystringrequired
ISO 4217 3 character currency code.
Note: Lune supports most but not all currency codes.
AED
AFN
ALL
AMD
ANG
merchantoneOfrequired
The merchant from whom the goods or services were purchased.
dietstring
Specify individual dietary preferences to improve estimates for food-related purchases.
high_meat_eater
medium_meat_eater
low_meat_eater
fish_eater
vegetarian
bundle_selectionarray
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.
object
Maps a bundle id to an allocation ratio
bundle_idstringrequired
The bundle's unique identifier
percentageoneOf
quantity_truncstring
Selects to which precision to truncate quantities specific to carbon offsetting.
g
kg
t
metadataobject
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.
region_fallbackstring
Specify how geographical constraints (e.g., country_code
, region
) should be handled when matching emission factors, and if fallbacks should be used.
Defaults to never
, meaning only emission factors that exactly match the specified geography are used. No fallbacks are applied.
never
always
idempotency_keystring
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.
is_transactionboolean
Use to distinguish confirmed transactions from quotes or forecasts. Defaults to false
when omitted. Can be updated at any point.
When true
, the estimate represents an actual transaction for purchased goods and services and will be included in Lune analytics.
transaction_processed_atstring (date-time)
Provide the date and time that the transaction is processed, as an RFC 3339 timestamp.
If omitted, the property defaults to the time of request. Used only for analytics, with no impact on the actual estimate calculation.
external_estimate_urlstring (https-url)requirednullable
An external accessible URL linking to a detailed page that provides complete information about the estimate.
is_transactionbooleanrequirednullable
transaction_processed_atstring (date-time)requirednullable
Errors
This API operation can return the following errors:401
404
429
503
service_unavailable
Update a transaction emission estimate
PUT
to /v1/estimates/transactions/{id}
Query parameters
idstringrequired
The estimate's unique identifier
Request body
Properties for estimating emissions associated with purchasing goods or services.
namestring
A name to reference this calculation.
valueobjectrequired
Specify the monetary value of the transaction, excluding shipping and taxes.
valuestringrequired
Pattern: ^[0-9]+(\.[0-9]+)?$
Specify the monetary value in the currency defined by the currency_code
property in the request. If no currency_code
is provided, the currency will default to that of the associated account.
currencystringrequired
ISO 4217 3 character currency code.
Note: Lune supports most but not all currency codes.
AED
AFN
ALL
AMD
ANG
merchantoneOfrequired
The merchant from whom the goods or services were purchased.
dietstring
Specify individual dietary preferences to improve estimates for food-related purchases.
high_meat_eater
medium_meat_eater
low_meat_eater
fish_eater
vegetarian
bundle_selectionarray
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.
object
Maps a bundle id to an allocation ratio
bundle_idstringrequired
The bundle's unique identifier
percentageoneOf
quantity_truncstring
Selects to which precision to truncate quantities specific to carbon offsetting.
g
kg
t
metadataobject
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.
region_fallbackstring
Specify how geographical constraints (e.g., country_code
, region
) should be handled when matching emission factors, and if fallbacks should be used.
Defaults to never
, meaning only emission factors that exactly match the specified geography are used. No fallbacks are applied.
never
always
idempotency_keystring
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.
is_transactionboolean
Use to distinguish confirmed transactions from quotes or forecasts. Defaults to false
when omitted. Can be updated at any point.
When true
, the estimate represents an actual transaction for purchased goods and services and will be included in Lune analytics.
transaction_processed_atstring (date-time)
Provide the date and time that the transaction is processed, as an RFC 3339 timestamp.
If omitted, the property defaults to the time of request. Used only for analytics, with no impact on the actual estimate calculation.
Response
massobjectrequired
amountstringrequired
Pattern: ^[0-9]+(\.[0-9]+)?$
unitstringrequired
Unit, t
for tonne, kg
for kilogram, g
for gram, mg
for milligram
mg
g
kg
t
metadataobject
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.
idempotency_keystring
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.
idstringrequired
The emission calculation unique identifier
quoteoneOfrequired
search_term_matchstringrequirednullable
The most accurate term matching the search.
The emission factor for this term is used to compute the emission estimate.
search_term_match_scorenumber (float)requirednullable
Populated if semantic search was used to find a match to the provided search term or category Indicates confidence in the match from 0 - 2, 0 being most confident.
semantic_matching_modelstringrequirednullable
The text embedding model used to support semantic search
emission_factorobjectrequirednullable
This property is null
for any estimate created before 01/03/2024
idstringrequired
The emission factor unique identifier
namestringrequired
The emission factor name
sourcestringrequired
epa
exiobase
ecoinvent
beis
lune
source_versionstringrequired
Source version of the emission factor.
publication_yearnumberrequired
Publication year of the emission factor
numerator_unitstringrequired
Unit, t
for tonne, kg
for kilogram, g
for gram
g
kg
t
denominator_unitoneOfrequired
Denominator unit of the emission factor
created_atstring (date-time)required
Date of creation of the emission factor
regionstringrequired
The name of the region that the emission factor covers.
categorystringrequirednullable
A category that describes the emission factor.
gas_emissionsobjectrequirednullable
Detailed information about the gas emissions.
This property is always set as of March 2024.
co2estringrequired
Pattern: ^[0-9]+(\.[0-9]+)?$
Amount of CO₂ equivalent gas. All gas emissions are accounted here.
co2string
Pattern: ^[0-9]+(\.[0-9]+)?$
Amount of CO₂ gas.
methanestring
Pattern: ^[0-9]+(\.[0-9]+)?$
Amount of methane gas.
nitrous_oxidestring
Pattern: ^[0-9]+(\.[0-9]+)?$
Amount of nitrous oxide gas.
otherstring
Pattern: ^[0-9]+(\.[0-9]+)?$
Amount of CO₂ equivalent gas contributed by other greenhouse gases.
wtw_breakdownobject
sourcestringrequired
direct_from_source
inferred_from_fuel
global_fuel_mix_inferred
wtt_co2estringrequired
Pattern: ^[0-9]+(\.[0-9]+)?$
Amount of CO₂ equivalent for the WTT (Well-To-Tank) stage. All gas emissions are accounted here.
ttw_co2estringrequired
Pattern: ^[0-9]+(\.[0-9]+)?$
Amount of CO₂ equivalent for the TTW (Tank-To-Wheel) stage. All gas emissions are accounted here.
diet_factorstringrequirednullable
Pattern: ^[0-9]+(\.[0-9]+)?$
exchange_ratestringrequirednullable
Pattern: ^[0-9]+(\.[0-9]+)?$
exchange_rate_datestring (date)requirednullable
requestobjectrequired
Properties for estimating emissions associated with purchasing goods or services.
namestring
A name to reference this calculation.
valueobjectrequired
Specify the monetary value of the transaction, excluding shipping and taxes.
valuestringrequired
Pattern: ^[0-9]+(\.[0-9]+)?$
Specify the monetary value in the currency defined by the currency_code
property in the request. If no currency_code
is provided, the currency will default to that of the associated account.
currencystringrequired
ISO 4217 3 character currency code.
Note: Lune supports most but not all currency codes.
AED
AFN
ALL
AMD
ANG
merchantoneOfrequired
The merchant from whom the goods or services were purchased.
dietstring
Specify individual dietary preferences to improve estimates for food-related purchases.
high_meat_eater
medium_meat_eater
low_meat_eater
fish_eater
vegetarian
bundle_selectionarray
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.
object
Maps a bundle id to an allocation ratio
bundle_idstringrequired
The bundle's unique identifier
percentageoneOf
quantity_truncstring
Selects to which precision to truncate quantities specific to carbon offsetting.
g
kg
t
metadataobject
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.
region_fallbackstring
Specify how geographical constraints (e.g., country_code
, region
) should be handled when matching emission factors, and if fallbacks should be used.
Defaults to never
, meaning only emission factors that exactly match the specified geography are used. No fallbacks are applied.
never
always
idempotency_keystring
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.
is_transactionboolean
Use to distinguish confirmed transactions from quotes or forecasts. Defaults to false
when omitted. Can be updated at any point.
When true
, the estimate represents an actual transaction for purchased goods and services and will be included in Lune analytics.
transaction_processed_atstring (date-time)
Provide the date and time that the transaction is processed, as an RFC 3339 timestamp.
If omitted, the property defaults to the time of request. Used only for analytics, with no impact on the actual estimate calculation.
external_estimate_urlstring (https-url)requirednullable
An external accessible URL linking to a detailed page that provides complete information about the estimate.
is_transactionbooleanrequirednullable
transaction_processed_atstring (date-time)requirednullable
Errors
This API operation can return the following errors:204
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
Update a transaction emission estimate's annotations
PATCH
to /v1/estimates/transactions/{id}/annotations
This method allows updating a selection of estimate annotations without going through a full estimate update (with all the necessary inputs).Only properties included in the input data are updated.Query parameters
idstringrequired
The estimate's unique identifier
Request body
is_transactionboolean
Use to distinguish confirmed transactions from quotes or forecasts. Defaults to false
when omitted. Can be updated at any point.
When true
, the estimate represents an actual transaction for purchased goods and services and will be included in Lune analytics.
transaction_processed_atstring (date-time)
Provide the date and time that the transaction is processed, as an RFC 3339 timestamp.
If omitted, the property defaults to the time of request. Used only for analytics, with no impact on the actual estimate calculation.
metadataobject
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.
idempotency_keystring
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.
Response
massobjectrequired
amountstringrequired
Pattern: ^[0-9]+(\.[0-9]+)?$
unitstringrequired
Unit, t
for tonne, kg
for kilogram, g
for gram, mg
for milligram
mg
g
kg
t
metadataobject
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.
idempotency_keystring
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.
idstringrequired
The emission calculation unique identifier
quoteoneOfrequired
search_term_matchstringrequirednullable
The most accurate term matching the search.
The emission factor for this term is used to compute the emission estimate.
search_term_match_scorenumber (float)requirednullable
Populated if semantic search was used to find a match to the provided search term or category Indicates confidence in the match from 0 - 2, 0 being most confident.
semantic_matching_modelstringrequirednullable
The text embedding model used to support semantic search
emission_factorobjectrequirednullable
This property is null
for any estimate created before 01/03/2024
idstringrequired
The emission factor unique identifier
namestringrequired
The emission factor name
sourcestringrequired
epa
exiobase
ecoinvent
beis
lune
source_versionstringrequired
Source version of the emission factor.
publication_yearnumberrequired
Publication year of the emission factor
numerator_unitstringrequired
Unit, t
for tonne, kg
for kilogram, g
for gram
g
kg
t
denominator_unitoneOfrequired
Denominator unit of the emission factor
created_atstring (date-time)required
Date of creation of the emission factor
regionstringrequired
The name of the region that the emission factor covers.
categorystringrequirednullable
A category that describes the emission factor.
gas_emissionsobjectrequirednullable
Detailed information about the gas emissions.
This property is always set as of March 2024.
co2estringrequired
Pattern: ^[0-9]+(\.[0-9]+)?$
Amount of CO₂ equivalent gas. All gas emissions are accounted here.
co2string
Pattern: ^[0-9]+(\.[0-9]+)?$
Amount of CO₂ gas.
methanestring
Pattern: ^[0-9]+(\.[0-9]+)?$
Amount of methane gas.
nitrous_oxidestring
Pattern: ^[0-9]+(\.[0-9]+)?$
Amount of nitrous oxide gas.
otherstring
Pattern: ^[0-9]+(\.[0-9]+)?$
Amount of CO₂ equivalent gas contributed by other greenhouse gases.
wtw_breakdownobject
sourcestringrequired
direct_from_source
inferred_from_fuel
global_fuel_mix_inferred
wtt_co2estringrequired
Pattern: ^[0-9]+(\.[0-9]+)?$
Amount of CO₂ equivalent for the WTT (Well-To-Tank) stage. All gas emissions are accounted here.
ttw_co2estringrequired
Pattern: ^[0-9]+(\.[0-9]+)?$
Amount of CO₂ equivalent for the TTW (Tank-To-Wheel) stage. All gas emissions are accounted here.
diet_factorstringrequirednullable
Pattern: ^[0-9]+(\.[0-9]+)?$
exchange_ratestringrequirednullable
Pattern: ^[0-9]+(\.[0-9]+)?$
exchange_rate_datestring (date)requirednullable
requestobjectrequired
Properties for estimating emissions associated with purchasing goods or services.
namestring
A name to reference this calculation.
valueobjectrequired
Specify the monetary value of the transaction, excluding shipping and taxes.
valuestringrequired
Pattern: ^[0-9]+(\.[0-9]+)?$
Specify the monetary value in the currency defined by the currency_code
property in the request. If no currency_code
is provided, the currency will default to that of the associated account.
currencystringrequired
ISO 4217 3 character currency code.
Note: Lune supports most but not all currency codes.
AED
AFN
ALL
AMD
ANG
merchantoneOfrequired
The merchant from whom the goods or services were purchased.
dietstring
Specify individual dietary preferences to improve estimates for food-related purchases.
high_meat_eater
medium_meat_eater
low_meat_eater
fish_eater
vegetarian
bundle_selectionarray
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.
object
Maps a bundle id to an allocation ratio
bundle_idstringrequired
The bundle's unique identifier
percentageoneOf
quantity_truncstring
Selects to which precision to truncate quantities specific to carbon offsetting.
g
kg
t
metadataobject
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.
region_fallbackstring
Specify how geographical constraints (e.g., country_code
, region
) should be handled when matching emission factors, and if fallbacks should be used.
Defaults to never
, meaning only emission factors that exactly match the specified geography are used. No fallbacks are applied.
never
always
idempotency_keystring
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.
is_transactionboolean
Use to distinguish confirmed transactions from quotes or forecasts. Defaults to false
when omitted. Can be updated at any point.
When true
, the estimate represents an actual transaction for purchased goods and services and will be included in Lune analytics.
transaction_processed_atstring (date-time)
Provide the date and time that the transaction is processed, as an RFC 3339 timestamp.
If omitted, the property defaults to the time of request. Used only for analytics, with no impact on the actual estimate calculation.
external_estimate_urlstring (https-url)requirednullable
An external accessible URL linking to a detailed page that provides complete information about the estimate.
is_transactionbooleanrequirednullable
transaction_processed_atstring (date-time)requirednullable
Errors
This API operation can return the following errors: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 transaction emission estimate by idempotency key
GET
to /v1/estimates/transactions/by-idempotency-key/{idempotency_key}
Query parameters
idempotency_keystringrequired
The order's idempotency key.
Idempotency keys must be unique per account.
Response
massobjectrequired
amountstringrequired
Pattern: ^[0-9]+(\.[0-9]+)?$
unitstringrequired
Unit, t
for tonne, kg
for kilogram, g
for gram, mg
for milligram
mg
g
kg
t
metadataobject
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.
idempotency_keystring
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.
idstringrequired
The emission calculation unique identifier
quoteoneOfrequired
search_term_matchstringrequirednullable
The most accurate term matching the search.
The emission factor for this term is used to compute the emission estimate.
search_term_match_scorenumber (float)requirednullable
Populated if semantic search was used to find a match to the provided search term or category Indicates confidence in the match from 0 - 2, 0 being most confident.
semantic_matching_modelstringrequirednullable
The text embedding model used to support semantic search
emission_factorobjectrequirednullable
This property is null
for any estimate created before 01/03/2024
idstringrequired
The emission factor unique identifier
namestringrequired
The emission factor name
sourcestringrequired
epa
exiobase
ecoinvent
beis
lune
source_versionstringrequired
Source version of the emission factor.
publication_yearnumberrequired
Publication year of the emission factor
numerator_unitstringrequired
Unit, t
for tonne, kg
for kilogram, g
for gram
g
kg
t
denominator_unitoneOfrequired
Denominator unit of the emission factor
created_atstring (date-time)required
Date of creation of the emission factor
regionstringrequired
The name of the region that the emission factor covers.
categorystringrequirednullable
A category that describes the emission factor.
gas_emissionsobjectrequirednullable
Detailed information about the gas emissions.
This property is always set as of March 2024.
co2estringrequired
Pattern: ^[0-9]+(\.[0-9]+)?$
Amount of CO₂ equivalent gas. All gas emissions are accounted here.
co2string
Pattern: ^[0-9]+(\.[0-9]+)?$
Amount of CO₂ gas.
methanestring
Pattern: ^[0-9]+(\.[0-9]+)?$
Amount of methane gas.
nitrous_oxidestring
Pattern: ^[0-9]+(\.[0-9]+)?$
Amount of nitrous oxide gas.
otherstring
Pattern: ^[0-9]+(\.[0-9]+)?$
Amount of CO₂ equivalent gas contributed by other greenhouse gases.
wtw_breakdownobject
sourcestringrequired
direct_from_source
inferred_from_fuel
global_fuel_mix_inferred
wtt_co2estringrequired
Pattern: ^[0-9]+(\.[0-9]+)?$
Amount of CO₂ equivalent for the WTT (Well-To-Tank) stage. All gas emissions are accounted here.
ttw_co2estringrequired
Pattern: ^[0-9]+(\.[0-9]+)?$
Amount of CO₂ equivalent for the TTW (Tank-To-Wheel) stage. All gas emissions are accounted here.
diet_factorstringrequirednullable
Pattern: ^[0-9]+(\.[0-9]+)?$
exchange_ratestringrequirednullable
Pattern: ^[0-9]+(\.[0-9]+)?$
exchange_rate_datestring (date)requirednullable
requestobjectrequired
Properties for estimating emissions associated with purchasing goods or services.
namestring
A name to reference this calculation.
valueobjectrequired
Specify the monetary value of the transaction, excluding shipping and taxes.
valuestringrequired
Pattern: ^[0-9]+(\.[0-9]+)?$
Specify the monetary value in the currency defined by the currency_code
property in the request. If no currency_code
is provided, the currency will default to that of the associated account.
currencystringrequired
ISO 4217 3 character currency code.
Note: Lune supports most but not all currency codes.
AED
AFN
ALL
AMD
ANG
merchantoneOfrequired
The merchant from whom the goods or services were purchased.
dietstring
Specify individual dietary preferences to improve estimates for food-related purchases.
high_meat_eater
medium_meat_eater
low_meat_eater
fish_eater
vegetarian
bundle_selectionarray
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.
object
Maps a bundle id to an allocation ratio
bundle_idstringrequired
The bundle's unique identifier
percentageoneOf
quantity_truncstring
Selects to which precision to truncate quantities specific to carbon offsetting.
g
kg
t
metadataobject
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.
region_fallbackstring
Specify how geographical constraints (e.g., country_code
, region
) should be handled when matching emission factors, and if fallbacks should be used.
Defaults to never
, meaning only emission factors that exactly match the specified geography are used. No fallbacks are applied.
never
always
idempotency_keystring
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.
is_transactionboolean
Use to distinguish confirmed transactions from quotes or forecasts. Defaults to false
when omitted. Can be updated at any point.
When true
, the estimate represents an actual transaction for purchased goods and services and will be included in Lune analytics.
transaction_processed_atstring (date-time)
Provide the date and time that the transaction is processed, as an RFC 3339 timestamp.
If omitted, the property defaults to the time of request. Used only for analytics, with no impact on the actual estimate calculation.
external_estimate_urlstring (https-url)requirednullable
An external accessible URL linking to a detailed page that provides complete information about the estimate.
is_transactionbooleanrequirednullable
transaction_processed_atstring (date-time)requirednullable
Errors
This API operation can return the following errors:401
404
429
503
service_unavailable
Create emission estimates for multiple transactions in one request
POST
to /v1/estimates/transactions/batch
Each estimate is processed individually, ensuring a failed estimate won’t impact others in the request. The response contains estimates or errors in the same order as the request.Consider using an idempotency_key
to safely retry the request without risking duplicate estimates.Request body
array
An array of transaction estimate requests.
object
An array of transaction estimate requests.
Properties for estimating emissions associated with purchasing goods or services.
namestring
A name to reference this calculation.
valueobjectrequired
Specify the monetary value of the transaction, excluding shipping and taxes.
valuestringrequired
Pattern: ^[0-9]+(\.[0-9]+)?$
Specify the monetary value in the currency defined by the currency_code
property in the request. If no currency_code
is provided, the currency will default to that of the associated account.
currencystringrequired
ISO 4217 3 character currency code.
Note: Lune supports most but not all currency codes.
AED
AFN
ALL
AMD
ANG
merchantoneOfrequired
The merchant from whom the goods or services were purchased.
dietstring
Specify individual dietary preferences to improve estimates for food-related purchases.
high_meat_eater
medium_meat_eater
low_meat_eater
fish_eater
vegetarian
bundle_selectionarray
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.
object
Maps a bundle id to an allocation ratio
bundle_idstringrequired
The bundle's unique identifier
percentageoneOf
quantity_truncstring
Selects to which precision to truncate quantities specific to carbon offsetting.
g
kg
t
metadataobject
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.
region_fallbackstring
Specify how geographical constraints (e.g., country_code
, region
) should be handled when matching emission factors, and if fallbacks should be used.
Defaults to never
, meaning only emission factors that exactly match the specified geography are used. No fallbacks are applied.
never
always
idempotency_keystring
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.
is_transactionboolean
Use to distinguish confirmed transactions from quotes or forecasts. Defaults to false
when omitted. Can be updated at any point.
When true
, the estimate represents an actual transaction for purchased goods and services and will be included in Lune analytics.
transaction_processed_atstring (date-time)
Provide the date and time that the transaction is processed, as an RFC 3339 timestamp.
If omitted, the property defaults to the time of request. Used only for analytics, with no impact on the actual estimate calculation.
Response
array
An array representing multiple transaction emission estimates.
Returned in the same order as the request.
oneOf
An array representing multiple transaction emission estimates.
Returned in the same order as the request.
Errors
This API operation can return the following errors: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
Create a multi-match transaction emission estimate
POST
to /v1/estimates/transactions/multi-match
Obtain multiple emission estimates for a single transaction by applying different emission factors in one request.The transaction estimate endpoint selects the emission factor with highest confidence. While this is typically ideal, sometimes you may prefer a different emission factor choice. The multi-match endpoint calculates estimates using up to five alternative emission factors, ordered by confidence score, giving you options to select from.Each estimate counts towards your plan's emission estimate allowance.Query parameters
limitstringrequired
The number of matches to return.
Request body
namestring
A name to reference this calculation.
valueobjectrequired
Specify the monetary value of the transaction, excluding shipping and taxes.
valuestringrequired
Pattern: ^[0-9]+(\.[0-9]+)?$
Specify the monetary value in the currency defined by the currency_code
property in the request. If no currency_code
is provided, the currency will default to that of the associated account.
currencystringrequired
ISO 4217 3 character currency code.
Note: Lune supports most but not all currency codes.
AED
AFN
ALL
AMD
ANG
merchantoneOfrequired
The merchant from whom the goods or services were purchased.
dietstring
Specify individual dietary preferences to improve estimates for food-related purchases.
high_meat_eater
medium_meat_eater
low_meat_eater
fish_eater
vegetarian
bundle_selectionarray
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.
object
Maps a bundle id to an allocation ratio
bundle_idstringrequired
The bundle's unique identifier
percentageoneOf
quantity_truncstring
Selects to which precision to truncate quantities specific to carbon offsetting.
g
kg
t
metadataobject
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.
region_fallbackstring
Specify how geographical constraints (e.g., country_code
, region
) should be handled when matching emission factors, and if fallbacks should be used.
Defaults to never
, meaning only emission factors that exactly match the specified geography are used. No fallbacks are applied.
never
always
Response
The estimates for each emission factor in the order from highest to lowest confidence.
Each estimate returned in the array is a standalone transaction estimate with its own id.
The array may be empty if there are no emission factors matching the input data with the required confidence level.
estimatesarray
object
massobjectrequired
amountstringrequired
Pattern: ^[0-9]+(\.[0-9]+)?$
unitstringrequired
Unit, t
for tonne, kg
for kilogram, g
for gram, mg
for milligram
mg
g
kg
t
metadataobject
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.
idempotency_keystring
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.
idstringrequired
The emission calculation unique identifier
quoteoneOfrequired
search_term_matchstringrequirednullable
The most accurate term matching the search.
The emission factor for this term is used to compute the emission estimate.
search_term_match_scorenumber (float)requirednullable
Populated if semantic search was used to find a match to the provided search term or category Indicates confidence in the match from 0 - 2, 0 being most confident.
semantic_matching_modelstringrequirednullable
The text embedding model used to support semantic search
emission_factorobjectrequirednullable
This property is null
for any estimate created before 01/03/2024
idstringrequired
The emission factor unique identifier
namestringrequired
The emission factor name
sourcestringrequired
epa
exiobase
ecoinvent
beis
lune
source_versionstringrequired
Source version of the emission factor.
publication_yearnumberrequired
Publication year of the emission factor
numerator_unitstringrequired
Unit, t
for tonne, kg
for kilogram, g
for gram
g
kg
t
denominator_unitoneOfrequired
Denominator unit of the emission factor
created_atstring (date-time)required
Date of creation of the emission factor
regionstringrequired
The name of the region that the emission factor covers.
categorystringrequirednullable
A category that describes the emission factor.
gas_emissionsobjectrequirednullable
Detailed information about the gas emissions.
This property is always set as of March 2024.
co2estringrequired
Pattern: ^[0-9]+(\.[0-9]+)?$
Amount of CO₂ equivalent gas. All gas emissions are accounted here.
co2string
Pattern: ^[0-9]+(\.[0-9]+)?$
Amount of CO₂ gas.
methanestring
Pattern: ^[0-9]+(\.[0-9]+)?$
Amount of methane gas.
nitrous_oxidestring
Pattern: ^[0-9]+(\.[0-9]+)?$
Amount of nitrous oxide gas.
otherstring
Pattern: ^[0-9]+(\.[0-9]+)?$
Amount of CO₂ equivalent gas contributed by other greenhouse gases.
wtw_breakdownobject
sourcestringrequired
direct_from_source
inferred_from_fuel
global_fuel_mix_inferred
wtt_co2estringrequired
Pattern: ^[0-9]+(\.[0-9]+)?$
Amount of CO₂ equivalent for the WTT (Well-To-Tank) stage. All gas emissions are accounted here.
ttw_co2estringrequired
Pattern: ^[0-9]+(\.[0-9]+)?$
Amount of CO₂ equivalent for the TTW (Tank-To-Wheel) stage. All gas emissions are accounted here.
diet_factorstringrequirednullable
Pattern: ^[0-9]+(\.[0-9]+)?$
exchange_ratestringrequirednullable
Pattern: ^[0-9]+(\.[0-9]+)?$
exchange_rate_datestring (date)requirednullable
requestobjectrequired
Properties for estimating emissions associated with purchasing goods or services.
namestring
A name to reference this calculation.
valueobjectrequired
Specify the monetary value of the transaction, excluding shipping and taxes.
valuestringrequired
Pattern: ^[0-9]+(\.[0-9]+)?$
Specify the monetary value in the currency defined by the currency_code
property in the request. If no currency_code
is provided, the currency will default to that of the associated account.
currencystringrequired
ISO 4217 3 character currency code.
Note: Lune supports most but not all currency codes.
AED
AFN
ALL
AMD
ANG
merchantoneOfrequired
The merchant from whom the goods or services were purchased.
dietstring
Specify individual dietary preferences to improve estimates for food-related purchases.
high_meat_eater
medium_meat_eater
low_meat_eater
fish_eater
vegetarian
bundle_selectionarray
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.
object
Maps a bundle id to an allocation ratio
bundle_idstringrequired
The bundle's unique identifier
percentageoneOf
quantity_truncstring
Selects to which precision to truncate quantities specific to carbon offsetting.
g
kg
t
metadataobject
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.
region_fallbackstring
Specify how geographical constraints (e.g., country_code
, region
) should be handled when matching emission factors, and if fallbacks should be used.
Defaults to never
, meaning only emission factors that exactly match the specified geography are used. No fallbacks are applied.
never
always
idempotency_keystring
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.
is_transactionboolean
Use to distinguish confirmed transactions from quotes or forecasts. Defaults to false
when omitted. Can be updated at any point.
When true
, the estimate represents an actual transaction for purchased goods and services and will be included in Lune analytics.
transaction_processed_atstring (date-time)
Provide the date and time that the transaction is processed, as an RFC 3339 timestamp.
If omitted, the property defaults to the time of request. Used only for analytics, with no impact on the actual estimate calculation.
external_estimate_urlstring (https-url)requirednullable
An external accessible URL linking to a detailed page that provides complete information about the estimate.
is_transactionbooleanrequirednullable
transaction_processed_atstring (date-time)requirednullable
Errors
This API operation can return the following errors: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