REST API v2.8

Product Variants

This interface is used for handling product variants.

Get Product Variants

Endpoint

GET sites/{siteid}/products/{productid}/productvariants

Parameters

pricelistid

Price list id. Set the pricelistid to specify a pricelist other than the default when getting the price field.Default: 1

HTTP Response Status

200

OK. Returns data (see below).

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.

Returns

Returns an item of type productvariants. This item contains all variants for the product.

Example

Request

GET https://api.mysitoo.com/v2/accounts/1500/sites/1/products/21/productvariants.json

Response

{ "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, "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, "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, "friendly": "blanket-blue-plaid", "attributes": [ "Blue", "Plaid" ], "pricelisthasvolume": false } ] }

Set Product Variants

Note that current variants will either be replaced or deleted with the new variants.

Endpoint

PUT sites/{siteid}/products/{productid}/productvariants

Request body

See productvariants for fields.
Required fields:
groupsvariants
Required productvariantgroup fields:
nameoptions
Required productvariant fields:
productidactiveactivepostitleskudeliverystatusmoneypricemoneypriceorgmoneypriceinmoneyofferpricebarcodefriendlyattributes
Note! The entire product variant structure will be overwritten in this call.

HTTP Response Status

200

OK. Returns data (see below).

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.

Returns

Returns true if successful.

Example

Request

PUT https://api.mysitoo.com/v2/accounts/1500/sites/1/products/21/productvariants.json { "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" ] } ] }

Response

true