Carrier and Method Selection API

Determine the carrier ship method that meets your needs with Shipium's Carrier and Method Selection API.

Get started

To use the Carrier and Method Selection API, you must first set up your account to use Shipium's Carrier and Method Selection service. Information about carrier and method selection within the Shipium platform and setting up your organization's account to use the service can be found in the Carrier and Method Selection documentation.

The rest of this document provides instructions for using the API.

How the Carrier and Method Selection API fits into your workflow

The Carrier and Method Selection API runs carrier selection on a shipment that already exists in the Shipium platform. Unlike the Carrier and Method Selection & Shipment Label API, which handles shipment creation, carrier selection, and label generation in a single call, this API is designed for organizations that manage these steps separately.

📘

Recommended approach for most use cases

Shipium recommends the Carrier and Method Selection & Shipment Label API for most organizations, whether or not you need to generate a shipping label. The Carrier and Method Selection API is intended for multi-step workflows where your organization needs to decouple shipment creation and carrier selection into separate API calls.

Pre-requisite: Create a shipment

Before calling the Carrier and Method Selection API, you must create a shipment in the Shipium platform using the Create Shipment endpoint (POST /api/v1/deliveryexperience/shipment). The Create Shipment call is where you provide the shipment's origin and destination addresses, line items, package dimensions, weights, and other shipment details. Shipium stores this data and returns a shipiumShipmentId that you will use as a path parameter when calling the Carrier and Method Selection API.

Because the shipment data is already stored, the Carrier and Method Selection API request body contains only carrier selection parameters that influence how the selection is made, such as currency, packaging type overrides, and filtering controls. You do not need to provide addresses, line items, or other shipment details again.

Multi-step workflow

In a multi-step workflow, your organization separates the shipment process into distinct API calls.

  1. Create Shipment. Register the shipment with the Shipium platform by providing addresses, line items, dimensions, and weights. The response includes a shipiumShipmentId.
  2. Carrier and Method Selection (this API). Using the shipiumShipmentId from the previous step, ask Shipium to evaluate carriers and determine the optimal carrier and service method for the shipment.
  3. Label Generation. Generate a shipping label based on the carrier decision.

This approach is useful when your organization needs to review the carrier decision before committing to a label, runs carrier selection at a different point in the warehouse workflow than label printing, or needs to re-run carrier selection on the same shipment if conditions change.

For guidance on creating shipments with partial data and completing them at a later time, see Partial (Multi-Step) Shipments.

Determine carrier and ship method with the Carrier and Method Selection API

The Shipium Carrier and Method Selection API assumes you're using one of the authentication mechanisms detailed in our authentication documentation. The endpoint for Carrier and Method Selection API calls is included in the table below.

API typeAPI endpoint
POSThttps://api.shipium.com/api/v1/deliveryexperience/shipment/{shipiumShipmentId}/carrierSelection
🔐

Authentication for API Calls

In the cURL example on this page, the environment variable AUTHSTRING is used to handle authorization. The recipe below shows how to set it correctly for both API Key and OAuth users.

Example cURL call

This example shows a request to run the carrier selection process on an existing shipment:

curl --request POST \
  --url https://api.shipium.com/api/v1/deliveryexperience/shipment/{shipiumShipmentId}/carrierSelection \
  --header 'accept: application/json' \
  --header $AUTHSTRING \
  --header 'content-type: application/json' \
  --data 'INSERT REQUEST BODY FROM BELOW'

Example request body

The following fields should be included in your JSON request.

{
  "currencyCode": "usd",
  "shippedDateTime": "2024-03-21T17:29:51.571Z",
  "packagingType": {
    "packagingMaterial": "box",
    "packagingSizeName": "13x12x10 box",
    "packagingTypeId": "ebd94f8b-d390-4c9c-987f-b88343f5bf45",
    "linearDimensions": {
      "linearUnit": "in",
      "length": 13,
      "width": 12,
      "height": 10
    },
    "packagingWeight": {
      "weightUnit": "lb",
      "weight": 50
    }
  },
  "carrierServiceMethodAllowList": [
    "fedex-ground",
    "ups-ground"
  ],
  "includeInjectionProfiles": true,
  "injectionParameters": [
    {
      "injectionProfileId": "0c3bdcfd-765b-4084-954e-76aa59dbd41d",
      "injectionSiteId": "3feb958c-414e-49f4-b15b-68f8f1cd02df"
    }
  ],
  "ignoreCarrierMinimumDimensions": false,
  "serviceMethodPoBoxAllowList": [
    "usps-priority-mail"
  ],
  "testMode": true
}

