iFrame Integration
Embed Ivy Checkout directly in your website with our iFrame integration
Guide
This guide walks you through embedding Ivy Checkout directly in your website using our iframe integration. You’ll create a seamless checkout experience where customers can complete their payment without leaving your site.
Step 1: Backend Setup
Install Dependencies
First, install our official Node SDK:
Create a Checkout Session
Create an endpoint on your server that initializes a checkout session:
Handle Payment Status
Create an endpoint to verify payment status:
Step 2: Frontend Implementation
Choose your preferred frontend implementation:
Install Dependencies
Create IvyCheckout Component
Add Styling
Reference
Instead of redirecting to any callback URLs, the iframe communicates with the parent window via the postMessage
API.
The iframe will send a message to the parent window with the following fields:
Always equal to "ivy"
Always equal to "iframe"
Either "success"
or "error"
Your original checkoutSession
field referenceId
. Can also be used to fetch
a order
with the Retrieve an Order
endpoint.
Security Considerations
The iframe sandbox attributes are crucial for security. Each attribute serves a specific purpose:
allow-scripts
: Required for Ivy Checkout to functionallow-same-origin
: Enables secure communicationallow-forms
: Required for payment form inputallow-popups
andallow-popups-to-escape-sandbox
: Required for bank redirectsallow-top-navigation
: Required for completion redirects
Need Help?
- Contact help@getivy.de
- Check our API Reference for detailed endpoint documentation