MenuClose

Products - API Reference

Select API:

Products

A saleable item, or variant of a parent product.

End Point URL

https://api.cms-tool.net/webapps/api/product

API Parameters and Filters

When Getting data, if supplying an ID, then only 1 data JSON element is returned. Otherwise an array is returned, irrespective of how many items are matched. When POSTing data, then only a single element will be returned, and only a single element is expected to be POSTed as a time.

Get Parameters

Name Description Example Data type
id

If ID is specified, then only a single element is returned if found. Otherwise, an array is returned, even if only one item matches. 

id=12345

int
keywords

Filter results based on Site keywords: Site search keywords

keywords=abc

string
code

Filter results based on p_code: Product code

code=123 string
categoryID

Filter results based on Product category id

categoryID=101

int
includeVariants Include product variants with the product includeVariants=1 string
includeAllAttributes When doing a multiple item search, include some product attributes that are hidden for the benfit of bandwidth. Attributes that are excluded by default are those where unlimited length HTML or rich text are included in the product description. So use this parameter if you specifically want this data, otherwise leave it out to have a smaller payload.  includeAllAttributes=t boolean
includeMinimalAttributes When doing a multiple item search, we can reduce fields only to code,title,  but all pricing and stock fields, thus saving bandwidth includeMinimalAttributes=t boolean
includeUltraMinimalAttributes When doing a multiple item search, we can reduce fields only to only code, basic pricing and stock fields, thus saving bandwidth includeUltraMinimalAttributes=t boolean

publicContentOnly

Only retrieve public accessable content

publicContentOnly=true boolean
modifiedAfter Various date/time formats ok, but prefer 2021-06-20 14:59:59
modifiedAfter will be updated if any stock movement occurs.
modifiedAfter=2021-06-20 datetime
location

Filter results based on Product location

location=auckland

string
title

Filter results based on Product name/title

title=Book string
orderby

Sort results based on date/time created, product name, date/time updated at, product code

orderby=created / orderby=name / orderby=updated / orderby=code string
orderDirection Sort results in descending order. Default is ascending order

orderDirection = reverse for descending order

string

Data Dictionary

