subscription.platform.checkout ​
Start customer checkout for the canonical Orkestia platform subscription.
Create a Stripe checkout session for the canonical platform subscription.
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 to subscribe. |
user_uuid | uuid | No | — | User initiating checkout. |
success_url | string | Yes | — | Browser return URL after payment. |
cancel_url | string | Yes | — | Browser return URL after cancellation. |
selected_price_ref | string | No | — | Optional Stripe price reference for a selected billing cycle. |
user_seats | integer | No | — | Initial paid user seat quantity. |
key_seats | integer | No | — | Initial paid agent/key seat quantity. |
trace_ref | string | No | — | Trace reference for request correlation. |
return_channel | json | No | — | Optional notification routing metadata. |
agent_session_ref | string | No | — | Optional initiating agent session reference. |
idempotency_key | string | No | — | Caller-supplied retry key. |
Output Schema ​
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
organization_uuid | uuid | No | — | Organization UUID. |
plan_uuid | uuid | No | — | Resolved platform plan UUID. |
platform_app_code | string | No | — | Canonical app code. |
platform_plan_name | string | No | — | Resolved platform plan name. |
checkout_workflow_id | string | No | — | Child subscription.checkout workflow id to watch. |
checkout_url | string | No | — | Stripe Checkout URL to open in a browser. |
pending_subscription_uuid | uuid | No | — | Pending subscription UUID when available. |
stripe_checkout_session_ref | string | No | — | Stripe Checkout Session reference. |
selected_price_ref | string | No | — | Selected Stripe price reference. |
user_seats | integer | No | — | Requested user seat quantity. |
key_seats | integer | No | — | Requested key seat quantity. |
return_channel | json | No | — | Notification routing metadata. |
agent_session_ref | string | No | — | Initiating agent session reference. |
next_action | json | No | — | Instruction for UI/agent handoff. |
status | string | No | — | Wrapper status. |
completed_at | string | No | — | Workflow completion timestamp. |
failed_at | string | No | — | Failure timestamp. |
failure_reason | string | No | — | Failure reason. |
failure_type | string | No | — | Failure type. |
failed_action | string | No | — | Failed action. |
failed_at_state | string | No | — | Failed state. |
failed_step | string | No | — | Failed step. |
failed_layer | string | No | — | Failed layer. |
error | string | No | — | Error message. |
error_type | string | No | — | Error class. |
States ​
| State | Initial | Terminal | Success | Auto-advance | Description |
|---|---|---|---|---|---|
pending | Yes | No | — | create_checkout | — |
completed | No | Yes | Yes | — | — |
failed | No | Yes | No | — | — |
State Diagram ​
Transitions ​
| From | Action | To | Description |
|---|---|---|---|
pending | create_checkout | completed | — |
* (any state) | fail | failed | — |
Business Errors ​
| Code | Message Template |
|---|---|
BILLING_AUTHORIZATION_REQUIRED | |
BILLING_ITEM_INPUT_ERROR | |
BILLING_ORGANIZATION_NOT_FOUND | Organization {organization_uuid} not found |
PLATFORM_PLAN_NOT_FOUND | No active platform subscription plan is configured |
CHECKOUT_MANAGER_UNAVAILABLE | Workflow manager is unavailable, so checkout cannot be started |
CHECKOUT_URL_UNAVAILABLE | Checkout workflow {checkout_workflow_id} did not return a checkout URL |
API Usage ​
bash
POST /api/workflows/start
Content-Type: application/json
{
"workflow_type": "subscription.platform.checkout",
"initial_data": {
"organization_uuid": "value",
"success_url": "value",
"cancel_url": "value"
}
}