curl --location --request POST 'https://api.yourapp.com/subcategories' \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --data-raw '{ "name": "Smartphones", "description": "Mobile phones and related accessories", "category_id": 1 }'
{ "success": true, "message": "Subcategory created successfully", "data": { "subcategory": { "id": 1, "name": "Smartphones", "description": "Mobile phones and related accessories", "category": { "id": 1, "name": "Electronics", "description": "Electronic devices and components" }, "created_at": "2024-03-08T09:15:00.000000Z", "updated_at": "2024-03-08T09:15:00.000000Z" } } }
Create a new subcategory
Show data
Show subcategory
Show category