Retrieve a batch
Returns a batch using an object ID.
Batch shipments are displayed 100 at a time. You can iterate through each page using the ?page= query parameter. You can also filter based on batch shipment status, for example, by passing a query param like ?object_results=creation_failed.
Use this endpoint to get new label_url values when the Expires value on the current URLs is in the past. Send one call for each batch. If the batch object_created is more than one year ago, this endpoint does not return new URLs.
For more details on filtering results, see our guide on filtering.
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.
Query Parameters
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"