Importing consignment data from the TPN Live Project is quite easy and can be done via a SOAP method.
Please note that testing should ONLY be done on the www.tpntest.net site to avoid issues. Please note that when importing data into the Live site you must ensure accuracy of data at all times.
The import is in standard CSV format and each value in the produced file holds information about one of the following fields. Note that not all the fields are mandatory and you may notice that some are consequently left blank. The consignment file values are always in the following order:
1. Docket - leave blank as this will be issued
2. Old system docket - Legacy number from TPN Depot - leave blank unless it comes from a legacy depot system
3. Third party ID - compulsory
4. Customer reference
5. Depot reference
6. Created date
7. Requesting depot number
8. Collection depot number
9. Delivery depot number
10. Consignee name
11. Consignee address line 1
12. Consignee address line 2
13. Consignee address line 3
14. Consignee address line 4
15. Consignee postcode
16. Consignee contact
17. Consignee telephone
18. Consignee email
19. Consignor name
20. Consignor address line 1
21. Consignor address line 2
22. Consignor address line 3
23. Consignor address line 4
24. Consignor postcode
25. Consignor contact
26. Consignor telephone
27. Consignor email
28. Delivery service code
29. Collection service code
30. Delivery Date/Time/Date and Time (Returns only what the consignment service requires)
31. Consignment public note
32. Delivery charge
33. Collection charge
34. Hub charge
35. Customer account code
36. Customer name
37. Customer contact
38. Customer telephone
39. Customer own paperwork (true/false)
40. Number of Qtr Pallets
41. Weight of Qtr Pallets
42. Number of Half Pallets
43. Weight of Half Pallets
44. Number of Half OS Pallets
45. Weight of Half OS Pallets
46. Number of Full Pallets
47. Weight of Full Pallets
48. Number of Full OS Pallets
49. Weight of Full OS Pallets
50. Sum Insured
51. Premium Payable
52. In Name Of
53. Insured Email Address
54. Entered By
Each record is separated by a new line (\r\n).
The SOAP method to import this data is as follows. Site URL on request.
The following is a sample SOAP 1.1 request and response. The placeholders shown need to be replaced with actual values.
POST /TPNImportExport/Service.asmx HTTP/1.1
Host: www.tpntest.net
Content-Type: text/xml; charset=utf-8
Content-Length: length
SOAPAction: "TPNImportExport/ConsignmentImport"
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<ConsignmentImport xmlns="TPNImportExport">
<Username>string</Username>
<Password>string</Password>
<ImportData>string</ImportData>
<CompanyName>string</CompanyName>
<ProgramName>string</ProgramName>
</ConsignmentImport>
</soap:Body>
</soap:Envelope>HTTP/1.1 200 OK
Content-Type: text/xml; charset=utf-8
Content-Length: length
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<ConsignmentImportResponse xmlns="TPNImportExport">
<ConsignmentImportResult>string</ConsignmentImportResult>
</ConsignmentImportResponse>
</soap:Body>
</soap:Envelope>
The following is a sample SOAP 1.2 request and response. The placeholders shown need to be replaced with actual values.
POST /TPNImportExport/Service.asmx HTTP/1.1 Host: www.tpntest.net Content-Type: application/soap+xml; charset=utf-8 Content-Length: length <?xml version="1.0" encoding="utf-8"?> <soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope"> <soap12:Body> <ConsignmentImport xmlns="TPNImportExport"> <Username>string</Username> <Password>string</Password> <ImportData>string</ImportData> <CompanyName>string</CompanyName> <ProgramName>string</ProgramName> </ConsignmentImport> </soap12:Body> </soap12:Envelope>
HTTP/1.1 200 OK
Content-Type: application/soap+xml; charset=utf-8
Content-Length: length
<?xml version="1.0" encoding="utf-8"?>
<soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope">
<soap12:Body>
<ConsignmentImportResponse xmlns="TPNImportExport">
<ConsignmentImportResult>string</ConsignmentImportResult>
</ConsignmentImportResponse>
</soap12:Body>
</soap12:Envelope>