Предметные инструменты · sale

Правила скидок Sale · изменения

sale_site_sale_discounts_m037_writeИзменение

Действия модуля sale.

Действия

В tools/call передайте имя инструмента, значение action и параметры действия во вложенном объекте arguments.

Создание правила скидки

create

Действия модуля sale.

site_id
строка · обязательный параметр
name
строка · обязательный параметр
rule_code
строка · обязательный параметр
percent
целое число · обязательный параметр
user_group_ids
массив · обязательный параметр
expected_revision
строка · обязательный параметр
confirm
логическое значение · обязательный параметр
acknowledge_native_discount_effects
логическое значение · обязательный параметр
Схема параметров JSON
{
  "type": "object",
  "properties": {
    "site_id": {
      "type": "string",
      "pattern": "^[A-Za-z0-9]{1,2}$"
    },
    "name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 255
    },
    "rule_code": {
      "type": "string",
      "pattern": "^[a-z][a-z0-9_-]{0,47}$"
    },
    "percent": {
      "type": "integer",
      "minimum": 1,
      "maximum": 100
    },
    "user_group_ids": {
      "type": "array",
      "minItems": 1,
      "maxItems": 32,
      "uniqueItems": true,
      "items": {
        "type": "integer",
        "minimum": 1,
        "maximum": 2147483647
      }
    },
    "expected_revision": {
      "type": "string",
      "pattern": "^[a-f0-9]{64}$"
    },
    "confirm": {
      "type": "boolean"
    },
    "acknowledge_native_discount_effects": {
      "type": "boolean"
    }
  },
  "required": [
    "site_id",
    "name",
    "rule_code",
    "percent",
    "user_group_ids",
    "expected_revision",
    "confirm",
    "acknowledge_native_discount_effects"
  ],
  "additionalProperties": false
}

Скачать исходное примечание

Создание купона со скидкой

create_coupon

Действия модуля sale.

discount_id
целое число · обязательный параметр
coupon_code
строка · обязательный параметр
expected_revision
строка · обязательный параметр
confirm
логическое значение · обязательный параметр
acknowledge_native_discount_effects
логическое значение · обязательный параметр
Схема параметров JSON
{
  "type": "object",
  "properties": {
    "discount_id": {
      "type": "integer",
      "minimum": 1,
      "maximum": 2147483647
    },
    "coupon_code": {
      "type": "string",
      "pattern": "^[A-Z0-9]{8,12}$"
    },
    "expected_revision": {
      "type": "string",
      "pattern": "^[a-f0-9]{64}$"
    },
    "confirm": {
      "type": "boolean"
    },
    "acknowledge_native_discount_effects": {
      "type": "boolean"
    }
  },
  "required": [
    "discount_id",
    "coupon_code",
    "expected_revision",
    "confirm",
    "acknowledge_native_discount_effects"
  ],
  "additionalProperties": false
}

Скачать исходное примечание

Создание накопительной скидки

create_cumulative

Действия модуля sale.

site_id
строка · обязательный параметр
name
строка · обязательный параметр
rule_code
строка · обязательный параметр
tiers
массив · обязательный параметр
user_group_ids
массив · обязательный параметр
expected_revision
строка · обязательный параметр
confirm
логическое значение · обязательный параметр
acknowledge_native_discount_effects
логическое значение · обязательный параметр
Схема параметров JSON
{
  "type": "object",
  "properties": {
    "site_id": {
      "type": "string",
      "pattern": "^[A-Za-z0-9]{1,2}$"
    },
    "name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 255
    },
    "rule_code": {
      "type": "string",
      "pattern": "^[a-z][a-z0-9_-]{0,47}$"
    },
    "tiers": {
      "type": "array",
      "minItems": 1,
      "maxItems": 16,
      "items": {
        "type": "object",
        "properties": {
          "minimum": {
            "type": "integer",
            "minimum": 0,
            "maximum": 1000000000
          },
          "percent": {
            "type": "integer",
            "minimum": 1,
            "maximum": 100
          }
        },
        "required": [
          "minimum",
          "percent"
        ],
        "additionalProperties": false
      }
    },
    "user_group_ids": {
      "type": "array",
      "minItems": 1,
      "maxItems": 32,
      "uniqueItems": true,
      "items": {
        "type": "integer",
        "minimum": 1,
        "maximum": 2147483647
      }
    },
    "expected_revision": {
      "type": "string",
      "pattern": "^[a-f0-9]{64}$"
    },
    "confirm": {
      "type": "boolean"
    },
    "acknowledge_native_discount_effects": {
      "type": "boolean"
    }
  },
  "required": [
    "site_id",
    "name",
    "rule_code",
    "tiers",
    "user_group_ids",
    "expected_revision",
    "confirm",
    "acknowledge_native_discount_effects"
  ],
  "additionalProperties": false
}

Скачать исходное примечание

Создание купона накопительной скидки

create_cumulative_coupon

Действия модуля sale.

