Skip to content

Last updated: April 29, 2022

Start accepting payments using QPay, a favorite payment method in Qatar.

Information

To start accepting QPay payments, please contact your Customer Success Manager.

Model

Collecting

Payment flow

Bank transfer

Payment method type

Online banking

One-step payment

check

Authorization

error

Capture

error

Refund

check

Partial refund

check

Chargeback

error

Recurring payment

error

Overview

QPay payments follow a two-step process:

  1. Request a QPay payment
  2. Redirect the customer

Request a payment

For the full API specification, see the API reference.

post

https://api.checkout.com/payments

Request example

1
{
2
"amount": 100,
3
"currency": "QAR",
4
"source": {
5
"type": "qpay",
6
"description": "QPay Demo Payment",
7
"language": "en",
8
"quantity": "1",
9
"national_id": "070AYY010BU234M"
10
}
11
}

Response example

If you receive a 202 Success response with a status field set to Pending, your request was successful.

1
{
2
"id": "pay_7eil5osdlcdehe62et5aihec4q",
3
"status": "Pending",
4
"customer": {
5
"id": "cus_mydbq4wrfp3excwlexeefsv3be"
6
},
7
"_links": {
8
"self": {
9
"href": "https://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

Redirect your customer to the redirect link’s href in the response. This will allow the customer to authorize the payment, before they are transferred to your predefined success or failure URL.


Get details about a payment

You can use the id found in the payment response, or the cko-session-id from the success/failure URL (e.g., https://www.checkout.com/order/succeeded?cko-session-id=sid_vii64oquze5u3h2x6hh4rurc4y) to retrieve details about the payment.

Note

The cko-session-id expires 15 minutes after being created.

Use the details below to set up your request.

Endpoints

For the full API specification, see the API reference.

GET

https://api.checkout.com/payments/{id}

Response example

1
{
2
"id": "pay_7eil5osdlcdehe62et5aihec4q",
3
"requested_on": "2019-06-20T10:03:42Z",
4
"source": {
5
"type": "qpay",
6
"description": "QPay Demo Payment",
7
"pun": "skqewp72qqxpuckrdf2c"
8
},
9
"amount": 100,
10
"currency": "QAR",
11
"payment_type": "Regular",
12
"status": "Captured",
13
"approved": true,
14
"risk": {
15
"flagged": false
16
},
17
"customer": {
18
"id": "cus_mydbq4wrfp3excwlexeefsv3be"
19
},
20
"_links": {
21
"redirect": {
22
"href": "https://sbapi.ckotech.co/qpay-external/redirect-to-qpay?pun=52h7saoi5edthll6ceec"
23
},
24
"self": {
25
"href": "https://api.sandbox.checkout.com/payments/pay_7eil5osdlcdehe62et5aihec4q"
26
},
27
"actions": {
28
"href": "https://api.sandbox.checkout.com/payments/pay_7eil5osdlcdehe62et5aihec4q/actions"
29
},
30
"refund": {
31
"href": "https://api.sandbox.checkout.com/payments/pay_7eil5osdlcdehe62et5aihec4q/refunds"
32
}
33
}
34
}

Refund a payment

QPay supports both partial and full refunds. You can refund a payment through the Dashboard or by using the refund API.


Cancel a payment

If the customer fails to complete their payment, we will automatically void the payment and send a payment_expired webhook.

If the customer cancels their payment, we will send a payment_canceled webhook.


Webhooks

When using QPay, you may receive the following webhooks.

WebhookDescription

payment_pending

Occurs when a payment request has successfully initiated.

payment_capture_pending

Occurs when the customer has approved the payment on the banking page.

payment_captured

Occurs when a capture is successful.

payment_capture_declined

Occurs when a capture is declined.

payment_canceled

Occurs when the customer has canceled the payment or the payment has failed.

payment_expired

Occurs when the payment has expired.

payment_refund_pending

Occurs when a refund request has successfully initiated.

payment_refunded

Occurs when a refund is successful.

payment_refund_declined

Occurs when a refund is declined.


Testing QPay

Note

To start testing, you'll need to contact your Customer Success Manager or Integrations engineer to activate QPay payments in the sandbox environment.

  1. Create a QPay transaction as above, following the redirect link in the response to QPay's website.
  2. Enter the details of one of our test cards:
Card numberExpiry datePIN

4166 3904 1957 0368

06/2022

(any PIN)

4215 3755 0088 3243

(any future date)

123456

  1. Select Pay. You should then be redirected to your predefined success URL.