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.
Request Body required
Section titled “Request Body required ”object
The carrier for which the shipping label is being purchased.
amazon_shipping_v2Details of the shipment to purchase. Copy the values from your chosen quote in the rates response.
object
The ID of the allocation to purchase the shipping label for. Retrieve this from the allocations array in the GET /orders/{order_id} response.
The ID of the carrier account to use for this shipment.
The chosen quote’s remote_shipment_id from the rates response. Starts with prb.
The chosen quote’s name from the rates response.
Whether to notify the customer about the shipment.
The chosen quote’s sub_carrier_id from the rates response, e.g. UPS or USPS.
The chosen quote’s service_carrier from the rates response, e.g. ups or usps.
Payment method ID, if applicable.
Liability amount for insurance, if applicable. Valid bounds are given by the liability_amount entry in the chosen quote’s shipping_service_options.
Whether to create a return label.
The chosen quote’s total_net_charge from the rates response.
The chosen quote’s base_rate from the rates response.
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" }}Responses
Section titled “ Responses ”Successful response with purchased shipping labels.
object
The ID of the purchased shipping label.
object
The currency unit for the charges.
The total charge for the shipping label.
URL to track the shipment.
URL to download the purchased shipping label.
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.