QPay for Payment Setup API
Last updated: April 30, 2026
To accept QPay payments, you must:
- Create a payment setup.
- Confirm the payment.
- Redirect the customer to QPay.
Call the Create a payment setup endpoint.
Information
Your base URL's {prefix} value is unique to your account and environment. To learn how to retrieve your base URLs for the sandbox and production environments, see API endpoints.
post
https://{prefix}.api.checkout.com/payments/setups
1{2"amount": 1000,3"currency": "QAR",4"description": "QPay payment",5"payment_methods": {6"qpay": {7"national_id": "28765432101",8"description": "Order ORD-5023-4E89"9}10},11"settings": {12"success_url": "https://example.com/payments/success",13"failure_url": "https://example.com/payments/failure"14}15}
In the request body, provide the following:
| Field | Description |
|---|---|
number | The payment amount, in the minor currency unit. |
string | Three-letter ISO 4217 currency code. |
string | A description of the payment. |
string | A description of the payment order. Alphanumeric characters only. |
string | The customer's Qatari national ID. Write-only — not returned in responses. |
string | The URL to redirect the customer to if the payment fails. |
string | The URL to redirect the customer to if the payment is successful. |
object | The customer's billing details. |
object | The customer's billing address. |
string | The first line of the billing address. |
string | The city of the billing address. |
string | The country of the billing address. |
string | A reference you can use to identify the payment. |
1{2"id": "set_rcmepwrchqab2wsergcafvijfy",3"processing_channel_id": "pc_wzjki6hw5puepb5fnvqlizj2e4",4"amount": 1000,5"currency": "QAR",6"payment_type": "Regular",7"reference": "ORD-5023-4E89",8"description": "QPay payment",9"payment_methods": {10"qpay": {11"status": "ready",12"flags": []13}14},15"available_payment_methods": [16"qpay"17],18"settings": {19"success_url": "https://example.com/payments/success",20"failure_url": "https://example.com/payments/failure"21}22}
The response returns a payment_methods object, which contains the payment methods enabled on your account.
When all required fields are present, the payment_methods.qpay object shows a ready status.
Confirm the payment by calling the Confirm a payment setup endpoint and provide:
- The payment setup
idas the{id}path parameter. qpayas the payment method name.
post
https://{prefix}.api.checkout.com/payments/setups/{id}/confirm/qpay
1{2"id": "pay_7eil5osdlcdehe62et5aihec4q",3"status": "Pending",4"customer": {5"id": "cus_mydbq4wrfp3excwlexeefsv3be"6},7"_links": {8"self": {9"href": "https://{prefix}.api.sandbox.checkout.com/payments/pay_7eil5osdlcdehe62et5aihec4q"10},11"redirect": {12"href": "https://sbapi.ckotech.co/qpay-external/redirect-to-qpay?pun=52h7saoi5edthll6ceec"13}14}15}
Redirect the customer to the redirect.href URL from the response. The customer completes the payment on the QPay page and is then redirected back to your settings.success_url or settings.failure_url.