Amazon Services
Amazon Marketplace Web Service (Amazon MWS) Documentation

Deprecation Notice:

Amazon Marketplace Web Service (MWS) will no longer be available after December 31, 2023. All MWS developers must migrate to Selling Partner API (SP-API) to avoid service disruptions. Refer to the Migration Hub for more information.

Amazon MWS Documentation

How to extract a shipping label file

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 returning it as a Base64-encoded string.

To extract document data from a compressed file

  1. Decode the Base64-encoded string.
  2. Save the decoded string with a “.gzip” extension.
  3. 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.