The TradeLens platform will send events to your webhook based on the type of subscription you’ve created.
In this article
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.
The webhook will receive events from the TradeLens platform as a JSONArray, for example:
"associatedConsignmentIds": ["ConsignmentId1", "ConsignmentId2"],
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.
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/
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 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.