Ship Embedded Crypto Checkout in Days: Developer Playbook
Practical playbook for developers and product teams to implement embedded crypto checkout: pick hosted, SDK, or API; follow handshake, CSP, and HMAC rules.
Practical playbook for developers and product teams to implement embedded crypto checkout: pick hosted, SDK, or API; follow handshake, CSP, and HMAC rules.

Embedded crypto checkout means the payment interface loads inside your own site or app, usually through an iframe or webview, and talks back to your page through message passing instead of a redirect. Pick hosted checkout if you want production in days and don’t need custom UI. Pick an embedded SDK if your stack is React (or similar) and you want branded, in-page UX. Pick direct API if you need full control or run a non-JavaScript stack, and staff a backend engineer to own the payment-intent lifecycle.
TL;DR:
- Embedded crypto checkout increases conversion by keeping customers on your site but requires careful frontend integration and ownership of message protocols.
- The handshake process involves validating origin, establishing a communication channel with postMessage, and handling delegated data securely to prevent spoofing.
- Security controls include content policies, origin validation, webhook signature verification, and strict limits on payment token requests to prevent abuse.
- Integration time varies from a few days for hosted checkout or SDKs to weeks or months for native or deeply customized solutions, depending on your technical stack.
- Post-launch monitoring should focus on webhook reliability, signature verification failures, message latency, and ensuring proper handling of failed or incomplete transactions.
Embedded crypto checkout keeps the buyer on your page while a payment widget, iframe, or SDK component handles the wallet connection, address generation, and confirmation. That’s different from a hosted redirect, where the customer leaves your domain entirely, and different again from a wallet-first flow, where a browser extension like MetaMask drives the whole interaction outside any checkout UI you control.
Three use cases show up constantly: in-app purchases inside gaming or SaaS products, marketplace checkouts that need to split payments across sellers, and subscription billing where recurring charges have to happen without repeated wallet approvals. NFT drops are a fourth, though volume there is spikier and demands more load testing than a typical storefront.
The trade-offs are real and worth naming before you write a line of code:
Three paths cover almost every use case, and the right one depends more on your existing frontend stack than on how much control you want.
usePayment().openPaymentModal() and reacts to isLoading and isSuccess states while the backend handles HMAC-signed callbacks. This path suits teams already on React, Vue, or a comparably supported framework who want branded UX without building message handling from scratch.Ownership splits differently by path. Hosted checkout puts most of the work on backend and finance (webhook handling, reconciliation). SDK integration shifts weight to frontend (message handlers, UI states). Direct API demands both, plus a dedicated owner for signature verification and retry logic.
This is the part most teams underestimate. An embedded checkout isn’t just an iframe with a payment form in it; it’s a two-way conversation between your page and the host, and getting the message protocol wrong causes silent failures that are painful to debug.
Google’s embedded checkout guidance for its Universal Commerce Protocol lays out the pattern clearly: the embedded surface parses host query parameters on load, specifically ec_version, ec_auth, and ec_delegate, then uses those values to decide how to initialize. Communication runs on window.postMessage formatted as JSON-RPC 2.0, and every incoming message needs origin validation before you act on it. Skipping that check is how spoofed messages end up triggering real payment actions.
The flow itself runs through two handshakes. The first establishes the connection and confirms protocol version compatibility. The embedded checkout then sends an ec.ready message, and if the host offers a MessagePort upgrade, a second handshake moves the channel off the shared window object onto a dedicated port, which reduces noise from unrelated postMessage traffic on the page.

