Skip to content
Create account
or
Sign in
The Stripe Docs logo
/
Ask AI
Create account
Sign in
Get started
Payments
Finance automation
Platforms and marketplaces
Money management
Developer tools
Get started
Payments
Finance automation
Get started
Payments
Finance automation
Platforms and marketplaces
Money management
OverviewExplore all products
Start building
Start developing
Sample projects
About the APIs
    API tour
    Payment Intents API
    Setup Intents API
    Payment Methods
    Products and prices
      How products and prices work
      Manage products and prices
    Older APIs
    Release phases
Build with LLMs
Use Stripe without code
Set up Stripe
Create an account
Web Dashboard
Mobile Dashboard
Migrate to Stripe
Manage fraud risk
Understand fraud
Radar fraud protection
Manage disputes
Verify identities
HomeGet startedAbout the APIsProducts and prices

Manage products and prices

Learn how to manage products and prices.

Copy page

You can create and update products and prices in the Dashboard or through the API.

Some advanced use cases, like creating variable prices, require you to use the API. If you have a large number of products and prices or if you’re building a custom integration with Elements, you need to use the API.

  • Use the Dashboard to create and manage products and prices if you want to avoid writing code or if you only have a few products and prices. Set up your pricing model in a sandbox and click the Copy to live mode button on the product details page.
  • Use the API or the Stripe CLI to create and manage products and prices. The API is a direct method that you use for production implementations. The Stripe CLI is a developer tool that helps you build, test, and manage your integration with Stripe directly from your terminal.

The following API steps use a fictional SaaS collaboration tool (Togethere) as an example, where the basic product is a project management dashboard.

Create a product

To create a single product and price:

Command Line
cURL
curl https://api.stripe.com/v1/products \ -u "
sk_test_BQokikJOvBiI2HlWgH4olfQ2
:"
\ -d name="Basic Dashboard" \ -d "default_price_data[unit_amount]"=1000 \ -d "default_price_data[currency]"=usd \ -d "default_price_data[recurring][interval]"=month \ -d "expand[]"=default_price

When customers first sign up with Togethere, they’re also charged a setup fee.

To create the fee as a product and price, make the same request using a different product name and price data:

Command Line
cURL
curl https://api.stripe.com/v1/products \ -u "
sk_test_BQokikJOvBiI2HlWgH4olfQ2
:"
\ -d name="Starter Setup" \ -d "default_price_data[unit_amount]"=2000 \ -d "default_price_data[currency]"=usd \ -d "expand[]"=default_price

Edit a product

To modify a product through the API:

Command Line
cURL
curl https://api.stripe.com/v1/products/id \ -u "
sk_test_BQokikJOvBiI2HlWgH4olfQ2
:"
\ -d name="Updated Product"

Archive a product

If you want to disable a product so that it can’t be added to new invoices or subscriptions, you can archive it. If you archive a product, any existing subscriptions that use the product remain active until they’re canceled and any existing payment links that use the product are deactivated. You can’t delete products that have an associated price, but you can archive them.

To archive a product (that is, to indicate that it’s not available for purchase) through the API, change the active parameter to false.

Command Line
cURL
curl https://api.stripe.com/v1/products \ -u "
sk_test_BQokikJOvBiI2HlWgH4olfQ2
:"
\ -d active=false \ -d name="My product"

To unarchive a product (that is, to indicate that it’s available for purchase) through the API, change the active parameter to true.

Command Line
cURL
curl https://api.stripe.com/v1/products/id \ -u "
sk_test_BQokikJOvBiI2HlWgH4olfQ2
:"
\ -d active=true

Delete a product

You can only delete products that have no prices associated with them. Alternatively, you can archive a product.

To permanently delete a product through the API, use delete product.

Command Line
cURL
curl -X DELETE https://api.stripe.com/v1/products/
{{PRODUCT_ID}}
\ -u "
sk_test_BQokikJOvBiI2HlWgH4olfQ2
:"

Create a price

You can create single or multiple prices for a product. For example, Togethere may have a “starter” level offered at 10 USD per month, 100 USD per year, or 9 EUR as a one-time purchase.

Note

After you create a price, you can only update its metadata, nickname, and active fields.

To create prices through the API, use create price.

Togethere wants to charge 10 USD per month for their “starter” service level.

The unit_amount parameter uses the lowest unit of the currency specified for the price. In the case of Togethere, the lowest unit is cents: 10 USD is 1,000 cents, which means their price unit_amount is 1000.

To create the price and assign it to the product, pass the product ID, unit amount, currency, and interval:

