categories.md

Categories

Filter Categories

Authentication

Requires a valid API key in the X-API-KEY header.

Headers

Accept-Language

Indicates the preferred natural language and locale for localized content.

OData Query Support

$select

Comma-separated list of root-resource property names to include in the response. The available property names are published in /Categories/$metadata. Selecting properties of embedded resources is not supported.

Example: $select=cat_title,cat_description

$expand

Comma-separated list of embedded collections to include. By default, embedded collections are not included. Only embedded collections (not embedded resources) are supported.

Example: $expand=Products

$filter

OData v4.01 URI conventions. Filtering is restricted to properties of the root resource (Category).

Examples:

$orderby

Single property, ascending by default. Multi-property ordering and ordering on embedded properties are not supported.

Examples:

Pagination — $top, $skip, $skipToken

Paging applies only to the root resource (Category), never to embedded collections.

Response

200 OK — CollectionRepresentation with the matching Category resources, pagination metadata (Count, Skip, Top, HasNext, continuation token) and the cultures echoed from Accept-Language.

Error Responses

Example

Request:

GET /Categories?$filter=contains(cat_title,'pro')&$orderby=cat_title asc&$top=20 HTTP/1.1
X-API-KEY: your-api-key-here
Accept-Language: en-US

Response:

HTTP/1.1 200 OK
Content-Type: application/json

Create Category

Authentication

Requires a valid API key in the X-API-KEY header.

Headers

Accept-Language

Culture used to interpret the localized field values supplied in the request body.

Request Body

A single JSON object whose properties match the writable fields published by /Categories/$metadata. The body is normalized before reaching the application layer:

Response

201 Created — The Location header points to the new resource: /Categories({id}). No response body.

Error Responses

Example

Request:

POST /Categories HTTP/1.1
X-API-KEY: your-api-key-here
Accept-Language: en-US
Content-Type: application/json

{
  "cat_title": "Outdoor",
  "cat_ref": "OUT-001",
  "cat_description": "Outdoor products category"
}

Response:

HTTP/1.1 201 Created
Location: /Categories(123)

Get Category

Authentication

Requires a valid API key in the X-API-KEY header.

Headers

OData Query Support

$select

Comma-separated list of root-resource property names to include in the response. See /Categories/$metadata for the available properties. Selecting properties of embedded resources is not supported.

Example: $select=cat_title,cat_description

Example: $expand=Products

$filter, $orderby, $top, $skip and $skipToken are not applicable to this endpoint.

Response

200 OK — EntityRepresentation with the requested Category resource.

Error Responses

Example

Request:

GET /Categories(123)?$select=cat_title,cat_description&$expand=Products HTTP/1.1
X-API-KEY: your-api-key-here
Accept-Language: en-US

Response:

HTTP/1.1 200 OK
Content-Type: application/json

Update Category

Authentication

Requires a valid API key in the X-API-KEY header.

Headers

Request Body

A single JSON object with the subset of writable fields to update (PATCH semantics — only the supplied fields are modified). Field names must match those published by /Categories/$metadata. Normalization rules:

Response

200 OK — Update applied.

Error Responses

Example

Request:

PATCH /Categories(123) HTTP/1.1
X-API-KEY: your-api-key-here
Accept-Language: en-US
Content-Type: application/json

{
  "cat_title": "Outdoor & Camping"
}

Response:

HTTP/1.1 200 OK

Delete Category

Authentication

Requires a valid API key in the X-API-KEY header.

Response

204 No Content — Category deleted.

Error Responses

Example

Request:

DELETE /Categories(123) HTTP/1.1
X-API-KEY: your-api-key-here

Response:

HTTP/1.1 204 No Content

Filter Category Products

Authentication

Requires a valid API key in the X-API-KEY header.

Headers

OData Query Support

$select

Comma-separated list of root-resource property names to include in the response. See /Products/$metadata for the available properties. Selecting properties of embedded resources is not supported.

Example: $select=prod_description,prod_tags

$expand

Comma-separated list of embedded collections to include (e.g. Variants). By default, embedded collections are not included. Only embedded collections (not embedded resources) are supported.

Example: $expand=Variants

$filter

