# Can't list stripe subscriptions data

**URL:** <https://community.auth0.com/t/cant-list-stripe-subscriptions-data/18872>\
**Category:** Get Help\
**Tags:** app\_metadata, stripe, rules\
**Created:** [December 9, 2018, 1:59pm UTC](https://community.auth0.com/t/cant-list-stripe-subscriptions-data/18872 "2018-12-09T13:59:08Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![manu1](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/manu1/32/8351_2.png) [@manu1](https://community.auth0.com/u/manu1)\
**Post date:** [December 9, 2018, 1:59pm UTC](https://community.auth0.com/t/cant-list-stripe-subscriptions-data/18872/1 "2018-12-09T13:59:08Z")

</div>

Hi,

I’m trying to create a rule that will retrieve the list of subscriptions from my Stripe customer and add it to the app\_metadata of the user profile.

However, when I am receiving the following error: ERROR: Cannot read property ‘list’ of undefined

Snippet of my code in the rule:  
var stripe = require(‘stripe’)(‘sk\_test\_XXXXXXXX’);  
var customer = {  
customer: user.app\_metadata.stripe\_customer\_id  
};

stripe.subscriptions.list(customer, function(err, subscriptions) {  
if (err) {  
console.log(“error from stripe”);  
}

Per the Stripe API documentation, this should work:

> **[The Subscription object | Stripe API Reference](https://docs.stripe.com/api/subscriptions/object?lang=node)**

I’ve verified that the user.app\_metadata.stripe\_customer\_id is populated correctly, and still get the same error  
I also tested this with Postman and I am able to retrieve the subscriptions.

Any ideas?

---

<div class="post-metadata">

**Author:** ![charsleysa](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/charsleysa/32/9722_2.png) [@charsleysa](https://community.auth0.com/u/charsleysa)\
**Post date:** [December 10, 2018, 2:11am UTC](https://community.auth0.com/t/cant-list-stripe-subscriptions-data/18872/2 "2018-12-10T02:11:24Z")

</div>

Hi @manu1

It’s possible that the rule is loading an older version of the stripe package. The latest version supported by Auth0 rules is 4.24.0 so try changing your require to `require('stripe@4.24.0')`

You can view (and request) supported packages [here](https://auth0-extensions.github.io/canirequire/).

Hope this helps!

---

<div class="post-metadata">

**Author:** ![konrad.sopala](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/konrad.sopala/32/13516_2.png) [@konrad.sopala](https://community.auth0.com/u/konrad.sopala)\
**Post date:** [August 28, 2019, 2:34pm UTC](https://community.auth0.com/t/cant-list-stripe-subscriptions-data/18872/3 "2019-08-28T14:34:48Z")

</div>


