Skip to main content
billing.io handles recurring billing through plans, subscriptions, and automated renewal checkouts. Payments are collected in crypto at each billing interval. billing.io manages the full lifecycle — trials, renewals, retries, pauses, cancellations — so you can focus on your product.
Subscription billing is available on Growth plans and above. You need at least one active payment method configured before creating subscriptions.

Core concepts

ConceptDescription
PlanDefines billing terms: price, interval, token, chain, and optional trial period
SubscriptionLinks a customer to a plan. Tracks status and billing periods.
RenewalCreated automatically at each billing interval. Generates a checkout for payment.
EntitlementFeature flags attached to plans for gating access in your application.

Subscription lifecycle

Subscriptions move through a defined state machine:
StatusDescription
trialingTrial period active. No payment collected yet.
activeCurrent period is paid. Access should be granted.
past_duePayment failed after retries. Customer should be notified.
pausedPaused by merchant. Renewals skipped until resumed.
canceledCanceled. Access continues until current_period_end.
expiredTerminal. Subscription has ended.

Renewal flow

When a billing period ends, billing.io automatically:
  1. Creates a renewal record (status: pending)
  2. Generates a checkout for the next payment
  3. Waits for the customer to pay
If the checkout is confirmed, the renewal is marked paid and the subscription period advances. If payment fails, billing.io retries up to max_attempts. After all retries are exhausted, the subscription moves to past_due.

Entitlements

Entitlements attach feature flags to plans. Use them to gate features based on which plan a customer is subscribed to.
Value TypeFieldExample
booleanvalue_booleanadvanced_analytics: true
numericvalue_numericapi_requests: 10000
stringvalue_stringsupport_level: "priority"
Check entitlements at runtime via GET /subscriptions/entitlements/check. By centralizing entitlements in billing.io, your application no longer needs to manage billing edge cases — access decisions are derived directly from payment state.
Entitlements are defined on the plan, not on individual subscriptions. Updating entitlements on a plan affects all active subscribers immediately.

Plan intervals

IntervalDescription
dailyBilled every day
weeklyBilled every 7 days
monthlyBilled every calendar month
yearlyBilled every calendar year

Key webhook events

EventRecommended Action
subscription.renewedExtend access for the new period
subscription.past_dueWarn the customer, offer retry
subscription.pausedRestrict feature access
subscription.canceledRevoke access at period end

Code examples

Create a plan

curl -X POST https://api.billing.io/v1/subscriptions/plans \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Pro Monthly",
    "amount_usd": 49.99,
    "interval": "monthly",
    "token": "USDT",
    "chain": "tron",
    "trial_days": 14
  }'

Create a subscription

curl -X POST https://api.billing.io/v1/subscriptions \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "customer_id": "cus_abc123def456",
    "plan_id": "plan_xyz789",
    "payment_method_id": "pm_a1b2c3d4e5f6"
  }'

Pause, resume, and cancel

curl -X PATCH https://api.billing.io/v1/subscriptions/sub_abc123 \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "action": "pause" }'
curl -X PATCH https://api.billing.io/v1/subscriptions/sub_abc123 \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "action": "resume" }'
curl -X PATCH https://api.billing.io/v1/subscriptions/sub_abc123 \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "action": "cancel" }'
See the Subscription Billing guide for the full implementation walkthrough.