Skip to main content

Update a multi-leg shipping emission estimate's annotations

This method allows updating a selection of estimate annotations without going through a full estimate update (with all the necessary inputs).

Only properties included in the input data are updated.

Path Parameters
idstringrequired

The estimate's unique identifier

Parameters
Returns
is_shipmentbooleanrequired

When true, the emission estimate refers to an actual shipment of goods, will be included in Lune analytics and can be included in any CO2 emissions reporting.

This property exists to distinguish booking quotes or forecasts from actual shipments where goods are moved.

You can mark an estimate as shipment at any time.


shipped_atstringdate-timerequired

The date and time of shipping the goods for the purpose of analytics (it doesn't affect emission calculations in any way).

If a value is provided when creating or updating an estimate we use the value. Otherwise defaults to the current time when creating estimates and remains unchanged when updating estimates.

This property must be formatted as RFC 3339, section 5.6 timestamp.

Examples:

  • 2023-12-01T12:30:30.000Z
  • 2023-12-01T12:30:30Z
  • 2023-12-01T11:30:30+01.00

legsarray of objectrequired

An array representing a leg's emission estimate.

Returned in the same order as the request.


distanceobjectrequired

adjusted_distanceobjectrequired

Distance estimation after distance adjustment factors have been applied. Adjusted factors are decided by GLEC and are added to make distances more realistic.


requestobjectrequired

Parameters for estimating multi-leg shipping emissions


external_estimate_urlrequired

An external accessible URL linking to a detailed page that provides complete information about the estimate.


sourceenum

Identifies the source used to create the estimate.

Enum:
  • api
  • dashboard
  • csv
  • chain_io
  • ecotransit_csv
  • widget

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
  • PATCH /estimates/shipping/multi-leg/{id}/annotations
  • curl 'https://api.lune.co/v1/estimates/shipping/multi-leg/Vxg3b7MoBkrNQA328Rgpnvmw1J8a6Lqj/annotations' \
      -H 'Authorization: Bearer <API_KEY>' \
      -H 'Content-Type: application/json' \
      -X PATCH \
      -d '{
        "is_shipment": true
      }'
      
  • Response
  • {
      "id": "08QD7GPaBx5b6Y6mJlWyONXLvrZljRE2",
      "is_shipment": false,
      "shipped_at": "2023-11-20T10:20:30Z",
      "mass": {
        "amount": "1.105698",
        "unit": "t"
      },
      "quote": {
        "estimated_quantity": "1.105697",
        "estimated_commission": "3.02",
        "estimated_total_cost": "30.13",
        "estimated_offset_cost": "27.11",
        "requested_value": null,
        "requested_quantity": "1.105698",
        "currency": "USD",
        "bundles": [
          {
            "bundle_id": "q9aKx7b6nNXMk3Yv3pD1mlW5Od2eLZE8",
            "bundle_name": "Conserving forests in Asia",
            "quantity": "1.050413",
            "unit_price": "12.65",
            "gross_unit_price": "14.06",
            "offset_cost": "13.29",
            "insufficient_available_quantity": null
          },
          {
            "bundle_id": "xWaKJL3okjD46VpJ4yGXnQNZRe1vzP0w",
            "bundle_name": "Ocean Carbon Removal",
            "quantity": "0.055284",
            "unit_price": "250",
            "gross_unit_price": "277.78",
            "offset_cost": "13.82",
            "insufficient_available_quantity": null
          }
        ]
      },
      "distance": {
        "amount": "22951.682",
        "unit": "km"
      },
      "legs": [
        {
          "mass": {
            "amount": "0.018195",
            "unit": "t"
          },
          "distance": {
            "amount": "19.09",
            "unit": "km"
          },
          "methodology": []
        },
        {
          "mass": {
            "amount": "0.019576",
            "unit": "t"
          },
          "distance": {
            "amount": "267.02",
            "unit": "km"
          },
          "methodology": []
        },
        {
          "mass": {
            "amount": "0.901448",
            "unit": "t"
          },
          "distance": {
            "amount": "22350.48",
            "unit": "km"
          },
          "methodology": []
        },
        {
          "mass": {
            "amount": "0.031184",
            "unit": "t"
          },
          "methodology": []
        },
        {
          "mass": {
            "amount": "0.135294",
            "unit": "t"
          },
          "distance": {
            "amount": "47.2081",
            "unit": "km"
          },
          "methodology": []
        }
      ],
      "request": {
        "shipment": {
          "mass": {
            "amount": "10.36",
            "unit": "t"
          }
        },
        "legs": [
          {
            "route": {
              "source": {
                "lat": 24.211893,
                "lon": 120.608696
              },
              "destination": {
                "locode": "TWTXG"
              }
            },
            "method": "diesel_truck"
          },
          {
            "route": {
              "source": {
                "locode": "TWTXG"
              },
              "destination": {
                "locode": "TWTPE"
              }
            },
            "method": {
              "vessel_type": "container_ship"
            }
          },
          {
            "route": {
              "source": {
                "locode": "TWTPE"
              },
              "destination": {
                "locode": "DEHAM"
              }
            },
            "method": {
              "vessel_imo_number": "9893890"
            }
          },
          {
            "method": "maritime_container_terminal"
          },
          {
            "route": {
              "source": {
                "locode": "DEHAM"
              },
              "destination": {
                "street_line1": "Märkische Allee 71",
                "postcode": "14979",
                "city": "Großbeeren",
                "country_code": "DEU"
              }
            },
            "method": "truck_articulated_34t"
          }
        ]
      },
      "source": "api"
    }