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 casesShipium 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.
- Create Shipment. Register the shipment with the Shipium platform by providing addresses, line items, dimensions, and weights. The response includes a
shipiumShipmentId. - Carrier and Method Selection (this API). Using the
shipiumShipmentIdfrom the previous step, ask Shipium to evaluate carriers and determine the optimal carrier and service method for the shipment. - 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 type | API endpoint |
|---|---|
| POST | https://api.shipium.com/api/v1/deliveryexperience/shipment/{shipiumShipmentId}/carrierSelection |
Authentication for API CallsIn the cURL example on this page, the environment variable
AUTHSTRINGis 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",
"name": "Default Ground Selection",
"serviceMethodIdsAfterExecutingRule": [
"fedex-ground"
]
},
"rulesApplied": [
{
"ruleId": "rule-001",
"ruleUrn": "urn:rule:rule-001",
"name": "Default Ground Selection",
"serviceMethodIdsAfterExecutingRule": [
"fedex-ground"
]
}
],
"ruleSetUrn": "urn:ruleset:default",
"processingTimestamp": "2024-03-21T17:29:52.100Z"
},
"effectiveShipDateTime": "2024-03-21T17:29:51.571Z",
"estimatedDeliveryDate": "2024-03-26T23:59:59.000Z",
"estimatedInjectionDateTime": "2024-03-21T18:00:00.000Z",
"effectiveDesiredDeliveryDate": "2024-03-27T23:59:59.000Z",
"currencyCode": "USD",
"injectionDetails": {
"requestInjectionProfileId": "0c3bdcfd-765b-4084-954e-76aa59dbd41d",
"partnerInjectionProfileId": "partner-injection-profile-001",
"shipiumInjectionProfileId": "shipium-injection-profile-001",
"requestInjectionSiteId": "3feb958c-414e-49f4-b15b-68f8f1cd02df",
"partnerInjectionSiteId": "partner-injection-site-001",
"shipiumInjectionSiteId": "shipium-injection-site-001",
"injectionCostDetails": {
"injectionLineItemRate": 2.30,
"injectionLineItemCurrencyCode": "usd",
"injectionRateModifier": {
"modifierType": "flat",
"modifierValue": 0
}
}
}
},
"carrierSelectionDateTime": "2024-03-21T17:29:52.000Z",
"carrierSelectionExpiration": "2024-03-22T17:29:52.000Z",
"details": {
"carrierSelectionServiceMethodSummaries": [
{
"partnerId": "9a8b7c6d-5e4f-3210-fedc-ba0987654321",
"serviceMethodIdentifier": "urn:carrierrate:86c6230a-4a2b-4f9b-8b71-a51627bbbcb2:1",
"carrierServiceMethodId": "fedex-ground",
"serviceMethodName": "FedEx Ground",
"carrierServiceName": "FedEx Ground",
"carrier": "fedex",
"carrierAccountId": "fedex-account-001",
"carrierSelectionStatus": "selected",
"carrierLabelStatus": "none",
"totalCost": 10.00,
"filterReasons": [],
"effectiveShipDate": "2024-03-21T17:29:51.571Z",
"estimatedInjectionDate": "2024-03-21T18:00:00.000Z",
"estimatedDeliveryDate": "2024-03-26T23:59:59.000Z"
},
{
"partnerId": "9a8b7c6d-5e4f-3210-fedc-ba0987654321",
"serviceMethodIdentifier": "urn:carrierrate:99d8341b-5c3e-4a7f-9c82-b62738cdef01:1",
"carrierServiceMethodId": "ups-ground",
"serviceMethodName": "UPS Ground",
"carrierServiceName": "UPS Ground",
"carrier": "ups",
"carrierAccountId": "ups-account-001",
"carrierSelectionStatus": "not_selected",
"carrierLabelStatus": "none",
"totalCost": 12.50,
"filterReasons": [],
"effectiveShipDate": "2024-03-21T17:29:51.571Z",
"estimatedInjectionDate": "2024-03-21T18:00:00.000Z",
"estimatedDeliveryDate": "2024-03-27T23:59:59.000Z"
}
]
},
"currencyCode": "USD"
}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
Field | Details |
|---|---|
| Type: String |
Conditional fields
Field | Details |
|---|---|
| Type: String (enumeration) |
| Type: Number (float) |
| Type: Number (float) |
| Type: Number (float) |
| Type: String |
Optional fields
Field | Details |
|---|---|
| Type: String (date-time) |
| Type: String (enumeration) |
| Type: String |
| Type: String |
| Type: String (enumeration) |
| Type: Number (float) |
| Type: Boolean |
| Type: String |
| Type: Boolean |
| Type: Boolean |
| Type: String |
| Type: Array of strings |
| Type: Array of strings |
| Type: Boolean |
Response attributes
The Carrier and Method Selection response attributes are defined in the following table.
Response attribute | Description |
|---|---|
| Unique ID of the carrier selection for later reference |
| The unique identifier for the shipment |
| The optional unique identifier that may be used for the shipment |
| The Shipium-generated tenant ID; when present, this is used to indicate the tenant associated with the shipment. |
| The tenant ID provided by your organization; when present, this is used to indicate the tenant associated with the shipment. |
| Defines the result of the carrier selection call; values returned will be |
| Details explaining the result status; pertinent when the status is |
| Your organization's unique ID |
| Unique ID of the carrier account selected for shipping |
| Identifier of the specific version of the service method of the shipping carrier selected |
| The carrier that was used for delivering the package to your customer |
| The name of the carrier service method selected |
| Indicates if the selected service method will be billed to a third party |
| Currency in which all price line items are stored |
| The cost of the shipment charged by the carrier |
| The cost of the insurance added to the shipment |
| Costs added to the shipment outside the normal basics of dock-to-dock transportation such as special equipment required, lift gates, or non-commercial destinations |
| Cost of duties added to the shipment |
| Cost of taxes added to the shipment |
| The total cost of the shipment |
| Cost used for carrier selection adjusted based on limit minimums |
| Cost expected to be provided in the carrier response, not including custom adjustments or hidden surcharges |
| Expected cost that the carrier will charge |
| Carrier invoice cost plus operational costs such as injection line haul |
| Name of the carrier service method selected during the carrier selection process |
| Maps to the unique internal Shipium ID that represents a carrier service method definition; see Supported Carriers for a list of carrier service method IDs. |
| Description of the result of the rule set processing; values returned will be |
| Ordered list of service methods selected by the rule set processing if a selection was made |
| The unique ID of the rule processed |
| The URN of the rule processed |
| The name of the rule processed |
| Versioned identifier of the rule set processed |
| The timestamp at which the rule set was processed |
| The 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 |
| The date and time by when the package is estimated to be delivered to the customer |
| The estimated date that the shipment will arrive at the injection site |
| The 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. |
| The currency in which all shipping carrier selection costs were calculated |
| You can provide either |
| Unique to the asset ID that you provided to the injection profile. |
| Injection profile identifier |
| You can provide either |
| Unique to the partner asset ID that you provided to the injection site |
| Injection site identifier |
| The amount of the rate modification |
| The currency of the rate |
| The type of the injection rate modifier |
| The value of the modification |
| The ISO-8601 formatted date when the carrier selection decision was made |
| The ISO-8601 formatted date defining the point in time when the carrier selection details expire and cannot be acted upon |
| A summary of all service methods considered during carrier selection, including their estimated costs, delivery dates, and filter reasons if they were not selected. |
| The carrier service method identifier |
| The display name of the service method |
| The carrier identifier |
| The selection status for this service method (e.g., |
| The total cost for this service method |
| The estimated delivery date for this service method |
| The reasons this service method was filtered out of consideration, if applicable |
| The 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:
Updated 15 days ago
