CPL API
Useful links
  • Developer
  • Sandbox
Useful links
  • Developer
  • Sandbox
Přepni do češtiny
  1. ShipmentBatch
  • Back to home
  • API Methods
  • AccessPoint
    • List of access points
  • AddressWhisper
    • Address Whisperer
  • Codelist
    • Codelist for the beneficiary's age verification service
    • Codelist product
    • Codelist externalNumbers
    • Codelist country + COD authorization
    • Codelist currency
    • Method for obtaining the services provided for shipments.
    • A method for obtaining minimum and maximum values ​​for services
    • Codelist shipment phase
    • Codelist status
    • Codelist of validation messages
    • Types of personal documents
  • Customer
    • Customer information - permitted currencies
    • Customer addresess
  • Data
    • Single label print
  • Info
    • /info
  • Order
    • Order tracking
  • OrderBatch
    • Create an order
    • Get order status
  • OrderEvent
    • Order cancel
  • Shipment
    • Shipment tracking
  • ShipmentBatch
    • Shipment creation
      POST
    • Used to combine sets of shipments
      POST
    • Used to modify the output format of the label.
      PUT
    • Getting import state
      GET
    • Pick up label
      GET
  • ShipmentEvent
    • Shipment cancel
    • Adding informations to shipment
  • Routing
    • Used to obtain routing information for a label
  • VersionInformation
    • News
  1. ShipmentBatch

Used to modify the output format of the label.

PUT
/shipment/batch/{batchId}
Maintainer:Not configured

Meaning and Usage#

With this method, you can change the label format by providing modified labelSettings object from the POST shipment/batch method.

Optimization of Label Retrieval#

Processing a large number of labels (e.g., printing in A4 format) is computationally intensive. Therefore, a cache mechanism is implemented for label printing.
For A4 format: 5 minutes
For simple labels: 60 seconds
If you want to significantly speed up label processing after calling the PUT method, we recommend using the data method instead of repeatedly calling GET shipment/batch/{batchId}/label.
The data method returns labels for individual shipments with a cache set to 1 second.

Advantages of the data Method#

The method is available in the response body of GET shipment/batch/{batchId} as the value of the labelUrl key.
When converting to ZPL format, the response already contains ZPL, so you don’t need to convert Base64 → ZPL as with the label method.

Disadvantages of the data Method#

Returns only an individual label. If GET/shipment/batch/{batchId} contains multiple shipments, you will need to call the method for each shipment separately.
Returns the label only in the default format. That means if you are using PUT to change only the label position (e.g., from default to A4), do not use this method.

Recommended Procedure#

1.
Call the PUT method to create or update a batch.
2.
Call GET shipment/batch/{batchId}.
The response contains a new dataGUID in the data method (see image).
image.png
This identifier changes with each call to the PUT method.
You can either:
Compare the new GUID with the previous one (if you store it), or
Set a minimum delay between the PUT and GET methods.
3.
Call the data method with the new GUID to retrieve the label with the updated format.

Request

Authorization
JWT Bearer
Add the parameter
Authorization
to Headers
,whose value is to concatenate the Token after the Bearer.
Example:
Authorization: Bearer ********************
or
Path Params

Header Params

Body Params application/json

Example
{
    "labelSettings": {
        "format": "Pdf",
        "completeLabelSettings": {
            "isCompleteLabelRequested": true,
            "pageSize": "A4"
        }
    }
}

Request Code Samples

Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
Request Request Example
Shell
JavaScript
Java
Swift
curl --location --request PUT '/shipment/batch/' \
--header 'Accept-Language;' \
--header 'X-Correlation-ID;' \
--header 'X-LogLevel;' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data-raw '{
    "labelSettings": {
        "format": "Pdf",
        "completeLabelSettings": {
            "isCompleteLabelRequested": true,
            "pageSize": "A4"
        }
    }
}'

Responses

🟢204No Content
application/json
No Content
Headers

Body

Example
{}
🟠400Bad Request
🔴500Server Error
🔴503Service Unavailable
Modified at 2025-09-10 12:49:32
Previous
Used to combine sets of shipments
Next
Getting import state