Authors:
Ankit Mehta, Movyn John, Cille Schliebitz, Anita Gu
Changed on:
3 Feb 2025
Webhook structureAll webhooks posted by the Fluent platform use the standard Event Model. This is the same as the Event API payload.Here you can see a Sample Payload for Webhooks.Next, we look at the Default SendWebhook RuleDefault SendWebhook RuleSendWebhook is a standard rule that can be added to any ruleset in a workflow. The SendWebhook is used to post the corresponding event message to any endpoint that is specified.The rule only accepts one parameter which is the url.Note: The Orchestration Editor can be used to add a Rule to the Ruleset in the Workflow (as shown here), that is triggered by the specific event that needs to be captured. In this case, sending a Webhook when the order gets into AWAITING_COLLECTION status.
Webhook RetriesAt times, the external parties may be unreachable due to connectivity issues; in these cases, if the Webhook request fails due to a connection timeout, the orchestration engine will automatically reattempt the Webhook request three times. More information about Webhook Retries (opens in a new tab).Next, we look at Webhook Signature Validation.Webhook Signature Validation-Why is a Webhook Signature needed? For security purposes, Fluent Commerce cryptographically signs each Webhook request with a private key before sending to the target endpoint.-How is the request validated? To validate if the request came from Fluent Commerce and has not been tampered with or replaced by another third party, a public key is provided so that clients can verify that the signatures match the request.-What does each request contain? Every Webhook request from the Fluent OMS contains two custom headers.1{
2"id": "b34281d0-ada4-11e9-a1a7-5da7a83b9sd97cd" ,
3"name": "OrderStatusChange"
4"accountId": "ACME",
5"retailerId": "1",
6"rootEntityId": "123",
7"rootEntityRef": "0_123",
8"rootEntityType" : "ORDER",
9"entityId": "123"
10"entityRef": "0_123",
11"entityType": "ORDER",
12"entityStatus": "SHIPPED",
13"type": "NORMAL"
14"attributes": {
15 "ShippingPartner": "Awesome Shipping Co."
16 "TrackingNumber": "TRACKING123" ,
17 "TrackingURL": "http://awesomeshippingco.test/track/q=TRACKING123"
18 }
19}1"rules" : [
2 {
3"name": "FLUENTRETAIL.base.SendWebhook",
4"props": { "url": "https://testwebhook.fluentretail.com/clicksend" }
5 }
6]