Предметные инструменты · catalog
Скидки и купоны · изменения
catalog_site_catalog_discounts_m155_writeИзменениеВключить или выключить скидку · Создать скидку на выбранные товары · Включить или выключить купон.
Действия
В tools/call передайте имя инструмента, значение action и параметры действия во вложенном объекте arguments.
Меняет только активность проверяемого правила и сохраняет ограничения. После записи проверяет штатное состояние.
discount_id- целое число · обязательный параметр
active- логическое значение · обязательный параметр
confirm- логическое значение · обязательный параметр
Подтвердите выбранные товары и изменение: true.
{
"type": "object",
"properties": {
"discount_id": {
"type": "integer",
"minimum": 1,
"maximum": 2147483647
},
"active": {
"type": "boolean"
},
"confirm": {
"type": "boolean",
"description": "Подтвердите выбранные товары и изменение: true."
}
},
"required": [
"discount_id",
"active",
"confirm"
],
"additionalProperties": false
}Создаёт правило только для перечисленных товаров. Требуются штатное право изменения скидок и право изменения каждого товара. Группы и типы цен необязательны; пустые списки означают все.
fields- объект · обязательный параметр
product_ids- массив · обязательный параметр
user_group_ids- массив
price_type_ids- массив
confirm- логическое значение · обязательный параметр
Подтвердите выбранные товары и изменение: true.
{
"type": "object",
"properties": {
"fields": {
"type": "object",
"properties": {
"name": {
"type": "string",
"maxLength": 255,
"minLength": 1
},
"active": {
"type": "boolean"
},
"site_id": {
"type": "string",
"minLength": 1,
"maxLength": 2,
"pattern": "^[A-Za-z0-9]{1,2}$"
},
"currency": {
"type": "string",
"minLength": 3,
"maxLength": 3,
"pattern": "^[A-Z]{3}$"
},
"value": {
"type": "number",
"maximum": 1000000000,
"exclusiveMinimum": 0
},
"value_type": {
"type": "string",
"enum": [
"P",
"F",
"S"
],
"description": "P — процент; F — сумма скидки; S — установленная цена."
},
"sort": {
"type": "integer",
"minimum": 1,
"maximum": 1000000
},
"priority": {
"type": "integer",
"minimum": 1,
"maximum": 1000000
},
"last_discount": {
"type": "boolean"
},
"renewal": {
"type": "boolean"
},
"max_uses": {
"type": "integer",
"minimum": 0,
"maximum": 1000000000
},
"max_discount": {
"type": "number",
"minimum": 0,
"maximum": 1000000000
},
"min_order_sum": {
"type": "number",
"minimum": 0,
"maximum": 1000000000
},
"active_from": {
"type": [
"string",
"null"
],
"pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2}:[0-9]{2}$",
"minLength": 19,
"maxLength": 19,
"description": "Дата и время сайта: 2026-10-04 12:00:00. null снимает границу периода."
},
"active_to": {
"type": [
"string",
"null"
],
"pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2}:[0-9]{2}$",
"minLength": 19,
"maxLength": 19,
"description": "Дата и время сайта: 2026-10-04 12:00:00. null снимает границу периода."
},
"xml_id": {
"type": "string",
"maxLength": 255,
"minLength": 0
},
"notes": {
"type": "string",
"maxLength": 2000,
"minLength": 0
}
},
"required": [
"name",
"site_id",
"currency",
"value",
"value_type"
],
"additionalProperties": false,
"minProperties": 1
},
"product_ids": {
"type": "array",
"maxItems": 100,
"uniqueItems": true,
"items": {
"type": "integer",
"minimum": 1,
"maximum": 2147483647
},
"minItems": 1
},
"user_group_ids": {
"type": "array",
"maxItems": 100,
"uniqueItems": true,
"items": {
"type": "integer",
"minimum": 1,
"maximum": 2147483647
}
},
"price_type_ids": {
"type": "array",
"maxItems": 100,
"uniqueItems": true,
"items": {
"type": "integer",
"minimum": 1,
"maximum": 2147483647
}
},
"confirm": {
"type": "boolean",
"description": "Подтвердите выбранные товары и изменение: true."
}
},
"required": [
"fields",
"product_ids",
"confirm"
],
"additionalProperties": false
}Изменяет активность купона без смены скидки и истории применения.
discount_id- целое число · обязательный параметр
coupon_id- целое число · обязательный параметр
active- логическое значение · обязательный параметр
confirm- логическое значение · обязательный параметр
Подтвердите выбранные товары и изменение: true.
{
"type": "object",
"properties": {
"discount_id": {
"type": "integer",
"minimum": 1,
"maximum": 2147483647
},
"coupon_id": {
"type": "integer",
"minimum": 1,
"maximum": 2147483647
},
"active": {
"type": "boolean"
},
"confirm": {
"type": "boolean",
"description": "Подтвердите выбранные товары и изменение: true."
}
},
"required": [
"discount_id",
"coupon_id",
"active",
"confirm"
],
"additionalProperties": false
}Код можно не задавать: создаётся случайный. Скидка должна быть проверяемым правилом; добавление купона переводит её в режим применения по купонам.
discount_id- целое число · обязательный параметр
fields- объект
confirm- логическое значение · обязательный параметр
Подтвердите выбранные товары и изменение: true.
{
"type": "object",
"properties": {
"discount_id": {
"type": "integer",
"minimum": 1,
"maximum": 2147483647
},
"fields": {
"type": "object",
"properties": {
"active": {
"type": "boolean"
},
"code": {
"type": "string",
"minLength": 1,
"maxLength": 32,
"pattern": "^[A-Za-z0-9_-]{1,32}$",
"description": "Код до 32 латинских букв, цифр, дефисов и подчёркиваний. Для нового купона код можно не задавать."
},
"type": {
"type": "string",
"enum": [
"Y",
"O",
"N"
],
"description": "Y — одна позиция заказа; O — один заказ; N — многоразовый."
},
"description": {
"type": "string",
"maxLength": 2000,
"minLength": 0
}
},
"required": [],
"additionalProperties": false,
"minProperties": 1
},
"confirm": {
"type": "boolean",
"description": "Подтвердите выбранные товары и изменение: true."
}
},
"required": [
"discount_id",
"confirm"
],
"additionalProperties": false
}Удаление последнего купона выключает режим купонов у скидки. Принадлежность и результат проверяются штатным API.
discount_id- целое число · обязательный параметр
coupon_id- целое число · обязательный параметр
confirm- логическое значение · обязательный параметр
Подтвердите выбранные товары и изменение: true.
{
"type": "object",
"properties": {
"discount_id": {
"type": "integer",
"minimum": 1,
"maximum": 2147483647
},
"coupon_id": {
"type": "integer",
"minimum": 1,
"maximum": 2147483647
},
"confirm": {
"type": "boolean",
"description": "Подтвердите выбранные товары и изменение: true."
}
},
"required": [
"discount_id",
"coupon_id",
"confirm"
],
"additionalProperties": false
}Удаляет только купоны выбранной скидки и проверяет, что режим купонов выключен. Другие скидки не изменяются.
discount_id- целое число · обязательный параметр
confirm- логическое значение · обязательный параметр
Подтвердите выбранные товары и изменение: true.
{
"type": "object",
"properties": {
"discount_id": {
"type": "integer",
"minimum": 1,
"maximum": 2147483647
},
"confirm": {
"type": "boolean",
"description": "Подтвердите выбранные товары и изменение: true."
}
},
"required": [
"discount_id",
"confirm"
],
"additionalProperties": false
}Изменяет только переданные поля. Принадлежность скидке и история использования сохраняются; сброс даты применения не поддерживается.
discount_id- целое число · обязательный параметр
coupon_id- целое число · обязательный параметр
fields- объект · обязательный параметр
confirm- логическое значение · обязательный параметр
Подтвердите выбранные товары и изменение: true.
{
"type": "object",
"properties": {
"discount_id": {
"type": "integer",
"minimum": 1,
"maximum": 2147483647
},
"coupon_id": {
"type": "integer",
"minimum": 1,
"maximum": 2147483647
},
"fields": {
"type": "object",
"properties": {
"active": {
"type": "boolean"
},
"code": {
"type": "string",
"minLength": 1,
"maxLength": 32,
"pattern": "^[A-Za-z0-9_-]{1,32}$",
"description": "Код до 32 латинских букв, цифр, дефисов и подчёркиваний. Для нового купона код можно не задавать."
},
"type": {
"type": "string",
"enum": [
"Y",
"O",
"N"
],
"description": "Y — одна позиция заказа; O — один заказ; N — многоразовый."
},
"description": {
"type": "string",
"maxLength": 2000,
"minLength": 0
}
},
"required": [],
"additionalProperties": false,
"minProperties": 1
},
"confirm": {
"type": "boolean",
"description": "Подтвердите выбранные товары и изменение: true."
}
},
"required": [
"discount_id",
"coupon_id",
"fields",
"confirm"
],
"additionalProperties": false
}Меняет активность с сохранением сроков, порогов и групп покупателей.
discount_id- целое число · обязательный параметр
active- логическое значение · обязательный параметр
confirm- логическое значение · обязательный параметр
Подтвердите выбранные товары и изменение: true.
{
"type": "object",
"properties": {
"discount_id": {
"type": "integer",
"minimum": 1,
"maximum": 2147483647
},
"active": {
"type": "boolean"
},
"confirm": {
"type": "boolean",
"description": "Подтвердите выбранные товары и изменение: true."
}
},
"required": [
"discount_id",
"active",
"confirm"
],
"additionalProperties": false
}Создаёт правило с порогами и выбранными группами покупателей. Персональные покупки не пересчитываются; группы пользователей не изменяются.
fields- объект · обязательный параметр
ranges- массив · обязательный параметр
user_group_ids- массив · обязательный параметр
confirm- логическое значение · обязательный параметр
Подтвердите выбранные товары и изменение: true.
{
"type": "object",
"properties": {
"fields": {
"type": "object",
"properties": {
"name": {
"type": "string",
"maxLength": 255,
"minLength": 1
},
"site_id": {
"type": "string",
"minLength": 1,
"maxLength": 2,
"pattern": "^[A-Za-z0-9]{1,2}$"
},
"currency": {
"type": "string",
"minLength": 3,
"maxLength": 3,
"pattern": "^[A-Z]{3}$"
},
"active": {
"type": "boolean"
},
"sort": {
"type": "integer",
"minimum": 1,
"maximum": 1000000
},
"xml_id": {
"type": "string",
"maxLength": 255,
"minLength": 0
},
"active_from": {
"type": [
"string",
"null"
],
"pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2}:[0-9]{2}$",
"minLength": 19,
"maxLength": 19,
"description": "Дата и время сайта: 2026-10-04 12:00:00. null снимает границу периода."
},
"active_to": {
"type": [
"string",
"null"
],
"pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2}:[0-9]{2}$",
"minLength": 19,
"maxLength": 19,
"description": "Дата и время сайта: 2026-10-04 12:00:00. null снимает границу периода."
},
"count_size": {
"type": "integer",
"minimum": 0,
"maximum": 1000000
},
"count_type": {
"type": "string",
"enum": [
"D",
"M",
"Y"
],
"description": "D — дни; M — месяцы; Y — годы."
},
"count_from": {
"type": [
"string",
"null"
],
"pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2}:[0-9]{2}$",
"minLength": 19,
"maxLength": 19,
"description": "Дата и время сайта: 2026-10-04 12:00:00. null снимает границу периода."
},
"count_to": {
"type": [
"string",
"null"
],
"pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2}:[0-9]{2}$",
"minLength": 19,
"maxLength": 19,
"description": "Дата и время сайта: 2026-10-04 12:00:00. null снимает границу периода."
},
"action_size": {
"type": "integer",
"minimum": 0,
"maximum": 1000000
},
"action_type": {
"type": "string",
"enum": [
"D",
"M",
"Y"
],
"description": "D — дни; M — месяцы; Y — годы."
}
},
"required": [
"name",
"site_id",
"currency"
],
"additionalProperties": false,
"minProperties": 1
},
"ranges": {
"type": "array",
"minItems": 1,
"maxItems": 100,
"items": {
"type": "object",
"properties": {
"from": {
"type": "number",
"minimum": 0,
"maximum": 1000000000
},
"value": {
"type": "number",
"maximum": 1000000000,
"exclusiveMinimum": 0
},
"type": {
"type": "string",
"enum": [
"P",
"F"
]
}
},
"required": [
"from",
"value",
"type"
],
"additionalProperties": false,
"minProperties": 1
}
},
"user_group_ids": {
"type": "array",
"maxItems": 100,
"uniqueItems": true,
"items": {
"type": "integer",
"minimum": 1,
"maximum": 2147483647
},
"minItems": 1
},
"confirm": {
"type": "boolean",
"description": "Подтвердите выбранные товары и изменение: true."
}
},
"required": [
"fields",
"ranges",
"user_group_ids",
"confirm"
],
"additionalProperties": false
}Штатно удаляет правило, его пороги, привязки групп и сохранённые персональные пороги. Подтвердите удаление выбранного правила.
discount_id- целое число · обязательный параметр
confirm- логическое значение · обязательный параметр
Подтвердите выбранные товары и изменение: true.
{
"type": "object",
"properties": {
"discount_id": {
"type": "integer",
"minimum": 1,
"maximum": 2147483647
},
"confirm": {
"type": "boolean",
"description": "Подтвердите выбранные товары и изменение: true."
}
},
"required": [
"discount_id",
"confirm"
],
"additionalProperties": false
}Сохраняет остальные поля, включая период накопления. ranges и user_group_ids заменяют соответствующие списки целиком. Пересчёт покупок не выполняется.
discount_id- целое число · обязательный параметр
fields- объект
ranges- массив
user_group_ids- массив
confirm- логическое значение · обязательный параметр
Подтвердите выбранные товары и изменение: true.
{
"type": "object",
"properties": {
"discount_id": {
"type": "integer",
"minimum": 1,
"maximum": 2147483647
},
"fields": {
"type": "object",
"properties": {
"name": {
"type": "string",
"maxLength": 255,
"minLength": 1
},
"site_id": {
"type": "string",
"minLength": 1,
"maxLength": 2,
"pattern": "^[A-Za-z0-9]{1,2}$"
},
"currency": {
"type": "string",
"minLength": 3,
"maxLength": 3,
"pattern": "^[A-Z]{3}$"
},
"active": {
"type": "boolean"
},
"sort": {
"type": "integer",
"minimum": 1,
"maximum": 1000000
},
"xml_id": {
"type": "string",
"maxLength": 255,
"minLength": 0
},
"active_from": {
"type": [
"string",
"null"
],
"pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2}:[0-9]{2}$",
"minLength": 19,
"maxLength": 19,
"description": "Дата и время сайта: 2026-10-04 12:00:00. null снимает границу периода."
},
"active_to": {
"type": [
"string",
"null"
],
"pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2}:[0-9]{2}$",
"minLength": 19,
"maxLength": 19,
"description": "Дата и время сайта: 2026-10-04 12:00:00. null снимает границу периода."
},
"count_size": {
"type": "integer",
"minimum": 0,
"maximum": 1000000
},
"count_type": {
"type": "string",
"enum": [
"D",
"M",
"Y"
],
"description": "D — дни; M — месяцы; Y — годы."
},
"count_from": {
"type": [
"string",
"null"
],
"pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2}:[0-9]{2}$",
"minLength": 19,
"maxLength": 19,
"description": "Дата и время сайта: 2026-10-04 12:00:00. null снимает границу периода."
},
"count_to": {
"type": [
"string",
"null"
],
"pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2}:[0-9]{2}$",
"minLength": 19,
"maxLength": 19,
"description": "Дата и время сайта: 2026-10-04 12:00:00. null снимает границу периода."
},
"action_size": {
"type": "integer",
"minimum": 0,
"maximum": 1000000
},
"action_type": {
"type": "string",
"enum": [
"D",
"M",
"Y"
],
"description": "D — дни; M — месяцы; Y — годы."
}
},
"required": [],
"additionalProperties": false,
"minProperties": 1
},
"ranges": {
"type": "array",
"minItems": 1,
"maxItems": 100,
"items": {
"type": "object",
"properties": {
"from": {
"type": "number",
"minimum": 0,
"maximum": 1000000000
},
"value": {
"type": "number",
"maximum": 1000000000,
"exclusiveMinimum": 0
},
"type": {
"type": "string",
"enum": [
"P",
"F"
]
}
},
"required": [
"from",
"value",
"type"
],
"additionalProperties": false,
"minProperties": 1
}
},
"user_group_ids": {
"type": "array",
"maxItems": 100,
"uniqueItems": true,
"items": {
"type": "integer",
"minimum": 1,
"maximum": 2147483647
},
"minItems": 1
},
"confirm": {
"type": "boolean",
"description": "Подтвердите выбранные товары и изменение: true."
}
},
"required": [
"discount_id",
"confirm"
],
"additionalProperties": false
}Удаляет проверяемое правило и все привязанные купоны штатным методом. Проверьте выбранную скидку перед подтверждением.
discount_id- целое число · обязательный параметр
confirm- логическое значение · обязательный параметр
Подтвердите выбранные товары и изменение: true.
{
"type": "object",
"properties": {
"discount_id": {
"type": "integer",
"minimum": 1,
"maximum": 2147483647
},
"confirm": {
"type": "boolean",
"description": "Подтвердите выбранные товары и изменение: true."
}
},
"required": [
"discount_id",
"confirm"
],
"additionalProperties": false
}Указанные поля изменяются, остальные сохраняются. product_ids полностью заменяет набор товаров. До записи проверяются старые и новые товары; сложные условия требуют штатного редактора.
discount_id- целое число · обязательный параметр
fields- объект
product_ids- массив
user_group_ids- массив
price_type_ids- массив
confirm- логическое значение · обязательный параметр
Подтвердите выбранные товары и изменение: true.
{
"type": "object",
"properties": {
"discount_id": {
"type": "integer",
"minimum": 1,
"maximum": 2147483647
},
"fields": {
"type": "object",
"properties": {
"name": {
"type": "string",
"maxLength": 255,
"minLength": 1
},
"active": {
"type": "boolean"
},
"site_id": {
"type": "string",
"minLength": 1,
"maxLength": 2,
"pattern": "^[A-Za-z0-9]{1,2}$"
},
"currency": {
"type": "string",
"minLength": 3,
"maxLength": 3,
"pattern": "^[A-Z]{3}$"
},
"value": {
"type": "number",
"maximum": 1000000000,
"exclusiveMinimum": 0
},
"value_type": {
"type": "string",
"enum": [
"P",
"F",
"S"
],
"description": "P — процент; F — сумма скидки; S — установленная цена."
},
"sort": {
"type": "integer",
"minimum": 1,
"maximum": 1000000
},
"priority": {
"type": "integer",
"minimum": 1,
"maximum": 1000000
},
"last_discount": {
"type": "boolean"
},
"renewal": {
"type": "boolean"
},
"max_uses": {
"type": "integer",
"minimum": 0,
"maximum": 1000000000
},
"max_discount": {
"type": "number",
"minimum": 0,
"maximum": 1000000000
},
"min_order_sum": {
"type": "number",
"minimum": 0,
"maximum": 1000000000
},
"active_from": {
"type": [
"string",
"null"
],
"pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2}:[0-9]{2}$",
"minLength": 19,
"maxLength": 19,
"description": "Дата и время сайта: 2026-10-04 12:00:00. null снимает границу периода."
},
"active_to": {
"type": [
"string",
"null"
],
"pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2}:[0-9]{2}$",
"minLength": 19,
"maxLength": 19,
"description": "Дата и время сайта: 2026-10-04 12:00:00. null снимает границу периода."
},
"xml_id": {
"type": "string",
"maxLength": 255,
"minLength": 0
},
"notes": {
"type": "string",
"maxLength": 2000,
"minLength": 0
}
},
"required": [],
"additionalProperties": false,
"minProperties": 1
},
"product_ids": {
"type": "array",
"maxItems": 100,
"uniqueItems": true,
"items": {
"type": "integer",
"minimum": 1,
"maximum": 2147483647
},
"minItems": 1
},
"user_group_ids": {
"type": "array",
"maxItems": 100,
"uniqueItems": true,
"items": {
"type": "integer",
"minimum": 1,
"maximum": 2147483647
}
},
"price_type_ids": {
"type": "array",
"maxItems": 100,
"uniqueItems": true,
"items": {
"type": "integer",
"minimum": 1,
"maximum": 2147483647
}
},
"confirm": {
"type": "boolean",
"description": "Подтвердите выбранные товары и изменение: true."
}
},
"required": [
"discount_id",
"confirm"
],
"additionalProperties": false
}