Product Variants
Get Product Variants
get /sites/{siteid}/products/{productid}/productvariantsReturns an item of type productvariants. This item contains all variants for the product.
{ "groups": [ { "name": "Color", "options": [ "Red", "Blue" ] }, { "name": "Pattern", "options": [ "Striped", "Plaid" ] } ], "variants": [ { "productid": 21, "active": true, "activepos": true, "title": "Blanket Red Striped", "sku": "54051-1", "deliverystatus": "", "moneyprice": "59.00", "moneypriceorg": "59.00", "moneypricein": "8.00", "moneyofferprice": "0.00", "barcode": null, "barcodealiases": [], "friendly": "blanket-red-striped", "attributes": [ "Red", "Striped" ], "pricelisthasvolume": false }, { "productid": 22, "active": true, "activepos": true, "title": "Blanket Red Plaid", "sku": "54051-2", "deliverystatus": "", "moneyprice": "69.00", "moneypriceorg": "69.00", "moneypricein": "12.00", "moneyofferprice": "0.00", "barcode": null, "barcodealiases": [], "friendly": "blanket-red-plaid", "attributes": [ "Red", "Plaid" ], "pricelisthasvolume": false }, { "productid": 23, "active": true, "activepos": true, "title": "Blanket Blue Plaid", "sku": "54051-3", "deliverystatus": "", "moneyprice": "69.00", "moneypriceorg": "69.00", "moneypricein": "12.00", "moneyofferprice": "0.00", "barcode": null, "barcodealiases": [], "friendly": "blanket-blue-plaid", "attributes": [ "Blue", "Plaid" ], "pricelisthasvolume": false } ]}
HTTP Status Code Summary | |
---|---|
200 | Returns an item of type productvariants. This item contains all variants for the product. |
400 | Bad Request. Invalid syntax, missing required argument or invalid request. |
401 | Unauthorized. Authorization failed. |
404 | Resource not found. The url is invalid. |
429 | Too Many Requests. |
500 | Internal Server Error. |
Set Product Variants
put /sites/{siteid}/products/{productid}/productvariantsNote that current variants will either be replaced or deleted with the new variants.
{ "groups": [ { "name": "Color", "options": [ "Red", "Purple" ] } ], "variants": [ { "productid": 21, "active": true, "activepos": true, "title": "Blanket Red", "sku": "54051-1", "deliverystatus": "", "moneyprice": "59.00", "moneypriceorg": "59.00", "moneypricein": "8.00", "moneyofferprice": "0.00", "barcode": "", "friendly": "blanket-red", "attributes": [ "Red" ] }, { "productid": 0, "active": true, "activepos": true, "title": "Blanket Purple", "sku": "54051-10", "deliverystatus": "", "moneyprice": "189.00", "moneypriceorg": "0.00", "moneypricein": "8.00", "moneyofferprice": "0.00", "barcode": "", "friendly": "blanket-purple", "attributes": [ "Purple" ] } ]}
true
HTTP Status Code Summary | |
---|---|
200 | Returns true |
400 | Bad Request. Invalid syntax, missing required argument or invalid request. |
401 | Unauthorized. Authorization failed. |
404 | Resource not found. The url is invalid. |
429 | Too Many Requests. |
500 | Internal Server Error. |
Objects
moneystring
productvariantobject
Product variant data.
The unique internal productid. It is unique over all sites in the system.
If false, the product is not shown in in the Webshop.
If false, the product is not shown in in the POS.
Title of product (ie. Product Name).
Stock Keeping Unit (ie. the article number). If entered, it needs to be unique for the site.
Delivery status. If set then it overrides any Stock texts on the site. If not set (ie. empty) then the stock is displayed using the stockcount field.
Price of the product. If this field is used for setting price on a product, the price will be set for the "Default" price list. It is recommended to use the Price Lists endpoints for setting product prices instead.
Suggested Retail Price (SRP)
Purchase price which can be used to help calculate profit on products. (Always excluding VAT)
If the product is in offer mode, the offerprice will be used instead of the price. The product is in offer mode if enabled and within the offer date period. (Deprecated, use price lists instead)
Barcode for the product.
Barcode aliases for the product. Used if multiple barcodes exist for product.
Friendly name. Absolute url = site url + friendly.
Array of attributes (string). It corresponds to the groups array in productvariants. For each group in productvariants this array must have a value at the same index and with a value from the corresponding options array.
True if product has volume pricing. (Deprecated, use price lists instead)
productvariantgroupobject
Product variant group with options.
Name of product variant group.
Options. Eg. ["Red", "Blue", "Pink"].
productvariantsobject
Product variants collection.
Array of productvariantgroup.
Array of productvariant.