Solved

RestAPI in sandbox always return null to subscriber node


Badge

Hi,

We’ve been sending requests to the following endpoint: https://api.revenuecat.com/v1/subscribers/{{id}}.

curl --request GET \
--url 'https://api.revenuecat.com/v1/subscribers/<app_user_id>' \
--header 'accept: application/json' \
--header 'authorization: Bearer <my_v1_token>'

In the request we DON’T send the optional parameter: “X-Is-Sandbox”: https://www.revenuecat.com/docs/api-v1#tag/customers/operation/subscribers

 

On the production environment, we have the following json response.

{
...
"subscriber": {
"entitlements": {
"entitlement_identify": {
"expires_date": "YYYY-MM-ddTHH:mm:ssZ",
"grace_period_expires_date": null,
"product_identifier": "product_identifier",
"purchase_date": "YYYY-MM-ddTHH:mm:ssZ",
}
},
}
...
}

We look for the subscriber node to make user’s subscription validation.
 

But in the last 3 days we’ve been experiencing trouble in the sandbox environment.

The current json response is:

{
...
"subscriber": {
"entitlements": {},
}
...
}

And this occur in many applications that we have.

 

Is it possible that there something isn’t working in sandbox environment?

Or maybe the endpoints has being changed?

 

Could you help us?

 

Thanks in advance,

 

Regards.

 

icon

Best answer by Greenie Cheng 4 July 2024, 14:59

View original

This post has been closed for comments

2 replies

Badge +1

Hi there, 

We recently updated the logic on the endpoint such that only production purchases are returned when the header is set to `X-Is-Sandbox: false`. This seems to have caused a lot of confusion for developers such as yourself. So we have opted to revert the change, so this should be working for you again. 

Sorry for the confusion. 

Badge

Thanks for your replay.

I confirm that all is working now 😁.