PATCH
/
api
/
withdrawals
/
{id}
Update a withdrawal
curl --request PATCH \
  --url http://localhost:3000/api/withdrawals/{id} \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "order": "<string>",
  "pane": "<string>",
  "withdrawnBy": "<string>",
  "material": "<string>",
  "quantity": 2,
  "approvedBy": "<string>",
  "withdrawnDimensions": {
    "width": 1,
    "height": 1,
    "thickness": 1
  },
  "notes": "<string>",
  "inventory": "<string>",
  "withdrawnDate": "2023-11-07T05:31:56Z"
}
'
{
  "success": true,
  "message": "<string>",
  "data": {
    "_id": "<string>",
    "withdrawalNumber": "<string>",
    "order": "<string>",
    "pane": "<string>",
    "withdrawnBy": "<string>",
    "material": "<string>",
    "quantity": 2,
    "status": "pending",
    "approvedBy": "<string>",
    "withdrawnDimensions": {
      "width": 1,
      "height": 1,
      "thickness": 1
    },
    "notes": "<string>",
    "inventory": "<string>",
    "withdrawnDate": "2023-11-07T05:31:56Z",
    "createdAt": "2023-11-07T05:31:56Z",
    "updatedAt": "2023-11-07T05:31:56Z"
  }
}
withdrawalNumber cannot be set or changed via PATCH; it is fixed when the withdrawal is created.

Authorizations

Authorization
string
header
required

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

Path Parameters

id
string
required

Resource ID

Body

application/json
order
string
Minimum string length: 1
pane
string
Minimum string length: 1
withdrawnBy
string
Minimum string length: 1
material
string
Minimum string length: 1
quantity
integer
Required range: x >= 1
stockType
enum<string>
Available options:
Raw,
Reuse
status
enum<string>
Available options:
pending,
approved,
rejected
approvedBy
string
Minimum string length: 1
withdrawnDimensions
object
notes
string
inventory
string

Inventory slot ID

Minimum string length: 1
withdrawnDate
string<date-time>

Response

Withdrawal updated

success
boolean
Example:

true

message
string
data
object