stripe.subscriptions.cancel_subscription ​
Cancel a Stripe subscription immediately or at period end
Cancel a Stripe subscription immediately or at period end.
Acts on the CUSTOMER'S OWN Stripe account, authenticated via the org-scoped Stripe connection selected by cloud_connection_uuid.
When cancel_at_period_end is true (default) the subscription stays active until the billing period ends, then auto-cancels. When false, it cancels immediately and a pro-rated refund may be issued.
Inputs:
- cloud_connection_uuid: Org-scoped Stripe connection UUID (required).
- subscription_id: Stripe subscription ID, e.g. sub_ABC123 (required).
- cancel_at_period_end: Cancel at the end of the billing period (optional, default: true).
Outputs (terminal state_data):
- subscription_id: str
- status: str — subscription status after cancellation
- cancel_at_period_end: bool
- cancel_at: int | None — Unix timestamp when cancellation takes effect
Connection required: cloud_connection_uuid — the organization's own Stripe account credentials; there is no platform-key fallback.
Overview ​
| Property | Value |
|---|---|
| Workflow type | Atomic |
| Library | App-stripe |
| Version | 1.0 |
Input Schema ​
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
cloud_connection_uuid | uuid | Yes | — | Org-scoped Stripe connection (customer's own account) |
subscription_id | string | Yes | — | Stripe subscription ID, e.g. sub_ABC123 |
cancel_at_period_end | boolean | No | — | Cancel at period end vs immediately (default: true) |
Output Schema ​
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
cancel_at | string | No | — | — |
cancel_at_period_end | boolean | No | — | — |
status | string | No | — | — |
subscription_id | string | No | — | — |
cloud_connection_uuid | uuid | 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 | — | execute | — |
completed | No | Yes | Yes | — | — |
failed | No | Yes | No | — | — |
State Diagram ​
Transitions ​
| From | Action | To | Description |
|---|---|---|---|
pending | execute | completed | — |
* (any state) | fail | failed | — |
API Usage ​
bash
POST /api/workflows/start
Content-Type: application/json
{
"workflow_type": "stripe.subscriptions.cancel_subscription",
"initial_data": {
"cloud_connection_uuid": "value",
"subscription_id": "value"
}
}