Lune Docs Logo
Log inContact us

Shipments

Upload a batch of shipments

HTTP POST to /v1/shipments/batchesSubmit a batch of shipments for emission reporting.Only rudimentary checks (e.g. payload structure and size) are performed at upload time. The request either succeeds as a whole or it does not; there are no per-row errors on upload. Detailed per-row validation happens asynchronously when the batch is processed.The counterparty on each resulting shipment is resolved from one of two sources:
  1. If contact_id is supplied on the request, the identified contact is the counterparty for every resulting shipment. Per-row target_internal_id and target_internal_name are ignored for counterparty resolution in this case.
  2. Otherwise, each row's counterparty is resolved from its per-row target_internal_id, scoped to the authenticated account. target_internal_name is used when the system has to create a previously-unseen counterparty mapping.
Supplying both contact_id on the request and target_internal_id on a row is not an error; contact_id wins. Rows without a usable counterparty when contact_id is absent will fail during asynchronous processing.The shipper_id and supplier_id on each resulting shipment are derived from the authenticated account and the resolved counterparty: a shipper account is assigned as shipper_id, otherwise it is assigned as supplier_id, and the counterparty takes the opposite role.Returns a batch identifier that can be used to refer to the batch later.
Request body

Client-side shipment reference identifier.

An identifier you've assigned to this row's counterparty, scoped to the account making the request. A contact may have multiple Internal IDs and this row matches against any of them; these are managed via the Lune dashboard. Used to resolve the counterparty when the batch does not provide a batch-level contact_id; ignored otherwise. Should be supplied together with target_internal_name.

Display name for the counterparty associated with target_internal_id. Used when no contact yet has the supplied target_internal_id and one needs to be created. Ignored when the batch provides a contact_id.

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.

Service level for the shipment.

express
economy
priority

International Commercial Term (Incoterms 2020) governing the shipment.

exw
fca
cpt
cip
dap

Type of freight contract.

spot
contract
tender

Whether the shipment contains hazardous cargo.

Booking reference number.

House waybill number.

Purchase order reference identifier.

Client-side identifier for the consignee.

Name of the consignee.

Client-side identifier for the consignor.

Name of the consignor.

Name of the freight paying party.

Legal entity responsible for the shipment.

Pattern: ^[0-9]+(\.[0-9]+)?$

Specify the monetary value in the currency defined by the currency_code property in the request. If no currency_code is provided, the currency will default to that of the associated account.

ISO 4217 3 character currency code.

Note: Lune supports most but not all currency codes.

AED
AFN
ALL
AMD
ANG

Emission scope for the shipper contract.

Client-provided emissions data for the whole shipment. All emission values are in kilograms. The emissions source is automatically set to "manual" when this object is provided.

Pattern: ^[0-9]+(\.[0-9]+)?$

Total emissions (kg CO2e).

Pattern: ^[0-9]+(\.[0-9]+)?$

Well-to-tank emissions (kg CO2e).

Pattern: ^[0-9]+(\.[0-9]+)?$

Tank-to-wheel emissions (kg CO2e).

Pattern: ^[0-9]+(\.[0-9]+)?$

Total distance in kilometres.

A single leg of a shipment journey.

Client-side identifier for this leg.

1-based ordering of this leg within the shipment. If omitted, the array order is used.

Transport method accepted when creating a shipment.

Indicates the leg's role in the overall shipment journey.

  • pre — first-mile pickup
  • main — primary long-haul
  • on — last-mile delivery
pre
main
on

A location specified as one of: an address, geographic coordinates, a UN/LOCODE, or an airport code.

A location specified as one of: an address, geographic coordinates, a UN/LOCODE, or an airport code.

Pattern: ^[0-9]+(\.[0-9]+)?$

The estimated distance. Unit, km for kilometers, mi for miles

km
mi
nm

Name of the carrier for this leg.

Standard Carrier Alpha Code.

Master waybill number.

The transit corridor used for sea shipments. This is used to improve the accuracy of the estimate. If not provided, the shortest route is calculated.

Only applicable to sea shipments.

panama
suez
cape_of_good_hope
northwest_passage
northeast_passage

Transit corridors that should be avoided for sea legs. Only applicable to sea legs. Mutually exclusive with transit_corridor.

The transit corridor used for sea shipments. This is used to improve the accuracy of the estimate. If not provided, the shortest route is calculated.

Only applicable to sea shipments.

panama
suez
cape_of_good_hope
northwest_passage
northeast_passage

Cargo load details for a shipment leg.

Pattern: ^[0-9]+(\.[0-9]+)?$

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

g
kg
t
lbs

A volume measurement.

Pattern: ^[0-9]+(\.[0-9]+)?$

Unit of volume measurement.

l
m3

Number of pieces in the load.

Pattern: ^[0-9]+(\.[0-9]+)?$

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

g
kg
t
lbs

Details of a shipping container.

ISO container size/type code.

20gp
40gp
40hc
45hc
20rf

Pattern: ^[0-9]+(\.[0-9]+)?$

TEU equivalent of the container.

Whether the container is a full container load or less than container load.

fcl
lcl

Pattern: ^[0-9]+(\.[0-9]+)?$

Measure of how fully the vehicle is utilising its cargo capacity (0 to 1).

Pattern: ^[0-9]+(\.[0-9]+)?$

Proportion of the vehicle's travel that is done empty (0 to 1).

