1. Add the SDK
Includeplayto.js on the page where you want to sell.
2. Open the checkout
Wire it to your buy button. Pass the id of the product (payment link) you want to charge for, and a fullreturnUrl to send the customer back to after
payment.
productId is the id of a product (payment link). To charge an invoice, pass
the invoice’s id as paymentLinkId instead.3. Handle the return
When payment ends, the modal closes and the customer’s window goes to yourreturnUrl with the result appended to the URL. Call Playto.handleReturn() on
that page (often the same page, which reloads) to detect it and fire your
callback.
In Live, your site’s domain must be approved first. See
Going live.
React
There’s no separate React package — the SDK is framework-agnostic. Load the script once and call the global from an event handler:Load
playto.js via Next.js <Script>, a <script> in your document <head>,
or by injecting it once on mount — then call window.Playto.