Developers
Start building
AI/Tool reference/Channels/Feed rules

Feed rules

The 14 tools of the Feed rules toolset in the Channels area, with their permissions, approval rules and inputs.

On this page

Toolset feed_rules, 14 tools.

Records

feed_rule

A rule that leaves out, changes or labels products on feeds: store-wide, or one feed's own. List shows the store-wide rules, or with feed_id the rules that feed runs. Get returns the rule with every saved version, newest first (version numbers for restore).

  • Permission: feeds.read
  • Tools: feed_rule_list, feed_rule_get

Filters on the list:

FilterTypeRequiredDescription
feed_idstringOnly the rules this feed runs, store-wide ones first. 1 to 64 characters

feed_rule_catalog

What a rule can use in this store: field paths with types and names, attribute and option keys, operators, formula functions, ready-made rules (templates) with their parameters, label slots, the sites' own conditions and steps, swap tables, currencies and the store time zone. Pass a feed ID, or "store" for the store-wide catalog. A rule is either a ready-made template with its values, or a whole document. Read feed_rule_catalog_get for the template ids with their parameters, the fields, operators and functions a document can use; find keys, values, categories, brands and swap tables with feed_rule_catalog_search_list.

  • Permission: feeds.read
  • Tools: feed_rule_catalog_get

Look up what a rule can name when the catalog lists only part of it: fields by English or Hungarian name, attribute and option keys and values, categories, collections, tags, brands and swap tables, by words in any case or accents. value is what the rule writes (a field path, a key, a value, a category or collection id, a table name). List only.

  • Permission: feeds.read
  • Tools: feed_rule_catalog_search_list

Filters on the list:

FilterTypeRequiredDescription
qstringWords to find. at most 200 characters
kindslist of stringOnly these kinds of thing, as the catalog names them
keystringAttribute or option key, to list its values
feed_idstring1 to 64 characters

feed_rule_stats

Per rule: the products it matches, leaves out and changes, on one feed or summed over all. Pass a feed ID, or "all".

  • Permission: feeds.read
  • Tools: feed_rule_stats_get

feed_rule_trace

Why one variant is or is not on a feed, rule by rule: each rule that matched and what it did. Get takes <feed id>/<variant id>.

  • Permission: feeds.read
  • Tools: feed_rule_trace_get

Actions

feed_rule_create

Create a feed rule and switch it on, after previewing what it does.

A dry run previews it: products left out, added and changed per feed, samples and site problems, and saves nothing. Run it after the merchant has seen the preview. Rules change what comparison sites and marketplaces receive. A rule is either a ready-made template with its values, or a whole document. Read feed_rule_catalog_get for the template ids with their parameters, the fields, operators and functions a document can use; find keys, values, categories, brands and swap tables with feed_rule_catalog_search_list.

  • Action key: feed_rule.create
  • Permission: feeds.write
  • Approval: Always waits for a person to approve it.
  • Effect: Changes the live store.
  • Retries: runs at most once; a repeat with the same idempotency key returns the first result.
  • Dry run: supported, with dry_run set to true.
FieldTypeRequiredDescription
namestringyes1 to 120 characters
scopestringyesstore: every feed it applies to; feed: one feed's own rule. one of "store", "feed"
feed_idstring or nullyesThe feed for scope feed, otherwise null. 1 to 64 characters
ruleobject, one shape of:yes
rule[kind=template].kindstringyesalways "template"
rule[kind=template].templateobjectyes
rule[kind=template].template.idstringyes
rule[kind=template].template.paramsmap of string or number or boolean or nullyes
rule[kind=template].onmap of string or number or boolean or list of any value or map of any value or nullWhere it applies: { feeds, markets, languages, kinds }, each "*" or a list
rule[kind=template].currencystring or nullThe currency of the template's amounts; the rule then runs only on feeds in it
rule[kind=document].kindstringyesalways "document"
rule[kind=document].documentmap of string or number or boolean or list of any value or map of any value or nullyesThe rule document: { when: <condition>, then: [<step>, ...] } with conditions and steps built from the fields, operators and functions of feed_rule_catalog_get. The store validates it exactly as the admin rule builder does and names the first thing wrong.
schedulemap of string or number or boolean or list of any value or map of any value or null or nullyesnull runs always. Otherwise { kind: "always" } | { kind: "dates", from, until, timezone } | { kind: "weekdays", days: [1..7], ... }
notestring or nullat most 500 characters
enabledbooleanDefault true

