This API endpoint creates customer portal URLs without requiring prior user authentication. It automatically handles user creation and returns a customer portal URL.
Basic Setup
Endpoint
POST https://onlineapp.pro/api/v1/paywall/{paywallId}/get-customer-portal
Authentication
Include the
x-api-key
header with your API key.How to get your API key
- Log into your account
- Navigate to "Settings" → "API Keys"
- Create new or copy existing key
Request Details
URL Parameters
paywallId
(string, required) - Your paywall identifier
Request Body
{ "email": "user@example.com", "userMeta": { // pass any meta data to get it in webhook event "my-user-uuid": "pojfoih27938y50ujtb4ip1n2b", "utm_source": "facebook" } }
How to get paywall ID? Go to paywall settings page and take it from URL.
For example:
https://monetize.software/en/publisher/paywalls/547
Paywall ID is 547
Required Fields
- `email` - User's email address
Optional Fields
- `userMeta` - Custom user metadata (will be linked to user and return by webhook events)
Sample Implementation
const paywallId = '123'; const response = await fetch(`/api/v1/paywall/${paywallId}/get-customer-portal`, { method: 'POST', headers: { 'Content-Type': 'application/json', 'x-api-key': 'your-secret-api-key' }, body: JSON.stringify({ email: 'user@example.com', userMeta: { // pass any meta data to get it in webhook event "my-user-uuid": "pojfoih27938y50ujtb4ip1n2b", "utm_source": "facebook" } }) });
Response Format
{ "url": "https://checkout.stripe.com/c/pay/cs_test_..." }
Error Handling
Common Error Responses
- 400 - Bad Request (missing parameters, invalid format)
- 401 - Unauthorized (invalid API key)
- 409 - Conflict (active purchase exists)
- 500 - Internal Server Error
Process Flow
- Validate parameters and email format
- Check URL formats
- Verify API key
- Find or create user
- Link to paywall
- Create customer portal
Security Guidelines
- Store API keys securely
- Use HTTPS for all requests
- Validate email formats
- Verify URL formats
Integration
After receiving the checkout URL, redirect the user:
window.location.href = data.url; // or window.open(data.url, '_blank');