#arn4v

1 messages · Page 1 of 1 (latest)

sharp lavaBOT
quick oak
#

Hmm, that's not really possible I don't think. You only want a list of customers with an active subscription?

obtuse kestrel
#

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

quick oak
# obtuse kestrel Is there any rate limit on how many customers can be fetched with customers.list...

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

obtuse kestrel
#

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?

obtuse kestrel
quick oak
quick oak
obtuse kestrel