App Store Connect API `inAppPurchaseV2` returns `links.next`, even when there's no more `data`

I think there's been a recent change to the App Store Connect API; I claim that it's a bug.

When querying App Store Connect API endpoints that return arrays, like https://api.appstoreconnect.apple.com/v1/apps, the response includes a links property, of type PagedDocumentLinks. https://developer.apple.com/documentation/appstoreconnectapi/pageddocumentlinks

links should include a next link only if there's more data to provide, and, indeed, this is how it works for the /v1/apps endpoint.

But when querying inAppPurchasesV2, I find that starting very recently (this week?) the API always returns a next link, even if there's no more data to show.

{
  data: [],
  links: {
    self: 'https://api.appstoreconnect.apple.com/v1/apps/1363309257/inAppPurchasesV2?cursor=APo&limit=50',
    first: 'https://api.appstoreconnect.apple.com/v1/apps/1363309257/inAppPurchasesV2?limit=50',
    next: 'https://api.appstoreconnect.apple.com/v1/apps/1363309257/inAppPurchasesV2?cursor=ASw'
  },
  meta: { paging: { total: 223, nextCursor: 'ASw', limit: 50 } }
}

If I request the next link, it will generate me another response with empty data and with a new cursor.

{
  data: [],
  links: {
    self: 'https://api.appstoreconnect.apple.com/v1/apps/1363309257/inAppPurchasesV2?cursor=ASw&limit=50',
    first: 'https://api.appstoreconnect.apple.com/v1/apps/1363309257/inAppPurchasesV2?limit=50',
    next: 'https://api.appstoreconnect.apple.com/v1/apps/1363309257/inAppPurchasesV2?cursor=AV4'
  },
  meta: { paging: { total: 223, nextCursor: 'AV4', limit: 50 } }
}

Code I've written against this API (including my open-source library <https://github.com/dfabulich/node-app-store-connect-api>) assumes that if there's another links.next link, we should follow it; as a result, my code is looping infinitely, requesting empty data until eventually I have to give up.

This issue doesn't affect other endpoints, like /v1/apps, just this inAppPurchasesV2 endpoint.

Was this an intentional change? It seems to be a bug.

Seeing the same thing. Started for me around October 14th.

We have noticed the same issue and are impacted in the same way (pagination goes on forever until we get a 429).

Is there any plan to :

  1. Communicate about this change ?
  2. Fix it ?

Hello, this is Christos from wappier.

We are facing similar issue in our production operations. We observed that if you are trying to fetch more than 200 in-app products (aproximately) the system is broken. We created a post for our problem as well here but I think your observation and ours are similiar. Our post can be found here: https://developer.apple.com/forums/thread/805313

Hope we will get a response soon.

App Store Connect API &#96;inAppPurchaseV2&#96; returns &#96;links.next&#96;, even when there's no more &#96;data&#96;
 
 
Q