question

bitdoor avatar image
bitdoor asked matt answered

Filter in unix-time

Hi,

having troubles understanding the filter for createdTime.

I created two transactions in the virtual terminal.

When I send this request, I can get them in the response.

https://www.clover.com/v3/merchants/2GSK3XZ3ESKS1/payments?access_token=373***&expand=cardTransaction

When I add filters in unix-time, I get empty response. The actual timestamp of both transaction is within the range.

https://www.clover.com/v3/merchants/2GSK3XZ3ESKS1/payments?access_token=373***&expand=cardTransaction&filter=createdTime<=1586246400&filter=createdTime>=1577865600

Response

{'elements': [], 'href': 'http://api.clover.com/v3/merchants/2GSK3XZ3ESKS1/payments?filter=createdTime%3C%3D1586246400&filter=createdTime%3E%3D1577865600&limit=100'}

Can you please give me a suggestion?

Note. If I only use the >= filter, then it seems to work

https://www.clover.com/v3/merchants/2GSK3XZ3ESKS1/payments?access_token=37***&expand=cardTransaction&filter=createdTime>=1577865600

and I get the transactions

Thanks

REST API
10 |2000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

matt avatar image
matt answered

Clover uses Unix time in milliseconds, I think you need to add 000 at the end of your timestamp!

10 |2000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Welcome to the
Clover Developer Community