Lune Docs Logo
Log inContact us

By transaction details

Create an emission estimate for a single transaction

HTTP POST to /v1/estimates/transactions
Request body

A name to reference this calculation.

Specify the monetary value of the transaction, excluding shipping and taxes.

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.

ISO 4217 3 character currency code.

Note: Lune supports most but not all currency codes.

AED
AFN
ALL
AMD
ANG

The merchant from whom the goods or services were purchased.

Specify individual dietary preferences to improve estimates for food-related purchases.

high_meat_eater
medium_meat_eater
low_meat_eater
fish_eater
vegetarian

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

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.

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

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.

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.

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.

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.

  • Sample request
  • Response

    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

    The most accurate term matching the search.

    The emission factor for this term is used to compute the emission estimate.

    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.

    The text embedding model used to support semantic search

    This property is null for any estimate created before 01/03/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 CO₂ equivalent gas contributed by other greenhouse gases.

    direct_from_source
    inferred_from_fuel
    global_fuel_mix_inferred

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

    Amount of CO₂ equivalent for the WTT (Well-To-Tank) stage. All gas emissions are accounted here.

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

    Amount of CO₂ equivalent for the TTW (Tank-To-Wheel) stage. All gas emissions are accounted here.

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

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

    Properties for estimating emissions associated with purchasing goods or services.

    A name to reference this calculation.

    Specify the monetary value of the transaction, excluding shipping and taxes.

    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.

    ISO 4217 3 character currency code.

    Note: Lune supports most but not all currency codes.

    AED
    AFN
    ALL
    AMD
    ANG

    The merchant from whom the goods or services were purchased.

    Specify individual dietary preferences to improve estimates for food-related purchases.

    high_meat_eater
    medium_meat_eater
    low_meat_eater
    fish_eater
    vegetarian

    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

    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.

    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

    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.

    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.

    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.

    An external accessible URL linking to a detailed page that provides complete information about the estimate.

  • Sample response
  • Errors
    This API operation can return the following errors:
    HTTP status codeError code
    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

    HTTP GET to /v1/estimates/transactions/{id}
    Query parameters

    The estimate's unique identifier

  • Sample request
  • Response

    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

    The most accurate term matching the search.

    The emission factor for this term is used to compute the emission estimate.

    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.

    The text embedding model used to support semantic search

    This property is null for any estimate created before 01/03/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 CO₂ equivalent gas contributed by other greenhouse gases.

    direct_from_source
    inferred_from_fuel
    global_fuel_mix_inferred

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

    Amount of CO₂ equivalent for the WTT (Well-To-Tank) stage. All gas emissions are accounted here.

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

    Amount of CO₂ equivalent for the TTW (Tank-To-Wheel) stage. All gas emissions are accounted here.

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

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

    Properties for estimating emissions associated with purchasing goods or services.

    A name to reference this calculation.

    Specify the monetary value of the transaction, excluding shipping and taxes.

    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.

    ISO 4217 3 character currency code.

    Note: Lune supports most but not all currency codes.

    AED
    AFN
    ALL
    AMD
    ANG

    The merchant from whom the goods or services were purchased.

    Specify individual dietary preferences to improve estimates for food-related purchases.

    high_meat_eater
    medium_meat_eater
    low_meat_eater
    fish_eater
    vegetarian

    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

    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.

    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

    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.

    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.

    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.

    An external accessible URL linking to a detailed page that provides complete information about the estimate.

  • Sample response
  • Errors
    This API operation can return the following errors:
    HTTP status codeError code
    401
    404
    429
    503
    service_unavailable

    Update a transaction emission estimate

    HTTP PUT to /v1/estimates/transactions/{id}
    Query parameters

    The estimate's unique identifier

    Request body

    Properties for estimating emissions associated with purchasing goods or services.

    A name to reference this calculation.

    Specify the monetary value of the transaction, excluding shipping and taxes.

    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.

    ISO 4217 3 character currency code.

    Note: Lune supports most but not all currency codes.

    AED
    AFN
    ALL
    AMD
    ANG

    The merchant from whom the goods or services were purchased.

    Specify individual dietary preferences to improve estimates for food-related purchases.

    high_meat_eater
    medium_meat_eater
    low_meat_eater
    fish_eater
    vegetarian

    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

    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.

    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

    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.

    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.

    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.

  • Sample request
  • Response

    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

    The most accurate term matching the search.

    The emission factor for this term is used to compute the emission estimate.

    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.

    The text embedding model used to support semantic search

    This property is null for any estimate created before 01/03/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 CO₂ equivalent gas contributed by other greenhouse gases.

    direct_from_source
    inferred_from_fuel
    global_fuel_mix_inferred

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

    Amount of CO₂ equivalent for the WTT (Well-To-Tank) stage. All gas emissions are accounted here.

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

    Amount of CO₂ equivalent for the TTW (Tank-To-Wheel) stage. All gas emissions are accounted here.

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

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

    Properties for estimating emissions associated with purchasing goods or services.

    A name to reference this calculation.

    Specify the monetary value of the transaction, excluding shipping and taxes.

    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.

    ISO 4217 3 character currency code.

    Note: Lune supports most but not all currency codes.

    AED
    AFN
    ALL
    AMD
    ANG

    The merchant from whom the goods or services were purchased.

    Specify individual dietary preferences to improve estimates for food-related purchases.

    high_meat_eater
    medium_meat_eater
    low_meat_eater
    fish_eater
    vegetarian

    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

    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.

    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

    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.

    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.

    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.

    An external accessible URL linking to a detailed page that provides complete information about the estimate.

  • Sample response
  • Errors
    This API operation can return the following errors:
    HTTP status codeError code
    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

    HTTP PATCH to /v1/estimates/transactions/{id}/annotationsThis 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

    The estimate's unique identifier

    Request body

    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.

    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.

    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.
  • Sample request
  • Response

    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

    The most accurate term matching the search.

    The emission factor for this term is used to compute the emission estimate.

    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.

    The text embedding model used to support semantic search

    This property is null for any estimate created before 01/03/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 CO₂ equivalent gas contributed by other greenhouse gases.

    direct_from_source
    inferred_from_fuel
    global_fuel_mix_inferred

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

    Amount of CO₂ equivalent for the WTT (Well-To-Tank) stage. All gas emissions are accounted here.

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

    Amount of CO₂ equivalent for the TTW (Tank-To-Wheel) stage. All gas emissions are accounted here.

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

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

    Properties for estimating emissions associated with purchasing goods or services.

    A name to reference this calculation.

    Specify the monetary value of the transaction, excluding shipping and taxes.

    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.

    ISO 4217 3 character currency code.

    Note: Lune supports most but not all currency codes.

    AED
    AFN
    ALL
    AMD
    ANG

    The merchant from whom the goods or services were purchased.

    Specify individual dietary preferences to improve estimates for food-related purchases.

    high_meat_eater
    medium_meat_eater
    low_meat_eater
    fish_eater
    vegetarian

    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

    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.

    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

    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.

    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.

    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.

    An external accessible URL linking to a detailed page that provides complete information about the estimate.

  • Sample response
  • 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 transaction emission estimate by idempotency key

    HTTP GET to /v1/estimates/transactions/by-idempotency-key/{idempotency_key}
    Query parameters

    The order's idempotency key.

    Idempotency keys must be unique per account.

  • Sample request
  • Response

    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

    The most accurate term matching the search.

    The emission factor for this term is used to compute the emission estimate.

    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.

    The text embedding model used to support semantic search

    This property is null for any estimate created before 01/03/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 CO₂ equivalent gas contributed by other greenhouse gases.

    direct_from_source
    inferred_from_fuel
    global_fuel_mix_inferred

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

    Amount of CO₂ equivalent for the WTT (Well-To-Tank) stage. All gas emissions are accounted here.

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

    Amount of CO₂ equivalent for the TTW (Tank-To-Wheel) stage. All gas emissions are accounted here.

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

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

    Properties for estimating emissions associated with purchasing goods or services.

    A name to reference this calculation.

    Specify the monetary value of the transaction, excluding shipping and taxes.

    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.

    ISO 4217 3 character currency code.

    Note: Lune supports most but not all currency codes.

    AED
    AFN
    ALL
    AMD
    ANG

    The merchant from whom the goods or services were purchased.

    Specify individual dietary preferences to improve estimates for food-related purchases.

    high_meat_eater
    medium_meat_eater
    low_meat_eater
    fish_eater
    vegetarian

    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

    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.

    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

    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.

    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.

    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.

    An external accessible URL linking to a detailed page that provides complete information about the estimate.

  • Sample response
  • Errors
    This API operation can return the following errors:
    HTTP status codeError code
    401
    404
    429
    503
    service_unavailable

    Create emission estimates for multiple transactions in one request

    HTTP POST to /v1/estimates/transactions/batchEach 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

    An array of transaction estimate requests.

    An array of transaction estimate requests.

    Properties for estimating emissions associated with purchasing goods or services.

    A name to reference this calculation.

    Specify the monetary value of the transaction, excluding shipping and taxes.

    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.

    ISO 4217 3 character currency code.

    Note: Lune supports most but not all currency codes.

    AED
    AFN
    ALL
    AMD
    ANG

    The merchant from whom the goods or services were purchased.

    Specify individual dietary preferences to improve estimates for food-related purchases.

    high_meat_eater
    medium_meat_eater
    low_meat_eater
    fish_eater
    vegetarian

    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

    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.

    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

    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.

    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.

    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.

  • Sample request
  • Response

    An array representing multiple transaction emission estimates.

    Returned in the same order as the request.

    An array representing multiple transaction emission estimates.

    Returned in the same order as the request.

  • Sample response
  • 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

    Create a multi-match transaction emission estimate

    HTTP POST to /v1/estimates/transactions/multi-matchObtain 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

    The number of matches to return.

    Request body

    A name to reference this calculation.

    Specify the monetary value of the transaction, excluding shipping and taxes.

    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.

    ISO 4217 3 character currency code.

    Note: Lune supports most but not all currency codes.

    AED
    AFN
    ALL
    AMD
    ANG

    The merchant from whom the goods or services were purchased.

    Specify individual dietary preferences to improve estimates for food-related purchases.

    high_meat_eater
    medium_meat_eater
    low_meat_eater
    fish_eater
    vegetarian

    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

    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.

    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
  • Sample request
  • 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.

    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

    The most accurate term matching the search.

    The emission factor for this term is used to compute the emission estimate.

    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.

    The text embedding model used to support semantic search

    This property is null for any estimate created before 01/03/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 CO₂ equivalent gas contributed by other greenhouse gases.

    direct_from_source
    inferred_from_fuel
    global_fuel_mix_inferred

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

    Amount of CO₂ equivalent for the WTT (Well-To-Tank) stage. All gas emissions are accounted here.

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

    Amount of CO₂ equivalent for the TTW (Tank-To-Wheel) stage. All gas emissions are accounted here.

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

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

    Properties for estimating emissions associated with purchasing goods or services.

    A name to reference this calculation.

    Specify the monetary value of the transaction, excluding shipping and taxes.

    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.

    ISO 4217 3 character currency code.

    Note: Lune supports most but not all currency codes.

    AED
    AFN
    ALL
    AMD
    ANG

    The merchant from whom the goods or services were purchased.

    Specify individual dietary preferences to improve estimates for food-related purchases.

    high_meat_eater
    medium_meat_eater
    low_meat_eater
    fish_eater
    vegetarian

    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

    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.

    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

    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.

    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.

    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.

    An external accessible URL linking to a detailed page that provides complete information about the estimate.

  • Sample response
  • 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