Command Line
cURL
curl https://api.stripe.com/v1/prices \ -u "
sk_test_BQokikJOvBiI2HlWgH4olfQ2
:"
\ -d product=
{{PRODUCT_ID}}
\ -d unit_amount=1000 \ -d currency=usd \ -d "recurring[interval]"=month

The setup fee for new customers is 20 USD. Because this charge is separate from the subscription and you only charge it one time, you don’t need to pass the interval:

Command Line
cURL
curl https://api.stripe.com/v1/prices \ -u "
sk_test_BQokikJOvBiI2HlWgH4olfQ2
:"
\ -d product=
{{PRODUCT_ID}}
\ -d unit_amount=2000 \ -d currency=usd

Set a default price

A product’s default price is the most common price you want to present to customers. For example, a product could have multiple prices for seasonal sales, but the default is the regular (non-sale) price. If your product only has one price, that is its default price. The default price must be an active Price.

Command Line
cURL
curl https://api.stripe.com/v1/products/
{{PRODUCT_ID}}
\ -u "
sk_test_BQokikJOvBiI2HlWgH4olfQ2
:"
\ -d default_price=
{{PRICE_ID}}

Lookup keys

Most businesses display pricing information on their website. If these prices are hard-coded and you want to change them, the process is often manual and requires you to deploy new code. To better manage these scenarios, you can use the lookup_key attribute on the Price object. This key allows you to:

  • Render different prices in your frontend.
  • Use the rendered price to bill customers.

You can pass a lookup_key when you create a price:

Command Line
cURL
curl https://api.stripe.com/v1/prices \ -u "
sk_test_BQokikJOvBiI2HlWgH4olfQ2
:"
\ -d product=
{{PRODUCT_ID}}
\ -d unit_amount=1000 \ -d currency=usd \ -d "recurring[interval]"=month \ -d lookup_key=standard_monthly

Instead of hard-coding text like 10 USD per month on your pricing page and using a price ID on your backend, you can query for the price using the standard_monthly key and then render that in your frontend:

Command Line
cURL
curl -G https://api.stripe.com/v1/prices \ -u "
sk_test_BQokikJOvBiI2HlWgH4olfQ2
:"
\ -d "lookup_keys[]"=standard_monthly

Note

To improve performance, you might want to add a caching layer to only reload the price occasionally.

When a customer clicks your subscribe or pay button, you pass the price from the GET request above into the Subscriptions API.

Now that you can render different prices, if you decide that you want to start charging new users 20 USD per month rather than 10 USD per month, you only need to create a new price and transfer the lookup key to that new price using transfer_lookup_key=true:

Rounding

Rounding occurs on the line item level of your invoices. For example, if you create a price with unit_amount_decimal = 0.05 and a monthly subscription for that [price] with quantity = 30, rounding occurs after multiplying the quantity by the decimal amount. In this case, the calculated amount for the line item would be 0.05 * 30 = 1.5, which rounds up to 2 cents. If you have multiple line items, each is rounded up before summing up the total amount for the invoice. This ensures that customers are still charged an integer minor unit amount, as decimal amounts only apply for pricing.

Exclusive taxes are added to each line item amount, depending on the tax rate. If you enable automatic taxes, exclusive taxes are applied and rounded on the total of the invoice, including invoice level discounts. If you use manual taxes on either the line item level or the invoice level, you can choose how to apply rounding. Use the invoice settings page in the Dashboard to apply and round taxes for each line item, or apply and round taxes on the invoice subtotal.

Command Line
cURL
curl https://api.stripe.com/v1/prices \ -u "
sk_test_BQokikJOvBiI2HlWgH4olfQ2
:"
\ -d product=
{{PRODUCT_ID}}
\ -d unit_amount=2000 \ -d currency=usd \ -d "recurring[interval]"=month \ -d lookup_key=standard_monthly \ -d transfer_lookup_key=true

Edit a price

Multiple properties can be updated on a price, either in the Dashboard or the API. For example, you can change whether the price is active, or modify its metadata.

Note that you can not change a price’s amount in the API. Instead, we recommend creating a new price for the new amount, switch to the new price’s ID, then update the old price to be inactive.

To edit a price through the API, use update price and specify the parameter you want to change. If you don’t specify a parameter, it remains unchanged.

Command Line
cURL
curl https://api.stripe.com/v1/prices/id \ -u "
sk_test_BQokikJOvBiI2HlWgH4olfQ2
:"
\ -d lookup_key=MY_LOOKUP_KEY

