Purchase a batch
Purchases an existing batch with a status of VALID.
Once you send a POST request to the purchase endpoint the batch status will change to PURCHASING.
When all the shipments are purchased, the status will change to PURCHASED and you will receive a batch_purchased webhook indicating that the batch has been purchased.
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.
Response
Batch
ID of the Carrier Account object to use as the default for all shipments in this Batch. The carrier account can be changed on a per-shipment basis by changing the carrier_account in the corresponding BatchShipment object.
"078870331023437cb917f5187429b093"
Token of the service level to use as the default for all shipments in this Batch. The servicelevel can be changed on a per-shipment basis by changing the servicelevel_token in the corresponding BatchShipment object. Servicelevel tokens can be found here.
"usps_priority"
Array of BatchShipment objects. The response keeps the same order as in the request array.
An array of URLs each pointing to a merged file of 100 labels each.
Each file is a PDF file or a ZIP file. The label_filetype of the batch and the label formats in the batch set the file type.
The file extension in the URL path (.pdf or .zip) gives the file type.
Each URL expires. The Expires query parameter gives the expiration time as a Unix timestamp in seconds.
Before you download a file, compare Expires with the current time.
If Expires is in the past, read the object_created value of the batch.
If object_created is more than one year ago, the file is no longer available. Do not call GET /batches/{BatchId}.
If object_created is less than one year ago, call GET /batches/{BatchId} to get new label_url values.
VALIDATING: the batch is being created and validatedVALID: the batch can be purchasedINVALID: the batch cannot be purchased;INVALIDBatchShipments must be removedPURCHASING: the batch is being purchasedPURCHASED: the batch is finished purchasing
VALIDATING, VALID, INVALID, PURCHASING, PURCHASED "VALID"
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"