$TOKEN is a JWT from login; $KEY is the seeded API key.
1. Create a feature
2. Create a plan — it starts as a DRAFT
Plans are created in
DRAFT status regardless of what you pass at creation,
and draft plans reject subscriptions. Activation is a deliberate, separate
step (step 4).3. Link the feature with a pricing rule
type is always BASE; the behavior lives in value.pricing. For usage
pricing, price_per_unit and usage_unit_type are both required — the API
returns a specific error naming the missing field if you omit either.
4. Activate the plan
5. Create a customer — keyed by your ID
customerReferenceId is your system’s ID for this customer. You never need
Tanso’s internal UUID on the client API.
6. Subscribe
The client subscribe endpoint takes
customerReferenceId — not customerId.
The subscription is created inactive, and a DUE invoice for the base
price is generated. Access begins when that invoice is paid.7. Pay the invoice
Without Stripe connected, invoices are settled explicitly:mark-paid is rejected.)
8. Check the entitlement — now allowed
allowed: false. Enforcement is
real-time: the check reflects subscription state at the moment you ask.
9. Report usage — revenue is attributed immediately
12 × $0.10 = $1.20 of revenue at ingestion — margin
analytics don’t wait for invoice time. Replaying the same
eventIdempotencyKey returns 409 Conflict; generate a unique key per event.
At cycle close, the scheduler rolls the period’s usage into the next invoice
automatically.