> ## 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.

# Subscriptions

> Bill customers on a recurring schedule with crypto and handle renewals.

Subscriptions charge customers on a fixed interval. In ZBX, recurring paylinks create plans; customers subscribe; invoices are issued; webhooks notify you of lifecycle changes.

## Flow

1. Create a **recurring** plan/paylink (`type: Recurring`, `interval`, `intervalCount`)
2. Customer completes the first checkout
3. Platform issues invoices on schedule
4. You handle `Subscription.*` and `Invoice.*` webhooks

## Create a recurring paylink

```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": "Premium membership",
    "amount": "69.99",
    "currency": "USD",
    "type": "Recurring",
    "interval": "Month",
    "intervalCount": 1,
    "reference": "plan_premium_monthly"
  }'
```

## Plans API

List, create, and retrieve plans:

* `GET https://mapi.zbx.boomfi.xyz/v1/plan`
* `POST https://mapi.zbx.boomfi.xyz/v1/plan`
* `GET https://mapi.zbx.boomfi.xyz/v1/plan/{id}`

## Subscriptions API

* `GET https://mapi.zbx.boomfi.xyz/v1/subscriptions`: list
* `GET https://mapi.zbx.boomfi.xyz/v1/subscriptions/{customerID}`: list by customer
* `POST https://mapi.zbx.boomfi.xyz/v1/subscriptions/{subscriptionID}/invoices`: create invoice
* Cancel / delete flows as documented in the API reference under **Subscriptions**

## Events to handle

| Event                   | Why it matters                    |
| ----------------------- | --------------------------------- |
| `Subscription.Created`  | New subscription pending/starting |
| `Subscription.Updated`  | Active, status changes            |
| `Subscription.Canceled` | Churn / access revocation         |
| `Invoice.Created`       | New invoice open                  |
| `Invoice.Overdue`       | Failed renewal / dunning          |

Full detail: [Event Types](/webhooks/event-types).

## Cookbook

See [Cookbook: Recurring Billing](/payments/cookbook-recurring).
