Skip to main content
A subscription links a customer to a billing plan and drives the entire billing cycle. This guide covers every state a subscription can be in and how to move between them.

Status overview

              ┌─────────────────────────────┐
              │                             │
 create ─→  active  ─→  paused  ─→  active  ─→  canceled
              │                             │
              └──────────── canceled ───────┘
StatusDescription
activeThe subscription is running. Events accumulate and invoices are generated at period end.
pausedNo new events are counted and no invoice is generated until the subscription is resumed.
canceledThe subscription has ended. The current period’s usage is invoiced and no further billing occurs.

Creating a subscription

Subscriptions start immediately when created. The first billing period begins at the moment of creation.
curl -X POST https://api.monigo.co/v1/subscriptions \
  -H "Authorization: Bearer mk_live_..." \
  -H "Content-Type: application/json" \
  -d '{
    "customer_id": "<customer_id>",
    "plan_id": "<plan_id>"
  }'
Response fields to note:
FieldDescription
idThe subscription UUID — required for invoice generation
statusAlways active on creation
current_period_startWhen the first billing period began
current_period_endWhen the first invoice will be generated
trial_ends_atPresent only if the plan has trial_period_days > 0

Querying subscriptions

Fetch a single subscription or list subscriptions filtered by customer, plan, or status.
# Get one subscription
curl https://api.monigo.co/v1/subscriptions/<subscription_id> \
  -H "Authorization: Bearer mk_live_..."

# List active subscriptions for a customer
curl "https://api.monigo.co/v1/subscriptions?customer_id=<customer_id>&status=active" \
  -H "Authorization: Bearer mk_live_..."

Pausing a subscription

Pausing freezes billing without ending the customer relationship. While paused:
  • Incoming events are still ingested and stored
  • Those events are not included in any invoice until the subscription is resumed
  • No invoice is generated at period end
Use pausing for grace periods, customer-initiated downtimes, or when a payment fails and you want to give the customer time to update their payment method.
curl -X POST https://api.monigo.co/v1/subscriptions/<subscription_id>/pause \
  -H "Authorization: Bearer mk_live_..."

Resuming a subscription

Resuming an active billing period. Usage accumulated while paused is included in the next invoice.
curl -X POST https://api.monigo.co/v1/subscriptions/<subscription_id>/resume \
  -H "Authorization: Bearer mk_live_..."

Canceling a subscription

Canceling ends the subscription. Monigo generates a final invoice for all usage accumulated in the current period up to the cancellation time.
curl -X POST https://api.monigo.co/v1/subscriptions/<subscription_id>/cancel \
  -H "Authorization: Bearer mk_live_..."
Cancellation is immediate and irreversible. If you need to temporarily stop billing, use pause instead. A canceled subscription cannot be reactivated — you would need to create a new subscription.
After cancellation:
  1. A final invoice is generated for the partial period
  2. The invoice is finalized and sent for collection
  3. The subscription.canceled webhook is fired
  4. No further events are attributed to this subscription

Webhook events

Subscribe to these events in Dashboard → Webhooks to react to subscription state changes:
EventFired when
subscription.createdA new subscription is created
subscription.pausedA subscription is paused
subscription.resumedA paused subscription is resumed
subscription.canceledA subscription is canceled
subscription.trial_endingThe trial period is 3 days from ending

  • Billing Cycle — how periods advance and invoices are triggered
  • Invoice Lifecycle — what happens to the invoices a subscription generates
  • Webhooks — full event catalog and signature verification