#obo - prices
1 messages · Page 1 of 1 (latest)
Yep! you can List prices for only a specified product and see if there are any results:
https://stripe.com/docs/api/prices/list#list_prices-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.
@dapper orbit I was looking at this, but we could potentially have hundreds of prices for a singular product
OK
Does that cause a problem for you?
You can also use limit=1 if you only want to check for existence
ahh sorry
I think I confused you
when I say price I mean like the actual price in cents
not the "price_id"
so like, "hey stripe is there a price with the cost of $0.05 per unit for this product"
You mean, you want to search to see if there exists a Price object which has a specific recurring amount associated with it?
correct
Are you doing something like "custom" pricing and trying to re-use prices?
yes that's exactly correct
we'll have our enterprise team making custom deals
and the engineering team wants to build them a tool to easily create new subscriptions with those item costs
Gotcha, so, not directly, no
Two options for you:
1/ Cache prices keyed by price in your system, so you can pull it up when it already exists
2/ Consider the Search API (currently in Beta). It does not support searching by unit_amount on Prices currently, but you can set metadata to reflect the amount and search on that:
https://stripe.com/docs/search-api#charges-metadata-search
3/ Bonus option: don't worry about it and just create the custom price each time. It's fine to have many prices.
got it. Thanks for the info
NP!