Overview
Paygentic supports two distinct types of consumer accounts, each with different capabilities and use cases:Managed Consumers
Created via API by merchants for quick onboarding. Customers only access Paygentic in relation to this one merchant.
These customer do not have Paygentic users and only use Paygentic through the merchant integration.
Full Consumer Accounts
When the customer interacts with multiple merchants they can choose to keep everything in one account and sign in to Paygentic to manage their usage.
Creating Customers via API
Prerequisites
- Valid merchant API key
- Merchant account ID
- Customer email and preferable address
API Reference: See the Create Customer API endpoint for complete request and response schemas.
- New Managed Consumer
- Existing Managed Consumer
When creating a new customer with consumer data, you’re establishing a managed consumer account:
Idempotency: If a customer already exists for the consumer-merchant pair, the API returns
200 with the existing customer ID instead of creating a duplicate.Creating Subscriptions
Once you have a customer, you can create subscriptions. When creating a subscription you can define the amounts forflat billable metrics. These are recurring fees for every subscription period.
Flat fees that have instantly charged prices need to be paid before the subscription starts. In the subscription response there will be a payment link where the customer can pay for this charge. The payment link is also present if the subscription has a “prefundAmount”, this should be used to add funds for pay as go (instantly priced usage billable metrics).
API Reference: See the Create Subscription API endpoint for complete request and response schemas.
Customer Portal
The customer portal allows your customers to view their subscription details, usage metrics, invoices, and manage payment sources - all within a secure, hosted interface.Generating Portal Links
- Managed Consumer Portal
- Full Platform Access
For managed consumers, generate portal links via the subscription endpoint:This provides read-only access to subscription data, source management, and usage tracking.
API Reference: See the Generate Portal Link API endpoint for complete request and response schemas.
Embedding the Portal
You can embed the customer portal directly into your application, providing a seamless experience without redirecting users away.Setup Requirements
Before embedding:- Domain Whitelisting: Contact support@paygentic.io to whitelist your domain(s)
- CSP Configuration: Add
platform.paygentic.ioto your CSPframe-srcdirective:
Implementation
Understanding sandbox attributes
Understanding sandbox attributes
The
sandbox attribute is required for security:allow-scripts- Portal functionalityallow-same-origin- Communication with your siteallow-forms- Form submissionallow-popups- 3D Secure authentication
Payment Checkout
Payment checkout provides a hosted payment form for collecting payments on invoices or subscription fees.Creating Payment Sessions
- For Invoices
- For Subscriptions
Create a checkout session for an existing invoice:
Embedding Payment Checkout
Handling Payment Events
The payment checkout communicates completion status via postMessage events:| Event Type | When Triggered |
|---|---|
payment_success | Payment completed successfully |
payment_error | Payment failed or was cancelled |
How redirects work:
- Standalone page: Customers are redirected to your specified
redirectUrls - Embedded iframe: postMessage events are sent instead of redirecting
- The system automatically detects the context
Advanced: Event handling patterns
Advanced: Event handling patterns
Success handling example:Error handling example:
Next Steps
- Learn about Usage Events for tracking consumption
- Explore Pricing for billing configuration
- Understand Accounts for payment management