Validate and Test Webhooks | Climes API
Validate and test the webhook before you start using them. Understand Idempotency and the importance of the order of Webhook Events.
Test Webhooks
You can test the webhooks to verify payloads or check if your webhook integration is working. Test events get triggered on a transaction done in the Staging environment. As the payload structure remains the same in the Staging and Production environments, you can rely on your stage testing.
You can test webhooks:
- Using Request Interceptor Tools
- Application Running on Localhost
- Application Running on Your Staging Environment
Using Request Interceptor Tools
There are many free webhook testing tools available online. A simple Google search for test webhooks online returns multiple sites that you can use to test webhooks. For example, Webhook.site .
To test webhooks:
- Open Webhook.site
- Upon opening you will be able to see Your unique URL section.Copy the endpoint from that section.
- Proceed to Set Up Webhooks, but with the following changes:
a. Ensure you are editing the Staging Environment Endpoints in Climes Partner Dashboard.
b. Paste the endpoint you copied in the previous step in the Endpoint field.
If you have enabled the appropriate webhook event during setup, you will receive the corresponding webhook payload on your Webhook.site site.
Application Running on Localhost
You cannot use localhost directly to receive webhook events as webhook delivery requires a public URL. You can handle this by creating a tunnel to your localhost using tools such as ngrok or localtunnel.
You can refer to the ngrok documentation to get started. Use the URL endpoint generated by these tools in the webhook URL while setting up your webhooks.
Application Running on Your Staging Environment
You can test your webhook integration in the staging environment before taking it live. You can configure your webhook's staging endpoint and receive test events on it.
Validate Webhooks
When your webhook Authorization Key is set in Climes Partner Dashboard, Climes sends it with each request under the Authorization
header.
Idempotency
There could be scenarios where your endpoint might receive the same webhook event multiple times. This is an expected behavior based on the webhook design.
Your endpoint should handle the event in such a way that it does not process same event multiple times.