CPL API
Useful links
  • Developer
  • Sandbox
Useful links
  • Developer
  • Sandbox
Přepni do češtiny
  1. Examples
  • Introduction
  • General
  • Creation of orders and shipments
  • Changelog
  • Authentication
    • Getting Bearer token
  • API Methods
  • Examples
    • Response - pick up labels (PDF A4)
    • Response - pickup label (ZPL)
    • Response - pick up label (JPG)
    • Shipment - shipment set items
    • International Shipment with or without COD – Parcels in a Set
    • Multiple shipments in one request
  • FAQ
  • Postman Collection
  1. Examples

Multiple shipments in one request

If you intend to send multiple shipments in one request, the body of the request can look as follows:
**POST shipment/batch request body for creating multiple shipments in one request**
{
  "returnChannel": {
    "type": "Email",
    "address": "gggg@ppl.cz"
  },
  "labelSettings": {
    "format": "Pdf",
    "dpi": 300,
    "completeLabelSettings": {
      "isCompleteLabelRequested": true,
      "pageSize": "default",
      "position": 2
    }
  },
  "shipments": [
    {
      "referenceId": "123456",
      "productType": "BUSS",
      "note": "poznamka",
      "depot": "07",
      "shipmentSet": {
        "numberOfShipments": 2
      },
      "sender": {
        "name": "Sender Name 1",
        "street": "Vysni Lhoty 222",
        "city": "Dobrá",
        "zipCode": "73951",
        "country": "CZ",
        "phone": "5465489",
        "email": "pavel@xdhdgf.cz"
      },
      "recipient": {
        "name": "Recip name 1",
        "street": "Nové Dvory-Podhůří 3844",
        "city": "Frýdek-Místek",
        "zipCode": "73801",
        "country": "CZ",
        "phone": "564654654",
        "email": "pavel@ghfd.cz"
      }
    },
    {
      "referenceId": "654321",
      "productType": "BUSS",
      "note": "poznamka",
      "depot": "07",
      "shipmentSet": {
        "numberOfShipments": 2
      },
      "sender": {
        "name": "Sender name 2",
        "street": "Vysni Lhoty 222",
        "city": "Dobrá",
        "zipCode": "73951",
        "country": "CZ",
        "phone": "321654987",
        "email": "pavel@cccccc.cz"
      },
      "recipient": {
        "name": "Recip name 2",
        "street": "Nové Dvory-Podhůří 3844",
        "city": "Frýdek-Místek",
        "zipCode": "73801",
        "country": "CZ",
        "phone": "123654789",
        "email": "pavel@cccccc.cz"
      }
    }
  ]
}
After creating such shipments, you will get the following response from the GET shipment/batch/{batchId} method.
In items, you can see that each shipment is separated and has its own master parcel.
**Response from GET shipment/batch/{batchId}**
{
  "completeLabel": {
    "labelUrls": [
      "https://api-dev.dhl.com/ecs/ppl/myapi2/shipment/batch/e4e989ee-a724-4b6c-a21a-9dd63804e14a/label?pageSize=Default&position=2&limit=200&offset=0"
    ]
  },
  "items": [
    {
      "referenceId": "123456",
      "shipmentNumber": "80050527937",
      "labelUrl": "https://api-dev.dhl.com/ecs/ppl/myapi2/data/2043c2c7-395b-494d-dc5a-08dd6c0ea4b5",
      "importState": "Complete",
      "relatedItems": [
        {
          "shipmentNumber": "80050527938",
          "labelUrl": "https://api-dev.dhl.com/ecs/ppl/myapi2/data/014215a9-7b60-440b-dc5b-08dd6c0ea4b5",
          "importState": "Complete",
          "relationType": "ShipmentSet"
        }
      ]
    },
    {
      "referenceId": "654321",
      "shipmentNumber": "80050527939",
      "labelUrl": "https://api-dev.dhl.com/ecs/ppl/myapi2/data/55ebe8cd-aa00-49d5-9a45-08dd6c0ea4ba",
      "importState": "Complete",
      "relatedItems": [
        {
          "shipmentNumber": "80050527940",
          "labelUrl": "https://api-dev.dhl.com/ecs/ppl/myapi2/data/9405c51f-d8b9-497e-9a46-08dd6c0ea4ba",
          "importState": "Complete",
          "relationType": "ShipmentSet"
        }
      ]
    }
  ]
}
If you set "isCompleteLabelRequested": true, you will see a completeLabel object containing the URL with all labels.
image.png
image.png
Previous
International Shipment with or without COD – Parcels in a Set
Next
FAQ
Built with