Example input:

{
  "name": "Hide cheap products",
  "scope": "store",
  "feed_id": null,
  "rule": {
    "kind": "template",
    "template": {
      "id": "exclude_cheap_products",
      "params": {
        "below": 500
      }
    }
  },
  "schedule": null
}

feed_rule_delete

Delete a feed rule for good; feed_rule_set_enabled keeps it to switch on later.

  • Action key: feed_rule.delete
  • Permission: feeds.write
  • Approval: Always waits for a person to approve it.
  • Effect: Changes the live store.
  • Destructive: in compact mode it runs with run_destructive_action.
  • Retries: safe to repeat with the same input.
FieldTypeRequiredDescription
rule_idstringyesFeed rule ID. 1 to 64 characters
expected_versionintegeryesThe rule version as read from feed_rule_get. at least 1

Example input:

{
  "rule_id": "019bb2ab-6d1c-7f3d-823d-17d50169da8f",
  "expected_version": 2
}

feed_rule_reorder

Put the rules of one list in a new order: the store-wide rules, or one feed's own.

ids are every rule of that list exactly once, first run first. expected_order is the order as read, so a list changed meanwhile refuses the save.

  • Action key: feed_rule.reorder
  • Permission: feeds.write
  • Approval: Always waits for a person to approve it.
  • Effect: Changes the live store.
  • Retries: safe to repeat with the same input.
FieldTypeRequiredDescription
scopestringyesstore: every feed it applies to; feed: one feed's own rule. one of "store", "feed"
feed_idstring or nullyes1 to 64 characters
idslist of stringyesat most 500 items. 1 to 64 characters
expected_orderlist of stringyesat most 500 items. 1 to 64 characters

Example input:

{
  "scope": "store",
  "feed_id": null,
  "ids": [
    "019bb2ae-6061-7f9f-8981-f9913ad51dc8",
    "019bb2a8-9b08-7da0-bb68-72c1eaeec333"
  ],
  "expected_order": [
    "019bb2a8-9b08-7da0-bb68-72c1eaeec333",
    "019bb2ae-6061-7f9f-8981-f9913ad51dc8"
  ]
}

feed_rule_restore

Bring an earlier version of a feed rule back as the newest.

  • Action key: feed_rule.restore
  • Permission: feeds.write
  • Approval: Always waits for a person to approve it.
  • Effect: Changes the live store.
  • Retries: safe to repeat with the same input.
FieldTypeRequiredDescription
rule_idstringyesFeed rule ID. 1 to 64 characters
versionintegeryesThe earlier version to bring back. at least 1
expected_versionintegeryesThe rule version as read from feed_rule_get. at least 1

Example input:

{
  "rule_id": "019bb2ab-6d1c-7f3d-823d-17d50169da8f",
  "version": 1,
  "expected_version": 3
}

feed_rule_set_enabled

Switch a saved feed rule on, or off without deleting it; the feeds it applies to rebuild.

  • Action key: feed_rule.set_enabled
  • Permission: feeds.write
  • Approval: Always waits for a person to approve it.
  • Effect: Changes the live store.
  • Retries: safe to repeat with the same input.
FieldTypeRequiredDescription
rule_idstringyesFeed rule ID. 1 to 64 characters
enabledbooleanyes
expected_versionintegeryesThe rule version as read from feed_rule_get. at least 1

Example input:

{
  "rule_id": "019bb2ab-6d1c-7f3d-823d-17d50169da8f",
  "enabled": false,
  "expected_version": 2
}

feed_rule_suggest

Three rules worth setting up for the merchant's words, best first, each complete and counted.

The store finds ideas in its own data and a model adds some, each named and explained in the merchant's language. Pass every idea already offered in offered so none repeats. Saves nothing; create the chosen one with feed_rule_create.

  • Action key: feed_rule.suggest
  • Permission: feeds.read
  • Approval: Runs without approval.
  • Effect: Reads only.
  • Retries: safe to repeat with the same input.
FieldTypeRequiredDescription
textstringyesThe merchant's words. 1 to 500 characters
localestringyesone of "en", "hu"
feed_idstring or null1 to 64 characters
offeredlist of objectIdeas offered so far, each with the key and name this action returned. at most 20 items
offered[].keystringyesat least 1 characters
offered[].namestringyesat least 1 characters

Example input:

{
  "text": "hide products without a barcode",
  "locale": "en"
}

feed_rule_test

