The following API calls allow you to generate labels for allocated consignments, plus customs documents in the event of an overseas consignment: createPaperworkForConsignments, createPaperworkForParcel, createPaperworkForCarton, despatchConsignmentWithBookingCode, and despatchConsignment.
Within each call, you need to specify parameters
that determine how the paperwork is to be output. You do this by specifying the appropriate properties
from the following table:
Table 24. Printing Properties
Property Name |
Possible values |
Manda- tory? |
Description |
---|---|---|---|
|
One from the following: |
The type of paperwork to be generated:
|
|
|
One from the following: NoteThe |
||
|
Either |
||
|
An integer or decimal number, e.g. |
This is only used when generating ZPL paperwork. |
For example:
<parameters xmlns:tns="http://schemas.xmlsoap.org/soap/envelope/">
<Property>
<propertyName>type</propertyName>
<propertyValue>label</propertyValue>
</Property>
<Property>
<propertyName>format</propertyName>
<propertyValue>zpl</propertyValue>
</Property>
<Property>
<propertyName>dimension</propertyName>
<propertyValue>6x4</propertyValue>
</Property>
<Property>
<propertyName>dpi</propertyName>
<propertyValue>203.1</propertyValue>
</Property>
</parameters>
Note
The labels
and documents
strings that are returned are Base64-encoded. They need to be saved as a text file, which can then be loaded into a Base64 decoder (e.g. https://www.base64decode.org/) to generate the printed output. Refer to Store the Paperwork and Print Later.
Customs Documentation
For consignments being shipped outside a trading bloc (e.g. GB to US), any allocation method responses that contain the consignment object (including despatchConsignmentWithBookingCode and despatchConsignment) will return the following in the API response:
<customsDocumentationRequired
xsi:type="xsd:boolean">true</customsDocumentationRequired>
This implies that additional customs documentation may be required (although it is not always the case - refer to https://www.ukpostbox.com/blog/cn22-cn23-customs-declarations).
Much of the requirements are dependent on carrier service, and you need to validate that you have all the requisite documentation. If you are printing labels to pdf
format, the simplest thing is to select a type of all
so that you get the customs documents as well. Otherwise, after printing the labels, you should always run one of createPaperworkForConsignments, createPaperworkForParcel or createPaperworkForCarton requesting a type
of customs
, and a format of pdf
, to validate that you have all the requisite documentation.
If the consignment is going via a postal carrier and is under 270 GBP
, an encoded CN22 will be returned as part of the labels
string. This will either be in the form of a second label or integrated with the delivery label. The documents
string will be returned empty.
If the consignment is going via a postal carrier and has a value of 270 GBP
or more, an encoded CN23 will be returned in the documents
string.
If the consignment is going via a parcel carrier that does not support paperless trade, a commercial Invoice will be returned in the documents
string.
If the carrier integration supports paperless trade, the documents
string will always be returned empty.
Note
Refer to the examples in despatchConsignmentWithBookingCode, createPaperworkForConsignments and Store the Paperwork and Print Later.