Documentation SOAP

Barcode webservice


  • Name: Barcode Webservice. 
  • Reason to Call: Generate a barcode for your parcels. 
  • Input: Customer code and customer number and some specifications of the required barcode. 
  • Output: An unique identifier to use for creating shipments and to track and trace the status of the parcels.


The following method is defined within the BarcodeWebService.

GenerateBarcodeGeneration of a single barcode

Call details

Interface Version


Sandbox endpoint 

Sandbox WSDL

Production endpoint 

Production WSDL

* PostNL has launched a new API platform since 24 August 2017. The former webservices have been migrated to this platform, so that we can keep providing good service. It is recommended to use the above endpoints.

If you already use the former API’s (endpoint: and/or you want to make use of the new endpoints, you can fill in the Request for API key form or contact your PostNL account manager to arrange this.


APIVersionRelease DateStatusRelease NotesSchema Changes
Barcode1_0Oct 01, 2012Supported  
1_1Oct 28, 2014Current VersionDifferent namespacesYes


This webservice is designed to process a vast amount of requests; making sure that within milliseconds after the request is sent, a unique code is reserved and sent to accompany the parcel it is requested for. It is highly recommended to automate the process, so that if a parcel is ready for sending, a unique barcode is immediately requested from our webservice.

Specifications barcodes
The barcodes contain three elements; type, range and serie. For Types, the following business rules apply:

  • A generated barcode of Type 3S is always 13 or 15 characters long and any other generated barcode must be 13 characters.
  • The total length of the information in the request is validated. Length is calculated by length of Type + length of Serie + length of Range. For type 3S, value must be 13 or 15. For all other types the combined length must be 13. For S10-barcodes a 13th character is added to the result (a checkdigit). When the total length is not correct, the request will be denied.
  • The Range is the customer code that PostNL has configured for you. This code consist of 1-4 letters in the case of barcodes where Type is 3S, otherwise it consists of 4 numbers (for S10-barcodes).
  • Barcode Serie in the format: "###000000-###000000", for example: 100000-20000.  The range must consist of a minimal difference of 100.000 for 3S barcodes (for S10-barcodes the serie should always be 0000-9999). Minimum length of the serie is 6 characters; maximum length is 9 characters.
  • It is allowed to add extra leading zeros at the beginning of the serie. For example : ‘000100000’ causing the Total generated barcode to end up with the required length of 13 or 15.

See the Products page for more information about which barcode type and length to use for the PostNL products.

Specific barcode types and barcode lengths must be used per product group. Below overview gives more insight in how calls must be configured.

Dutch domestic shipments:

TypeRangeSerieTotal lengthExample generated barcode

EPS shipments:

TypeRangeSerieTotal lengthExample generated barcode

GlobalPack shipments:

Type*RangeSerie **Total lengthExample generated barcode

* PostNL will provide you the exact barcode type to use with the PostNL Pakketten API. This should be either CC, CD, CF or CP.

** The Serie must always be 0000-9999 for use with GlobalPack to be able to generate a unique number for you.

The resulting (non-3S) barcode contains one more number than entered by {range} plus {serie}, this is the mandatory checkdigit. This number is calculated for you. The barcode will always end with NL.

Error codes

Error codes have been specified in the below PDF file. Errors from the backend services will be caught and returned as standard API errors according to the generic error handling procedures.

Barcode Error Document

Request GenerateBarcode


MessageIDMString [1-12]ID of the message1
MessageTimeStampMDatetime [19]Date/time of sending the message. Format: dd-mm-yyyy hh:mm:ss29-4-2016 12:00:00

Customer type

CustomerCodeMString [1-4]Customer code as known at PostNL PakkettenABCD
CustomerNumberMInteger [1-8]Customer number as known at PostNL Pakketten1234567

Barcode type

TypeMString [2]Accepted values are: 2S, 3S, CC, CP, CD, CF3S
RangeMString [1-4]This is the customer code that PostNL has
configured for you.
SerieMString [9-19]Barcode serie in the format: "###000000-
###000000", for example: 100000-20000. The
range must consist of a minimal difference of
100.000. Minimum length of the serie is 6
characters; maximum length is 9 characters.
It is allowed to add extra leading zeros at the
beginning of the serie. See Guidelines for more information.

Request example

Accept-Encoding: gzip,deflate
Content-Type: text/xml;charset=UTF-8
apikey: **********
Content-Length: 1074
Connection: Keep-Alive

<soapenv:Envelope xmlns:soapenv="" 
            <tpp:MessageTimeStamp>29-04-2017 12:00:00</tpp:MessageTimeStamp>

Response GenerateBarcode

BarcodeGenerated barcode3SABCD6659149

Response example

<s:Envelope xmlns:s="">
    <GenerateBarcodeResponse xmlns=""