#MrLowLevel
1 messages · Page 1 of 1 (latest)
active and trialing I think
Or is unpaid terminal too?
Ok, basically I want to prevent creating a new sub if the user already has one
So I want to know which statuses are "recoverable", and see if there exists a subscription with such a status for that user
Currently the code goes something like
const subscriptions = await stripe.subscriptions.list({ customer: user.customerId, limit: 1 })
if (subscriptions.data.length > 0) {
throw new InvalidOperationError('User already has a subscription')
}
best way is to check your database where you have saved the ID of their existing subscription