Payment Callback
Gate sends an HTTP POST notification (webhook) to your server when a CVS payment code is successfully paid, so you don't need to poll.
Webhook Workflow
- The customer pays in cash at the cashier using the
pay_no. - The payment network notifies Gate. The notification is only used as a trigger: Gate re-reads the payment status directly from the payment network before updating the transaction.
- Gate changes the status to
SUCCESS. - Gate sends the payload to the
callback_urlyou provided in Create Transaction. The callback is only sent forSUCCESS, and only ifcallback_urlwas provided.
Webhook Endpoint Details
| Property | Value |
|---|---|
| HTTP Method | POST |
| Target URL | Your callback_url |
| Content-Type | application/json |
Payload Structure
| Field | Type | Description |
|---|---|---|
trx_id |
string | Transaction ID from create transaction. |
status |
string | Always SUCCESS. |
amount |
number | Transaction amount. |
fee_amount |
number | Fee frozen when the transaction was created. |
total_amount |
number | Total paid by the customer (amount + fee). |
currency |
string | Currency, IDR. |
pay_no |
string | The payment code that was paid. |
mitra_code |
string | Code of the store where the customer paid (e.g. ALMA). |
paid_at |
string (RFC3339) | Time the payment was completed. |
Example Webhook Payload
{
"trx_id": "cmr1h08xk000342qq3fmnl5u1",
"status": "SUCCESS",
"amount": 150000,
"fee_amount": 0,
"total_amount": 150000,
"currency": "IDR",
"pay_no": "ALMA1234567890123",
"mitra_code": "ALMA",
"paid_at": "2026-07-01T10:05:43+07:00"
}
Expired Codes
A code that passes its expired_date without being paid does not trigger a callback. If the customer still wants to pay, create a new transaction.
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 thetrx_idmatches a pending order in your database before fulfilling the order.Idempotency: Callbacks may be re-sent. Processing the same
trx_idmultiple times must not result in duplicate order fulfillment.