#FacuTerrens
1 messages ยท Page 1 of 1 (latest)
Hello ๐
Copying this here for full context
I want to know if there is a way to recover the id of this recently created product
Hi!
You can use the API to list all products as well as prices
https://stripe.com/docs/api/products/list
https://stripe.com/docs/api/prices/list
NP! ๐ Good Luck
$stripe = new \Stripe\StripeClient(
'sk_test_4eC39HqLyjWDarjtT1zdp7dc'
);
$stripe->products->all(['limit' => 3]);
I run this, but how do I see the ids?
echo $stripe->products->all(['limit' => 3]);
Products describe the specific goods or services you offer to your customers.
Prices define the unit cost, currency, and (optional) billing cycle for both recurring and one-time purchases of products. Products help you track inventory or provisioning, and prices help you track payment terms.
oh okey!
and if, for example, I want to save the value that $stripe->products->all(['limit' => 1]);
in an array, or a variable, to later put it in a DB using MySQL, what should I do?
If you increase the limit to be higher than 1, the call itself will return a list of products
Well, technically that call would already return a list, it would just be a list of 1
Are you having issues accessing that list that is returned?
What I can't do is grab the value of the id, since it shows me many values, and I just want to grab the id