Skip to content

QPay

Last updated: April 29, 2022

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

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

Authorization

Capture

Refund

Partial refund

Chargeback

Recurring payment


Overview

QPay payments follow a two-step process:


Request a payment

For the full API specification, see the API reference.

    post

    https://api.checkout.com/payments

    Copied!

    Request example

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

    Response example

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

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    {
    "id": "pay_7eil5osdlcdehe62et5aihec4q",
    "status": "Pending",
    "customer": {
    "id": "cus_mydbq4wrfp3excwlexeefsv3be"
    },
    "_links": {
    "self": {
    "href": "https://api.sandbox.checkout.com/payments/pay_7eil5osdlcdehe62et5aihec4q"
    },
    "redirect": {
    "href": "https://sbapi.ckotech.co/qpay-external/redirect-to-qpay?pun=52h7saoi5edthll6ceec"
    }
    }
    }

    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.

    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}

      Copied!

      Response example

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

      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

      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.