본문으로 건너뛰기
Copy for LLM

Accept a payment

Taking an online payment is three steps: open the page, send the customer to it, then follow the payment to its outcome.

Before the first payment​

Two settings on your account decide what a page may do, and an administrator sets them once in the Boundless dashboard (or over the settings API):

SettingWhat it decides
Allowed return originsWhere a customer's browser may be sent after paying. Every returnUrl you send must be on one of these origins — https://host[:port], no path. A request whose return address is anywhere else is refused with 400.
Checkout page expiryHow long a page takes payment, from 60 to 1800 seconds. The default is 120 seconds.

The expiry is not chosen per request. A table bill rarely needs longer than the default; raise it for flows where the customer takes time to decide.

Step 1 — Open the page​

curl https://api-live.kcpboundless.com/api/online/payments \
-H "X-API-Key: bndl_live_..." \
-H "Content-Type: application/json" \
-d '{
"merchantExternalId": "your-merchant-id",
"amount": 42.50,
"currency": "SGD",
"reference": "bill-7731",
"returnUrl": "https://order.example.com/bills/7731/return"
}'
FieldRequiredDescription
merchantExternalIdyesYour business identifier.
amountyesDecimal amount in the payment's currency, greater than zero.
currencyyesISO 4217 code, for example SGD.
referencerecommendedYour own reference for the order — a bill id, an invoice number. Up to 100 characters. It makes a retried request safe, and matches every outcome back to your records. See One live payment per reference.
returnUrlyesWhere the customer's browser is sent once the page is done. Must be on your allowed return origins.
allowedMethodsoptionalWhat the page offers: ["CARD"], ["E_WALLET"], or both. Omit to offer every method enabled on your account. E_WALLET covers every wallet and QR method, PayNow included.
descriptionoptionalShown on the page where the acquirer supports it, up to 100 characters — "Table 4", for instance.
customerName, customerEmail, customerMobileoptionalPassed to the page for the customer's convenience.

The response is the payment, waiting for the customer:

{
"id": "01a18691-b545-7952-ba41-661d336d894f",
"pspReference": "BNDL7K2P9QW1ABCD",
"status": "AWAITING_TERMINAL",
"amount": 42.50,
"currency": "SGD",
"reference": "bill-7731",
"channel": "ONLINE",
"checkoutUrl": "https://onlinepayments.pinelabs.sg/checkout/v1/pay?order_id=v1-...",
"checkoutExpiresAt": "2026-11-02T08:17:30Z"
}
  • id — the payment id. Use it to read the payment and to refund it. It is an opaque string; store it as text and pass it back unchanged.
  • status — AWAITING_TERMINAL means the page is open and the customer has not paid. The same status name is used for a bill waiting at a terminal; for an online payment it means waiting for the customer on the page.
  • checkoutUrl — the page. Send the customer's browser there.
  • checkoutExpiresAt — when the page stops taking payment.
Persist the id before you redirect

Store the payment id against the order in your own database before sending the customer to the page. The outcome arrives by webhook and on the customer's return, and both name the payment by its id.

A page the acquirer refuses to open comes back 201 with the payment already REFUSED (or ERROR when the acquirer could not be reached) and no checkoutUrl. Branch on status, never on the HTTP code alone.

Step 2 — Send the customer to the page​

Redirect the customer's browser to checkoutUrl. The page offers the methods you allowed, handles any card authentication (3-D Secure) itself, and lets the customer retry a declined card until the page expires.

When the page is done — paid, declined for good, or the customer gave up — the browser is sent to your returnUrl with the payment id appended:

https://order.example.com/bills/7731/return?paymentId=01a18691-b545-7952-ba41-661d336d894f

Nothing else is appended. The address carries no status, because a browser's address is the customer's to edit. On your return page, show "confirming your payment" and read the payment (or wait for the webhook) before showing a result.

A return is not an outcome

The customer's browser coming back tells you they came back — not that they paid, and not that they did not. A customer can close the tab after paying and never return at all. The outcome is the payment's status, read from Boundless, or the webhook.

Step 3 — Follow it to the outcome​

By webhook​

Register a webhook endpoint (see Webhooks) and Boundless will call it when the payment reaches a final state — captured, declined, cancelled, expired. This is your durable record of every outcome, delivered even if your return page was never shown.

By reading the payment​

Read the current state — what Boundless already knows. Cheap; use this on your return page and for routine polling:

curl https://api-live.kcpboundless.com/api/transactions/01a18691-b545-7952-ba41-661d336d894f \
-H "X-API-Key: bndl_live_..."

Refresh from the page — asks the acquirer what happened on the page and applies the answer before responding. Use it when you suspect Boundless's view is behind the page — the customer says they paid but the payment still reads as waiting:

