Stripe Subscription
Stripe Subscription manages the subscriptions in your Stripe account. A subscription charges a customer periodically according to a price, for example a monthly fee. From a flow you can subscribe a customer, look up their subscriptions, schedule a subscription to end at the end of the period or cancel it right away.
When to use it
- A customer picks a plan on your website and you want to create the subscription in Stripe.
- You want to offer a few days of free trial when the subscription starts.
- A customer asks to leave and you want their subscription to end when the period they already paid for is over.
- Every week you want to review subscriptions with late payments to remind the customer.
Configuration
You need a Stripe API credential with the secret key of your Stripe account. See Credentials.
| Field | What it does |
|---|---|
| Credential (required) | The Stripe API credential of your account. |
| Operation (required) | The action the component performs. Defaults to Create. See Operations. |
| Mode | Only in Get. By ID looks up one subscription; All returns the list of subscriptions. Defaults to By ID. |
| Subscription ID | The subscription’s identifier in Stripe (starts with sub_). Required in Cancel, Update and Get with By ID. |
| Customer ID | The customer’s identifier in Stripe (starts with cus_). Required in Create. In Get with All, shows only that customer’s subscriptions. |
| Price ID | Only in Create, and required there. The price the customer subscribes to (starts with price_). It must be a recurring price; create it with Stripe Price and Type set to recurring. |
| Payment Method ID | Only in Create. The payment method the subscription will be charged to (starts with pm_). It is saved on the customer as their default payment method. It comes filled in with pm_card_visa, a Stripe test card: replace it with the customer’s real payment method when you use the live key, or clear it to use the one the customer already has. |
| Trial Period Days | Only in Create. Days of free trial before the first charge. |
| Cancel at Period End | Only in Update. true makes the subscription end when the current period is over; false undoes that scheduled cancellation. |
| Status Filter | Only in Get with All. Returns only subscriptions in that status, for example active, trialing, past_due, unpaid or canceled. |
| Limit | Only in Get with All. Maximum number of subscriptions returned, between 1 and 100. Defaults to 100. |
Operations
- Cancel: cancels the subscription right away. To make it end at the end of the period, use Update with Cancel at Period End set to
true. - Create: subscribes a customer to a recurring price. If the price is not recurring, the component stops and explains why.
- Get: with
By IDreturns one subscription; withAllreturns the list, filtered by customer or status if you give them. - Update: schedules or undoes the cancellation at the end of the period.
Output
The Data output returns the subscription you worked with. With Get and All, it returns one item per subscription. Each item includes, among other Stripe details, the subscription’s identifier, the customer, its status and the dates of the current period.
You can connect it to a welcome or goodbye email, to your CRM or to a condition that checks the status. The component can also be connected to an Agent as a tool, so the agent decides when to use it. See Tool Mode.
Example
A wine club creates the monthly subscription of every new member with a one-month trial.
- Create the customer with Stripe Customer and pass their identifier to Customer ID.
- Add Stripe Subscription with Operation set to
Create. - In Price ID, put the club’s monthly price and, in Payment Method ID, the member’s payment method.
- Set Trial Period Days to
30. - Connect the Data output to a welcome email that says when the first charge will be.
Good practices
- When a customer asks to leave, use Update with Cancel at Period End set to
trueinstead of Cancel, so they keep the period they already paid for. - Test your flows with Stripe’s test key before you use the live key.
Related components
- Stripe Customer: create and manage customers.
- Stripe Price: recurring prices for subscriptions.
- Stripe Invoice: the invoices subscriptions generate.