Skip to Content

Invoices

Invoices are the primary mechanism for requesting payments through QPay. When you create an invoice, QPay generates a QR code and deep links that customers can use to pay via their banking apps.


Create Invoice

POST /v2/invoice

Creates a new payment invoice. QPay supports three types of invoices: simple, full, and ebarimt (tax receipt).

Request Headers

HeaderValueRequired
AuthorizationBearer <access_token>Yes
Content-Typeapplication/jsonYes

Request Body (Simple Invoice)

The minimal invoice with only required fields:

{ "invoice_code": "YOUR_INVOICE_CODE", "sender_invoice_no": "ORDER-001", "invoice_receiver_code": "terminal", "invoice_description": "Payment for Order #001", "amount": 50000, "callback_url": "https://yoursite.com/callback" }
FieldTypeRequiredDescription
invoice_codestringYesYour merchant invoice code (assigned by QPay)
sender_invoice_nostringYesYour unique invoice/order reference number
invoice_receiver_codestringYesReceiver code (use "terminal" for general payments, or customer email)
invoice_descriptionstringYesHuman-readable description shown to the payer
amountnumberYesPayment amount in MNT (Mongolian Tugrik)
callback_urlstringYesURL where QPay sends payment notification callbacks

Request Body (Full Invoice)

Full invoice with all available options including branch data, receiver data, line items, and transaction accounts:

{ "invoice_code": "YOUR_INVOICE_CODE", "sender_invoice_no": "ORDER-002", "sender_branch_code": "BRANCH_01", "sender_branch_data": { "register": "REG001", "name": "Main Branch", "email": "branch@company.mn", "phone": "77001234", "address": { "city": "Ulaanbaatar", "district": "Khan-Uul", "street": "Peace Avenue 123", "building": "Tower A", "apartment": "301", "zipcode": "16000" } }, "sender_staff_data": { "name": "Staff Name", "email": "staff@company.mn", "phone": "88001234" }, "invoice_receiver_code": "terminal", "invoice_receiver_data": { "register": "AA12345678", "name": "Customer Name", "email": "customer@example.com", "phone": "99001234" }, "invoice_description": "Detailed invoice", "enable_expiry": "true", "allow_partial": false, "minimum_amount": 10000, "allow_exceed": false, "maximum_amount": 100000, "amount": 50000, "callback_url": "https://yoursite.com/callback", "note": "Additional notes", "transactions": [ { "description": "Payment transaction", "amount": "50000", "accounts": [ { "account_bank_code": "050000", "account_number": "1234567890", "account_name": "Company Account", "account_currency": "MNT", "is_default": true } ] } ], "lines": [ { "tax_product_code": "TAX001", "line_description": "Product A", "line_quantity": "2", "line_unit_price": "25000", "note": "item note", "discounts": [ { "description": "Discount", "amount": 1000 } ], "surcharges": [ { "description": "Service fee", "amount": 500 } ], "taxes": [ { "description": "VAT", "amount": 2500 } ] } ] }

Additional Fields (Full Invoice)

FieldTypeRequiredDescription
sender_branch_codestringNoBranch code of the sender
sender_branch_dataobjectNoBranch details (name, email, phone, address)
sender_staff_dataobjectNoStaff member details (name, email, phone)
invoice_receiver_dataobjectNoReceiver details (register, name, email, phone)
enable_expirystringNoEnable invoice expiry ("true" or "false")
allow_partialbooleanNoAllow partial payment
minimum_amountnumberNoMinimum payment amount (when allow_partial is true)
allow_exceedbooleanNoAllow payment exceeding the invoice amount
maximum_amountnumberNoMaximum payment amount (when allow_exceed is true)
notestringNoAdditional notes
transactionsarrayNoTransaction routing details with bank accounts
linesarrayNoLine items with descriptions, quantities, and prices

Line Item Fields

FieldTypeDescription
tax_product_codestringTax product code
line_descriptionstringItem description
line_quantitystringQuantity
line_unit_pricestringUnit price
notestringItem note
discountsarrayDiscount items ({ description, amount })
surchargesarraySurcharge items ({ description, amount })
taxesarrayTax items ({ description, amount })

Request Body (Ebarimt Invoice)

For invoices that include electronic tax receipt (ebarimt) information:

{ "invoice_code": "YOUR_INVOICE_CODE", "sender_invoice_no": "ORDER-003", "invoice_receiver_code": "terminal", "invoice_description": "Tax invoice", "tax_type": "1", "district_code": "34", "callback_url": "https://yoursite.com/callback", "lines": [ { "tax_product_code": "TAX001", "line_description": "Taxable Product", "line_quantity": "1", "line_unit_price": "75000", "classification_code": "CLS001" } ] }
FieldTypeRequiredDescription
tax_typestringYesTax type code
district_codestringYesDistrict code for tax purposes
linesarrayYesLine items with tax product codes and classification codes
lines[].classification_codestringNoClassification code for the line item

Example Request

curl -X POST https://merchant.qpay.mn/v2/invoice \ -H "Authorization: Bearer <access_token>" \ -H "Content-Type: application/json" \ -d '{ "invoice_code": "YOUR_INVOICE_CODE", "sender_invoice_no": "ORDER-001", "invoice_receiver_code": "terminal", "invoice_description": "Payment for Order #001", "amount": 50000, "callback_url": "https://yoursite.com/callback" }'

