# V1TransactionsApi ListPayments batchToken

**URL:** <https://developer.squareup.com/forums/t/v1transactionsapi-listpayments-batchtoken/4272>\
**Category:** Questions\
**Tags:** sdk\
**Created:** [November 18, 2021, 7:09pm UTC](https://developer.squareup.com/forums/t/v1transactionsapi-listpayments-batchtoken/4272 "2021-11-18T19:09:22Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![victor](https://avatars.discourse-cdn.com/v4/letter/v/3e96dc/32.png) [@victor](https://developer.squareup.com/forums/u/victor)\
**Post date:** [November 18, 2021, 7:09pm UTC](https://developer.squareup.com/forums/t/v1transactionsapi-listpayments-batchtoken/4272/1 "2021-11-18T19:09:22Z")

</div>

Does the SDK give the batchToken in the response to listPayments(Async)? I don’t see it available in the response or in the class (DefaultV1TransactionsApi) code. I am using Java version 16.0.0.20211020.

Previously, in version 2.9, we used listPaymentsWithHttpInfo and the response.getBatchToken().

Yes, I know this endpoint is deprecated, but we need to use it until we migrate to Payments and Order API.

Thanks,  
Victor

---

<div class="post-metadata">

**Author:** ![Bryan-Square](https://sea1.discourse-cdn.com/square/forums/user_avatar/developer.squareup.com/bryan-square/32/38_2.png) [@Bryan-Square](https://developer.squareup.com/forums/u/Bryan-Square)\
**Post date:** [November 18, 2021, 9:32pm UTC](https://developer.squareup.com/forums/t/v1transactionsapi-listpayments-batchtoken/4272/2 "2021-11-18T21:32:26Z")

</div>

👋 Which SDK are you using? The `batch_token` should still be in the header of the response.

---

<div class="post-metadata">

**Author:** ![victor](https://avatars.discourse-cdn.com/v4/letter/v/3e96dc/32.png) [@victor](https://developer.squareup.com/forums/u/victor)\
**Post date:** [November 19, 2021, 3:22pm UTC](https://developer.squareup.com/forums/t/v1transactionsapi-listpayments-batchtoken/4272/3 "2021-11-19T15:22:16Z")

</div>

Java version 16.0.0.20211020.

---

<div class="post-metadata">

**Author:** ![Bryan-Square](https://sea1.discourse-cdn.com/square/forums/user_avatar/developer.squareup.com/bryan-square/32/38_2.png) [@Bryan-Square](https://developer.squareup.com/forums/u/Bryan-Square)\
**Post date:** [November 19, 2021, 8:02pm UTC](https://developer.squareup.com/forums/t/v1transactionsapi-listpayments-batchtoken/4272/4 "2021-11-19T20:02:28Z")

</div>

I’m still seeing it included in the [SDK](https://github.com/square/square-java-sdk/blob/master/doc/api/v1-transactions.md#list-payments). Do you an example request that it wasn’t returned? Also your app Id and a time that you made the request will be helpful to look at the logs. 🙂

---

<div class="post-metadata">

**Author:** ![victor](https://avatars.discourse-cdn.com/v4/letter/v/3e96dc/32.png) [@victor](https://developer.squareup.com/forums/u/victor)\
**Post date:** [December 6, 2021, 8:10pm UTC](https://developer.squareup.com/forums/t/v1transactionsapi-listpayments-batchtoken/4272/5 "2021-12-06T20:10:36Z")

</div>

Hey Bryan, sorry for the disconnect as I was working through updating from v2.9 to 16.  
It was time consuming, many things changed!

I just ran for 12/3 at 14:00 Central time, location id L00AES4DD6B7S.  
The SDK does show that a `batchToken` is an optional parameter, but the response is a List.

There is no cursor or token returned as in the past with V2.0 `listPaymentsWithHttpInfo`.  
That version returned a CompleteResponse with a getBatchToken method available.

As it is now, I set the limit=200 (the max value allowed), but if there are more than that, I won’t be able to get the rest without a batchToken or cursor.

Thanks,  
Victor

---

<div class="post-metadata">

**Author:** ![victor](https://avatars.discourse-cdn.com/v4/letter/v/3e96dc/32.png) [@victor](https://developer.squareup.com/forums/u/victor)\
**Post date:** [December 13, 2021, 9:03pm UTC](https://developer.squareup.com/forums/t/v1transactionsapi-listpayments-batchtoken/4272/6 "2021-12-13T21:03:48Z")

</div>

@Bryan-Square Just checking in on this.  
Is there a way to get a cursor or batchToken in the response when using the Java SDK?

---

<div class="post-metadata">

**Author:** ![Bryan-Square](https://sea1.discourse-cdn.com/square/forums/user_avatar/developer.squareup.com/bryan-square/32/38_2.png) [@Bryan-Square](https://developer.squareup.com/forums/u/Bryan-Square)\
**Post date:** [December 13, 2021, 9:57pm UTC](https://developer.squareup.com/forums/t/v1transactionsapi-listpayments-batchtoken/4272/7 "2021-12-13T21:57:26Z")

</div>

When you were getting the payments for 12/3 did you have a `begin_time` and `end_time` set? If it was only for that day there were only 76 payments. The `BatchToken` and `cursor` will only be available if there are additional results to return and if one wasn’t included that means that you got all the results. 🙂

---

<div class="post-metadata">

**Author:** ![victor](https://avatars.discourse-cdn.com/v4/letter/v/3e96dc/32.png) [@victor](https://developer.squareup.com/forums/u/victor)\
**Post date:** [December 13, 2021, 10:25pm UTC](https://developer.squareup.com/forums/t/v1transactionsapi-listpayments-batchtoken/4272/8 "2021-12-13T22:25:22Z")

</div>

Thanks Bryan. Yes, I used a begin time and end time, I understand for 76 payments, there wouldn’t be a cursor. The problem is that I don’t see a cursor field or method available in the response as it was for the old version.  
Before, the code looked like:

> CompleteResponse\<List\> completeResponse =  
> v1TransactionsApi.listPaymentsWithHttpInfo(  
> squareLocationId,  
> TRANSACTION\_SORT\_ORDER,  
> beginTime,  
> endTime,  
> limit,  
> finalBatchToken);  
> batchToken = completeResponse.getBatchToken();
