#jacques1284
1 messages · Page 1 of 1 (latest)
ok I found Auto-pagination in stripe
I'll use that thanks
Can this work?
const invoices = await this.stripe.invoices.list(data).autoPagingEach();
console.log(`Stripe invoices list successfully retrieved : ${JSON.stringify(invoices.data)}`);
return invoices.data;```
No, follow the Syntax in the guide I shared
Make sure to choose your programming language:
https://stripe.com/docs/api/pagination/auto?lang=node
// In Node 10+:
for await (const customer of stripe.customers.list({limit: 3})) {
// Do something with customer
}
// In other environments:
stripe.customers.list({limit: 3})
.autoPagingEach(function(customer) {
// Do something with customer
});
is it possible to retrieve all invoices in a variable or do we have to use a for ?
If you want to use something like this, you can use simple pagination:
https://stripe.com/docs/api/pagination