Process labels in bulk and receive a large number of labels and customs forms in bulk responses. Batching is ideal for workflows that need to process hundreds or thousands of labels quickly.
- Update batch status to 'archived' by id
ShipStation API v2 (2.0.0)
The possible batch status values
Return a specific page of results. Defaults to the first page. If set to a number that's greater than the number of pages of results, an empty page is returned.
The number of results to return per response.
- Mock serverhttps://docs.shipstation.com/_mock/openapi/v2/batches
- Productionhttps://api.shipstation.com/v2/batches
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X GET \
'https://docs.shipstation.com/_mock/openapi/v2/batches?status=open&page=2&page_size=50&sort_dir=desc&batch_number=string&sort_by=ship_date' \
-H 'api-key: YOUR_API_KEY_HERE'The request was a success.
Batch List
The available layouts (sizes) in which shipping labels can be downloaded. The label format determines which sizes are supported. 4x6 is supported for all label formats, whereas letter (8.5" x 11") is only supported for pdf format.
The possible file formats in which shipping labels can be downloaded. We recommend pdf format because it is supported by all carriers, whereas some carriers do not support the png or zpl formats.
| Label Format | Supported Carriers |
|---|---|
pdf | All carriers |
png | fedex stamps_com ups usps |
zpl | access_worldwide apc asendia dhl_global_mail dhl_express dhl_express_australia dhl_express_canada dhl_express_worldwide dhl_express_uk dpd endicia fedex fedex_uk firstmile imex newgistics ontrac rr_donnelley stamps_com ups usps |
A string that uniquely identifies the batch
A string that uniquely identifies the external batch
Custom notes you can add for each created batch
An ISO 8601 string that represents a date and time.
An ISO 8601 string that represents a date and time.
The number of errors that occurred while generating the batch
The errors associated with the failed API call
The source of the error, as indicated by the name this informs us if the API call failed because of the carrier, the order source, or the ShipStation API itself.
The type of error
The error code specified for the failed API Call
An error message associated with the failed API call
The name of the field that caused the error (only present for validation errors)
The number of warnings that occurred while generating the batch
The number of labels generated in the batch
The number of forms for customs that are available for download
The total of errors, warnings, and completed properties
The batch shipments endpoint
Link to batch labels query
Link to batch errors endpoint
The label download for the batch
The URL of the linked resource, if any
The URL for the pdf generated label
The URL for the png generated label
The form download for any customs that are needed
The paperless details which may contain elements like href, instructions and handoff_code.
The URL of the linked resource, if any
The instructions for the paperless download.
The total number of batches the API call returned
The total number of batch pages the API call returned
Helpful links to other pages of results
The link to the first page of results. This object will always have an href field. If there are no results, then the first page will contain an empty array of items.
The link to the final page of results. This object will always have an href field. If there are no results, then the final page will contain an empty array of items.
The link to the previous page of results. The href field will only be set when the page is 2 or greater.
The link to the next page of results. The href field will only be set when the page is less than pages.
{ "batches": [ { … } ], "total": 10, "page": 1, "pages": 10, "links": { "first": { … }, "last": { … }, "prev": { … }, "next": { … } } }
A create batch request body
A string that uniquely identifies the external batch
- Mock serverhttps://docs.shipstation.com/_mock/openapi/v2/batches
- Productionhttps://api.shipstation.com/v2/batches
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X POST \
https://docs.shipstation.com/_mock/openapi/v2/batches \
-H 'Content-Type: application/json' \
-H 'api-key: YOUR_API_KEY_HERE' \
-d '{
"external_batch_id": "se-28529731",
"batch_notes": "This is my batch",
"shipment_ids": [
"se-28529731"
],
"rate_ids": [
"se-28529731"
]
}'The requested object creation was a success.
The available layouts (sizes) in which shipping labels can be downloaded. The label format determines which sizes are supported. 4x6 is supported for all label formats, whereas letter (8.5" x 11") is only supported for pdf format.
The possible file formats in which shipping labels can be downloaded. We recommend pdf format because it is supported by all carriers, whereas some carriers do not support the png or zpl formats.
| Label Format | Supported Carriers |
|---|---|
pdf | All carriers |
png | fedex stamps_com ups usps |
zpl | access_worldwide apc asendia dhl_global_mail dhl_express dhl_express_australia dhl_express_canada dhl_express_worldwide dhl_express_uk dpd endicia fedex fedex_uk firstmile imex newgistics ontrac rr_donnelley stamps_com ups usps |
A string that uniquely identifies the batch
A string that uniquely identifies the external batch
Custom notes you can add for each created batch
An ISO 8601 string that represents a date and time.
An ISO 8601 string that represents a date and time.
The number of errors that occurred while generating the batch
The errors associated with the failed API call
The source of the error, as indicated by the name this informs us if the API call failed because of the carrier, the order source, or the ShipStation API itself.
The type of error
The error code specified for the failed API Call
An error message associated with the failed API call
The name of the field that caused the error (only present for validation errors)
The number of warnings that occurred while generating the batch
The number of forms for customs that are available for download
The total of errors, warnings, and completed properties
The batch shipments endpoint
Link to batch labels query
Link to batch errors endpoint
The label download for the batch
The URL of the linked resource, if any
The URL for the pdf generated label
The URL for the png generated label
The form download for any customs that are needed
The paperless details which may contain elements like href, instructions and handoff_code.
The URL of the linked resource, if any
The instructions for the paperless download.
{ "label_layout": "4x6", "label_format": "pdf", "batch_id": "se-28529731", "batch_number": "123456", "external_batch_id": "12323aaaar", "batch_notes": "Batch for morning shipment", "created_at": "2018-09-23T15:00:00.000Z", "processed_at": "2018-09-23T15:00:00.000Z", "errors": 2, "process_errors": [ { … } ], "warnings": 1, "completed": 1, "forms": 3, "count": 2, "batch_shipments_url": { "href": "http://api.shipstation.com/v2/labels/se-28529731", "type": "child" }, "batch_labels_url": { "href": "http://api.shipstation.com/v2/labels/se-28529731", "type": "child" }, "batch_errors_url": { "href": "http://api.shipstation.com/v2/labels/se-28529731", "type": "child" }, "label_download": { "href": "http://api.shipstation.com/v2/labels/se-28529731", "pdf": "http://api.shipstation.com/v2/labels/se-28529731", "png": "http://api.shipstation.com/v2/labels/se-28529731", "zpl": "http://api.shipstation.com/v2/labels/se-28529731" }, "form_download": { "href": "http://api.shipstation.com/v2/labels/se-28529731", "type": "child" }, "paperless_download": { "href": "http://api.shipstation.com/v2/labels/se-28529731", "instructions": "any instructions", "handoff_code": "122334" }, "status": "open" }
- Mock serverhttps://docs.shipstation.com/_mock/openapi/v2/batches/external_batch_id/{external_batch_id}
- Productionhttps://api.shipstation.com/v2/batches/external_batch_id/{external_batch_id}
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X GET \
https://docs.shipstation.com/_mock/openapi/v2/batches/external_batch_id/13553d7f-3c87-4771-bae1-c49bacef11cb \
-H 'api-key: YOUR_API_KEY_HERE'The request was a success.
The available layouts (sizes) in which shipping labels can be downloaded. The label format determines which sizes are supported. 4x6 is supported for all label formats, whereas letter (8.5" x 11") is only supported for pdf format.
The possible file formats in which shipping labels can be downloaded. We recommend pdf format because it is supported by all carriers, whereas some carriers do not support the png or zpl formats.
| Label Format | Supported Carriers |
|---|---|
pdf | All carriers |
png | fedex stamps_com ups usps |
zpl | access_worldwide apc asendia dhl_global_mail dhl_express dhl_express_australia dhl_express_canada dhl_express_worldwide dhl_express_uk dpd endicia fedex fedex_uk firstmile imex newgistics ontrac rr_donnelley stamps_com ups usps |
A string that uniquely identifies the batch
A string that uniquely identifies the external batch
Custom notes you can add for each created batch
An ISO 8601 string that represents a date and time.
An ISO 8601 string that represents a date and time.
The number of errors that occurred while generating the batch
The errors associated with the failed API call
The source of the error, as indicated by the name this informs us if the API call failed because of the carrier, the order source, or the ShipStation API itself.
The type of error
The error code specified for the failed API Call
An error message associated with the failed API call
The name of the field that caused the error (only present for validation errors)
The number of warnings that occurred while generating the batch
The number of forms for customs that are available for download
The total of errors, warnings, and completed properties
The batch shipments endpoint
Link to batch labels query
Link to batch errors endpoint
The label download for the batch
The URL of the linked resource, if any
The URL for the pdf generated label
The URL for the png generated label
The form download for any customs that are needed
The paperless details which may contain elements like href, instructions and handoff_code.
The URL of the linked resource, if any
The instructions for the paperless download.
{ "label_layout": "4x6", "label_format": "pdf", "batch_id": "se-28529731", "batch_number": "123456", "external_batch_id": "12323aaaar", "batch_notes": "Batch for morning shipment", "created_at": "2018-09-23T15:00:00.000Z", "processed_at": "2018-09-23T15:00:00.000Z", "errors": 2, "process_errors": [ { … } ], "warnings": 1, "completed": 1, "forms": 3, "count": 2, "batch_shipments_url": { "href": "http://api.shipstation.com/v2/labels/se-28529731", "type": "child" }, "batch_labels_url": { "href": "http://api.shipstation.com/v2/labels/se-28529731", "type": "child" }, "batch_errors_url": { "href": "http://api.shipstation.com/v2/labels/se-28529731", "type": "child" }, "label_download": { "href": "http://api.shipstation.com/v2/labels/se-28529731", "pdf": "http://api.shipstation.com/v2/labels/se-28529731", "png": "http://api.shipstation.com/v2/labels/se-28529731", "zpl": "http://api.shipstation.com/v2/labels/se-28529731" }, "form_download": { "href": "http://api.shipstation.com/v2/labels/se-28529731", "type": "child" }, "paperless_download": { "href": "http://api.shipstation.com/v2/labels/se-28529731", "instructions": "any instructions", "handoff_code": "122334" }, "status": "open" }
- Mock serverhttps://docs.shipstation.com/_mock/openapi/v2/batches/{batch_id}
- Productionhttps://api.shipstation.com/v2/batches/{batch_id}
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X DELETE \
https://docs.shipstation.com/_mock/openapi/v2/batches/se-28529731 \
-H 'api-key: YOUR_API_KEY_HERE'No response example- Mock serverhttps://docs.shipstation.com/_mock/openapi/v2/batches/{batch_id}
- Productionhttps://api.shipstation.com/v2/batches/{batch_id}
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X GET \
https://docs.shipstation.com/_mock/openapi/v2/batches/se-28529731 \
-H 'api-key: YOUR_API_KEY_HERE'The request was a success.
The available layouts (sizes) in which shipping labels can be downloaded. The label format determines which sizes are supported. 4x6 is supported for all label formats, whereas letter (8.5" x 11") is only supported for pdf format.
The possible file formats in which shipping labels can be downloaded. We recommend pdf format because it is supported by all carriers, whereas some carriers do not support the png or zpl formats.
| Label Format | Supported Carriers |
|---|---|
pdf | All carriers |
png | fedex stamps_com ups usps |
zpl | access_worldwide apc asendia dhl_global_mail dhl_express dhl_express_australia dhl_express_canada dhl_express_worldwide dhl_express_uk dpd endicia fedex fedex_uk firstmile imex newgistics ontrac rr_donnelley stamps_com ups usps |
A string that uniquely identifies the batch
A string that uniquely identifies the external batch
Custom notes you can add for each created batch
An ISO 8601 string that represents a date and time.
An ISO 8601 string that represents a date and time.
The number of errors that occurred while generating the batch
The errors associated with the failed API call
The source of the error, as indicated by the name this informs us if the API call failed because of the carrier, the order source, or the ShipStation API itself.
The type of error
The error code specified for the failed API Call
An error message associated with the failed API call
The name of the field that caused the error (only present for validation errors)
The number of warnings that occurred while generating the batch
The number of forms for customs that are available for download
The total of errors, warnings, and completed properties
The batch shipments endpoint
Link to batch labels query
Link to batch errors endpoint
The label download for the batch
The URL of the linked resource, if any
The URL for the pdf generated label
The URL for the png generated label
The form download for any customs that are needed
The paperless details which may contain elements like href, instructions and handoff_code.
The URL of the linked resource, if any
The instructions for the paperless download.
{ "label_layout": "4x6", "label_format": "pdf", "batch_id": "se-28529731", "batch_number": "123456", "external_batch_id": "12323aaaar", "batch_notes": "Batch for morning shipment", "created_at": "2018-09-23T15:00:00.000Z", "processed_at": "2018-09-23T15:00:00.000Z", "errors": 2, "process_errors": [ { … } ], "warnings": 1, "completed": 1, "forms": 3, "count": 2, "batch_shipments_url": { "href": "http://api.shipstation.com/v2/labels/se-28529731", "type": "child" }, "batch_labels_url": { "href": "http://api.shipstation.com/v2/labels/se-28529731", "type": "child" }, "batch_errors_url": { "href": "http://api.shipstation.com/v2/labels/se-28529731", "type": "child" }, "label_download": { "href": "http://api.shipstation.com/v2/labels/se-28529731", "pdf": "http://api.shipstation.com/v2/labels/se-28529731", "png": "http://api.shipstation.com/v2/labels/se-28529731", "zpl": "http://api.shipstation.com/v2/labels/se-28529731" }, "form_download": { "href": "http://api.shipstation.com/v2/labels/se-28529731", "type": "child" }, "paperless_download": { "href": "http://api.shipstation.com/v2/labels/se-28529731", "instructions": "any instructions", "handoff_code": "122334" }, "status": "open" }
- Mock serverhttps://docs.shipstation.com/_mock/openapi/v2/batches/{batch_id}
- Productionhttps://api.shipstation.com/v2/batches/{batch_id}
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X PUT \
https://docs.shipstation.com/_mock/openapi/v2/batches/se-28529731 \
-H 'api-key: YOUR_API_KEY_HERE'No response exampleA string that uniquely identifies the external batch
- Mock serverhttps://docs.shipstation.com/_mock/openapi/v2/batches/{batch_id}/add
- Productionhttps://api.shipstation.com/v2/batches/{batch_id}/add
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X POST \
https://docs.shipstation.com/_mock/openapi/v2/batches/se-28529731/add \
-H 'Content-Type: application/json' \
-H 'api-key: YOUR_API_KEY_HERE' \
-d '{
"external_batch_id": "se-123456",
"batch_notes": "This is my batch",
"shipment_ids": [
"se-28529731"
],
"rate_ids": [
"se-28529731"
],
"process_labels": {
"create_batch_and_process_labels": true,
"ship_date": "2018-09-23T15:00:00.000Z",
"label_layout": "4x6",
"label_format": "pdf",
"display_scheme": "label"
}
}'No response example- Mock serverhttps://docs.shipstation.com/_mock/openapi/v2/batches/{batch_id}/errors
- Productionhttps://api.shipstation.com/v2/batches/{batch_id}/errors
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X GET \
'https://docs.shipstation.com/_mock/openapi/v2/batches/se-28529731/errors?page=2&pagesize=1' \
-H 'api-key: YOUR_API_KEY_HERE'The request was a success.
The errors currently associated with the batch
Error message associated with the shipment.
A string that uniquely identifies the shipment
Helpful links to other pages of results
The link to the first page of results. This object will always have an href field. If there are no results, then the first page will contain an empty array of items.
The link to the final page of results. This object will always have an href field. If there are no results, then the final page will contain an empty array of items.
The link to the previous page of results. The href field will only be set when the page is 2 or greater.
The link to the next page of results. The href field will only be set when the page is less than pages.
{ "errors": [], "links": { "first": { … }, "last": { … }, "prev": { … }, "next": { … } } }
An ISO 8601 string that represents a date and time.
The available layouts (sizes) in which shipping labels can be downloaded. The label format determines which sizes are supported. 4x6 is supported for all label formats, whereas letter (8.5" x 11") is only supported for pdf format.
The possible file formats in which shipping labels can be downloaded. We recommend pdf format because it is supported by all carriers, whereas some carriers do not support the png or zpl formats.
| Label Format | Supported Carriers |
|---|---|
pdf | All carriers |
png | fedex stamps_com ups usps |
zpl | access_worldwide apc asendia dhl_global_mail dhl_express dhl_express_australia dhl_express_canada dhl_express_worldwide dhl_express_uk dpd endicia fedex fedex_uk firstmile imex newgistics ontrac rr_donnelley stamps_com ups usps |
- Mock serverhttps://docs.shipstation.com/_mock/openapi/v2/batches/{batch_id}/process/labels
- Productionhttps://api.shipstation.com/v2/batches/{batch_id}/process/labels
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X POST \
https://docs.shipstation.com/_mock/openapi/v2/batches/se-28529731/process/labels \
-H 'Content-Type: application/json' \
-H 'api-key: YOUR_API_KEY_HERE' \
-d '{
"ship_date": "2018-09-23T15:00:00.000Z",
"label_layout": "4x6",
"label_format": "pdf",
"display_scheme": "label"
}'No response example- Mock serverhttps://docs.shipstation.com/_mock/openapi/v2/batches/{batch_id}/remove
- Productionhttps://api.shipstation.com/v2/batches/{batch_id}/remove
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X POST \
https://docs.shipstation.com/_mock/openapi/v2/batches/se-28529731/remove \
-H 'Content-Type: application/json' \
-H 'api-key: YOUR_API_KEY_HERE' \
-d '{
"shipment_ids": [
"se-28529731"
],
"rate_ids": [
"se-28529731"
]
}'No response exampleWebhooks
Webhooks are a powerful feature that can save you from sending repeated polling requests to check on the state of something. With webhooks, ShipStation will automatically contact your servers when the stage changes. This can include parcel tracking events, notification when a batch operation completes, and more.