Confirming

Documentation

To guarantee the level of service, we need to make sure the correct information reaches us within as little time as possible. Using the confirmation service (or the Labelling / Shipping service with confirm) enable us to give real-time feedback per parcel, so that you can immediately take action when an error or warning is returned.

Development

All the necessary information for implementing this API.

                                   .

Go to Technical documentation https://docs.api.postnl.nl

Why use the Confirming API

Information of the parcels
The confirmation contains information about the sender and receiver, the destination (city and country) and any additional delivery services applicable.

Confirming parcels
Let PostNL know that the parcels are coming in the distribution process. It guarantees a smoother process in distribution if the information we receive and the (information on) label matches.

Shipping or Labelling without confirm
Usually the confirming is sent along with creating a label. In some cases it is recommended to use both the Shipping/ Labelling API without confirm method and the Confirming API. For example if you need more time to process the parcels after picking and packing and you don't want consumers to be able to trace the parcels already.

Get started

Request your (Sandbox) API Key and start using the API.
As soon as you have an API key, it is recommended to run our Postman collections. Here you can find code examples of the various services and products we offer. This makes implementing the APIs much easier.

                                    . 

Start using the API

Guidelines

Confirmation
The Shipping and Labelling API contains the possibility to create a label and the PostNL confirmation. If you choose to use confirm the shipments after creating a label, you can use the Confirmation API.
Implementing the confirming functionality as early in your process as possible is highly suggestible. Our best practice is that you implement this service call directly after the generation of the shipping label.

Error handling
We would like to stress the need for a suitable error handling implementation on your side. If somehow, an error is received at your end upon sending your confirmation, this means that we could not process the information correctly and the successful delivery of the parcel is in jeopardy. We strive to return the error message with as much detail as possible so you can take proper action in order to improve the information about the parcel and retry.

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

Street, HouseNr and HouseNrExt
The element StreetHouseNrExt is a combination of Street, HouseNr and HouseNrExt. This field has a dependency with the field Street. One of both fields must be filled mandator.
This field can be used in case the values of Street, HouseNr and HouseNrExt can’t be mapped separately before calling the API.
The API will calculate a split of street name, house number and extension for you, and will afterwards use the split values. This might result in incorrect behavior for which PostNL can’t be held liable. Content in this field must be in the described order or otherwise the conversion will not work and place all values in the Street field.

Multiple shipment (Multi-collo)
A parcel can be (part of) a single shipment or can be part of a multi-collo shipment. At the Group type you can specify that a parcel is part of a multi-collo shipment.

For shipments within the Netherlands multi-collo shipments can be created. Using the API, this can be done as follows:

• Connect the parcels by using the Group type in each request. Mention the amount of parcels in the shipment (GroupCount), the number of the specific Parcel (GroupSequence) and the main barcode of the shipment (MainBarcode) and specify Multicollo as the GroupType (GroupType 03)

• Multi-collo is available for Dutch domestic (with exception of Mailbox / Brievenbuspakje products)

For Extra@Home and Cargo shipments, the requests cannot be done separately for multi-collo shipments. Multi-collo shipments must be confirmed in one joint request.

Pickup Basic and Plus
Pickup plus products consist of two Shipments, the collection order and the delivery order. Both orders must be placed in a separate Shipment in the request. This means that a request for a pickup plus product will contain two Shipment segments. You can find more information at the Products page (Pickup service).  
 
Destination EU / Rest of World
When separating Shipping/ Labelling and confirming for combilabel product codes, there are some fields from the response that need to match with the Confirming request. These fields concern the network partner data. The following fields from the Shipping or Labelling response need to be matched with the Confirming request:
• Barcode
• DownPartnerBarcode
• DownPartnerID
• ProductCodeDelivery
 
The Customs type is mandatory for ‘Parcels non-EU” (Rest of World) shipments and recommended for shipments with destination EU and not allowed for any other shipment types.

Address type
PostNL internal applications validate the receiver address. In case the spelling of addresses should be different according to our PostNL information, the address details will be corrected. This can be noticed in Track & Trace.

The API will not add address details. Street and City fields will only be printed when they are in the call towards the Shipping or Labelling API.

The element Address type is a code in the request. Possible values are:

