set_category_mapping
Map store categories to marketplace/taxonomy categories. Address the taxonomy by feed_id OR explicitly by taxonomy_code (+ optional taxonomy_locale). rules is a list of {store_category_ids:[...], target_hash} — each maps those store categories (ids from list_store_categories / list_unmapped_categories) to one target (hash from search_target_categories); a store category already mapped is re-pointed to the new target. The rule set is SHARED per project+taxonomy+locale, so if OTHER feeds use this taxonomy the call returns status=mapping_exists_requires_confirm (HTTP 409) with affectedFeedIds — re-call with confirm:true to apply. SAVE-ONLY: persists but does NOT regenerate — call export_feed afterwards. Returns {taxonomyCode, taxonomyLocale, status, rulesWritten, reason, affectedFeedIds}; status is 'updated' | 'no_changes' | 'mapping_exists_requires_confirm' | 'rejected' (reason: no_taxonomy | unknown_target | unknown_store_category | empty_rules). project_id is OPTIONAL (inferred for a single-project customer).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| rules | Yes | ||
| confirm | No | Set true to apply when other feeds share this taxonomy (status=mapping_exists_requires_confirm); default false. | |
| feed_id | No | ||
| project_id | No | ||
| taxonomy_code | No | Target taxonomy id (e.g. 'google'); alternative to feed_id for addressing the taxonomy. | |
| taxonomy_locale | No | Locale of the taxonomy tree, e.g. 'en_GB' — defaults to the taxonomy's own default when omitted. |