Create an electricity emission estimate
HTTPPOST
to /v1/estimates/electricity
Estimate emissions produced by electricity consumption.Request body
Parameters for estimating electricity emissions
namestring
A name to reference this calculation.
consumptionobjectrequired
amountstringrequired
Pattern: ^[0-9]+(\.[0-9]+)?$
unitstringrequired
Unit, kWh
for kilowatt-hours, MWh
for megawatt-hours, GWh
for gigawatt-hours
kWh
MWh
GWh
country_codestring
The three-letter code of the country where the consumption takes place, if applicable.
Providing this value will improve the estimation process. If the value is not provided the global average will be used.
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
percentageoneOfSelection percentage as integer
Selection percentage as integer
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.
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
quoteoneOfrequiredError response
Error response
requestobjectrequired
Parameters for estimating electricity emissions
namestring
A name to reference this calculation.
consumptionobjectrequired
amountstringrequired
Pattern: ^[0-9]+(\.[0-9]+)?$
unitstringrequired
Unit, kWh
for kilowatt-hours, MWh
for megawatt-hours, GWh
for gigawatt-hours
kWh
MWh
GWh
country_codestring
The three-letter code of the country where the consumption takes place, if applicable.
Providing this value will improve the estimation process. If the value is not provided the global average will be used.
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
percentageoneOfSelection percentage as integer
Selection percentage as integer
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.
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.
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 an electricity emission estimate
HTTPGET
to /v1/estimates/electricity/{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
quoteoneOfrequiredError response
Error response
requestobjectrequired
Parameters for estimating electricity emissions
namestring
A name to reference this calculation.
consumptionobjectrequired
amountstringrequired
Pattern: ^[0-9]+(\.[0-9]+)?$
unitstringrequired
Unit, kWh
for kilowatt-hours, MWh
for megawatt-hours, GWh
for gigawatt-hours
kWh
MWh
GWh
country_codestring
The three-letter code of the country where the consumption takes place, if applicable.
Providing this value will improve the estimation process. If the value is not provided the global average will be used.
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
percentageoneOfSelection percentage as integer
Selection percentage as integer
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.
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.
Errors
This API operation can return the following errors:401
404
429
503
service_unavailable
Update an electricity emission estimate
HTTPPUT
to /v1/estimates/electricity/{id}
Estimate emissions produced by electricity consumption.Query parameters
idstringrequired
The estimate's unique identifier
Request body
Parameters for estimating electricity emissions
namestring
A name to reference this calculation.
consumptionobjectrequired
amountstringrequired
Pattern: ^[0-9]+(\.[0-9]+)?$
unitstringrequired
Unit, kWh
for kilowatt-hours, MWh
for megawatt-hours, GWh
for gigawatt-hours
kWh
MWh
GWh
country_codestring
The three-letter code of the country where the consumption takes place, if applicable.
Providing this value will improve the estimation process. If the value is not provided the global average will be used.
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
percentageoneOfSelection percentage as integer
Selection percentage as integer
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.
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
quoteoneOfrequiredError response
Error response
requestobjectrequired
Parameters for estimating electricity emissions
namestring
A name to reference this calculation.
consumptionobjectrequired
amountstringrequired
Pattern: ^[0-9]+(\.[0-9]+)?$
unitstringrequired
Unit, kWh
for kilowatt-hours, MWh
for megawatt-hours, GWh
for gigawatt-hours
kWh
MWh
GWh
country_codestring
The three-letter code of the country where the consumption takes place, if applicable.
Providing this value will improve the estimation process. If the value is not provided the global average will be used.
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
percentageoneOfSelection percentage as integer
Selection percentage as integer
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.
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.
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