Skip to content

Update line item

PATCH
/api/purchase-orders/{id}/items/{itemId}
curl --request PATCH \
--url http://localhost:3000/api/purchase-orders/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/items/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0 \
--header 'Content-Type: application/json' \
--cookie session=<session> \
--data '{ "description": "example", "categoryId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "manufacturerId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "quantityOrdered": 1, "unitCost": 1, "notes": "example" }'

Recalculates the item totalCost and PO totalValue when quantity or cost change.

id
required
string format: uuid
itemId
required
string format: uuid
Media type application/json
object
description
string
categoryId
string format: uuid
manufacturerId
string format: uuid
quantityOrdered
integer
unitCost
number
notes
string
Example generated
{
"description": "example",
"categoryId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0",
"manufacturerId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0",
"quantityOrdered": 1,
"unitCost": 1,
"notes": "example"
}

Item updated

Media type application/json
object
data
object
id
required
string format: uuid
poId
required
string format: uuid
description
required
string
categoryId
string format: uuid
nullable
categoryName
string
nullable
manufacturerId
string format: uuid
nullable
manufacturerName
string
nullable
quantityOrdered
required
integer
quantityReceived
required
integer
unitCost

Numeric(12,2) serialised as string

string
nullable
totalCost

Numeric(12,2) serialised as string

string
nullable
notes
string
nullable
createdAt
required
string format: date-time
updatedAt
required
string format: date-time
Example generated
{
"data": {
"id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0",
"poId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0",
"description": "example",
"categoryId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0",
"categoryName": "example",
"manufacturerId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0",
"manufacturerName": "example",
"quantityOrdered": 1,
"quantityReceived": 1,
"unitCost": "example",
"totalCost": "example",
"notes": "example",
"createdAt": "2026-04-15T12:00:00Z",
"updatedAt": "2026-04-15T12:00:00Z"
}
}

Not authenticated

Media type application/json
object
error
required
string
Example
{
"error": "Not found"
}

Insufficient role

Media type application/json
object
error
required
string
Example
{
"error": "Not found"
}

Item not found

Media type application/json
object
error
required
string
Example
{
"error": "Not found"
}