Skip to content

M3 API Reference

The M3 Inventory API provides endpoints for managing inventory items, locations, stock movements, and alerts.

Production: https://m3.inspiringlivingsolutions.com/api
Development: http://localhost:3000/api

Requires Clerk session authentication.

GET /items

Query Parameters:

ParameterTypeDescription
pagenumberPage number
limitnumberItems per page
categorystringFilter by category
propertyIdstringFilter by property
locationIdstringFilter by location
conditionstringFilter by condition
lowStockbooleanOnly low stock items

Response:

{
"data": [
{
"id": "uuid",
"name": "Bath Towels - White",
"category": "LINENS",
"quantity": 24,
"minStock": 10,
"condition": "GOOD",
"property": { "id": "uuid", "name": "Villa Sunrise" },
"location": { "id": "uuid", "name": "Linen Closet" }
}
],
"pagination": { "page": 1, "limit": 20, "total": 500 }
}
GET /items/:id
POST /items

Body:

{
"name": "Bath Towels - White",
"sku": "TWL-BTH-WHT",
"category": "LINENS",
"propertyId": "uuid",
"locationId": "uuid",
"quantity": 24,
"unit": "EACH",
"minStock": 10,
"maxStock": 50,
"condition": "NEW",
"unitCost": 250,
"currency": "THB"
}
PATCH /items/:id
DELETE /items/:id

POST /movements

Body:

{
"itemId": "uuid",
"type": "USE",
"quantity": 5,
"notes": "Used for turnover",
"referenceType": "WORK_ORDER",
"referenceId": "wo-uuid"
}

Movement Types:

  • INITIAL
  • PURCHASE
  • USE
  • DAMAGE
  • LOSS
  • TRANSFER_IN
  • TRANSFER_OUT
  • ADJUSTMENT
  • RETURN
GET /movements

Query Parameters:

ParameterTypeDescription
itemIdstringFilter by item
typestringFilter by type
startDatestringFrom date
endDatestringTo date

POST /transfers

Body:

{
"sourceLocationId": "uuid",
"destinationLocationId": "uuid",
"items": [
{ "itemId": "uuid", "quantity": 5 },
{ "itemId": "uuid", "quantity": 3 }
],
"notes": "Moving stock to Villa B"
}
POST /transfers/:id/receive

Body:

{
"items": [
{ "itemId": "uuid", "receivedQuantity": 5 },
{ "itemId": "uuid", "receivedQuantity": 2, "notes": "1 damaged" }
]
}

GET /properties
GET /locations

Query Parameters:

ParameterTypeDescription
propertyIdstringFilter by property
parentIdstringFilter by parent
typestringFilter by type
POST /locations

Body:

{
"name": "Master Bedroom",
"type": "ROOM",
"propertyId": "uuid",
"parentId": "uuid",
"description": "Main floor master"
}

GET /categories
POST /categories

Body:

{
"name": "Pool Equipment",
"parentId": "uuid",
"description": "Pool and spa items"
}

GET /alerts

Query Parameters:

ParameterTypeDescription
statusstringACTIVE, ACKNOWLEDGED, RESOLVED
typestringLOW_STOCK, CONDITION, EXPIRY
propertyIdstringFilter by property
POST /alerts/:id/acknowledge
POST /alerts/:id/resolve

Body:

{
"action": "Ordered 20 units",
"notes": "PO-12345 created"
}

GET /reports/stock
GET /reports/movements
GET /reports/valuation

{
"error": {
"code": "INSUFFICIENT_STOCK",
"message": "Not enough stock for this movement",
"details": {
"available": 5,
"requested": 10
}
}
}