Shipment Planning API

Determine when shipments should be shipped with Shipium's Shipment Planning API.

Get started

To use the Shipment Planning API, you must first configure your account. Guidance can be found in the Shipment Planning documentation. This document provides instructions for using the API.

Retrieve shipment planning guidance from the Shipment Planning API

The Shipium Shipment Planning API is designed to be flexible to fit your organization’s business strategy and technical capabilities. All API calls assume you're using one of the authentication mechanisms detailed in our authentication documentation. The endpoint for all Shipment Planning API calls is included in the table below.

API typeAPI endpoint
POSThttps://api.shipium.com/api/v1/deliveryexperience/shipmentPlanning

The following table provides all required and optional field descriptions for calling the Shipment Planning API.

Request fieldRequired/OptionalField propertiesDescription
requestDate OverrideOptionalString
Ex.: 2019-10-31T20:00:00Z
Overrides the request date to a specific date and time from which the ship-by and drop-by date are calculated
desiredDelivery DateRequiredString
Ex.: 2019-10-31T20:00:00Z
The string representation of either an ISO-8601 date or a local date for desired delivery: yyyy-mm-dd. The date or date-time the package is intended to arrive to the customer. This is used to determine the most appropriate service method when generating a label.
desiredDelivery DateOptions .exactDateDeliveryOptionalBoolean
true or false
This optional flag indicates that a shipment carrier selection and exact date delivery is targeting the requested desired delivery date with no tolerance for before or after. The default value is false.
carrierService MethodAllowListOptionalString
Ex.: ups-ground-service-method
A list of carrierServiceMethodId and/or carriers that should be considered for selection; either carrierServiceMethodAllowList or shipOption may be provided but not both.
shipmentParameters .originIdOptional, but required if countryCode and postalCode are not provided for the ship-from addressStringA unique identifier associated with the shipping origin; when this value is absent, the countryCode and postalCode for the ship-from address are required.
shipmentParameters .shipFromAddress .street1OptionalStringThe first origin address line
shipmentParameters .shipFromAddress .street2OptionalStringThe second origin address line
shipmentParameters .shipFromAddress .cityOptionalStringThe name of the city for the origin address
shipmentParameters .shipFromAddress .stateOptionalStringThe two-letter postal abbreviation of the state for the origin address
shipmentParameters .shipFromAddress .countryCodeOptional, but required if originId is not providedStringThe ISO 3166-1 country code for the origin address; when this value is absent, the originId is required.
shipmentParameters .shipFromAddress .postalCodeOptional, but required if originId is not providedStringA country-code-appropriate postal code for the origin address; when this value is absent, the originId is required.
shipmentParameters .shipFromAddress .addressTypeOptionalString enumeration
Values are:

- commercial
- residential
The type of location for the origin address; the default value is residential.
shipmentParameters .destinationAddress .street1OptionalStringThe first destination address line
shipmentParameters .destinationAddress .street2OptionalStringThe second destination address line
shipmentParameters .destinationAddress .cityOptionalStringThe name of the city for the destination address
shipmentParameters .destinationAddress .stateOptionalStringThe 2-letter postal abbreviation of the state for the destination address
shipmentParameters .destinationAddress .countryCodeRequiredStringThe ISO 3166-1 country code for the destination address
shipmentParameters .destinationAddress .postalCodeRequiredStringA country-code-appropriate postal code for the destination address
shipmentParameters .destinationAddress .addressTypeOptionalString enumeration
Values are:

- commercial
- residential
The type of location for the destination address; the default value is residential.
shipmentParameters .fulfillment ContextOptionalStringFulfillment context alias used in the fulfillment context detail search
shipmentParameters .shipOptionOptionalString
Ex.: standard
A high-level shipping option shown to or selected by a customer; either carrierServiceMethodAllowList or shipOption may be provided but not both.
shipmentParameters .deliverySignature OptionOptionalString enumeration
Values are:
-AdultResidentSignature

- AdultSignature
- None
- ResidentSignature
- Signature
- Unknown
A delivery signature option passed in the API request; the default value is none.
partnerReference IdentifierOptionalString
No character limitations
A reference identifier your organization can provide to use for reporting purposes
referenceIdentifierOptionalString
No character limitations
An optional identifier you can provide to reference the shipment
reference Identifiers.nameOptionalString
No character limitations
Optionally include your organization's own identifier to be associated with the shipment for internal tracking.
reference Identifiers.valueOptionalString
No character limitations
Optionally include your organization's own value to be associated with the specified name, associated with this shipment for internal tracking.