Key Definition Type Format
pid
ID
System ID for the product, also referred to by ID
Integer (Unique ID)
p_title
Main Product Title
Product name (Validation: required)
text
cid
cid
System ID for the website ID (read only)
int
Max Len: 11
page
page
System ID for the page (read only)
int
Max Len: 11
p_api_setting_id
api setting id
ID of API service that has the master data for this product
int
Max Len: 11
p_groupid
Main Category ID
Master Category / Collection ID Top level product groupid = 0 Hidden or N/A = -9 (Validation: Fkey To Category ID)
int
Max Len: 11
p_groupid10
Category ID 10
Additional category ID 10, a product can belong to 10 different categories. Refer category meta data
int
Max Len: 11
p_groupid2
Category ID 2
Additional category ID 2, a product can belong to 10 different categories. Refer category meta data
int
Max Len: 11
p_groupid3
Category ID 3
Additional category ID 3, a product can belong to 10 different categories. Refer category meta data
int
Max Len: 11
p_groupid4
Category ID 4
Additional category ID 4, a product can belong to 10 different categories. Refer category meta data
int
Max Len: 11
p_groupid5
Category ID 5
Additional category ID 5, a product can belong to 10 different categories. Refer category meta data
int
Max Len: 11
p_groupid6
Category ID 6
Additional category ID 6, a product can belong to 10 different categories. Refer category meta data
int
Max Len: 11
p_groupid7
Category ID 7
Additional category ID 7, a product can belong to 10 different categories. Refer category meta data
int
Max Len: 11
p_groupid8
Category ID 8
Additional category ID 8, a product can belong to 10 different categories. Refer category meta data
int
Max Len: 11
p_groupid9
Category ID 9
Additional category ID 9, a product can belong to 10 different categories. Refer category meta data
int
Max Len: 11
p_material_required_groupid
material required groupid
If this product requires fabric or material in order to be manufactured, From which category ID can material or fabric be selected
int
Max Len: 11
p_parentpid
Parent Product ID
Product variants will have a p_parentpid that links to the master product. Master products have p_parentpid=0. Only master products display on category pages. (Validation: Fkey to PID)
int
Max Len: 11
p_privacy_mbrgroupid
privacy mbrgroupid
Security visibility to a limited member group ID to see the product. Refer member group meta data.
int
Max Len: 11
p_privacy_mbrgroupid_buy
privacy mbrgroupid buy
Security visibility to a limited member group ID to buy the product Refer member group meta data.
int
Max Len: 11
p_privacy_mbrgroupid_price
privacy mbrgroupid price
Security visibility to a limited member group ID to see the price. Refer member group meta data.
int
Max Len: 11
p_subscribetocampaignid
subscribetocampaignid
Upon purchase, a customer will be subscribed to this email campaign ID
int
Max Len: 11
p_vendorid
Vendor ID
Member ID of the vendor who has ownership rights of this product, and might earn commissions from the sale of this product.
int
Max Len: 11
p_additionaltext
Additional text
Additional rich product information revealed after product pricing table, but above the tabbed interface. So always visible on page. (Validation: HTML)
text
p_address_search
Post Code Availability
Post Code availability. Product only available in these postcodes (Validation: 1021,1022,3050)
text
p_age_target
Age target
For market places, these specific age values represent age bands, for products targeting certain ages, such as baby or preschool (Validation: 0,1,2,3,5,10,15,25,50,70)
int
Max Len: 11
p_aggregaterating
aggregate rating
An average review rating (5 stars) value between 0 and 5 (Readonly)
text
Precision: 3.1
p_aggregateratingcount
aggregate rating count
Count of reviews contributing to average review (Readonly)
int
Max Len: 11
p_api_debug
api debug
Either JSON or XML data as per the last API sync
text
p_api_last_updated
api last updated
The timestamp when last synced with an API
timestamp
p_api_source
api source
A system code identifying which API is the master for this product.
text
p_api_source_id
api source id
An identifier used for syncing with an API, eg a GUID
text
p_api_sync_block
api sync block
Internal System Use (read only)
bool
Max Len: 1
true/false
p_assembled_part_count
assembled part count
If this product is assembled, then it will have a count of parts/materials (not quantity) (Validation: 0+)
int
Max Len: 11
p_author
author
The authors name, if this is a book or Artists name if this is a painting
text
p_autoupgrade_expiry
auto upgrade expiry
Upgrades member to a new expiry date once paid
interval
p_autoupgrade_mbrgrpid
auto upgrade mbrgrpid
Upgrade a member to this security group once paid
int
Max Len: 11
p_autoupgrademember
auto upgrade member level
Upgrades member to this security level once paid, status achieved. refer member security levels.  (Validation: 0+)
int
Max Len: 11
p_autoupgradepassword
auto upgrade send password
If True, then a password will be sent to the customer as a welcome email, when paid status (Validation: T)
char
Max Len: 1
p_autovoucher
auto voucher
If True, then create a voucher to send to the customer and save in the vouchers list. (Validation: T)
char
Max Len: 1
p_backorder_maxqty
backorder maxqty
Permittable quantity of back order quantity allowed, perhaps set to the total number currently on back order by the supplier
decimal
Precision: 10.3
p_bookingcalendartags
bookingcalendartags
If a service, or room, then these tags identify a limited set of global resources that can be used. 
text
p_booking_price_unit
booking price unit
How the standard price unit compares to time. eg 1 day, 1 hour, or 45 minutes. This may be the fixed duration of a service or seat hire, or alternatively related to pricing units multiplied by quantity of time.
interval
p_bookingsequence
bookingsequence
For consecutive services, in which order would these occur.
int
Max Len: 11
p_bookingtype
bookingtype
If this is a bookable item, then there are 4 types (Validation: eg )
text
p_buy_points
buy points
If this value is more than 0 then the customer will gain additional loyalty points when they purchase this product
text
Precision: 10.2
p_calendar_count
calendar count
How many resources (aka hire items or seats) are available to book (calendar instances)
int
Max Len: 11
p_cascade_pricing
cascade pricing
Prices are automatically cascaded to variants when changes made to the master product, eg where there is no price variations expected.
bool
Max Len: 1
true/false
p_category
Z-Legacy
LEGACY - not used
int
Max Len: 11
p_checkout_questions
checkout questions
A legacy approach to present additional questions at checkout... HTML format. 
text
p_childcnt
childcnt
Count of variant products, if this is a master product. Value = 0 forordinary product. (Validation: 0+)
int
Max Len: 11
p_code
code
Product code used for reconcilation with other systems, or possibly printed bar code.  (Validation: desireable)
text
p_code_gl_sales
code gl sales
GL Code to use on API connections. eg Xero requires an item ID, and a sales code
text
p_colour
colour
The default or variant colour
text
p_cost_price
cost price
The average cost price of this product. Read only. The cost price is derived from recent purchases.
text
Precision: 10.2
p_customer_price_json
customer price json
JSON structure for targeted pricing on a unique customer basis, only best price applies compared with customer price teir.
text
p_custom_fields
custom fields
A count of how many additional customisation fields exist. Stored in text format for legacy reasons.
text
p_debug
debug
LEGACY - used for internal debugging
text
p_deposit_pc
deposit pc
If only a deposit is required for this product, then only require this much be paid on checkout, even though the total of the invoice will be for the full cost, expectation to pay difference when collecting hire items.
decimal
Precision: 10.2
p_depth
depth
Depth / length in cm (Validation: 0+)
decimal
Precision: 8.1
p_details
details
Product short description
text
p_display_options_json
display options json
Additional configuraiton in JSON format that lists the colours, options, styles and display rules for these.
json
p_dt_available
date available
This product is hidden until  this date makes the product available (visible)
timestamp
p_dt_expires
date expires
This product will no longer be visible after this date
timestamp
p_duplicationid
duplicationid
Used internally during website/page duplications as a temporary reference to the old product
int
Max Len: 11
p_emailfile
Digital File Purchase
Once purchased, a secure file at this file location will be emailed to the customer. Otherwise referred to as a digial file purchase
text
p_enquiry
enquiry
Display an enquiry form with this product
text
p_error_msg
error msg
The error message related to any image import, but also reserved for other uses.. 
text
p_exclude_countries
exclude countries
CSV of country names. Do not allow these countries to purchase a restricted product
text
p_exclude_from_list
exclude from list
If specified, then exclude this product from merchant center product feeds. Enum values include (GoogleMerchantFeed,FacebookProductFeed)
text
p_extra1
extra1
Custom Product Data Field 1
text
p_extra2
extra2
Custom Product Data Field 2
text
p_extra3
extra3
Custom Product Data Field 3
text
p_extra4
extra4
Custom Product Data Field 4
text
p_extra5
extra5
Custom Product Data Field 5
text
p_extra6
extra6
Custom Product Data Field 6
text
p_features_json
features json
A JSON object containing list of feature IDs
json
p_filename
filename
SEO Filename, will be prefixed with "/product/" automatically unless the SEO filename starts with a slash
text
p_freight_rule
freight rule
Enum, Generally null, but other options include (Exclude,SeparateItem,SeparateLine). Exclude means this product does not use the normal freight rules
text
p_freight_ship_separately
freight shiseparately
Calculate shipping on the basis that this item will be shipped separately. Courier platform dependent.
bool
Max Len: 1
true/false
p_group
group
Temporary use when importing products into categories. When used in CSV imports, this column can auto create required categories, link them, and can expand into multiple categories using a | delimiter. Sometimes this column has the name of the primary category when exported (but is not guaranteed)
text
p_gst_rule
gst rule
Currently used to identify if GST / Sales tax should apply domestically. If false, then GST is not added to line items. (Validation: Depreciating in favour of tax codes at some point)
bool
Max Len: 1
true/false
p_height
height
Height in cm, default 0 if unknown (Validation: 0+)
text
Precision: 8.1
p_img
img
Image (Primary product image). URL can be local reference. External URLs will be imported and replaced with a local file reference. (Validation: URL)
text
p_img_json
img json
Meta data about the primary product image
json
p_img_more_count
img more count
Additional image count. Additional images are stored in another table
int
Max Len: 11
p_itemcondition
itemcondition
eg is this item New or Second Hand... Refer to meta schema for values. Default meaning is New if blank, so leave it blank.
text
p_last_sale
last sale
When this item was last sold to anyone
timestamp
p_limitshippingtocountries
limitshippingtocountries
Limit shipping to these countries only. Full country text, comma separated. eg "New Zealand, Australia" (Validation: New Zealand, Australia)
text
p_listed
listed
Timestamp this product record was created
timestamp
p_location
location
Confidential location of the stock, eg shelf/bin number
text
p_madeincountry
madeincountry
Country Code of origin. (2 digit country code, one code only. Used with market places. (Validation: NZ,AU,US,CA,CM,JP etc)
text
p_manufact_sku
manufact sku
Manufacturer code, eg barcode or ISBN 
text
p_manufacturer
manufacturer
Name of manufacturer
text
p_maxlevelforsee
maxlevelforsee
Hide from wholesale option, as per member level, eg 175 only for retail visibility only 999 wholesale members can view (Validation: 175,999, )
int
Max Len: 11
p_maxqty
maxqty
The max quantity that can be purchased per order. (Validation: ignore if 0)
decimal
Precision: 10.2
p_metadesc
metadesc
SEO meta description
text
p_metakeywords
metakeywords
SEO meta keywords
text
p_metatitle
metatitle
SEO meta title
text
p_minlevelforbuy
minlevelforbuy
Only members with this security level can buy this product. A value of 0 means anyone can buy this procuct
int
Max Len: 11
p_minlevelforprice
minlevelforprice
Only members with this security level can see the product price. A value of 0 means anyone can see the price
int
Max Len: 11
p_minlevelforsee
minlevelforsee
Only members with this security level can see the product. A value of 0 means anyone can see the product
int
Max Len: 11
p_minqty
Minimum Purchase Quantity
The min quantity that must be purchased per order (Validation: ignore if 0)
text
Precision: 10.2
p_minqtytrade
Minimum Purchase Quantity Trade
The min quantity that must be purchased per order, before trade price  available. (Validation: ignore if 0)
text
Precision: 10.3
p_order
Order or Position
1 is public and visible, 0 is hidden, -99 is blocked (Validation: -99, 0, 1)
int
Max Len: 11
p_outofstockmessage
Stock Availability Message
A customer defined text message to warn customer of specifics relating to availability. The existence of this message overrides default messages, and is considered a warning, so should be used for edge cases, not for global information
text
p_postpay_info
postpay info
Information to be provided on invoices/receipts after payment. This might be a product key or instructions. Designed to give information only once payment received, but only unique per product, not per order.
text
p_price
Main Checkout Price
The primary checkout price (excl Tax or GST). Correct to 3 Decimal places in database. (Validation: required, 0=free)
text
Precision: 13.3
p_pricea
VIP Member Group A Price
The price for VIP or members in price group A (Validation: <=price)
text
Precision: 10.2
p_priceb
Member Group B Price
The price for members in price group B
text
Precision: 10.2
p_pricebreaka
Price Break A Unit Price
Quantity price break price A, subject to minimum quantity **p_pricebreaka_minqty**
text
Precision: 13.3
p_pricebreaka_minqty
Price Break A Min Qty
Quantity required to get cheaper price **p_pricebreaka**
text
Precision: 10.3
p_pricebreaka_setup
Price Break A Setup Fee
Setup price added to total if Quantity Price break A is used.
text
Precision: 10.2
p_pricebreakb
Price Break B Unit Price
Quantity price break price B, subject to minimum quantity **p_pricebreakb_minqty**
text
Precision: 10.2
p_pricebreakb_minqty
Price Break B Min Qty
Quantity required to get cheaper price **p_pricebreakb**
text
Precision: 10.3
p_pricebreakb_setup
Price Break B Setup Fee
Setup price added to total if Quantity Price break B is used.
text
Precision: 10.2
p_pricebreakc
Price Break C unit price
Quantity price break unit price C, subject to minimum quantity **p_pricebreakc_minqty**
text
Precision: 10.2
p_pricebreakc_minqty
Price Break C Min Qty
Quantity required to get cheaper price **p_pricebreakc**
text
Precision: 10.3
p_pricebreakc_setup
Price Break C Setup Fee
Setup price added to total if Quantity Price break C is used.
text
Precision: 10.2
p_pricebreakd
Price Break D Unit Price
Quantity price break price D, subject to minimum quantity **p_pricebreakd_minqty**
text
Precision: 10.2
p_pricebreakd_minqty
Price Break D Min Qty
Quantity required to get cheaper price **p_pricebreakd**
text
Precision: 10.3
p_pricebreakd_setup
Price Break D Setup Fee
Setup price added to total if Quantity Price break D is used.
text
Precision: 10.2
p_pricebreake
Price Break E Unit Price
Quantity price break price E, subject to minimum quantity **p_pricebreake_minqty**
text
Precision: 10.2
p_pricebreake_minqty
Price Break E Min Qty
Quantity required to get cheaper price **p_pricebreake**
text
Precision: 10.3
p_pricebreake_setup
Price Break E Setup Fee
Setup price added to total if Quantity Price break E is used.
text
Precision: 10.2
p_pricebreakf
Price Break F Unit Price
Quantity price break price F, subject to minimum quantity **p_pricebreakf_minqty**
text
Precision: 10.2
p_pricebreakf_minqty
Price Break F Min Qty
Quantity required to get cheaper price **p_pricebreakf**
text
Precision: 10.3
p_pricebreakf_setup
Price Break F Setup Fee
Setup price added to total if Quantity Price break F is used.
text
Precision: 10.2
p_pricec
Member Group C Price
The price for members in price group C
text
Precision: 10.2
p_priced
Member Group D Price
The price for members in price group D
text
Precision: 10.2
p_pricee
Member Group E Price
The price for members in price group E
text
Precision: 10.2
p_pricef
Member Group F Price
The price for members in price group F
text
Precision: 10.2
p_priceg
Member Group G Price
The price for members in price group G
text
Precision: 10.2
p_priceh
Member Group H Price
The price for members in price group H
text
Precision: 10.2
p_priceprediscount
priceprediscount
RRP Price prior to discount (Validation: >=price)
decimal
Precision: 13.3
p_price_prefix
price prefix
Words that might prefix a price in special circumstances eg From, Estimated, Approx, etc
text
p_private_stock_notes
private stock notes
Confidential notes that the merchant keeps about the stock availability, but not visible to customers.
text
p_promo_classes
promo classes
Custom CSS promptional classes that are added to a product to create visual stamps or ohter CSS outcomes
text
p_promote
promote
The most recently assigned featured product stamp. A product can be featured in multiple places, but this value is only the most recent stamp
text
p_promote_price_incl
Tax Inclusive Price
The tax inclusive price that retail customers would pay. This is not the main price. This price is derived from the main price including any general discounts. (Readonly)
text
Precision: 10.2
p_qtyinc
qtyinc
The increment unit, eg if an item is only sold by the dozen, then 12, or if decimals are permitted, then 0.1 (Validation: >0 )
decimal
Precision: 10.3
p_qtyinstock
qtyinstock
Stock on hand. This value excludes recent sales that have already decremented this value. This number can go into negatives, typically in a back order situation. There is no break down by location
decimal
Precision: 12.3
p_qtylowstock
qtylowstock
An arbitrary point when stock is considered too low, and reordering is urgent.
decimal
Precision: 10.3
p_qtyonorder
qtyonorder
Total quantity in submitted purchase orders awaiting delivery. Value likely to be reset when purchase orders are edited. (Validation: 0+)
decimal
Precision: 10.3
p_recipe_type
recipe type
The type of assembled part recipe, determines how products are synced to  (Validation: REVEALRECIPE,PACKAGE or NULL)
text
p_replenishqty
replenishqty
If enabled, the qty in stock will be reset to this value every morning. Typically used by cafes and bakeries who cook 10 dozen muffins every day, or something like that. Ignored if 0 (Validation: ignore if 0)
decimal
Precision: 10.3
p_sale_ends
sale ends
On this date/time the sale price will end, and the main price will revert to the value of the p_priceprediscount if a value exists.
timestamp
p_sale_items_left
sale items left
How many items left on sale price, if greater than 0. Once it gets to 0, then prediscount price applies. This number is visible to customer, and is used to encourage a scarcity decision.
int
Max Len: 11
p_season_pricing
season pricing
Seasonal pricing matrix applies
int
Max Len: 11
p_shipping
shipping
Fixed unit cost for domestic shipping on top of any other freight fees.
decimal
Precision: 10.2
p_shipping_int
shipping int
Fixed unit cost for international shipping on top of any other freight fees 
decimal
Precision: 10.2
p_showbuybutton
showbuybutton
Buy button is hidden if this value is false.
bool
Max Len: 1
true/false
p_size
size
The default or variant size
text
p_stock_checked
stock checked
The date of the last stock take, eg when this product last had it's qty in stock "set" as a new total, by a CMS web form.
timestamp
p_stock_display
stock display
Override default stock display rules (Validation: eg OOS,NONE,QTY,etc)
text
p_stock_enquiry_count
stock enquiry count
Count of open enquiries related to this product (Validation: 0+)
int
Max Len: 11
p_style
style
The default or variant style/option
text
p_subtitle
subtitle
Sub title of product h2, optional field
text
p_supplieraccountcode
supplier account code
Supplier code is used with some APIs where this value is required, otherwise null
text
p_suppliercode
supplier code
Product code used for purchasing new stock 
text
p_suppliername
supplier name
Name of supplier
text
p_supplierprice
supplier price
Known cost of item to replace from supplier
text
Precision: 10.2
p_supplier_puq
supplier puq
The incremental unit for purchase orders. eg if a supplier only allows purchases by the dozen, then PUQ is 12
decimal
Precision: 10.2
p_tab_applications
Applications Tab
Additional information about product applications revealed in a tabbed interface (Validation: HTML)
text
p_tab_contents
Contents Tab
Additional information about product contents revealed in a tabbed interface (Validation: HTML)
text
p_tab_features
Features Tab
Additional information about product features revealed in a tabbed interface (Validation: HTML)
text
p_tab_links
Links Tab
Additional links and information about the product revealed in a tabbed interface (Validation: HTML)
text
p_tab_moreinformation
More Information Tab
Additional information revealed in a tabbed interface (Validation: HTML)
text
p_tab_reviews
Reviews Tab
Additional information about product reviews revealed in a tabbed interface (Validation: HTML)
text
p_tab_specifications
SpecificationsTab
Additional information about product specifications revealed in a tabbed interface (Validation: HTML)
text
p_tab_termsconditions
Terms And Conditions Tab
Special product related terms and conditions revealed in a tabbed interface. Then presents  this also at checkout, and requires acceptable of combined T&C's (Validation: HTML)
text
p_tab_video
Video Tab
Additional information likely embedded product videos revealed in a tabbed interface (Validation: HTML)
text
p_target_quantity
Target Stock Quantity
The desired stock holding level. Purchase orders default to this number less stock on hand. (Validation: ignore if 0)
text
Precision: 10.3
p_uom
Unit Of Measure
Unit of Measure
text
p_updated
Last Updated
The time this product was last updated for core information, which should include when stock count changes. This may not be updated for long text fields
timestamp
p_vendor_notify
vendor notify
Email address of a vendor to supply the goods, in a drop shipping arrangement (Validation: Email)
text
p_voucher_createafter
voucher createafter
Delayed creation of the voucher, eg as a future incentive
interval
p_voucher_exclude_groupid
voucher exclude groupid
Allow voucher use for any category except this one. (Validation: Refers category.id)
int
Max Len: 11
p_voucherexpiry
voucher expiry
Interval signalling the date of expiry of voucher added to whatever the purchase date was.
interval
p_voucher_limit_groupid
voucher limit groupid
Limit voucher use to this category (Validation: Refers category.id)
int
Max Len: 11
p_voucher_limit_pid
voucher limit pid
Limit voucher use to this product (Validation: Refers product.id)
int
Max Len: 11
p_voucher_not_redeemable_online
voucher not redeemable online
Is this product a voucher that is not redeemable online (only redeemable in store)
bool
Max Len: 1
true/false
p_voucher_percent
voucher percent
Purchase of this product is a percentage based voucher, gives this percentage of discount of a future purchase.
text
Precision: 4.2
p_vouchervalue
vouchervalue
Purchase of this product is a fixed value voucher. The monetary value of the voucher that can be redeemed in the default currency of the shopping cart.
text
Precision: 10.2
p_weight
weight
Weight in grams, including packaging (Validation: 0+)
text
Precision: 12.3
p_width
width
Product dimension width in cm. Including packaging. (Validation: 0+)
text
Precision: 8.1

Usage Instructions and Examples

Useful use cases

1. Get all products

Return all products related to your website. Use GET to retrieve the data. Use additional parameters above. Use pagination if you have more than 100 products to return.

Example URL: https://api.cms-tool.net/webapps/api/product

"data": [
{
"p_title": "prod1",
"p_price":  10.00,
"pid": 1234,
...
}
]
}

