Skip to main content

The Happy Path

This guide walks through the complete happy path of billing a customer with Recurso. By the end, you will have created a plan, added a customer, started a subscription, and collected payment — with webhooks firing at each stage.

Step 1: Create a Plan

Define what you are selling and how much it costs.
Response:
Save the id — you will use it in step 3.
For pricing model options (flat rate, per-seat, tiered, usage-based), see the Plans guide.

Step 2: Create a Customer

Add the person or company who will be billed.
Response:
Save the id for the next step.
For B2B customers in India, include the gstin field to get GST-compliant invoices. See the GST Invoicing guide.

Step 3: Create a Subscription

Connect the customer to the plan. This starts the billing relationship.
Response:
Activation issues the first invoice. Fetch it (GET /v1/invoices?subscription_id=...) and send the customer to the hosted checkout page — https://api.recurso.dev/checkout/{invoice_id} — where Recurso picks the gateway from the invoice currency. (With a saved UPI mandate or card on file, collection is automatic instead.) After payment succeeds, Recurso fires these webhooks:

Webhook: subscription.created

Webhook: payment.succeeded

Grant access to your product when you receive subscription.created. See the Webhooks guide for signature verification.

Step 4: Invoice Auto-Generated

At the end of each billing period, Recurso automatically generates the next invoice. No API call is needed from your side.

Webhook: invoice.created

You can fetch any invoice at any time:

Step 5: Payment Collected

Recurso charges the customer’s saved payment method automatically. On success:

Webhook: invoice.paid

If payment fails, Recurso enters the dunning flow — retrying payment on a configurable schedule and sending reminder emails to the customer.

Webhook: invoice.payment_failed

Step 6: Subscription Renews

After payment succeeds, the subscription period advances automatically:
  • current_period_start moves to the start of the new period
  • current_period_end moves forward by one billing interval
  • A new invoice is generated at the next period end
This cycle repeats until the subscription is canceled or paused.

What Happens Next

Once the basic flow is running, you can layer on additional features:

Add Coupons

Apply discounts to subscriptions at creation time

Usage Billing

Add metered billing on top of flat-rate plans

Customer Portal

Let customers self-manage subscriptions and invoices

Webhooks

Set up production webhook endpoints with signature verification

Smart Retry

Configure intelligent payment retry logic

Go to Production

Switch from test to live keys and prepare for launch