Skip to main content
Question

List subscription API does not return product details

  • August 29, 2025
  • 6 replies
  • 81 views

Forum|alt.badge.img

Hi, I’m currently trying to integrate this API

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

In the response example, it shows `entitlement` with `product` details of that entitlement. But, from my testing, the `product` field is not in the response. I've tried experimenting with `expand` parameter with multiple values, but the `product` field is not showing. Is the documentation wrong? Can you tell me how can I get the `product` details?

 

            "entitlements": {
"items": [
{
"created_at": 1755827296320,
"display_name": "Premium",
"id": "entl861f....",
"lookup_key": "premium",
"object": "entitlement",
"project_id": "proj8d....."
}
],
"next_page": null,
"object": "list",
"url": "https://api.revenuecat.com/v2/projects/proj...."
},

 

This post has been closed for comments

6 replies

hussain
RevenueCat Staff
Forum|alt.badge.img+6
  • RevenueCat Staff
  • August 29, 2025

Hi,

Thanks for reaching out. I’m happy to help!

It isn’t guaranteed that GET /v2/projects/{project_id}/customers/{customer_id}/subscriptions will return a product object for every entitlement in the response. In practice, some nested fields shown in examples are not always returned or expandable across all endpoints/relationships. You can always expand the Response Schema related to specific response codes in our docs to see which fields are guaranteed and which aren’t. The fields marked with “required” will always be present.

Instead of relying on an entitlement’s embedded product, you can:

  1. Call /subscriptions to get the customer’s subscriptions.

  2. Read the product_id from each subscription (this is always present).

  3. Use that product_id to fetch full product details via GET /v2/projects/{project_id}/products/{product_id}. Docs here.

Hope this helps, let me know if you have any other questions.

Best,

Hussain


Forum|alt.badge.img
  • Author
  • New Member
  • September 1, 2025

Hi ​@hussain, thanks for the reply.

How do I get the latest customer’s subscription from `/subscriptions` API. The order of subscriptions in the list seems to be random and the `active` subscription might be returned in the middle of the list.


hussain
RevenueCat Staff
Forum|alt.badge.img+6
  • RevenueCat Staff
  • September 1, 2025

Hi,

The /subscriptions list isn’t ordered. The endpoint doesn’t guarantee sort order, so you’ll want to choose what “latest” means for your use case and sort/filter on your side.

If you want subscriptions that are currently giving access, filter the list by gives_access === true. That’s the authoritative flag for whether a subscription should unlock the associated entitlements right now (regardless of the store’s intermediate states).

If you want the most recent subscription chronologically, sort the returned items locally by the timestamp that best fits your definition of “latest” (e.g. current_period_starts_at for most recently started subscription). Since the API doesn’t impose ordering, relying on position in the list can be misleading.

You also asked about “active” vs “latest.” A customer can have multiple subscriptions active at the same time (e.g., across products/tiers or stores), so it’s possible to see more than one active item. Hence, you might have to account for this in your logic.

Thanks again for your patience, let me know if you have any other questions. I’m happy to help!

Best,

Hussain


Forum|alt.badge.img
  • Author
  • New Member
  • September 2, 2025

Hi ​@hussain 

Thanks for the detailed answers. I have some follow-up questions.

Since /subscriptions is paginated and there’s no guarantee the subscription I need is on the first page, I’ll need to fetch the entire subscription list before filtering/ordering?

Is there any filter/sort parameter for the API?

 

> You also asked about “active” vs “latest.” A customer can have multiple subscriptions active at the same time (e.g., across products/tiers or stores), so it’s possible to see more than one active item. Hence, you might have to account for this in your logic.

 

Thanks! I’ll keep this in mind.


hussain
RevenueCat Staff
Forum|alt.badge.img+6
  • RevenueCat Staff
  • September 2, 2025

Hi,

Thanks for following up. If you need a definitive answer like “the latest subscription across all of this customer’s history,” because the endpoint is unordered and paginated. You should iterate pages until you’ve evaluated all items (or until you’re satisfied you’ve found what you’re looking for).

At the moment, there isn’t a filter like “only active” on the /subscriptions endpoint.

Hope this clears it up!

Best,

Hussain


Forum|alt.badge.img
  • Author
  • New Member
  • September 3, 2025

Understood. Thanks for the explanation!