Add or remove promocode objects
manage_promocode_objectsAttach or remove product variants, categories, or collections from a promocode. Choose either variant IDs or category/collection IDs per request to update eligibility.
Instructions
Attach objects to a promocode or detach them. Supported object types: product_variant_ids (variant UUIDs), category_ids (category UUIDs), collection_ids (collection UUIDs). Per request pass EITHER product_variant_ids OR categories/collections — the API does not mix variants with categories/collections.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"id": "<id>",
"action": "<action>",
"objects": "<objects>"
},
"name": "manage_promocode_objects"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | Promocode ID (UUID). | |
| action | Yes | Whether to attach or detach the objects. | |
| objects | Yes | PromocodeObjects record: arrays product_variant_ids, category_ids and/or collection_ids (see get_operation_schema("AddPromocodeObjects")). |