Run up to 20 products through one feed's rules, optionally with a draft rule in place, and see each step.

Test mode: shows each rule step and what the site would get for every variant. Nothing is saved. draft is the rule as it would be (same shape as a rule preview); null tests the saved rules.

  • Action key: feed_rule.test
  • Permission: feeds.read
  • Approval: Runs without approval.
  • Effect: Reads only.
  • Retries: safe to repeat with the same input.
FieldTypeRequiredDescription
feed_idstringyes1 to 64 characters
variant_idslist of stringyes1 to 20 items. at least 1 characters
draftobject or null
draft.rule_idstring or nullyesnull for a new rule. 1 to 64 characters
draft.scopestringyesstore: every feed it applies to; feed: one feed's own rule. one of "store", "feed"
draft.feed_idstring or nullyes1 to 64 characters
draft.ruleobject, one shape of: or nullyesnull keeps the saved rule's document (only with rule_id)
draft.rule[kind=template].kindstringyesalways "template"
draft.rule[kind=template].templateobjectyes
draft.rule[kind=template].template.idstringyes
draft.rule[kind=template].template.paramsmap of string or number or boolean or nullyes
draft.rule[kind=template].onmap of string or number or boolean or list of any value or map of any value or nullWhere it applies: { feeds, markets, languages, kinds }, each "*" or a list
draft.rule[kind=template].currencystring or nullThe currency of the template's amounts; the rule then runs only on feeds in it
draft.rule[kind=document].kindstringyesalways "document"
draft.rule[kind=document].documentmap of string or number or boolean or list of any value or map of any value or nullyesThe rule document: { when: <condition>, then: [<step>, ...] } with conditions and steps built from the fields, operators and functions of feed_rule_catalog_get. The store validates it exactly as the admin rule builder does and names the first thing wrong.
draft.schedulemap of string or number or boolean or list of any value or map of any value or null or nullyesnull runs always. Otherwise { kind: "always" } | { kind: "dates", from, until, timezone } | { kind: "weekdays", days: [1..7], ... }
draft.enabledbooleanyes

Example input:

{
  "feed_id": "019bb295-753c-7642-bb09-0ac0eda0f41b",
  "variant_ids": [
    "019bb7f3-10ac-7f8b-b47e-f5cd71dff2e1"
  ]
}

feed_rule_update

Save a change to a feed rule as its next version, after previewing it.

Only the parts named are replaced (name, rule, schedule). A dry run previews the change per feed and saves nothing; a rename alone needs no preview. expected_version is the version as read from feed_rule_get: a newer one saved meanwhile refuses the change.

  • Action key: feed_rule.update
  • Permission: feeds.write
  • Approval: Always waits for a person to approve it.
  • Effect: Changes the live store.
  • Retries: safe to repeat with the same input.
  • Dry run: supported, with dry_run set to true.
FieldTypeRequiredDescription
rule_idstringyesFeed rule ID. 1 to 64 characters
expected_versionintegeryesThe rule version as read from feed_rule_get. at least 1
namestring1 to 120 characters
ruleobject, one shape of:
rule[kind=template].kindstringyesalways "template"
rule[kind=template].templateobjectyes
rule[kind=template].template.idstringyes
rule[kind=template].template.paramsmap of string or number or boolean or nullyes
rule[kind=template].onmap of string or number or boolean or list of any value or map of any value or nullWhere it applies: { feeds, markets, languages, kinds }, each "*" or a list
rule[kind=template].currencystring or nullThe currency of the template's amounts; the rule then runs only on feeds in it
rule[kind=document].kindstringyesalways "document"
rule[kind=document].documentmap of string or number or boolean or list of any value or map of any value or nullyesThe rule document: { when: <condition>, then: [<step>, ...] } with conditions and steps built from the fields, operators and functions of feed_rule_catalog_get. The store validates it exactly as the admin rule builder does and names the first thing wrong.
schedulemap of string or number or boolean or list of any value or map of any value or null or nullnull runs always. Otherwise { kind: "always" } | { kind: "dates", from, until, timezone } | { kind: "weekdays", days: [1..7], ... }
notestring or nullat most 500 characters

Example input:

{
  "rule_id": "019bb2ab-6d1c-7f3d-823d-17d50169da8f",
  "expected_version": 2,
  "rule": {
    "kind": "template",
    "template": {
      "id": "exclude_cheap_products",
      "params": {
        "below": 500
      }
    }
  }
}
Last updated