CodeDescription
01Receiver
02Sender
03Alternative sender address
04Collection address
08Return address*
09Delivery address (for use with Pick up at PostNL location)

* When using the ‘label in the box return label’, it is mandatory to use an Antwoordnummer in AddressType 08. This cannot be a regular address. 

Remarks:
Within the CustomerType, only AddressType 02 can be used. This Type can also be placed in the ShipmentType.
Within the ShipmentType, at least ShipmentType with 01 is required. 

Shipment type
The element Shipment type is a code in the request. Possbile values are:

CodeDescription
01Receiver
02Sender (if not in Customer/Address)
03Alternative sender address
04Collection address
08Return address*
09Delivery address (for use with Pickup at PostNL location)

* When using the ‘label in the box return label’, it is mandatory to use a Antwoordnummer in AddressType 08. This cannot be a regular address. 

The following rules apply:
If there is no Address specified with AddressType = 02, the data from Customer/Address will be added to the list as AddressType 02. If there is no Customer/Address, the message will be rejected.

An Address with AddressType = 02 can be specified. In this case, no Customer/Address has to be specified.

At least one other AddressType must be specified, other than AddressType 02. In most cases this will be AddressType 01, the receiver address.

Contact type
Contact type has the elements Email, SMSNr and TelNr. These fields have a dependency with each other. At least one of these three fields must be filled mandatory for certain products/ product codes (e.g. Evening/Sameday delivery, Pickup at PostNL location). Two or three can be filled as well.
 
CodeDescription
01Receiver
02Sender

Remark: Please add the e-mail address of the receiver to improve the Mijn PostNL experience of your customer.

Code example

Request example:
 
curl --location --request
POST 'https://api-sandbox.postnl.nl/shipment/v2/confirm' \
--header 'Content-Type: application/json' \
--header 'apikey: ***' \
--data-raw '{
"Customer": {
 "Address": {
   "AddressType": "02",
   "City": "Den Haag",
   "CompanyName": "PostNL",
   "Countrycode": "NL",
   "HouseNr": "3",
   "Street": "Waldorpstraat",
   "Zipcode": "2521CA"
 },
 "CollectionLocation": "123456",
 "ContactPerson": "Janssen",
 "CustomerCode": "DEVC",
 "CustomerNumber": "11223344",
 "Email": "email@company.com",
 "Name": "Janssen"
},
"Message": {
 "MessageID": "1",
 "MessageTimeStamp": "08-09-2022 12:00:00",
 "Printertype": "GraphicFile|PDF"
},
"Shipments": {
 "Addresses": [
   {
     "AddressType": "01",
     "Building": "",
     "City": "Utrecht",
     "Countrycode": "NL",
     "FirstName": "Peter",
     "HouseNr": "9",
     "HouseNrExt": "a bis",
     "Name": "de Ruiter",
     "Street": "Bilderdijkstraat",
     "Zipcode": "3532VA"
   }
 ],
 "Barcode": "3SDEVC520422911",
 "Contacts": [
   {
     "ContactType": "01",
     "Email": "receiver@email.com",
     "SMSNr": "+31612345678",
     "TelNr": "+31301234567"
   }
 ],
 "Dimension": {
   "Weight": "2000"
 },
 "ProductCodeDelivery": "3085"
    }
}
 
Response: 
 
{
    "ResponseShipments": [
        {
            "Errors": [],
            "Warnings": [],
            "Barcode": "3SDEVC520422911"
        }
    ]
}

Request Confirming

Customer type

AttributeMandatoryFormatDescriptionExample
AddressO-MAddress typeSee Address type (XmlElement is Address)
Address 02 is mandatory. It can either be placed in the Customer segment or in the Shipment segment (note that if you put it in the Shipment segment, it should go into all Shipment segments)
 
CollectionLocationMStringCode of delivery location at PostNL Pakketten123456
ContactPersonOStringName of customer contact personJanssen
CustomerCodeMString [1-4]Customer code as known at PostNL PakkettenABCD
CustomerNumberMInteger [1-8]Customer number as known at PostNL Pakketten1234567
EmailOString [0-50]E-mail address of customerjanssen@company.com
NameOString [0-35]Customer name StringJanssen

Message type

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

Shipments type