1b. Get 1 product

Return 1 product, with all additional meta data. Use GET to retrieve the data. In this case, data is a single object. 

Example URL: GET https://api.cms-tool.net/webapps/api/product?id=12345

{

"data": 

{

"p_title": "prod1",

"p_price":  10.00,

"pid": 12345,

...

}

}

}

2. Create a new product

To create a new product you do not need to include an id in the data JSON. All the other information provided will be used to create a new Product.

To add the product to an existing category include : "p_groupid" : group id number. where the group id number can be found from the category endpoint.

{

   "p_title": "Bag",

   "p_price": 50.00,

   "p_qtyinstock": 25.0

}

The above JSON will create a new product with name Bag, price 50 and quantity in stock 25.

3. Update an existing product

To update an existing product include the product id and the fields you would like to update in the data JSON value. Only provide the minimal fields you would like to update in the data. You can also update a product by providing only a p_code instead of an ID, however, it will only update the first match.

In this example, we already know the ID, and only update stock count and price.

{
    "id": 12345,
    "p_qtyinstock": 5.000,
    "p_price": 25.00
}

Product Options

Some Products have sizes/colours/styles associated with it. We can create new options and update existing options for a Product.
To do so, include a JSON Array of styles/colours/sizes and provide p_option_type, p_option keys. The option name is p_option and the option type is p_option_type. The type is optional here while the name has to be unique.
To update any option include the option_id to identify the option to update. See below examples.

