Set Color Mode

Webhooks and callbacks


Whenever certain transaction actions occur on your Durianpay Checkout integration, we trigger events which your application can listen to. This is where webhooks come in. A webhook is a URL on your server where we send payloads for such events. For example, if you implement webhooks, once a payment is successful, we will immediately notify your server with a payment.completed event. Here is a list of events we can send to your webhook URL.

You can specify your webhook URL on your dashboard (or through your dedicated Customer success manager) where we would send POST requests to whenever an event occurs.

Valid events

payment.completed, payment.failed, payment.cancelled, order.created, order.completed, account_validation.completed, invoice.paid, invoice.transaction

Webhook events explained

NameDescription
payment.completedThis event is triggered when a payment is successfully completed by the customer. Only when payment is completed on our end, we fire this event so you can safely use it to mark transaction/order completed on your side
payment.failedThis event is triggered when a payment is failed due to either timeout OR some other error.
payment.cancelledThis event is triggered when a payment is cancelled by the end user/customer for some reason
order.createdThis event is triggered when a order is successfully created on our end
order.completedThis event is triggered when a order is successfully paid for (Fully) on our end which means that one or more payments against the order has been successfully made and total amount of order has been captured
disbursement.validation_completedThis event is triggered when a disbursement is already validated
disbursement.completedThis event is triggered when a disbursement is completed. Only when the money is already sent to the destination.
settlement.settledThis event is triggered when a settlement is already settled to merchant's bank account
account_validation.completedThis event is triggered when an account number's owner is validated
invoice.paidThis event is triggered when an invoice has been paid
invoice.transactionThis event is triggered when an invoice transaction is completed

If you want to implement one, we recommend order.completed webhook event as it covers the scenario when users might pay using multiple payments for a single order

Setting up Webhooks

  • Create Webhooks in Settings > Create New

    Durian webhook 1
  • Fill up the event you want to subscribe to, give a name to webhook event and add your url which you want us to call

    Durian webhook 2

Sample webhook payloads

payment.completed
{
  "event": "payment.completed",
  "data":{
    "id": "pay_dAS123ad123Asd",
    "signature": "9e892f199d026d06a56669e658a56f264610431d24e8b4d07f7bd46f6d5062d2",
    "order_id": "ord_XXXXXXXXX",
    "amount": 1000000,
    "amount_str": "10000.00",
    "is_live": true,
    "merchant_id": "mer_MsCtIPhqRc8045",
    "payment_method": "CARD",
    "currency": "IDR",
    "paid_at": "2016-09-30T21:10:19.000Z",
    "created_at":"2016-09-30T21:09:56.000Z",
    "metadata": {
      "key": "value"
    },
    "customer_email": "john@xyz.com",
    "customer_id": "cus_XXXX",
    "customer_name": "John",
    "failure_reason": {},
    "order_ref_id": "XXXXX",
    "payment_ref_id": "XXXXX",
    "updated_at": "2022-03-21T10:54:14.564094Z"
  },
  "retry_count": 0
}