subscription.billing.lumen-plan.change ​
Change an organization's Lumen tier through Stripe-backed billing.
Change the Stripe-backed Lumen tier and request Lumen provisioning.
Overview ​
| Property | Value |
|---|---|
| Workflow type | Atomic |
| Library | App-subscription |
| Version | 1.0 |
Input Schema ​
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
organization_uuid | uuid | Yes | — | — |
plan | string | Yes | — | — |
retention_days | integer | No | — | — |
payment_confirmed | boolean | No | — | — |
stripe_checkout_session_ref | string | No | — | — |
proration_behavior | string | No | — | — |
billing_cycle_anchor | string | No | — | — |
return_channel | json | No | — | — |
agent_session_ref | string | No | — | — |
Output Schema ​
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
organization_uuid | uuid | No | — | — |
subscription_uuid | uuid | No | — | — |
plan | string | No | — | — |
retention_days | integer | No | — | — |
effective_retention_days | integer | No | — | — |
rate_limit_per_minute | integer | No | — | — |
stripe_price_ref | string | No | — | — |
stripe_subscription_item_ref | string | No | — | — |
stripe_action | string | No | — | — |
proration_behavior | string | No | — | — |
billing_cycle_anchor | string | No | — | — |
downgrade_cut_days | integer | No | — | — |
downgrade_effective_at | string | No | — | — |
scheduled_workflow_ref | string | No | — | — |
workflow_schedule_uuid | uuid | No | — | — |
scheduled_downgrade | json | No | — | — |
billing_item_uuid | uuid | No | — | — |
lumen_provisioning | json | No | — | — |
lumen_provisioning_reconcile_schedule_uuid | uuid | No | — | — |
payment_confirmed | boolean | No | — | — |
stripe_checkout_session_ref | string | No | — | — |
status | string | No | — | — |
completed_at | string | No | — | — |
failed_at | string | No | — | — |
failure_reason | string | No | — | — |
failure_type | string | No | — | — |
failed_action | string | No | — | — |
failed_at_state | string | No | — | — |
failed_step | string | No | — | — |
failed_layer | string | No | — | — |
error | string | No | — | — |
error_type | string | No | — | — |
States ​
| State | Initial | Terminal | Success | Auto-advance | Description |
|---|---|---|---|---|---|
pending | Yes | No | — | change_plan | — |
completed | No | Yes | Yes | — | — |
failed | No | Yes | No | — | — |
State Diagram ​
Transitions ​
| From | Action | To | Description |
|---|---|---|---|
pending | change_plan | completed | — |
* (any state) | fail | failed | — |
Business Errors ​
| Code | Message Template |
|---|---|
BILLING_AUTHORIZATION_REQUIRED | |
BILLING_OPERATION_INPUT_ERROR | |
BILLING_OPERATION_STRIPE_NOT_CONFIGURED | STRIPE_SECRET_KEY is required for paid billing item changes |
BILLING_OPERATION_PRICE_NOT_CONFIGURED | No Stripe price is configured for {item_code} |
BILLING_OPERATION_PLATFORM_SUBSCRIPTION_NOT_FOUND | No active platform subscription found for organization |
BILLING_OPERATION_PLATFORM_SUBSCRIPTION_NOT_BILLED | Organization {organization_uuid} has an active platform subscription record with no Stripe subscription behind it — platform checkout must complete before paid add-ons can be purchased |
API Usage ​
bash
POST /api/workflows/start
Content-Type: application/json
{
"workflow_type": "subscription.billing.lumen-plan.change",
"initial_data": {
"organization_uuid": "value",
"plan": "value"
}
}