Prerequisites
- Create a one-time or subscription plan in Dashboard → Plans
- Enable desired payment methods in Dashboard → Checkout
- Configure workflows for each enabled payment method in Dashboard → Workflows
- PayNext API Key: Available in Dashboard → Developers → API Keys
How It Works
| Server-side | Create a session using the PayNext API. Pass the session id to your frontend. |
| Client-side | Mount the SDK checkout using the session id. |
Integration Steps
1
Create Session
Call the PayNext API from your server. See the API Reference for details.POST Use the
/client-sessionExample Request
Example Response
id from the response as your clientToken in the frontend.2
Install SDK
3
Preload SDK (Optional)
The SDK uses a CDN-based architecture with a small initial bundle. You can optionally preload the SDK when you anticipate checkout usage (e.g., on pricing pages):
4
Configure Return URL
Required for redirect-based payment methods (Cash App, Venmo, etc.). Without it, customers cannot complete checkout.
- Point to a page where the checkout is rendered
- Optionally, use a URL query parameter (e.g.,
?scrollTo=paynext-checkout) to scroll users back to checkout if it’s not at the top of the page
5
Mount Checkout
Initialize the SDK with your
clientToken and mount the checkout form.6
Test
Use the sandbox environment and test payment details available for your payment method and processor to validate your setup.
7
Go Live
- Change
environmentto'production'in your SDK config - Use production API keys on your backend
- Test with real payment methods before launch
- Set up webhooks for payment confirmations