#shaun-checkout-subscription-addon
1 messages ยท Page 1 of 1 (latest)
Brilliant ๐
They are really two different prices
one is the recurring amount, the other one is an upfront cost
How would you model this if not as 2 separate Prices?
Ah so they're kinda represented as:
Product
Price
or
Price
As opposed to both prices at once
Makes sense
usually they are also 2 separate products
at least in the way we recommend building this, otherwise you have 2 line items with the same product name which will confuse people
So
My Product (upfront)
Price $20.00
My Product (monthly)
Price $2.99/m
yep exactly
Is there no way to group them, in the checkout page
Like a smaller version of this, per "line item"
no, and honestly I think you don't really want that since people want to understand why they pay so much upfront and you'll want to track this in the future as your business grows and you start looking at analytics
Okay! thanks for the helpful info.
While I have your attention I have one more small question
Let's say I want to create my products/prices programatically, how would you approach that?
I'd start by asking why? :p
is this to do custom pricing? Is this to import your entire catalog?
Well I have my products in config, and the prices are loaded and handled by my backend. I'd like to just loop through my products/prices and just create them on your api at start.
Your response suggests you want me to use stripe as the master of records
well what you described is a one-off import right?
you don't do this every time you start your app
I'll tell you what, let me give you something more concrete
So I have a list of domains I want to sell
Each has an upfront and a monthly cost.
I can add and remove domains from my config, as well as modify their prices.
I need:
- My backend to have the up to date prices
- My stripe to have the up to date prices
If Stripe is the main source of truth, I need to store that the price is for a domain, on stripe
If my app is the main source of truth, then I need to make sure I'm not creating duplicate stuff on stripe
Maybe something like this, then when my app starts, I retrieve all products and check the metadata?
(I'm just brainstorming)
yeah don't do anything that requires "syncing when starting the app"
that's fine today, when you have 5000 products though that's 30s of start time you can't take back
My take is that Stripe should be the source of truth and a record of your internal prices. And whenever you add/remove product/prices you sync those changes to Stripe (Product inactive, old Price replaced by a separate Price with a new amount, etc.) and you map those in your database
Stripe source of truth -> Application (caching in database) -> Front end?
something like that?
I think so. You threw the front end in now and that's a bit different but I assume it's because you display all your prices client-side and let someone choose what they want right?
Exactly
then yeah I'd basically have 2 things. One is my own database of all my "prices" and the corresponding Price id (and Product id) in Stripe. That's what I use to render this client-side with all the info and choose the right Price id price_123 based on the user's choice
Separately I'd have a script/logic that can handle "price changes" on my business to update records in Stripe and my database if that makes sense