#Sero
1 messages · Page 1 of 1 (latest)
Hi there, the public doc doesn't mention whether the list is ordered by its created timestamp (https://stripe.com/docs/api/subscriptions/list#list_subscriptions).
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Can you tell me more about the problem that you are trying to solve?
Im creating a checkout where I test if the subscription ID exists, basically the customer must have only 1 active subscription at a time and I need to be able to verify if it exists so to not double subscribe the customer
maybe I can use the .lenght of the subscription.data object
and if more than 0 do not proceed
You can pass in the customer ID (https://stripe.com/docs/api/subscriptions/list#list_subscriptions-customer) when listing subscriptions, if the list.length is more than 1, then it means this customer already has a subscription.
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
is there a difference between an active and not active subscription?
or only active ones are listed?
The list API will return non-cancelled subscriptions by default. These are the possible value for subscription status (https://stripe.com/docs/api/subscriptions/object#subscription_object-status)
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.