API Documentation v1
Everything you need to integrate with Central Payment API v1. Enhanced hosted checkout, multi-gateway fallbacks, comprehensive guides, interactive documentation, and code examples.
Quick Start
New to Central Payment API? Check out our interactive documentation below for step-by-step instructions.
Central Payment API v1 provides a unified interface for processing payments across multiple providers with enhanced hosted checkout, multi-gateway fallbacks, and comprehensive transaction management. Get started in minutes with our simple REST API.
Base URL v1
https://billing.flare99.com/api/v1
Required Headers
X-Api-Key: your_api_key
X-Signature: hmac_sha256_signature
X-Timestamp: unix_timestamp
Content-Type: application/json
Create One-Time Payment
Request
POST /api/v1/payments/hosted-url
{
"amount": 99.99,
"currency": "USD",
"description": "Premium upgrade",
"customer_email": "user@example.com",
"return_url": "https://yoursite.com/success"
}
Create Recurring Subscription
Request
POST /api/v1/subscriptions
{
"customer_email": "user@example.com",
"customer_name": "John Doe",
"plan_id": "plan_premium_monthly",
"trial_days": 14
}
27 Endpoints (27 documented) — Integration Kit includes 15 core requests
Use the Integration Kit to get started quickly; consult the interactive docs for the full API reference.
Authentication
Central Payment API uses HMAC-SHA256 signatures for secure authentication. Each request must include your API key and a properly signed request.
Generating Signatures
JavaScript Example
const crypto = require('crypto');
function generateSignature(timestamp, body, secretKey) {
const payload = `${timestamp}.${body}`;
return crypto
.createHmac('sha256', secretKey)
.update(payload)
.digest('hex');
}
Security Note: Requests older than 5 minutes are automatically rejected to prevent replay attacks.
API Endpoints
/payments
Create Payment
Create a new payment session with gateway URLs
/payments/hosted-url
Create Hosted URL
Generate hosted checkout URL for seamless payment
/payments
List Payments
Retrieve paginated payment history with filters
/payments/{hash}
Get Payment Details
Retrieve comprehensive payment information and attempts
Subscription Management API
Central Payment API v1 provides comprehensive subscription management with automated recurring billing, flexible plans, invoice generation, and complete lifecycle management. Perfect for SaaS, membership sites, and any business requiring recurring payments.
Enterprise-Ready: 32 subscription endpoints covering plans, invoices, events, and analytics with complete audit trails.
Subscription Lifecycle
/subscriptions
Create Subscription
Create new subscription with trial periods and custom metadata
/subscriptions
List Subscriptions
Retrieve subscriptions with filtering and pagination
/subscriptions/{id}/cancel
Cancel Subscription
Cancel subscription with prorating options
/subscriptions/{id}/change-plan
Change Plan
Upgrade/downgrade with automatic prorating
Available Plans
/subscription-plans
List Plans
Get all available subscription plans for your customers
/subscription-plans/{id}
Plan Details
Get detailed plan information, pricing, and features
Invoice & Billing
/subscription-invoices/{sub}/generate
Generate Invoice
Create invoices with custom due dates
/subscription-invoices/upcoming/{sub}
Preview Invoice
Preview next invoice before generation
/subscription-invoices/{id}/payment
Process Payment
Process invoice payments with gateway selection
/subscription-invoices/stats/overview
Invoice Analytics
Comprehensive billing analytics and metrics
Example: Create Subscription
Request
POST /api/v1/subscriptions
Content-Type: application/json
X-Api-Key: your_api_key
X-Signature: hmac_sha256_signature
X-Timestamp: unix_timestamp
{
"customer_email": "customer@example.com",
"customer_name": "John Doe",
"plan_id": "plan_premium_monthly",
"start_date": "2025-01-01",
"trial_days": 14,
"metadata": {
"source": "website",
"campaign": "winter_sale"
}
}
Response
{
"success": true,
"subscription": {
"id": "sub_1234567890",
"status": "trialing",
"customer": {
"email": "customer@example.com",
"name": "John Doe"
},
"plan": {
"id": "plan_premium_monthly",
"name": "Premium Monthly",
"price": 29.99,
"currency": "USD",
"billing_cycle": "monthly"
},
"trial_end": "2025-01-15T00:00:00Z",
"current_period_start": "2025-01-01T00:00:00Z",
"current_period_end": "2025-02-01T00:00:00Z",
"created_at": "2025-01-01T12:00:00Z"
}
}
This integration kit contains all the essential endpoints for building applications with Central Payment API.
Webhooks
v1 webhooks provide enhanced event notifications with automatic retry mechanisms, comprehensive delivery tracking, and bidirectional webhook management. All webhooks are signed with HMAC-SHA256 for security.
v1 Enhancement: Automatic retry with exponential backoff, delivery status tracking, and webhook health monitoring.
v1 Webhook Events
Payment Events
-
payment.completed -
payment.failed -
payment.pending -
payment.cancelled
Subscription Events
-
subscription.created -
subscription.activated -
subscription.cancelled -
subscription.plan_changed
Invoice Events
-
invoice.created -
invoice.paid -
invoice.failed -
invoice.overdue
v1 Key Features
Hosted Checkout
Create beautiful, branded checkout pages without frontend complexity. Users select payment methods, we handle everything else.
POST /api/v1/payments/hosted-url
Multi-Gateway Fallback
Automatic failover between payment providers. If Stripe fails, automatically try PayPal or other configured gateways.
Auto-retry with attempt tracking
Admin Dashboard
Dual Filament panels for comprehensive system administration and application-specific management.
System + App-level control
Enhanced Security
HMAC-SHA256 signatures, encrypted credentials storage, comprehensive audit trails, and reduced PCI scope.
HMAC + Encryption + Audit
Complete OpenAPI/Swagger Documentation v1
Comprehensive interactive documentation for 27 essential integration endpoints with complete schema definitions, examples, and testing capabilities
27 Endpoints
Essential integration & customer management
HMAC Security
Built-in authentication scheme documentation
Complete Schemas
Full request/response model definitions
Try It Out
Interactive testing directly from docs