Cancel Subscription

stripe.cancel_subscription
ActionBusiness appsconnection required

Calls the Stripe API with the connection's secret key.

Cancel a Stripe subscription immediately.

Connection

Required
Yes — the node will not save without one
Auth type
API key
Providers
Stripe
Secret shape
the Stripe secret key (sk_...)
Resolved by
config.connection_id, else node.connection_id

Configuration

4 fields, 1 required. A dotted path is a nested object and name[] an array of objects — the editor renders the same tree.

FieldTypeRequiredDefaultConstraintsExample
subscription_id
The subscription to act on (sub_...). Supports {{ }} expressions.
stringYes——sub_1MowQVLkdIwHu7ixeRlqHVzs
invoice_now
Invoice the customer now for any usage that has not been billed.
booleanNo———
prorate
Credit the unused part of the period back to the customer.
booleanNo———
idempotency_key
Overrides the key this node derives from the step. Set it to a business identifier (an order id, say) when the same write must not repeat across runs; leave it blank and a retry of this step reuses the step's own key.
stringNo—≤ 255 characters—

Example configuration

Every value below is the contract’s own example or default — nothing invented.

{
  "subscription_id": "sub_1MowQVLkdIwHu7ixeRlqHVzs"
}

Output

One shape.

result

FieldTypeExample
id
The subscription id (sub_...).
string—
status
One of incomplete, incomplete_expired, trialing, active, past_due, canceled, unpaid or paused.
string—
customer
The customer this subscription bills.
string—
currency
Three-letter lowercase ISO currency code.
string—
collection_method
charge_automatically or send_invoice.
string—
cancel_at_period_end
True when it stops at the end of the period.
boolean—
canceled_at
When it was cancelled, Unix seconds, or null.
number—
start_date
When the subscription started, Unix seconds.
number—
trial_end
When the trial ends, Unix seconds, or null.
number—
latest_invoice
The most recent invoice id, or null.
string—
default_payment_method
The payment method it charges, or null.
string—
created
Creation time, as a Unix timestamp in seconds.
number—
metadata
The key/value pairs stored on the subscription.
object—
{
  "cancel_at_period_end": false,
  "canceled_at": 0,
  "collection_method": "",
  "created": 0,
  "currency": "",
  "customer": "",
  "default_payment_method": "",
  "id": "",
  "latest_invoice": "",
  "metadata": {},
  "start_date": 0,
  "status": "",
  "trial_end": 0
}

Notes

  • This ends the subscription at once. To stop it at the end of the paid period, use Stripe: Update Subscription with cancel_at_period_end.

See Cancel Subscription run in a workflow.

In a technical demo we add the Stripe connection, drop the node on the canvas and let Workflow Health pre-flight it before the first real run.