Searching and Sorting
All index (list) endpoints support searching and sorting using Ransack query syntax.
Searching
Search by any resource field using the q parameter:
Example: Search customers by name
curl -X GET "https://api.qoyod.com/v1/customers?q[name_cont]=John" \
-H "API-KEY: your_api_key_here"
Common Search Predicates
| Predicate | Description | Example |
|---|---|---|
_eq | Equals | q[id_eq]=123 |
_cont | Contains | q[name_cont]=John |
_start | Starts with | q[email_start]=john |
_end | Ends with | q[email_end][email protected] |
_gt | Greater than | q[total_gt]=1000 |
_lt | Less than | q[total_lt]=5000 |
_gteq | Greater than or equal | q[date_gteq]=2024-01-01 |
_lteq | Less than or equal | q[date_lteq]=2024-12-31 |
Sorting
Sort results by any field using the s parameter:
# Sort invoices by date descending
curl -X GET "https://api.qoyod.com/v1/invoices?q[s]=invoice_date desc" \
-H "API-KEY: your_api_key_here"
Default sorting is by id in ascending order.