Skip to main content

I was using API v2 to get customer info in order to get their entitlements

response = await fetch(
  `${apiUrl}/projects/${projectId}/customers/${userId}`,
  {
    headers: {
      Authorization: `Bearer ${apiKey}`,
      'Content-Type': 'application/json',
    },
  }
)

Sometimes though I noticed that active_entitlements.items would be empty, even though the user did indeed have an active subscription.

 

So I figured I’d try using the v1 endpoint instead

responseV1 = await fetch(`${apiUrlV1}/subscribers/${userId}`, {
  headers: {
    Authorization: `Bearer ${apiKeyV1}`,
    'Content-Type': 'application/json',
  },
})

And there it is! In this response the entitlement is included.

 

v2 response, no active entitlements:

{
  "active_entitlements": {
    "items": n],
    "next_page": null,
    "object": "list",
    "url": "https://api.revenuecat.com/v2/projects/proj6e8ba871/customers/823211fd-6c1f-4d10-8b1f-de9718832140/active_entitlements"
  },
  "experiment": null,
  "first_seen_at": 1741892521463,
  "id": "823211fd-6c1f-4d10-8b1f-de9718832140",
  "last_seen_at": 1742116954863,
  "object": "customer",
  "project_id": "proj6e8ba871"
}

 

 

v1 response, one entitlement (that’s active):

{
  "request_date": "2025-03-16T14:36:56Z",
  "request_date_ms": 1742135816204,
  "subscriber": {
    "entitlements": {
      "Pro": {
        "expires_date": "2025-03-16T14:41:47Z",
        "grace_period_expires_date": null,
        "product_identifier": "androidtestcom.groddapp.ias.pro.v1",
        "product_plan_identifier": "androidtestcom-groddapp-ias-monthly-pro-v1",
        "purchase_date": "2025-03-16T14:36:47Z"
      }
    },
    "first_seen": "2025-03-13T19:02:01Z",
    "last_seen": "2025-03-16T09:22:34Z",
    "management_url": "https://play.google.com/store/account/subscriptions",
    "non_subscriptions": {},
    "original_app_user_id": "823211fd-6c1f-4d10-8b1f-de9718832140"
// etc
}

 

 

So, my question is:

Why is the entitlement included in the v1 response, but not in the v2 response?

Hey ​@tobbe ,

That does seem strange - was the active entitlement in question granted by a sandbox purchase?


was the active entitlement in question granted by a sandbox purchase?

Yes. I’m only using the sandbox right now


@kaitlin Have you had a chance to look into this?


I am also getting blank returns for getting entitlements for v2 when the customer does have the entitlement in the sandbox (granted)

https://www.revenuecat.com/docs/api-v2#tag/Customer/operation/list-customer-active-entitlements


@pten230423947982 Thanks for confirming that it’s not just me 🙂

Now let’s just hope we can get someone from RevenueCat to look into the issue.