The TradeLens platform will send events to your webhook based on the type of subscription you’ve created.
In this article
Consignment visibility
Consignments created before a port or a terminal organization is onboarded onto the TradeLens platform won’t be visible to the port or terminal, unless the carrier does a partyAdded, POST .../consignments/partyAdded - Consignment visibility added (E001), to add the organization to the consignment.
This is because TradeLens uses the transport plan for dynamic routing. It adds the port and terminal organizations at the same time as dynamic route calculation. It doesn’t go back to add organizations if they’re onboarded later on.
Event format
The webhook will receive events from the TradeLens platform as a JSONArray, for example:
[
{
"eventSubmissionTime": 1523633968187,
"eventType": "actualDischargeFromBarge",
"originatorId": "origninatorId",
"eventOccurrenceTime": 1523633968187,
"originatorName": "originatorName",
"transportEquipmentId": "6c995b93-ddf8-4062-a519-99db31a111ef",
"equipmentNumber": "Test-V1-T003-1523633966168-C1",
"transportationPhase": "Transshipment",
"associatedConsignmentIds": ["ConsignmentId1", "ConsignmentId2"],
"location": {
"type": "UN/Locode",
"value": "NLRTM"
}
}
]
At the moment, this array of events is an array of size one. The message format is an array so that TradeLens can publish multiple events in the future with just one call.
More details can be found on how Event and document data retrieval through subscriptions are managed can be found in that article.
Subscription schema
TradeLens provides the JSON schema to consume the payload sent to your webhook from the subscription service.
Event Subscription API
You can find and edit the JSON schema in the Event Subscription API section of Swagger.
If you’ve been onboarded onto a stack other than ‘platform,’ replace platform in the above url with your stack name. For example, Maersk: https://maersk.tradelens.com/documentation/swagger/
API documentation
The API is just for documentation purposes for you to review. You can also open the Model in the Responses section of the Swagger to see the superset of possible fields in events posted to configured subscriptions. Descriptions are provided for each field.
Subscription data
Subscription data comprises data from the event payload as provided by the publisher, plus additional data from TradeLens to assist subscribers.
When you create a new subscription – see How to subscribe to TradeLens data – you can access Swagger by clicking the Schema button, next to an Implementation notes button.