> ## Documentation Index
> Fetch the complete documentation index at: https://docs.zbx.boomfi.xyz/llms.txt
> Use this file to discover all available pages before exploring further.

# Cookbook: Recurring Billing

> End-to-end subscription setup with invoices and lifecycle webhooks.

Bill customers on a interval using recurring paylinks and subscription webhooks.

## 1. Prerequisites

Same as [Cookbook: Sell a Product](/payments/cookbook-sell-product): settlement, API key, verified webhooks.

## 2. Create a recurring offer

```bash theme={null}
curl -X POST "https://mapi.zbx.boomfi.xyz/v1/paylinks" \
  -H "X-API-KEY: sk_test_xxx" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Pro plan",
    "amount": "29.00",
    "currency": "USD",
    "type": "Recurring",
    "interval": "Month",
    "intervalCount": 1,
    "reference": "pro_monthly"
  }'
```

Share the checkout URL. See [Subscriptions](/payments/subscriptions).

## 3. Provision access from webhooks

| Event                           | Merchant action                                   |
| ------------------------------- | ------------------------------------------------- |
| `Subscription.Created`          | Record pending subscription                       |
| `Subscription.Updated` (Active) | Grant product access                              |
| `Payment.Updated` (Succeeded)   | Confirm paid period                               |
| `Invoice.Created`               | Record open invoice                               |
| `Invoice.Overdue`               | Notify customer / restrict access per your policy |
| `Subscription.Canceled`         | Revoke access                                     |

Always [Verify Webhook Signatures](/webhooks/verify-signatures) and enforce idempotency on subscription and invoice ids.

## 4. Cancel

Use the Merchants API cancel-subscription endpoints (see API reference) or customer-facing cancel flows if enabled. Expect a cancellation webhook when status settles.

## 5. Ops

Use [Event History and Replay](/webhooks/event-history-and-replay) if renewal notifications failed to reach your servers.
