Home
Bayon Pay Docs

Developer platform

One payment object.
Every Cambodian checkout.

A merchant connects their existing bank payment link, then uses a Bayon Pay API key on their website. Bayon Pay creates hosted KHQR checkouts and keeps orders synchronized through signed payment events.

Custom API

Available

WooCommerce

WooCommerce

Available

Shopify

Shopify

Available

01 · Store connection

A bank payment link is enough for the merchant

The merchant never enters a bank Merchant ID or bank API key. The store connects a USD link, a KHR link, or both; Bayon Pay supplies the API key used by the store's server.

1

Paste one or both supported Cambodian bank payment links and label each currency.

2

Generate a bpk_live_… Bayon Pay API key for the store's server.

3

Create payments by API; funds settle through the connected bank link.

Payment confirmation: some KHQR bank apps expose a QR-scanned state before the payment settles; others stay pending until the transfer completes. Bayon Pay only marks a payment paid once the connected bank link's own session reports an approved payment.
Optional smart routing: with both links connected, a USD-priced order can be settled through the KHR link using the merchant's locked USD→KHR rate. The API preserves the original order amount plus the converted settlement amount and rate.

02 · Custom websites

Create a payment server-side

Never expose a Bayon Pay live API key in browser JavaScript. Create the payment from your server; the key selects its store and connected bank payment link automatically.

Request
curl https://bayonpay.io/v1/payments \
  -H "Authorization: Bearer $BAYON_PAY_API_KEY" \
  -H "Idempotency-Key: order-1048-attempt-1" \
  -H "Content-Type: application/json" \
  -d '{
    "amount": 25.00,
    "currency": "USD",
    "reference_id": "ORDER-1048",
    "metadata": { "cart_id": "1048" },
    "prefer_alipay_plus": true
  }'
201 response
{
  "id": "pmt_4d78f5b2…",
  "status": "pending",
  "amount": "25.00",
  "currency": "USD",
  "settlement_amount": "100000",
  "settlement_currency": "KHR",
  "exchange_rate": 4000,
  "smart_routed": true,
  "reference_id": "ORDER-1048",
  "checkout_url": "https://…/pay/pmt_4d78f5b2…",
  "qr_string": "000201010212…6304AB12",
  "mode": "live",
  "settlement": "merchant_bank_account",
  "expires_at": "2026-08-30T08:42:00.000Z"
}
Live checkout: the connected bank payment link produces a bank-generated KHQR containing the settlement amount. Bayon Pay returns the raw KHQR string and a hosted checkout URL, and checks the bank's own payment session directly — it does not consume a merchant Bakong Open API allowance. A redirect or customer screenshot never marks an order paid.

03 · WooCommerce

A native gateway, checked against your plan

Download it from Integrations once your account is on Basic or higher. The gateway needs only your Bayon Pay API key — bank credentials never enter WordPress.

Installation

From Integrations, download the plugin, then in WordPress: Plugins → Add New → Upload Plugin, and activate it.

In WooCommerce → Settings → Payments → Bayon Pay, paste an API key from API keys and turn the gateway on. Store currency must be USD or KHR.

KHQR and Alipay+ each have their own switch, matching Connection. With both switched on, the customer picks between them on the Bayon Pay checkout page after placing the order — WooCommerce itself always shows a single payment option.

No webhook configuration is required: the plugin checks pending orders on its own schedule, which is what drives Bayon Pay to re-check the bank status. A webhook (optional, in the plugin's own settings) only shortens the wait.

Plan enforcement: the plugin polls Bayon Pay to confirm the account still qualifies, and every payment it creates is checked again on the server regardless of what the plugin does locally. Downgrading or cancelling below Basic takes the gateway out of checkout on its own — usually within the hour, immediately with the plugin's "Re-check now" button — with no separate action needed in WordPress.

04 · Shopify

Connect a store, then add one payment method

Bayon Pay never sits inside Shopify's checkout as a native gateway — it connects as an app that turns orders placed with a manual payment method into a KHQR / Alipay+ checkout, automatically.

Setup

From Integrations → Shopify, enter your store domain and connect — you'll approve the connection on Shopify, then land back here.

In Shopify: Settings → Payments → Manual payment methods → add one named Bayon Pay. Store currency must be USD or KHR.

A customer who chooses it at checkout gets an email with a KHQR / Alipay+ link for that order — with both switched on in Connection, they pick between them on the Bayon Pay checkout page.

Once the bank confirms payment, Bayon Pay marks the order paid in Shopify automatically — no manual reconciliation.

Optional: a Thank You page checkout extension shows a "Pay now" link right on the order confirmation page instead of making the customer wait for the email — Shopify's checkout framework doesn't allow embedding the checkout page itself there, so this links out to it instead. See integrations/shopify/thank-you-extension in the repository for the extension source and deploy steps.

Why not a native Shopify payment method? Bayon Pay is a software integration, not a licensed payment processor — Cambodian banks settle funds directly to the merchant. Shopify's native payments program is built around apps that briefly hold and settle funds themselves, which is a different model than the one Bayon Pay is built on.

05 · Webhooks & security

Add endpoints from the dashboard

Each endpoint receives a one-time signing secret. Only Bayon Pay's verified internal banking status may mark a payment paid and trigger a successful-payment event.

Verify signatures

Reject callbacks with an invalid HMAC or stale timestamp.

Process idempotently

The same event can arrive more than once; update an order once.

Match the amount

Confirm currency, amount, reference, and verified banking-rail status together.

Retry delivery

Use bounded retries and keep an auditable delivery record.

06 · Supported links

Merchant input versus Bayon Pay infrastructure

Merchants connect only a bank-issued payment link. Bayon Pay uses the provider's payment-link flow to create KHQR; verified payment confirmation remains a separate provider integration.

ABA PayWay linkCreates an amount-specific dynamic KHQRBeta available
KB PRASAC linkLink storage is available; dynamic KHQR adapter is not yet availableComing soon

Bank names identify potential integrations only and do not imply partnership, endorsement, or production availability.