Material categories

Get material categories

get

The API gives the ability to get all material categories.

Authorizations
Header parameters
x-tenant-idstring · uuidRequired

Tenant id (uuid v4)

Responses
200Success
application/json
get
/api/public/material-categories
GET /api/public/material-categories HTTP/1.1
Host: 
x-api-key: YOUR_API_KEY
x-tenant-id: 123e4567-e89b-12d3-a456-426614174000
Accept: */*
200Success
[
  {
    "id": "b86fa12a-76fc-46f5-8a3e-bf39e7be4c4e",
    "name": "Cotton",
    "created_at": "2023-12-01T10:30:00.000Z",
    "updated_at": "2023-12-15T14:45:30.000Z"
  }
]

Create material category

post

The API gives the ability to create new category.

Authorizations
Header parameters
x-tenant-idstring · uuidRequired

Tenant id (uuid v4)

Body
namestringRequired

Category name

Example: Cotton
Responses
201Success
application/json
post
/api/public/material-categories
POST /api/public/material-categories 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: 17

{
  "name": "Cotton"
}
201Success
{
  "id": "b86fa12a-76fc-46f5-8a3e-bf39e7be4c4e",
  "name": "Cotton",
  "created_at": "2023-12-01T10:30:00.000Z",
  "updated_at": "2023-12-15T14:45:30.000Z"
}

Delete material category

delete

The API gives the ability to delete category.

Authorizations
Path parameters
idstringRequired

Material category id

Header parameters
x-tenant-idstring · uuidRequired

Tenant id (uuid v4)

Responses
200Success
application/json
delete
/api/public/material-categories/{id}
DELETE /api/public/material-categories/{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 category

patch

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

Authorizations
Path parameters
idstringRequired

Material category id

Header parameters
x-tenant-idstring · uuidRequired

Tenant id (uuid v4)

Body
namestringRequired

Category name

Example: Cotton
Responses
200Success
application/json
patch
/api/public/material-categories/{id}
PATCH /api/public/material-categories/{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: 17

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

Last updated