Stripe Sandbox - Product ID
I understand that the enviroment variable for Stripe payments should be the price id - however, I'm having issues finding the price ID in the Stripe UI - all I get is the product ID - I'm running my instance of Stripe in SandBox mode.
How do I get my product ID?
@kapa.ai
3 Replies
Hi @Gareth_Simpson. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
----------------------
To use Stripe payments with Wasp (or Open SaaS), you need to use the Price ID, not the Product ID, in your environment variables (e.g.,
SUBSCRIPTION_PRICE_ID
or CREDITS_PRICE_ID
). The Price ID is required because Stripe allows a single product to have multiple prices (for example, different billing intervals or amounts), and the payment logic references the specific price, not just the product.
How to find the Price ID in Stripe (Sandbox or Live):
1. Go to your Stripe Dashboard.
2. Navigate to "Products" in the left sidebar.
3. Click on the product you want to use.
4. Scroll down to the "Pricing" section.
5. You will see one or more prices listed. Click on the price you want to use.
6. The Price ID will be shown (it usually starts with price_...
). You can copy it from there.
You should use this Price ID in your .env
file, for example:
If you only see the Product ID (which starts with prod_...
), make sure you have created at least one price for that product. If not, add a price to the product in the Stripe UI.
This approach is confirmed in the community discussions, where users set the CREDITS_PRICE_ID
or SUBSCRIPTION_PRICE_ID
in their .env
file and reference it in their code for payments and subscriptions. The code examples and troubleshooting steps all use the Price ID, not the Product ID, for Stripe integration in Wasp/Open SaaS projects Payment for Credits / Credit Balance System.
If you need more details on how to set up your environment variables in Wasp, you can refer to the Wasp documentation on environment variables.
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------
Sorry @Gareth_Simpson, I seem to be having a bit of trouble. Don't worry though, I've pinged my support and they will try to fix me up! :technologist:
Perhaps try again in 15mins?Thank you ! THis is the correct answer.
How do I flag this as solved?
