Articles on: Communications

Webhooks

Webhooks are automated messages sent from a web application in real-time when a specific event occurs. Essentially, webhooks allow different software systems to communicate and synchronize data efficiently. It can be used to connect your system with Nector to get notified on various events.

In this article you will learn how to create and manage webhooks.

For a list of webhooks and the data associated with each webhook, please refer this article for more info: https://nector.crisp.help/en/article/webhook-details-sent-to-delivery-url

Visit the Webhooks Page on your Nector dashboard

As the first step enable the webhooks by toggling the status button under the Basic Settings. After enabling you will see the below view.




Request sent from nector to webhook uri has a TTL of 10 seconds, if the request takes more than 10 seconds, it will fail on nector's side. Nector will retry the request for a maximum of 5 times, with exponential delay.

Add New Webhook



Visit the Webhooks Page on your Nector dashboard

Now switch to the Send Webhooks tab and click on the "+" button, a popup will open




There are many webhooks supported on Nector. If you don't know which one to choose, here are the two webhooks that are most relevant and commonly used:

Wallet Coins Rewarded: This webhook will be sent whenever wallet coins are rewarded on nector.
Coupon Is Created: This webhook will be sent whenever a customer uses his wallet coins to get a discount/coupon code on nector.

Now select the event on which you want to send webhook, input the Webhook Uri to which the webhook should be sent, also input Webhook Secret in case you want to verify on your side if the webhook came from nector or not, and add any filters based on which webhook sending should be restricted

To verify the webhook, refer to the value of x-nector-webhook-secret value in the received webhook header, the x-nector-webhook-secret is sha256 of Webhook Secret you have set on nector.




For example,

To send Coupon is Created Webhook to (https://eolw7ilfauomfv3.m.pipedream.net) url whenever a coupon is created, you would create the webhook as shown above.

The Webhook Secret can be any value as per your business needs.

Once you have entered all the details, click on the Create button in the popup.

Webhooks can also be sent for other things like when a new customer is referred, for coin expiry notification, for review request, and more. To learn how to setup these webhooks, look into those respective articles.

Edit a Webhook



Visit the Webhooks Page on your Nector dashboard

Switch to the Send Webhooks tab and click on the webhook that you want to edit.




Here, you can change the Webhook URL to which this webhook needs to be sent, update the Webhook secret to verify the authenticity of the incoming webhooks, also you can optionally add a prefix to the webhook event. Once the changes are done, click on the Save button.

Sending Test Webhook


You can also send a test webhook by clicking on Send Test Webhook.

A popup opens, enter the email id where you want to send the test email.




Kindly note, the Email id of customer to whom email has to be sent needs to exist in the Customers database of your store.

Webhook Restrictions


You can set certain webhook restrictions and control when the webhooks will be sent by adding the necessary restrictions on the supported properties.




Understanding the conditions:

Coupon Discount Is Greater Than - This will send the email only when the coupon's discount value is greater than or equal to the below value. Ex. send only when discount is greater than ₹50.00
Coupon Discount Is Less Than - This will send the email only when the coupon's discount value is less than or equal to the below value. Ex. send only when discount is less than ₹500.00
Coupon Types - Send the email only for selected types of coupons from the list of coupons available.
Coupon Discount Type - This will send the email only for particular type of discount (Fixed discount or percentage discount). It is recommended you add this if you are using the coupon discount value filters above.
Coupon Discount Applicable On - This will send the email only for either cart discounts or free shipping discounts.

Finally click on Save button to update the changes.

The restrictions vary depending on which webhook you have chosen thus giving you greater flexibility and control over sending mails.

Delete a Webhook



Visit the Webhooks Page on your Nector dashboard

Switch to the Send Webhooks tab and click on the webhook that you want to delete.

Here, click on the Delete button at the top right area of this page and confirm the action.


Updated on: 12/05/2024

Was this article helpful?

Share your feedback

Cancel

Thank you!