POST
/
checkout
/
rtp
/
initiate
cURL
curl -X POST "https://api.onekhusa.com/sandbox/v1/checkout/rtp/initiate" \
  --header "Content-Type: application/json" \
  --header "X-Idempotency-Key: your-idempotency-key" \
  -d '{
    "authentication": {
      "apiKey": "API_KEY",
      "apiSecret": "API_SECRET"
    },
    "merchant": {
      "organisationId": "ORG123456789",
      "merchantAccountNumber": 12345678
    },
    "payment": {
      "sourceReferenceNumber": "SRN123456789",
      "description": "GROCERIES PAYMENT",
      "amount": 450000.00
    },
    "route": {
      "successRedirectionUrl": "YOUR_APP_REDIRECTION_SUCCESS_PAGE_URL",
      "failureRedirectionUrl": "YOUR_APP_REDIRECTION_ERROR_PAGE_URL",
      "callbackApiUrl": "YOUR_WEBHOOK_PAYLOAD_ENDPOINT"
    }
  }'
{
  "sourceReferenceNumber": "SRN123456789",
  "merchantAccountNumber": 12345678,
  "paymentTransactionId": "GENERATED_TRANSACTION_ID"
}

2. Redirect To Checkout

Once your application receives a successfully initiated payment response, redirect to the following OneKhusa checkout page URL:
https://checkout.onekhusa.com/requestToPay/initiate?ptid=paymentTransactionId
Note that paymentTransactionId is a placeholder for the actual value received from payment response.
Request To Pay Checkout                              Figure 1: Request To Pay Checkout Your initiated payment transaction will be displayed as illustrated in figure 1 above and follow the instructions to pay through the supported banks and mobile money wallets on OneKhusa. Once payment is successful and received, you will be redirected automatically to your application.

3. Simulate Checkout Payment

To simulate a payment made by a customer through managed checkout service, do either one of the following:
  • Login to merchant portal, navigate to Fake Data – Simulate Accept Request To Pay, then provide details from the checkout (TAN and Amount) and finalise the payment OR
  • Use Simulate Accept Request To Pay endpoint

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer Token, Where accessToken is the access token used to authenticate the request.

Headers

X-Idempotency-Key
string

A unique key to ensure idempotent requests

Body

application/json
authentication
object
required
merchant
object
required
payment
object
required
route
object
required

Response

200 - application/json

Successful initiation of checkout request

sourceReferenceNumber
string
required

Unique reference number provided in the request.

Example:

"SRN123456789"

merchantAccountNumber
integer
required

Merchant account used for the transaction.

Example:

12345678

paymentTransactionId
string
required

Generated transaction ID used for redirecting to checkout.

Example:

"GENERATED_TRANSACTION_ID"