Merchant Onboarding & Product Setup
1
Create a Paygentic account
Go to platform.paygentic.io and sign up. Choose Merchant during registration.
2
Create a Product
Open your merchant dashboard and create a new product.
3
Define Billable Metrics
This is what you’ll charge for — e.g., number of code submissions or execution timeFor different API tiers, you can create separate metrics:
- Basic Submissions: Simple languages like Python, JavaScript
- Premium Submissions: Complex languages like Rust, Haskell
- Execution Time: Actual processing time in seconds
4
Create Plan and Price
- Create a usage plan
- Set a price for your metric (e.g.,
$0.001per submission)
Customer Onboarding
Now that your product is configured, you need to programmatically create customers and subscriptions when users sign up for your API service.1
Create a Customer
When a new user signs up for your API, create them as a managed customer in Paygentic:
The API is idempotent - if a customer already exists for this email/merchant combination, it returns the existing customer ID instead of creating a duplicate.
2
Create a Subscription
Once you have a customer ID, create a subscription to your plan. This establishes the billing relationship:
If your plan has upfront fees or if you specified a
prefundAmount, the response will include a payment.checkoutUrl that the customer must visit to complete payment before they can start using the API.3
Handle Payment (if required)
If the subscription requires initial payment, direct the user to complete it:For a seamless experience, you can embed the payment checkout in an iframe within your application. See the Customer Lifecycle guide for implementation details.
Tracking Usage
Once customers are onboarded and have active subscriptions, track their usage in real-time. This involves optional entitlement creation for payment pre-authorization and mandatory usage event reporting.1
Report Usage Events
When a customer uses your API, report the usage immediately to trigger real-time billing:
While the
entitlementId is optional when reporting usage, it is considered best practice to include it. Creating and consuming from a pre-authorized entitlement helps guarantee that you will be paid for the reported usage in full.2
Provide Customer Portal Access
Give your API users visibility into their usage and billing through the customer portal:The portal allows customers to:
- View real-time usage metrics
- Download invoices
- Manage payment methods
- Track spending
Complete Integration Example
Here’s how all the pieces fit together in your API service:Full Implementation
Full Implementation
Next Steps
You’ve successfully integrated pay-as-you-go monetization! Your API now benefits from:- Instant Revenue: Get paid immediately when customers use your API
- Zero Risk: No unpaid usage or bad debt from customers
- Transparent Pricing: Customers see exactly what they pay for each request
- Scalable Architecture: Handles high-volume APIs with edge infrastructure
Additional Resources
- Customer Lifecycle - Deep dive into customer management
- Usage Events - Advanced usage tracking patterns
- Entitlements - Payment pre-authorization strategies
- API Reference - Complete API documentation