Update line item
PATCH
/api/purchase-orders/{id}/items/{itemId}
const url = 'http://localhost:3000/api/purchase-orders/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/items/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0';const options = { method: 'PATCH', headers: {cookie: 'session=<session>', 'Content-Type': 'application/json'}, body: '{"description":"example","categoryId":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0","manufacturerId":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0","quantityOrdered":1,"unitCost":1,"notes":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}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.
Authorizations
Section titled “Authorizations ”Parameters
Section titled “ Parameters ”Path Parameters
Section titled “Path Parameters ” id
required
string format: uuid
itemId
required
string format: uuid
Request Body required
Section titled “Request Body required ” 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"}Responses
Section titled “ Responses ”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
categoryName
string
manufacturerId
string format: uuid
manufacturerName
string
quantityOrdered
required
integer
quantityReceived
required
integer
unitCost
Numeric(12,2) serialised as string
string
totalCost
Numeric(12,2) serialised as string
string
notes
string
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"}