Add Inzi checkout to your online store
Accept USDC and USDT payments on your e-commerce site. Works with any framework — just make an API call from your server.
Create checkout on order confirmation
When a customer clicks “Pay with crypto”, create a checkout on your server:
Next.js API Route
app/api/checkout/route.ts
import { NextResponse } from 'next/server'
export async function POST(req: Request) {
const { orderId, amount } = await req.json()
const res = await fetch('https://api.inzilink.com/api/v1/checkouts', {
method: 'POST',
headers: {
'Authorization': `Bearer ${process.env.INZI_API_KEY}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
amount: amount.toFixed(2),
currency: 'USD',
description: `Order ${orderId}`,
metadata: { order_id: orderId },
redirect_url: `${process.env.NEXT_PUBLIC_URL}/orders/${orderId}/success`,
webhook_url: `${process.env.NEXT_PUBLIC_URL}/api/webhooks/inzi`,
}),
})
const checkout = await res.json()
return NextResponse.json({ checkout_url: checkout.checkout_url })
}Redirect customer to checkout
On the frontend, redirect the customer to the checkout_url:
const res = await fetch('/api/checkout', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ orderId: 'ORD-123', amount: 49.99 }),
})
const { checkout_url } = await res.json()
// Redirect to Inzi checkout page
window.location.href = checkout_urlThe customer selects a chain (Polygon, TON, etc.), sees the payment address + QR code, and pays from any wallet.
Receive webhook when paid
routes/webhooks.js
app.post('/webhooks/inzi', express.raw({ type: 'application/json' }), async (req, res) => {
const event = verifyWebhook(req.body.toString(), req.headers, WEBHOOK_SECRET)
if (event.event === 'checkout.completed') {
const orderId = event.data.metadata.order_id
await markOrderAsPaid(orderId)
await sendOrderConfirmationEmail(orderId)
}
if (event.event === 'checkout.expired') {
const orderId = event.data.metadata.order_id
await markOrderAsExpired(orderId)
}
res.json({ ok: true })
})Customer returns to your site
If you set redirect_url, the checkout page redirects the customer back 2 seconds after payment confirmation.
Full flow
Customer → "Pay with crypto" →
Your server → POST /v1/checkouts →
Inzi returns checkout_url →
Redirect customer →
Customer pays →
Webhook → checkout.completed →
Mark order as paid →
redirect_url → "Thank you" page