CMS Tool API schema
Public API version 1.4.10.
Discounts
Each product line of an order can be discounted, so an order can have multiple discounts, but only one per product.
Endpoint URL
https://api.cms-tool.net/api/discount
/api/discount
Read and update promotional discounts.
GET
List records, or retrieve one by appending its ID to the path.
Query parameters
| Name | Type | Example | Notes |
|---|---|---|---|
id | int | 123 | Filter results by id. |
offset | int | 123 | Skip this many matching records before returning results. |
pageSize | int | 123 | Limit the number of records returned. |
POST
Create or update a record from a JSON object.
Request content type: application/json
Request body fields
| Name | Type | Example | Notes |
|---|---|---|---|
id | int | 123 | Set the id value. |
promo | text | example | Set the promo value. |
promocode | text | ABC123 | Set the promocode value. |
minimumspend | number | 19.95 | Set the minimumspend value. |
percentdiscount | number | 19.95 | Set the percentdiscount value. |
valuediscount | number | 19.95 | Set the valuediscount value. |
promoexpiry | date | 2026-09-24 | Set the promoexpiry value. |
Data definitions
| Field | Type | Description | Format | Example |
|---|---|---|---|---|
in_price_group | char | Text, Price group which a customer must belong to in order to get this discount. Do not set any valid for retail. Other price groups are one of the letters (A,B,C,D,E,F,G,H) | ||
countavailable | int | count of how many times can this discount be used by anyone | ||
valid_for_min_member_level | int | Minimum Member Level Required, only use member level ID from the reference data. | ||
promoexpiry | timestamp | Timestamp when this discount will expire | 2025-12-31 23:59:59 | |
onlyingroupid | int | ID, refer to the category ID list, this value determines what category can receive the discount, the target discounted item | ||
promo | serial | System ID, unique serial number. do not set or change this value | 123456 | |
exclude_groupid | int | ID, refer to the category ID list, this value determines what category is excluded from receiving the discount | ||
onlyforsupplier | text | Text, name of a product supplier for which only this discount can be applied | ||
perunitdiscount | decimal | A discount that is applied to each unit, so that more quantity gets more discount | ||
percentdiscount | decimal | A percentage discount being a value from 0 to 100. Free items would have 100% discount | ||
free_freight | bool | if true then user will get free shipping or free courier | ||
repeatallowance | bool | if true, then the value of limitquantityitemsfordiscount is repeated everytime the reference product rules are met | ||
with_purchase_of_pid | int | ID, refers to a product ID, this value determines what product must also be purchased in order to get a discount on the targeted item | ||
promoaffiliateid | int | ID of a specific customer who should be recorded as the affiliate who referred this new business when this discount is used | ||
exclude_reference_groupid | int | ID, refer to the category ID list, this value determines what category is excluded from being a reference item to win the discount. | ||
promonotes | text | A description of this discount that will only be shown to administrators and maximum of 100 characters | ||
comparepricing | bool | if true, then the discount will only be applied to the lowest price item when a reference item is required | ||
not_in_member_group | int | ID of a customer group whom a customer must not belong to in order to get this discount. See Customer group meta data | ||
minimumspend | decimal | The minimimum a customer must spend to activate this discount, this is optional | ||
promobegins | timestamp | timestamp when this discount will start being available | 2025-12-31 23:59:59 | |
valid_for_max_member_level | int | Members of this level and above are denied using the discount. Only use member level ID from reference data. eg 200 = Trade customers excluded | ||
promocode | text | A user friendly discount promotion code, only if the instructions require a promo code | ||
promomessagetocustomer | text | A description of this discount intended for display to the customer and maximum of 50 characters | ||
withqtypurchased | decimal | The quantity of reference items that must be purchased in order to get a discount. | ||
ifnotalreadydiscounted | bool | if true, then an item is not value for discount if it already is discounted by some other means | ||
countused | int | count of how many times has this discount been used | ||
in_member_group | int | ID of a customer group whom a customer must belong to in order to get this discount. See customer group meta data | ||
withsupplierpurchase | text | Text, name of a product supplier for which a refererence item must be purchased | ||
with_purchase_of_groupid | int | ID, refer to the category ID list, this value determines what category of reference items must also be purchased in order to get this discount on the target item | ||
promocurrency | char | The currency of this discount, only if instructions require a currency focus | ||
perunitmaxprice | decimal | The discount will be such that the product price will be capped at this value | ||
limitpercustomer | int | how many times can this discount be used by each customer | ||
limitquantityitemsfordiscount | decimal | the maximum quantity of items that can receive the discount. | ||
with_purchase_of_groupid2 | int | ID, refer to the category ID list, this value determines what category of reference items must also be purchased in order to get this discount on the target item, and would be additional to with_purchase_of_groupid meaning that items from both categories must be purchased in order to get a discount on the target item | ||
onlyformemberid | int | ID of a specific customer who should get this discount. There is no meta data provided for this. | ||
autoaddproducttocart | bool | if true, then any free item will be automatically added to the cart when the specified rules have been met | ||
valuediscount | decimal | A specified discount value, perhaps per order or per order line. eg $10 off | ||
maximumdiscount | decimal | The maximum discount value that can be calculated by this rule | ||
valid_on_page | int | ID of a page that may only get this discount. ignore this field | ||
onlyforpid | int | ID, refers to a product ID, this value determines what product is the target for the discount. |
Machine-readable documentation
This documentation is also available as JSON or Markdown at the same URL. Request JSON with Accept: application/json or Markdown with Accept: text/markdown.