question

mlyon avatar image
mlyon asked ·

"created" parameter on /v1/charges endpoint - not working?

I'm attempting to filter the results from the /v1/charges endpoint based on the created timestamp. The API reference shows an object parameter with the name "created", which can include greater-than/less-than values. The documentation doesn't make it clear how these values are supposed to be formatted (in seconds? milliseconds?), however, it doesn't seem to matter what I put in for those parameters, they don't have any effect. I can put a "gt" value in that is 1 less than the "lt" value, which shouldn't return anything, and it still returns all the records. I've tried this using the online REST API Reference form, as well as with my own code, and neither work.

I did notice that when using the API Reference, it sets the url parameters like "created[gt]=1585699200&created[lt]=1586044800" (urlencoded, of course). However, on the "paginating requests" page of the ecommerce API tutorials, it shows the example with the parameter json-encoded like "created={"gt":1585699200,"lt":1586044800}". Regardless, I've tried both and neither work.

Any advice on how these parameters are supposed to function would be appreciated.

REST APISandboxe-commerce api
10 |2000 characters needed characters left characters exceeded

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

1 Answer

· Write an Answer
David Marginian avatar image
David Marginian answered ·

Update:

This is a documentation issue, currently, we support searching via date/time:

/v1/charges?created.gt=2021-01-22%2011:12:14

I will have the documentation team fix our docs.

Original Post:

Something doesn't seem right here. I will let the ecomm team know. Alternatively (or in the meantime) you could use the v3/orders endpoint - https://docs.clover.com/reference#ordergetorders-2, and, https://docs.clover.com/docs/applying-filters.

1 comment
10 |2000 characters needed characters left characters exceeded

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

Ok, that appears to be working, thanks.

0 Likes 0 ·

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