#itemas-Subscription
1 messages · Page 1 of 1 (latest)
sub_1Kd06bIL0HJB3ySiZVpS33vl
or do you mean whats inside that array
Ok, I can see there is one item in the items array. the object type is price, not subscription.
I set it as a subscription
Hmm, how did you do that?
from stripe dashboard
I just want to know, how can I retrieve the actual product that user has subscribed to from the front end
And what's front-end in this context?
I am requesting current users data in the path of users/{userId}/subscriptions
then I store all subscription documents in randomData variable and this is how I retrieve products that user has subscribed to:
{randomData &&
randomData.map((subscription) => {
return (
<>
<div>
{subscription.items[0].price.product.id}
</div>
</>
);
})}
Everything works so far, but I just want to know why is the items field array if it always have a single product inside, or are there cases where there are multiple products?
Got it, yes you can have multiple product in one subscription, let me send you a doc, one sec
right, I get it now, so to get all the products, I simply have to map that items array?
Yes you are right 🙂
@old reef my shift is over, my colleague has joined this thread to continue helping you. If your problem can't be resolved in Discord, please reach out to Stripe Support and they'll escalate the issue to us https://support.stripe.com/contact
Find help and support for Stripe. Our support center provides answers on all types of situations, including account information, charges and refunds, and subscriptions information. Get your questions answered and find international support for Stripe.
appreciate thanks\