Archive a price

If you want to disable a price so that it can’t be added to new invoices or subscriptions, you can archive it. If you archive a price, any existing subscriptions that use the price remain active until they’re canceled and any existing payment links that use the product are deactivated.

To use the API to archive a price (that is, to indicate that it can’t be used for new purchases), change the active parameter to false.

Command Line
cURL
curl https://api.stripe.com/v1/prices/id \ -u "
sk_test_BQokikJOvBiI2HlWgH4olfQ2
:"
\ -d lookup_key=MY_LOOKUP_KEY \ -d active=false

To use the API to unarchive a price (that is, to indicate that it can be used for new purchases), change the active parameter to true.

Command Line
cURL
curl https://api.stripe.com/v1/prices/id \ -u "
sk_test_BQokikJOvBiI2HlWgH4olfQ2
:"
\ -d lookup_key=MY_LOOKUP_KEY \ -d active=true

Delete a price

You can only delete prices that you’ve never used. Otherwise, you can archive them.

You can’t delete a price through the API. You can archive a price to mark it as active=false, which indicates that it’s not available for purchase.

Display pricing information

After creating products and prices, you can embed a pricing table on your website to display pricing information to your customers. When customers choose a subscription option, they’re taken directly to checkout. Configure, customize, and update directly in the Dashboard without writing any code.

Import products and prices

If you have a very large product catalog, use the Products API to import your catalog programmatically. If you’re importing your product catalog to Stripe, you can use anything as your starting data source, like a product management system or CSV file.

Use the Products API to create a product in Stripe for each product in your system. To map products in your system to products in Stripe, assign each product that you import a unique id. For each product, use the Prices API to make a corresponding price. Make sure to store the id of the newly created price. You need to pass this id when you use the products and prices in your integration.

Confirm the import by checking the Dashboard or using the API to list all products.

Delete imported prices

During development, you might need to run this script multiple times for testing. If you use the same Product ID, you’ll see an error stating that a Product with that ID already exists. If you haven’t used the Product yet, you can delete it using the Stripe Dashboard:

  1. Go to the Products Dashboard and find your Product.

  2. In the Pricing section, click the overflow menu () next to the Price and select Delete Price.

  3. Click the overflow menu () at the top of the page, and select Delete Product.

Synchronize products and prices

You might need to run through an import multiple times. You can create a script to test the import and, if you want to, synch your original data source with Stripe. To make your script idempotent and resilient to errors, you can safely try to create the product first, then update it if the product already exists.

To keep your product catalog synchronized with Stripe, use webhooks or other mechanisms to trigger product updates in Stripe. To update a product programmatically, use the following pattern.

First, find the existing price associated with the product with list all prices API to make sure the price still matches your data source. Each product should have exactly one active price.

Command Line
cURL
curl -G https://api.stripe.com/v1/prices \ -u "
sk_test_BQokikJOvBiI2HlWgH4olfQ2
:"
\ -d product=
{{PRODUCT_ID}}
\ -d active=true

Next, check whether the decimal amount of the price has changed. The unit_amount_decimal field displays the unit amount in cents.

If the amount doesn’t match, you have to create a new price. When you create a new price, specify the product ID of the original product, the currency, and the updated unit_amount price.

Command Line
cURL
curl https://api.stripe.com/v1/prices \ -u "
sk_test_BQokikJOvBiI2HlWgH4olfQ2
:"
\ -d product=
{{PRODUCT_ID}}
\ -d unit_amount=2000 \ -d currency=usd

Update the old price to mark it as active=false.

Command Line
cURL
curl https://api.stripe.com/v1/prices/
{{PRICE_ID}}
\ -u "
sk_test_BQokikJOvBiI2HlWgH4olfQ2
:"
\ -d active=false

Use products and prices in your integration

You can use products and prices across several different Stripe integration paths.

Specify the Price ID when you create a Checkout Session.

  • If you’re using one-time prices, see how to create a Checkout Session when accepting a payment.

  • If you’re creating Subscriptions, see how to create a Checkout Session when building a subscription integration.

Testing

You can copy products from a testing environment to live mode so that you don’t need to recreate them. Prices associated with the product are also copied over. In the product details page in the Dashboard, click Copy to live mode in the upper right corner.

You can only copy test products to live mode once. If you make updates to the test product after the copy, the live product won’t reflect the changes.

Was this page helpful?
YesNo
Need help? Contact Support.
Join our early access program.
Check out our changelog.
Questions? Contact Sales.
LLM? Read llms.txt.
Powered by Markdoc