Skip to main content

Create a shipping emission estimate (multi-leg)

Each leg can be fulfilled by a different method, eg a truck, a plane or other options.
Parameters
shipment

Either a mass given in kilograms or tonnes (mass) or the number of Twenty-foot Equivalent Units (TEUs) (with their cargo type, optionally). Note that providing mass will result in more accurate estimates for methods other than container_ship. Estimates using container_ship are more precise when the shipment is given in TEUs.


legsarray of objectrequired

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.


quantity_truncenum

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

Enum:
  • g
  • kg
  • t
Returns
legsarray of allOfrequired

distanceobject

requestobject

Parameters for estimating multi-leg shipping emissions


massobject

idstringrequired

The emission calculation unique identifier


quote
  • POST /estimates/shipping/multi-leg
  • curl 'https://api.lune.co/v1/estimates/shipping/multi-leg' \
      -H 'Authorization: Bearer <API_KEY>' \
      -H 'Content-Type: application/json' \
      -X POST \
      -d '{
        "shipment": {
          "mass": {
            "amount": "40.501",
            "unit": "t"
          }
        },
        "legs": [
          {
            "route": {
              "amount": "40.501",
              "unit": "km"
            },
            "method": "inland_waterway_motor_vessel_small"
          }
        ]
      }'
      
  • Response
  • {
      "legs": [
        {
          "mass": {
            "amount": "40.501",
            "unit": "t"
          },
          "distance": {
            "amount": "40.501",
            "unit": "km"
          },
          "methodology": [
            "imo_unavailable_container_ship_fallback"
          ]
        }
      ],
      "distance": {
        "amount": "40.501",
        "unit": "km"
      },
      "request": {
        "shipment": {
          "mass": {
            "amount": "40.501",
            "unit": "t"
          }
        },
        "legs": [
          {
            "route": {
              "amount": "40.501",
              "unit": "km"
            },
            "method": "inland_waterway_motor_vessel_small",
            "country_code": "PRT"
          }
        ],
        "name": "name",
        "bundle_selection": [
          {
            "bundle_id": "BmWxrvXo29eGqzA1qjANL5PwnkgaO8R3",
            "percentage": 34
          },
          {
            "bundle_id": "VndoQ0PZjGMzvYOZGwqy6kbgN1eOJx9B",
            "percentage": 66
          }
        ],
        "quantity_trunc": "t"
      },
      "mass": {
        "amount": "40.501",
        "unit": "t"
      },
      "id": "90ng23MKvLqbkpMwMw7yMBD4wJQrV6O6",
      "quote": {
        "errors": [
          {
            "error_code": "account_suspended",
            "message": "message"
          }
        ]
      }
    }