Skip to main content

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

PredicateDescriptionExample
_eqEqualsq[id_eq]=123
_contContainsq[name_cont]=John
_startStarts withq[email_start]=john
_endEnds withq[email_end][email protected]
_gtGreater thanq[total_gt]=1000
_ltLess thanq[total_lt]=5000
_gteqGreater than or equalq[date_gteq]=2024-01-01
_lteqLess than or equalq[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.