Лояльность · Чтение
Промоакции · Проверка
promotions_validate
Попробуйте три запроса
Получить данные
- Вы указываетеКлюч записи
- ПомощникЧтение
- Вы получаетеПоля ответа
Запрос в чат
Для задачи «Промоакции / Проверка» выполни чтение по выбранной записи (ключ записи). Выведи кратко: valid, issues.
- valid
- Поле ответа
- issues
- Поле ответа
- revision
- Версия записи
Задать параметры
- Вы указываетеКлюч записи
- ПомощникСверка выбора
- Вы получаетеТочный объект
Запрос в чат
Покажи, как получить «Промоакции / Проверка» на учебном примере с values.name = Осенняя коллекция. Объясни, какие ещё данные нужны и как будет выглядеть ответ.
- values.name
- Осенняя коллекция
- values.type
- discountorder
- values.firstPurchase
- true
Разобрать ответ
- Вы указываетеПолученный ответ
- ПомощникРазбор значений
- Вы получаетеКраткое пояснение
Запрос в чат
На основании уже полученного ответа «Промоакции / Проверка» объясни valid, issues. Отметь отсутствующие значения.
- valid
- Поле ответа
- issues
- Поле ответа
- revision
- Версия записи
Как работает действие
Это чтение. Выберите запись или задайте фильтры в доступной компании. Прочитайте актуальную версию записи перед подготовкой запроса.
Описание разработчика
Check a promotion draft or a partial edit against the same transactional rules as promotions_create/update: native types, prices, purchase conditions, gift choices, client groups, date bounds, local time windows and current company/location references. Supply key plus revision for an edit. No promotion, order, discount, gift, message or receipt is created; validity is advisory and rechecked on save. Use orders_native_quote to check actual order pricing.
Параметры запроса
- key
- Канонический ключ записи из результата чтения. необязательно · object
- revision
- Текущая версия выбранной записи. необязательно · string
- values
- Значения для записи. Состав и вложенность указаны в схеме. обязательно по схеме · object
Что вернёт команда
- valid
- Whether this configuration passes the current native promotion checks. обязательно по схеме · boolean
- issues
- First blocking issue; correct it and validate again. обязательно по схеме · array · до элементов 1
- revision
- Current source revision, or null for an unsaved draft. обязательно по схеме · string / null
- saved
- Validation does not save or activate a promotion. обязательно по схеме · boolean
Поля и технические схемы

