Skip to main content

Shipments

Create one or multiple shipments in a single request. The API validates all fields, generates parcel numbers, enriches routing data, and returns PDF labels.

Endpoint: POST /api/v1/shipments Auth: Bearer JWT token required


Create Shipment

Request

Content-Type: application/json Body: array of shipment objects

[
{
"invoicingNumber": "12345678",
"serviceCode": "PSD",
"sender": { },
"receiver": { },
"parcelInfo": [ ],
"customsData": { },
"printOptions": { }
}
]

Shipment root fields

FieldTypeLengthRequiredDescription
invoicingNumberString1–20MandatoryCustomer billing number
numberOfParcelsIntegerMandatoryTotal parcels (1–20)
customerReferenceNumber1String0–35OptionalCustomer reference 1
customerReferenceNumber2String0–35OptionalCustomer reference 2
customerReferenceNumber3String0–35OptionalCustomer reference 3
customerReferenceNumber4String0–35OptionalCustomer reference 4
shipmentNoteString0–70OptionalShipment note
parcelShopIdStringConditionalRequired for ParcelShop delivery services
clientSoftwareString1-30OptionalClient application name
clientVersionString1-10OptionalClient application version

Address fields (sender / receiver / return)

FieldTypeLengthRequiredNotes
nameString1–35MandatoryCompany or person name
name2String0–35OptionalAdditional name line
contactString0–35OptionalContact person
countryCodeString2MandatoryISO 3166-1 alpha-2
stateCodeString2ConditionalRequired for US/CA
zipCodeString1–9MandatoryPostal code
cityString1–35MandatoryCity
streetString1–35MandatoryStreet name and number
street2String0–35OptionalAdditional address line
houseNumberString0–8ConditionalHouse Number
phoneString0–30ConditionalRequired for GB — international format +CCNNNNNN
emailString0–50ConditionalRequired for non-CH/LI countries (except GB)
eoriString0–22ConditionalRequired for GB/NO international
vatString0–20ConditionalRequired for GB/NO international (non-CH)
languageString2OptionalISO 639-1 (DE, EN, FR, IT)
referenceString0–35OptionalAddress reference
noteString0–70OptionalDelivery instructions
glnString0–13OptionalGlobal Location Number

Parcel info (parcelInfo[])

Array of parcel objects — one entry per physical parcel. The number of entries should match numberOfParcels.

FieldTypeLengthRequiredDescription
serviceCodeStringMandatoryParcel-level service code
optionCodesArray<String>OptionalAdditional service option codes
contentStringOptionalParcel content description (PCONTENT)
weightIntegerOptionalParcel weight in grams
reference1String0–35OptionalParcel reference 1
reference2String0–35OptionalParcel reference 2
reference3StringOptionalParcel reference 3
reference4StringOptionalParcel reference 4
higherInsuranceObjectOptionalHigher-insurance additional service (see below)
limitedQuantitiesObjectOptionalLimited-quantities dangerous-goods data (see below)

higherInsurance fields:

FieldTypeLengthRequiredDescription
amountNumberMandatoryInsured amount
currencyString3MandatoryISO 4217 currency code

limitedQuantities fields:

FieldTypeLengthRequiredDescription
unNumberStringOptionalUN dangerous-goods number
codeStringOptionalSubstance code
packagingGroupStringOptionalPackaging group
klassStringOptionalDangerous-goods class
subWeightIntegerOptionalSubstance weight

Customs data (customsData)

Required for international (non-domestic customs) shipments.