AttributeMandatoryFormatDescriptionExample
ShipmentMShipment typeList of 1 or more ShipmentType elements of a shipment. At least one shipment type is required. Shipments for validation or
confirmation.
 

Shipment type

For those products, this field is mandatory. Please regard to the Guidelines section.
AttributeMandatoryFormatDescriptionExample
AddressesMAddress typeList of 1 or more Address type elements.
At least 1 address type is mandatory.
 
Amounts0-MAmount typeList of 0 or more AmountType elements. An amount represents a value of the shipment.
Amount type 01 mandatory for COD-shipments, Amount type 02 mandatory for domestic Insured shipments.
Amount type 04 mandatory for Commercial route China (productcode 4992)
Amount type 12 mandatory for Inco terms DDP Commercial route China (productcode 4992)
 
BarcodeMString [11-15]Barcode of the shipment. This is a unique value.
In case of combilabel product codes, use the barcode value from the Labelling webService response
3SABCD6659149
CollectionTimeStampEndODatetime [19]Ending date/time of the collection of the shipment
Mandatory for pickup plus products
04-06-2016 17:00:00
CollectionTimeStampStartODatetime [19]Starting date/time of the collection of the shipment
Mandatory for pickup plus products
04-06-2016 19:00:00
ContactsO-MContact typeOne or more ContactType elements belonging to a shipment
Mandatory in some cases. Please refer to Guidelines
 
ContentO-MString [0-35]Content of the shipment
Mandatory for Extra@Home shipments.
Media player
CostCenterOString [0-35]Cost center of the shipment. This value will appear on your invoice.SX-GT-66
CustomerOrderNumberOString [0-35]Order number of the customer.8689242390
CustomsO-MCustoms typeThe Customs type is mandatory for Parcels Non-EU shipments and not allowed for any other shipment types. 
DeliveryAddressO-MInteger [2]Delivery address specification. This field is mandatory when AddressType on the Address is 09.02
DeliveryDateO-MDatetime [19]Mandatory when using Mailbox Parcels (for generation of the coding rule) and delivery options like Evening/Morning/Sameday delivery etc. 
30-06-2016 12:00:00
DimensionMDimension typeDimension of a shipment.
See the dimension type
 
DownPartnerBarcodeO-M [0-35]StringBarcode of the downstream network partner of PostNL Pakketten.

Mandatory for combilabel product codes. The value entered here should match the Labelling webService response

CD123456785NL
DownPartnerIDO-M [0-50]StringIdentification of the downstream network partner of PostNL Pakketten.
Mandatory for Pickup at PostNl Location Belgium. Use the data from the Location API response; attribute RetailNetworkID. 
PNPBE-01 
DownPartnerLocationO-M [0-10]StringIdentification of the location of the downstream network partner of PostNL Pakketten.
BE0Q82
GroupsO-MGroup typeList of 0 or more Group types with data, grouping multiple shipments together.
Mandatory for multicollo shipments and pickup plus. Please see Guidelines (Multiple shipment) for more information.
 
IDExpirationO-MDate [10]Expiration date of the ID document.
Mandatory for ID Check products
05-06-2020
IDNumberO-MString [0-20]Document number of the ID document
Mandatory for ID Check products
4261103214
IDTypeO-MInteger [2]Type of the ID document.
Mandatory for ID Check products
See Guidelines for the possible values.
03
ProductCodeCollectOInteger [4]Second product code of a shipment.3153
ProductCodeDeliveryMInteger [4]Product code of the shipment
In case of combilabel product codes, use the barcode value from the Labelling webService response
3085
ProductOptionsO-MProductOption typeProduct options for the shipment, mandatory for certain products, see How to Use / Products 
ReceiverDateOfBirthO-MDate [10]Date of birth
Mandatory for Age check products
10-12-1980
ReferenceO-MString [0-35]Your own reference of the shipment. Mandatory for Extra@Home shipments; for E@H this is used to create your order number, so this should be unique for each request.2016014567
ReferenceCollectOString [0-35]Additional reference of the collect order of the shipment.6659150
RemarkOString [0-35]Remark of the shipment. Displayed on label, not used for data under GDPR.
Fragile
ReturnBarcodeO-MString [11-15]Return barcode of the shipment. PostNL will provide you with a separate customer code specifically for for generating barcodes for return shipments.
Mandatory for Label in the box (return label) shipments
3SABCD7762162
ReturnReferenceOString [0-35]Return reference of the shipment112233
CodingTextO-MString [0-35]CodingText used for mailbox parcels. This value can be retrieved form the Labelling response. Mandatory for mailbox parcels.    #2426A3A#03#0306#

