#CameronBryce
1 messages ยท Page 1 of 1 (latest)
The steps will be:
- Create the product first: https://stripe.com/docs/products-prices/manage-prices?dashboard-or-api=api#create-product
- Create price on the product: https://stripe.com/docs/products-prices/manage-prices?dashboard-or-api=api#create-price
To set the Customer chooses price in Step 2, custom_unit_amount.enabled parameter should be set to true: https://stripe.com/docs/api/prices/create#create_price-custom_unit_amount
Alternatively, you may create Products and Prices in the Dashboard: https://stripe.com/docs/products-prices/getting-started#create-products-prices
Perfect, let me do this. Thank you ๐
No problem! Happy to help ๐
// Set your secret key. Remember to switch to your live secret key in production.
// See your keys here: https://dashboard.stripe.com/apikeys
const stripe = require('stripe')('sk_test_51LU0xrA2CaLsHzBan4SLF8Iju0dUdcw1xTEO29yGKFNyfUDzlDe8WYZXHpUQrCObtpBILigJgKRqxPqkT2IzygIo00PO7AK8ID');
const product = await stripe.products.create({
name: 'Basic Dashboard',
default_price_data: {
unit_amount: 1000,
currency: 'usd',
recurring: {interval: 'month'},
},
expand: ['default_price'],
});
So, would it be possible to do all of this inside the products.create() by chance? Was curious if the custom_unit_amount.enabled would work with it
default_price_data hash doesn't support custom_unit_amount.enabled, so you'd need to create custom_unit_amount.enabled on the Prices Creation API instead