PostPlus API
  1. Scenarios And Workflows
PostPlus API
  • Authentication, Environments
  • Endpoints Overview
    • Parcels Endpoints
    • Shipments Endpoints
    • Tracking Endpoints
    • Accounts Endpoints
  • Scenarios And Workflows
    • Working with parcels
    • Create or update parcel record
    • Cancel or delete a parcel record
    • Manifesting parcels in bags and shipments
    • Query parcel tracking events
  • All API Endpoints
    • Parcels
      • Create or update single parcel.
      • Create or update up to 200 parcels in a single request.
      • Get parcel details by parcel Id.
      • Get up to 100 parcels details by parcel Ids.
      • Get parcel details by parcel number (tracking number).
      • Get up to 100 parcels details by parcel numbers (tracking numbers).
      • Get parcel details by sender reference number.
      • Get up to 100 parcel details by sender reference numbers.
      • Query up to 500 parcels.
      • Delete parcel by Id.
      • Delete up to 100 parcels by Ids.
      • Get print details and contents by print Id.
      • Get up to 100 parcel print details and contents by print Ids.
      • Get pickup point details by Id.
      • Query pickup points.
      • Group parcels into bags and link to a shipment (update parcel references).
      • Get parcel details by manifest reference numbers.
      • Get up to 100 parcel details by manifest reference numbers.
      • Get parcel details by carrier reference numbers.
      • Get up to 100 parcel details by carrier reference numbers.
    • Shipments
      • Create new shipment.
      • Update shipment.
      • Get shipment details.
      • Delete shipment.
      • Create new bag level shipment.
      • Update bag level shipment.
      • Link parcels with specified bag numbers to a shipment.
      • Validate and prepare shipment for submitting.
      • Submit and lock shipment and it's parcels.
      • Cancel erroneous parcels in a shipment.
      • Upload shipment manifest file.
      • Upload shipment document.
      • Delete shipment manifest file.
      • Query up to 500 shipments.
      • Group parcels into bags and link to a shipment, then prepare and submit shipment in one transaction.
    • Documents
      • Download manifest file.
      • Download resulting (processed) manifest file.
      • Download resulting (processed) shipment file.
      • Download shipment documents in archive file.
      • Download shipment document file by Id.
      • Download parcel label by Id.
      • Generate and download shipment parcel labels.
      • Generate and download generic bag labels.
      • Generate and download bag label.
      • Generate and download parcel commercial invoices.
    • Tracking
      • Get event codes and other metadata.
      • Fetch up to 500 tracking events in cursor fashion.
      • Get tracking events by the list of parcel numbers, up to 50, comma separated.
      • Get tracking events by the list of sender reference numbers, up to 50, comma separated.
      • Get tracking events by the list of parcel numbers or sender reference numbers, up to 50, comma separated.
      • Upload tracking events file.
      • Get bag tracking events by the list of bag numbers, up to 50, comma separated.
      • Get bag tracking events by the list of bag numbers or shipment numbers, up to 50, comma separated.
    • Accounts
      • Get current account details.
    • Integrations
      • Add up to 500 tracking events to the processing queue. The whole batch either succeeds or fails.
      • Add tracking event with generic payload.
  1. Scenarios And Workflows

Manifesting parcels in bags and shipments

Overview of parcel related endpoints: Parcels Endpoints
Overview of shipment related endpoints: Shipments Endpoints
The general workflow is the following:
image.png
pseudocode
@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}}
Read more about how to create parcels, shipments and fetch tracking.
After the parcel labels have been created and fetched, packing and sorting can start. Once the client has generated bag codes and knows which parcel went to which bag, the bag reference can be updated. It would make sense to create the shipment first, so the link to shipment and bag could be added with one request.
Previous
Cancel or delete a parcel record
Next
Query parcel tracking events
Built with