1. View Product options

To view the product options related to an individual product, GET the Product using the product ID

Example URL: https://api.cms-tool.net/webapps/api/product?id=12345

The product options will be contained in one of the 3 array elements, highlighting it's type. If the product contains variants, there is no guarantee that the sizes/colours/styles will be represented here, as our system can generate that data on the fly from the variant data.

{
  "id": 12345,
  ...
  "DisplayOptions": {
    "p_sizes": [
       {
           "option": "small"
       },
       {
           "option": "normal"
       },
       {
           "option": "large"
       }
    ],
    "p_colours": [...],
    "p_styles": [...],
    ....
  }
  ...
} 

2. Create/Update options/sizes/colours/styles

To update any option list, please provide an array of json objects (a complete list), where at least "option" is provided. The below example replaces the size list for product 12345.

{
 "id": 12345,
 "DisplayOptions": {
    "p_sizes": [
       {
           "option": "small"
       },
       {
           "option": "normal"
       },
       {
           "option": "large",
           "cost": 10.00,
           "img": "/images/swatchImage.jpg"
       }
   ]
 }
}

3. Deleting options/sizes/colours/styles

The API needs to provide a complete list of options, if any option list is provided. 

If you provide an incomplete array, then this will replace the old option list (thus deleting any that were excluded)

