You need to enable JavaScript in order to use the AI chatbot tool powered by ChatBot REST API Specs - okePay
Developer Hub · REST API

okePay REST API

Create a payment order and receive a hosted checkout URL. Send form fields or JSON over HTTPS. No Bearer token — identify the merchant with merchant (your merchant_ref).

Base URL: https://okepay.biz/api Endpoint: POST /create_transaction

Authentication

No Bearer token is required. Pass your merchant reference in the body as merchant (the same value shown as merchant_ref in your merchant dashboard).

Content-Type: application/x-www-form-urlencoded   # or application/json
Accept:       application/json

merchant=1zLSD3

Create a transaction

POST /api/create_transaction — creates an order and returns a hosted checkout_url. Send the buyer to that URL to complete payment. Treat the IPN callback as the source of truth for payment status.

Request parameters

Field Required Description
merchantyesYour merchant_ref
amountfyesAmount in currency1 (e.g. 10.00)
currency1yesISO currency code (e.g. EUR, USD)
buyer_emailyesBuyer email
item_nameyesItem name shown on checkout / IPN
item_numberyesItem / SKU reference
invoiceyesYour order / invoice reference
ipn_urlyesServer-to-server notification URL
buyer_first_namenoBuyer first name
buyer_last_namenoBuyer last name
buyer_mobilenoBuyer mobile (e.g. +85290000000)
success_urlnoBrowser return URL after successful payment
cancel_urlnoBrowser return URL if payment is cancelled
send_email_paylinkno0 or 1 — email the checkout link to the buyer
email_subjectnoSubject when emailing the pay link
PaymentTypenoPayment type filter; use 0 for default / all enabled methods
user_creationnoAuto-create buyer account when needed
address_suppliednotrue / false — when true, send address fields
address_line1if addressRequired when address_supplied=true
address_cityif addressRequired when address_supplied=true
address_countrynoISO 3166-1 alpha-2 (e.g. HK). Defaults to HK
address_line2noAddress line 2
address_state_provincenoState / province
address_postal_codenoPostal code
localenoCheckout locale (e.g. en)

Example — form-urlencoded

POST https://okepay.biz/api/create_transaction
Content-Type: application/x-www-form-urlencoded
Accept: application/json

merchant=1zLSD3
&amountf=10.00
&currency1=EUR
&buyer_email=buyer@example.com
&buyer_first_name=John
&buyer_last_name=Doe
&buyer_mobile=+4407700000000
&item_name=Test Product
&item_number=SKU-001
&invoice=ORDER-100234
&ipn_url=https://your-shop.example/okepay/ipn
&success_url=https://your-shop.example/checkout?status=success
&cancel_url=https://your-shop.example/checkout?status=cancel
&send_email_paylink=0
&PaymentType=0
&locale=en

Example — JSON

POST https://okepay.biz/api/create_transaction
Content-Type: application/json
Accept: application/json

{
  "merchant": "1zLSD3",
  "amountf": "10.00",
  "currency1": "EUR",
  "buyer_email": "buyer@example.com",
  "buyer_first_name": "John",
  "buyer_last_name": "Doe",
  "buyer_mobile": "+4407700000000",
  "item_name": "Test Product",
  "item_number": "SKU-001",
  "invoice": "ORDER-100234",
  "ipn_url": "https://your-shop.example/okepay/ipn",
  "success_url": "https://your-shop.example/checkout?status=success",
  "cancel_url": "https://your-shop.example/checkout?status=cancel",
  "send_email_paylink": "0",
  "PaymentType": "0",
  "locale": "en"
}

Success response

{
  "status": true,
  "message": "",
  "response": {
    "payment_id": "READLXPY...",
    "original_amount": "10.00",
    "original_currency": "EUR",
    "checkout_url": "https://okepay.biz/apimakePayment/...",
    "confirms_needed": 1,
    "timeout": 18000,
    "paymentLink": "https://okepay.biz/apimakePayment/...",
    "amountf": "10.00"
  }
}

Open response.checkout_url in the browser so the buyer can pay on the hosted checkout page.

Webhooks (IPN)

When the payment status changes, okePay POSTs a notification to your ipn_url. Always use the IPN (not the browser return) to mark the order paid.

POST https://your-shop.example/okepay/ipn

# Payload fields include invoice, payment_id, status, amounts, and currency.
# Respond with HTTP 200 so delivery is acknowledged.

Responses

statusMeaning
trueOrder created — use response.checkout_url
falseValidation or merchant error — see message