Add, modify, or delete department
Add a new department to your catalog
| Name | Necessary | Description |
|---|---|---|
shopID | Yes | Your institution's identifier |
key | Yes | Your API key |
data[title] | Yes | Title (required) |
data[shortTitle] | No | Short title |
data[stock] | No | Quantity in stock |
data[vatID] | No | VAT rate ID |
data[eatinvatID] | No | VAT rate ID on site |
data[discountID] | No | ID of the discount |
data[price] | No | Selling price |
data[keyboardHide] | No | Hide from the sales interface |
data[shopHide] | No | Hide from the shop |
data[position] | No | Position (on the interface) |
data[deptGroupID] | No | Department Group ID |
data[unitID] | No | Unit ID |
data[needPrepa] | No | Area for preparing the department |
data[variationID0] | No | ID variation 0 |
data[variationID1] | No | ID variant 1 |
data[variationID2] | No | ID variant 2 |
data[variationID3] | No | ID variant 3 |
data[variationID4] | No | ID variant 4 |
data[activityCode] | No | Activity accounting code |
Edit a department of your catalog
| Name | Necessary | Description |
|---|---|---|
shopID | Yes | Your institution's identifier |
key | Yes | Your API key |
id | Yes | Department Identifier |
data[title] | No | Title (required) |
data[shortTitle] | No | Short title |
data[stock] | No | Quantity in stock |
data[vatID] | No | VAT rate ID |
data[eatinvatID] | No | VAT rate ID on site |
data[discountID] | No | ID of the discount |
data[price] | No | Selling price |
data[keyboardHide] | No | Hide from the sales interface |
data[shopHide] | No | Hide from the shop |
data[position] | No | Position (on the interface) |
data[deptGroupID] | No | Department Group ID |
data[unitID] | No | Unit ID |
data[needPrepa] | No | Area for preparing the department |
data[variationID0] | No | ID variation 0 |
data[variationID1] | No | ID variant 1 |
data[variationID2] | No | ID variant 2 |
data[variationID3] | No | ID variant 3 |
data[variationID4] | No | ID variant 4 |
data[activityCode] | No | Activity accounting code |
Remove a department from your catalog
| Name | Necessary | Description |
|---|---|---|
shopID | Yes | Your institution's identifier |
key | Yes | Your API key |
id | Yes | Department Identifier |
async function editDept(){ const body = new URLSearchParams({ shopID: SHOPID, key: APIKEY, id: 123, 'data[title]': 'New title' }); const res = await fetch("https://kash.click/workers/editDept.php", { method: "POST", headers: { "Content-Type": "application/x-www-form-urlencoded" }, body }); let payload; try{ payload = await res.json(); }catch{ payload = await res.text(); } console.log(payload);}
This document is made available under the terms of the licence Creative Commons Attribution 4.0 International (CC BY 4.0) .