Address type

AttributeMandatoryFormatDescriptionExample
AddressTypeMInteger [2]Type of the address. This is a code. You can find the possible values in the paragraph Guidelines02
AreaOString [0-35]Area of the addressBeukenhorst
BuildingnameOString [0-35]Building name of the addressAA
CityMString [0-35]City of the addressHoofddorp
CompanyNameO-MString [0-35]This field has a dependency with the field Name. One of both fields must be filled mandatory; using both fields is also allowed.
Mandatory when AddressType is 09.
PostNL
CountrycodeMString [2]The ISO2 country codesNL
DepartmentOString [0-35]Send to specific department of a company.IT
DoorcodeOString [0-35]Door code of address123
FirstNameOString [0-35]Remark: please add FirstName and Name (lastname) of the receiver to improve the parcel tracking experience of your customer.Peter
FloorOString [0-35]Send to specific floor of a company.4
HouseNrO-MString [0-35]Mandatory for shipments to Benelux.
Max. length is 5 characters is only for Benelux addresses.
For Benelux addresses, this field should always be numeric.
42
HouseNrExtONL= String [0-6]
Outside of NL= String
[0-6]
House number extensionA
NameO-MString [0-35]Last name of person. This field has a dependency with the field CompanyName. One of both fields must be filled mandatory; using both fields is also allowed. Remark: please add FirstName and Name (lastname) of the receiver to improve the parcel tracking experience of your customer.de Ruiter
RegionOString [0-35]RegionNoord-Holland
RemarkOString [0-35]Remark of the shipment. Displayed on label, not used for data under GDPR.Fragile
StreetO-MString [0-95]This field has a dependency with the field StreetHouseNrExt. One of both fields must be filled mandatory; using both fields is also allowed.Siriusdreef
StreetHouseNrExtO-MString [0-95]

Combination of Street, HouseNr and HouseNrExt. Please see Guidelines for the explanation

Siriusdreef 42 A
ZipcodeO-MString [0-10]Max length (NL) 6 characters, (BE;LU) 4 numeric characters
Correct format for NL: 0000AA (no spaces)
2132WT

Amount type

AttributeMandatoryFormatDescriptionExample
AccountNameOString [0-35] Name of bank account owner C. de Ruiter 
AmountTypeMInteger [2] Amount type. This is a code. Possible values are: 02 = Insured value
04 mandatory for Commercial route China.
12 mandatory for Inco terms DDP Commercial route China.
01
BICO-MString [8-11] BIC number, optional for COD shipments (mandatory for bank account number other than originating in the Netherlands) RABONL2UXXX
CurrencyOString [3] Currency code according ISO 4217. E.g. EUREUR
IBANO-MString [15-31] IBAN bank account number, mandatory for COD shipments. Dutch IBAN numbers are 18 characters NL00RABO0123456789
ReferenceOString [0-35] Personal payment reference 1234-5678
TransactionNumberOString [0-35] Transaction number1234
ValueO-MDecimal [0-9] Money value in EUR (unless value Currency is specified for another currency) Value format (N6.2): #####0.00 (2 digits behind decimal dot)
Mandatory for COD, Insured products (with the exception of certain productcodes with a standard insured amount) and Commercial route China. For COD the Eurosign (€) is always required.
10.00

Contact type

AttributeMandatoryFormatDescriptionExample
ContactTypeMInteger [2] Type of the contact. This is a code. You can find the possible values at the Guidelines01
EmailO-MString [0-50] Email address of the contact. Mandatory in some cases. Please see the Products pagereceiver@gmail.com
SMSNrO-MString [10-17]Mobile phone number of the contact. Mandatory in some cases. Please see the Products page0612345678
TelNrO-MString [10-17]Phone number of the contact.0612345678

Customs type

