Category
Put multiple categories
Category
Put multiple categories
Create or Update multiple categories’
PUT
/
categories
curl --request PUT \
--url https://api.aasaan.shop/api/v1/stores/categories/ \
--header 'Content-Type: application/json' \
--data '[
{
"id": "ae7219",
"name": "Shampoo",
"slug": "shampoo",
"description": "Hair categories",
"hide": false,
"displayOrder": 0,
"parentCategoryId": "6124bc492f3660f743776404",
"image": {
"id": 0,
"url": "https://images.aasaan.app/123412421",
"type": "image/png"
}
}
]'
{
"categories": [
{
"id": "623d3455ec3c4b3548eb4a322",
"name": "Shampoo",
"slug": "shampoo",
"description": "Hair categories",
"hide": false,
"displayOrder": 0,
"parentCategoryId": "6124bc492f3660f743776404",
"image": {
"id": 0,
"url": "https://images.aasaan.app/123412421",
"type": "image/png"
},
"date_created": "2022-03-25T03:17:44.092Z",
"date_modified": "2022-06-10T07:51:12.510Z"
}
],
"errors": [
"Category with CategoryId - category-id-1 is missing name"
]
}
Body
application/json · object[]
id
Example:
"ae7219"
Name
Example:
"Shampoo"
Slug
Example:
"shampoo"
Shampoos and conditioners
Example:
"Hair categories"
Hide a category
Example:
false
Display order
Example:
0
Parent category id
Example:
"6124bc492f3660f743776404"
Response
201
application/json
Categories created or updated in the category array, errors for those categories that couldn't be updated or created.
Unique identifier for the resource that was used to create this category
Example:
"623d3455ec3c4b3548eb4a322"
Name
Example:
"Shampoo"
Slug
Example:
"shampoo"
Shampoos and conditioners
Example:
"Hair categories"
Hide a category
Example:
false
Display order
Example:
0
Parent category id
Example:
"6124bc492f3660f743776404"
Created date
Example:
"2022-03-25T03:17:44.092Z"
Modified date
Example:
"2022-06-10T07:51:12.510Z"
curl --request PUT \
--url https://api.aasaan.shop/api/v1/stores/categories/ \
--header 'Content-Type: application/json' \
--data '[
{
"id": "ae7219",
"name": "Shampoo",
"slug": "shampoo",
"description": "Hair categories",
"hide": false,
"displayOrder": 0,
"parentCategoryId": "6124bc492f3660f743776404",
"image": {
"id": 0,
"url": "https://images.aasaan.app/123412421",
"type": "image/png"
}
}
]'
{
"categories": [
{
"id": "623d3455ec3c4b3548eb4a322",
"name": "Shampoo",
"slug": "shampoo",
"description": "Hair categories",
"hide": false,
"displayOrder": 0,
"parentCategoryId": "6124bc492f3660f743776404",
"image": {
"id": 0,
"url": "https://images.aasaan.app/123412421",
"type": "image/png"
},
"date_created": "2022-03-25T03:17:44.092Z",
"date_modified": "2022-06-10T07:51:12.510Z"
}
],
"errors": [
"Category with CategoryId - category-id-1 is missing name"
]
}