Search.../
  1. Home
  2. Getting Started
  3. Overview
Generate a test token to explore our APIs

Filter and sort

Query Language

Endpoints that allow querying follow these format guidelines.

Fields That Allow Filtering

FieldOperatorsSorting Allowed
id$eq,$ne,$hasSome,$contains,$startsWithAllowed
dateCreated$eq,$ne,$hasSome,$lt,$lte,$gt,$gteAllowed
expired$eq,$ne
specification.active$eq,$ne
specification.name$eq,$ne,$hasSome,$contains,$startsWithAllowed
specification.code$eq,$ne,$hasSome,$contains,$startsWithAllowed
specification.usageLimit$eq,$ne,$hasSome,$contains,$startsWithAllowed
specification.limitedToOneItem$eq,$ne
scope.namespace$eq,$ne,$hasSome,$contains,$startsWithAllowed
scope.group.name$eq,$ne,$hasSome,$contains,$startsWithAllowed
scope.group.entityId$eq,$ne,$hasSome,$contains,$startsWithAllowed

** Note that "HasSome" is same as the operator "IN" in SQL

Examples

Query valid (i.e., non-expired) coupons

curl 'https://www.wixapis.com/stores/v2/coupons/query' --data-binary '{"query":{"filter":"{\"expired\": false}"}}' -H 'Content-Type: application/json' -H 'Authorization: XXX'
Copy Code

Get all coupons, sorted by creation date

curl 'https://www.wixapis.com/stores/v2/coupons/query' --data-binary '{"query":{"sort":"[{\"dateCreated\": \"asc\"}]"}}' -H 'Content-Type: application/json' -H 'Authorization: XXX'
Copy Code

Get coupons by IDs

curl 'https://www.wixapis.com/stores/v2/coupons/query' --data-binary '{"query":{"filter":"{\"id\": {\"$hasSome\": [\"COUPON_ID_1\",\"COUPON_ID_2\"]}}"}}' -H 'Content-Type: application/json' -H 'Authorization: xxx'
Copy Code

Was this helpful?