A webhook is a notification sent to an external system such as a CRM, online store, or call center. It appears as a URL: http://mysite.com/webhook?id={id}&type={type}. When the external system receives the webhook, it can respond accordingly.
For instance, from Kladana, you can send webhooks to an external CRM with the transaction identifier and type: http://mysite.com/webhook?id={id}&type={type}.
When something changes in a transaction in Kladana, the CRM will receive a notification: http://mysite.com/webhook?id=1111-22dddw-2w3ed-222e30&type=CustomerOrder. This literally means: A Sales Order with the unique identifier 1111-22dddw-2w3ed-222e30 has been modified.
You can then create a script that queries Kladana to find out what exactly happened with the Sales Order, including its number, amount, and then send an SMS to the customer with the following text: Sales Order 5643 dated 10.06.2024 for an amount of 50,000 rupees has been handed over to the delivery service.
In this chain, the webhook serves as the starting mechanism for notifications. All other steps need to be programmed additionally.
Webhooks in workflows
Webhook sending is an action in Workflows.
To get the webhook URL, contact the support team of the app you want to send the data to. Let’s take the following address as an example: http://mysite.com/webhook.
Notifications can include the following parameters: {id} — event ID, {type} — the transaction type. To add this information, edit the webhook URL after the question mark using parameters {id} and {type} in the following way: http://mysite.com/webhook?id={id}&type={type}.
When the workflow is triggered, the external system receives the following notification: http://mysite.com/webhook?id=1111-22dddw-2w3ed-222e30&type=CustomerOrder.
Possible values for {type}:
- CustomerOrder (Sales Order);
- InvoiceOut (Sales Invoice);
- PurchaseOrder (Purchase Order);
- InvoiceIn (Supplier Invoice);
- Demand (Shipment);
- Supply (Receiving);
- ProductionTask (Production Order);
- PaymentIn (Incoming Payment);
- PaymentOut (Outgoing Payment);
- CashIn (Incoming Cash Payment);
- CashOut (Outgoing Cash Payment);
- SalesReturn (Sales Return);
- Move (Transfer);
- PurchaseReturn (Purchase Return).