The primary elements of the response (other than the request elements) are listed in this table. The primary pieces of data returned are the fcDropDate and the shipByDate, representing when a shipment should be sent to the fulfillment center (FC) and when it should be shipped, respectively, in order to get it to the customer by the requested desiredDeliveryDate.

Response attributeDescription
shipmentPlanningIdUnique Shipium-generated ID associated with the request and response
fcDropByDateThe date by which the fulfillment center (FC) should begin processing of the shipment in order to hit the desired delivery date that was requested. This value is calculated based on the shipByDate and a calculation using the FC processing time configured for the appropriate origin.
shipByDateThe date by which the FC should ship the shipment in order to hit the desired delivery date that was requested.
estimateSourceThe source of the times in transit (TNTs) that were utilized as part of the calculation. This will be one of ShipiumCalculated, PartnerProvided, or CarrierProvided.
estimatedTransitDaysThe number of transit days between the desired delivery date and the estimated ship by date
shipDateExceptionA boolean value that is true only if some exception in providing a shipByDate exists

In addition to these primary response elements, if the requested desired delivery date would have required a ship date in the past, the shipDateExceptionDetails attributes in the following table will be returned in the response as well as shipDateException being set to true.

Response attributeDescription
shipDateExceptionDetails.exceptions.exceptionTypeThe type of exception for the ship date calculation exception
shipDateExceptionDetails.exceptions.exceptionDescriptionA description of the type of exception for the ship date calculation exception
shipDateExceptionDetails.effectiveShipByDateProvides an effective ship-by date in the local timezone of the origin
shipDateExceptionDetails.effectiveDeliveryDateProvides an effective delivery date in the local timezone of the destination

When the Shipment Planning service initially thinks a shipment should have already been shipped and provides an estimated ship date that is in the past, Shipium adjusts the ship date by selecting the shipping cutoff time for the selected carrier and service method configured for the origin (fulfillment center, FC) from which the package is being shipped. For example, if a request was made at 2024-06-13T19:23:12-06:00 and the cutoff time for the carrier service method configured for the FC was 14:00, the resulting exception ship date would be 2024-06-14T14:00:00-06:00.

Basic shipment planning request and response

Example cURL call

This example shows a typical Shipment Planning API call cURL request:

curl --request POST \
  --url '<<api_url>>/api/v1/deliveryexperience/shipmentPlanning' \
  --header 'accept: application/json' \
  --header $AUTHSTRING \
  --header 'content-type: application/json' \
  --data 'INSERT REQUEST BODY FROM BELOW'

Example request body using ship option

This is an example JSON request. Note that the referenceIdentifiers section is not required, but may be helpful for tagging certain requests for debugging purposes later.

{
  "requestDateOverride": "2024-08-20T10:50:42Z",
  "desiredDeliveryDate": "2024-08-24T23:59:59-04:00",
  "desiredDeliveryDateOptions": {
      "exactDateDelivery": false
    },
  "carrierServiceMethodAllowList": [],
  "shipmentParameters": {
    "shipFromAddress": {
      "street1": "123 Main St.",
      "street2": "Suite 42",
      "city": "Albuquerque",
      "state": "NM",
      "countryCode": "US",
      "postalCode": "87121",
      "addressType": "commercial"
    },
    "destinationAddress": {
      "street1": "123 Main St.",
      "street2": "Suite 42",
      "city": "Albuquerque",
      "state": "NM",
      "countryCode": "US",
      "postalCode": "87121",
      "addressType": "commercial"
    },
    "fulfillmentContext": "123456",  
    "shipOption": "standard",
    "deliverySignatureOption": "none"
  },
  "partnerReferenceIdentifier": "shipmentPlanA1",
  "referenceIdentifier": "76d8e547-a553-4627-b721-ccfcf350c866",
  "referenceIdentifiers": [
        {
          "name": "order-instance-ID",
          "value": "1350000_2024-08-20 00:01:26 UTC"
        }
  ],
}

Example response body using ship option

