Manipulate shipping labels
Learn how to use the Merchant Fulfillment API to manipulate shipping labels.
Learn how to use the Merchant Fulfillment API to manipulate shipping labels. The createShipment
and getShipment
operations return a shipping label file in PDF, PNG, or ZPL format, depending on the carrier. Amazon compresses the document data before it returns it as a Base64-encoded string.
Prerequisites
To complete this tutorial, you need:
- Authorization from the selling partner for whom you are making calls. For more information, refer to Authorizing Selling Partner API applications.
- The Direct-to-Consumer Shipping (Restricted) role assigned to your developer profile.
- The Direct-to-Consumer Shipping (Restricted) role selected in the app registration page for your application.
Extract document data from a compressed file
- Decode the Base64-encoded string.
- Save the decoded string with a
.gzip
extension. - Extract the PDF, PNG, or ZPL file from the GZIP file.
createShipment
and getShipment
also return a Base64-encoded MD5 hash to validate the document data.
Reprint a shipping label
- Call the
getShipment
operation and include theShipmentId
for the shipment that requires the shipping label. - Extract and print the shipping label from the
FileContents
element that is returned by thegetShipment
operation.
Updated about 11 hours ago