Delegation adds another layer. When the host passes ec_delegate for things like stored payment instruments or a saved address, your UI should hide those fields entirely and request the data from the host instead of collecting it again. Treat delegated data as authoritative and replace it in your local state wholesale, not merged field by field.
Your listener also needs to emit and respond to a defined set of events: ec.start, ec.line_items.change, ec.buyer.change, ec.payment.change, ec.fulfillment.change, ec.complete, and ec.messages.change. Miss one and the host has no way to know the checkout state actually changed.
Pro Tip: Build a small local test harness that fires each of these events manually before connecting to a real host. Debugging a missing ec.complete event in production, after the customer already paid, is a bad way to spend an afternoon.
Embedding a payment surface inside your page multiplies your attack surface if you skip the basics. None of these controls are optional once real money moves through the iframe.
frame-ancestors allowlist so only approved parent domains can embed your checkout, and apply iframe sandbox attributes, including credentialless contexts where cookies shouldn’t leak between origins.ec.complete event should never trigger a second fulfillment.Google’s guidance is explicit that hosts should release payment tokens only on valid user activation, meaning your embed should never programmatically request a token without a real click or tap behind it. That single rule closes off a whole class of automated abuse.
Break the work into three tracks and staff each one before you start, not after the first integration bug shows up.
Timelines vary more by team familiarity than by raw complexity. A hosted checkout integration typically lands in a few days once you’ve built the webhook consumer. A React-based SDK embed usually takes three to five days for a team already comfortable with the framework, mostly spent on state management and delegated-field handling. A full webview or native-app integration, especially one supporting both postMessage and native bridge fallbacks, commonly stretches into weeks or months, largely because native platforms need platform-specific bridge objects when postMessage isn’t available.
A staged rollout with a pilot merchant before full launch catches reconciliation gaps that only show up under real transaction volume.
Pro Tip: Run your pilot with a merchant who processes low but steady volume, not your highest-traffic account. You want to catch edge cases without a webhook backlog burying your team on day one.
Test the failure paths before you test the happy path. Handshake failures, a dropped connection mid-session that needs the channel upgrade to retry cleanly, delegated flows where the host’s data arrives late or malformed, message loss under network jitter, and partial or failed payments all need explicit test cases, not assumptions that they’ll behave like the demo environment.
Once live, track webhook success rate and HMAC verification failures as your two earliest warning signs. A rise in either usually means a signature mismatch on your end or a processor deploying a change to their signing key. Watch payment finality metrics closely too, since crypto settlement timing varies by network congestion in a way card payments never do, and alert on any payment stuck in a pending state past your expected window.
On the reconciliation side, every webhook needs idempotent handling so retried deliveries never double-post to your ledger. Map each payment_intent to a single ledger entry, and validate off-ramp timing separately from payment confirmation, since the moment a customer’s payment clears on-chain isn’t always the moment funds settle into your account.
Cryptopayr gives teams three real starting points instead of one. The hosted checkout and API cover the fastest path and the full-control path in the same product, both supporting 110+ cryptocurrencies with no KYC step slowing down onboarding.
Smaller teams without dedicated backend capacity should start with plugins or hosted checkout; teams building custom UX should look at the API directly.
Refunds work differently once payment settles on-chain, and that difference should shape your customer service policy before your first complaint arrives, not after.
A card chargeback reverses a payment through the card network, sometimes weeks after the sale. Crypto settlement is generally final once confirmed, so a “refund” is really a new transaction sent back to the customer, not a reversal of the original one. That means your system needs an explicit refund flow, initiated by the merchant, rather than relying on any built-in reversal mechanism the network provides.
Build refund handling into your payment-intent state machine from day one. A refund should reference the original payment_intent ID so your reconciliation job can link the two transactions, and it needs its own webhook event so your ledger reflects it correctly. Partial refunds add complexity, since you’re now tracking a partial payment against a line-item level order, not a single all-or-nothing transaction.

