Webhooks
What are webhooks?
Section titled “What are webhooks?”Let’s take the example of your bank. When you make a withdrawal, the ATM checks the remaining balance in your account and dispenses the amount you requested. Once this operation is completed, your balance is updated. This balance change triggers an action: an SMS is sent to you with the withdrawal details. This is how webhooks work.
A webhook allows you to trigger an action following an event. They are generally used to make systems communicate with each other. It’s the simplest way to receive an alert when something happens in another system.
Webhooks are used for real-time notifications, so your system can be updated as soon as the event occurs.
Webhooks are HTTP callback points defined by the user. They allow you to register a URL where event data can be stored. Then, you can do whatever you want with the data you retrieve and store from an event by triggering an action.
With webhooks, you can among other things:
- Synchronize systems in real-time
- Send any type of notification
- Process data as you wish
- Create reports
- …
How to configure a webhook?
Section titled “How to configure a webhook?”Let’s take an example: You want to store the contact information of people who have placed an order on your site in an Excel file.
Prerequisites: You must create your account on Make.
1. Create a scenario by selecting the Custom Webhook trigger.
2. Name the webhook.
3. The webhook is “listening”: Copy the URL provided by Make and keep this window open.
Enter the URL provided by Make in the Ciklik application.
Click on My Sites, then Edit.
In the Marketing Settings tab, add the keys and URLs of the associated webhooks in the Webhooks field.
4. Place an order on your site to validate the webhook listening and the data flow for this scenario.
5. You can now build your scenario to use the data received during an order placement and automatically trigger the actions of your choice.
Before creating an action, link the trigger to a router. This will allow you to trigger multiple actions during an order placement without having to reconfigure everything.
6. Now select the application you want to use to perform your action.
In our example, we want to collect information in an Excel sheet.
Create a blank file in your drive and give it the desired structure by defining the column values.
You then need to connect with your Google account.
Then enter the name of the Google Sheet where the data selected from the list of values returned by the Ciklik application via the webhook during order creation will be retrieved.
7. Validate your scenario and activate it. You can test by placing a new order on your site. You will automatically find the field values in your Excel file.
What events are available?
Section titled “What events are available?”Here is the list of available events for webhooks from the Ciklik application:
| Resource | Event Key |
|---|---|
| subscription | created_subscription |
| subscription | updated_subscription |
| subscription | deleted_subscription |
| checkoutorder | created_checkoutorder |
| checkoutorder | updated_checkoutorder |
| checkouttransaction | created_checkouttransaction |
| checkouttransaction | updated_checkouttransaction |
| checkoutinvoice | created_checkoutinvoice |
| address | created_address |
| address | updated_address |
| shippingbox | created_shippingbox |
| shippingbox | updated_shippingbox |
| shippingbox | deleted_shippingbox |
| user | created_user |
| user | updated_user |
| optin | created_optin |
| optin | updated_optin |
For each of these keys, a scenario can be triggered with a webhook by entering its URL in the Webhooks field, in the Marketing Settings tab of your site.
Find in the Webhooks section of the left column the details of data sent via webhooks when the scenario has been successfully executed. This data is temporarily saved in the application.
For updates (updated), you will find the list of modified fields and their new values in the changed array.
The URL for abandoned cart management is entered in the Webhook URL: Abandoned Carts field.
Data Structure Examples
Section titled “Data Structure Examples”Abandoned Cart Webhook
Section titled “Abandoned Cart Webhook”{ "cart_id": 1042077, "user_id": 133180, "first_name": "JEANNE", "last_name": "MOULIN", "phone": "0604000000", "email": "jeannemoulin06@gmail.com", "created": "2021-01-17T21:05:47.000000Z", "item": "Box 3 mois"}New Subscription Creation Webhook
Section titled “New Subscription Creation Webhook”{ "order_id": 230129, "user_id": 122312, "first_name": "ANNE", "last_name": "DUPOND", "phone": "0600000000", "email": "annedupond@gmail.com", "status": "completed", "created": "2021-01-15T09:02:16.000000Z", "items": [ { "id": 474784, "price": 50, "tax": "0.000", "quantity": 1, "name": "Ma formule de box mensuelle", "type": "App\\Plan", "orderable": { "id": 1062, "uuid": "formule-box-mensuelle", "name": "Ma formule de box mensuelle", "interval": "month", "interval_count": 1, "start_billing_day": 1, "close_billing_day": 10, "short_name": null, "more": null, "active": true, "tenant_id": 82, "created_at": "2020-11-25T17:15:59.000000Z", "updated_at": "2020-11-25T17:39:32.000000Z", "deleted_at": null, "img": null, "shipped_count": 1, "start_date": null, "best_value": "0", "alert": false, "need_auto_pause": false, "mass_shipping": true, "engaged": false, "engaged_interval": 0, "affilae": "5c34b7dbs8race63108b456c-5f1aa9bb0856337cd27ffc3a", "fixed_period": true, "category_id": null, "advanced_mod": null, "position": 449, "tax": 0.000, "price": "50.00" }, "affilae": "5c34b7dbs8race63108b456c-5f6aa9bb0856337cd27ffc6a" } ], "shipping": "0.00", "count": 1, "total_tax_paid": "0.00", "total_discount_inc": "0.000", "total_paid": "50.000", "total_shipping_paid": "0.000", "created_at": "2021-01-15T09:02:16.000000Z", "coupon": [], "subscription_uuid": "78be3696-cb96-4e2f-98c6-2a4951db6f1d", "comments": null, "revenue": "50.00", "refunded": "0.00", "customerRevenue": "50.00", "customerRefund": "0.00", "totalTransactionsSuccess": 1, "subTransactionsSuccess": 1, "next_billing": "2021-03-01T00:00:00.000000Z", "countTransactions": 1}Order Confirmation Webhook
Section titled “Order Confirmation Webhook”{ "order_id": 230102, "user_id": 121888, "first_name": "NATHALIE", "last_name": "DUPONT", "phone": "0200000000", "email": "nathalie.dupont@outlook.fr", "status": "completed", "created": "2021-01-15T01:03:03.000000Z", "items": [ { "id": 474730, "price": 20, "tax": "0.000", "quantity": 1, "name": "Formule 1 mois", "type": "App\\Plan", "orderable": { "id": 905, "uuid": "ma-box-formule-1-mois", "name": "Formule 1 mois", "interval": "month", "interval_count": 1, "start_billing_day": 1, "close_billing_day": 10, "short_name": null, "more": "Ma formule de box 1 mois", "active": false, "tenant_id": 82, "created_at": "2020-10-07T13:52:31.000000Z", "updated_at": "2020-11-30T08:39:15.000000Z", "deleted_at": null, "img": null, "shipped_count": 1, "start_date": null, "best_value": "0", "alert": false, "need_auto_pause": false, "mass_shipping": true, "engaged": false, "engaged_interval": 1, "affilae": null, "fixed_period": true, "category_id": null, "advanced_mod": null, "position": 331, "tax": 0.000, "price": "20.000" }, "affilae": null } ], "shipping": "0.00", "count": 1, "total_tax_paid": "0.000", "total_discount_inc": "20.000", "total_paid": "0.000", "total_shipping_paid": "0.000", "created_at": "2021-01-15T01:03:03.000000Z", "coupon": { "id": 43768, "uuid": "MONCOUPON1MOIS", "plans": null, "price": "20.00", "percent_off": null, "currency": null, "duration": "repeating", "redeem_by": 1626350400, "display_amount": "20,00€", "display_percent": null }, "subscription_uuid": "bdda3255-b2f8-459b-adeb-75fe533fb579", "comments": null, "revenue": "0.00", "refunded": "0.00", "customerRevenue": "0.00", "customerRefund": "0.00", "totalTransactionsSuccess": 3, "subTransactionsSuccess": 3, "next_billing": "2021-03-01T23:59:59.000000Z", "countTransactions": 1}Subscription Pause Webhook
Section titled “Subscription Pause Webhook”{ "id": 66641, "uuid": "e5e00564-9cc8-402a-ba1e-6c69ff519c37", "plan": { "id": 1057, "uuid": "ma-formule-3-mois", "name": "Formule 3 Mois", "short_name": null, "more": null, "image": "https://s4.eu-image-1.amazonaws.com/boxraiser/", "start_at": null, "price": 30, "category": null, "tax": 0.000, "addons": [], "interval": "month", "interval_count": 3, "shipped_count": 3, "advanced_mod": null, "position": 444, "engaged_interval": 0, "engaged": false }, "address": { "id": 96909, "address": "35 rue JEAN JAURES", "address1": "", "postcode": "75000", "city": "PARIS", "phone": "0600008888", "first_name": "MARIE", "last_name": "THOMAS", "country": { "id": 2, "name": "France Métropolitaine", "alphaCode": "FR" } }, "transporter": { "id": 381, "name": "Livraison à domicile", "description": "1 livraisons par mois", "price": 0, "gift": false, "active": true, "shipped_count": 1, "type": "subs" }, "declinaison": { "id": 139740, "attribute": { "id": 47, "name": "Votre Profil" }, "values": [ { "id": 283650, "property": { "id": 133, "name": "Votre sexe", "type": "list", "predefined": true }, "propValue": { "id": 563, "value": "Femme" } }, { "id": 283651, "property": { "id": 134, "name": "Quel est votre âge ?", "type": "list", "predefined": true }, "propValue": { "id": 567, "value": "Entre 35 et 45 ans" } }, { "id": 283652, "property": { "id": 135, "name": "Quel est votre taille de vêtements ?", "type": "list", "predefined": true }, "propValue": { "id": 572, "value": "L" } } ] }, "created_at": "2020-12-08T17:52:44.000000Z", "end_date": "2021-02-01T00:00:00.000000Z", "engaged_date": "2021-11-08T23:59:59.000000Z", "auto_pause_at": "2021-11-08T23:59:59.000000Z", "start_date": "2020-12-08T00:00:00.000000Z", "active": false, "paused": false, "next_billing": null, "is_auto": false, "revenue": "50.00", "refunded": "0.00", "customerRevenue": "50.00", "customerRefund": "0.00", "totalTransactionsSuccess": 3, "subTransactionsSuccess": 2, "has_active_subscription": false}Subscription Update Webhook (updated_subscription)
Section titled “Subscription Update Webhook (updated_subscription)”{ "id": 118147, "email": "cedricyoung@gmail.com", "uuid": "549c8710-1a41-4cc2-ba28-607ebace2e63", "refp": "https://winebox.fr/subscribe?refp=4f8e62c5-24c2-4208-ae62-4f771ae502ce", "can_void_with_coupon": true, "has_active_subscription": true, "info": null, "addresses": [ { "id": 89278, "address": "321 RUE JEAN MOULIN", "address1": "", "postcode": "75000", "city": "PARIS", "phone": "0610000000", "first_name": "CEDRIC", "last_name": "YOUN", "country": { "id": 2, "name": "France Métropolitaine", "alphaCode": "FR" } } ], "profiles": [ { "id": 124540, "attribute": { "id": 47, "name": "Votre Profil" }, "values": [ { "id": 259955, "property": { "id": 133, "name": "Votre sexe", "type": "list", "predefined": true }, "propValue": { "id": 563, "value": "Homme" } }, { "id": 259956, "property": { "id": 134, "name": "Quel est votre âge ?", "type": "list", "predefined": true }, "propValue": { "id": 567, "value": "Entre 35 et 45 ans" } }, { "id": 259957, "property": { "id": 135, "name": "Quelle est votre taille de vêtement ?", "type": "list", "predefined": true }, "propValue": { "id": 573, "value": "L" } } ] } ], "customerRevenue": "500.00", "customerRefund": "0.00", "totalTransactionsSuccess": 3}