What I’m trying to do
Return results that are sorted / filtered by field
**What I’ve tried so far
// this query works as expected**
import { elevate } from "wix-auth";import { coupons as c } from "wix-marketing.v2";
export async function get_coupons_v2(){
const query = {
"paging": {
"limit": 50,
"offset": 0}
}
const el = elevate(c.queryCoupons)
const result = await el(query)
return result
// adding different variations based on
// API Query Language
// leads to errors like
message: Unexpected value for StringValue details: applicationError: description: Bad Request code: BAD_REQUEST data: {}
Not sortable: active, expired, type, limitedToOneItem, appliesToSubscriptions. scope is neither filterable nor sortable.
active and expired are filterable with eq and ne only — no hasSome, no ranges.
Second thing: your error names StringValue, which is a type complaint, not a structure complaint. active and expired are booleans. Passing “true” as a string instead of true will throw exactly this. Same for numeric fields passed as strings.
Isolate it — run filter with no sort, then sort with no filter. That tells you which half is rejected in one pass instead of guessing at the shape.
If you’re hitting this on a field not listed above, that field doesn’t support query operations. Check your query against the sortable list first — one non-sortable field anywhere in the chain throws the entire request.