0

I'm using the following URL:

"payments?expand=cardTransaction,taxRates,lineItemPayments,refunds,order,tender,employee&orderBy=createdTime%20ASC&offset=0&limit=1"

It returns transaction with ID: BFPVD5YC6PQRT on 09-Feb-2016 2:09 pm

But my first ever transaction is: BER8957JDE1ZC on 26-Jan-2016 2:54 pm

asked 2016-02-12 13:03:11 -0500

BillMoller gravatar image

2 answers

Sort by  
0

https://docs.clover.com/build/web-apps/web-api/#pagination might explain your problem. You get up to 100 results by default.

answered 2016-02-12 16:16:17 -0500

Jim Patel gravatar image
Comments

There is apparently some custom logic on the Payments endpoint, likely created in response to developer abuse or something. Basically, it breaks it down the payments into time segments whenever a query is missing a modifiedTime filter. To avoid this, add a modifiedTime filter to your request to query less than the current timestamp (or provide a better timestamp range).

I actually was able to test this on your test merchant too, and I have verified the response is what you are looking for. /payments?orderBy=createdTime%20ASC&filter=modifiedTime<1455318559000

mike gravatar image
mike 2016-02-12 17:11:57 -0500

Without the modifiedTime query and with a limit+offset less than 500, the server automatically adds a 3 days filter as you described. As the limit+offset increases, the days filter changes as well.

mike gravatar image
mike 2016-02-12 17:13:02 -0500

Thank you Mike! I knew I was missing something. It sounds like you figured it out. I'll try this when I return.

BillMoller gravatar image
BillMoller 2016-02-16 16:03:03 -0500
0

orderBy=createdTime%20ASC is why you're getting your older transactions first. Try changing ASC to DESC

answered 2016-02-12 13:21:43 -0500

mike gravatar image
Comments

DESC returns: EPNY8NVKR4936 on 12-Feb-2016 1:51 pm, my most recent transaction... also, created descending should be the latest, so I expected ascending to be the earliest.

BillMoller gravatar image
BillMoller 2016-02-12 13:25:36 -0500

I just called it again with ASC, and it returned: ID: 0GDJR2WNF4PWC 09-Feb-2016 2:56 pm, as if the "payments" method only goes back to a three day window?

BillMoller gravatar image
BillMoller 2016-02-12 13:31:43 -0500

Sorry, I misunderstood your question. I dove into our server code and am adding on to Jim's answer.

mike gravatar image
mike 2016-02-12 16:59:59 -0500