Material subcategories

Get material subcategories

get

The API gives the ability to get all subcategories of material category.

Authorizations
Path parameters
idstringRequired

Material category id

Query parameters
skipnumberOptional
takenumberOptional
namestringOptional
Header parameters
x-tenant-idstring · uuidRequired

Tenant id (uuid v4)

Responses
200Success
application/json
Responseall of
and
get
/api/public/material-categories/{id}/subcategories
GET /api/public/material-categories/{id}/subcategories HTTP/1.1
Host: 
x-api-key: YOUR_API_KEY
x-tenant-id: 123e4567-e89b-12d3-a456-426614174000
Accept: */*
200Success
{
  "data": [
    {
      "id": "b86fa12a-76fc-46f5-8a3e-bf39e7be4c4e",
      "name": "Organic Cotton",
      "created_at": "2023-12-01T10:30:00.000Z",
      "updated_at": "2023-12-15T14:45:30.000Z",
      "material_category_id": "a75eb02c-65dc-35e4-9b2f-ce28d6ad3d3c"
    }
  ],
  "meta": {
    "total": 1,
    "lastPage": 1,
    "currentPage": 1,
    "perPage": 1,
    "prev": 1,
    "next": 1
  }
}

Create material subcategory

post

The API gives the ability to create new subcategory within a category.

Authorizations
Path parameters
idstringRequired

Material category id

Header parameters
x-tenant-idstring · uuidRequired

Tenant id (uuid v4)

Body
namestringRequired

Subcategory name

Example: Organic Cotton
Responses
201Success
application/json
post
/api/public/material-categories/{id}/subcategories
POST /api/public/material-categories/{id}/subcategories HTTP/1.1
Host: 
x-api-key: YOUR_API_KEY
x-tenant-id: 123e4567-e89b-12d3-a456-426614174000
Content-Type: application/json
Accept: */*
Content-Length: 25

{
  "name": "Organic Cotton"
}
201Success
{
  "id": "b86fa12a-76fc-46f5-8a3e-bf39e7be4c4e",
  "name": "Organic Cotton",
  "created_at": "2023-12-01T10:30:00.000Z",
  "updated_at": "2023-12-15T14:45:30.000Z",
  "material_category_id": "a75eb02c-65dc-35e4-9b2f-ce28d6ad3d3c"
}

Delete material subcategory

delete

The API gives the ability to delete subcategory.

Authorizations
Path parameters
idstringRequired

Material category id

subcategory_idanyRequired

Material subcategory id

Header parameters
x-tenant-idstring · uuidRequired

Tenant id (uuid v4)

Responses
200Success
application/json
delete
/api/public/material-categories/{id}/subcategories/{subcategory_id}
DELETE /api/public/material-categories/{id}/subcategories/{subcategory_id} HTTP/1.1
Host: 
x-api-key: YOUR_API_KEY
x-tenant-id: 123e4567-e89b-12d3-a456-426614174000
Accept: */*
200Success
{
  "message": "The operation was done successfully"
}

Update material subcategory

patch

The API gives the ability to update an existing subcategory’s name.

Authorizations
Path parameters
idstringRequired

Material category id

subcategory_idanyRequired

Material subcategory id

Header parameters
x-tenant-idstring · uuidRequired

Tenant id (uuid v4)

Body
namestringRequired

Subcategory name

Example: Organic Cotton
Responses
200Success
application/json
patch
/api/public/material-categories/{id}/subcategories/{subcategory_id}
PATCH /api/public/material-categories/{id}/subcategories/{subcategory_id} HTTP/1.1
Host: 
x-api-key: YOUR_API_KEY
x-tenant-id: 123e4567-e89b-12d3-a456-426614174000
Content-Type: application/json
Accept: */*
Content-Length: 25

{
  "name": "Organic Cotton"
}
200Success
{
  "message": "The operation was done successfully"
}

Last updated