POST
/
api
/
material-logs
Create a material log
curl --request POST \
  --url http://localhost:3000/api/material-logs \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "material": "<string>",
  "quantityChanged": 123,
  "panes": [
    "<string>"
  ],
  "referenceId": "<string>",
  "totalPrice": 1,
  "order": "<string>",
  "parentLog": "<string>",
  "worker": "<string>"
}
'
{
  "success": true,
  "message": "<string>",
  "data": {
    "_id": "<string>",
    "material": "<string>",
    "panes": [
      "<string>"
    ],
    "referenceId": "<string>",
    "quantityChanged": 123,
    "totalPrice": 123,
    "order": "<string>",
    "parentLog": "<string>",
    "worker": "<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
material
string
required
Minimum string length: 1
actionType
enum<string>
required
Available options:
withdraw,
claim,
import,
cut,
remake
quantityChanged
number
required
panes
string[]

Array of Pane ObjectIds

Minimum string length: 1
referenceId
string
Minimum string length: 1
referenceType
enum<string>
Available options:
claim,
withdrawal,
qc_remake
totalPrice
number
Required range: x >= 0
stockType
enum<string>
Available options:
Raw,
Reuse
order
string
Minimum string length: 1
parentLog
string
Minimum string length: 1
worker
string
Minimum string length: 1

Response

Material log created

success
boolean
Example:

true

message
string
data
object