FieldTypeLengthRequiredDescription
shipmentTypeString1MandatoryParcel type (PARCELTYPE)
valueNumberMandatoryCustoms value of goods (CAMOUNT)
currencyString3OptionalISO 4217 currency for value
valueExNumberOptionalAdditional customs value (CAMOUNTEX)
currencyExString3OptionalISO 4217 currency for valueEx
reasonForExportString2MandatoryReason-for-export code
termsOfDeliveryString2MandatoryIncoterms / terms of delivery (CTERMS)
clearanceClearedString1MandatoryClearance-cleared flag
opCodeString3OptionalOperation code
preAlertStatusString3OptionalPre-alert status
contentString0–35OptionalCustoms content description (CCONTENT)
paperString1OptionalPaperwork flag (CPAPER)
highLowValueString1OptionalHigh/low value indicator
invoiceNumberString0–35OptionalCommercial invoice number (CINVOICE)
dateDate (yyyy-MM-dd)MandatoryInvoice date (CINVOICEDATE)
exportMRNString0–209OptionalExport Movement Reference Number (SHIPMRN)
documentTypesArray<String>≤20 itemsOptionalCustoms document types
commentString0–70OptionalCustoms comment (CCOMMENT)
comment2String0–70OptionalDestination country registration (DESTCOUNTRYREG)
senderHMRCString0–15OptionalSender HMRC registration
senderInvoicingAddressObjectOptionalSender invoice address (address object)
receiverInvoicingAddressObjectOptionalRecipient invoice address (address object)
numberOfInvoiceLinesIntegerOptionalNumber of invoice lines (NUMBEROFARTICLE)
invoiceLinesArray<Object>ConditionalInvoice line items (see below). Count between number of parcels and number of parcels + 20

invoiceLines[] fields:

FieldTypeLengthRequiredDescription
natureOfGoodsString0–200OptionalNature of goods (CCONTENT)
hsCodeString0–11OptionalHS tariff code
productCodeString0–255OptionalProduct code (CPRODCODE)
amountNumberOptionalLine amount (CAMOUNTLINE)
grossWeightIntegerOptionalGross weight (CGROSSWEIGHT)
qItemsIntegerMandatoryQuantity of items
countryOfOriginString3OptionalISO country of origin (CORIGIN)
FieldTypeRequiredDescription
paperSizeStringOptionalA4 or A6 (default: A4)
startPositionStringOptionalLabel position on A4 sheet: UPPER_LEFT, UPPER_RIGHT, BOTTOM_LEFT, BOTTOM_RIGHT

Response

201 Created — all shipments created:

{
"tracingId": "TRACE-123",
"success": [
{
"id": 1,
"parcelNumber": "05305000123456",
"label": "base64-encoded-PDF..."
}
],
"failed": []
}

207 Multi-Status — partial success:

{
"tracingId": "TRACE-456",
"success": [ { "id": 1, "parcelNumber": "05305000123456", "label": "..." } ],
"failed": [
{
"id": 2,
"fieldErrors": {
"receiver.countryCode": ["NOT_SUPPORTED"],
"receiver.email": ["REQUIRED_FOR_INTERNATIONAL"]
}
}
]
}

Status codes:

CodeDescription
201 CreatedAll shipments created successfully
207 Multi-StatusSome succeeded, some failed
400 Bad RequestInvalid request payload
401 UnauthorizedMissing or invalid token

Example

curl -X POST "https://label-print-shipments.dpd.ch/api/v1/shipments" \
-H "Authorization: Bearer <jwt_token>" \
-H "Content-Type: application/json" \
-d '[
{
"invoicingNumber": "12345678",
"serviceCode": "PSD",
"numberOfParcels": 1,
"sender": {
"name": "Sender AG",
"countryCode": "CH",
"zipCode": "8000",
"city": "Zürich",
"street": "Industriestrasse 25"
},
"receiver": {
"name": "Receiver GmbH",
"countryCode": "DE",
"zipCode": "10115",
"city": "Berlin",
"street": "Alexanderplatz 1",
"email": "info@receiver.de"
},
"parcelInfo": [
{ "weight": 2500 }
],
"printOptions": {
"paperSize": "A6"
}
}
]'

Generate a manifest PDF that lists the shipments handed over to DPD for a given invoicing number. Supports traceability for the day's pickup — the file is returned as a PDF attachment and is intended to be printed and kept with the parcels.

Endpoint: POST /api/v1/shipments/print-manifest Produces: application/pdf Auth: Bearer JWT token required

The endpoint returns shipments owned by the authenticated user only. Filter the result with a date range (fromDate/toDate, applied to importedAt) and/or an explicit list of parcelNumbersat least one of the two filters is required.

Request

Content-Type: application/json

