This article outlines how to construct a ReprintLabels
request for the ShipmentServer API. This API allows you to reprint labels for an existing shipment by providing the shipment data and specifying the label format.
Endpoint and Method:
The request should be a POST
request to the following endpoint:
- Production - https://www.shipmentserver.com
- Sandbox - https://demo.shipmentserver.com
Request Body (multipart/form-data):
The request body should be formatted as multipart/form-data
with the following key-value pairs:
command
: Always set to"ReprintLabels"
. This tells the API what action to perform.actor
: The Id of the actor. This is your username.key
: The key of the actor. This is your password.data
(JSON String): This field contains the core shipment information.options
(JSON String): This field allows you to specify additional options, such as the label format.
The data.json file contains the id of the shipment you want to reprint.
-- filename: data.json
{
"ShpCSID":466635140
}
The options.json file specifies the label format, indicating that the label should be generated in ZPL format for printing on Zebra printers. Note that in some cases you can only request labels in the same format as the shipment was created with.
-- filename: options.json
{
"Labels": "ZPLGK"
}
Example using curl.
curl -X POST "https://demo.shipmentserver.com" \
-F "command=ReprintLabels" \
-F "actor=YOUR_ACTOR_ID" \
-F "key=YOUR_ACTOR_KEY" \
-F "data={\"ShpCSID\": 0}" \
-F "options=\"{\"Labels\": \"ZPLGK\"}\""
How to Import a cURL Request in Postman
- Open Postman select a workspace then click on the Import button.
- Select the Raw Text tab and paste the cURL request.
- Click Continue, then Import to load the request into Postman.
- Update any place holder variables with the your actual value
- Click Send to execute the request.