Manifesting parcels in bags and shipments
Overview of shipment related endpoints: Shipments Endpoints
@host = https://api.test.post-plus.io
@apiKey= apitest1234567890
### create shipment - AMS (Amsterdam terminal)
# @name newShipment
POST {{host}}/api/v1/shipments HTTP/1.1
content-type: application/json
X-API-KEY: {{apiKey}}
{
"type": "AWB",
"terminalCode": "AMS",
"shipmentNr": "999-68495221",
"arrivalInfo":
{
"notes": "notes"
}
}
### new shipment id
@shipmentId = {{newShipment.response.body.id}}
### update shipment details - arrival info - flight number etc
# @name updateShipment
PUT {{host}}/api/v1/shipments/{{shipmentId}} HTTP/1.1
content-type: application/json
X-API-KEY: {{apiKey}}
{
"arrivalInfo":
{
"transportNr": "CA1024",
"originCountryCode": "US",
"totalWeight": 1,
"totalBags": 1,
"arrivalOn": "2023-04-02 08:00:00",
"notes": "new notes"
}
}
### add parcels to the shipment, grouped in a bag
POST {{host}}/api/v1/parcels/update-references-many HTTP/1.1
content-type: application/json
X-API-KEY: {{apiKey}}
{
"parcelNrs": "RF000000028LT,RF000000031LT,RF000000045LT,RF000000059LT",
"updateBagNr": "TEST-NL-BAG-1",
"linkShipmentId": {{shipmentId}}
}
### validate and prepare shipment for submitting
# @name prepareShipment
POST {{host}}/api/v1/shipments/{{shipmentId}}/prepare HTTP/1.1
content-type: application/json
X-API-KEY: {{apiKey}}
{
}
### shipment submit token
@shipmentSubmitToken = {{prepareShipment.response.body.shipmentSubmitToken}}
### get shipment details, optinally include related details about the documents
# @name shipmentDetails
GET {{host}}/api/v1/shipments/{{shipmentId}}?IncludeBags=true&IncludeDocuments=true&IncludeManifestFiles=true
X-API-KEY: {{apiKey}}
### delete shipment with all related data - only before submitting
DELETE {{host}}/api/v1/shipments/{{shipmentId}}
X-API-KEY: {{apiKey}}
### submit shipment using the tokeb from prepare step
POST {{host}}/api/v1/shipments/{{shipmentId}}/submit HTTP/1.1
content-type: application/json
X-API-KEY: {{apiKey}}
{
"shipmentSubmitToken": "{{shipmentSubmitToken}}"
}
### download resulting manifest file - list of parcels in the manifest
GET {{host}}/api/v1/documents/shipments/{{shipmentId}}/resulting-file?fileFormat=Csv
X-API-KEY: {{apiKey}}
### get shipment details - CN35,CN38 etc are generated asynchronously, need to check for the progress
# @name shipmentDetails
GET {{host}}/api/v1/shipments/{{shipmentId}}?IncludeBags=true&IncludeDocuments=true&IncludeManifestFiles=true
X-API-KEY: {{apiKey}}
@documentId = {{shipmentDetails.response.body.documents[0].id}}
### download all shipment documents - CN35,CN38 etc as an archive
# @name shipmentDocuments
GET {{host}}/api/v1/documents/shipments/{{shipmentId}}/all-documents
X-API-KEY: {{apiKey}}
### download shipment document by document id
# @name shipmentDocumentById
GET {{host}}/api/v1/documents/shipment-documents/{{documentId}}
X-API-KEY: {{apiKey}}