#mbillah21-products-list

1 messages ยท Page 1 of 1 (latest)

cinder sluice
#

Do you have an example product id that isn't returned?

#

@granite vortex please reply here in the thread, not in the main channel

granite vortex
#

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

cinder sluice
#

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

granite vortex
#

so how can I change the default?

cinder sluice
#
  "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

granite vortex
#

okay

#

let me try

#

Thank you very much. it worked ๐Ÿ™‚

cinder sluice
#

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

granite vortex
#

api integration with api version will work for me ๐Ÿ™‚

cinder sluice
#

yay!

granite vortex
#

Need one more help if possible, how can I delete product with price using api?

cinder sluice
#

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

granite vortex
#

okay, I will set them active: false