ESTAGE Support
IdeasMy tickets

How many active products a rule set would match

Permission collections:readRate limit writesIdempotent with Idempotency-Key

Dry run of a rule set: how many active products it matches and up to 5 of their names (alphabetical). Nothing is saved.

POSThttps://api.estage.com/v1/collections/preview-rules

Authorization

ESTAGE-API-Keystringheaderrequired

A project key, est_live_…, from Settings → API keys. Call from server code only.

Body

application/json
rulesarray of objectrequired≤ 50 items

1–50 rules.

Show 3 fields
fieldstringrequired≤ 96 chars

title, product_type, vendor, price, compare_at_price, weight, inventory_total, variant_title, or attribute:<key>.

relationstringrequired

One of equals, not_equals, contains, not_contains, starts_with, ends_with, greater_than, less_than, is_set, is_not_set

valueanynullable

Required except for is_set / is_not_set.

rules_matchstringdefault "all"

One of all, any

Headers

Idempotency-Keystring≤ 255 chars

Any unique string per attempt. A retry with the same key gets the first answer back instead of doing the work twice.

RequestcURL
curl --request POST \
  --url 'https://api.estage.com/v1/collections/preview-rules' \
  --header 'ESTAGE-API-Key: est_live_your-api-key' \
  --header 'Content-Type: application/json' \
  --header 'Idempotency-Key: your-unique-key' \
  --data '{
    "rules": [
      {
        "field": "price",
        "relation": "less_than",
        "value": 30
      }
    ],
    "rules_match": "all"
  }'
OK
{
  "data": {
    "count": 2,
    "sample": [
      "Classic Tee",
      "Logo Cap"
    ]
  }
}
Example. Errors are { error: { code, message, details } }.