subscription.billing.lumen-plan.checkout ​
Create a Stripe Checkout URL for a paid Lumen plan upgrade.
Create a prepaid checkout before applying paid Lumen upgrades.
Overview ​
| Property | Value |
|---|---|
| Workflow type | Linear |
| Library | App-subscription |
| Version | 1.0 |
Input Schema ​
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
organization_uuid | uuid | Yes | — | — |
plan | string | Yes | — | — |
retention_days | integer | No | — | — |
success_url | string | Yes | — | — |
cancel_url | string | Yes | — | — |
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 | — | — |
prior_plan | string | No | — | — |
prior_retention_days | integer | No | — | — |
prior_effective_retention_days | integer | No | — | — |
amount_due | integer | No | — | — |
currency | string | No | — | — |
stripe_customer_ref | string | No | — | — |
stripe_price_ref | string | No | — | — |
stripe_checkout_session_ref | string | No | — | — |
checkout_url | string | No | — | — |
next_action | json | No | — | — |
return_channel | json | No | — | — |
agent_session_ref | string | No | — | — |
billing_actor_ref | string | No | — | — |
change_result | json | No | — | — |
status | string | No | — | — |
completed_at | string | No | — | — |
canceled_at | string | No | — | — |
cancel_reason | 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 | — | create_checkout | — |
checkout_created | No | No | — | — | — |
canceled | No | Yes | Yes | — | — |
completed | No | Yes | Yes | — | — |
failed | No | Yes | No | — | — |
State Diagram ​
Transitions ​
| From | Action | To | Description |
|---|---|---|---|
pending | create_checkout | checkout_created | — |
checkout_created | payment_received | completed | — |
checkout_created | cancel | canceled | — |
* (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 |
BILLING_OPERATION_CHECKOUT_URL_UNAVAILABLE | Stripe did not return a checkout URL |
API Usage ​
bash
POST /api/workflows/start
Content-Type: application/json
{
"workflow_type": "subscription.billing.lumen-plan.checkout",
"initial_data": {
"organization_uuid": "value",
"plan": "value",
"success_url": "value",
"cancel_url": "value"
}
}