Overview
ORIGIN Neural uses Stripe for billing. All subscription management, payment processing, and invoice handling is done through the Stripe integration. The billing API lets you create checkout sessions, manage subscriptions, and access the customer portal.
Create Checkout
Start a new subscription by creating a Stripe checkout session. The user is redirected to Stripe's hosted checkout page.
/api/billing/checkoutAUTHCreate a Stripe checkout session for a subscription plan.
Parameters
| Name | Type | Description |
|---|---|---|
plan* | string | Plan ID: starter, pro, scale, enterprise. |
promo_code | string | Promotional code for discounts. |
Response
{
"checkout_url": "https://checkout.stripe.com/c/pay/cs_live_abc...",
"session_id": "cs_live_abc123"
}Customer Portal
Redirect users to the Stripe customer portal where they can update payment methods, view invoices, and manage their subscription.
/api/billing/portalAUTHCreate a Stripe customer portal session.
Response
{
"portal_url": "https://billing.stripe.com/p/session/abc..."
}Subscription
Get the current subscription status and plan details.
/api/billing/subscriptionAUTHGet current subscription details.
Response
{
"plan": "pro",
"status": "active",
"current_period_end": "2026-03-07T00:00:00Z",
"cancel_at_period_end": false,
"characters_used": 125000,
"characters_limit": 500000
}Payment History
Retrieve the payment history for the authenticated user.
/api/billing/paymentsAUTHGet payment history.
Response
{
"payments": [
{
"id": "pi_abc123",
"amount": 2900,
"currency": "usd",
"status": "succeeded",
"created": "2026-02-01T00:00:00Z",
"description": "Pro plan - monthly"
}
]
}Cancel Subscription
Cancel a subscription. The subscription remains active until the end of the current billing period.
/api/billing/cancelAUTHCancel subscription at end of current period.
Response
{
"status": "cancelled",
"active_until": "2026-03-07T00:00:00Z"
}Validate Promo Code
Check if a promotional code is valid before applying it at checkout.
/api/billing/validate-promoValidate a promotional code.
Parameters
| Name | Type | Description |
|---|---|---|
code* | string | The promo code to validate. |
Response
{
"valid": true,
"discount_percent": 20,
"applicable_plans": ["pro", "scale"]
}Plan Recommendation
Get a plan recommendation based on the user's usage patterns.
/api/billing/recommendationAUTHGet a recommended plan based on usage.
Response
{
"current_plan": "starter",
"recommended_plan": "pro",
"reason": "You've used 85% of your character limit 3 months in a row.",
"savings_estimate": "$10/month vs overage charges"
}