Payments
A payment is one request for money from a customer, paid by scanning an MMQR code or approving it in AYA Pay.
Create a payment for every order. It starts pending and ends succeeded, failed, expired or canceled; each of those sends an event(payment.succeeded, …).
The payment object
idstring- Unique id, starts with
pay_. objectstring- Always
payment. livemodebooleantruefor live mode,falsefor test mode.statusenumpending,succeeded,failed,expiredorcanceled. Onlypendingcan change.amountinteger- Amount in the currency's smallest unit. MMK has no decimals:
15200is 15,200 Ks. currencystring- Three-letter ISO code, e.g.
MMK. methodenummmqr(QR code scanned with any MMQR banking app) orayapay_push(request pushed to the customer's AYA Pay app).referencestring- Your own reference, e.g. the order number.
bank_referencestring- Short reference shown in the customer's banking app and on bank statements.
descriptionstring | null- Shown to the customer on the checkout.
checkout_urlstring- Hosted checkout page for this payment. Redirect the customer here.
qr_payloadstring | null- The MMQR string to render as a QR code yourself (
mmqrpayments). redirect_urlstring | null- For methods that hand the customer to another app, where to send them.
customer_phonestring | null- The customer's phone number for
ayapay_push. return_urlstring | null- Where the hosted checkout sends the customer after a successful payment.
metadataobject- Your own key–value data, returned as given.
failure_reasonstring | null- Why the payment failed, when it did.
expires_attimestamp- After this the payment can no longer be paid and becomes
expired. succeeded_attimestamp | null- When the payment succeeded.
created_attimestamp- When the payment was created.
amount_refundedinteger- Total of refunds made on this payment.
feesobject | null{ provider, klink, total }: the bank's fee and Klink Pay's fee. Set once the payment succeeded.netinteger | nullamountminusfees.total: what you are paid out. Set once the payment succeeded.payment_linkstring | null- The
plink_id when the payment was made through a payment link.
{
"id": "pay_4Nq7xY2mKc8vTz1aB3dE9f",
"object": "payment",
"livemode": false,
"status": "succeeded",
"amount": 15200,
"currency": "MMK",
"method": "mmqr",
"reference": "order-1001",
"bank_reference": "KP7GQ2M9XW4T",
"description": "Table 4",
"checkout_url": "https://checkout.klinkpay.net/c/pay_4Nq7xY2mKc8vTz1aB3dE9f",
"qr_payload": "00020101021226…6304A1B2",
"redirect_url": null,
"customer_phone": null,
"return_url": "https://shop.example.com/orders/1001",
"metadata": {
"order_id": "1001"
},
"failure_reason": null,
"expires_at": "2026-11-27T10:15:00Z",
"succeeded_at": "2026-11-27T10:01:12Z",
"created_at": "2026-11-27T10:00:00Z",
"amount_refunded": 0,
"fees": {
"provider": 76,
"klink": 304,
"total": 380
},
"net": 14820,
"payment_link": null
}Create a payment
POST/v1/payments
Send an Idempotency-Key header. Requires payments:write on restricted keys. Live keys only work for active accounts.
Body
amountintegerrequired- In the smallest currency unit; a positive integer.
currencystring- Default
MMK. methodenummmqr(default) orayapay_push.referencestringrequired- Your own reference for the payment, e.g. the order number. Search for it later with
?reference=. descriptionstring- Shown to the customer.
customer_phonestring- Required for
ayapay_push: the AYA Pay account to send the request to. return_urlstring- HTTPS URL the hosted checkout returns the customer to after paying.
payment_idandstatusare added to its query string. expires_in_minutesinteger- How long the payment can be paid. A default applies when omitted.
metadataobject- Up to a few key–value pairs of your own.
curl https://sandbox-api.klinkpay.net/v1/payments \
-H "Authorization: Bearer kp_test_…" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: order-1001" \
-d '{
"amount": 15200,
"currency": "MMK",
"reference": "order-1001",
"description": "Table 4",
"return_url": "https://shop.example.com/orders/1001"
}'{
"id": "pay_4Nq7xY2mKc8vTz1aB3dE9f",
"object": "payment",
"livemode": false,
"status": "pending",
"amount": 15200,
"currency": "MMK",
"method": "mmqr",
"reference": "order-1001",
"bank_reference": "KP7GQ2M9XW4T",
"description": "Table 4",
"checkout_url": "https://checkout.klinkpay.net/c/pay_4Nq7xY2mKc8vTz1aB3dE9f",
"qr_payload": "00020101021226…6304A1B2",
"redirect_url": null,
"customer_phone": null,
"return_url": "https://shop.example.com/orders/1001",
"metadata": {
"order_id": "1001"
},
"failure_reason": null,
"expires_at": "2026-11-27T10:15:00Z",
"succeeded_at": null,
"created_at": "2026-11-27T10:00:00Z",
"amount_refunded": 0,
"fees": null,
"net": null,
"payment_link": null
}ayapay_push, the customer gets a notification in AYA Pay and approves it there; qr_payload is null. You can still send them to checkout_url, which tells them to open AYA Pay.Retrieve a payment
GET/v1/payments/:id
Returns the payment. Use it to confirm the status from your server, e.g. when the customer comes back to return_url.
curl https://sandbox-api.klinkpay.net/v1/payments/pay_4Nq7xY2mKc8vTz1aB3dE9f \
-H "Authorization: Bearer kp_test_…"{
"id": "pay_4Nq7xY2mKc8vTz1aB3dE9f",
"object": "payment",
"livemode": false,
"status": "succeeded",
"amount": 15200,
"currency": "MMK",
"method": "mmqr",
"reference": "order-1001",
"bank_reference": "KP7GQ2M9XW4T",
"description": "Table 4",
"checkout_url": "https://checkout.klinkpay.net/c/pay_4Nq7xY2mKc8vTz1aB3dE9f",
"qr_payload": "00020101021226…6304A1B2",
"redirect_url": null,
"customer_phone": null,
"return_url": "https://shop.example.com/orders/1001",
"metadata": {
"order_id": "1001"
},
"failure_reason": null,
"expires_at": "2026-11-27T10:15:00Z",
"succeeded_at": "2026-11-27T10:01:12Z",
"created_at": "2026-11-27T10:00:00Z",
"amount_refunded": 0,
"fees": {
"provider": 76,
"klink": 304,
"total": 380
},
"net": 14820,
"payment_link": null
}List payments
GET/v1/payments
Query
referencestring- Only payments with this reference.
statusenum- Only payments in this status.
limitinteger- 1–100, default 20. See Pagination.
starting_afterstring- Cursor: a payment id.
ending_beforestring- Cursor: a payment id.
curl https://sandbox-api.klinkpay.net/v1/payments?reference=order-1001 \
-H "Authorization: Bearer kp_test_…"{
"object": "list",
"data": [
{
"id": "pay_4Nq7xY2mKc8vTz1aB3dE9f",
"object": "payment",
"livemode": false,
"status": "pending",
"amount": 15200,
"currency": "MMK",
"method": "mmqr",
"reference": "order-1001",
"bank_reference": "KP7GQ2M9XW4T",
"description": "Table 4",
"checkout_url": "https://checkout.klinkpay.net/c/pay_4Nq7xY2mKc8vTz1aB3dE9f",
"qr_payload": "00020101021226…6304A1B2",
"redirect_url": null,
"customer_phone": null,
"return_url": "https://shop.example.com/orders/1001",
"metadata": {
"order_id": "1001"
},
"failure_reason": null,
"expires_at": "2026-11-27T10:15:00Z",
"succeeded_at": null,
"created_at": "2026-11-27T10:00:00Z",
"amount_refunded": 0,
"fees": null,
"net": null,
"payment_link": null
}
],
"has_more": false
}Cancel a payment
POST/v1/payments/:id/cancel
Cancels a pending payment so it can no longer be paid, e.g. when the customer changes their order. Returns the payment with status canceled and sends payment.canceled. A payment that is no longer pending returns 409 invalid_state.
curl https://sandbox-api.klinkpay.net/v1/payments/pay_4Nq7xY2mKc8vTz1aB3dE9f/cancel \
-X POST \
-H "Authorization: Bearer kp_test_…" \
-H "Idempotency-Key: $(uuidgen)"{
"id": "pay_4Nq7xY2mKc8vTz1aB3dE9f",
"object": "payment",
"livemode": false,
"status": "canceled",
"amount": 15200,
"currency": "MMK",
"method": "mmqr",
"reference": "order-1001",
"bank_reference": "KP7GQ2M9XW4T",
"description": "Table 4",
"checkout_url": "https://checkout.klinkpay.net/c/pay_4Nq7xY2mKc8vTz1aB3dE9f",
"qr_payload": "00020101021226…6304A1B2",
"redirect_url": null,
"customer_phone": null,
"return_url": "https://shop.example.com/orders/1001",
"metadata": {
"order_id": "1001"
},
"failure_reason": null,
"expires_at": "2026-11-27T10:15:00Z",
"succeeded_at": null,
"created_at": "2026-11-27T10:00:00Z",
"amount_refunded": 0,
"fees": null,
"net": null,
"payment_link": null
}