{
  "shipmentPlanningId": "8ffa82ab-e67a-4b9f-bed6-d3b29b088bb1",
  "shippingOrigin": {
      "countryCode": "US",
      "postalCode": "98101",
      "shipiumOriginId": "d1135cd9-3f8b-4a54-b8cb-573f0ab6870d",
      "originProcessingDays": 1.0
  },
  "carrierServiceMethodAllowList": [],
  "shipmentParameters": {
    "shipFromAddress": {
      "street1": "123 Main St.",
      "street2": "Suite 42",
      "city": "Seattle",
      "state": "WA",
      "countryCode": "US",
      "postalCode": "98101",
      "addressType": "commercial"
    },
    "destinationAddress": {
      "street1": "123 Main St.",
      "street2": "Suite 42",
      "city": "Albuquerque",
      "state": "NM",
      "countryCode": "US",
      "postalCode": "87121",
      "addressType": "commercial"
    },
    "fulfillmentContext": "123456",  
    "shipOption": "standard",
    "deliverySignatureOption": "none"
  },
  "desiredDeliveryDate": "2021-11-20T00:00:00Z",
  "desiredDeliveryDateOptions": {
      "exactDateDelivery": false
    },
  "requestDateOverride": "2024-08-20T10:50:42Z",
  "shipByDate": "2021-11-17T22:00:00-07:00",
  "fcDropByDate": "2021-11-16T00:00:01-07:00",
  "estimateSource": "ShipiumCalculated",
  "estimatedTransitDays": 3,
  "shipDateException": false,
  "partnerReferenceIdentifier": "shipmentPlanA1",
  "referenceIdentifier": "76d8e547-a553-4627-b721-ccfcf350c866",
  "referenceIdentifiers": [
        {
          "name": "order-instance-ID",
          "value": "1350000_2024-08-20 00:01:26 UTC"
        }
    ]
}

Example response body using ship option with a ship date exception

In the event that there is an issue with providing back a shipByDate for the passed desiredDeliveryDate, the API will set the field shipDateException to true and provide details for the best possible effectiveShipByDate and effectiveDeliveryDate based on the passed parameters.

{
  "shipmentPlanningId": "8ffa82ab-e67a-4b9f-bed6-d3b29b088bb1",
  "shippingOrigin": {
      "countryCode": "US",
      "postalCode": "97005",
      "shipiumOriginId": "a97a9ffc-ce6c-44dd-9831-7497bf0838ce",
      "originProcessingDays": 1.0
  },
  "carrierServiceMethodAllowList": [],
  "shipmentParameters": {
    "shipFromAddress": {
      "street1": "123 Main St.",
      "street2": "Suite 42",
      "city": "Seattle",
      "state": "WA",
      "countryCode": "US",
      "postalCode": "98101",
      "addressType": "commercial"
    },
    "destinationAddress": {
      "street1": "123 Main St.",
      "street2": "Suite 42",
      "city": "Albuquerque",
      "state": "NM",
      "countryCode": "US",
      "postalCode": "87121",
      "addressType": "commercial"
    },
    "fulfillmentContext": "123456",  
    "shipOption": "standard",
    "deliverySignatureOption": "none"
  },
  "desiredDeliveryDate": "2021-11-20T00:00:00Z",
  "desiredDeliveryDateOptions": {
      "exactDateDelivery": false
    },
  "requestDateOverride": "2024-08-20T10:50:42Z",
  "shipByDate": "2021-11-15T11:09:52.071939792-07:00",
  "fcDropByDate": "2021-11-16T00:00:01-07:00",
  "estimateSource": "ShipiumCalculated",
  "estimatedTransitDays": 3,
  "shipDateException": true,
  "shipDateExceptionDetails": {
    "exceptions": [
      {
        "exceptionType": "LateDeliveryDate",
        "exceptionDescription": "The effectiveShipByDate results in a delivery date past the desiredDeliveryDate."
      }
    ],
    "effectiveShipByDate": "2021-11-17T22:00:00-07:00",
    "effectiveDeliveryDate": "2021-11-21T22:00:00-07:00"
  },
  "partnerReferenceIdentifier": "shipmentPlanA1",
  "referenceIdentifier": "76d8e547-a553-4627-b721-ccfcf350c866",
  "referenceIdentifiers": [
        {
          "name": "order-instance-ID",
          "value": "1350000_2024-09-30 00:01:26 UTC"
        }
    ]
}

Example request body using carrier service method allow list

{
  "requestDateOverride": "2024-08-20T10:50:42Z",
  "desiredDeliveryDate": "2024-08-24T23:59:59-04:00",
  "desiredDeliveryDateOptions": {
      "exactDateDelivery": false
    },
  "carrierServiceMethodAllowList": [
    "usps-ground-advantage-service-method",
    "ups-ground-service-method"
  ],
  "shipmentParameters": {
    "shipFromAddress": {
      "street1": "123 Main St.",
      "street2": "Suite 42",
      "city": "Albuquerque",
      "state": "NM",
      "countryCode": "US",
      "postalCode": "87121",
      "addressType": "commercial"
    },
    "destinationAddress": {
      "street1": "123 Main St.",
      "street2": "Suite 42",
      "city": "Albuquerque",
      "state": "NM",
      "countryCode": "US",
      "postalCode": "87121",
      "addressType": "commercial"
    },
    "fulfillmentContext": "123456",  
    "shipOption": null,
    "deliverySignatureOption": "none"
  },
  "partnerReferenceIdentifier": "shipmentPlanA1",
  "referenceIdentifier": "76d8e547-a553-4627-b721-ccfcf350c866",
  "referenceIdentifiers": [
        {
          "name": "order-instance-ID",
          "value": "1350000_2024-08-20 00:01:26 UTC"
        }
  ],
}

