Skip to main content

Product Group API

The Product Group API returns a paginated list of product groups. This endpoint is not scoped to a store, so it does not require the x-store-id header.

Endpoint Details

Base URL: https://joptic.jethings.com

Required Headers

Authorization: Bearer <token>
No x-store-id header is needed because product groups are not store-scoped.

Get All Product Groups

Endpoint

Endpoint: GET /product-groups Retrieve all product groups with pagination, search, and sorting options.

Query Parameters

ParameterTypeRequiredDefaultDescription
pagenumberNo1Page number (minimum 1)
limitnumberNo10Page size (clamped to 1-100)
searchstringNo-Case-insensitive match on group name
isActivebooleanNo-Filters by status (true -> 1, false -> 0)
sortBystringNocreatedAtAllowed: title, ref, createdAt, updatedAt. Service maps createdAt, updatedAt, name; other values fallback to createdAt.
sortOrderstringNodescSorting order: asc or desc

Success Response

{
  "data": [
    {
      "id": "clx1a0z8e0001lga8s6s6x1a2",
      "store": null,
      "name": "1.56",
      "status": 1,
      "parent": null,
      "createdAt": "2024-01-01T00:00:00.000Z",
      "updatedAt": "2024-01-01T00:00:00.000Z"
    }
  ],
  "pagination": {
    "page": 1,
    "limit": 10,
    "total": 25,
    "totalPages": 3,
    "hasNext": true,
    "hasPrev": false
  }
}

Response Fields

FieldTypeDescription
dataarrayList of product group objects
data[].idstringProduct group ID
data[].storestring | nullStore reference (returned but not filtered)
data[].namestring | nullProduct group name
data[].statusnumberNumeric status flag (1 active, 0 inactive)
data[].parentstring | nullParent group reference if applicable
data[].createdAtstring | nullCreation timestamp (ISO 8601)
data[].updatedAtstring | nullLast update timestamp (ISO 8601)
paginationobjectPagination metadata
pagination.pagenumberCurrent page
pagination.limitnumberPage size
pagination.totalnumberTotal number of groups
pagination.totalPagesnumberTotal pages
pagination.hasNextbooleanWhether a next page exists
pagination.hasPrevbooleanWhether a previous page exists

Behavior Notes

  • Pagination clamps page to >= 1 and limit to 1-100.
  • Sorting falls back to createdAt if sortBy is not mapped.
  • store is returned for compatibility but not used for filtering.
  • status uses numeric flags (1 active, 0 inactive).

Example Request

curl -X GET "https://joptic.jethings.com/product-groups?page=1&limit=10&search=lens&isActive=true&sortBy=createdAt&sortOrder=desc" \
  -H "Authorization: Bearer <token>"