|
| 1 | +# Product Categories |
| 2 | + |
| 3 | +* [List all categories](#list-all-categories) |
| 4 | +* [Retrieve a category](#retrieve-a-category) |
| 5 | +* [Create a category](#create-a-category) |
| 6 | +* [Update a category](#update-a-category) |
| 7 | +* [Delete a category](#delete-a-category) |
| 8 | +* [Upload a category image](#upload-a-category-image) |
| 9 | +* [Delete a category image](#delete-a-category-image) |
| 10 | + |
| 11 | +## List all categories |
| 12 | + |
| 13 | +``` |
| 14 | +GET /api/v1/product_categories |
| 15 | +``` |
| 16 | + |
| 17 | +#### Query parameters |
| 18 | + |
| 19 | +| Name | Type | Description | |
| 20 | +| --- | --- | --- | |
| 21 | +| `fields` | `string` | Comma-separated list of fields. Example `id,parent_id,name` | |
| 22 | +| `enabled` | `boolean` | Only enabled categories | |
| 23 | + |
| 24 | +## Retrieve a category |
| 25 | + |
| 26 | +``` |
| 27 | +GET /api/v1/product_categories/{category_id} |
| 28 | +``` |
| 29 | + |
| 30 | +## Create a category |
| 31 | + |
| 32 | +``` |
| 33 | +POST /api/v1/product_categories |
| 34 | +``` |
| 35 | + |
| 36 | +#### Request body |
| 37 | + |
| 38 | +| Name | Type | Description | |
| 39 | +| --- | --- | --- | |
| 40 | +| `name` | `string` | - | |
| 41 | +| `description` | `string` | - | |
| 42 | +| `meta_description` | `string` | - | |
| 43 | +| `meta_title` | `string` | - | |
| 44 | +| `enabled` | `boolean` | - | |
| 45 | +| `sort` | `string` | - | |
| 46 | +| `parent_id` | `string` | - | |
| 47 | +| `position` | `integer` | - | |
| 48 | +| `slug` | `string` | - | |
| 49 | + |
| 50 | +## Update a category |
| 51 | + |
| 52 | +``` |
| 53 | +PUT /api/v1/product_categories/{category_id} |
| 54 | +``` |
| 55 | + |
| 56 | +#### Request body |
| 57 | + |
| 58 | +| Name | Type | Description | |
| 59 | +| --- | --- | --- | |
| 60 | +| `name` | `string` | - | |
| 61 | +| `description` | `string` | - | |
| 62 | +| `meta_description` | `string` | - | |
| 63 | +| `meta_title` | `string` | - | |
| 64 | +| `enabled` | `boolean` | - | |
| 65 | +| `sort` | `string` | - | |
| 66 | +| `parent_id` | `string` | - | |
| 67 | +| `position` | `integer` | - | |
| 68 | +| `slug` | `string` | - | |
| 69 | + |
| 70 | +## Delete a category |
| 71 | + |
| 72 | +``` |
| 73 | +DELETE /api/v1/product_categories/{category_id} |
| 74 | +``` |
| 75 | + |
| 76 | +## Upload a category image |
| 77 | + |
| 78 | +``` |
| 79 | +POST /api/v1/product_categories/{category_id}/image |
| 80 | +``` |
| 81 | + |
| 82 | +## Delete a category image |
| 83 | + |
| 84 | +``` |
| 85 | +DELETE /api/v1/product_categories/{category_id}/image |
| 86 | +``` |
0 commit comments