Skip to main content
Use the Payoes checkout embed SDK when you want customers to pay without leaving your site. The SDK opens the same hosted checkout page in an iframe modal, so wallet flows and UI updates stay in sync with Payoes automatically.

Embed vs redirect

Always verify payment status on your server with webhooks or GET /api/v1/payments/{id}. Client-side callbacks are for UX only.

Installation

npm

Script tag

After npm run build, the IIFE bundle is served from your Payoes host:
For local development, use baseUrl: "http://localhost:3000".

End-to-end flow

1

Create a payment on your server

Use your secret API key to create a payment and read id or checkout_url.
2

Open checkout in the browser

Call Payoes.openCheckout({ paymentId }) after the customer clicks Pay.
3

Handle completion

Use onComplete to update UI. Confirm the payment with webhooks before fulfilling orders.

API

Payoes.openCheckout(options)

Payoes.closeCheckout()

Programmatically closes the modal and notifies the iframe. Customers can close with the X button, backdrop click, or Escape.

postMessage protocol

The iframe loads /c/{payment_id}?embed=1 and communicates with the parent page:

Troubleshooting

Ensure your Payoes host allows embedding. Checkout routes send Content-Security-Policy: frame-ancestors * in v1.
Some mobile wallets open in a separate app. After paying, return to the browser tab that opened the embed.
Confirm the payment reached completed or refunded status. Use webhooks as the source of truth.
Pass baseUrl: "http://localhost:3000" and create sandbox payments with a sandbox API key.