#Goltan-Product
1 messages · Page 1 of 1 (latest)
You can use List Product API and filter (yourself) by name: https://stripe.com/docs/api/products/list
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
metadata is also a good use, tho
I was trying to reduce traffic and perform the filtering server side; not having a name filter seemed an obvious omission
also... every single Inventory platform that I have worked on has a Product Code column
//Does Product already exist?
var stripeProductId = new ProductService().List(new ProductListOptions { }).FirstOrDefault(p => p.Name == product.Name)?.Id;
//Find the Price
if (!string.IsNullOrEmpty(stripeProductId)) {
product.AlternateProductId = new PriceService().List(new PriceListOptions { Limit = 3, Product = stripeProductId }).FirstOrDefault()?.Id;
}
works but could be faster...
Yeah, unfortunately we don't have the filter parameter today, sorry :/
suggestion: add Meta to all list methods - wouldn't that be cool!