<iframe> or a lightweight JavaScript widget. Both options handle wallet display, QR code generation, and real-time payment status updates automatically.
Before you begin
You need a payment linkslug before embedding. Create one through the CLI or the API.
Step 1: create a payment link
- CLI
- API
Run the interactive CLI and follow the prompts to create a charge:Or use the non-interactive
--yes mode to create a link from env vars and capture the embed snippet from the JSON output:Step 2: copy the embed snippet
The API response includes both embed formats ready to use:Step 3: embed in your HTML
Choose the format that fits your site.iframe
Drop theiframe_snippet directly into your HTML. The recommended size is 400×600 px.
JavaScript widget
Add thejs_widget_snippet to your page. The script mounts the checkout inline where you place it.
How the checkout works
The hosted checkout page pollsGET /api/payments/status/{slug} every five seconds. When a USDC payment on Base is confirmed, the page updates automatically — no reload required.
Only USDC on Base (chain ID 8453) is accepted. The checkout displays the correct network and contract address to the payer. Transfers of any other token are silently ignored.
Choosing between iframe and JS widget
| iframe | JS widget | |
|---|---|---|
| Works without JavaScript | Yes | No |
| Static HTML sites | Best choice | Works if JS loads |
| React / Next.js / Vue | Works | Works |
| Custom mount target | No | Yes |
| Isolation from page styles | Yes (sandboxed) | No |