OData v4.01 URI conventions. Filtering is restricted to properties of the root resource (Product).

Examples:

$orderby

Single property, ascending by default. Multi-property ordering and ordering on embedded properties are not supported.

Examples:

Paging applies only to the root resource (Product), never to embedded collections.

Response

200 OK — CollectionRepresentation with the matching Product resources, pagination metadata (Count, Skip, Top, HasNext, continuation token) and the cultures echoed from Accept-Language.

Error Responses

Example

Request:

GET /Categories(123)/Products?$filter=contains(prod_description,'pro')&$top=20 HTTP/1.1
X-API-KEY: your-api-key-here
Accept-Language: en-US

Response:

HTTP/1.1 200 OK
Content-Type: application/json

Get Category Product

Authentication

Requires a valid API key in the X-API-KEY header.

Headers

OData Query Support

Example: $select=prod_description,prod_tags

Example: $expand=Variants

Response

200 OK — EntityRepresentation with the Product resource scoped to the given Category.

Error Responses

Example

Request:

GET /Categories(123)/Products(456)?$expand=Variants HTTP/1.1
X-API-KEY: your-api-key-here
Accept-Language: en-US

Response:

HTTP/1.1 200 OK
Content-Type: application/json

Get Categories Changelog

Authentication

Requires a valid API key in the X-API-KEY header.

OData Query Support

Supports $filter, $orderby, $top, $skip over the changelog fields. $select, $expand and $skipToken are not supported by this endpoint.

Response

200 OK — Collection of changelog entries (CollectionRepresentation).

Error Responses

Example

Request:

GET /Categories/Changelog?$orderby=changedAt desc&$top=50 HTTP/1.1
X-API-KEY: your-api-key-here

Response:

HTTP/1.1 200 OK
Content-Type: application/json

Get Category Changelog

Authentication

Requires a valid API key in the X-API-KEY header.

OData Query Support

Supports $filter, $orderby, $top, $skip over the changelog fields. $select, $expand and $skipToken are not supported by this endpoint.

Response

200 OK — Collection of changelog entries for the specified Category.

Example

Request:

GET /Categories(123)/Changelog?$top=20 HTTP/1.1
X-API-KEY: your-api-key-here

Response:

HTTP/1.1 200 OK
Content-Type: application/json

Get Category Layout

Each field carries an attributeId and a grid size — one of quarter, half, threeQuarters or row. When a row has a divider its dividerType is one of normal, wide or lineBreak. dividerType and dividerTitle are omitted from a row when they have no value, so a row without a divider contains only its fields.

The Category model has a single layout shared by all categories. A layout must already be configured for the tenant; if none exists the request fails.

Update Category Layout

A layout must already exist for the tenant; this operation replaces it and does not create one. If none exists the request returns 404 Not Found.

⚠️ All attributes are required

The payload must contain every attribute currently in the stored layout — no more, no less. Omitting an attribute removes it from the form. Adding an attribute that is not already in the layout is also rejected. Use GET /Categories/layout first to obtain the current set of attributes.

This is different from PATCH /v2/AttributeSets({id}), where layouts may contain any subset of the tenant's attributes.

Layout Structure

The payload has the same shape as the GET /Categories/layout response:

   {
     "sections": [
       {
         "title": "General",
         "rows": [
           {
             "fields": [
               { "attributeId": "cat_title", "size": "half" },
               { "attributeId": "cat_ref",   "size": "half" }
             ]
           },
           {
             "dividerType": "normal",
             "dividerTitle": "Details",
             "fields": [
               { "attributeId": "cat_description", "size": "row" }
             ]
           }
         ]
       }
     ]
   }

Validation Rules

If any rule is violated the request returns 400 Bad Request describing each failure:

Get Category Metadata

The schema should be consulted to build requests against the other Category endpoints (which fields can be used in $select, $filter, $orderby, request bodies, etc.).

Authentication

Requires a valid API key in the X-API-KEY header.

Response

200 OK — Returns the JSON Schema as a ServiceDocumentRepresentation.

Error Responses

Example

Request:

GET /Categories/$metadata HTTP/1.1
X-API-KEY: your-api-key-here

Response:

HTTP/1.1 200 OK
Content-Type: application/json