Setting up webhook

Instead of continuously polling the Quidax API, your system can listen for real-time webhook events and respond automatically.

🚧

Responding to Webhook Requests

To confirm that your server has received a webhook event, your endpoint must return an HTTP status code 200. Any other response code, including 3xx redirects, will be regarded as a failed delivery.

The response body and headers are of no concern to us in this context.

🚧

Ensuring idempotency

Webhook events may occasionally be delivered more than once. Ensure that your application can handle webhook events idempotently, meaning that processing the same event multiple times produces the same result.

This prevents situations such as:

  • crediting a user twice
  • triggering duplicate transactions
  • processing duplicate orders

🚧

Verify Events by Re-querying

After receiving a webhook notification, we strongly recommend verifying the event by making an additional API call before providing value to your customers.

For example, after receiving a successful instant order notification, you can confirm the transaction status using our Instant Order Verification endpoint.

const axios = require('axios');

const options = {
  method: 'GET',
  url: 'https://app.quidax.io/api/v1/users/me/instant_orders/instant_order_id',
  headers: {
    accept: 'application/json',
    Authorization: 'Bearer <secret_key>'
  }
};

axios
  .request(options)
  .then(function (response) {
    console.log(response.data);
  })
  .catch(function (error) {
    console.error(error);
  });

🚧

Webhooks Retry

If your endpoint does not respond with a 200 status code, Quidax will retry the webhook delivery according to the following schedule:

AttemptRetry Time
1stImmediately
2ndAfter 1 minute
3rdAfter 30 minutes
4thAfter 1 hour
5thAfter 24 hours

After the fifth attempt, the system would stop sending the webhook.


🚧

Webhook URL Setup Process

Follow these steps to configure your webhook endpoint and receive event updates in real time:

Step 1

Sign in to your Quidax merchant account, click your username in the navigation bar, and select “My Account.”

Step 2

Scroll down to the Developer Settings page and click “Manage.”

Step 3

Enter the Webhook URL where your application will receive event notifications and click “Save Changes.”