Skip to main content

Create a transaction emission estimate (batch)

Perform multiple transaction emissions estimate in one request. Each estimate is handled individually. The response contains estimates or errors in the same orders as the request.
Parameters
namestring

A name to reference this calculation.


valueobject

namestring

The name of the merchant.


country_codestringrequired

The three-letter code of the merchant's country.



dietenum

A diet followed by an individual.

High meat-eater is someone consuming over 100 grams of meat per day, medium is 50-99 grams per day and low is less than 50 grams per day. A fish eater is someone that doesn't consume meat other than fish.

Enum:
  • high_meat_eater
  • medium_meat_eater
  • low_meat_eater
  • fish_eater
  • vegetarian
  • vegan

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.


quantity_truncenum

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

Enum:
  • g
  • kg
  • t
Returns
BatchTransactionEmissionEstimatearray of oneOf
  • POST /estimates/transactions/batch
  • curl 'https://api.lune.co/v1/estimates/transactions/batch' \
      -H 'Authorization: Bearer <API_KEY>' \
      -H 'Content-Type: application/json' \
      -X POST \
      -d '[
        {
          "value": {
            "value": "3.14",
            "currency": "GBP"
          },
          "merchant": {
            "country_code": "GBR",
            "category_code": "0763"
          }
        }
      ]'
      
  • Response
  • [
      {
        "mass": {
          "amount": "40.501",
          "unit": "t"
        },
        "id": "90ng23MKvLqbkpMwMw7yMBD4wJQrV6O6",
        "quote": {
          "errors": [
            {
              "error_code": "account_suspended",
              "message": "message"
            }
          ]
        },
        "request": {
          "name": "name",
          "value": {
            "value": "3.14",
            "currency": "GBP"
          },
          "merchant": {
            "name": "The Corner Store",
            "country_code": "GBR",
            "category_code": "0763"
          },
          "diet": "high_meat_eater",
          "bundle_selection": [
            {
              "bundle_id": "BmWxrvXo29eGqzA1qjANL5PwnkgaO8R3",
              "percentage": 34
            },
            {
              "bundle_id": "VndoQ0PZjGMzvYOZGwqy6kbgN1eOJx9B",
              "percentage": 66
            }
          ],
          "quantity_trunc": "t"
        },
        "search_term_match": "search_term_match"
      }
    ]