#itemas-Subscription

1 messages · Page 1 of 1 (latest)

young mirage
#

Hi there, can you copy and past the subscription ID here?

old reef
#

or do you mean whats inside that array

young mirage
#

Ok, I can see there is one item in the items array. the object type is price, not subscription.

young mirage
#

Hmm, how did you do that?

old reef
#

from stripe dashboard

#

I just want to know, how can I retrieve the actual product that user has subscribed to from the front end

young mirage
#

And what's front-end in this context?

old reef
# young mirage 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?

young mirage
#

Got it, yes you can have multiple product in one subscription, let me send you a doc, one sec

old reef
young mirage
#

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

old reef
#

appreciate thanks\