Webhooks are merchant defined HTTPS callback URLs that are used by Smartpay to notify you about payment related events. Once you register a webhook endpoint, Smartpay will send notifications to the specified URL whenever an event occurs related to your account. Webhooks allow you to automate custom backend actions in response to the transitions that happen in a payment flow.

Why use webhooks

  • Redirect failures: When a consumer successfully completes the Smartpay checkout, we redirect them to the successURL defined by you when creating the checkout session. This can be used to update the order status in your own system. In the case the consumer closes the browser window before the redirect or their network connection drops, you will still receive a webhook notifying you of a successful order.
  • Data synchronization: When you register a URL as a webhook endpoint, Smartpay will send near real-time notifications to that URL as events take place. This allows you to synchronize the data with other services not directly responsible for making the API request that may need to know the result of the request.

While you can use Smartpay without webhooks, we highly recommend its use. In the rare event that the redirect URL does not get called when an order is authorized, webhooks adds resilience. Both the sucess redirect URL and webhooks are an important part of the payment process and we strongly recommend that you implement both methods.

How do webhooks work

  • When an event occurs that you subscribed for (order authorized or payout paid etc.) Smartpay creates an event object and sends it to your registered webhook endpoint using an HTTPS POST request.
  • The request contains the event data as a JSON object.
  • You must acknowledge receipt of the webhook by returning a 200 HTTP status code. No response or a response other than 200 will indicate an error to Smartpay and the webhook will be retried.