Skip to content

Update a subscription-enrollment

PUT
/subscription-enrollments/{id}
id
required
string

DocumentId

object
data
object
status
string
Allowed values: active pending_downgrade cancelled expired
plan_id
string
plan_name
string
started_at
string format: date-time
expires_at
string format: date-time
cancelled_at
string format: date-time
cancel_reason
string
retention_offer_shown
boolean
auto_renew
boolean
stripe_customer_id
string
stripe_subscription_id
string
stripe_price_id
string
current_period_end
string format: date-time
cancel_at_period_end

F3.BILLING.02 — subscription is scheduled to cancel at current_period_end (Stripe cancel_at_period_end=true) rather than immediately. Enables reactivate before the period ends.

boolean
pending_tier_change

F3.BILLING.02 — set when a period-end downgrade is scheduled (Stripe subscription_schedule / update at period end): { newTierId, newPlanName, effective_at }. Cleared once Stripe confirms the change via customer.subscription.updated.

addons

F3.BILLING.02 — active addon Stripe subscription line items: [{ addon_id, stripe_price_id, quantity, stripe_item_id }]. Mirrors Stripe as the source of truth; updated by /addons action and the subscription.updated webhook.

dunning_state

F3.BILLING.03 — sencai-watchdog dunning state machine. none = current on payment; payment_failed = day 0 (invoice.payment_failed received); grace_period = day 7 unpaid (in-app banner warning); suspended = day 14 unpaid (org.org_status also flips to ‘suspended’, read-only enforcement); terminated = day 30 unpaid (non-critical cloud instances terminated + org archived, gated behind WATCHDOG_AUTO_TERMINATE). Reset to ‘none’ on invoice.paid (restore). Owned exclusively by sencai-watchdog via service-secret endpoints — never written by any user-facing route.

string
Allowed values: none payment_failed grace_period suspended terminated
dunning_state_changed_at

F3.BILLING.03 — timestamp of the last dunning_state transition. Used by sencai-watchdog to compute day-count thresholds (7d/14d/30d) idempotently across hourly cron runs.

string format: date-time
organisation
One of:

DocumentId reference to api::organisation.organisation

string

Updated

object
data
object
status
string
Allowed values: active pending_downgrade cancelled expired
plan_id
string
plan_name
string
started_at
string format: date-time
expires_at
string format: date-time
cancelled_at
string format: date-time
cancel_reason
string
retention_offer_shown
boolean
auto_renew
boolean
stripe_customer_id
string
stripe_subscription_id
string
stripe_price_id
string
current_period_end
string format: date-time
cancel_at_period_end

F3.BILLING.02 — subscription is scheduled to cancel at current_period_end (Stripe cancel_at_period_end=true) rather than immediately. Enables reactivate before the period ends.

boolean
pending_tier_change

F3.BILLING.02 — set when a period-end downgrade is scheduled (Stripe subscription_schedule / update at period end): { newTierId, newPlanName, effective_at }. Cleared once Stripe confirms the change via customer.subscription.updated.

addons

F3.BILLING.02 — active addon Stripe subscription line items: [{ addon_id, stripe_price_id, quantity, stripe_item_id }]. Mirrors Stripe as the source of truth; updated by /addons action and the subscription.updated webhook.

dunning_state

F3.BILLING.03 — sencai-watchdog dunning state machine. none = current on payment; payment_failed = day 0 (invoice.payment_failed received); grace_period = day 7 unpaid (in-app banner warning); suspended = day 14 unpaid (org.org_status also flips to ‘suspended’, read-only enforcement); terminated = day 30 unpaid (non-critical cloud instances terminated + org archived, gated behind WATCHDOG_AUTO_TERMINATE). Reset to ‘none’ on invoice.paid (restore). Owned exclusively by sencai-watchdog via service-secret endpoints — never written by any user-facing route.

string
Allowed values: none payment_failed grace_period suspended terminated
dunning_state_changed_at

F3.BILLING.03 — timestamp of the last dunning_state transition. Used by sencai-watchdog to compute day-count thresholds (7d/14d/30d) idempotently across hourly cron runs.

string format: date-time
organisation
One of:

DocumentId reference to api::organisation.organisation

string
documentId
string
id
integer
createdAt
string format: date-time
updatedAt
string format: date-time
publishedAt
string format: date-time
nullable

Validation error

Missing or invalid authentication

Not authorized (tenant scope or capability)

Not found