Payment Callback

Gate sends an HTTP POST notification (webhook) to your server when an e-wallet payment reaches a final status, so you don't need to poll.


Webhook Workflow

  1. The customer pays via the payment_url from the Create Transaction step.
  2. The payment network sends a server-to-server notification to Gate.
  3. Gate updates the transaction status. Only a Completed payment changes the transaction to SUCCESS; this status is final and is not changed by later notifications.
  4. Gate sends the payload to the callback_url you provided in Create Transaction. If callback_url is empty, no notification is sent.

Webhook Endpoint Details

Property Value
HTTP Method POST
Target URL Your callback_url
Content-Type application/json
Timeout 10 seconds

Payload Structure

Fields

Field Type Description
trx_id string Transaction ID from create transaction.
external_ref_id string Transaction reference at the payment network.
paid_at string (RFC3339) Time the payment was completed.
amount string Paid amount as a decimal string (e.g. "50000").
method integer Payment method enum (2 = E-Wallet).
status integer Payment status code (table below).
issuer_name string E-wallet brand code (e.g. DANA).
customer_name string Customer name.

Status Values

Value Status Meaning
0 Pending Not yet paid.
1 Reject Rejected by the payment network.
2 Cancel Cancelled.
3 Expired Timed out without payment.
4 Obscure Undefined status from the network.
5 Completed Successfully paid and settled.

Example Webhook Payload

{
	"trx_id": "cmr1h08xk000342qq3fmnl5u1",
	"external_ref_id": "EXTREF02202607010942441460",
	"paid_at": "2026-07-01T10:05:43+07:00",
	"amount": "50000",
	"method": 2,
	"status": 5,
	"issuer_name": "DANA",
	"customer_name": "John Doe"
}

Expected Response

Your server must respond with HTTP 2xx as quickly as possible.

HTTP/1.1 200 OK
Content-Type: application/json

{
  "status": "success"
}

A 4xx/5xx response or a timeout is treated as a failure and will be retried by the background queue.


Important Notes

[!IMPORTANT] Verify trx_id: Make sure the trx_id matches a pending order in your database before fulfilling the order.

Idempotency: Callbacks may be re-sent. Processing the same trx_id with status 5 multiple times must not result in duplicate order fulfillment.