Stripe Create Plan
Audience:
Low-code EngineersSkill Prerequisites:
Actions,Tokens,Connectors,Stripe
Creates a subscription plan in Stripe. A plan sets the price and the billing schedule, for example 9.99 USD every month. You then subscribe customers to it with Stripe Create Subscription.
Every plan belongs to a Stripe product. The action can create a new product for the plan, or add the plan to a product you already have. It returns the IDs of the new plan and its product.
The plan uses the per_unit billing scheme, so the amount is charged once per unit at the start of each billing period.
This action requires the Stripe feature (STRIPE) to be licensed. Stripe support is a separate add-on package (DnnSharp.Stripe). If you don't see the Stripe actions, the add-on isn't installed.
Typical Use Cases
- Create the plans for your membership levels from a setup form or workflow, instead of in the Stripe Dashboard
- Let an administrator or a seller set their own price and billing schedule
- Add a new price, for example a yearly option, to an existing product
- Save the plan ID in your database, so later subscriptions can use it
Don't use it to
- Subscribe a customer. Use Stripe Create Subscription with the plan ID.
- Take a one-time payment. Use Stripe Checkout.
- Change or delete a plan. There's no action for this. Use the Stripe Dashboard.
- Create a plan with tiers or metered usage. The action only creates fixed-price, per-unit plans.
Related Actions
| Action Name | Description |
|---|---|
| Stripe Create Subscription | Subscribes a Stripe customer to a plan. |
| Stripe Create Customer | Creates the Stripe customer to subscribe. |
| Stripe Checkout | Takes a one-time payment through Stripe Checkout. |
| Add Stripe Connector | Creates the Stripe connector this action uses. |
| Update Stripe Connector | Changes the secret key of a Stripe connector. |
| Run SQL Query | Saves the plan ID in your database. |
Input Parameter Reference
| Parameter | Description | Supports Tokens | Default | Required |
|---|---|---|---|---|
| API Connector | The Stripe connector with the secret key to use. See Add Stripe Connector. When using an expression, the value must be the connector ID. | Yes | none | Yes |
| Amount | The price for each billing period, as a whole number in the currency's smallest unit, for example 999 for 9.99 USD. Use 0 for a free plan. | Yes | empty string | Yes |
| Currency | The three-letter ISO currency code, for example usd or eur. It must be a currency Stripe supports. | Yes | empty string | Yes |
| Interval | How often the customer is billed: Day, Week, Month or Year. Can be set with an expression that returns day, week, month or year, in lowercase. | Yes | empty string | Yes |
| Nickname | A short description of the plan, for example Gold - Monthly. It's shown in the Stripe Dashboard, not to customers. | Yes | empty string | No |
| Interval Count | The number of intervals between payments. For example, Interval = Month and Interval Count = 3 bills every 3 months. The longest allowed is one year (1 year, 12 months or 52 weeks). | Yes | 1 | No |
| Use Existing Product | When checked, the plan is added to the product in Product ID. When unchecked, a new product is created for the plan. | No | false | No |
| Product ID | The ID of an existing Stripe product, for example prod_.... The product must be of type service. Only shown when Use Existing Product is checked. | Yes | empty string | Yes, with Use Existing Product |
| Product Name | The name of the new product. Customers can see it, for example on invoices. Only shown when Use Existing Product is unchecked. | Yes | empty string | Yes, without Use Existing Product |
| Statement Descriptor | The text on the customer's card statement for the new product, up to 22 characters. It must contain at least one letter. Stripe shows it in capitals and removes non-ASCII characters. Only shown when Use Existing Product is unchecked. | Yes | empty string | No |
| Product Metadata | Key-value pairs to save with the new product, for example Level = Gold. A single key named DeleteMetadata saves no metadata. Only shown when Use Existing Product is unchecked. | Yes | empty list | No |
| Default Trial Period Days | The number of free trial days saved on the plan. See Trials. | Yes | empty string | No |
| On Success | Actions that run after Stripe creates the plan. | No | empty list | No |
| On Error | Actions that run when Stripe rejects the request. The reason is in [Stripe:ErrorMessage]. | No | empty list | No |
Output Parameters Reference
The tokens are set before On Success or On Error runs.
| Parameter | Description |
|---|---|
[Stripe:PlanId] | The ID of the new plan, created by Stripe, for example plan_.... Pass it to Stripe Create Subscription. |
[Stripe:ProductId] | The ID of the plan's product, for example prod_.... It's the new product's ID, or your Product ID if you used an existing product. |
[Stripe:ErrorMessage] | The error message from Stripe, when the request fails. |
What happens when it runs
- The action checks
Interval, and checks thatProduct IDorProduct Namehas a value. IfStatement Descriptoris longer than 22 characters, it fails too. These checks raise an error right away.On Errordoesn't run for them. - It sends the plan to Stripe with the connector's secret key. If
Use Existing Productis unchecked, Stripe creates the product in the same request. - On success, it sets
[Stripe:PlanId]and[Stripe:ProductId]and runsOn Success. - If Stripe rejects the request, for example because of an unsupported currency or a wrong product ID, it sets
[Stripe:ErrorMessage]and runsOn Error. IfOn Erroris empty, the action raises the error instead.
Trials
Default Trial Period Days is saved on the plan in Stripe. Stripe only uses a plan's trial when the subscription request asks for it, and Stripe Create Subscription doesn't. So subscriptions created by that action start without the trial. Test this in test mode before you rely on it.
Considerations
- Amounts are in the smallest unit.
999is 9.99 USD, not 999 USD. For zero-decimal currencies, such asjpy, the amount is the whole amount. Decimals, such as9.99, aren't accepted. - Use lowercase for the interval. When you set
Intervalwith an expression, it must be exactlyday,week,monthoryear.Monthfails. - Stripe creates the IDs. You can't choose the plan ID. Save
[Stripe:PlanId], because you need it to subscribe customers. - Every run creates a new plan. Running the action twice creates two plans, and two products when
Use Existing Productis unchecked. To reuse a product, checkUse Existing Productand pass[Stripe:ProductId]from the first run. - Plans are Stripe's older model. Stripe now uses prices for this, but plans still work. The action uses the Plans API, through the Stripe.net library version 29.2.0 (Stripe API version
2019-09-09). - Test and live keys. A connector with a test key (
sk_test_...) creates the plan in test mode. A plan created in test mode doesn't exist in live mode, so create your plans again with the live key before going live. - Plans can't be changed here. Stripe doesn't let you change a plan's amount or interval. To change a price, create a new plan and move customers to it in Stripe.
Examples
To understand how to use the below examples, please see Running Examples.
1. Monthly plan with a new product
This action creates a Gold Membership product and a plan that bills 19.99 USD every month. On success, it saves the plan and product IDs in a table. Replace the connector ID with your Stripe connector.
{
"Title": "Stripe Create Plan",
"ActionType": "StripeCreatePlan",
"Description": "Create the Gold monthly plan",
"Parameters": {
"Credentials": {
"Entry": "00000000-0000-0000-0000-000000000000"
},
"Amount": "1999",
"Currency": "usd",
"Interval": "month",
"Nickname": "Gold - Monthly",
"IntervalCount": "1",
"ExistingProduct": false,
"ProductName": "Gold Membership",
"StatementDescriptor": "GOLD MEMBERSHIP",
"ProductMetadata": {
"Level": "Gold"
},
"OnSuccess": [
{
"Title": "Run SQL Query",
"ActionType": "RunSql",
"Parameters": {
"ConnectionString": "",
"QueryTimeout": "",
"SqlQuery": "INSERT INTO dbo.MembershipPlans (Name, StripePlanId, StripeProductId) VALUES ('Gold - Monthly', '[Stripe:PlanId]', '[Stripe:ProductId]')",
"BindTokens": "",
"OutputTokenName": "",
"ExtractColumns": "",
"OnError": [],
"ShowErrors": false
}
}
],
"OnError": [
{
"Title": "Display Error Message",
"ActionType": "ShowError",
"Parameters": {
"Message": "<p>Stripe couldn't create the plan: [Stripe:ErrorMessage]</p>"
}
}
]
}
}
2. Yearly plan for an existing product
This action adds a yearly plan of 199.00 USD to the product in the [ProductId] token, for example saved by the first example. The connector ID comes from the [StripeConnectorId] token.
{
"Title": "Stripe Create Plan",
"ActionType": "StripeCreatePlan",
"Description": "Add a yearly plan to the Gold product",
"Parameters": {
"Credentials": {
"IsExpression": true,
"Entry": "[StripeConnectorId]"
},
"Amount": "19900",
"Currency": "usd",
"Interval": "year",
"Nickname": "Gold - Yearly",
"ExistingProduct": true,
"ProductId": "[ProductId]",
"OnError": [
{
"Title": "Log Error",
"ActionType": "LogError",
"Parameters": {
"Message": "Stripe Create Plan failed for product [ProductId]: [Stripe:ErrorMessage]"
}
}
]
}
}
Revised 09/27/2026