Withdraw Callback

when a withdraw order is completed or failed. the payment gateway notifies the merchant via webhook (URL specified when create a withdraw order) Using POST request with Content-Type: application/json to merchant's notify URL with below data. The singature is sent in the header X-Signature. Clients need to verify the signature before further processing.

Method : POST

Callback Data

{
    "merchant_id" : "[merchant id]",
    "platform_order_id" : "[platform order id]",
    "client_order_id" : "[merchant order id]",
    "mode" : "WITHDRAW",
    "bank" : "[bank code]",
    "account_no" : "[account number]",
    "account_name" : "[account name]",
    "amount" : "[amount]",
    "status" : "PAID",
    "timestamp" : [timestamp]
}

Explainations

paramdescription
merchant_idmerchant id
platform_order_idplatform order id
client_order_idyour merchant order id.
modeWITHDRAW for withdraw notification
bankbank code
account_noaccount no
account_nameaccount name
amountamount
statusstatus SUCCESS FAIL

Complete HTTP Request Example

POST /callback HTTP/1.1
Content-Type: application/json
Connection: Close
X-Signature: 6cd4a32478f5ec8e69343988dc9137e37d3eb02123adc3248ec4ea0aeca2e922

{
    "merchant_id" : "AA12345678",
    "platform_order_id" : "THBW2024042821130xxxxxxxxx",
    "client_order_id" : "ORDER0123456789789445566",
    "mode" : "WITHDRAW",
    "bank": "KBANK",
    "account_no": "1234567890",
    "account_name": "สมชาย นามสมมุติ",
    "amount" : "1000.00",
    "status" : "SUCCESS",
    "timestamp" : 112233445566
}

Callback Handling

To ensure correct handling of callbacks from the payment gateway, please implement your webhook processing with the following considerations:

HTTP Status 200 Response:Your system must respond with HTTP status code 200 upon successful receipt and processing of the callback. If the payment gateway does not receive a 200 response, the callback will be retried after a delay until a successful acknowledgment is received.

Handling Duplicate Callbacks (Idempotency):It's standard practice and normal for duplicate callbacks to occur. Ensure your system verifies each callback using platform_order_id or client_order_id before processing. Implement your logic so that repeated callbacks do not cause duplicate actions or financial transactions.

These steps follow industry-standard practices for webhook implementations and ensure robust and reliable callback processing.