Create a price rule
create_price_ruleAdd a pricing rule — a percent off, a percent markup, a fixed price or an amount off — for everybody, a price level or one customer, on every item, a type, a trade or one item, optionally from a minimum quantity and between dates. It changes what every FUTURE order, estimate and invoice line is quoted at; nothing already issued moves. Use quote_prices to show the user the effect first. Usually queued for the account holder to approve (read staged).
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": {
"name": "<name>",
"rule_type": "<rule_type>",
"value": "<value>"
},
"name": "create_price_rule"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | ||
| note | No | ||
| value | Yes | A percentage for percent_off and percent_markup; dollars for fixed_price and amount_off. | |
| ends_on | No | ISO date it stops applying. | |
| item_id | No | Required when item_scope is item. | |
| priority | No | The lowest number wins. Default 100. | |
| entity_id | No | Another entity in the same books (ids from `list_entities`). Leave out to use the entity the person is working in. | |
| is_active | No | Default true. | |
| item_type | No | Required when item_scope is type. | |
| rule_type | Yes | ||
| stackable | No | Applies on top of the winning rule instead of competing with it. | |
| starts_on | No | ISO date it starts applying. | |
| item_scope | No | Default all. | |
| trade_type | No | Required when item_scope is trade. | |
| customer_id | No | Required when customer_scope is customer. | |
| min_quantity | No | Applies from this quantity. Default 0. | |
| customer_scope | No | Default all. | |
| price_level_id | No | Required when customer_scope is level. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | No | The created or updated record's id, when the write was applied rather than staged. | |
| note | No | Why the result was truncated, when it was. | |
| staged | No | TRUE means nothing has changed yet — the write is queued in the account holder's Approvals queue in Seayora. Say it is waiting for approval; never report it as done. | |
| draft_id | No | The staged proposal's id, when it was queued rather than performed. | |
| truncated | No | Present and true when the result was too large to return in full. Treat it as a partial answer. | |
| total_available | No | How many rows existed before truncation. |