# ListPaymentsRequest pagination

**URL:** <https://developer.squareup.com/forums/t/listpaymentsrequest-pagination/22197>\
**Category:** Questions\
**Tags:** payments-api\
**Created:** [May 6, 2025, 10:15am UTC](https://developer.squareup.com/forums/t/listpaymentsrequest-pagination/22197 "2025-05-06T10:15:23Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![fcmarquis](https://avatars.discourse-cdn.com/v4/letter/f/82dd89/32.png) [@fcmarquis](https://developer.squareup.com/forums/u/fcmarquis)\
**Post date:** [May 6, 2025, 10:15am UTC](https://developer.squareup.com/forums/t/listpaymentsrequest-pagination/22197/1 "2025-05-06T10:15:23Z")

</div>

HI,

Using the latest Api (2025-04-16), considering I have an infinite number of payments. I would like to retrieve payments using a cursor so clients would be able to request payments, pages by page by calling a new request ( with relevant cursor) — As I did in older api versions.

How using, the new version call, can I retrieve a limited set of payments without using the pager or without retrieving the whole set of payments?

It seams the request is returning the whole set of payments every time? I am wrong?  
Thanks

---

<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 6, 2025, 10:15am UTC](https://developer.squareup.com/forums/t/listpaymentsrequest-pagination/22197/2 "2025-05-06T10:15:42Z")

</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:

> **[Retrieve Payments](https://developer.squareup.com/docs/payments-api/retrieve-payments)**
>
> Learn how to retrieve payments using the Payments API.

> **[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.

> **Additional Documentation**
>
> [Take Payments](https://developer.squareup.com/docs/payments-api/overview)  
> [Take Payments](https://developer.squareup.com/docs/payments-api/take-payments)  
> [Payments API](https://developer.squareup.com/docs/payments-refunds)

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:** ![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 6, 2025, 3:44pm UTC](https://developer.squareup.com/forums/t/listpaymentsrequest-pagination/22197/4 "2025-05-06T15:44:29Z")

</div>

In the latest API version, you can still use pagination to retrieve a limited set of payments. When you call the ListPayments endpoint, you can specify a limit parameter to control the number of payments returned in each response. If there are more payments to retrieve, the response will include a cursor that you can use in your next ListPayments request to fetch the next set of payments. If there are no more payments to retrieve, the response will not include a cursor.

So, if you’re seeing all payments returned in a single response, it might be because you’re not setting a limit, or the total number of payments is less than or equal to the limit you’ve set.

Remember to use the cursor returned in the previous response in your subsequent ListPayments request to retrieve the next set of payments.

_This answer was reviewed by @Bryan-Square._

---

<div class="post-metadata">

**Author:** ![fcmarquis](https://avatars.discourse-cdn.com/v4/letter/f/82dd89/32.png) [@fcmarquis](https://developer.squareup.com/forums/u/fcmarquis)\
**Post date:** [May 6, 2025, 3:50pm UTC](https://developer.squareup.com/forums/t/listpaymentsrequest-pagination/22197/5 "2025-05-06T15:50:07Z")

</div>

Thanks.  
Following the successful request, the object returned ti a Square\Core\Pagination\CursorPager, how to get the cursor from it, it does not have the getCursor() function

I have over 300 payments, I set limit : 50, I know I have 6 pages doing  
$pageCount = 0;  
foreach ($apiResponse-\>getPages() as $page) {  
$pageCount++;  
}  
I don’t find how to get the cursor.

I see using the Api Explorer it returns a json with payments and at the end a cursor. But from the api, I get the pager which does not seam to have the payload structure I look for.

Thanks.

---

<div class="post-metadata">

**Author:** ![fcmarquis](https://avatars.discourse-cdn.com/v4/letter/f/82dd89/32.png) [@fcmarquis](https://developer.squareup.com/forums/u/fcmarquis)\
**Post date:** [May 14, 2025, 2:01am UTC](https://developer.squareup.com/forums/t/listpaymentsrequest-pagination/22197/8 "2025-05-14T02:01:41Z")

</div>

Confirmed by Square Support, Square\Core\Pagination\Page::getCursor() is not supported on square/square-php-sdk Version 42.1.0.20250416. It is quite unfortunate the online documents is not reflecting this.

---

<div class="post-metadata">

**Author:** ![anne789](https://avatars.discourse-cdn.com/v4/letter/a/c77e96/32.png) [@anne789](https://developer.squareup.com/forums/u/anne789)\
**Post date:** [June 30, 2025, 7:44am UTC](https://developer.squareup.com/forums/t/listpaymentsrequest-pagination/22197/9 "2025-06-30T07:44:25Z")

</div>

Thank you for this solution. [peryourhealth](https://www.peryourhealth.it.com/)