discount_id
целое число · обязательный параметр
coupon_code
строка · обязательный параметр
expected_revision
строка · обязательный параметр
confirm
логическое значение · обязательный параметр
acknowledge_native_discount_effects
логическое значение · обязательный параметр
Схема параметров JSON
{
  "type": "object",
  "properties": {
    "discount_id": {
      "type": "integer",
      "minimum": 1,
      "maximum": 2147483647
    },
    "coupon_code": {
      "type": "string",
      "pattern": "^[A-Z0-9]{8,12}$"
    },
    "expected_revision": {
      "type": "string",
      "pattern": "^[a-f0-9]{64}$"
    },
    "confirm": {
      "type": "boolean"
    },
    "acknowledge_native_discount_effects": {
      "type": "boolean"
    }
  },
  "required": [
    "discount_id",
    "coupon_code",
    "expected_revision",
    "confirm",
    "acknowledge_native_discount_effects"
  ],
  "additionalProperties": false
}

Скачать исходное примечание

Применение накопительной скидки

cumulative_coupon

Действия модуля sale.

discount_id
целое число · обязательный параметр
order_id
целое число · обязательный параметр
coupon_id
целое число · обязательный параметр
expected_revision
строка · обязательный параметр
confirm
логическое значение · обязательный параметр
acknowledge_native_order_effects
логическое значение · обязательный параметр
Схема параметров JSON
{
  "type": "object",
  "properties": {
    "discount_id": {
      "type": "integer",
      "minimum": 1,
      "maximum": 2147483647
    },
    "order_id": {
      "type": "integer",
      "minimum": 1,
      "maximum": 2147483647
    },
    "coupon_id": {
      "type": "integer",
      "minimum": 1,
      "maximum": 2147483647
    },
    "expected_revision": {
      "type": "string",
      "pattern": "^[a-f0-9]{64}$"
    },
    "confirm": {
      "type": "boolean"
    },
    "acknowledge_native_order_effects": {
      "type": "boolean"
    }
  },
  "required": [
    "discount_id",
    "order_id",
    "coupon_id",
    "expected_revision",
    "confirm",
    "acknowledge_native_order_effects"
  ],
  "additionalProperties": false
}

Скачать исходное примечание

Изменение правила скидки

edit

Действия модуля sale.

discount_id
целое число · обязательный параметр
patch
объект · обязательный параметр
expected_revision
строка · обязательный параметр
confirm
логическое значение · обязательный параметр
acknowledge_native_discount_effects
логическое значение · обязательный параметр
Схема параметров JSON
{
  "type": "object",
  "properties": {
    "discount_id": {
      "type": "integer",
      "minimum": 1,
      "maximum": 2147483647
    },
    "patch": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string",
          "minLength": 1,
          "maxLength": 255
        },
        "active": {
          "type": "boolean"
        }
      },
      "minProperties": 1,
      "additionalProperties": false
    },
    "expected_revision": {
      "type": "string",
      "pattern": "^[a-f0-9]{64}$"
    },
    "confirm": {
      "type": "boolean"
    },
    "acknowledge_native_discount_effects": {
      "type": "boolean"
    }
  },
  "required": [
    "discount_id",
    "patch",
    "expected_revision",
    "confirm",
    "acknowledge_native_discount_effects"
  ],
  "additionalProperties": false
}

Скачать исходное примечание

Изменение накопительной скидки

edit_cumulative

Действия модуля sale.

discount_id
целое число · обязательный параметр
patch
объект · обязательный параметр
expected_revision
строка · обязательный параметр
confirm
логическое значение · обязательный параметр
acknowledge_native_discount_effects
логическое значение · обязательный параметр
Схема параметров JSON
{
  "type": "object",
  "properties": {
    "discount_id": {
      "type": "integer",
      "minimum": 1,
      "maximum": 2147483647
    },
    "patch": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string",
          "minLength": 1,
          "maxLength": 255
        },
        "active": {
          "type": "boolean"
        }
      },
      "minProperties": 1,
      "additionalProperties": false
    },
    "expected_revision": {
      "type": "string",
      "pattern": "^[a-f0-9]{64}$"
    },
    "confirm": {
      "type": "boolean"
    },
    "acknowledge_native_discount_effects": {
      "type": "boolean"
    }
  },
  "required": [
    "discount_id",
    "patch",
    "expected_revision",
    "confirm",
    "acknowledge_native_discount_effects"
  ],
  "additionalProperties": false
}

Скачать исходное примечание

Применение купона со скидкой

fixed_coupon

Действия модуля sale.

order_id
целое число · обязательный параметр
discount_id
целое число · обязательный параметр
coupon_id
целое число · обязательный параметр
expected_revision
строка · обязательный параметр
confirm
логическое значение · обязательный параметр
acknowledge_native_order_effects
логическое значение · обязательный параметр
Схема параметров JSON
{
  "type": "object",
  "properties": {
    "order_id": {
      "type": "integer",
      "minimum": 1,
      "maximum": 2147483647
    },
    "discount_id": {
      "type": "integer",
      "minimum": 1,
      "maximum": 2147483647
    },
    "coupon_id": {
      "type": "integer",
      "minimum": 1,
      "maximum": 2147483647
    },
    "expected_revision": {
      "type": "string",
      "pattern": "^[a-f0-9]{64}$"
    },
    "confirm": {
      "type": "boolean"
    },
    "acknowledge_native_order_effects": {
      "type": "boolean"
    }
  },
  "required": [
    "order_id",
    "discount_id",
    "coupon_id",
    "expected_revision",
    "confirm",
    "acknowledge_native_order_effects"
  ],
  "additionalProperties": false
}

Скачать исходное примечание