subscription.billing.portal-session.create ​
Create a Stripe Billing Portal URL for customer self-service billing management.
Create a Stripe Billing Portal session and return a browser handoff.
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. |
return_url | string | Yes | — | Browser return URL. |
user_uuid | uuid | No | — | User requesting the portal URL. |
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 | — | — |
stripe_customer_ref | string | No | — | — |
portal_url | string | No | — | — |
return_url | string | 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 | — | create_portal_session | — |
completed | No | Yes | Yes | — | — |
failed | No | Yes | No | — | — |
State Diagram ​
Transitions ​
| From | Action | To | Description |
|---|---|---|---|
pending | create_portal_session | completed | — |
* (any state) | fail | failed | — |
Business Errors ​
| Code | Message Template |
|---|---|
BILLING_ORGANIZATION_NOT_FOUND | Organization {organization_uuid} not found |
BILLING_STRIPE_NOT_CONFIGURED | STRIPE_SECRET_KEY is required to create a Stripe billing portal session |
BILLING_PORTAL_URL_UNAVAILABLE | Stripe did not return a billing portal URL |
BILLING_ITEM_INPUT_ERROR | |
BILLING_AUTHORIZATION_REQUIRED |
API Usage ​
bash
POST /api/workflows/start
Content-Type: application/json
{
"workflow_type": "subscription.billing.portal-session.create",
"initial_data": {
"organization_uuid": "value",
"return_url": "value"
}
}