If you provide an empy array or set the array to null, then this will delete that option list. 

If you do not provide the key for the array, then no changes are made. 

The parameter "DeleteMissingArrayElements" has no meaning in this area. 


Product Variants

Product variants are different type of product options as they give you control over the stock quantity of the variation. Creating and updating a variant is similar to product with the key difference that a variant has a parent id. 

1. Insert a Product Variant

To create a new variant provide the variant(s) in the "variants" array. Every variant must have a parent id and hence the id key field must be provided. In the below example we are creating a new variant Large Red variant under the product id 12345. The rest of the information will be used to create the variant.

   "id": 12345,
   "variants": [ 

{

   "id": 12345,

   "variants": [

       {

           "p_size": "Large",

           "p_colour": "Red",

           "p_qtyinstock": 10,

           "p_price": 15.00,

           "p_code": "ABC123",

           "p_img": "image_url.jpeg"

       },

  ...

   ]

}

2. Update Product Variant

To update a variant include the id of the variant or the code to identify the variant. You must also provide the parent id of the variant. All the information provided with it will be used to update the variant. In the below examples we are updating the variant using id in the left example and using the code in the right.

{                                                            
   "id": 12345,                            
   "variants": [
          { 
              "id": 1234,
              "p_size": "Medium"
          }    
      ]
}
                                                               
   "id": "12345",                                
    "variants": [         
                       
            "p_code": "Code123",              
            "p_size": "Medium"         
         }          
    ]
}

