Update Subscription

stripe.update_subscription
ActionBusiness appsconnection required

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

Change the billing settings or items of an existing subscription.

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

9 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
cancel_at_period_end
True stops the subscription when the paid period ends; false reverses a pending cancellation.
booleanNo———
items
The subscribed items, as a JSON array of objects such as [{"price": "price_123", "quantity": 1}]. Use this instead of price_id for more than one line.
arrayNo—array of object—
proration_behavior
How to treat the unused time when items change mid-period.
stringNo—one of "create_prorations", "none", "always_invoice"—
collection_method
charge_automatically bills the customer's saved payment method; send_invoice emails an invoice with payment instructions.
stringNo—one of "charge_automatically", "send_invoice"—
days_until_due
Days a sent invoice has to be paid. Only used with send_invoice.
numberConditional—≥ 0; only with collection_method—
default_payment_method
The payment method this subscription charges (pm_...). It must belong to the same customer.
stringNo———
metadata
Key/value pairs stored on the subscription and returned on every read.
objectNo———
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

  • Replacing 'items' removes any item you leave out; include the item id of every line you want to keep.

See Update 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.