#whimsy_subscriptions-products
1 messages ยท Page 1 of 1 (latest)
๐ Welcome to your new thread!
โฒ๏ธ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.
โฑ๏ธ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.
๐ This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1290662876809527378
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
and if we already have a subscription system in place, which uses checkout sessions and just provides line_items, how would we migrate that to products system so its least painful for users
What are you trying to do and what is not working like you expect
Subscriptions use Prices which refer to Products
In many (but not all) cases, Prices and Products can be defined ad-hoc using price_data and product_data
The order is generally:
1/ Create Products representing distinct goods or services you sell (Basic and Premium packages would be different products, assuming they have different features/access etc
2/ Create Prices for those products. Prices are, at minimum, a currency+amount+frequency for a given product.
3/ Create Subscriptions using those Prices for the subscription items
so i should just use this? https://docs.stripe.com/api/products/create to create products with prices, and after that, can i then just edit these prices normally? they wont be weirdly binded or something
You'd use that API to create products
yes im talking about api whole time
then you'd use the price create api to create prices, referring to those products
https://docs.stripe.com/api/prices/create#create_price-product
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
There are separate APIs for creating products and creating prices
now it again doesnt make any sense
why do i have to create products, then prices, and then bind them to products
Because that's how the product and price model works
why can't i just use default_price_data on create product and be done with it?
prices refer to products
so i can?
You can if you want. I don't find that intuitive and I have never tried using it to be honest
But looks like you can do that in the same request if you want, this will create a price for you for that product it appears
i mean i have like tier1 - 5$, tier2 - 10$ and if i just directly create them with 2 api calls its no worries
because i dont really want to deal with linking prices and stuff
im just confused why does price have to be made with a product, can't prices just be like for themselves, and then i link price to a product, but api requires product data when creating a price
api requires product data when creating a price
Generally I'd suggest providing a fixedproduct, instead ofproduct_data
well when saying product data i mean both of those fields
What do you mean by tiers here? Based on quantity of seats or what?
tiers would be like different products, nothing more
Ok, sure. Again, because a Price is for some Product you sell, so you need to provide a reference to it (or define it inline to be created)
not sure why does even price have to have product property
Take a look at the diagram here, this will hopefully help illuminate: https://docs.stripe.com/products-prices/pricing-models#flat-rate
its like many-to-many relation
Its not many to many, its 1 to many
a price is for 1 single product. a product can have none, 1 or many prices.
well yes but to create a price you need (product/product_data), and to create a product you need (price/price_default_data) lol
create a product you need (price/price_default_data
No you don't, that an optional convenience to create a price using that product at the same time
you can create a product all by itself with no links to anything else
just like a customer
Where do you see that indicating it's required? If so, that seem to be a mistake I should get fixed.
upon closer look it doesnt, i was probably reading prices page the whole time, oops,
about the other thing, lets say i already have a subscription system right, and the way im making subscriptions is dynamic, so basically i use https://docs.stripe.com/api/checkout/sessions/create#create_checkout_session-line_items (by just prodiving line_items and subscription_data), is there any way to migrate those subscrptions to a product based system?
when saying i use line_items, i mean i literally just specifly all
i would really like to switch that to product system so i just provide price of a product, but not sure how to migrate users who use old one
is there any way to migrate those subscrptions to a product based system?
Can you clarify what you mean here, or share an example? In Stripe lexicon, these items/prices would already have products defined by the product data you provided.
When you use price_data and/or product_data a corresponding price_123 or prod_456 object is create automatically. but it is also archived automatically so that it does not appear in your dashboard.
whimsy_subscriptions-products
hm i noticed they are missing, so how do i transfer subscriptions that use those archived dynamically generated products to my own ones?
and will anything change or
Hi ๐ jumping in as my teammate needs to step away soon. If you want to update the Price that a Subscription is using, you make a request to update the Subscription providing the ID of the Subscription Item you want to update and the ID of the new Price you want to use for that:
https://docs.stripe.com/billing/subscriptions/upgrade-downgrade#changing
what happens on the user side when i do this? if price isnt the same
Depends on how what you set for proration_behavior when making the update, whether you're updating billing_cycle_anchor, and what you're referring to by "the user side".
You can use testmode and Test Clocks to test these updates and see exactly how they'll impact the lifecycle of your Subscriptions:
https://docs.stripe.com/billing/testing/test-clocks
by the user side i mean will it just bill them more on the next month or something else? because when i would do that migration, i mean prices and everything would essentially stay the same just under different price and product objects
so if i set to proration_behavior to create_prorations when i update the price id for a subscription, they will be invoiced? and get a mail to pay or?
Only under certain conditions does create_prorations result in an immediate Invoice:
https://docs.stripe.com/api/subscriptions/update#update_subscription-proration_behavior
Will cause proration invoice items to be created when applicable. These proration items will only be invoiced immediately under certain conditions.
https://docs.stripe.com/billing/subscriptions/upgrade-downgrade#immediate-payment
Whether or not they get an email depends on the email settings for your account:
https://dashboard.stripe.com/settings/billing/automatic
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
hm
if someone buys something, subscription is created for them, and if they want like buy additional "addon" (which is a product) or something, is there a way to send them a link to buy that addon but so that it gets added to their existing subscription, so they dont have like 2 subscriptions
No, you would need to implement your own logic for updating the Subscription and add an additional Subscription Item to it.
hm, you have any idea how would i do that? what i can think of is to just add the product to their subscription via api and make it directly invoice them, but that's a little unintuitive, i'd like something like checkout process
That's exactly how I'd recommend doing it, by making a request to our API to update the Subscription with the changes you wish to make to it. If you set the proration_behavior to always_invoice as part of that update request, the customer is immediately invoiced and charged for the change.
how would they know they're charged exactly, is email notifications on by default?
or can i get that invoice pay link?
Doesn't matter what the default behavior is, what matters is the email settings for your account. The link I provided earlier is to the dashboard settings page where you can view and edit your subscription-related email settings.
Sure, the Invoice will generate a link to the Hosted Invoice Page:
https://docs.stripe.com/api/invoices/object#invoice_object-hosted_invoice_url
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
ah nice