Checkouts are how your customers pay for your products on mavi pay. Every purchase flows through a checkout session, which collects payment information, processes the charge via Stripe, and delivers benefits upon success.
mavi pay provides three ways to accept payments: hosted checkout pages, shareable checkout links, and an embeddable checkout widget.
When a customer clicks a buy button or visits a checkout link, they are taken to a hosted checkout page on pay.mavifinans.sh. This page handles:
The hosted checkout is fully managed by mavi pay. No code is required -- just create a product and share the link.
Checkout links are unique URLs tied to a specific product. You can generate them from the dashboard and share them anywhere -- email campaigns, social media posts, landing pages, or printed QR codes.
Each link directs the customer to the hosted checkout page for that product. See the Checkout Links documentation for details on creation, tracking, and customisation.
For a seamless experience on your own website, mavi pay provides an embeddable checkout widget. The widget renders an inline checkout form directly on your page, so customers never leave your site.
npm install @mavi-pay/sdkimport { MaviPayCheckout } from '@mavi-pay/sdk'
export default function BuyPage() {
return (
<MaviPayCheckout
productId="prod_xxxxxxxx"
onSuccess={(result) => {
console.log('Payment succeeded:', result.orderId)
}}
/>
)
}| Prop | Type | Description |
|---|---|---|
productId | string | Required. The ID of the product to sell. |
onSuccess | (result) => void | Callback fired after successful payment. |
onError | (error) => void | Callback fired if payment fails. |
theme | "light" | "dark" | Checkout form colour scheme. Defaults to "light". |
successUrl | string | Redirect URL after payment. Overrides the callback. |
You can customise the checkout experience from the dashboard under Settings > Checkout:
mavi pay fires webhook events at each stage of the checkout lifecycle. You can configure webhook endpoints in the dashboard under Settings > Webhooks.
Key events:
checkout.created -- A checkout session was initiated.checkout.completed -- Payment succeeded and the order is confirmed.checkout.failed -- Payment failed or was declined.