question

matt avatar image
matt asked matt commented

REST API internal server error 500 with filter

Hi,

I get 500 errors, when using the filter "createdTime" and specifying a longer time period for the payments route. The request works when turning off the filter completely or when specifying a short time period (a year or so works)

Request:

https://api.clover.com/v3/merchants/C1B31MQ6CTAKC/payments?access_token=XXX&expand=tender&expand=cardTransaction&limit=1000&offset=0&filter=createdTime>=1302114988000

Access token is in separate moderator's post


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.

matt avatar image
matt answered

the error has disappeared - still Clover's API should not return 500s - probably overwhelmed or whatever...

10 |2000

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

David Marginian avatar image
David Marginian Deactivated answered matt commented

This can happen for queries that are not constrained enough. Merchants can have a lot of orders, so querying for large time periods is problematic. Please limit your queries to avoid these issues.

5 comments
10 |2000

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

matt avatar image matt commented ·

Well...then it's still not good, because there should be a useful response. In addition, it worked WITHOUT filter, but it did not work WITH filter. Since the response is anyway limited to 1000 datasets, IMHO there should not be 500 errors.

0 Likes 0 ·
David Marginian avatar image David Marginian ♦♦ matt commented ·

I agree, but it is also not good to do open or broad queries. Just because the response is limited does not mean the query is performant.

1 Like 1 ·
matt avatar image matt David Marginian ♦♦ commented ·

Hi David, I did again some testing as the 500 errors are a problem for my app in production. I made a series of requests with the created_at filter and the requests are limited to a period of 30 days, which shouldn't be a problem in terms of results. The log of the requests shows that timestamps below unix time 1500000000000 returned 500 errors. I made three rounds of the same test series. 2 times the requests below this timestamp returned 500, in the other round it returned 200. All requests above this number returned 200. So maybe it is a hint on the issue on Clover's side. Logs are posted in separate moderator's post due to token.

0 Likes 0 ·
Show more comments

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

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