discounts__calculate_order_loyalty
Calculate applicable discounts and loyalty rewards for an order using items, phone, coupon, and manual conditions before placing the order.
Instructions
Расчёт скидок/лояльности заказа (короткая форма calculate).
items собираются через build_product_item / build_compound_item. Купон и ручные условия передаются через order.loyalty_info (верхнеуровневые поля request — obsolete). Где взять ID: comboGroupId → menu__get_combos_info; comboId → menu__get_combos_info; comboSourceId → menu__get_combos_info; productSizeId → menu__get_nomenclature. Это тул-обёртка: своего троттлинга нет, но вызов расходует квоту нижележащего метода API — кэшируйте результат в диалоге.
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": {
"organization_id": "<organization_id>",
"items": "<items>",
"phone": "<phone>"
},
"name": "discounts__calculate_order_loyalty"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| items | Yes | ||
| phone | Yes | ||
| coupon | No | ||
| customer | No | ||
| organization_id | Yes | ||
| terminal_group_id | No | ||
| order_service_type | No | ||
| applicable_manual_conditions | No |