createPaperworkForConsignments

This method creates the labels and customs documents for one or more allocated consignments, in a Base64-encoded format.

Note

It is assumed that you have worked through Creating your first Request to a Service and are familiar with the Properties needed to Call or Create a Consignment and Printing Properties.

How to submit a request

Proceed as follows:

  1. If you have not already done so, open a new project using the WSDL ConsignmentService.xml.

  2. Create a new request under createPaperworkForConsignments.

  3. Enter the authorisation for the request.

  4. Specify the code(s) of the existing consignment(s) for which paperwork is to be generated.

  5. Enter the parameters for document generation.

  6. Click Arrow.png to submit the request.

Example Request

<soapenv:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ser="urn:DeliveryManager/services" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">
   <soapenv:Header/>
   <soapenv:Body>
      <ser:createPaperworkForConsignments soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
         <consignmentCodes xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xsi:type="ser:ArrayOf_soapenc_string" soapenc:arrayType="soapenc:string[]">
            <item>DMC4BY1V5GA6</item>
            <item>DMC4BY1V6DEV</item>
         </consignmentCodes>
          <parameters xmlns:tns="http://schemas.xmlsoap.org/soap/envelope/">
            <Property>
               <propertyName>type</propertyName>
               <propertyValue>all</propertyValue>
            </Property>
            <Property>
               <propertyName>format</propertyName>
               <propertyValue>pdf</propertyValue>
            </Property>
            <Property>
               <propertyName>dimension</propertyName>
               <propertyValue>6x4</propertyValue>
            </Property>
         </parameters>
      </ser:createPaperworkForConsignments>
   </soapenv:Body>
</soapenv:Envelope>

For an example response and how to process the information, see below.

Example Response

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
   <soapenv:Body>
      <ns1:createPaperworkForConsignmentsResponse soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns1="urn:DeliveryManager/services">
         <createPaperworkForConsignmentsReturn xsi:type="ns2:Paperwork" xmlns:ns2="urn:DeliveryManager/types">
            <documents xsi:type="soapenc:base64Binary" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">JVBERi.....JUVPRgo=</documents>
            <labels xsi:type="soapenc:base64Binary" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">JVBERi.....JSVFT0YK</labels>
         </createPaperworkForConsignmentsReturn>
      </ns1:createPaperworkForConsignmentsResponse>
   </soapenv:Body>
</soapenv:Envelope>

Decode and Print the Labels and Customs Documents

The results are generated in up to two strings at the bottom of the response: a labels string containing the label(s) for each parcel, and a documents string containing the customs documents.

The strings are Base64-encoded, as in the example response above, where the strings have been truncated for aesthetic purposes.

To generate the labels or documents from the associated string, you need to copy and load the string into a Base64 decoder (e.g. https://www.base64decode.org/). Refer to Store the Paperwork and Print Later.