Skip to main content

Create an estimate using a specific emission factor

Parameters
emission_factor_idstringrequired

The emission factor unique identifier


valuestring^[0-9]+(\.[0-9]+)?$required

The quantity of the activity being measured



namestring

A name to reference this calculation.


bundle_selectionarray of object

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.



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:

  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.
Returns

Returns: EmissionFactor object

massobjectrequired

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:

  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.

idstringrequired

The emission calculation unique identifier


quoterequired

requestobjectrequired

emission_factorobjectrequired
  • POST /estimates/emission-factor
  • curl 'https://api.lune.co/v1/estimates/emission-factor' \
      -H 'Authorization: Bearer <API_KEY>' \
      -H 'Content-Type: application/json' \
      -X POST \
      -d '{
        "emission_factor_id": "ljmkOq7vXd238gAE9WALWQ8ZGVD5ExNz",
        "value": "15.25",
        "unit": "GBP"
      }'
      
  • Response
  • {
      "mass": {
        "amount": "40.501",
        "unit": "t"
      },
      "idempotency_key": "5bd808a954e",
      "id": "90ng23MKvLqbkpMwMw7yMBD4wJQrV6O6",
      "quote": {
        "errors": [
          {
            "error_code": "account_suspended",
            "message": "message"
          }
        ],
        "error": {
          "error_code": "account_suspended",
          "message": "message"
        }
      },
      "request": {
        "emission_factor_id": "ljmkOq7vXd238gAE9WALWQ8ZGVD5ExNz",
        "activity": {
          "value": "15.25",
          "unit": "GBP"
        },
        "name": "name",
        "bundle_selection": [
          {
            "bundle_id": "BmWxrvXo29eGqzA1qjANL5PwnkgaO8R3",
            "percentage": 34
          },
          {
            "bundle_id": "VndoQ0PZjGMzvYOZGwqy6kbgN1eOJx9B",
            "percentage": 66
          }
        ],
        "quantity_trunc": "t",
        "idempotency_key": "5bd808a954e"
      },
      "emission_factor": {
        "id": "ljmkOq7vXd238gAE9WALWQ8ZGVD5ExNz",
        "name": "Steel Pipe",
        "source": "exiobase",
        "source_version": "1.0",
        "publication_year": 2021,
        "numerator_unit": "t",
        "denominator_unit": "GBP",
        "created_at": "2022-09-01T00:00:00.000Z",
        "region": "region",
        "gas_emissions": {
          "co2e": "41.501",
          "co2": "30.231",
          "methane": "2.51",
          "nitrous_oxide": "4.3",
          "other": "0.93"
        }
      }
    }