# .Net SDK: inconsistent availablility of underlying List/Search paging mechanism

**URL:** <https://developer.squareup.com/forums/t/net-sdk-inconsistent-availablility-of-underlying-list-search-paging-mechanism/22411>\
**Category:** Feature Requests\
**Tags:** sdk\
**Created:** [May 21, 2025, 12:10am UTC](https://developer.squareup.com/forums/t/net-sdk-inconsistent-availablility-of-underlying-list-search-paging-mechanism/22411 "2025-05-21T00:10:57Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![jhardin\_accumula](https://sea1.discourse-cdn.com/square/forums/user_avatar/developer.squareup.com/jhardin_accumula/32/9412_2.png) [@jhardin\_accumula](https://developer.squareup.com/forums/u/jhardin_accumula)\
**Post date:** [May 21, 2025, 12:10am UTC](https://developer.squareup.com/forums/t/net-sdk-inconsistent-availablility-of-underlying-list-search-paging-mechanism/22411/1 "2025-05-21T00:10:57Z")

</div>

Folks:

I’m attempting to build an integration application in C# which talks to the Square API. The application will be calling multiple API endpoints to poll changed data, and I was hoping that I could develop a single consistent, reusable pattern to access the list/search API endpoints, which are very similar to each other - but the Square .Net SDK is not allowing me to do that.

For example, the `Customers.SearchAsync()` method returns a `SearchCustomersResponse` object that contains one page of data plus the `cursor` value for the next page, if there is any. This is simple and mirrors the actual API definition and allows me to explicitly code pagination in a manner our application already supports.

However, the `GiftCards.Activities.ListAsync()` method has similar parameters but returns a `Pager<GiftCardActivity>` that encapsulates the pagination details. Even though the `ListActivitiesRequest` object _has_ a `Cursor` property, there is _no apparent way_ to get the cursor value from the current page to provide to a request for the next page, so that a code pattern consistent with customer search could be used.

The `GiftCards.Activities.ListAsync()` method does have _exactly_ what I want, it just doesn’t expose it for public use:

```auto
    private async Task<ListGiftCardActivitiesResponse> ListInternalAsync(
        ListActivitiesRequest request,
        RequestOptions? options = null,
        CancellationToken cancellationToken = default
    )
    {
        ...
    }

```

The `GiftCards.ListAsync()` method has the same problem: the only way to use it is via the provided `Pager<GiftCard>` wrapper which encapsulates the details of pagination.

This inconsistency, and the way it blocks creating list/search API request code using one reusable pattern, is extremely frustrating.

It’s fine having a client method that returns a `Pager` that hides all of the details of pagination for large response sets to make it easier to code for the API, but not when that comes at the cost of _ **not** being able to manage pagination myself_ if I wish to.

Please have the SDK provide consistent access methods across all of the endpoints, as far as possible, to allow an application to use either approach (explicit paging, or implicit “automatic” paging behind a `Pager`) as needed: either expose the `ListInternalAsync()` method for use somehow, or expose the current page’s “next page” cursor value in the `Page<TItem>` object..

Neither of the workarounds that I see - using reflection to access the private list method, or using a local fork of the Square SDK library with custom changes - are appealing.

Thank you.

---

<div class="post-metadata">

**Author:** ![Square-Dev-AI](https://sea1.discourse-cdn.com/square/forums/user_avatar/developer.squareup.com/square-dev-ai/32/2513_2.png) [@Square-Dev-AI](https://developer.squareup.com/forums/u/Square-Dev-AI)\
**Post date:** [May 21, 2025, 12:11am UTC](https://developer.squareup.com/forums/t/net-sdk-inconsistent-availablility-of-underlying-list-search-paging-mechanism/22411/2 "2025-05-21T00:11:21Z")

</div>

👋 I’m Square Dev AI, here to help answer your question!  
Based on the information you’ve provided, the following documentation will help answer your question:

> **[API Pagination Guide - Common API Patterns | Square](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination)**
>
> Learn how Square API endpoints use pagination to efficiently provide listing results.

> **[Common Square API Patterns](https://developer.squareup.com/docs/sdks/dotnet/common-square-api-patterns)**
>
> Learn how the Square .NET SDK supports the common Square API features.

> **Additional Documentation**
>
> [Use a Gift Card (Orders and Payments Integration)](https://developer.squareup.com/docs/gift-cards/walkthrough-2-orders-and-payments-integration)  
> [Common Square API Patterns](https://developer.squareup.com/docs/sdks/dotnet/using-dot-net-sdk)  
> [Retrieve Gift Cards and Track Activity](https://developer.squareup.com/docs/gift-cards/retrieve-gift-cards-and-activities)

If this documentation helped you find a solution, please check the box indicating that this reply solves the problem.  
Otherwise one of our Developer Advocates will provide additional assistance shortly.

---

<div class="post-metadata">

**Author:** ![jhardin\_accumula](https://sea1.discourse-cdn.com/square/forums/user_avatar/developer.squareup.com/jhardin_accumula/32/9412_2.png) [@jhardin\_accumula](https://developer.squareup.com/forums/u/jhardin_accumula)\
**Post date:** [May 21, 2025, 12:13am UTC](https://developer.squareup.com/forums/t/net-sdk-inconsistent-availablility-of-underlying-list-search-paging-mechanism/22411/3 "2025-05-21T00:13:32Z")

</div>

The recommended documentation resources do not help, as the Square .Net SDK hides pagination details for some endpoints.

---

<div class="post-metadata">

**Author:** ![Square-Dev-AI](https://sea1.discourse-cdn.com/square/forums/user_avatar/developer.squareup.com/square-dev-ai/32/2513_2.png) [@Square-Dev-AI](https://developer.squareup.com/forums/u/Square-Dev-AI)\
**Post date:** [May 21, 2025, 4:06pm UTC](https://developer.squareup.com/forums/t/net-sdk-inconsistent-availablility-of-underlying-list-search-paging-mechanism/22411/4 "2025-05-21T16:06:15Z")

</div>

The Square .NET SDK provides different methods for handling pagination depending on the specific API endpoint. For the `Customers.SearchAsync()` method, the SDK returns a `SearchCustomersResponse` object that includes a cursor for the next page of results, allowing you to handle pagination manually.

However, for the `GiftCards.Activities.ListAsync()` and `GiftCards.ListAsync()` methods, the SDK returns a `Pager<GiftCardActivity>` and `Pager<GiftCard>` object respectively. These objects encapsulate the details of pagination, and the SDK handles the pagination automatically for you.

The inconsistency you’re seeing is due to the different ways these API endpoints are designed to handle pagination. While it might seem inconsistent, it’s designed to provide flexibility and convenience for different use cases.

For endpoints that return a large amount of data, the SDK provides the `Pager` object to simplify the process of handling pagination. This is useful in scenarios where you want to retrieve all results without having to manually handle the pagination.

On the other hand, for endpoints that typically return a smaller amount of data, the SDK provides a cursor that you can use to manually handle pagination. This gives you more control over the pagination process and can be useful in scenarios where you want to retrieve a specific page of results.

Currently, there isn’t a way to manually handle pagination for methods that return a `Pager` object. If you need this functionality, you might consider submitting a feature request to the Square Developer team.

_This answer was reviewed by @Bryan-Square._

---

<div class="post-metadata">

**Author:** ![jhardin\_accumula](https://sea1.discourse-cdn.com/square/forums/user_avatar/developer.squareup.com/jhardin_accumula/32/9412_2.png) [@jhardin\_accumula](https://developer.squareup.com/forums/u/jhardin_accumula)\
**Post date:** [May 21, 2025, 4:19pm UTC](https://developer.squareup.com/forums/t/net-sdk-inconsistent-availablility-of-underlying-list-search-paging-mechanism/22411/5 "2025-05-21T16:19:09Z")

</div>

> [@Square-Dev-AI](#):
>
> For endpoints that return a large amount of data, the SDK provides the `Pager` object to simplify the process of handling pagination. This is useful in scenarios where you want to retrieve all results without having to manually handle the pagination.

Sure, it’s great to have helpers like that available, but not when they assume they will be the correct solution for _all_ problems and entirely block access to the underlying raw request pagination mechanism.

> [@Square-Dev-AI](#):
>
> If you need this functionality, you might consider submitting a feature request to the Square Developer team.

That’s what this conversation is.