3. Delete Product Variant 

Set the product order status to delete a specific variant. That variant may remain in the database, but it will not be visible to anyone. 

eg  "p_order":-999 

Or, add a request parameter, or a json data parameter (in top level) called "DeleteMissingArrayElements" and we will delete any items that are not in your array.  {Feature under construction}

Pro Tips: 

GST Pricing

Prices via API excl GST, and using 3 decimal points is good to ensure tidy round inclusive pricing. We don't have a GST component field, so if you want inclusive = 12.00, then you need to push price=10.435 Alternatively we can "round" all prices to 10cents if the merchant wants.

Category Ordering

Products can exist in multiple categories. The category exposure is visible or managed in 2 different ways. The hard connection to categories is via the p_group* fields. And a softer linkage is via a nested "groupOrdering" where you can control the ordering within a category. 

The ordering is any number > 0, and need not be sequential. Lowest numbers position at the top, and higher numbers position further down the page. These numbers may be automatically converted by our system to sequential positions should any item be repositioned within the CMS.  You can use either approach to add and remove products from categories. 

You can use pg_groupid or category_id interchangeably, both are valid. Same for pg_order or category_order. We now supply a read only field category_name for the text of the category. 

If you use the p_groupid* approach, then we will only remove the product from a category if the p_groupid is a negative number. If you do not supply these keys in your update, then no changes will occur.

