Skip to main content
GET
/
categories
/
{id}
Get category by ID
curl --request GET \
  --url https://integrations.clopos.com/open-api/categories/{id} \
  --header 'x-brand: <api-key>' \
  --header 'x-token: <api-key>' \
  --header 'x-venue: <api-key>'
{
  "success": true,
  "data": {
    "id": 123,
    "parent_id": 123,
    "name": "<string>",
    "slug": "<string>",
    "type": "PRODUCT",
    "color": "<string>",
    "status": 123,
    "depth": 123,
    "_lft": 123,
    "_rgt": 123,
    "properties": {},
    "children": [
      {}
    ],
    "created_at": "2023-11-07T05:31:56Z",
    "updated_at": "2023-11-07T05:31:56Z"
  },
  "time": 123,
  "timestamp": "2023-11-07T05:31:56Z",
  "unix": 123
}

Purpose

Returns a single category, regardless of whether it is a root or subcategory, and optionally its child nodes.

HTTP Request

GET https://integrations.clopos.com/open-api/categories/{id}

Authorization

The following headers are required:
  • x-token
  • x-brand
  • x-venue

Request Example

curl -X GET "https://integrations.clopos.com/open-api/categories/1?include_children=true" \
  -H "x-token: oauth_example_token" \
  -H "x-brand: openapitest" \
  -H "x-venue: 1"

Response

200 OK — Category found

{
  "success": true,
  "data": {
    "id": 1,
    "parent_id": null,
    "name": "Beverages",
    "slug": "beverages",
    "type": "PRODUCT",
    "color": "#3498db",
    "status": 1,
    "depth": 0,
    "_lft": 1,
    "_rgt": 8,
    "properties": {
      "visible": true,
      "sortable": true,
      "description": "All beverages and drinks"
    },
    "children": [
      {
        "id": 2,
        "parent_id": 1,
        "name": "Coffee",
        "slug": "coffee",
        "type": "PRODUCT",
        "status": 1,
        "depth": 1,
        "children": []
      }
    ],
    "created_at": "2024-01-20T16:00:00Z",
    "updated_at": "2024-01-20T16:00:00Z"
  },
  "time": 12,
  "timestamp": "2024-01-20T16:05:00Z",
  "unix": 1705763100
}

404 Not Found — Category does not exist

{
  "success": false,
  "error": "resource_not_found",
  "message": "Category not found"
}

Field Reference

Top-Level Fields

FieldTypeDescription
successbooleanIndicates the success status of the request.
dataobjectCategory details.
timenumberResponse time.
timestampstringISO 8601 formatted time.
unixnumberUnix timestamp.

Category Object

FieldTypeDescription
idintegerCategory ID.
parent_idintegerParent category ID, null for root.
namestringCategory name.
slugstringURL-friendly identifier.
typestringPRODUCT, INGREDIENT, ACCOUNTING.
statusinteger1 = active, 0 = inactive.
depthintegerHierarchy level.
_lft, _rgtintegerNested set boundaries.
colorstringHEX color.
propertiesobjectAdditional visibility/setting info.
childrenarrayList of subcategories.
created_atstringCreation time.
updated_atstringLast update time.

Notes

  • The include_children=false parameter returns only a single category record; recommended for performance in large trees.
  • The returned children array recursively uses the same schema; be careful when processing the tree structure repeatedly on the client side.
  • Based on the type field in the response, you can read menu, content, or accounting categories from the same endpoint.
  • If the category is not found, it returns 404; add fallback or remapping logic on the client side.

Authorizations

x-token
string
header
required

Access token obtained from /auth endpoint

x-brand
string
header
required

Brand identifier

x-venue
string
header
required

Venue identifier

Path Parameters

id
string
required

Category ID

Query Parameters

include_children
boolean
default:true

Include nested child categories in the response

Response

Category retrieved successfully

success
boolean
data
object
time
integer
timestamp
string<date-time>
unix
integer