#energetic_swan_85077

1 messages · Page 1 of 1 (latest)

prisma sirenBOT
junior cliff
#

You would want to specify status = cancelled to list deleted Subs

silk karma
#

I retrieve it by id

#

and It is available in test model

#

hello?

junior cliff
#

You mean you retrieve by Id and it returns empty response?

silk karma
#

it return can't find the sub

#

but It is available in test mode, So it's what confuses me

junior cliff
#

Okie, how about List Subscription, pass status = canceled and then filter the Id from the response?

silk karma
#

Then I have to try it, But why not by id?

#

Here are the settings in different environments?

junior cliff
#

No I think that's the default behavior in both Test mode and Live mode

silk karma
#

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.

junior cliff
#

1 min. By deleted Subscription, do you mean cancelled Subscription? Can you provide the Id you just tried?

silk karma
#

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}

junior cliff
#

Yeah, can you give that Subscription Id?

prisma sirenBOT
silk karma
#

sub_1OZKwvATmNg0rXeeE52Al1iY

final lily
silk karma
#

sorry, I don't have one here

final lily
#

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

final lily
silk karma
#

What you mean is that I used a different key in the request of retrieve by id, so I couldn’t get the sub?

final lily
#

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

silk karma
#

ok, wait a minute, I'll ask if I can get the req_xxx

#

req_wbKRAClu56ieSt

final lily
#

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

Keep track of changes and upgrades to the Stripe API.

prisma sirenBOT