If you do not provide a complete category ordering array, then we will not remove category linking, unless you specifically add a request parameter, or a json data parameter (in top level) called "DeleteMissingArrayElements".   


Visibility

The p_order field is used to determine general visibility on page and in search.  The field p_order used to determine the position on the page of the product, but that has been deprecated and replaced with each product having a unique position within any category, where a product may belong in multiple categories. The position in categories is now managed in the array "groupOrdering"

  • "p_order":1,    (This is a ordinary visible product, the default value)
  • "p_order":0,    (This product is hidden from category lists, but remains a searchable product, and you can link to it as you like.)
  • "p_order":-1,    (This is a hidden product, and anyone can access if the link is known, but it is excluded from search)
  • "p_order":-99,    (This is a hidden/blocked product, and no one can access it)

Security Visibility

The p_minlevelforsee and p_maxlevelforsee fields are focused on a member security level.  Use the min level to require a password. Whereas, use a lower max level, to prevent your wholesale customers viewing the product. The 2 fields together create a range.  Similar fields and rules exist for categories, but products do need to be secured in their own right, as a product can be searched without reference to the multiple categories in which it may reside. 

  • "p_minlevelforsee":0     (Anyone can see this product)
  • "p_minlevelforsee":100     (Customers must login to see this product)
  • "p_minlevelforsee":600     (This product is visible only to POS users)
  • "p_minlevelforsee":999     (This is a blocked product, no one can see this)

Promotions / Featured Items

The "p_promote" field is reserved for visual "Stamps" that appear on the product list within a category. If you supply a p_promote field it will also be added to the "promotions" json array, with a default position. 

Use the "promotions" array to manage the promotional targets of your product. If you supply a promotion array, then the item will be promoted in all those categories, but no stamp is created.

You can specify any text as the product promotional stamp. Whereas the array is really intended for specified target areas. 

If you provide no promotions array, there will be no changes to the database for promotions. This is the general approach we have where you only need to supply data if you intend a change to happen. 

You can supply a promo_order of < 0 to force a delete of a specific promotion.

If you do provide an array, but do not provide a complete array, then we will still not adjust promotional lists, unless you specifically add a request parameter, or a json data parameter (in top level) called "DeleteMissingArrayElements".  

 

Stock Counts

Unlimited stock can be set as p_qtyinstock=9999, or any number less indicate how many are available. If you have sold 3 items on backorder, then the stock level is negative -3

Unlimited backorder stock can be set as p_backorder=9999, or any number less indicates how many are on back order.

There are several more fields to help with reports and stock level targeting.

p_qtyinstock is updated whenever items are sold, or when stock movements are specifically saved. This field can be overridden by specified API connections, and also by importing CSV data. We make a best effort to provide a robust stock count, but acknowledge the needs for many merchants to manage this number externally.

Sample Object


