subscription.billing.item.change ​
Change supported Stripe-managed billing item quantities.
Change a supported customer billing item through the billing surface.
Overview ​
| Property | Value |
|---|---|
| Workflow type | Atomic |
| Library | App-subscription |
| Version | 1.0 |
Input Schema ​
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
organization_uuid | uuid | Yes | — | Organization UUID. |
subscription_uuid | uuid | No | — | Optional platform subscription UUID. |
item_code | string | Yes | — | Billing item code. |
quantity | integer | Yes | — | Absolute target quantity. |
success_url | string | No | — | Stripe Checkout success return URL; required for paid increases. |
cancel_url | string | No | — | Stripe Checkout cancel return URL; required for paid increases. |
proration_behavior | string | No | — | Stripe proration behavior. |
selected_membership_uuids | list | No | — | Membership UUIDs confirmed for user-seat downgrade unseating. |
use_oldest_fallback | boolean | No | — | Allow oldest non-owner members to fill missing downgrade selections. |
user_uuid | uuid | No | — | User requesting the change. |
return_channel | json | No | — | Optional notification routing metadata. |
agent_session_ref | string | No | — | Optional initiating agent session reference. |
Output Schema ​
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
organization_uuid | uuid | No | — | — |
subscription_uuid | uuid | No | — | — |
item_code | string | No | — | — |
quantity | integer | No | — | — |
proration_behavior | string | No | — | — |
checkout_workflow_ref | string | No | — | — |
checkout | json | No | — | — |
checkout_url | string | No | — | — |
stripe_checkout_session_ref | string | No | — | — |
seat_change_workflow_ref | string | No | — | — |
seat_change | json | No | — | — |
seat_downgrade_workflow_ref | string | No | — | — |
seat_downgrade | json | No | — | — |
return_channel | json | No | — | — |
agent_session_ref | string | No | — | — |
next_action | json | 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_item | — |
completed | No | Yes | Yes | — | — |
failed | No | Yes | No | — | — |
State Diagram ​
Transitions ​
| From | Action | To | Description |
|---|---|---|---|
pending | change_item | completed | — |
* (any state) | fail | failed | — |
Business Errors ​
| Code | Message Template |
|---|---|
BILLING_ORGANIZATION_NOT_FOUND | Organization {organization_uuid} not found |
BILLING_PLATFORM_SUBSCRIPTION_NOT_FOUND | No active platform subscription found for organization |
BILLING_MANAGER_UNAVAILABLE | Workflow manager is unavailable, so billing item changes cannot be started |
BILLING_ITEM_NOT_MANAGEABLE | Billing item {item_code} is not manageable through Stripe yet: |
BILLING_ITEM_INPUT_ERROR | |
BILLING_CHILD_WORKFLOW_FAILED | {workflow_type} failed: |
BILLING_AUTHORIZATION_REQUIRED |
API Usage ​
bash
POST /api/workflows/start
Content-Type: application/json
{
"workflow_type": "subscription.billing.item.change",
"initial_data": {
"organization_uuid": "value",
"item_code": "value",
"quantity": 123
}
}