REST API v2.8

Product Groups

A Product Group contains the VAT and type (ie. product, service or gift card).

Get Product Groups

Endpoint

GET sites/{siteid}/productgroups

Parameters

start

The index of the item to start fromDefault: 0

num

The number of items returnedDefault: 10

fields

Comma separated list of fields to return. Use this to query only the fields you are using. Default is all fields in productgroup.

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 envelope with items of type productgroup.

Example

Request

GET https://api.mysitoo.com/v2/accounts/1500/sites/1/productgroups.json

Response

{ "totalcount": 4, "items": [ { "vatid": 2, "value": 25, "productgrouptype": 10, "productgroupname": "Common Goods", "comment": "Default Sales Tax" }, { "vatid": 3, "value": 6, "productgrouptype": 10, "productgroupname": "Books", "comment": "" }, { "vatid": 5, "value": 0, "productgrouptype": 30, "productgroupname": "Gift Cards", "comment": "" }, { "vatid": 6, "value": 25, "productgrouptype": 20, "productgroupname": "Consulting", "comment": "" } ] }

Add Product Group

Endpoint

POST sites/{siteid}/productgroups

Request body

See productgroup for fields.
Required fields:
productgroupname

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 vatid if successful.

Example

Request

POST https://api.mysitoo.com/v2/accounts/1500/sites/1/productgroups.json { "value": 0, "productgrouptype": 30, "productgroupname": "Gift Card" }

Response

7

Get Product Group

Endpoint

GET sites/{siteid}/productgroups/{vatid}

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 productgroup.

Example

Request

GET https://api.mysitoo.com/v2/accounts/1500/sites/1/productgroups/2.json

Response

{ "vatid": 2, "value": 25, "productgrouptype": 10, "productgroupname": "Common Goods", "comment": "Default Sales Tax" }

Update Product Group

Endpoint

PUT sites/{siteid}/productgroups/{vatid}

Request body

See productgroup for fields.

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/productgroups/7.json { "value": 14 }

Response

true

Delete Product Group

Endpoint

DELETE sites/{siteid}/productgroups/{vatid}

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

DELETE https://api.mysitoo.com/v2/accounts/1500/sites/1/productgroups/7.json

Response

true