Example response body using carrier service method allow list

{
  "shipmentPlanningId": "8ffa82ab-e67a-4b9f-bed6-d3b29b088bb1",
  "shippingOrigin": {
      "countryCode": "US",
      "postalCode": "98101",
      "shipiumOriginId": "d1135cd9-3f8b-4a54-b8cb-573f0ab6870d",
      "originProcessingDays": 1.0
  },
  "carrierServiceMethodAllowList": [
    "usps-ground-advantage-service-method",
    "ups-ground-service-method"
  ],
  "shipmentParameters": {
    "shipFromAddress": {
      "street1": "123 Main St.",
      "street2": "Suite 42",
      "city": "Seattle",
      "state": "WA",
      "countryCode": "US",
      "postalCode": "98101",
      "addressType": "commercial"
    },
    "destinationAddress": {
      "street1": "123 Main St.",
      "street2": "Suite 42",
      "city": "Albuquerque",
      "state": "NM",
      "countryCode": "US",
      "postalCode": "87121",
      "addressType": "commercial"
    },
    "fulfillmentContext": "123456",  
    "shipOption": null,
    "deliverySignatureOption": "none"
  },
  "desiredDeliveryDate": "2021-11-20T00:00:00Z",
  "desiredDeliveryDateOptions": {
      "exactDateDelivery": false
    },
  "requestDateOverride": "2024-08-20T10:50:42Z",
  "shipByDate": "2021-11-17T22:00:00-07:00",
  "fcDropByDate": "2021-11-16T00:00:01-07:00",
  "estimateSource": "ShipiumCalculated",
  "estimatedTransitDays": 3,
  "shipDateException": false,
  "partnerReferenceIdentifier": "shipmentPlanA1",
  "referenceIdentifier": "76d8e547-a553-4627-b721-ccfcf350c866",
  "referenceIdentifiers": [
        {
          "name": "order-instance-ID",
          "value": "1350000_2024-08-20 00:01:26 UTC"
        }
    ]
}

Shipment planning request and response with minimal requirements

Example cURL request

curl --request POST \
  --url '<<api_url>>/api/v1/deliveryexperience/shipmentPlanning' \
  --header 'accept: application/json' \
  --header $AUTHSTRING \
  --header 'content-type: application/json' \
  --data 'INSERT REQUEST BODY FROM BELOW'

Example request body

{
  "desiredDeliveryDate": "2024-08-24T23:59:59-04:00",
  "shipmentParameters": {
    "destinationAddress": {
      "countryCode": "US",
      "postalCode": "10005", 
      "addressType": "commercial"
    },
  },
  "partnerReferenceIdentifier": "shipmentPlanD1"
}

Example response body

{
  "shipmentPlanningId": "8ffa82ab-e67a-4b9f-bed6-d3b29b088bb1",
  "shippingOrigin": {
      "countryCode": "US",
      "postalCode": "98101",
      "shipiumOriginId": "d1135cd9-3f8b-4a54-b8cb-573f0ab6870d",
      "originProcessingDays": 1.0
  },
  "carrierServiceMethodAllowList": [],
  "shipmentParameters": {
    "shipFromAddress": null,
    "destinationAddress": {
      "street1": null,
      "street2": null,
      "city": null,
      "state": null,
      "countryCode": "US",
      "postalCode": "10005",
      "addressType": "commercial"
    },
    "fulfillmentContext": null,  
    "shipOption": "standard",
    "deliverySignatureOption": "none"
  },
  "desiredDeliveryDate": "2024-08-24T23:59:59-04:00",
  "desiredDeliveryDateOptions": {
      "exactDateDelivery": false
    },
  "shipByDate": "2021-11-17T22:00:00-07:00",
  "fcDropByDate": "2021-11-16T00:00:01-07:00",
  "estimateSource": "ShipiumCalculated",
  "estimatedTransitDays": 3,
  "shipDateException": false,
  "partnerReferenceIdentifier": "shipmentPlanD1"
}

📘

More information on the API responses

As with all Shipium API responses, this API follows the API Response Codes standards unless otherwise specified.

Resources

Your Shipium team member is available to help along the way. However, you might find these resources helpful: