Purchase a Shipping Label
When to Use & Considerations
This endpoint will purchase a shipping label for a given rate.
On success, the response status will be 200 multipart/mixed; boundary=”boundary” (where "boundary" is a unique value per response)
Details of the label data is returned as application/json in the first part of the body
The label data is included as an attachment
- See Split Fulfillment Scenarios below for expectations
- Note: ShippingLabelRequestID ensures a label purchase request is not duplicated.
Resource URL / Endpoint
POST https://api.channeladvisor.com/v1/Orders(OrderID)/PurchaseLabel
Important and/or Required Parameters
Property | Format | Required | Note |
---|---|---|---|
RateID | string | Required | A GUID that is associated with a rate returned from ShippingRates |
LabelFormat | enum | Required | Valid values are: PDF, ZPL. The default value is PDF |
ShippingLabelRequestID | string (50) | Recommended | Seller supplied unique identifier for the label purchase request. Supply this value in each request to ensure duplicate labels are not purchased. Note: once set, this value is applied on the Fulfillment and will not be returned in the response. If a future request is supplied with the same ID, the response will supply the existing label. See Purchase Shipping Label with Existing Request ID. |
POST https://api.channeladvisor.com/v1/Orders(12345678)/PurchaseLabel?access_token=xxxxxxxxxx
{
"RateID": "7fd46c9dZPL-5f4d-494b-979e-3b20697d663c",
"LabelFormat": "ZPL",
"ShippingLabelRequestID": "9bagr9lmodz83l4k9dkngksoq"
}
200 OK
--cbf31a2f51fd421087153db40ced6c2c
Content-Type: application/json
{
"ShippingLabelUrl":"https://api.channeladvisor.com/v1/Fulfillments(87654321)/Label",
"FulfillmentID":87654321,
"Cost":23.85,
"CarrierID":2,
"ClassID":6,
"DeliveryDate":"12/19/2018 8:00:00 PM",
"TrackingNumber": "123456789",
"LabelFormat": "ZPL"
}
--cbf31a2f51fd421087153db40ced6c2c
Content-Disposition: attachment; filename=label.ZPL
Content-Type: application/text
^XA^CF,0,0,0^PR12^MD30^PW800^POI^CI13^LH0,20
^FO12,124^GB755,2,2^FS
^FO12,390^GB777,2,2^FS
^FO32,3^AdN,0,0^FWN^FH^FDFROM:^FS
^FO32,19^AdN,0,0^FWN^FH^FDAmazing Shoes^FS
^FO32,37^AdN,0,0^FWN^FH^FD^FS
^FO32,55^AdN,0,0^FWN^FH^FD123 Test^FS
^FO32,73^AdN,0,0^FWN^FH^FD^FS
^FO32,109^AdN,0,0^FWN^FH^FDUS ^FS
^FO224,3^AdN,0,0^FWN^FH^FD(919) 555-1234^FS
etc...
--cbf31a2f51fd421087153db40ced6c2c--
Split Fulfillment Scenarios
SKU Split Fulfillments - Same Distribution Center (Order with SKU A, Quantity 2)
- Fulfillment A: SKU A, Qty 1, DC #1
- Fulfillment B: SKU A, Qty 1, DC #1
Request | Output Expectation |
---|---|
SKU A, Qty 2 | Success: Single Label Generated for Qty 2 |
SKU A, Qty 3 | Unsuccessful: Quantity > Total |
SKU A, Qty 1 | Success: Single Label Generated for Qty 1 |
SKU Split Fulfillment - Different Distribution Centers (Order with SKU A, Quantity 4)
- Fulfillment A: SKU A, Qty 2, DC #1
- Fulfillment B: SKU A, Qty 2, DC #2
Request | Output Expectation |
---|---|
SKU A, Qty 2 | Success: Single Label Generated for Qty 2 |
SKU A, Qty 3 | Unsuccessful: Items are on multiple DCs |
SKU A, Qty 1 | Success: Single Label Generated for Qty 1 |