{
"invoicingNumber": "12345678",
"fromDate": "2026-03-25",
"toDate": "2026-04-29",
"parcelNumbers": ["05305000123456", "05305000123457"],
"address": {
"reference": "PICKUP-001"
},
"printSettings": {
"printRecipientReference": true,
"printParcelReference1": true,
"printParcelReference2": true,
"printUserName": true,
"printWeight": true,
"sortOrderForManifest": "CONSIGNEE_ZIP"
}
}
FieldTypeRequiredDescription
invoicingNumberStringMandatoryInvoicing number scoping the manifest
fromDateDate (yyyy-MM-dd)ConditionalInclusive lower bound of importedAt. Required when parcelNumbers is not provided. Must be provided together with toDate
toDateDate (yyyy-MM-dd)ConditionalInclusive upper bound of importedAt. Required when parcelNumbers is not provided. Must be provided together with fromDate
parcelNumbersArray<String>ConditionalRestrict the manifest to specific parcel numbers. Required when no date range is provided
addressObjectOptionalPickup address used to scope the manifest. Only reference is read; all other address fields are ignored. The reference is resolved against the customer configuration. When omitted and the result set spans multiple pickups, the first encountered pickup is used and other shipments are silently dropped
printSettingsObjectMandatoryPrint settings applied to the generated manifest

printSettings fields

FieldTypeRequiredDescription
printRecipientReferenceBooleanOptionalPrint the recipient reference column
printParcelReference1BooleanOptionalPrint parcel reference 1
printParcelReference2BooleanOptionalPrint parcel reference 2
printUserNameBooleanOptionalPrint the user name on the manifest
printWeightBooleanOptionalPrint the parcel weight column
sortOrderForManifestEnumMandatorySort order for shipments on the manifest

sortOrderForManifest values:

ValueDescription
CONSIGNEE_ZIPSort by consignee zip code
CONSIGNEE_COUNTRYSort by consignee country
CONSIGNEE_NAMESort by consignee name
REFERENCE_1Sort by parcel reference 1
PARCEL_NUMBERSort by parcel number

Common use case — today's manifest

The most frequent integration pattern is generating the manifest for shipments imported today, right before the driver pickup. Set fromDate and toDate to today's date (UTC days) and omit parcelNumbers to include everything for that invoicing number on that day:

{
"invoicingNumber": "12345678",
"fromDate": "2026-05-26",
"toDate": "2026-05-26",
"printSettings": {
"printRecipientReference": true,
"printParcelReference1": true,
"printUserName": true,
"printWeight": true,
"sortOrderForManifest": "CONSIGNEE_ZIP"
}
}
TODAY=$(date -u +%F)
curl -X POST "https://label-print-shipments.dpd.ch/api/v1/shipments/print-manifest" \
-H "Authorization: Bearer <jwt_token>" \
-H "Content-Type: application/json" \
-o manifest.pdf \
-d "{
\"invoicingNumber\": \"12345678\",
\"fromDate\": \"$TODAY\",
\"toDate\": \"$TODAY\",
\"printSettings\": {
\"printRecipientReference\": true,
\"printParcelReference1\": true,
\"printUserName\": true,
\"printWeight\": true,
\"sortOrderForManifest\": \"CONSIGNEE_ZIP\"
}
}"

Notes:

  • fromDate/toDate are matched against importedAt in UTC (start-of-day to end-of-day). Shipments imported after midnight UTC the next calendar day in your local zone will not appear.
  • Provide address: {"reference": "PICKUP-001"} to scope to a specific pickup when the user has multiple.

Response

200 OK — manifest generated; body is the PDF stream.

HeaderValue
Content-Typeapplication/pdf
Content-Dispositionattachment; filename="manifest.pdf"
Content-LengthPDF size in bytes

Status codes

CodeDescription
200 OKManifest generated
400 Bad RequestMissing/invalid filter (e.g. only one of fromDate/toDate set, fromDate after toDate, both date range and parcelNumbers empty, missing printSettings, unresolvable address.reference)
401 UnauthorizedMissing or invalid token
404 Not FoundNo shipments match the filter, or none match the requested pickup

Example

curl -X POST "https://label-print-shipments.dpd.ch/api/v1/shipments/print-manifest" \
-H "Authorization: Bearer <jwt_token>" \
-H "Content-Type: application/json" \
-o manifest.pdf \
-d '{
"invoicingNumber": "12345678",
"fromDate": "2026-03-25",
"toDate": "2026-04-29",
"parcelNumbers": ["05305000123456", "05305000123457"],
"address": {
"reference": "PICKUP-001"
},
"printSettings": {
"printRecipientReference": true,
"printParcelReference1": true,
"printParcelReference2": true,
"printUserName": true,
"printWeight": true,
"sortOrderForManifest": "CONSIGNEE_ZIP"
}
}'