Example response body

{
  "carrierSelectionId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
  "shipiumShipmentId": "f47ac10b-58cc-4372-a567-0e02b2c3d479",
  "partnerShipmentId": "YOUR-SHIPMENT-ID-001",
  "shipiumTenantId": "9a8b7c6d-5e4f-3210-fedc-ba0987654321",
  "partnerTenantId": "your-partner-tenant-id",
  "carrierDecision": {
    "status": "success",
    "statusDetails": "Carrier selection completed successfully",
    "partnerId": "9a8b7c6d-5e4f-3210-fedc-ba0987654321",
    "carrierAccountId": "fedex-account-001",
    "serviceMethodIdentifier": "urn:carrierrate:86c6230a-4a2b-4f9b-8b71-a51627bbbcb2:1",
    "carrier": "fedex",
    "carrierServiceName": "FedEx Ground",
    "serviceMethodName": "FedEx Ground",
    "carrierServiceMethodId": "fedex-ground",
    "thirdPartyBilling": false,
    "carrierEstimatedPriceDetails": {
      "currencyCode": "usd",
      "shippingCost": 8.75,
      "insuranceCost": 0,
      "accessorials": 1.25,
      "duty": 0,
      "taxes": 0,
      "totalCost": 10.00,
      "adjustedLabelCost": 10.00,
      "carrierCompareCost": 9.50,
      "carrierInvoiceCost": 10.00,
      "operationalCost": 10.00
    },
    "ruleSetProcessingResultSummary": {
      "result": "selection_made",
      "selectedCarrierServiceMethodIdentifiers": [
        "fedex-ground"
      ],
      "ruleMakingSelection": {
        "ruleId": "rule-001",
        "ruleUrn": "urn:rule:rule-001",

Request and response fields for API calls

The following tables provide required, conditional, and optional fields for calling the Carrier and Method Selection API. You can find additional support in the Carrier and Method Selection API Reference.

Required fields

FieldDetails
currencyCodeType: String
Example: usd
Description: Currency in which all the rates for shipping carrier selection costs will be calculated

Conditional fields

FieldDetails
packagingType.linearDimensions.linearUnitType: String (enumeration)
Values: cm (centimeter), in (inch)
Condition: Required if packagingTypeId is not included
Description: The unit in which linear dimensions are provided
packagingType.linearDimensions.lengthType: Number (float)
Example: 13
Condition: Required if packagingTypeId is not included
Description: The longest linear dimension (i.e., the longest side of a box or envelope)
packagingType.linearDimensions.widthType: Number (float)
Example: 12
Condition: Required if packagingTypeId is not included
Description: The second longest linear dimension (i.e., the second longest side of a box or envelope)
packagingType.linearDimensions.heightType: Number (float)
Example: 10
Condition: Required if packagingTypeId is not included
Description: The shortest linear dimension.
Note on envelopes: This height should represent the highest product you would reasonably put in this envelope before losing more than 10% of the length of the envelope in other dimensions.
injectionParameters.injectionSiteIdType: String
Condition: Must be paired with injectionProfileId
Description: The Shipium ID or the partner-provided ID of an injection site that should be considered during carrier selection. If an injection site ID is specified, it must be accompanied by an injection profile ID.

Optional fields

FieldDetails
shippedDateTimeType: String (date-time)
Example: 2025-09-17T20:10:17.123456Z
Description: The timestamp for when a partner shipped the product from their warehouse; the timestamp must be a valid ISO 8601 timestamp.
packagingType.packagingMaterialType: String (enumeration)
Values: box, envelope, flat_pack, mailing_tube, parcel_pallet
Description: The type of packaging used to create the package for the shipment
packagingType.packagingSizeNameType: String
Example: 13x12x10 box
Description: A custom name for the packaging
packagingType.packagingTypeIdType: String
Example: ebd94f8b-d390-4c9c-987f-b88343f5bf45
Description: The packagingTypeId that was used for this package. When this value is present, the dimensions defined in the partner are used. When this value is absent, linearDimensions is required.
packagingType.packagingWeight.weightUnitType: String (enumeration)
Values: g (gram), kg (kilogram), lb (pound), oz (ounce)
Description: The unit in which weight values are provided
packagingType.packagingWeight.weightType: Number (float)
Example: 50
Description: The value of the weight
includeInjectionProfilesType: Boolean
Values: true or false
Description: If true, service methods from the configured injection profiles will be considered during carrier selection.
injectionParameters.injectionProfileIdType: String
Description: The Shipium ID or the partner-provided ID of an injection profile that should be considered during carrier selection
testModeType: Boolean
Values: true or false
Description: If true, no actual labels are created, only a representation of the label. No money is charged to the underlying account.
ignoreRuleSetsType: Boolean
Values: true or false
Description: When true, any configured rule sets will be ignored during carrier selection.
customsInfo.taxIdentificationNumberType: String
Example: 12345
Description: This optional value can be passed to override any tax ID number (also known as an employer identification number, or EIN) that is configured in your network settings.
carrierServiceMethodAllowListType: Array of strings
Description: A list of carrierServiceMethodId values and/or carrier names that should be considered for selection. When provided, only the specified carriers and service methods will be evaluated. If an empty list is passed, it is treated as if no list was specified. You can find a list of carrierServiceMethodId values in Supported Carriers.
serviceMethodPoBoxAllowListType: Array of strings
Description: A list of serviceMethodId values that will be considered for USPS PO box delivery that otherwise would be filtered out as they do not support USPS PO box delivery for the shipment. You can find a list of serviceMethodId values in Supported Carriers.
ignoreCarrierMinimumDimensionsType: Boolean
Values: true or false
Description: When true, the minimum dimensions of carriers will effectively be ignored when deciding if a carrier service method is eligible to be considered during costing. The default value is false.

Response attributes

The Carrier and Method Selection response attributes are defined in the following table.

Response attributeDescription
carrierSelectionIdUnique ID of the carrier selection for later reference
shipiumShipmentIdThe unique identifier for the shipment
partnerShipmentIdThe optional unique identifier that may be used for the shipment
shipiumTenantIdThe Shipium-generated tenant ID; when present, this is used to indicate the tenant associated with the shipment.
partnerTenantIdThe tenant ID provided by your organization; when present, this is used to indicate the tenant associated with the shipment.
carrierDecision.statusDefines the result of the carrier selection call; values returned will be success, no_decision, or uncosted.
carrierDecision.statusDetailsDetails explaining the result status; pertinent when the status is no_decision
carrierDecision.partnerIdYour organization's unique ID
carrierDecision.carrierAccountIdUnique ID of the carrier account selected for shipping
carrierDecision.serviceMethodIdentifierIdentifier of the specific version of the service method of the shipping carrier selected
carrierDecision.carrierThe carrier that was used for delivering the package to your customer
carrierDecision.carrierServiceNameThe name of the carrier service method selected
carrierDecision.thirdPartyBillingIndicates if the selected service method will be billed to a third party
carrierDecision.carrierEstimatedPriceDetails .currencyCodeCurrency in which all price line items are stored
carrierDecision.carrierEstimatedPriceDetails .shippingCostThe cost of the shipment charged by the carrier
carrierDecision.carrierEstimatedPriceDetails .insuranceCostThe cost of the insurance added to the shipment
carrierDecision.carrierEstimatedPriceDetails .accessorialsCosts added to the shipment outside the normal basics of dock-to-dock transportation such as special equipment required, lift gates, or non-commercial destinations
carrierDecision.carrierEstimatedPriceDetails .dutyCost of duties added to the shipment
carrierDecision.carrierEstimatedPriceDetails .taxesCost of taxes added to the shipment
carrierDecision.carrierEstimatedPriceDetails .totalCostThe total cost of the shipment
carrierDecision.carrierEstimatedPriceDetails .adjustedLabelCostCost used for carrier selection adjusted based on limit minimums
carrierDecision.carrierEstimatedPriceDetails .carrierCompareCostCost expected to be provided in the carrier response, not including custom adjustments or hidden surcharges
carrierDecision.carrierEstimatedPriceDetails .carrierInvoiceCostExpected cost that the carrier will charge
carrierDecision.carrierEstimatedPriceDetails .operationalCostCarrier invoice cost plus operational costs such as injection line haul
carrierDecision.serviceMethodNameName of the carrier service method selected during the carrier selection process
carrierDecision.carrierServiceMethodIdMaps to the unique internal Shipium ID that represents a carrier service method definition; see Supported Carriers for a list of carrier service method IDs.
carrierDecision.ruleSetProcessingResultSummary .resultDescription of the result of the rule set processing; values returned will be selection_made or no_selection.
carrierDecision.ruleSetProcessingResultSummary .selectedCarrierServiceMethodIdentifiersOrdered list of service methods selected by the rule set processing if a selection was made
carrierDecision.ruleSetProcessingResultSummary .ruleMakingSelection.ruleIdThe unique ID of the rule processed
carrierDecision.ruleSetProcessingResultSummary .ruleMakingSelection.ruleUrnThe URN of the rule processed
carrierDecision.ruleSetProcessingResultSummary .ruleMakingSelection.nameThe name of the rule processed
carrierDecision.ruleSetProcessingResultSummary .ruleSetUrnVersioned identifier of the rule set processed
carrierDecision.ruleSetProcessingResultSummary .processingTimestampThe timestamp at which the rule set was processed
carrierDecision.effectiveShipDateTimeThe earliest that a shipment can leave the fulfillment center, or origin, based on the shipped date time and the schedules for that origin and the carriers
carrierDecision.estimatedDeliveryDateThe date and time by when the package is estimated to be delivered to the customer
carrierDecision.estimatedInjectionDateTimeThe estimated date that the shipment will arrive at the injection site
carrierDecision.effectiveDesiredDeliveryDateThe adjusted desired delivery date that Shipium used for carrier selection. This date includes all adjustments Shipium has made to the requested desired delivery date, such as business rules and holidays.
carrierDecision.currencyCodeThe currency in which all shipping carrier selection costs were calculated
carrierDecision.injectionDetails .requestInjectionProfileIdYou can provide either partnerInjectionProfileId or shipiumInjectionProfileId in the request, and this attribute records the injection profile identifier you provided in the request.
carrierDecision.injectionDetails .partnerInjectionProfileIdUnique to the asset ID that you provided to the injection profile.
carrierDecision.injectionDetails .shipiumInjectionProfileIdInjection profile identifier
carrierDecision.injectionDetails .requestInjectionSiteIdYou can provide either partnerInjectionSiteId or shipiumInjectionSiteId in the request, and this attribute records the injection site identifier you provided in the request.
carrierDecision.injectionDetails .partnerInjectionSiteIdUnique to the partner asset ID that you provided to the injection site
carrierDecision.injectionDetails .shipiumInjectionSiteIdInjection site identifier
carrierDecision.injectionDetails .injectionCostDetails.injectionLineItemRateThe amount of the rate modification
carrierDecision.injectionDetails .injectionCostDetails .injectionLineItemCurrencyCodeThe currency of the rate
carrierDecision.injectionDetails .injectionCostDetails.injectionRateModifier .modifierTypeThe type of the injection rate modifier
carrierDecision.injectionDetails .injectionCostDetails.injectionRateModifier .modifierValueThe value of the modification
carrierSelectionDateTimeThe ISO-8601 formatted date when the carrier selection decision was made
carrierSelectionExpirationThe ISO-8601 formatted date defining the point in time when the carrier selection details expire and cannot be acted upon
currencyCodeThe currency in which all shipping carrier selection costs were calculated

Resources

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


Did this page help you?