{
"p_aggregaterating":5,
"p_maxqty":0,
"p_qty_label":"Length",
"p_assembled_part_count":0,
"pid":1514650,
"p_voucher_limit_pid":0,
"p_backorder_maxqty":0,
"p_price":10,
"p_last_sale":"2021-12-06 09:52:59.027852",
"p_custom_fields":
{
}
,
"p_categories":"Main Test Products",
"p_order":1,
"groupOrdering":[
{
"pg_groupid":4772,
"pg_order":2
}
],
"id":1514650,
"p_minlevelforsee":0,
"p_pricebreakb_minqty":0,
"p_pricebreakc_minqty":0,
"p_pricebreaka_minqty":0,
"p_shipping_int":0,
"p_autoupgrade_mbrgrpid":0,
"p_title":"One small thing only",
"p_img":"/images/05.png",
"p_width":0,
"p_target_quantity":0,
"p_parentpid":0,
"p_customer_price_json":
{
}
,
"p_gst_rule":"t",
"p_buy_points":0,
"p_metadesc":"rtetre",
"p_groupid2":-9,
"p_depth":0,
"p_subscribetocampaignid":0,
"p_groupid8":-9,
"p_age_target":0,
"p_groupid7":-9,
"p_counter":0,
"p_deposit_pc":0,
"page":905,
"p_groupid4":-9,
"p_minqty":1,
"p_showbuybutton":"t",
"p_groupid3":-9,
"p_season_pricing":0,
"p_sale_items_left":9999,
"p_groupid6":-9,
"cid":517,
"p_groupid5":-9,
"p_duplicationid":0,
"p_privacy_mbrgroupid":0,
"p_autoupgrademember":0,
"p_vendorid":0,
"p_qtyonorder":0,
"p_group":"Main Test Products",
"p_calendar_count":0,
"p_bookingsequence":0,
"p_replenishqty":0,
"p_priceprediscount":13.043,
"p_childcnt":0,
"p_aggregateratingcount":0,
"p_supplier_puq":1,
"p_listed":"2017-02-03 14:03:07.639828",
"p_pricebreakb":0,
"p_pricebreaka":0,
"p_freight_exclude":"f",
"p_pricebreakc":0,
"p_shipping":0,
"p_priced":6.38,
"p_pricee":6.58,
"p_api_last_updated":"2017-02-03 14:03:07.639828",
"p_priceb":6.58,
"p_weight":0,
"p_pricec":6.58,
"p_priceh":6.58,
"p_pricef":6.58,
"p_priceg":6.58,
"p_cascade_pricing":"f",
"p_qtylowstock":0,
"p_qtyinstock":8,
"p_voucher_exclude_groupid":0,
"p_updated":"2021-12-06 09:52:59.027852",
"p_pricea":7.83,
"p_supplierprice":0,
"p_stock_enquiry_count":0,
"p_optioncount":0,
"p_qtyinc":0.1,
"p_groupid":4772,
"p_metakeywords":"retrwet",
"p_height":0,
"p_voucher_limit_groupid":0,
"p_promote_price_incl":11.5
}

API End Points

Content

Blog pages are usually presented as a list udner a primary page. Individual blog pages do not appear on the menu, only in lists. The blog engine also powers FAQ and gallery type pages
A website is made up of the primary navigational pages that create the primary menu, as well as hidden pages and member only pages. Pages can contain pages in a treelike structure, however, this excludes sub pages which are defined as blogs or products

Ecommerce

Categories are used to group products. Products can belong in up to 8 categories. Categories can also form a tree, with Category parent ID = 0 being the parent level category. The term group is synomous with category, so many elements are prefixed with the word group.
Each product line of an order can be discounted, so an order can have multiple discounts, but only one per product.
The available payment methods at checkout. An order can only have 1 payment method, but the admin can change the payment method, and take part payments.
A saleable item, or variant of a parent product.
Invoices, orders, baskets and quotes are all represented by this object, and differentiated by status.
The courier or freight fee rules available for checkout. Each order can only have rule applied

Members

Bulk emails represent a newsletter that will be sent to a bulk audience via a mailing list. Alternatively, a bulk email is a sequence within a campaign.
A message is created for every contact us, enquiry form, or custom form.
Group members/customers, each member can belong to unlimited groups. Groups can contain groups
System security levels. Default level is 100 for general users.
Members or customers or users are the same thing. These are anyone who has purchased, enquired, or who has permission to login, or receive newsletters. This excludes administrative users.
A blog comment or product review uses the same engine. Each record may have a rating, as well as an optional comment, and is linked to an object and the person who posted it

Other

Bookings are for appointments, seats, hire items, etc. Not for events.
Use the Event Attendee endpoint to get your event attendee information on your site.
Events have a start/end date and additional information, they might be bookable, or just for informational purposes

Reference

A list of countries, and some meta data
Generic categories are those that relate to open source categorisations of products for SEO purposes