Create a shipping label
Creates a new transaction object and purchases the shipping label using a rate object that has previously been created.
Alternatively, creates a new transaction object and purchases the shipping label instantly using shipment details, an existing carrier account, and an existing service level token.
Authorizations
Headers
Optional string used to pick a non-default API version to use. See our API version guide.
"2018-02-08"
Optional. The object ID of a Managed Shippo Account. Platform accounts set this to make the request on behalf of one of their managed accounts. See the Platform accounts guide.
Body
Examples.
- Create request to purchase label with a Rate
- Create request to purchase label without a Rate (Instalabel)
Print format of the label. If empty, will use the default format set from the Shippo dashboard.
PNG, PNG_2.3x7.5, PDF, PDF_2.3x7.5, PDF_4x6, PDF_4x8, PDF_A4, PDF_A5, PDF_A6, ZPLII "PDF_4x6"
Response
Created transaction
An object with details about the user who created the Transaction (purchased the label). A value will be returned only for Transactions that can be associated with a specific user, e.g. when a logged-in user purchases a label via the Shippo Web application; but not for Transactions purchased e.g. via the API using a ShippoToken, which is associated with the account but not any specific user.
Print format of the label. If empty, will use the default format set from the Shippo dashboard.
PNG, PNG_2.3x7.5, PDF, PDF_2.3x7.5, PDF_4x6, PDF_4x8, PDF_A4, PDF_A5, PDF_A6, ZPLII "PDF_4x6"
A URL pointing directly to the label in the format you've set in your settings.
A value will only be returned if the Transactions has been processed successfully.
The URL expires. The Expires query parameter gives the expiration time as a Unix timestamp in seconds. Before you download the label, compare Expires with the current time. If Expires is in the past, read the object_created value of the transaction. If object_created is more than one year ago, the label file is no longer available. Do not call GET /transactions/{TransactionId}. If object_created is less than one year ago, call GET /transactions/{TransactionId} to get a new label_url.
"https://shippo-delivery.s3.amazonaws.com/70ae8117ee1749e393f249d5b77c45e0.pdf?Signature=vDw1ltcyGveVR1OQoUDdzC43BY8%3D&Expires=1437093830&AWSAccessKeyId=AKIAJTHP3LLFMYAWALIA"
A URL pointing directly to the QR code in PNG format. A value will only be returned if requested using qr_code_requested flag and the carrier provides such an option.
"https://shippo-delivery.s3.amazonaws.com/96_qr_code.pdf?Signature=PEdWrp0mFWAGwJp7FW3b%2FeA2eyY%3D&Expires=1385930652&AWSAccessKeyId=AKIAJTHP3LLFMYAWALIA"
ID of the Rate object for which a Label has to be obtained.
If you purchase a label by calling the transaction endpoint without a rate (instalabel), this field will be a simplified Rate object in the Transaction model returned from the POST request.
Note, only rates less than 7 days old can be purchased to ensure up-to-date pricing.