Stock Item
Manage inventory items including product codes, descriptions, pricing, and stock control settings.
Path Parameter:
:DOCKEY (integer) — internal ID, NOT the item codeEndpoints
GET
/stockitemList all stock items
POST
/stockitemCreate new stock item
PUT
/stockitem/:DOCKEYUpdate stock item by internal ID
DELETE
/stockitem/:DOCKEYDelete stock item by internal ID
Fields
| Field | Type | Required | Notes |
|---|---|---|---|
| dockey | integer | No | Auto-assigned internal ID. Used in URL path for PUT/DELETE. |
| code | string | Yes | Stock item code / SKU. |
| description | string | Yes | Item name / description. |
| stockgroup | string | No | Stock group for accounting. Auto-defaults to DEFAULT. Get from GET /stockgroup. Default: "DEFAULT" |
| stockcontrol | boolean | No | Track inventory quantity. Set false for non-stock items. Default: true |
| costingmethod | integer | No | Inventory costing method. 1 = FIFO. Default: 1 |
| sltax | string | No | Sales tax code. Get from GET /tax. Default: null |
| phtax | string | No | Purchase tax code. Get from GET /tax. Default: null |
| barcode | string | No | Product barcode. Default: null |
| refcost | string | No | Reference cost price. Default: null |
| refprice | string | No | Reference selling price. Default: null |
Examples
POST — Create Stock Item (Minimal)
POST /stockitem
{
"code": "STK-001",
"description": "Product Name"
}POST — Create Stock Item (Full)
POST /stockitem
{
"code": "STK-001",
"description": "Product Name",
"stockgroup": "SG-01",
"stockcontrol": true,
"barcode": "1234567890",
"refcost": "50.00",
"refprice": "100.00"
}Finding dockey for PUT/DELETE
GET /stockitem?code=STK-001
Response:
{
"pagination": { "offset": 0, "limit": 50, "count": 1 },
"data": [
{
"dockey": 1,
"code": "STK-001",
"description": "Product Name",
...
}
]
}DELETE (by dockey, not code)
DELETE /stockitem/1
Response: "OK" (plain text)Critical: Use :DOCKEY (integer) in URL path for PUT/DELETE, NOT the code. To find dockey: GET /stockitem?code=STK-001 and read data[].dockey.