Dispute handling without a bank intermediary puts more weight on your own policies. Clear terms about refund windows, proof-of-delivery requirements for physical goods, and a documented process for handling failed or stuck transactions reduce the ambiguity that otherwise turns into support escalations. Some processors offer arbitration or mediation layers for marketplace disputes between buyers and sellers, which matters more if you’re running a platform with commission splitting rather than a single-merchant storefront.
Whatever refund policy you choose, publish it clearly at checkout. A customer who understands crypto payments settle differently from card payments is far less likely to file a dispute out of confusion rather than an actual problem with the transaction.
Pricing for crypto checkout usually breaks down into three components: a percentage fee per transaction, a flat per-payment fee, and sometimes a platform or white-label licensing cost layered on top.
Percentage-based fees typically scale down as your monthly volume grows, which rewards merchants who can commit to consistent transaction flow. Cryptopayr’s structure illustrates the pattern: Standard tier runs 2% per month, Growth drops to 1.5%, Scale to 1%, and Enterprise volume reaches 0.1%. A flat per-payment option also exists at $0.10 per transaction for merchants who prefer predictable costs over percentage-based fees, particularly useful for high-ticket, low-frequency sales where a percentage fee would otherwise be disproportionate.
Total cost of ownership goes beyond the processor’s published rate, though. Factor in engineering time to build and maintain the integration, which is real even on the hosted path since you’re still writing webhook consumers and reconciliation logic. Add support costs from handling failed transactions and refund requests, and don’t forget the operational cost of settlement, whether that means holding volatile assets or paying a small conversion spread to auto-convert into stablecoins.
Businesses running a marketplace or multi-seller platform should also weigh white-label licensing, which starts at 1% and typically bundles branding control with the same underlying processing infrastructure. That’s often cheaper than building commission-splitting logic from scratch, especially for a platform still validating product-market fit.
Compliance requirements for crypto checkout depend heavily on your jurisdiction, your customer base, and whether you or your processor holds custody of funds at any point, so treat any blanket claim of “no compliance needed” with suspicion.
Know Your Customer and Anti-Money Laundering obligations generally attach to the entity that takes custody of funds, even briefly. A processor that never holds your customers’ funds, converting directly between buyer and merchant wallets, shifts much of that obligation compared with one that custodies balances before settlement. That’s a meaningful distinction when you’re evaluating a no-KYC processor: the absence of a KYC step for you as a merchant doesn’t eliminate KYC or AML obligations that may apply to your own business under your local regulator, depending on your transaction volume and the nature of what you sell.
Jurisdictional variance is the harder problem. What counts as a regulated money transmission activity in one country may be treated entirely differently in another, and a merchant selling globally through an embedded checkout is effectively accepting payments across every jurisdiction a buyer connects from. Some regulators focus scrutiny on the fiat off-ramp step rather than the crypto transaction itself, since that’s where crypto value re-enters the traditional banking system.
A processor operating as a regulated Money Services Business, as Cryptopayr does, provides a compliance layer merchants would otherwise have to build themselves. That doesn’t remove every obligation from the merchant’s side, particularly around sales tax, consumer protection law, and any sector-specific licensing (money transmission, gaming, adult content) that applies regardless of payment method. Talk to a qualified compliance professional about your specific jurisdiction and product category before launch, not after your first regulator inquiry.
Conversion in embedded checkout hinges on removing friction points that don’t exist in card payments, and the biggest one is asking a buyer to leave your page to open a wallet app.
Card-first flows convert better for mainstream mobile buyers who don’t already have a crypto wallet installed, while wallet-first flows fit crypto-native audiences who expect to connect MetaMask or a similar wallet directly. A hybrid approach, defaulting to whichever method matches your traffic source, tends to outperform forcing every visitor down the same path. If your traffic comes mostly from crypto communities or NFT marketplaces, wallet-first UX won’t cost you conversion the way it would on a general e-commerce storefront.
Practical UX rules that matter more than they sound: show a real-time price in the customer’s local currency alongside the crypto amount, since asking someone to mentally convert exchange rates at checkout kills conversion fast. Keep the confirmation state visible and specific, showing pending, confirming, and complete states distinctly rather than a single generic spinner, because crypto confirmation times vary by network and a silent wait reads as a broken checkout.
Mobile matters even more here than in card checkout, since a large share of wallet interactions happen through mobile wallet apps that need to hand off cleanly between your page and the wallet’s own confirmation screen. Test that handoff on both iOS and Android before launch, since deep-linking behavior between a browser and a wallet app varies by platform in ways that are easy to miss in a desktop-only test pass.
Selecting a provider comes down to matching your team’s constraints against what each integration path actually demands, more than comparing feature lists side by side.
Start with your frontend stack. A provider offering a React SDK saves real time if that’s already your framework; if you’re on a different stack or building server-side rendered pages, a hosted checkout or direct API integration avoids fighting an SDK built for someone else’s tech choices. Next, weigh custody model. Some providers hold funds briefly before settlement; others route payments directly with auto-conversion to stablecoins, which matters for both compliance exposure and your exposure to price volatility between payment and settlement.
Fee structure deserves close scrutiny beyond the headline percentage. Look for setup fees, monthly minimums, and whether the rate drops as volume grows, since a provider charging a flat 2% regardless of scale becomes expensive fast once you’re processing meaningful volume. Coin and network support matters too. A merchant serving a global audience needs broader coverage than one running a niche storefront for a single crypto community.
Finally, check what happens when something breaks. Does the provider publish clear webhook documentation and HMAC verification guidance, or are you reverse-engineering payload formats from a support ticket? Platform-specific plugin support (WooCommerce, PrestaShop, Magento) shortens the evaluation period considerably if you’re running a standard e-commerce stack rather than a custom application. Weigh these criteria against your actual traffic profile and technical capacity rather than picking the provider with the lowest advertised fee.
Most embedded checkout failures trace back to a handful of predictable causes, and knowing them ahead of time turns a production incident into a caught bug.
Origin validation gaps top the list. Skipping strict origin checks on postMessage listeners opens the door to spoofed messages triggering real actions, and this bug often passes testing because local development environments don’t simulate a malicious origin. Handshake failures come next, particularly when a host offers a MessagePort upgrade and your code doesn’t handle the case where that upgrade fails or times out, leaving the connection silently broken.
Webhook reliability issues cause the most support tickets in practice. A missing idempotency check means a retried webhook double-fulfills an order; a missing HMAC verification means a forged request could trigger a fake payment confirmation. Both are preventable with code review focused specifically on those two checks before launch.
Delegated flow bugs show up when a host passes delegated payment data and the embedded UI doesn’t properly hide the corresponding fields, creating a confusing double-entry experience for the buyer. Network-related failures, dropped connections mid-transaction or delayed webhook delivery under load, need explicit retry and timeout logic rather than an assumption that the network behaves reliably.
Monitor for these specifically: webhook delivery latency, HMAC verification failure rate, incomplete handshake attempts, and any payment stuck in a pending state longer than your network’s typical confirmation window. Set alerts on each rather than waiting for a customer complaint to surface the pattern.
Pilot hosted checkout first if your team is small; move to an SDK once you know your volume justifies the frontend investment. Get HMAC verification and reconciliation right before anything else. Everything downstream depends on those two holding up under real traffic.
— Dustin
This platform is built for the exact decision this article just walked through: hosted checkout when you need speed, an API when you need control, and plugins for common e-commerce platforms. There is no KYC step slowing down onboarding, and fees include a low starting percentage at the top volume tier with a flat per-payment option available for predictable pricing.

