Stock Group
Stock groups drive the default sales, purchase and stock accounts posted when items move.
Path Parameter:
:CODE (string) — the group code in the URL pathEndpoints
GET
/stockgroupList stock groups with pagination and filters
GET
/stockgroup/:CODEGet a single stock group by code
POST
/stockgroupCreate a new stock group
PUT
/stockgroup/:CODEUpdate a stock group by code
DELETE
/stockgroup/:CODEDelete a stock group by code
Fields
| Field | Type | Required | Notes |
|---|---|---|---|
| code | string | Yes | Group code. Proven: "SG-01". |
| description | string | Yes | Group name. Proven: "Inventory Group A". |
| sales | string | No | Sales account code. Read from GET /account → data[].code. Default: null |
| salesreturned | string | No | Sales return account code. Default: null |
| cashsales | string | No | Cash sales account code. Default: null |
| purchase | string | No | Purchase account code. Default: null |
| cashpurchase | string | No | Cash purchase account code. Default: null |
| purchasereturned | string | No | Purchase return account code. Default: null |
| balancestock | string | No | Balance stock account code. Default: null |
| costingmethod | integer | No | Costing method. Integer only — not a string. Proven: 1. Default: 1 |
| attachments | string | No | File attachment reference. Default: null |
| isactive | boolean | No | Active flag. Proven: false. Default: true |
| lastmodified | integer | No | Unix timestamp, read-only. |
Examples
POST — Create Stock Group
POST /stockgroup
{
"code": "SG-01",
"description": "Inventory Group A"
}GET — List Stock Groups
GET /stockgroup?offset=0DELETE
DELETE /stockgroup/SG-01
Response: "OK" (plain text)Notes
- Every account field must reference an existing account code — call GET /account and read data[].code first.
- costingmethod must be a plain integer (1), not a quoted string.
