Specifying Carrier Service and Method
You should probably not use this option!
This variable and mechanism should only ever be used as an option of last resort. You are potentially choosing from amongst a more limited set of options than are available to you for shipping and this could have an impact on delivery performance or cost.
Likewise, limiting the list of carrier service methods make it more likely that you will get no eligible carrier errors.
If you do want to limit the set of carrier methods available when choosing a carrier and method during a call to carrier selection (whether getting a label or not), you can optionally provide a carrierServiceMethodAllowList
in the API call.
The carrierServiceMethodAllowList
takes one or more of the carrierServiceMethodId values listed in Supported Carriers provided in an array as its value. Based on that value, it chooses the best carrier and ship method from that list that meets the other criteria specified in the API call.
Example
This example shows a sample of using carrierServiceMethodAllowList
in an example in which we want to limit the carrier methods to only USPS First Class Package Service or UPS Ground.
The following can be added to the top-level body of the message when creating a shipment with ShipmentParameters
or to the megamethod request. Please note that this is not part of the "shipmentParameters"
, but exists at the same level.
{
...
"shipmentParameters": {
...
},
...
"carrierServiceMethodAllowList": [
"usps-first-class-package-service-method",
"ups-ground-service-method"
],
...
}
You can find the full list of carrierServiceMethod
values that are supported here: Supported Carriers.
Updated about 2 months ago