Update Inventory by Id
PATCH/inventory/id/:id
This endpoint enables updating inventory record by it's unique id.
Available update fields
Name | Required |
---|---|
quantity (integer) | no |
costPrice (integer) | no |
nextDeliveryDate (date) | no |
notes (string) | no |
dateModified
is always updated with the current date and time.
warehouseId
and location
cannot be updated.
If product stock is moved to a different warehouse or location, old inventory record should be updated with 0 quantity, then create a new record with the new warehouseId and/or location
Request
Path Parameters
id stringrequired
Inventory record Id
- application/json
Body
costPrice number
nextDeliveryDate string
notes string
quantity number
Responses
- 200
- 404
Update Inventory by Id - 200
Response Headers
Connection
string
Content-Length
string
Date
string
Keep-Alive
string
Return-Format
string
- application/json
- Schema
- Example (from schema)
- Update Inventory by Id - 200
Schema
data
object
companyId number
costPrice number
dateModified string
id number
location string
nextDeliveryDate string
notes string
productId number
quantity number
sku string
supplier string
supplierCode string
usergroupId number
warehouseId number
messages string[]
total number
{
"data": {
"companyId": 0,
"costPrice": 25.5,
"dateModified": "2023-10-02T19:33:14",
"id": 16141,
"location": "B45",
"nextDeliveryDate": "2022-02-20T00:00:00",
"notes": "",
"productId": 227237,
"quantity": 20,
"sku": "NCABD70004",
"supplier": "TECHDATA",
"supplierCode": "NCABD70004",
"usergroupId": 143,
"warehouseId": 0
},
"messages": [
"Inventory updated"
],
"total": 1
}
{
"data": {
"companyId": 0,
"costPrice": 25.5,
"dateModified": "2023-10-02T19:33:14",
"id": 16141,
"location": "B45",
"nextDeliveryDate": "2022-02-20T00:00:00",
"notes": "",
"productId": 227237,
"quantity": 20,
"sku": "NCABD70004",
"supplier": "TECHDATA",
"supplierCode": "NCABD70004",
"usergroupId": 143,
"warehouseId": 0
},
"messages": [
"Inventory updated"
],
"total": 1
}
Update Inventory by Id - 404
Response Headers
Alt-Svc
string
Via
string
alt-svc
string
content-length
string
date
string
return-format
string
server
string
x-request-id
string
- application/json
- Schema
- Example (from schema)
- Update Inventory by Id - 404
Schema
error
object
code number
messages string[]
moreInfo string
status number
type string
{
"error": {
"code": 13006,
"messages": [
"Inventory with id [58991] not found"
],
"moreInfo": "https://www.propel.us/docs/errors/13006",
"status": 404,
"type": "InventoryNotFound"
}
}
{
"error": {
"code": 13006,
"messages": [
"Inventory with id [58991] not found"
],
"moreInfo": "https://www.propel.us/docs/errors/13006",
"status": 404,
"type": "InventoryNotFound"
}
}
Loading...