Skip to main content

Get a smart-scan emission estimate

Path Parameters
idstringrequired

The estimate's unique identifier

Returns
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

line_itemsarray of objectrequired

Line items for the smart scan estimate. At least one line item will always exist.

  • GET /estimates/smart-scan/{id}
  • curl 'https://api.lune.co/v1/estimates/smart-scan/Vxg3b7MoBkrNQA328Rgpnvmw1J8a6Lqj' \
      -H 'Authorization: Bearer <API_KEY>'
  • 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": {
        "unstructured_data": {
          "key_value": {
            "id": 123,
            "amount": {
              "value": "10",
              "currency": "EUR"
            },
            "line_items": [
              {
                "amount": "1"
              },
              {
                "amount": "9"
              }
            ]
          }
        },
        "name": "name",
        "bundle_selection": [
          {
            "bundle_id": "BmWxrvXo29eGqzA1qjANL5PwnkgaO8R3",
            "percentage": 34
          },
          {
            "bundle_id": "VndoQ0PZjGMzvYOZGwqy6kbgN1eOJx9B",
            "percentage": 66
          }
        ],
        "quantity_trunc": "t",
        "idempotency_key": "5bd808a954e",
        "value": "3.14",
        "currency": "GBP",
        "merchant": {
          "Merchant category code": {
            "name": "The Corner Store",
            "country_code": "GBR",
            "category_code": "0763"
          }
        },
        "diet": "high_meat_eater",
        "region_fallback": "never"
      },
      "line_items": [
        {
          "mass": {
            "amount": "40.501",
            "unit": "t"
          },
          "type": "transaction",
          "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",
            "category": "category",
            "gas_emissions": {
              "co2e": "41.501",
              "co2": "30.231",
              "methane": "2.51",
              "nitrous_oxide": "4.3",
              "other": "0.93"
            }
          },
          "search_term_match": "search_term_match",
          "search_term_match_score": 1,
          "diet_factor": {
            "Diet factor": "0.6495"
          },
          "semantic_matching_model": "semantic_matching_model",
          "exchange_rate": {
            "Exchange rate": "0.2667"
          },
          "exchange_rate_date": {
            "Exchange rate date": "2024-01-01"
          },
          "country_code": "USA",
          "value": {
            "value": "3.14",
            "currency": "GBP"
          },
          "Item and category": {
            "item": "Office desks",
            "category": {
              "Category": "Furniture"
            },
            "category_code": null
          }
        }
      ]
    }