If your OMS or WMS operates on carton values, as opposed to consignment codes, then this method creates the labels and customs documents for a particular carton ID within an allocated consignment. The documents are created 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:
-
If you have not already done so, open a new project using the WSDL
ConsignmentService.xml
. -
Create a new request under
createPaperworkForCarton
. -
Enter the authorisation for the request.
-
Specify the code of the existing consignment for which paperwork is to be generated.
-
Specify the cartonId (which can be associated with more than one parcel).
-
Enter the parameters for document generation.
-
Click to submit the 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:createPaperworkForCarton soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<consignmentCode xsi:type="soapenc:string">DMC4BY1V3SHJ</consignmentCode>
<cartonId xsi:type="soapenc:string">08K02JTY8</cartonId>
<parameters xsi:type="ser:ArrayOf_tns1_Property" soapenc:arrayType="typ:Property[]" xmlns:typ="urn:DeliveryManager/types"/>
</ser:createPaperworkForCarton>
</soapenv:Body>
</soapenv:Envelope>
For an example response and how to process the information, see below.
<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:createPaperworkForCartonResponse soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns1="urn:DeliveryManager/services">
<createPaperworkForCartonReturn xsi:type="ns2:Paperwork" xmlns:ns2="urn:DeliveryManager/types">
<documents xsi:type="soapenc:base64Binary" xsi:nil="true" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"/>
<labels xsi:type="soapenc:base64Binary" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">JVBERi0xLjQKJeLj.....JlZgo5NzEyNQolJUVPRgo=</labels>
</createPaperworkForCartonReturn>
</ns1:createPaperworkForCartonResponse>
</soapenv:Body>
</soapenv:Envelope>
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.
In the example response, the Base64-encoded strings have been truncated for aesthetic purposes.
To generate the labels
or documents
from the string, you need to copy and load the string into a Base64 decoder. For more information about this, refer to Store the Paperwork and Print Later.