#delgesu1745
1 messages · Page 1 of 1 (latest)
Also, how exactly do you use a lookup id to get a price object?
Hello! I don't believe we support custom IDs on price anymore. Generally, I think lookup keys would have a similar benefit to custom prices (where you could set your own unique ID) but lookup keys will be more useful if you need to migrate/change the price because we allow you to transfer the lookup key from one price to another
I see. I
I'm on a really old version of the api I think lol
Ok, so tell me more about migrating or changing price, becasue it looks to me like if we increase our pricing on a product we have to archive the old one to create a new one if we're using a unqiue id.
Is it not possible just to actually change the price dollar amount on a price if we increase rates, but everything else is staying the same?
Correct - once you've created a price it's not possible to update the amount associated to it.
So yes, you'd either need to archive the old one to create a new one using the same unique ID
or you'd need to switch over to using lookup keys (where your backend is looking up the specific lookup key to know which price to use)
Ok so tell me more about transferring the lookup key.
How does that work. Because I think I have lookups set on the prices I need to archive and create newly for increaseing rates.
https://stripe.com/docs/api/prices/create#create_price-transfer_lookup_key - when you create a new price with the same lookup_key as an existing price you need to set transfer_lookup_key=true , which will remove it from the old price at the same time it's added to the new on
OK great. And does that automatically archive the old price then or do I still need to do that?
And can the transfer just be done from the dashboard or do you have to use the API?
I don't think transferring the lookup key can be done through the dashboard
And you'd still have to archive the price separately
Hey so what would you recommend in terms of if we have a bunch of different price points that are liked discounted prices compared to the standard price, is it better to use coupons to reduce the price or just create a bunch of different prices on the same product for the discounted amount?
Most of the time I'd recommend using coupons for that
And the best (only?) way to get a price using a lookup ID is to use the List all prices function?
yup
Hey for the lookup_keys param, what's the type it should be? It doesn't specify in the API. I assume an array of strings, since it looks like it can be multiple, but I'm not getting any prices back when I do that.
Oh wait, hahaha. I was updating the lookup keys on the live side but running on the test side. Sorry!
If you need it later - https://stripe.com/docs/api/prices/create#create_price-lookup_key
^ The api ref mentions lookup_key expects a string of up to 200 characters
Right that's on the create side. But on the list side, when you specify which lookup keys to use, what should it be there?
Oh wow didn't realize our list API doesn't document that very well - looking internally it seems to accept an array of up to 10 strings
Yeah, that's what I figured.
Alright, thanks so much for your help. Got that all fixed up and working now.
👍 glad I could help!