Create Batch
Batches allow you to process hundreds or thousands of labels at a time and receive the labels and any related documentation, like customs forms, in a single bulk response.
If you are new to batches in ShipEngine, be sure to read the Label Batches overview first.
To use batches successfully, you should also understand how to create a shipment, how to get shipping rates, and the basics around carrier services.
Requirements
- All shipments in a batch, whether added with
shipment_id
orrate_id
must have acarrier_id
andservice_code
. - The shipments you add to a batch must use a
warehouse_id
instead of aship_from
address. - All shipments in a batch must be shipped from the same warehouse. This means all shipments in a batch must be assigned the same
warehouse_id
.
Request Body
In the request body, you'll can the following (though none of these properties are required when creating the batch):
external_batch_id
: A string that uniquely identifies the external batch.batch_notes
: A custom messages for a particular batchshipment_ids
: Array of shipment IDs used in the batch (you can also add shipments to the batch later)rate_ids
: Array of rate IDs used in the batch (you can also add rates to the batch later)
Example Request & Response
POST /v1/batches/
Response
The response will return the new batch properties, including the batch_id
you'll need for adding shipments to the batch and processing the batch.