Pattern: ^[0-9]+(\.[0-9]+)?$

Passenger utilisation factor for passenger transport modes (0 to 1).

Departure and arrival dates for a shipment leg.

A date (YYYY-MM-DD) or date-time (RFC 3339).

A date (YYYY-MM-DD) or date-time (RFC 3339).

A date (YYYY-MM-DD) or date-time (RFC 3339).

A date (YYYY-MM-DD) or date-time (RFC 3339).

Client-provided emissions data for a shipment leg. All emission values are in kilograms.

Pattern: ^[0-9]+(\.[0-9]+)?$

Total emissions (kg CO2e).

Pattern: ^[0-9]+(\.[0-9]+)?$

Well-to-tank emissions (kg CO2e).

Pattern: ^[0-9]+(\.[0-9]+)?$

Tank-to-wheel emissions (kg CO2e).

Pattern: ^[0-9]+(\.[0-9]+)?$

Emission intensity.

Pattern: ^[0-9]+(\.[0-9]+)?$

Total particulate matter emissions (kg).

Pattern: ^[0-9]+(\.[0-9]+)?$

Well-to-tank particulate matter emissions (kg).

Pattern: ^[0-9]+(\.[0-9]+)?$

Tank-to-wheel particulate matter emissions (kg).

Pattern: ^[0-9]+(\.[0-9]+)?$

Total carbon dioxide emissions (kg).

Pattern: ^[0-9]+(\.[0-9]+)?$

Well-to-tank carbon dioxide emissions (kg).

Pattern: ^[0-9]+(\.[0-9]+)?$

Tank-to-wheel carbon dioxide emissions (kg).

Pattern: ^[0-9]+(\.[0-9]+)?$

Total nitrogen oxides emissions (kg).

Pattern: ^[0-9]+(\.[0-9]+)?$

Well-to-tank nitrogen oxides emissions (kg).

Pattern: ^[0-9]+(\.[0-9]+)?$

Tank-to-wheel nitrogen oxides emissions (kg).

Pattern: ^[0-9]+(\.[0-9]+)?$

Total sulfur dioxides emissions (kg).

Pattern: ^[0-9]+(\.[0-9]+)?$

Well-to-tank sulfur dioxides emissions (kg).

Pattern: ^[0-9]+(\.[0-9]+)?$

Tank-to-wheel sulfur dioxides emissions (kg).

Pattern: ^[0-9]+(\.[0-9]+)?$

Total non-methane hydrocarbons emissions (kg).

Pattern: ^[0-9]+(\.[0-9]+)?$

Well-to-tank non-methane hydrocarbons emissions (kg).

Pattern: ^[0-9]+(\.[0-9]+)?$

Tank-to-wheel non-methane hydrocarbons emissions (kg).

Pattern: ^[0-9]+(\.[0-9]+)?$

Primary energy consumption (MJ).

Pattern: ^[0-9]+(\.[0-9]+)?$

Fuel consumption (litres).

Pattern: ^[0-9]+(\.[0-9]+)?$

Distance (km).

Pattern: ^[0-9]+(\.[0-9]+)?$

Transport activity (tonne-kilometres).

Description of the emission factor used.

Region of the emission factor.

Source of the emission factor.

Pattern: ^[0-9]+(\.[0-9]+)?$

Intensity value of the emission factor.

Numerator unit of the emission factor.

Denominator unit of the emission factor.

Year of the emission factor.

Lune contact identifier for the counterparty in this batch. When supplied, every row in the batch uses the identified contact as the counterparty and per-row target_internal_id / target_internal_name are ignored for counterparty resolution. When omitted, each row's counterparty is resolved from its per-row target_internal_id instead.

Idempotency key for this batch upload, unique per authenticated account. Returns HTTP 409 Conflict with error code shipment_batch_idempotency_already_exists if a batch with the same idempotency key has already been submitted by this account.

