#energetic_swan_85077
1 messages · Page 1 of 1 (latest)
You would want to specify status = cancelled to list deleted Subs
You mean you retrieve by Id and it returns empty response?
it return can't find the sub
but It is available in test mode, So it's what confuses me
Okie, how about List Subscription, pass status = canceled and then filter the Id from the response?
Then I have to try it, But why not by id?
Here are the settings in different environments?
No I think that's the default behavior in both Test mode and Live mode
Is this modified recently? We have retrieve it in this way a long time ago, but it seems that there has been no feedback about any abnormalities.
1 min. By deleted Subscription, do you mean cancelled Subscription? Can you provide the Id you just tried?
Use the http delete request to call the /v1/customers/{0}/subscriptions api
I can’t get the sub id of the live mode at the moment.
Correction /v1/customers/{0}/subscriptions/{1}
Yeah, can you give that Subscription Id?
sub_1OZKwvATmNg0rXeeE52Al1iY
Can you share the req_xxx ID for this request?
sorry, I don't have one here
Not sure how I can help without that then. The error would suggest to me that you're making an API request to lookup the sub_xxx with API keys that belong to a different account
Belongs to acct_15vjQkATmNg0rXee
What you mean is that I used a different key in the request of retrieve by id, so I couldn’t get the sub?
That's my theory and a common cause of errors like this yes. But I can't really say for sure without seeing the req_xxx for that request(s) that are failing
Looking
Yeah API keys seems fine. Testing something
Ok, this is seemingly an API version issue. You're on quite an old version: 2015-04-07. We added support for what you're trying to do in 2016-07-06:
Updates the list all subscriptions call to also return canceled subscriptions. The endpoint now supports fetching only canceled subscriptions by specifying status=canceled. You can now retrieve a single canceled subscription by providing its ID.
https://stripe.com/docs/upgrades#2016-07-06
My recommendation would be to just pass the Stripe-Version header for that specific request: https://stripe.com/docs/api/versioning
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.