Pricing: Update Store Rule
update_pricing_rule[Pricing Rule]
[What it does] Saves one owned store's Pricing Settings. A call may update any combination of the store-wide Basic or Advanced fixed rule, price endings, and exchange-rate mode. Supported rule modes are none, basic, and advanced; Advanced custom formulas are view-only and cannot be modified with this Tool.
[When to use] Use only when the user explicitly asks to change a store's Pricing Settings, after a fresh get_pricing_rule read and after the user confirms the exact resulting store-wide configuration.
[When not to use] To inspect settings, including an Advanced custom formula, use get_pricing_rule. To preview a product price, use simulate_pricing_rule. To change live or pre-publish product prices, use the applicable product update Tool. This Tool changes the rule itself; it does not reprice existing products.
[How to use]
Always call
get_pricing_rulefirst. Copydsers_store_idandresource_versionunchanged. A successful write invalidates that version.For a rule update, choose exactly one mode and its matching complete body:
mode=nonesends no rule body;mode=basicrequiresbasic_rule;mode=advancedrequiresadvanced_rulewithformula_mode=fixed. Never send a body belonging to another mode.Advanced
formula_mode=fixedrequiresfixed_rangesandfixed_restand must not send custom fields. Advancedformula_mode=custom,custom_ranges, andcustom_restare read-only and must not be submitted. Inactive saved Advanced fields are preserved.Basic and Advanced fixed boundaries are inclusive USD costs with at most two decimal places and
min < max. Their bounded gaps are completed on the 0.01 grid from the matching rest formula. Collections may contain at most 100 ranges after completion.Advanced mode requires the current plan's pricing-rule benefit; unsupported plans receive an upgrade-required error before any write.
The rule, cents, and currency sections are updated independently. Omit top-level
modefor a cents-only or currency-only update. Omitted sections are preserved; only an explicit false disables a cent-ending switch. A custom rate requires custom mode:mode=defaultomitsexchange_rate;mode=customrequires a positiveexchange_rate.This Tool is not idempotent. Send once. If the result is unknown or partial, call
get_pricing_ruleand submit only what still differs. On success the server has read back and verified the saved state and returns the newresource_version. [Side effects] Changes store-wide Pricing Settings used by future price calculations, but does not directly rewrite existing product prices. [Confirmation] Mandatory and not skippable. Show the store, resulting active mode and formula, completed ranges, and every cents or currency change before calling.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| mode | No | Optional resulting page pricing mode. Provide its complete matching rule body. Advanced requires the current DSers plan's pricing_rule benefit; unsupported plans receive an upgrade-required error before any write. Omit for independent cents or currency updates. | |
| cents | No | Optional independent store price-ending settings. May be updated by itself, even before a pricing-rule template is saved. Paste JSON example: {"compare_at_cents":"99","compare_at_enabled":true,"price_cents":"99","price_enabled":true}. | |
| currency | No | Optional independent store exchange-rate update. Use mode default without exchange_rate, or mode custom with a positive exchange_rate. Paste JSON example: {"exchange_rate":"1.08","mode":"custom"}. | |
| basic_rule | No | Required with mode basic. This is the page Basic range-and-rest structure backed by upstream StandardPricing. Ranges are USD-denominated costs and may be empty; when empty, rest applies to every cost. Missing leading or internal bounded intervals are completed on the fixed 0.01 grid using copies of rest; rest remains the separate unlimited tail. Paste JSON example: {"basis":"product_cost","compare_at_basis":"product_cost","ranges":[{"max":"9.99","min":"0","pricing":{"compare_at":{"basis":"product_cost","operator":"multiply","value":"2.5"},"operator":"multiply","value":"2"}}],"rest":{"compare_at":{"basis":"product_cost","operator":"multiply","value":"2.5"},"operator":"multiply","value":"2"}}. | |
| advanced_rule | No | Required with mode advanced. Only formula_mode fixed can be modified; Advanced custom formulas are view-only through get_pricing_rule. Provide fixed_ranges and fixed_rest, and do not submit custom_ranges or custom_rest. Ranges are USD-denominated costs, and fixed gaps are completed on the fixed 0.01 grid using copies of fixed_rest. Paste JSON example: {"fixed_ranges":[{"formula":{"breakeven_percent":"0","compare_at":{"enabled":true,"operator":"multiply","value":"1.2"},"fixed_profit":"0","minimum_profit":"1","multiplier_factor":"1","profit_percent":"20","shipping":{"enabled":true,"fixed_cost":"5","mode":"fixed","suppliers":[]},"tax":{"enabled":false,"fixed_amount":"0","mode":"fixed"}},"max":"9.99","min":"0"}],"fixed_rest":{"breakeven_percent":"0","compare_at":{"enabled":true,"operator":"multiply","value":"1.2"},"fixed_profit":"0","minimum_profit":"1","multiplier_factor":"1","profit_percent":"20","shipping":{"enabled":true,"fixed_cost":"5","mode":"fixed","suppliers":[]},"tax":{"enabled":false,"fixed_amount":"0","mode":"fixed"}},"formula_mode":"fixed"}. | |
| dsers_store_id | Yes | Copy from get_pricing_rule response. Required. | |
| resource_version | Yes | Copy from resource_version in get_pricing_rule response. Required. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| resource_version | Yes | Version of the saved pricing rule; copy it into any later update_pricing_rule call | |
| toolcall_response_at | Yes | UTC timestamp when the Tool response was returned, formatted as RFC3339. |