Skip to content

Add line item

POST
/api/purchase-orders/{id}/items
curl --request POST \
--url http://localhost:3000/api/purchase-orders/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/items \
--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 PO totalValue.

id
required
string format: uuid
Media type application/json
object
description
required
string
categoryId
string format: uuid
manufacturerId
string format: uuid
quantityOrdered
integer
default: 1
unitCost
number
notes
string

Item created

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"
}
}

Description is required

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

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"
}

Purchase order not found

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