Skip to content

Purchase Shipping Labels

POST
/shipping/shipments

Purchase a shipping label for an order’s allocation. Ensure you fetch rates first via Retrieve Shipping Rates, then copy your chosen quote’s fields into the matching shipment field.

object
carrier
required

The carrier for which the shipping label is being purchased.

string
amazon_shipping_v2
shipment
required

Details of the shipment to purchase. Copy the values from your chosen quote in the rates response.

object
allocation_id
required

The ID of the allocation to purchase the shipping label for. Retrieve this from the allocations array in the GET /orders/{order_id} response.

number format: int64
carrier_id

The ID of the carrier account to use for this shipment.

string
remote_shipment_id
required

The chosen quote’s remote_shipment_id from the rates response. Starts with prb.

string
service_type
required

The chosen quote’s name from the rates response.

string
notify_customer

Whether to notify the customer about the shipment.

boolean
sub_carrier_id
required

The chosen quote’s sub_carrier_id from the rates response, e.g. UPS or USPS.

string
service_carrier

The chosen quote’s service_carrier from the rates response, e.g. ups or usps.

string
payment_method_id

Payment method ID, if applicable.

string
nullable
liability_amount

Liability amount for insurance, if applicable. Valid bounds are given by the liability_amount entry in the chosen quote’s shipping_service_options.

string
try_inbound_label

Whether to create a return label.

boolean
total_net_charge
required

The chosen quote’s total_net_charge from the rates response.

string format: currency
base_rate
required

The chosen quote’s base_rate from the rates response.

string format: currency
key
additional properties

Additional optional services can be included using keys from the shipping_service_options array in the rates response.

Value-added services use the pattern value_added_service__* (e.g., value_added_service__VAS_GROUP_ID_CONFIRMATION)

Additional inputs use the pattern additional_input__* (e.g., additional_input__SHIPMENT_DESCRIPTION)

Common examples:

  • value_added_service__VAS_GROUP_ID_CONFIRMATION: “SIGNATURE_CONFIRMATION” or “DELIVERY_CONFIRMATION”
  • additional_input__SHIPMENT_DESCRIPTION: “Fragile electronics”

The available options and their valid values are returned in the shipping_service_options array from the rates endpoint. If the selected rate includes a non-optional service, you should pass the option with a valid value from its values array. Omitting a required service, or sending a value the rate did not offer, fails with INVALID_VALUE_ADDED_SERVICES.

Example
{
"carrier": "amazon_shipping_v2",
"shipment": {
"allocation_id": 55443322,
"carrier_id": "",
"remote_shipment_id": "prb123abcde",
"service_type": "amazon_shipping_v2-2295c3aa-af8c-48a0-9f19-cd84d53cbd36",
"notify_customer": true,
"sub_carrier_id": "UPS",
"service_carrier": "ups",
"payment_method_id": null,
"value_added_service__VAS_GROUP_ID_CONFIRMATION": "NO_CONFIRMATION",
"try_inbound_label": false,
"total_net_charge": "11.80",
"base_rate": "11.80"
}
}

Successful response with purchased shipping labels.

object
id

The ID of the purchased shipping label.

string
outbound_label_charges
object
unit

The currency unit for the charges.

string
value

The total charge for the shipping label.

number format: float
tracking_url

URL to track the shipment.

string
label_url

URL to download the purchased shipping label.

string
Example
{
"id": 123456789,
"outbound_label_charges": {
"unit": "USD",
"value": "8.56,"
},
"tracking_url": "<TRACKING_URL>",
"label_url": "<LABEL_URL_PART_FROM_PURCHASE>"
}

Bad request. Ensure you are passing valid parameters. Returned with error code INVALID_VALUE_ADDED_SERVICES when a mandatory value-added service group is omitted, or a value not offered by the chosen quote is sent. Check the shipping_service_options array of the chosen quote in the rates response.

Example
{
"error_messages": [
"InvalidRequestException, errorCode: INVALID_VALUE_ADDED_SERVICES, errorMessage: The requested value added services are invalid. Please check the value added services offered in the GetRates response."
]
}

Allocation ID not found or invalid shipping rates provided.

Internal server error during label purchase.