#sejo-subscription-cancel
1 messages · Page 1 of 1 (latest)
@timber otter Let me know how I can help!
If this is related to the earlier thread, let me know if you're running into any issues with retrieving a subscription ID now that you have a customer ID
For reference, this is the earlier thread: #1107767286972035114 message
If that's the problem, I need the subscription id to cancel the subscription
But as you said, I now have the customer id, but I need the subscription id
Right, exactly. You can either make a call to list subscriptions and filter by customer ID so the response only includes subscriptions for that specific customer:
https://stripe.com/docs/api/subscriptions/list
or you can make a call to retrieve that specific customer and expand their subscriptions:
https://stripe.com/docs/api/customers/retrieve
sejo-subscription-cancel
I'm reading I try and I tell you
i think i got it
This is the real subscription id right? "id": "si_NsLUWG8hKiyMWI",
no, that is a SubscriptionItem id. See the object right below it
a Subscription id is sub_12345
I'm sorry you're just giving me pictures with no context
Is this a SubscriptionSchedule? Something else? What are you trying to do and what's blocking you?
I am looking for the subscription id to be able to cancel the subscription
In which context though? Where does that picture come from? What exact API are you calling, what exact API Resource are you getting back? What is your code doing?
This code is the response of querying
const subscriptions = await stripe.subscriptions.list({
customer: id_cancellation,
});
res.send({subscriptions})
That image gives me insomnia and it's what brings me the subscription list
is the filtering of a single client
Okay so you are calling the List Subscriptions API, so you get a List back. That list can have 0, 1 or N elements. Each element is a Subscription object as described at https://stripe.com/docs/api/subscriptions/object and that object has an id property that is the Subscription id sub_123. So that's all you need
thank you so much