curl -X POST https://api-live.kcpboundless.com/api/online/payments/01a18691-b545-7952-ba41-661d336d894f/sync-status \
-H "X-API-Key: bndl_live_..."

Either way the response is the payment, with its status advanced if the customer has finished:

{
"id": "01a18691-b545-7952-ba41-661d336d894f",
"status": "CAPTURED",
"amount": 42.50,
"currency": "SGD",
"reference": "bill-7731",
"paymentMethodType": "E_WALLET",
"walletProvider": "PAYNOW"
}

Both calls are safe to make repeatedly. Once a payment is final, its state does not change on you.

Every page ends​

Boundless checks every open page on its own, every few seconds, so a customer who closes the tab after paying is still recorded as paid. When a page reaches its expiry, Boundless asks the acquirer one last time, and if nobody paid it closes the payment as EXPIRED and stops the page at the acquirer so it can take no more payment. You do not have to reconcile abandoned pages yourself.

Outcomes​

StatusMeaningWhat your app should do
AWAITING_TERMINALThe page is open; the customer has not paid.Keep waiting.
CAPTUREDPaid. Funds are captured.Fulfil the order.
REFUSEDDeclined, and the page will take no further attempt. failureReason carries the acquirer's reason.Offer the customer a new page.
CANCELLEDWithdrawn before payment — by your app, or by the customer on the page.Close the order as unpaid.
EXPIREDThe page reached its expiry with nobody paying.Close the order as unpaid; open a new page if the customer is still there.
ERRORA processing problem prevented a decision.Safe to open a new page with the same reference.

A declined attempt the customer can retry does not end the page: the payment stays AWAITING_TERMINAL while they try another card. REFUSED arrives only when the acquirer has stopped accepting attempts.

Further statuses exist for refunds and settlement — see Refund a payment.

One live payment per reference​

Set a reference you can look up, and the API protects you from duplicates:

  • While a payment under a reference is waiting or paid, sending the same request again returns that same payment — still with its checkoutUrl while the page is open — rather than opening a second page. Retry a timed-out request with the same reference with confidence. A customer who taps "pay" twice gets one page.
  • A request under the same reference with a different amount or currency is refused with 409. Handing back the existing page would show the customer the wrong total, and opening another would let them pay twice. Use a new reference for a changed order.
  • A reference is free again once its payment ends unpaid — REFUSED, CANCELLED, EXPIRED, ERROR — or has been fully refunded. A new request then opens a new page.
  • A paid reference stays held through settlement and while a refund is on its way or has failed, so a bill that was paid cannot be paid again under the same reference.

Retry policy​

ConditionRetry?
Network timeout, no responseYes — same reference
5xxYes, with backoff — same reference
429Yes, after Retry-After
409No. The reference is in use with different details, or the payment is already decided.
4xx other than 409 and 429No. Fix the request.
201 with status ERRORYes — same reference
201 with status REFUSEDNo. The acquirer refused the page; check the reason.

Cancelling an open page​

If the order changes before the customer pays — a bill is edited, the customer abandons the table — withdraw the page:

curl -X POST https://api-live.kcpboundless.com/api/online/payments/01a18691-b545-7952-ba41-661d336d894f/cancel \
-H "X-API-Key: bndl_live_..."

Boundless reads the acquirer's record first, then stops the page at the acquirer and closes the payment CANCELLED. If the customer completed the payment in the same moment, their payment stands and the response comes back CAPTURED — always read the returned status. A payment that is already paid cannot be cancelled (409); refund it instead.

A payment that lands after the page was closed​

A page is stopped at the acquirer when it expires or is cancelled, so this is rare. If a customer's payment nevertheless completes after Boundless had closed the page — the acquirer accepted it in the last moment — Boundless finds it, within a minute, and deals with it so that a bill is never collected twice:

  • No other payment holds the reference — the customer paid once, late. The payment moves from EXPIRED (or CANCELLED) to CAPTURED and you receive PAYMENT_CAPTURED for a payment you had been told was over. Treat the bill as paid.
  • Another payment under the same reference was paid — the customer paid twice. The late one is refunded at the acquirer automatically and you receive PAYMENT_REFUNDED for it; the payment ends REFUNDED_EXTERNALLY. The bill's own payment is untouched.

So your webhook handler must accept PAYMENT_CAPTURED after PAYMENT_EXPIRED or PAYMENT_CANCELLED for the same payment, and must key on the payment id, not on the bill: PAYMENT_REFUNDED for the late payment does not mean the bill was refunded.

Good practice​

  • Match on your reference. Every webhook carries it as merchantReference.
  • Do not assume from the open call. A 201 means the page is open, not that the customer paid. The payment is only paid at CAPTURED.
  • Do not trust the return. Read the payment, or wait for the webhook, before showing a result.
  • Stop polling once the payment is final. Continued reads of a decided payment consume your rate-limit budget and tell you nothing new.