Advanced invoice filtering with custom GraphQL where clauses and dynamic ordering
Supports invoiceNumber text matching, status filtering, and date ranges.
Real Example:
curl --location 'https://{{host}}/v1/invoices/search' \
--header 'Authorization: bearer {{token}}' \
--header 'Content-Type: application/json' \
--data '{
"pageSize": 1,
"where": {
"_and": [
{
"_or": [
{
"invoiceNumber": {
"_ilike": "%2024%"
}
},
{
"description": {
"_ilike": "%service%"
}
}
]
},
{
"status": {
"_in": ["POSTED", "CLOSED"]
}
},
{
"createdAt": {
"_gte": "1900-01-01T00:00:00Z"
}
},
{
"dueDate": {
"_gte": "2024-01-01T00:00:00Z"
}
}
]
},
"orderBy": [
{
"invoiceNumber": "asc"
},
{
"createdAt": "desc"
}
]
}'Security
BearerAuth
- Mock serverhttps://api.doc.aiwyn.ai/_mock/bundle/gql/v1/invoices/search
- Sandboxhttps://demo.api.aiwyn.ai/gql/v1/invoices/search
- Staginghttps://staging.api.aiwyn.app/gql/v1/invoices/search
curl -i -X POST \
https://api.doc.aiwyn.ai/_mock/bundle/gql/v1/invoices/search \
-H 'Authorization: Bearer <YOUR_JWT_HERE>' \
-H 'Content-Type: application/json' \
-d '{
"pageSize": 1,
"where": {
"_and": [
{
"_or": [
{
"invoiceNumber": {
"_ilike": "%2024%"
}
},
{
"description": {
"_ilike": "%service%"
}
}
]
},
{
"status": {
"_in": [
"POSTED",
"CLOSED"
]
}
},
{
"createdAt": {
"_gte": "1900-01-01T00:00:00Z"
}
},
{
"dueDate": {
"_gte": "2024-01-01T00:00:00Z"
}
}
]
},
"orderBy": [
{
"invoiceNumber": "asc"
},
{
"createdAt": "desc"
}
]
}'Response
{ "invoices": [ { … } ], "total": { "aggregate": { … } } }