Skip to main content

Webhook

You can configure webhook endpoint via Create Order API through ‘callback_url’ field in order to be notified about events that happen in your account.

A POST request will be sent from the Wonder backend to the callback_url. The following header will also be included:

  • Credential. Please refer to Authentication.
  • Nonce. Please refer to Authentication.
  • Signature. When you generate the appid in Wonder Dashboard you will download the Webhook Public Key, which you can use to authenticate the Signature.
  • Content-Type.

Process webhook

Include the state and correspondence_state fields in the Webhook request body to indicate the status of the order and the order's status state.

Please refer to Order State.

order.transactions included all successful or failed payment records.

The request body format in the Webhook is same with Query Order API.


Confirm received webhook

Once your system receives a webhook, you should return Http Status Code 200, regardless of whether or not the internal logic successfully handles it.

  • If the status code is 200, the webhook was sent successfully.
  • If the status code is 4xx, then the webhook will be marked as failed and will not be sent again.
  • If status code is 5xx, then a retry will be attempted.

Retry logics

The system will retry up to 15 times, with a maximum of 6 hours between retries.

15 retries will be sent within 24 hours.


Best practices

Because a variety of factors can cause a webhook to not be delivered in a timely manner, as a best practice, we recommend following the following process for order status synchronization.

info

If you have firewall requirements and need to allow specific IP addresses to access your production environment, please add the following IP addresses to your firewall whitelist: 119.8.39.23/32 119.8.232.135/32