V1TransactionsApi ListPayments batchToken

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

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

Java version 16.0.0.20211020.

I’m still seeing it included in the SDK. 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. :slightly_smiling_face:

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

@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?

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. :slightly_smiling_face:

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();