Whether to schedule emission calculations immediately after this batch has been processed. Defaults to false.

  • Sample request
  • Response

    Batch identifier.

  • Sample response
  • Errors
    This API operation can return the following errors:
    HTTP status codeError code
    400
    api_version_invalid
    400
    bundle_selection_ratios_invalid
    400
    bundle_selection_bundle_invalid
    400
    order_value_invalid
    400
    bundle_id_invalid
    400
    id_invalid
    400
    distance_invalid
    400
    test_account_name_update_disallowed
    400
    bundle_selection_ratios_invalid_format
    400
    address_not_found

    Calculate shipments

    HTTP POST to /v1/shipments/calculateCreates one or more calculation batches for the shipments matching the given filters. Accepts the same filters as GET /shipments.Emissions calculation happens asynchronously: this only enqueues it. Returns the identifiers of the calculation batches created.The request is rejected if more than 200000 shipments are selected.For an organisation billed by credit, the request is rejected if its credit balance is below the number of matched shipments.
    Query parameters

    Free-text search term used to match shipment IDs in the returned results.

    Include only shipments with a shipment date on or after this date.

    Include only shipments with a shipment date on or before this date.

    Filter shipments by the main carriage mode of transport.

    Filter shipments by the pre-carriage mode of transport.

    Filter shipments by the post-carriage mode of transport.

    Filter shipments by supplier account IDs.

    Filter shipments by shipper account IDs.

    Filter shipments by the IDs of the shipment batches they were created from.

    Filter shipments by the IDs of the data sheet uploads their shipment batches were created from. Values are OR'd: a shipment matches if its batch came from any of the given data sheets.

    Filter shipments to only the given IDs. This is the same Lune-generated unique identifier already returned on each shipment's id field, so it can be matched. Values are OR'd: a shipment matches if its ID is any of the given values.

    Filter shipments by whether they contain legs with flagged emission intensity.

    Filter shipments by emissions availability.

    all
    with_co2e
    without_co2e
  • Sample request
  • Response

    Identifiers of the calculation batches created.

  • Sample response
  • Errors
    This API operation can return the following errors:
    HTTP status codeError code
    400
    api_version_invalid
    400
    bundle_selection_ratios_invalid
    400
    bundle_selection_bundle_invalid
    400
    order_value_invalid
    400
    bundle_id_invalid
    400
    id_invalid
    400
    distance_invalid
    400
    test_account_name_update_disallowed
    400
    bundle_selection_ratios_invalid_format
    400
    address_not_found

    Get a shipment batch

    HTTP GET to /v1/shipments/batches/{id}Fetch the current processing state of a shipment batch. Row results and counts are included when row processing has run to completion.
    Query parameters

    Shipment batch identifier.

  • Sample request
  • Response

  • Sample response
  • Errors
    This API operation can return the following errors:
    HTTP status codeError code
    401
    404
    429

    List shipment batches

    HTTP GET to /v1/shipments/batchesReturns the account's paginated shipment batches in reverse order (most recent first).Each item uses the same summary shape. Counts and batch_error are null until processing finishes (or when a batch-level error prevents row-level processing). Per-row results are not included; use get shipment batch to fetch them for a single batch.
    Query parameters

    Pattern: ^\d+$

    Maximum number of resources to return, between 1 and 100.

    A cursor for use in pagination.

    The cursor that points to the starting item of the next page of results. If not provided, the first page of results is returned.

    Filter batches by how they were created.

  • Sample request
  • Response

    Whether or not there are more elements available after this set.

    If false, this set comprises the end of the array.

    Part of a paginated response.

    The cursor value to be used as the after parameter for fetching the next page of results.

    null if has_more is false.

    An array of shipment batch summaries ordered by creation date descending.

    Part of a paginated response.

    Batch identifier.

    Batch processing status.

    pending
    processing
    processed

    Describes through which channel the batch was created.

    • api — submitted directly through the shipments API
    • data_sheet — submitted as a data sheet through the Lune uploader
    api
    data_sheet

    Name of the account that uploaded the batch.

    Full name of the user that uploaded the linked data sheet, when available. Null for API uploads without a data sheet or when the uploader has no name.

    Filename of the linked data sheet, when the batch was created from a sheet upload. Null for API uploads without a data sheet.

    Timestamp when the batch was created.

    Number of rows that were processed successfully. Null while the batch is not finished, or when a batch-level error prevented row-level processing.

    Number of rows that failed processing. Null while the batch is not finished, or when a batch-level error prevented row-level processing.

    Batch-level processing error when row processing did not run. Null otherwise.

  • Sample response
  • Errors
    This API operation can return the following errors:
    HTTP status codeError code
    401
    429

    List shipments

    HTTP GET to /v1/shipmentsReturns the account's paginated shipments in reverse order (most recent first).
    Query parameters

    Pattern: ^\d+$

    Maximum number of resources to return, between 1 and 100.

    A cursor for use in pagination.

    The cursor that points to the starting item of the next page of results. If not provided, the first page of results is returned.

    Free-text search term used to match shipment IDs in the returned results.

    Include only shipments with a shipment date on or after this date.

    Include only shipments with a shipment date on or before this date.

    Filter shipments by the main carriage mode of transport.

    Filter shipments by the pre-carriage mode of transport.

    Filter shipments by the post-carriage mode of transport.

    Filter shipments by supplier account IDs.

    Filter shipments by shipper account IDs.

    Filter shipments by the IDs of the shipment batches they were created from.

    Filter shipments by the IDs of the data sheet uploads their shipment batches were created from. Values are OR'd: a shipment matches if its batch came from any of the given data sheets.

    Filter shipments to only the given IDs. This is the same Lune-generated unique identifier already returned on each shipment's id field, so it can be matched. Values are OR'd: a shipment matches if its ID is any of the given values.

    Filter shipments by whether they contain legs with flagged emission intensity.

    Filter shipments by emissions availability.

    all
    with_co2e
    without_co2e

    Whether to include approximate shipment totals in the response.

  • Sample request
  • Response

    Whether or not there are more elements available after this set.

    If false, this set comprises the end of the array.

    Part of a paginated response.

    The cursor value to be used as the after parameter for fetching the next page of results.

    null if has_more is false.

    An array of Shipment objects ordered by creation date descending.

    Part of a paginated response.

    A shipment with its legs, with or without emissions.

    Unique identifier of the emission estimate associated with this shipment.

    Origin street address line 1.

    Origin street address line 2.

    Origin postcode.

    Origin city.

    Origin country code (ISO 3166-1 alpha-3).

    Origin UN/LOCODE.

    Origin airport code.

    Pattern: ^-?[0-9]+(\.[0-9]+)?$

    Origin latitude.

    Pattern: ^-?[0-9]+(\.[0-9]+)?$

    Origin longitude.

    Destination street address line 1.

    Destination street address line 2.

    Destination postcode.

    Destination city.

    Destination country code (ISO 3166-1 alpha-3).

    Destination UN/LOCODE.

    Destination airport code.

    Pattern: ^-?[0-9]+(\.[0-9]+)?$

    Destination latitude.

    Pattern: ^-?[0-9]+(\.[0-9]+)?$

    Destination longitude.

    Pattern: ^[0-9]+(\.[0-9]+)?$

    Total distance in kilometres.

    Pattern: ^[0-9]+(\.[0-9]+)?$

    Total emissions (kg CO2e).

    Pattern: ^[0-9]+(\.[0-9]+)?$

    Well-to-tank emissions (kg CO2e).

    Pattern: ^[0-9]+(\.[0-9]+)?$

    Tank-to-wheel emissions (kg CO2e).

    Pattern: ^[0-9]+(\.[0-9]+)?$

    Pattern: ^[0-9]+(\.[0-9]+)?$

    Pattern: ^[0-9]+(\.[0-9]+)?$

    Pattern: ^[0-9]+(\.[0-9]+)?$

    Pattern: ^[0-9]+(\.[0-9]+)?$

    Pattern: ^[0-9]+(\.[0-9]+)?$

    Pattern: ^[0-9]+(\.[0-9]+)?$

    Pattern: ^[0-9]+(\.[0-9]+)?$

    Pattern: ^[0-9]+(\.[0-9]+)?$

    Pattern: ^[0-9]+(\.[0-9]+)?$

    Pattern: ^[0-9]+(\.[0-9]+)?$

    Pattern: ^[0-9]+(\.[0-9]+)?$

    Pattern: ^[0-9]+(\.[0-9]+)?$

    Pattern: ^[0-9]+(\.[0-9]+)?$

    Pattern: ^[0-9]+(\.[0-9]+)?$

    Pattern: ^[0-9]+(\.[0-9]+)?$

    Pattern: ^[0-9]+(\.[0-9]+)?$

    Pattern: ^[0-9]+(\.[0-9]+)?$

    Pattern: ^[0-9]+(\.[0-9]+)?$

    Pattern: ^[0-9]+(\.[0-9]+)?$

    Pattern: ^[0-9]+(\.[0-9]+)?$

    Pattern: ^[0-9]+(\.[0-9]+)?$

    Pattern: ^[0-9]+(\.[0-9]+)?$

    Pattern: ^[0-9]+(\.[0-9]+)?$

    Pattern: ^[0-9]+(\.[0-9]+)?$

    Pattern: ^[0-9]+(\.[0-9]+)?$

    Pattern: ^[0-9]+(\.[0-9]+)?$

    Pattern: ^[0-9]+(\.[0-9]+)?$

    Pattern: ^[0-9]+(\.[0-9]+)?$

    Pattern: ^[0-9]+(\.[0-9]+)?$

    Pattern: ^[0-9]+(\.[0-9]+)?$

    Pattern: ^[0-9]+(\.[0-9]+)?$

    Pattern: ^[0-9]+(\.[0-9]+)?$

    Pattern: ^[0-9]+(\.[0-9]+)?$

    Pattern: ^[0-9]+(\.[0-9]+)?$

    Pattern: ^[0-9]+(\.[0-9]+)?$

    Pattern: ^[0-9]+(\.[0-9]+)?$

    Pattern: ^[0-9]+(\.[0-9]+)?$

    Pattern: ^[0-9]+(\.[0-9]+)?$

    Pattern: ^[0-9]+(\.[0-9]+)?$

    Pattern: ^[0-9]+(\.[0-9]+)?$

    Pattern: ^[0-9]+(\.[0-9]+)?$

    Pattern: ^[0-9]+(\.[0-9]+)?$

    Pattern: ^[0-9]+(\.[0-9]+)?$

    Pattern: ^[0-9]+(\.[0-9]+)?$

    Pattern: ^[0-9]+(\.[0-9]+)?$

    Pattern: ^[0-9]+(\.[0-9]+)?$

    Pattern: ^[0-9]+(\.[0-9]+)?$

    Pattern: ^[0-9]+(\.[0-9]+)?$

    Pattern: ^[0-9]+(\.[0-9]+)?$

    Pattern: ^[0-9]+(\.[0-9]+)?$

    Pattern: ^[0-9]+(\.[0-9]+)?$

    Pattern: ^[0-9]+(\.[0-9]+)?$

    Pattern: ^[0-9]+(\.[0-9]+)?$

    Pattern: ^[0-9]+(\.[0-9]+)?$

    Pattern: ^[0-9]+(\.[0-9]+)?$

    Pattern: ^[0-9]+(\.[0-9]+)?$

    Pattern: ^[0-9]+(\.[0-9]+)?$

    Pattern: ^[0-9]+(\.[0-9]+)?$

    Pattern: ^[0-9]+(\.[0-9]+)?$

    Pattern: ^[0-9]+(\.[0-9]+)?$

    Pattern: ^[0-9]+(\.[0-9]+)?$

    Pattern: ^[0-9]+(\.[0-9]+)?$

    Pattern: ^[0-9]+(\.[0-9]+)?$

    Pattern: ^[0-9]+(\.[0-9]+)?$

    Pattern: ^[0-9]+(\.[0-9]+)?$

    Pattern: ^[0-9]+(\.[0-9]+)?$

    Pattern: ^[0-9]+(\.[0-9]+)?$

    Pattern: ^[0-9]+(\.[0-9]+)?$

    Pattern: ^[0-9]+(\.[0-9]+)?$

    Pattern: ^[0-9]+(\.[0-9]+)?$

    Pattern: ^[0-9]+(\.[0-9]+)?$

    Pattern: ^[0-9]+(\.[0-9]+)?$

    Pattern: ^[0-9]+(\.[0-9]+)?$

    Pattern: ^[0-9]+(\.[0-9]+)?$

    Pattern: ^[0-9]+(\.[0-9]+)?$

    Pattern: ^[0-9]+(\.[0-9]+)?$

    Pattern: ^[0-9]+(\.[0-9]+)?$

    Pattern: ^[0-9]+(\.[0-9]+)?$

    Pattern: ^[0-9]+(\.[0-9]+)?$

    Pattern: ^[0-9]+(\.[0-9]+)?$

    Lune-generated unique identifier.

    Client-side shipment reference identifier.

    Identifier of the supplier.

    Name of the supplier.

    Identifier of the shipper.

    Name of the shipper.

    Tags for categorising or filtering shipments.

    express
    economy
    priority

    exw
    fca
    cpt
    cip
    dap

    spot
    contract
    tender

    Whether the shipment contains hazardous cargo.

    Booking reference number.

    House waybill number.

    Purchase order reference identifier.

    Client-side identifier for the consignee.

    Name of the consignee.

    Client-side identifier for the consignor.

    Name of the consignor.

    Name of the freight paying party.

    Legal entity responsible for the shipment.

    Pattern: ^[0-9]+(\.[0-9]+)?$

    Specify the monetary value in the currency defined by the currency_code property in the request. If no currency_code is provided, the currency will default to that of the associated account.

    ISO 4217 3 character currency code.

    Note: Lune supports most but not all currency codes.

    AED
    AFN
    ALL
    AMD
    ANG

    Emission scope for the shipper contract.

    Source of the emissions data.

    ecotransit
    lune
    manual

    A shipment leg with its calculated emissions.

    Client-side identifier for this leg.

    1-based ordering of this leg within the shipment.

    pre
    main
    on

    Pattern: ^[0-9]+(\.[0-9]+)?$

    The estimated distance. Unit, km for kilometers, mi for miles

    km
    mi
    nm

    Name of the carrier for this leg.

    Standard Carrier Alpha Code.

    Master waybill number.

    Transit corridor to force the route through for sea legs. Only applicable to sea legs.

    panama
    suez
    cape_of_good_hope
    northwest_passage
    northeast_passage

    Transit corridors that should be avoided for sea legs. Only applicable to sea legs.

    The transit corridor used for sea shipments. This is used to improve the accuracy of the estimate. If not provided, the shortest route is calculated.

    Only applicable to sea shipments.

    panama
    suez
    cape_of_good_hope
    northwest_passage
    northeast_passage

    Pattern: ^[0-9]+(\.[0-9]+)?$

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

    g
    kg
    t
    lbs

    Pattern: ^[0-9]+(\.[0-9]+)?$

    Unit of volume measurement.

    l
    m3

    Number of pieces in the load.

    Pattern: ^[0-9]+(\.[0-9]+)?$

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

    g
    kg
    t
    lbs

    Details of a shipping container.

    Container number.

    20gp
    40gp
    40hc
    45hc
    20rf

    Pattern: ^[0-9]+(\.[0-9]+)?$

    TEU equivalent of the container.

    fcl
    lcl

    lightweight
    average
    heavyweight
    container_only

    Pattern: ^[0-9]+(\.[0-9]+)?$

    Measure of how fully the vehicle is utilising its cargo capacity (0 to 1).

    Pattern: ^[0-9]+(\.[0-9]+)?$

    Proportion of the vehicle's travel that is done empty (0 to 1).

    Pattern: ^[0-9]+(\.[0-9]+)?$

    Passenger utilisation factor for passenger transport modes (0 to 1).

    Estimated departure date or date-time.

    Estimated arrival date or date-time.

    Actual departure date or date-time.

    Actual arrival date or date-time.

    Pattern: ^[0-9]+(\.[0-9]+)?$

    Total emissions (kg CO2e).

    Pattern: ^[0-9]+(\.[0-9]+)?$

    Well-to-tank emissions (kg CO2e).

    Pattern: ^[0-9]+(\.[0-9]+)?$

    Tank-to-wheel emissions (kg CO2e).

    Pattern: ^[0-9]+(\.[0-9]+)?$

    Emission intensity.

    Pattern: ^[0-9]+(\.[0-9]+)?$

    Total particulate matter emissions (kg).

    Pattern: ^[0-9]+(\.[0-9]+)?$

    Well-to-tank particulate matter emissions (kg).

    Pattern: ^[0-9]+(\.[0-9]+)?$

    Tank-to-wheel particulate matter emissions (kg).

    Pattern: ^[0-9]+(\.[0-9]+)?$

    Total carbon dioxide emissions (kg).

    Pattern: ^[0-9]+(\.[0-9]+)?$

    Well-to-tank carbon dioxide emissions (kg).

    Pattern: ^[0-9]+(\.[0-9]+)?$

    Tank-to-wheel carbon dioxide emissions (kg).

    Pattern: ^[0-9]+(\.[0-9]+)?$

    Total nitrogen oxides emissions (kg).

    Pattern: ^[0-9]+(\.[0-9]+)?$

    Well-to-tank nitrogen oxides emissions (kg).

    Pattern: ^[0-9]+(\.[0-9]+)?$

    Tank-to-wheel nitrogen oxides emissions (kg).

    Pattern: ^[0-9]+(\.[0-9]+)?$

    Total sulfur dioxides emissions (kg).

    Pattern: ^[0-9]+(\.[0-9]+)?$

    Well-to-tank sulfur dioxides emissions (kg).

    Pattern: ^[0-9]+(\.[0-9]+)?$

    Tank-to-wheel sulfur dioxides emissions (kg).

    Pattern: ^[0-9]+(\.[0-9]+)?$

    Total non-methane hydrocarbons emissions (kg).

    Pattern: ^[0-9]+(\.[0-9]+)?$

    Well-to-tank non-methane hydrocarbons emissions (kg).

    Pattern: ^[0-9]+(\.[0-9]+)?$

    Tank-to-wheel non-methane hydrocarbons emissions (kg).

    Pattern: ^[0-9]+(\.[0-9]+)?$

    Primary energy consumption (MJ).

    Pattern: ^[0-9]+(\.[0-9]+)?$

    Fuel consumption (litres).

    Pattern: ^[0-9]+(\.[0-9]+)?$

    Distance (km).

    Pattern: ^[0-9]+(\.[0-9]+)?$

    Transport activity (tonne-kilometres).

    Description of the emission factor used.

    Region of the emission factor.

    Source of the emission factor.

    Pattern: ^[0-9]+(\.[0-9]+)?$

    Intensity value of the emission factor.

    Numerator unit of the emission factor.

    Denominator unit of the emission factor.

    Year of the emission factor.

    An <a href="https://pretty-rfc.herokuapp.com/RFC3339">RFC 3339</a>-formatted timestamp.

    Approximate total number of shipments matching the active filters.

    These totals may lag behind the current shipment data.

  • Sample response
  • Errors
    This API operation can return the following errors:
    HTTP status codeError code
    400
    api_version_invalid
    400
    bundle_selection_ratios_invalid
    400
    bundle_selection_bundle_invalid
    400
    order_value_invalid
    400
    bundle_id_invalid
    400
    id_invalid
    400
    distance_invalid
    400
    test_account_name_update_disallowed
    400
    bundle_selection_ratios_invalid_format
    400
    address_not_found

    Get a shipment

    HTTP GET to /v1/shipments/{id}Retrieve a shipment by its identifier, including calculated emissions when available.
    Query parameters

    The shipment's unique identifier.

  • Sample request
  • Response

    A shipment with its legs, with or without emissions.

    Unique identifier of the emission estimate associated with this shipment.

    Origin street address line 1.

    Origin street address line 2.

    Origin postcode.

    Origin city.

    Origin country code (ISO 3166-1 alpha-3).

    Origin UN/LOCODE.

    Origin airport code.

    Pattern: ^-?[0-9]+(\.[0-9]+)?$

    Origin latitude.

    Pattern: ^-?[0-9]+(\.[0-9]+)?$

    Origin longitude.

    Destination street address line 1.

    Destination street address line 2.

    Destination postcode.

    Destination city.

    Destination country code (ISO 3166-1 alpha-3).

    Destination UN/LOCODE.

    Destination airport code.

    Pattern: ^-?[0-9]+(\.[0-9]+)?$

    Destination latitude.

    Pattern: ^-?[0-9]+(\.[0-9]+)?$

    Destination longitude.

    Pattern: ^[0-9]+(\.[0-9]+)?$

    Total distance in kilometres.

    Pattern: ^[0-9]+(\.[0-9]+)?$

    Total emissions (kg CO2e).

    Pattern: ^[0-9]+(\.[0-9]+)?$

    Well-to-tank emissions (kg CO2e).

    Pattern: ^[0-9]+(\.[0-9]+)?$

    Tank-to-wheel emissions (kg CO2e).

    Pattern: ^[0-9]+(\.[0-9]+)?$

    Pattern: ^[0-9]+(\.[0-9]+)?$

    Pattern: ^[0-9]+(\.[0-9]+)?$

    Pattern: ^[0-9]+(\.[0-9]+)?$

    Pattern: ^[0-9]+(\.[0-9]+)?$

    Pattern: ^[0-9]+(\.[0-9]+)?$

    Pattern: ^[0-9]+(\.[0-9]+)?$

    Pattern: ^[0-9]+(\.[0-9]+)?$

    Pattern: ^[0-9]+(\.[0-9]+)?$

    Pattern: ^[0-9]+(\.[0-9]+)?$

    Pattern: ^[0-9]+(\.[0-9]+)?$

    Pattern: ^[0-9]+(\.[0-9]+)?$

    Pattern: ^[0-9]+(\.[0-9]+)?$

    Pattern: ^[0-9]+(\.[0-9]+)?$

    Pattern: ^[0-9]+(\.[0-9]+)?$

    Pattern: ^[0-9]+(\.[0-9]+)?$

    Pattern: ^[0-9]+(\.[0-9]+)?$

    Pattern: ^[0-9]+(\.[0-9]+)?$

    Pattern: ^[0-9]+(\.[0-9]+)?$

    Pattern: ^[0-9]+(\.[0-9]+)?$

    Pattern: ^[0-9]+(\.[0-9]+)?$

    Pattern: ^[0-9]+(\.[0-9]+)?$

    Pattern: ^[0-9]+(\.[0-9]+)?$

    Pattern: ^[0-9]+(\.[0-9]+)?$

    Pattern: ^[0-9]+(\.[0-9]+)?$

    Pattern: ^[0-9]+(\.[0-9]+)?$

    Pattern: ^[0-9]+(\.[0-9]+)?$

    Pattern: ^[0-9]+(\.[0-9]+)?$

    Pattern: ^[0-9]+(\.[0-9]+)?$

    Pattern: ^[0-9]+(\.[0-9]+)?$

    Pattern: ^[0-9]+(\.[0-9]+)?$

    Pattern: ^[0-9]+(\.[0-9]+)?$

    Pattern: ^[0-9]+(\.[0-9]+)?$

    Pattern: ^[0-9]+(\.[0-9]+)?$

    Pattern: ^[0-9]+(\.[0-9]+)?$

    Pattern: ^[0-9]+(\.[0-9]+)?$

    Pattern: ^[0-9]+(\.[0-9]+)?$

    Pattern: ^[0-9]+(\.[0-9]+)?$

    Pattern: ^[0-9]+(\.[0-9]+)?$

    Pattern: ^[0-9]+(\.[0-9]+)?$

    Pattern: ^[0-9]+(\.[0-9]+)?$

    Pattern: ^[0-9]+(\.[0-9]+)?$

    Pattern: ^[0-9]+(\.[0-9]+)?$

    Pattern: ^[0-9]+(\.[0-9]+)?$

    Pattern: ^[0-9]+(\.[0-9]+)?$

    Pattern: ^[0-9]+(\.[0-9]+)?$

    Pattern: ^[0-9]+(\.[0-9]+)?$

    Pattern: ^[0-9]+(\.[0-9]+)?$

    Pattern: ^[0-9]+(\.[0-9]+)?$

    Pattern: ^[0-9]+(\.[0-9]+)?$

    Pattern: ^[0-9]+(\.[0-9]+)?$

    Pattern: ^[0-9]+(\.[0-9]+)?$

    Pattern: ^[0-9]+(\.[0-9]+)?$

    Pattern: ^[0-9]+(\.[0-9]+)?$

    Pattern: ^[0-9]+(\.[0-9]+)?$

    Pattern: ^[0-9]+(\.[0-9]+)?$

    Pattern: ^[0-9]+(\.[0-9]+)?$

    Pattern: ^[0-9]+(\.[0-9]+)?$

    Pattern: ^[0-9]+(\.[0-9]+)?$

    Pattern: ^[0-9]+(\.[0-9]+)?$

    Pattern: ^[0-9]+(\.[0-9]+)?$

    Pattern: ^[0-9]+(\.[0-9]+)?$

    Pattern: ^[0-9]+(\.[0-9]+)?$

    Pattern: ^[0-9]+(\.[0-9]+)?$

    Pattern: ^[0-9]+(\.[0-9]+)?$

    Pattern: ^[0-9]+(\.[0-9]+)?$

    Pattern: ^[0-9]+(\.[0-9]+)?$

    Pattern: ^[0-9]+(\.[0-9]+)?$

    Pattern: ^[0-9]+(\.[0-9]+)?$

    Pattern: ^[0-9]+(\.[0-9]+)?$

    Pattern: ^[0-9]+(\.[0-9]+)?$

    Pattern: ^[0-9]+(\.[0-9]+)?$

    Pattern: ^[0-9]+(\.[0-9]+)?$

    Pattern: ^[0-9]+(\.[0-9]+)?$

    Pattern: ^[0-9]+(\.[0-9]+)?$

    Pattern: ^[0-9]+(\.[0-9]+)?$

    Pattern: ^[0-9]+(\.[0-9]+)?$

    Pattern: ^[0-9]+(\.[0-9]+)?$

    Pattern: ^[0-9]+(\.[0-9]+)?$

    Pattern: ^[0-9]+(\.[0-9]+)?$

    Pattern: ^[0-9]+(\.[0-9]+)?$

    Lune-generated unique identifier.

    Client-side shipment reference identifier.

    Identifier of the supplier.

    Name of the supplier.

    Identifier of the shipper.

    Name of the shipper.

    Tags for categorising or filtering shipments.

    express
    economy
    priority

    exw
    fca
    cpt
    cip
    dap

    spot
    contract
    tender

    Whether the shipment contains hazardous cargo.

    Booking reference number.

    House waybill number.

    Purchase order reference identifier.

    Client-side identifier for the consignee.

    Name of the consignee.

    Client-side identifier for the consignor.

    Name of the consignor.

    Name of the freight paying party.

    Legal entity responsible for the shipment.

    Pattern: ^[0-9]+(\.[0-9]+)?$

    Specify the monetary value in the currency defined by the currency_code property in the request. If no currency_code is provided, the currency will default to that of the associated account.

    ISO 4217 3 character currency code.

    Note: Lune supports most but not all currency codes.

    AED
    AFN
    ALL
    AMD
    ANG

    Emission scope for the shipper contract.

    Source of the emissions data.

    ecotransit
    lune
    manual

    A shipment leg with its calculated emissions.

    Client-side identifier for this leg.

    1-based ordering of this leg within the shipment.

    pre
    main
    on

    Pattern: ^[0-9]+(\.[0-9]+)?$

    The estimated distance. Unit, km for kilometers, mi for miles

    km
    mi
    nm

    Name of the carrier for this leg.

    Standard Carrier Alpha Code.

    Master waybill number.

    Transit corridor to force the route through for sea legs. Only applicable to sea legs.

    panama
    suez
    cape_of_good_hope
    northwest_passage
    northeast_passage

    Transit corridors that should be avoided for sea legs. Only applicable to sea legs.

    The transit corridor used for sea shipments. This is used to improve the accuracy of the estimate. If not provided, the shortest route is calculated.

    Only applicable to sea shipments.

    panama
    suez
    cape_of_good_hope
    northwest_passage
    northeast_passage

    Pattern: ^[0-9]+(\.[0-9]+)?$

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

    g
    kg
    t
    lbs

    Pattern: ^[0-9]+(\.[0-9]+)?$

    Unit of volume measurement.

    l
    m3

    Number of pieces in the load.

    Pattern: ^[0-9]+(\.[0-9]+)?$

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

    g
    kg
    t
    lbs

    Details of a shipping container.

    Container number.

    20gp
    40gp
    40hc
    45hc
    20rf

    Pattern: ^[0-9]+(\.[0-9]+)?$

    TEU equivalent of the container.

    fcl
    lcl

    lightweight
    average
    heavyweight
    container_only

    Pattern: ^[0-9]+(\.[0-9]+)?$

    Measure of how fully the vehicle is utilising its cargo capacity (0 to 1).

    Pattern: ^[0-9]+(\.[0-9]+)?$

    Proportion of the vehicle's travel that is done empty (0 to 1).

    Pattern: ^[0-9]+(\.[0-9]+)?$

    Passenger utilisation factor for passenger transport modes (0 to 1).

    Estimated departure date or date-time.

    Estimated arrival date or date-time.

    Actual departure date or date-time.

    Actual arrival date or date-time.

    Pattern: ^[0-9]+(\.[0-9]+)?$

    Total emissions (kg CO2e).

    Pattern: ^[0-9]+(\.[0-9]+)?$

    Well-to-tank emissions (kg CO2e).

    Pattern: ^[0-9]+(\.[0-9]+)?$

    Tank-to-wheel emissions (kg CO2e).

    Pattern: ^[0-9]+(\.[0-9]+)?$

    Emission intensity.

    Pattern: ^[0-9]+(\.[0-9]+)?$

    Total particulate matter emissions (kg).

    Pattern: ^[0-9]+(\.[0-9]+)?$

    Well-to-tank particulate matter emissions (kg).

    Pattern: ^[0-9]+(\.[0-9]+)?$

    Tank-to-wheel particulate matter emissions (kg).

    Pattern: ^[0-9]+(\.[0-9]+)?$

    Total carbon dioxide emissions (kg).

    Pattern: ^[0-9]+(\.[0-9]+)?$

    Well-to-tank carbon dioxide emissions (kg).

    Pattern: ^[0-9]+(\.[0-9]+)?$

    Tank-to-wheel carbon dioxide emissions (kg).

    Pattern: ^[0-9]+(\.[0-9]+)?$

    Total nitrogen oxides emissions (kg).

    Pattern: ^[0-9]+(\.[0-9]+)?$

    Well-to-tank nitrogen oxides emissions (kg).

    Pattern: ^[0-9]+(\.[0-9]+)?$

    Tank-to-wheel nitrogen oxides emissions (kg).

    Pattern: ^[0-9]+(\.[0-9]+)?$

    Total sulfur dioxides emissions (kg).

    Pattern: ^[0-9]+(\.[0-9]+)?$

    Well-to-tank sulfur dioxides emissions (kg).

    Pattern: ^[0-9]+(\.[0-9]+)?$

    Tank-to-wheel sulfur dioxides emissions (kg).

    Pattern: ^[0-9]+(\.[0-9]+)?$

    Total non-methane hydrocarbons emissions (kg).

    Pattern: ^[0-9]+(\.[0-9]+)?$

    Well-to-tank non-methane hydrocarbons emissions (kg).

    Pattern: ^[0-9]+(\.[0-9]+)?$

    Tank-to-wheel non-methane hydrocarbons emissions (kg).

    Pattern: ^[0-9]+(\.[0-9]+)?$

    Primary energy consumption (MJ).

    Pattern: ^[0-9]+(\.[0-9]+)?$

    Fuel consumption (litres).

    Pattern: ^[0-9]+(\.[0-9]+)?$

    Distance (km).

    Pattern: ^[0-9]+(\.[0-9]+)?$

    Transport activity (tonne-kilometres).

    Description of the emission factor used.

    Region of the emission factor.

    Source of the emission factor.

    Pattern: ^[0-9]+(\.[0-9]+)?$

    Intensity value of the emission factor.

    Numerator unit of the emission factor.

    Denominator unit of the emission factor.

    Year of the emission factor.

    An <a href="https://pretty-rfc.herokuapp.com/RFC3339">RFC 3339</a>-formatted timestamp.

  • Sample response
  • Errors
    This API operation can return the following errors:
    HTTP status codeError code
    401
    404
    429