Index | Conventions

api/v1/stock/glgroup

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.

NoteAPI Logged on User permissions are adhered to like any other Jim User.
RelationshipTypeReturnsIncludablePatchable
cogsGLAccountGLAccountobject✓✗
poGLAccountGLAccountobject✓✗
salesGLAccountGLAccountobject✓✗

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.

NoteEach relationship you include embeds its full related resources in the response, so requesting includes — especially several at once, or to-many relationships that return every related row with no paging — can greatly increase the size of the payload. Only request the includes you actually need.

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:

AttributeTypeDescription
groupNamestringThe GL group's name.
stockTypestringThe stock type of the GL group.

Example GET (Return specific)

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.

{
  "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" }
    }
  ]
}