CMS Tool API

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

NameTypeExampleNotes
idint123Filter results by id.
offsetint123Skip this many matching records before returning results.
pageSizeint123Limit the number of records returned.

POST

Create or update a record from a JSON object.

Request content type: application/json

Request body fields

NameTypeExampleNotes
idint123Set the id value.
promotextexampleSet the promo value.
promocodetextABC123Set the promocode value.
minimumspendnumber19.95Set the minimumspend value.
percentdiscountnumber19.95Set the percentdiscount value.
valuediscountnumber19.95Set the valuediscount value.
promoexpirydate2026-09-24Set the promoexpiry value.

Data definitions

FieldTypeDescriptionFormatExample
in_price_groupcharText, 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)
countavailableintcount of how many times can this discount be used by anyone
valid_for_min_member_levelintMinimum Member Level Required, only use member level ID from the reference data.
promoexpirytimestampTimestamp when this discount will expire2025-12-31 23:59:59
onlyingroupidintID, refer to the category ID list, this value determines what category can receive the discount, the target discounted item
promoserialSystem ID, unique serial number. do not set or change this value123456
exclude_groupidintID, refer to the category ID list, this value determines what category is excluded from receiving the discount
onlyforsuppliertextText, name of a product supplier for which only this discount can be applied
perunitdiscountdecimalA discount that is applied to each unit, so that more quantity gets more discount
percentdiscountdecimalA percentage discount being a value from 0 to 100. Free items would have 100% discount
free_freightboolif true then user will get free shipping or free courier
repeatallowanceboolif true, then the value of limitquantityitemsfordiscount is repeated everytime the reference product rules are met
with_purchase_of_pidintID, refers to a product ID, this value determines what product must also be purchased in order to get a discount on the targeted item
promoaffiliateidintID of a specific customer who should be recorded as the affiliate who referred this new business when this discount is used
exclude_reference_groupidintID, refer to the category ID list, this value determines what category is excluded from being a reference item to win the discount.
promonotestextA description of this discount that will only be shown to administrators and maximum of 100 characters
comparepricingboolif true, then the discount will only be applied to the lowest price item when a reference item is required
not_in_member_groupintID of a customer group whom a customer must not belong to in order to get this discount. See Customer group meta data
minimumspenddecimalThe minimimum a customer must spend to activate this discount, this is optional
promobeginstimestamptimestamp when this discount will start being available2025-12-31 23:59:59
valid_for_max_member_levelintMembers of this level and above are denied using the discount. Only use member level ID from reference data. eg 200 = Trade customers excluded
promocodetextA user friendly discount promotion code, only if the instructions require a promo code
promomessagetocustomertextA description of this discount intended for display to the customer and maximum of 50 characters
withqtypurchaseddecimalThe quantity of reference items that must be purchased in order to get a discount.
ifnotalreadydiscountedboolif true, then an item is not value for discount if it already is discounted by some other means
countusedintcount of how many times has this discount been used
in_member_groupintID of a customer group whom a customer must belong to in order to get this discount. See customer group meta data
withsupplierpurchasetextText, name of a product supplier for which a refererence item must be purchased
with_purchase_of_groupidintID, 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
promocurrencycharThe currency of this discount, only if instructions require a currency focus
perunitmaxpricedecimalThe discount will be such that the product price will be capped at this value
limitpercustomerinthow many times can this discount be used by each customer
limitquantityitemsfordiscountdecimalthe maximum quantity of items that can receive the discount.
with_purchase_of_groupid2intID, 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
onlyformemberidintID of a specific customer who should get this discount. There is no meta data provided for this.
autoaddproducttocartboolif true, then any free item will be automatically added to the cart when the specified rules have been met
valuediscountdecimalA specified discount value, perhaps per order or per order line. eg $10 off
maximumdiscountdecimalThe maximum discount value that can be calculated by this rule
valid_on_pageintID of a page that may only get this discount. ignore this field
onlyforpidintID, 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.