Printing Properties

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 8. Printing Properties

Property Name

Possible values

Manda- tory?

Description

type

One from the following: alllabel, or customs.

The type of paperwork to be generated:

  • all will generate both a labels and documents string in the returned response (if there are labels and customs documents, respectively, to generate).

  • label will generate a labels string in the returned response (if there are labels to generate).

  • customs will generate a documents string in the returned response (if there are customs documents to generate).

format

One from the following: pdf, zpl, png, pcl.

Note

The documents string is only generated in pdf format.

The format of the paperwork to be generated.

dimension

Either a4 or m×n , where 'm' and 'n' are either integers or decimal numbers in inches (e.g. 6×4 , 8.5×11).

The dimensions of the paperwork, in inches,

dpi

An integer or decimal number, e.g. 203.1.

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 block (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.