#BarrelRider
1 messages ยท Page 1 of 1 (latest)
hi! well the normal way would be to use /v1/subscriptions instead https://stripe.com/docs/api/subscriptions/list so you'd pass ['customer' => 'cus_xxx', 'status'=>'active'] to that to get all active subscriptions for that customer; and then repeat the call for trialing.
Oh I see, I was hoping that I could get em all in one call. That's very helpful, I'll do that, thank you!
you might be able to do it with the Search API https://stripe.com/docs/api/subscriptions/search instead with a 'status:\'active\' OR status:\'trialing\' AND customer:\'cus_xxx\'' query
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
oh even better thanks ๐
Oh I am getting Queries cannot have a mix of AND and OR so I guess I will just go with 2 calls
ah ok, makes sense. It's mostly because it would be hard to optimise the underlying database to support fully arbitrary queries unfortunately
that is absolutely fine, so long I know I am using that the right way I have no issues with 2 queries
๐
also in regards to the same thing - I am doing that toc heck in my system if user already has an active subscription - I assume I have to do that on my side? I can't stop the user from multiple subscriptions via stripe? it just that for my system it makes no sense to have multiple subscriptions.