#mbillah21-products-list
1 messages ยท Page 1 of 1 (latest)
Do you have an example product id that isn't returned?
@granite vortex please reply here in the thread, not in the main channel
oh sorry
prod_LN0CphtkTdmbya this product did not return (test product)
I have created 3 test products (one from dashboard and 2 using api) but when it used above code I got only two products which were created by api
I think it's because you have a really old Stripe account
your account is on a default API version from 2013
and it's causing products to default to the "wrong type" right now
Alternatively it's because your code is using the wrong API version otherwise
so how can I change the default?
"api_key" => "sk_test_123",
"stripe_version" => "2020-08-27"
]);```
basically you need to "force" the API version when you initialize the Stripe instance in PHP, otherwise it uses that 9 years old API version and ignores the past 9 years of API changes
try that and you should get the product from the Dashboard. and you should then make sure to create your product/prices with that API version
yay!
you likely want to change your default API version if you are starting from scratch, but not if you have a real ongoing integration in production since you'd break completely
api integration with api version will work for me ๐
yay!
Need one more help if possible, how can I delete product with price using api?
you mark those as inactive instead
You can't delete a Price. You can delete a Product via https://stripe.com/docs/api/products/delete but we recommend setting active: false instead. Deleting data is always a pain 2 years later when you want to do some kind of analysis
okay, I will set them active: false