Webhook

During registration the Merchant may provide endpoint that will accept POST payload to utilize webhooks that will contain the status of the order.

Webhook is executed in following scenarios:

  • Checkout is accepted and order is created (state: approved) - note that without 'approved' status, the /charge is not possible. This webhoook will be sent only if immediate_capture is disabled.
  • Order is charged (state: completed). This webhoook will be sent only if immediate_capture is enabled or for Pay in 3.
  • The customer is rejected on scoring (state: cancelled)
  • Scoring failed - unknown error (state: error)
  • Settled - Twisto has transfered funds (settled_date: <date>)
  • Refunded - order is refunded (refunded_amount: <Decimal>)
  • Cancel - order is canceled (state: cancelled)

The webhook will look like this:

{ 'checkout_id': ..., 'total_amount': ..., 'refunded_amount': ..., 'created_date': '2019-08-24T14:15:22Z', 'settled_date': '2019-08-26T14:15:22Z', 'type': 'standard', # standard 'state': 'approved', # approved (scoring accepted), cancelled (scoring rejected or cancelled by merchant), error }