AttributeMandatoryFormatDescriptionExample
CertificateO-MBoolean [true/false]Mandatory for Commercial Goods, Commercial Sample and Returned Goods (or Invoice or License; at least 1 out of 3 must be selected) true
CertificateNrO-MString [0-35]Mandatory when Certificate is true. NR112233
ContentMContent type. Array of content type.This section is mandatory (minimum once, maximum 5)  
CurrencyMString [3] Currency code, only EUR and USS are allowed. EUR
EANMString [0-13]A unique code for a product. Together with HS number this is mandatory for product code 4992.8712512330262
HandleAsNonDeliverableMBoolean [true/false]Determines what to do when the shipment cannot be delivered the first time (if this is set to true, the shipment will be returned after the first failed attempt)false
InvoiceO-MBoolean [true/false]Possible values are true/false (no capitals allowed)
Mandatory for Commercial Goods, Commercial Sample and Returned Goods (or Certificate or License; at least 1 out of 3 must be selected)
true
InvoiceNrO-MString [0-35] Mandatory when Invoice is true. 22334455
LicenseO-MBoolean [true/false]Mandatory for Commercial Goods, Commercial Sample and Returned Goods (or Certificate or Certificate; at least 1 out of 3 must be selected) true
LicenseNrO-MString [0-35] Mandatory when License is true11223344
ProductURLMString [0-200] Webshop URL of the product which is being shipped.
Mandatory for product code 4992
http://jishi.ydx.hk/goods.php?id=4974_1
ShipmentTypeMString [1-35]Type of shipment, possible values: Gift, Documents, Commercial Goods, Commercial Sample, Returned GoodsCommercial Goods
TrustedShipperIDOString [0-50]Trusted shipper ID
1234
ImporterReferenceCodeOString [0-50]

Importer reference code

567
TransactionCodeO-MString [0-50]

Transaction code
Mandatory for shipments to the USA. See list 136 on this page (only use the free usage codes). 

002
TransactionDescriptionO-MString [0-50]

Transaction description
Mandatory for shipments to the USA.

Milk powder

Content type

AttributeMandatoryFormatDescriptionExample
DescriptionMString [1-35] Description of goods Powdered milk
QuantityMInteger [1-4] Quantity of items in description 2
WeightMInteger [1-20]Net weight of goods in gram (gr)2600
ValueMDecimal [1-9] Commercial (customs) value of goods. 20.00
HSTariffNrMString [6]First 6 numbers of Harmonized System Code 100878
CountryOfOriginMString [2] Country code NL

Dimension type

AttributeMandatoryFormatDescriptionExample
HeightOInteger [0-20]Height of the shipment in milimeters (mm). 1400
LengthOInteger [0-20]Length of the shipment in milimeters (mm). 2000
VolumeO-MInteger [0-20]Volume of the shipment in centimeters (cm3).
Mandatory for E@H-products
30000
WeightMInteger [0-20]Weight of the shipment in grams
Approximate weight suffices
4300
WidthOInteger [0-20]Width of the shipment in milimeters (mm). 1500

Group type

AttributeMandatoryFormatDescriptionExample
GroupCountO-MInteger [0-3] Total number of colli in the shipment (in case of multicolli shipments)
Mandatory for multicollo and Pickup Plus shipments
4
GroupSequenceO-MInteger [0-3] Sequence number of the collo within the complete shipment (e.g. collo 2 of 4)
Mandatory for multicollo and Pickup Plus shipments
2
GroupTypeO-MInteger [2] Group sort that determines the type of group that is indicated. This is a code. Possible values: 01 = Collection request 03 = Multiple parcels in one shipment (multicollo) 04 = Single parcel in one shipment03
MainBarcodeO-MString [11-15] Main barcode for the shipment (in case of multicolli shipments)
Mandatory for multicollo shipments and pickup plus shipments (delivery order)
3SABCD6659149

ProductOption type

AttributeMandatoryFormatDescriptionExample
CharacteristicO-MInteger [3] The characteristic of the ProductOption. Mandatory for some products, Please see the Products page118
OptionO-MInteger [3]The product option code for this ProductOption.
Mandatory for some products, please see the Products page
006

Response Confirming

ConfirmingResponseShipment type

Attribute  DescriptionExample
Barcode  Barcode of the confirmed shipment3SABCD6659149
Warnings  List of warnings 

Warning type

Attribute  DescriptionExample
Code  Warning code1003
Description  Warning description

Validation failed for shipment