PostNL Generate Return Label

Generates a return shipping label via the PostNL Labelling API (SOAP v2.2). Returns the label as a base64-encoded PDF along with the tracking number.

What it does

  • Authenticates with the PostNL API using the provided API key.
  • Sends a SOAP XML request to the Labelling endpoint with sender and receiver address details.
  • Parses the XML response to extract the PDF label content and barcode (tracking number).

Notes

  • The label is returned as a base64-encoded PDF string. Decode it to get the printable PDF.
  • Uses PostNL's SOAP v2.2 Labelling endpoint (https://api.postnl.nl/shipment/v2_2/label).
  • The Product Code Delivery determines the shipment type (e.g. 3085 for standard returns).
  • Weight should be provided in grams.

Inputs

NameTypeDescription
API KeyString (sensitive)PostNL API key
Sender CityStringCity of the sender (customer returning the item)
Sender Country CodeStringISO country code of the sender
Sender House NumberStringHouse number of the sender
Sender NameStringName of the sender
Sender StreetStringStreet of the sender
Sender Zip CodeStringPostal code of the sender
Collection LocationStringPostNL collection location code
Customer CodeStringPostNL customer code
Customer NumberStringPostNL customer number
Receiver CityStringCity of the receiver (warehouse/return centre)
Receiver Company NameStringCompany name of the receiver
Receiver Country CodeStringISO country code of the receiver
Receiver House NumberStringHouse number of the receiver
Receiver StreetStringStreet of the receiver
Receiver Zip CodeStringPostal code of the receiver
Package WeightStringWeight in grams
Product Code DeliveryStringPostNL product code for the shipment type

Outputs

NameTypeDescription
Label Generated?BooleanWhether the return label was successfully generated
Return LabelStringBase64-encoded PDF label
Tracking NumberStringBarcode/tracking number for the shipment

API reference


Did this page help you?