Webhook Connector

Tradecloud triggers a webhook to notify the buyer or supplier the order or shipment is new or has been updated.

Using the webhook

Step 1. Tradecloud sends a webhook trigger to your webhook service

When an order or shipment is new or has been changed at Tradecloud, we will trigger your webhook.
You can either choose between the POST or GET webhook.
POST which will contain the order event or shipment event in a JSON body.
GET which will contain the order ID or shipment ID as path or query parameter.
See the API manual about pro's and cons of either choice.
When you use the order event it will ONLY contain the lines affected by the event.
When you use the shipment event it will contain ALL the lines and ALL the documents. You can filter new/changed lines and documents based on the lastChangedAt fields.
When you GET the order or shipment yourself you will get ALL the lines. In case of shipments you can filter new/changed lines and documents based on the lastChangedAt fields.
In case of a POST webhook you can use the event inside the request JSON body:
In case of a GET webhook, the triggered webhook URL contains an order id parameter, for example:
GET https://yourcompany.com/any/order/path/:orderId
GET https://yourcompany.com/any/shipment/path/:shipmentId
or
GET HTTP://yourcompany.com/any/path?orderId=:orderId
GET HTTP://yourcompany.com/any/path?shipmentId=:shipmentId

Step 2. Your webhook service fetches the actual order or shipment from Tradecloud

In case of a GET webhook, using the order ID or shipment ID you can fetch the actual order or shipment from Tradecloud:
GET https://api.accp.tradecloud1.com/order/:orderId
GET https://api.accp.tradecloud1.com/shipment/:shipmentId

Next: setting up the webhook