Path: api/v1/stock/glgroup
This API is JSON:API compliant.
This endpoint supports the following methods:
GET
This endpoint requires an OAuth bearer token, and returns errors in a standard shape. See API Conventions for authentication, error responses and paging, which apply to every endpoint.
The resource type for this endpoint is StockGLGroup
The identifier is groupno
Relationships
A relationship links this StockGLGroup to another resource. Includable relationships can be embedded via the include query parameter (see Includes below). Patchable relationships can be changed via PATCH.
| Relationship | Type | Returns | Includable | Patchable |
|---|---|---|---|---|
| cogsGLAccount | GLAccount | object | ✓ | ✗ |
| poGLAccount | GLAccount | object | ✓ | ✗ |
| salesGLAccount | GLAccount | object | ✓ | ✗ |
Includes
Use the include query parameter to embed Includable relationships in a single response, for example:GET /api/v1/stock/glgroup/{groupno}?include=poGLAccount,cogsGLAccount,salesGLAccount
Embedded resources are returned in a top-level included array, not nested inside the relationship. Match each one back to its relationship by type and id.
For example, requesting include=poGLAccount returns the poGLAccount reference under relationships and the full resource in the included array. The reference and the included entry share the same type and id:
GET /api/v1/stock/glgroup/{groupno}?include=poGLAccount
{
"data": {
"type": "StockGLGroup",
"id": "1001",
"relationships": {
"poGLAccount": {
"data": { "type": "GLAccount", "id": "2002" }
}
}
},
"included": [
{
"type": "GLAccount",
"id": "2002",
"attributes": { ... }
}
]
}
Attributes
The StockGLGroup resource type attributes are as follows:
| Attribute | Type | Description |
|---|---|---|
| groupName | string | The GL group's name. |
| stockType | string | The stock type of the GL group. |
Path: api/v1/stock/glgroup/1?include=poGLAccount,cogsGLAccount,salesGLAccount Response: This example shows the maximum set of fields the endpoint can return, all populated. A real response only contains the data that applies to that record, so fields that are empty or not relevant are omitted — do not assume every field shown here will be present in every response.
Example GET (Return specific)
{
"data": {
"id": "1",
"type": "StockGLGroup",
"attributes": { "groupName": "STOCK", "stockType": "Depleting, Special" },
"relationships": {
"poGLAccount": { "data": { "type": "GLAccount", "id": "410" } },
"cogsGLAccount": { "data": { "type": "GLAccount", "id": "520" } },
"salesGLAccount": { "data": { "type": "GLAccount", "id": "310" } }
},
"links": { "self": "/api/v1/stock/glgroup/1" }
},
"included": [
{
"type": "GLAccount", "id": "410",
"attributes": {
"accCode": "1-1400", "accName": "Inventory / Stock on Hand",
"accType": "Detail", "classification": "Asset", "accNature": "Debit",
"active": true, "expense": false, "control": false,
"taxCode": "GST", "currencyCode": "AUD"
},
"links": { "self": "/api/v1/accounting/gl/410" }
},
{
"type": "GLAccount", "id": "520",
"attributes": {
"accCode": "5-2000", "accName": "Cost of Goods Sold",
"accType": "Detail", "classification": "Cost Of Sales", "accNature": "Debit",
"active": true, "expense": false, "control": false,
"taxCode": "GST", "currencyCode": "AUD"
},
"links": { "self": "/api/v1/accounting/gl/520" }
},
{
"type": "GLAccount", "id": "310",
"attributes": {
"accCode": "4-1000", "accName": "Sales - Stock",
"accType": "Detail", "classification": "Income", "accNature": "Credit",
"active": true, "expense": false, "control": false,
"taxCode": "GST", "currencyCode": "AUD"
},
"links": { "self": "/api/v1/accounting/gl/310" }
}
]
}