Pricing Rule
A rule that changes a price or gives a discount when its conditions hold: a customer group's price, a quantity break.
Area: Prices and price lists · Why it is here: retail core · Fields: 61
Read and write it
Every call runs as your app's own user, with its key in one header, at the retailer's own address. The user reads and writes only what its role allows: your app's user, and the rights the retailer gives it.
Read a list (only name unless you ask for fields):
curl -s "https://⟨site⟩/api/resource/Pricing%20Rule?fields=%5B%22*%22%5D&limit_page_length=20" \
-H "Authorization: token ⟨api key⟩:⟨api secret⟩"
Read one, with its tables:
curl -s "https://⟨site⟩/api/resource/Pricing%20Rule/⟨name⟩" -H "Authorization: token ⟨api key⟩:⟨api secret⟩"
Create one (the required fields first), if your app's role may:
curl -s -X POST "https://⟨site⟩/api/resource/Pricing%20Rule" -H "Authorization: token ⟨api key⟩:⟨api secret⟩" \
-H "Content-Type: application/json" -d '{"title": …, "apply_on": …, "price_or_product_discount": …, "currency": …}'
Change one with PUT /api/resource/Pricing%20Rule/⟨name⟩ and the fields you change; a table sent there replaces its rows, so send its existing rows too. All the record calls and their answers: the API reference.
Fields
Read from the product at POS 2.1.0.667 (till app 60147699c): its own fields, the fields iVendNext adds to it, and iVendNext's changes to any of them. Read-only fields are set by iVendNext; a hidden one is not on the form but can be read. Every record also has name (its id, in the address), owner, creation, modified, modified_by and docstatus (0 a draft, 1 submitted, 2 cancelled), all read-only.
| Field | Field name | Type | Required | Read-only | Hidden | Links to |
|---|---|---|---|---|---|---|
| Naming Series | naming_series |
Select | one of: PRLE-.#### | |||
| Title | title |
Data | yes | |||
| Disable | disable |
Check | ||||
| Apply On | apply_on |
Select | yes | one of: Item Code, Item Group, Brand, Transaction | ||
| Price or Product Discount | price_or_product_discount |
Select | yes | one of: Price, Product | ||
| Warehouse | warehouse |
Link | Warehouse | |||
| Apply Rule On Item Code | items |
Table | Pricing Rule Item Code | |||
| Apply Rule On Item Group | item_groups |
Table | Pricing Rule Item Group | |||
| Apply Rule On Brand | brands |
Table | Pricing Rule Brand | |||
| Mixed Conditions | mixed_conditions |
Check | ||||
| Is Cumulative | is_cumulative |
Check | ||||
| Coupon Code Based | coupon_code_based |
Check | ||||
| Apply Rule On Other | apply_rule_on_other |
Select | one of: Item Code, Item Group, Brand | |||
| Item Code | other_item_code |
Link | Item | |||
| Item Group | other_item_group |
Link | Item Group | |||
| Brand | other_brand |
Link | Brand | |||
| Selling | selling |
Check | ||||
| Buying | buying |
Check | ||||
| Applicable For | applicable_for |
Select | one of: Customer, Customer Group, Territory, Sales Partner, Campaign, Supplier, Supplier Group | |||
| Customer | customer |
Link | Customer | |||
| Customer Group | customer_group |
Link | Customer Group | |||
| Territory | territory |
Link | Territory | |||
| Sales Partner | sales_partner |
Link | Sales Partner | |||
| Campaign | campaign |
Link | Campaign | |||
| Supplier | supplier |
Link | Supplier | |||
| Supplier Group | supplier_group |
Link | Supplier Group | |||
| Min Qty (As Per Stock UOM) | min_qty |
Float | ||||
| Max Qty (As Per Stock UOM) | max_qty |
Float | ||||
| Min Amt | min_amt |
Currency | ||||
| Max Amt | max_amt |
Currency | ||||
| Same Item | same_item |
Check | ||||
| Free Item | free_item |
Link | Item | |||
| Qty | free_qty |
Float | ||||
| Free Item Rate | free_item_rate |
Currency | ||||
| UOM | free_item_uom |
Link | UOM | |||
| Round Free Qty | round_free_qty |
Check | ||||
| Is Recursive | is_recursive |
Check | ||||
| Recurse Every (As Per Transaction UOM) | recurse_for |
Float | ||||
| Apply Recursion Over (As Per Transaction UOM) | apply_recursion_over |
Float | ||||
| Valid From | valid_from |
Date | ||||
| Valid Upto | valid_upto |
Date | ||||
| Company | company |
Link | Company | |||
| Currency | currency |
Link | yes | Currency | ||
| Margin Type | margin_type |
Select | one of: Percentage, Amount | |||
| Margin Rate or Amount | margin_rate_or_amount |
Float | ||||
| Rate or Discount | rate_or_discount |
Select | one of: Rate, Discount Percentage, Discount Amount | |||
| Apply Discount On | apply_discount_on |
Select | one of: Grand Total, Net Total | |||
| Rate | rate |
Currency | ||||
| Discount Amount | discount_amount |
Currency | ||||
| Discount Percentage | discount_percentage |
Float | ||||
| For Price List | for_price_list |
Link | Price List | |||
| Condition | condition |
Code | ||||
| Apply Multiple Pricing Rules | apply_multiple_pricing_rules |
Check | ||||
| Apply Discount on Discounted Rate | apply_discount_on_rate |
Check | ||||
| Threshold for Suggestion (In Percentage) | threshold_percentage |
Percent | ||||
| Validate Applied Rule | validate_applied_rule |
Check | ||||
| Rule Description | rule_description |
Small Text | ||||
| Has Priority | has_priority |
Check | ||||
| Priority | priority |
Select | one of: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12 … | |||
| Promotional Scheme Id | promotional_scheme_id |
Data | yes | yes | ||
| Promotional Scheme | promotional_scheme |
Link | yes | Promotional Scheme |
Table: Pricing Rule Brand
The rows of brands. Each row also has idx (its place), parent, parentfield and parenttype.
Table: Pricing Rule Item Code
The rows of items. Each row also has idx (its place), parent, parentfield and parenttype.
| Field | Field name | Type | Required | Read-only | Hidden | Links to |
|---|---|---|---|---|---|---|
| Item Code | item_code |
Link | Item | |||
| UOM | uom |
Link | UOM |
Table: Pricing Rule Item Group
The rows of item_groups. Each row also has idx (its place), parent, parentfield and parenttype.
| Field | Field name | Type | Required | Read-only | Hidden | Links to |
|---|---|---|---|---|---|---|
| Item Group | item_group |
Link | Item Group | |||
| UOM | uom |
Link | UOM |