Categories power the storefront navigation menu and product filtering system. They support a three-level hierarchy: department (first) → category (second) → subcategory (third). Brands are a flat resource that appear as both navigation facets and product metadata. Both resources drive the dropdowns used when creating or editing products.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/JuanSCaicedo/Api-Ecommerce/llms.txt
Use this file to discover all available pages before exploring further.
Mutating operations —
store, update, and destroy — on both categories and brands are throttled at 10 requests per minute per token.Authentication
All/api/admin/ endpoints require an admin JWT with type_user=1:
POST /api/auth/login.
Category Hierarchy Rules
The three-level hierarchy is encoded in two nullable foreign-key columns on every category row:| Level | categorie_second_id | categorie_third_id | Example |
|---|---|---|---|
| First | NULL | NULL | Electronics |
| Second | set (not NULL) | NULL | Smartphones |
| Third | set (not NULL) | set (not NULL) | Android Phones |
List Categories
id descending, 10 per page.
Request headers
| Header | Value |
|---|---|
| Authorization | Bearer <admin_token> |
Filter categories by
name (SQL LIKE %value%).Total matching categories across all pages.
Paginated category collection. Items live under the
data key (Laravel ResourceCollection envelope).Array of category objects for the current page. Each object includes
id, name, icon, imagen (resolved OCI URL or null), categorie_second_id, categorie_second (nested name object or null), categorie_third_id, categorie_third (nested name object or null), position, type_categorie, state, and created_at.Get Category Config (Dropdowns)
Returns all first-level and second-level categories for use in form dropdowns (e.g., when creating a new category). Note: this endpoint does not filter bystate — all categories at each level are returned regardless of state.
| Header | Value |
|---|---|
| Authorization | Bearer <admin_token> |
All top-level categories (
categorie_second_id = NULL, categorie_third_id = NULL).All second-level categories (
categorie_second_id != NULL, categorie_third_id = NULL).Unlike
GET /api/admin/products/config, the categories config endpoint only returns two levels (first and second), not thirds. Third-level categories are accessible via the main list endpoint.Get Category
Category ID.
Full category resource via
CategorieResource. Includes id, name, icon, imagen (OCI URL), categorie_second_id, categorie_second (nested {name} or null), categorie_third_id, categorie_third (nested {name} or null), position, type_categorie, state, and created_at.Create Category
| Header | Value |
|---|---|
| Authorization | Bearer <admin_token> |
| Content-Type | multipart/form-data |
Category display name. Must be unique across all categories.
Category image file (JPEG/PNG). Uploaded to OCI Object Storage under
juandevops/ecommerce/public/categories/. The OCI path is stored in the imagen column.1 = active (visible on storefront), 0 = inactive.Display order in navigation menus. Lower values appear first.
Icon identifier string (e.g., a Heroicons name or custom token used by the frontend).
Optional category type flag consumed by the frontend.
Parent category ID for second-level categories. Omit to create a first-level category.
Grandparent category ID for third-level categories. Set alongside
categorie_second_id.| To create | categorie_second_id | categorie_third_id |
|---|---|---|
| First-level | omit / null | omit / null |
| Second-level | parent ID | omit / null |
| Third-level | parent ID | grandparent ID |
200 on success, 403 on duplicate name.Newly created category ID.
Update Category
UsesPOST (not PUT/PATCH) to support multipart image uploads.
Category ID to update.
- Omit — leave the current image unchanged.
- Empty string (
"") — delete the existing image from OCI and setimagentonull. - New file — delete the old image from OCI and upload the replacement.
Delete Category
Category ID to delete.
List Brands
id descending.
Request headers
| Header | Value |
|---|---|
| Authorization | Bearer <admin_token> |
Filter brands by
name (SQL LIKE %value%).Total matching brands across all pages.
Array of brand objects. Each object contains
id, name, state, and created_at formatted as "YYYY-MM-DD hh:mm A". Note: the brands list is returned as a plain array (not wrapped in a data key).Create Brand
| Header | Value |
|---|---|
| Authorization | Bearer <admin_token> |
| Content-Type | application/json |
Brand display name. Must be unique.
1 = active, 0 = inactive.200 on success, 403 on duplicate name.The created brand object including
id, name, state, and created_at.Update Brand
Brand ID to update.
New brand name. Must be unique among other brands.
1 = active, 0 = inactive.200 on success, 403 on duplicate name.Updated brand object with
id, name, state, and created_at.Delete Brand
Brand ID to delete.