Subscriptions

Read status and manage lifecycle for gateway subscriptions created after a verified checkout.

AGENTS.md
GET/api/v1/subscriptions/:id/
GET/api/v1/subscriptions/:id/status/

Returns the live subscription status for your app.

POST/api/v1/subscriptions/:id/cancel/

Defaults to cancellation at the current period end. Send {"immediate": true} with a secret key to end access now. Lifetime plans always end immediately.

Body fieldNotes
immediateOptional. Requires secret key when true.
reasonOptional free-form cancellation reason.
POST/api/v1/subscriptions/:id/resume/

Undoes a scheduled cancellation before the period ends.

GET/api/v1/subscriptions/:id/events/

Append-only lifecycle audit trail for the subscription.

Response fields

FieldMeaning
cancel_at_period_endAccess continues until period end.
canceled_atWhen cancellation was requested.
current_period_endWhen access renews or ends.

Webhooks

subscription.activated, subscription.cancel_scheduled, subscription.resumed, subscription.ended, plus grace/expiry events.

subscription.ended includes reason. Scheduled cancellations report cancel_at_period_end; immediate cancellations report the reason you supplied or canceled_immediately; ordinary expiry reports period_ended; and grace expiry reports grace_ended.

A renewal or plan-change checkout also emits subscription.activated. After an expired subscription, renewal creates a new subscription id; a plan change keeps the same id. Store the id from the latest event.

Audit trail

Each lifecycle event stores actor_type (dashboard, api_key, sdk, or system), actor_id, type, data, and created_at. Use it for support investigations and to show customers who changed their plan.

GET/api/platform/subscriptions/

Dashboard listing for your company (JWT). Supports cancel/resume from the UI.