Skip to main content

GET /categories

List all active categories for the store, ordered by sort index.

Authentication

None required.

Example Request

curl "https://front.rmz.gg/api/categories"

Response

Success (200)

{
  "success": true,
  "data": [
    {
      "id": 1,
      "name": "Games",
      "slug": "games",
      "description": null,
      "image": null,
      "icon": null,
      "is_active": true,
      "sort_order": 0,
      "products_count": 24,
      "created_at": "2024-01-01T00:00:00.000000Z",
      "updated_at": "2024-06-15T10:30:00.000000Z"
    },
    {
      "id": 2,
      "name": "Software",
      "slug": "software",
      "description": null,
      "image": null,
      "icon": null,
      "is_active": true,
      "sort_order": 1,
      "products_count": 12,
      "created_at": "2024-01-01T00:00:00.000000Z",
      "updated_at": "2024-06-15T10:30:00.000000Z"
    }
  ]
}

GET /categories/

Get a single category by slug, including product count from child categories.

Authentication

None required.

Path Parameters

ParameterTypeDescription
slugstringCategory URL slug

Example Request

curl "https://front.rmz.gg/api/categories/games"

Response

Success (200)

{
  "success": true,
  "data": {
    "id": 1,
    "name": "Games",
    "slug": "games",
    "description": null,
    "image": null,
    "icon": null,
    "is_active": true,
    "sort_order": 0,
    "products_count": 36,
    "created_at": "2024-01-01T00:00:00.000000Z",
    "updated_at": "2024-06-15T10:30:00.000000Z"
  }
}
The products_count includes products from both the parent category and all its active child categories.

Error Responses

StatusDescription
404Category not found or inactive

GET /categories//products

Get products within a category. Includes products from child categories of the specified parent.

Authentication

None required.

Path Parameters

ParameterTypeDescription
slugstringCategory URL slug

Query Parameters

ParameterTypeRequiredDescription
searchstringNoSearch within category products (max 255 chars)
sortstringNoSort order: price_asc, price_desc, name_asc, name_desc, created_asc, created_desc. Default: newest first
per_pageintegerNoItems per page (1-50). Default: 19
typestringNoFilter by type: digital, subscription, course
price_minnumberNoMinimum price filter
price_maxnumberNoMaximum price filter
in_stockbooleanNoFilter to only in-stock products

Example Request

curl "https://front.rmz.gg/api/categories/games/products?sort=price_asc&per_page=12"

Response

Success (200)

Products use the same ProductResource structure as GET /products. See List Products for the full response schema.
{
  "success": true,
  "data": [
    {
      "id": 101,
      "name": "Premium Game Key",
      "marketing_title": null,
      "slug": "premium-game-key",
      "description": "Premium game activation key for PC",
      "short_description": "Premium game activation key for PC...",
      "type": "code",
      "status": 1,
      "is_featured": false,
      "is_noticeable": false,
      "is_new": false,
      "is_discounted": false,
      "is_discount_expired": false,
      "show_reviews": true,
      "price": {
        "original": 199.99,
        "actual": 199.99,
        "discount": null,
        "discount_expiry": null,
        "show_discount_countdown": false,
        "show_discount_savings": false,
        "savings_amount": 0,
        "formatted": "199.99 ر.س",
        "formatted_original": "199.99 ر.س",
        "discount_percentage": 0,
        "currency": "SAR"
      },
      "stock": {
        "available": 50,
        "unlimited": false,
        "min_qty": 1,
        "codes_count": 50,
        "is_in_stock": true
      },
      "sales": {
        "badge": null
      },
      "image": {
        "id": 1,
        "url": "https://...",
        "full_link": "https://...",
        "path": "...",
        "filename": "image.webp",
        "alt_text": "Premium Game Key"
      },
      "categories": [],
      "fields": null,
      "meta": null,
      "metadata": null,
      "tags": null,
      "seo": {
        "meta_title": null,
        "meta_description": null,
        "meta_keywords": null
      },
      "created_at": "2024-06-15T10:30:00.000000Z",
      "updated_at": "2024-06-15T10:30:00.000000Z"
    }
  ],
  "pagination": {
    "current_page": 1,
    "last_page": 3,
    "per_page": 19,
    "total": 36,
    "from": 1,
    "to": 19,
    "has_more_pages": true,
    "next_page_url": "...",
    "prev_page_url": null
  }
}

Error Responses

StatusDescription
404Category not found or inactive
422Validation error on query parameters