Skip to Content

Payments

Payment endpoints allow you to retrieve payment details, check payment status, list payments, and manage cancellations and refunds.


Get Payment

GET /v2/payment/{id}

Retrieves detailed information about a specific payment by its payment ID.

Request Headers

HeaderValueRequired
AuthorizationBearer <access_token>Yes

Path Parameters

ParameterTypeDescription
idstringThe payment ID

Example Request

curl -X GET https://merchant.qpay.mn/v2/payment/pay-abc123 \ -H "Authorization: Bearer <access_token>"

Response

{ "payment_id": "pay-abc123", "payment_status": "PAID", "payment_fee": "0.00", "payment_amount": "50000.00", "payment_currency": "MNT", "payment_date": "2026-02-26T10:00:00", "payment_wallet": "qpay", "transaction_type": "P2P", "object_type": "INVOICE", "object_id": "inv-abc123", "card_transactions": [], "p2p_transactions": [ { "transaction_bank_code": "050000", "account_bank_code": "050000", "account_bank_name": "Khan Bank", "account_number": "1234567890", "status": "SUCCESS", "amount": "50000.00", "currency": "MNT", "settlement_status": "SETTLED" } ] }
FieldTypeDescription
payment_idstringUnique payment identifier
payment_statusstringPayment status: PAID, PENDING, CANCELLED, REFUNDED
payment_feestringTransaction fee charged by QPay
payment_amountstringTotal payment amount
payment_currencystringCurrency code (e.g., MNT)
payment_datestringPayment timestamp (ISO 8601 format)
payment_walletstringPayment wallet identifier
transaction_typestringTransaction type: P2P (bank transfer) or CARD
object_typestringRelated object type (always INVOICE)
object_idstringRelated invoice ID
card_transactionsarrayCard transaction details (empty for P2P payments)
p2p_transactionsarrayP2P bank transfer transaction details

P2P Transaction Fields

FieldTypeDescription
transaction_bank_codestringSending bank code
account_bank_codestringReceiving bank code
account_bank_namestringReceiving bank name
account_numberstringReceiving account number
statusstringTransaction status: SUCCESS, PENDING, FAILED
amountstringTransaction amount
currencystringTransaction currency
settlement_statusstringSettlement status: SETTLED, PENDING

Error Responses

HTTP StatusError CodeDescription
404PAYMENT_NOTFOUNDPayment does not exist

Check Payment

POST /v2/payment/check

Checks if a payment has been made for a given invoice. This is the primary endpoint for verifying payment status after creating an invoice. Use this endpoint for both webhook verification and client-side polling.

Request Headers

HeaderValueRequired
AuthorizationBearer <access_token>Yes
Content-Typeapplication/jsonYes

Request Body

{ "object_type": "INVOICE", "object_id": "abc123-def456-ghi789", "offset": { "page_number": 1, "page_limit": 10 } }
FieldTypeRequiredDescription
object_typestringYesObject type — use "INVOICE"
object_idstringYesThe invoice ID to check
offsetobjectNoPagination parameters
offset.page_numbernumberNoPage number (default: 1)
offset.page_limitnumberNoItems per page (default: 10)

Example Request

curl -X POST https://merchant.qpay.mn/v2/payment/check \ -H "Authorization: Bearer <access_token>" \ -H "Content-Type: application/json" \ -d '{ "object_type": "INVOICE", "object_id": "abc123-def456-ghi789" }'

Response (Payment Found)

{ "count": 1, "paid_amount": 50000.00, "rows": [ { "payment_id": "pay-abc123", "payment_status": "PAID", "payment_amount": "50000.00", "trx_fee": "0.00", "payment_currency": "MNT", "payment_wallet": "qpay", "payment_type": "P2P", "card_transactions": [], "p2p_transactions": [ { "transaction_bank_code": "050000", "account_bank_name": "Khan Bank", "account_number": "1234567890", "status": "SUCCESS", "amount": "50000.00", "currency": "MNT" } ] } ] }

Response (No Payment Yet)

{ "count": 0, "paid_amount": 0, "rows": [] }
FieldTypeDescription
countnumberTotal number of payments found for this invoice
paid_amountnumberTotal paid amount across all payments
rowsarrayArray of payment detail objects
rows[].payment_idstringPayment identifier
rows[].payment_statusstringPayment status
rows[].payment_amountstringPayment amount
rows[].trx_feestringTransaction fee
rows[].payment_currencystringCurrency code
rows[].payment_walletstringPayment wallet
rows[].payment_typestringTransaction type (P2P or CARD)
rows[].card_transactionsarrayCard transaction details
rows[].p2p_transactionsarrayP2P transaction details

How to determine payment status: If count > 0 and rows contains entries, the invoice has been paid. If count is 0 and rows is empty, no payment has been made yet.

Error Responses

HTTP StatusError CodeDescription
400INVALID_OBJECT_TYPEInvalid object type (must be "INVOICE")

List Payments

POST /v2/payment/list

Returns a paginated list of payments matching the given filter criteria. You can filter by object type, object ID, and date range.

Request Headers

HeaderValueRequired
AuthorizationBearer <access_token>Yes
Content-Typeapplication/jsonYes

Request Body