Response

{ "invoice_id": "abc123-def456-ghi789", "qr_text": "qpay_data_string...", "qr_image": "base64_encoded_png_image...", "qPay_shortUrl": "https://qpay.mn/s/abc123", "urls": [ { "name": "Khan Bank", "description": "Khan Bank mobile app", "logo": "https://qpay.mn/logos/khanbank.png", "link": "khanbank://qpay?data=..." }, { "name": "Golomt Bank", "description": "Golomt Bank mobile app", "logo": "https://qpay.mn/logos/golomt.png", "link": "golomtbank://qpay?data=..." } ] }
FieldTypeDescription
invoice_idstringUnique invoice identifier (use this to check payment status)
qr_textstringQR code data as a text string
qr_imagestringBase64-encoded PNG image of the QR code
qPay_shortUrlstringShort URL that opens the QPay payment page
urlsarrayArray of deep links for mobile banking apps
urls[].namestringBank name
urls[].descriptionstringBank app description
urls[].logostringBank logo image URL
urls[].linkstringDeep link URL to open the banking app

Error Responses

HTTP StatusError CodeDescription
400INVOICE_CODE_INVALIDThe provided invoice code is invalid or does not belong to your merchant
400INVOICE_LINE_REQUIREDLine items are required (for ebarimt invoices)
400INVALID_AMOUNTThe payment amount is invalid (zero, negative, or non-numeric)
400MIN_AMOUNT_ERRAmount is below the allowed minimum
400MAX_AMOUNT_ERRAmount exceeds the allowed maximum
404MERCHANT_NOTFOUNDMerchant account not found
403MERCHANT_INACTIVEMerchant account is disabled or inactive

Get Invoice

GET /v2/invoice/{id}

Retrieves the details of an existing invoice by its ID.

Path Parameters

ParameterTypeDescription
idstringThe invoice ID returned from the create invoice response

Request Headers

HeaderValueRequired
AuthorizationBearer <access_token>Yes

Example Request

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

Response

Returns the full invoice object including its current status, QR code data, and payment URLs.

Error Responses

HTTP StatusError CodeDescription
404INVOICE_NOTFOUNDInvoice does not exist

Cancel Invoice

DELETE /v2/invoice/{id}

Cancels an existing invoice by its invoice ID. Only unpaid invoices can be cancelled.

Path Parameters

ParameterTypeDescription
idstringThe invoice ID to cancel

Request Headers

HeaderValueRequired
AuthorizationBearer <access_token>Yes

Example Request

curl -X DELETE https://merchant.qpay.mn/v2/invoice/abc123-def456-ghi789 \ -H "Authorization: Bearer <access_token>"

Response

HTTP 200 on success with an empty response body.

Error Responses

HTTP StatusError CodeDescription
404INVOICE_NOTFOUNDInvoice does not exist
400INVOICE_ALREADY_CANCELEDInvoice was already cancelled
400INVOICE_PAIDInvoice has been paid and cannot be cancelled

List Invoices

POST /v2/invoice/list

Returns a paginated list of invoices matching the given filter criteria.

Request Headers

HeaderValueRequired
AuthorizationBearer <access_token>Yes
Content-Typeapplication/jsonYes

Request Body

{ "invoice_code": "YOUR_INVOICE_CODE", "sender_invoice_no": "", "invoice_status": "", "start_date": "2026-01-01", "end_date": "2026-12-31", "offset": { "page_number": 1, "page_limit": 20 } }
FieldTypeRequiredDescription
invoice_codestringNoFilter by invoice code
sender_invoice_nostringNoFilter by your reference number
invoice_statusstringNoFilter by status
start_datestringNoStart date filter (YYYY-MM-DD)
end_datestringNoEnd date filter (YYYY-MM-DD)
offsetobjectYesPagination parameters
offset.page_numbernumberYesPage number (starts at 1)
offset.page_limitnumberYesNumber of items per page

Example Request

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

Response

{ "count": 42, "rows": [ { "invoice_id": "abc123-def456-ghi789", "invoice_code": "YOUR_INVOICE_CODE", "sender_invoice_no": "ORDER-001", "invoice_description": "Payment for Order #001", "amount": 50000, "invoice_status": "OPEN", "created_date": "2026-02-26T10:00:00" } ] }
FieldTypeDescription
countnumberTotal number of matching invoices
rowsarrayArray of invoice summary objects

Check Invoice Payment

POST /v2/invoice/check

Checks whether a payment has been made for a given invoice. This is functionally equivalent to POST /v2/payment/check but specifically designed for invoice-based lookups.

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_typestringYesAlways "INVOICE"
object_idstringYesThe invoice ID to check
offsetobjectNoPagination for multiple payments
offset.page_numbernumberNoPage number (default: 1)
offset.page_limitnumberNoItems per page (default: 10)

Example Request

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

Response

{ "count": 1, "paid_amount": 50000.00, "rows": [ { "payment_id": "pay-abc123", "payment_status": "PAID", "payment_amount": "50000.00", "payment_currency": "MNT", "payment_wallet": "qpay", "payment_type": "P2P" } ] }
FieldTypeDescription
countnumberNumber of payments found
paid_amountnumberTotal amount paid
rowsarrayArray of payment detail objects

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")
Last updated on