#arn4v
1 messages · Page 1 of 1 (latest)
Hmm, that's not really possible I don't think. You only want a list of customers with an active subscription?
Correct. We've been applying coupons directly to customer (profile?) and want to change that logic so coupons are applied on checkout session instead.
Is there any rate limit on how many customers can be fetched with customers.list()? We have well in the 100K+ range and if we can't filter in the API itself then we'll have to filter in our own code
The max limit per request is 100. So I'd recommend using auto pagination from the Node lib if you're working with a ton of objects as it'll keep you within the rate limit: https://stripe.com/docs/api/pagination/auto
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Ah okay, thank you!
Another question:
The coupon key is optional, so the type is string | undefined (where string is the coupon id I believe)
Is this the correct way to remove the coupon from a user?
Stripe.customers.update(customerId, {
// Throws a type error because it doesn't accept null
coupon: null
})
Also: If we remove coupon code from a users account that already has an active subscription, does that remove the discount from the next invoice/billing date? Or does it stay active till cancellation?
Just to be sure: Does the for await way, where the limit is set to fetch users 3 at a time, and continue until the entire customer list is iterated?
So 3 users fetched, another API call, another 3, until say 10,000 users are fetched
You'd set it as an empty string: coupon: ''
You can specify the limit parameter, up to 100
Can you please check the last question here?