View Batch Labels

Use this endpoint to retrieve a combined PDF of all shipping labels for booked shipments in a batch. The PDF is returned as a base64-encoded string in the response body.

REST Endpoint

GET /restapi/v1/customers/:customerId/batch/:batchId/labels

Request Example

GET /restapi/v1/customers/TEST00002/batch/42/labels

Response Status Code

200 OK

Response Content Type

application/json

Response JSON Example

{
  "labelsPdf": "<base64-encoded-pdf>"
}

Explanation of Response Fields

Field Type Description
labelsPdf string Base64-encoded PDF containing all shipping labels for booked shipments in the batch. Decode the base64 string to get the raw PDF bytes.

Notes

  • The batch must contain at least one booked shipment. If no shipments have been booked, a 422 error is returned.
  • Labels that fail to generate individually are skipped; the combined PDF contains all successfully generated labels.
  • If no labels can be generated at all (e.g., labels have been purged), a 422 error is returned.
  • The combined PDF can be large for batches with many shipments. Consider using the Retrieve Shipping Label endpoint for individual labels if needed.

Error Responses

Status Condition
422 No booked shipments found in this batch
422 Could not generate any labels for this batch
404 Batch not found
403 Batch does not belong to this customer