Вход · JSON Schema
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"key": {
"description": "Existing promotion to merge with values; omit for a new draft.",
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "^[A-Za-z0-9_~:@+.-]{1,128}$",
"description": "Existing canonical promotion ID."
}
},
"required": [
"id"
],
"additionalProperties": false
},
"revision": {
"description": "Native revision value; use the value and type returned by the corresponding service.",
"type": "string",
"pattern": "^[a-f0-9]{32}$"
},
"values": {
"type": "object",
"properties": {
"available": {
"description": "available in promotions. Supply only an intentional user-requested change; omitted fields are preserved.",
"type": [
"boolean",
"null"
]
},
"name": {
"anyOf": [
{
"description": "Native Product.Name. Supplied array replaces the whole array.",
"maxItems": 100,
"type": "array",
"items": {
"type": "object",
"properties": {
"Language": {
"description": "Native Namesjson.Language.",
"type": "string",
"maxLength": 2000
},
"Text": {
"description": "Native Namesjson.Text.",
"type": "string",
"maxLength": 12000
}
},
"additionalProperties": false,
"description": "Native Product.Name."
}
},
{
"type": "null"
}
],
"description": "Localized promotion names: Language/Text pairs. Supplied array replaces all translations; merge the current array first."
},
"type": {
"type": "string",
"enum": [
"discountorder",
"fixsumm",
"discount",
"fixeach",
"fixprice",
"bonus",
"discountpair"
],
"description": "discountorder: percent on order; fixsumm: amount on order; discount: percent on targeted lines; fixeach: amount per targeted unit; fixprice: special product prices; bonus: extra gift lines; discountpair: percent off the lower-priced unit in each qualifying pair."
},
"establishment": {
"minItems": 1,
"maxItems": 100,
"type": "array",
"items": {
"anyOf": [
{
"type": "string",
"pattern": "^[A-Za-z0-9_~:@+.-]{1,128}$"
},
{
"type": "string",
"const": "all"
}
]
},
"description": "Canonical company location IDs. Native all means all locations and requires company-wide access; it is not a location ID. Empty scopes are rejected."
},
"discount_bool": {
"description": "discount bool in promotions. Supply only an intentional user-requested change; omitted fields are preserved.",
"type": [
"boolean",
"null"
]
},
"photos": {
"anyOf": [
{
"description": "Native Product.Photos. Supplied array replaces the whole array.",
"maxItems": 100,
"type": "array",
"items": {
"type": "object",
"properties": {
"image": {
"description": "Native PhotoGallery_json.image.",
"type": "string",
"maxLength": 2000
},
"Blur": {
"description": "Native PhotoGallery_json.Blur.",
"type": "string",
"maxLength": 2000
},
"Language": {
"$ref": "#/$defs/_mcp0"
},
"dark": {
"description": "Native PhotoGallery_json.dark.",
"type": "string",
"maxLength": 2000
}
},
"additionalProperties": false,
"description": "Native Product.Photos."
}
},
{
"type": "null"
}
],
"description": "Existing native photo declarations. This configures presentation only."
},
"background_photo": {
"anyOf": [
{
"description": "Native Product.BackroundImage.",
"type": "object",
"properties": {
"image": {
"description": "Native PhotoGallery_json.image.",
"type": "string",
"maxLength": 2000
},
"Blur": {
"description": "Native PhotoGallery_json.Blur.",
"type": "string",
"maxLength": 2000
},
"Language": {
"$ref": "#/$defs/_mcp0"
},
"dark": {
"description": "Native PhotoGallery_json.dark.",
"type": "string",
"maxLength": 2000
}
},
"additionalProperties": false
},
{
"type": "null"
}
],
"description": "Existing native background image declaration, or null to clear."
},
"color": {
"description": "color in promotions. Supply only an intentional user-requested change; omitted fields are preserved.",
"anyOf": [
{
"type": "string",
"maxLength": 100000
},
{
"type": "null"
}
]
},
"promocode": {
"anyOf": [
{
"type": "string",
"maxLength": 80
},
{
"type": "null"
}
],
"description": "Exact case-sensitive native code. Empty/null clears it. A nonempty code requires auto=false; saving does not redeem it."
},
"date_start": {
"$ref": "#/$defs/_mcp1"
},
"date_finish": {
"$ref": "#/$defs/_mcp1"
},
"auto": {
"description": "auto in promotions. Supply only an intentional user-requested change; omitted fields are preserved.",
"type": [
"boolean",
"null"
]
},
"description": {
"anyOf": [
{
"description": "Native Product.Description. Supplied array replaces the whole array.",
"maxItems": 100,
"type": "array",
"items": {
"type": "object",
"properties": {
"Language": {
"description": "Native Namesjson.Language.",
"type": "string",
"maxLength": 2000
},
"Text": {
"description": "Native Namesjson.Text.",
"type": "string",
"maxLength": 12000
}
},
"additionalProperties": false,
"description": "Native Product.Description."
}
},
{
"type": "null"
}
],
"description": "Localized descriptions: Language/Text pairs. Merge all existing translations before replacing this array."
},
"available_in_app": {
"description": "available in app in promotions. Supply only an intentional user-requested change; omitted fields are preserved.",
"type": [
"boolean",
"null"
]
},
"group_clients": {
"anyOf": [
{
"maxItems": 100,
"type": "array",
"items": {
"type": "string",
"pattern": "^[A-Za-z0-9_~:@+.-]{1,128}$"
}
},
{
"type": "null"
}
],
"description": "Existing canonical customer group IDs. Required and nonempty when who_give=group."
},
"usloviya_zakaza": {
"description": "usloviya zakaza in promotions. Supply only an intentional user-requested change; omitted fields are preserved.",
"type": [
"boolean",
"null"
]
},
"time_start_finish": {
"anyOf": [
{
"maxItems": 16,
"type": "array",
"items": {
"type": "string",
"pattern": "^([01]\\d|2[0-3]):[0-5]\\d$"
}
},
{
"type": "null"
}
],
"description": "Pairs of HH:mm values in location timezone; up to eight windows. A finish before start crosses midnight. Empty/null means all day."
},
"days": {
"anyOf": [
{
"maxItems": 7,
"type": "array",
"items": {
"type": "string",
"enum": [
"mo",
"mon",
"tue",
"wed",
"thu",
"fri",
"sat",
"sun"
]
}
},
{
"type": "null"
}
],
"description": "Native weekday tokens. mo/mon mean Monday; empty/null means every day. Interpreted in each location timezone."
},
"who_give": {
"anyOf": [
{
"type": "string",
"enum": [
"all",
"onlylogin",
"onlyunset",
"group"
]
},
{
"type": "null"
}
],
"description": "All customers, identified customers, orders without a customer, or selected customer groups."
},
"dependencies": {
"anyOf": [
{
"maxItems": 100,
"type": "array",
"items": {
"type": "object",
"properties": {
"Product": {
"anyOf": [
{
"type": "string",
"pattern": "^[A-Za-z0-9_~:@+.-]{1,128}$"
},
{
"type": "string",
"const": "all"
}
],
"description": "Canonical product ID, or all for a whole-order threshold."
},
"Quantity": {
"description": "Required quantity, zero/omitted means no quantity threshold.",
"type": "number",
"minimum": 0,
"maximum": 100000000
},
"HowMany": {
"description": "Required pre-discount line amount, zero/omitted means no amount threshold.",
"type": "number",
"minimum": 0,
"maximum": 100000000
},
"Equals": {
"description": "True means exact thresholds; false/omitted means at least.",
"type": "boolean"
}
},
"required": [
"Product"
],
"additionalProperties": false
}
},
{
"type": "null"
}
],
"description": "Native purchase conditions and line targets. Product/Quantity/HowMany/Equals casing is exact. Arrays replace; null clears."
},
"price_fiks": {
"anyOf": [
{
"maxItems": 100,
"type": "array",
"items": {
"type": "object",
"properties": {
"Product": {
"type": "string",
"pattern": "^[A-Za-z0-9_~:@+.-]{1,128}$",
"description": "Canonical product ID for special price or gift choice."
},
"Price": {
"type": "number",
"minimum": 0,
"maximum": 100000000,
"description": "Special unit price, including zero; bonus pricing additionally uses type_bonus."
}
},
"required": [
"Product",
"Price"
],
"additionalProperties": false
}
},
{
"type": "null"
}
],
"description": "Explicit special prices or gift choices. Required for fixprice and bonus. Product references are verified within the company."
},
"quantity_result": {
"anyOf": [
{
"type": "number",
"minimum": 0,
"maximum": 1000
},
{
"type": "null"
}
],
"description": "Positive configured gift quantity per order for bonus. Current Orders does not multiply it by completed purchase thresholds; timeinorderone does not enable such repetition. Verify the actual allocation with orders_native_quote."
},
"result_price": {
"anyOf": [
{
"type": "number",
"minimum": 0,
"maximum": 100000000
},
{
"type": "null"
}
],
"description": "Gift unit price when bonus type_bonus=price. Zero makes the gift free."
},
"fiks_amount": {
"anyOf": [
{
"type": "number",
"minimum": 0,
"maximum": 100000000
},
{
"type": "null"
}
],
"description": "Amount off. Positive for fixeach/fixsumm; for bonus type_bonus=amount this is the amount off a gift unit."
},
"discount": {
"anyOf": [
{
"type": "number",
"minimum": 0,
"maximum": 100
},
{
"type": "null"
}
],
"description": "Percent 0..100. Positive for discount, discountorder and discountpair. For bonus with type_bonus=procent this is the gift discount percent."
},
"immediately": {
"description": "Use true for a pair discount applied in the current order. Other promotion types follow their native configuration.",
"type": [
"boolean",
"null"
]
},
"type_bonus": {
"anyOf": [
{
"type": "string",
"enum": [
"price",
"procent",
"amount"
]
},
{
"type": "null"
}
],
"description": "Gift pricing: result_price, percent off discount, or amount off fiks_amount."
},
"timeinorderone": {
"description": "timeinorderone in promotions. Supply only an intentional user-requested change; omitted fields are preserved.",
"type": [
"boolean",
"null"
]
},
"withotherpromotions": {
"description": "withotherpromotions in promotions. Supply only an intentional user-requested change; omitted fields are preserved.",
"type": [
"boolean",
"null"
]
},
"firstPurchase": {
"type": "boolean",
"description": "Restrict this promotion to the first website order of a signed-in customer. May be combined with a promo code. Omit to preserve the current rule; false removes the restriction."
}
},
"additionalProperties": false,
"description": "Draft values or a partial edit. Empty values validates an existing record unchanged. New drafts require name, type, establishment and available."
}
},
"required": [
"values"
],
"additionalProperties": false,
"$defs": {
"_mcp0": {
"description": "Native PhotoGallery_json.Language. Supplied array replaces the whole array.",
"maxItems": 100,
"type": "array",
"items": {
"type": "string",
"maxLength": 2000,
"description": "Native PhotoGallery_json.Language."
}
},
"_mcp1": {
"description": "Native Orders promotion date in UTC, stored as SQL timestamp without a timezone suffix: YYYY-MM-DDTHH:mm:ss[.ffffff]. Convert an intended local instant to UTC before supplying it. Recurring days/time_start_finish instead use each location timezone. Null clears this date bound; omission preserves it.",
"anyOf": [
{
"type": "string",
"pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(?:\\.\\d{1,6})?$"
},
{
"type": "null"
}
]
}
}
}Выход · JSON Schema
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"valid": {
"type": "boolean",
"description": "Whether this configuration passes the current native promotion checks."
},
"issues": {
"maxItems": 1,
"type": "array",
"items": {
"type": "object",
"properties": {
"field": {
"type": "string",
"description": "Field that needs correction, without stored data."
},
"message": {
"type": "string",
"description": "Bounded correction guidance."
}
},
"required": [
"field",
"message"
],
"additionalProperties": false
},
"description": "First blocking issue; correct it and validate again."
},
"revision": {
"anyOf": [
{
"type": "string",
"pattern": "^[a-f0-9]{32}$",
"description": "Exact current revision from promotions_get; omit along with key for a new draft."
},
{
"type": "null"
}
],
"description": "Current source revision, or null for an unsaved draft."
},
"saved": {
"type": "boolean",
"const": false,
"description": "Validation does not save or activate a promotion."
}
},
"required": [
"valid",
"issues",
"revision",
"saved"
],
"additionalProperties": false
}