Skip to content

Managing your subscription

billing.read and billing.update belong to OWNER and BILLING only.

Organization settings → Billing, or:

Terminal window
curl -sS "https://cavsnode.com/api/v1/organizations/acme-ai/billing" \
-H "Authorization: Bearer $CAVS_TOKEN"

Returns the current plan, subscription status, the period, usage against the plan’s limits, and an invoice preview including projected overage.

  1. Go to Settings → Billing → Change plan and choose one.

  2. You’re redirected to the payment provider’s hosted checkout. CAVS never sees your card details.

  3. On success you come back and the plan applies — normally within seconds, once the provider’s webhook lands.

Over the API
curl -sS -X POST "https://cavsnode.com/api/v1/organizations/acme-ai/billing/checkout" \
-H "Authorization: Bearer $CAVS_TOKEN" \
-H "Content-Type: application/json" \
-d '{"plan_id": "team"}'
{ "url": "https://checkout.stripe.com/c/pay/…" }

Redirect the user to url.

Plan changes arrive by provider webhook. If it’s slow, nudge it:

Terminal window
curl -sS -X POST "https://cavsnode.com/api/v1/organizations/acme-ai/billing/confirm" \
-H "Authorization: Bearer $CAVS_TOKEN" \
-H "Content-Type: application/json" \
-d '{"plan_id": "team"}'

A 202 Accepted with {"status": "pending_webhook"} means the provider hasn’t confirmed yet — poll GET …/billing.

Cards, invoices, billing address, tax details and cancellation live in the provider’s portal:

Terminal window
curl -sS -X POST "https://cavsnode.com/api/v1/organizations/acme-ai/billing/portal" \
-H "Authorization: Bearer $CAVS_TOKEN"
{ "url": "https://billing.stripe.com/p/session/…" }

The link is short-lived and single-use — generate a fresh one each time.

Same flow with a lower plan_id.

Developer plans can add Bring Your Own S3 for $29/mo:

Terminal window
curl -sS -X POST "https://cavsnode.com/api/v1/organizations/acme-ai/billing/byos-addon" \
-H "Authorization: Bearer $CAVS_TOKEN" \
-H "Content-Type: application/json" \
-d '{"enabled": true}'

Team and Business include BYOS, so the add-on doesn’t apply. Disabling it while repositories use BYOS connections will fail — move or delete those repositories first.

Event Effect
billing.payment.failed Notification + email to the organization
Repeated failure The subscription lapses per the provider’s dunning policy
storage.quota.exceeded The organization is marked PAST_DUE

A PAST_DUE organization keeps its data and its read access. Write operations are refused with 402 until the situation is resolved.

Fix payment details in the billing portal. The change takes effect as soon as the provider confirms.

  1. Export or download anything you need first.

  2. Cancel the subscription in the billing portal. You revert to the Free plan at the end of the paid period.

  3. If you’re over Free’s limits, writes will be refused until you’re under them.

  4. To leave entirely, delete the organization (OWNER only).

Invoices, receipts, VAT/GST handling and billing addresses are all in the provider’s portal. CAVS stores only a reference to the subscription, never card details.

For annual billing, purchase orders, custom terms or an SLA, contact sales about the Business plan.

Every billing action is recorded in the audit log: billing.checkout_started, billing.subscription_updated, billing.byos_addon_updated — with actor and IP.

Terminal window
curl -sS "https://cavsnode.com/api/v1/organizations/acme-ai/audit" -H "$H" \
| jq '.events[] | select(.action | startswith("billing."))'