{ "object_type": "INVOICE", "object_id": "abc123-def456-ghi789", "start_date": "2026-01-01", "end_date": "2026-12-31", "offset": { "page_number": 1, "page_limit": 20 } }
FieldTypeRequiredDescription
object_typestringYesObject type (typically "INVOICE")
object_idstringYesThe invoice ID
start_datestringYesStart date filter (YYYY-MM-DD)
end_datestringYesEnd date filter (YYYY-MM-DD)
offsetobjectYesPagination parameters
offset.page_numbernumberYesPage number (starts at 1)
offset.page_limitnumberYesItems per page

Example Request

curl -X POST https://merchant.qpay.mn/v2/payment/list \ -H "Authorization: Bearer <access_token>" \ -H "Content-Type: application/json" \ -d '{ "object_type": "INVOICE", "object_id": "abc123-def456-ghi789", "start_date": "2026-01-01", "end_date": "2026-12-31", "offset": { "page_number": 1, "page_limit": 20 } }'

Response

{ "count": 2, "rows": [ { "payment_id": "pay-abc123", "payment_date": "2026-02-26T10:00:00", "payment_status": "PAID", "payment_fee": "0.00", "payment_amount": "50000.00", "payment_currency": "MNT", "payment_wallet": "qpay", "payment_name": "...", "payment_description": "...", "object_type": "INVOICE", "object_id": "inv-abc123" }, { "payment_id": "pay-def456", "payment_date": "2026-02-25T14:30:00", "payment_status": "PAID", "payment_fee": "0.00", "payment_amount": "25000.00", "payment_currency": "MNT", "payment_wallet": "qpay", "payment_name": "...", "payment_description": "...", "object_type": "INVOICE", "object_id": "inv-def456" } ] }
FieldTypeDescription
countnumberTotal number of matching payments
rowsarrayArray of payment summary objects
rows[].payment_idstringPayment identifier
rows[].payment_datestringPayment timestamp
rows[].payment_statusstringPayment status
rows[].payment_feestringTransaction fee
rows[].payment_amountstringPayment amount
rows[].payment_currencystringCurrency code
rows[].payment_walletstringPayment wallet
rows[].payment_namestringPayment name
rows[].payment_descriptionstringPayment description
rows[].object_typestringRelated object type
rows[].object_idstringRelated object ID

Cancel Payment

POST /v2/payment/cancel/{id}

Cancels a payment by its payment ID. This operation is only applicable to card transactions. P2P (bank transfer) payments cannot be cancelled through the API.

Request Headers

HeaderValueRequired
AuthorizationBearer <access_token>Yes
Content-Typeapplication/jsonYes

Path Parameters

ParameterTypeDescription
idstringThe payment ID to cancel

Request Body (Optional)

{ "callback_url": "https://yoursite.com/cancel-callback", "note": "Reason for cancellation" }
FieldTypeRequiredDescription
callback_urlstringNoURL for cancellation status notification
notestringNoReason for cancellation

Example Request

curl -X POST https://merchant.qpay.mn/v2/payment/cancel/pay-abc123 \ -H "Authorization: Bearer <access_token>" \ -H "Content-Type: application/json" \ -d '{ "callback_url": "https://yoursite.com/cancel-callback", "note": "Customer requested cancellation" }'

Response

HTTP 200 on success with an empty response body.

Error Responses

HTTP StatusError CodeDescription
404PAYMENT_NOTFOUNDPayment does not exist
400PAYMENT_NOT_PAIDPayment has not been completed yet
400PAYMENT_ALREADY_CANCELEDPayment was already cancelled

Refund Payment

POST /v2/payment/refund/{id}

Refunds a payment by its payment ID. This operation is only applicable to card transactions. P2P (bank transfer) payments cannot be refunded through the API.

Request Headers

HeaderValueRequired
AuthorizationBearer <access_token>Yes
Content-Typeapplication/jsonYes

Path Parameters

ParameterTypeDescription
idstringThe payment ID to refund

Request Body (Optional)

{ "callback_url": "https://yoursite.com/refund-callback", "note": "Reason for refund" }
FieldTypeRequiredDescription
callback_urlstringNoURL for refund status notification
notestringNoReason for refund

Example Request

curl -X POST https://merchant.qpay.mn/v2/payment/refund/pay-abc123 \ -H "Authorization: Bearer <access_token>" \ -H "Content-Type: application/json" \ -d '{ "callback_url": "https://yoursite.com/refund-callback", "note": "Product return" }'

Response

HTTP 200 on success with an empty response body.

Error Responses

HTTP StatusError CodeDescription
404PAYMENT_NOTFOUNDPayment does not exist
400PAYMENT_NOT_PAIDPayment has not been completed yet
400PAYMENT_ALREADY_CANCELEDPayment was already cancelled

Payment Status Values

StatusDescription
PAIDPayment has been completed successfully
PENDINGPayment is in progress or awaiting confirmation
CANCELLEDPayment has been cancelled
REFUNDEDPayment has been refunded

Callback / Webhook

When a payment is completed, QPay sends a POST request to the callback_url specified during invoice creation. The callback body contains:

{ "invoice_id": "abc123-def456-ghi789" }

Upon receiving a callback, your server should:

  1. Call POST /v2/payment/check with the received invoice_id to verify the payment
  2. Update your order/transaction status based on the result
  3. Return an HTTP 200 response to acknowledge receipt

Never trust the callback alone — always verify via the check endpoint.

Last updated on