If you’re weighing custody and settlement decisions from the pricing section above, the processing page breaks down how auto-conversion to stablecoins works alongside standard settlement. Marketplaces handling commission splits across sellers should look at the platform tools built specifically for that structure. Whichever path fits your stack, start by generating an API key from the gateway page and running a test transaction against your own staging environment before touching production traffic.
For the handshake and event details covered above, read Google’s Universal Commerce Protocol embedded checkout guide directly. Bold Commerce’s PIGI iframe integration doc shows a working iframe/postMessage example with SCA handling. For checkout-strategy data on card versus wallet-first conversion, see this card vs crypto checkout comparison.
It’s a payment interface that loads inside your own site or app, typically through an iframe, rather than redirecting customers to a separate page. It communicates with your page using postMessage and JSON-RPC, and it’s the approach Google’s Universal Commerce Protocol documents in detail.
A hosted checkout typically launches in a few days once your webhook consumer is built. A React SDK embed usually takes three to five days for a team already familiar with the framework, while a native webview integration can stretch into weeks or months.
Yes. Cryptopayr offers a no-KYC onboarding process across its hosted checkout, API, and plugin options, supporting 110+ cryptocurrencies. Fees start at 0.1% per transaction at the Enterprise volume tier.
Webhooks notify your backend when a payment status changes, and they should always carry an HMAC signature your server verifies before trusting the payload. Treat every webhook as idempotent, since processors retry deliveries and duplicate handling causes double fulfillment.
Since on-chain settlement is generally final, a refund is a new transaction sent back to the customer rather than a reversal of the original payment. Merchants need an explicit refund flow tied to the original payment intent, with its own webhook event for reconciliation.
Open a free CryptoPayr account and take your first crypto payment the same day.
Get started for free
Decide if you need a crypto gateway or exchange by mapping where funds settle. Follow the six step checkout to settlement flow that merchants must confirm...
Accept NEAR payments with a developer checklist: avoid token vs native mistakes and secure access keys. Or go live fast with Cryptopayr no KYC.
Three ways to accept Bitcoin Cash: gateway, plugins and hosted checkout, or direct wallet. Cryptopayr skips KYC, auto-converts, and can go live in a day;...