POST
/
api
/
materials
Create a material
curl --request POST \
  --url http://localhost:3000/api/materials \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "<string>",
  "unit": "<string>",
  "reorderPoint": 1,
  "specDetails": {
    "thickness": "<string>",
    "color": "<string>",
    "glassType": "<string>",
    "width": "<string>",
    "length": "<string>"
  }
}
'
{
  "success": true,
  "message": "<string>",
  "data": {
    "_id": "<string>",
    "name": "<string>",
    "unit": "<string>",
    "reorderPoint": 123,
    "specDetails": {
      "thickness": "<string>",
      "color": "<string>",
      "glassType": "<string>",
      "width": "<string>",
      "length": "<string>"
    },
    "createdAt": "2023-11-07T05:31:56Z",
    "updatedAt": "2023-11-07T05:31:56Z"
  }
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
name
string
required
Minimum string length: 1
unit
string
required
Minimum string length: 1
reorderPoint
number
required
Required range: x >= 0
specDetails
object

Response

Material created

success
boolean
Example:

true

message
string
data
object