REST API
Notifications

Notifications

All routes under /api/v1/notifications require authentication.

Notification Categories

CategoryDescription
stockLow stock alerts
creditCredit payment reminders
salesSales milestones
aiAI assistant messages
systemSystem updates
supplierSupplier delivery notifications

GET /notifications

List notifications with filtering.

Auth: Required

Query Parameters:

ParameterTypeDescription
categorystringFilter by category
unreadbooleanOnly unread notifications
pageintPage number
page_sizeintItems per page

Response:

{
  "success": true,
  "data": {
    "notifications": [
      {
        "id": "uuid",
        "category": "stock",
        "title": "Low Stock Alert",
        "body": "Pepsi 500ml is below reorder point",
        "link": "/inventory/products/uuid",
        "is_read": false,
        "created_at": "2024-01-15T10:00:00Z"
      }
    ],
    "unread_count": 5
  }
}

GET /notifications/unread-count

Get count of unread notifications.

Auth: Required

Response:

{
  "success": true,
  "data": {
    "count": 5
  }
}

POST /notifications

Create a notification.

Auth: Required

Request Body:

{
  "store_id": "uuid",
  "category": "system",
  "title": "System Update",
  "body": "ZiadaPOS has been updated to version 2.0",
  "link": "/settings"
}

PATCH /notifications/read-all

Mark all notifications as read.

Auth: Required


PATCH /notifications/:id/read

Mark a single notification as read.

Auth: Required


DELETE /notifications/:id

Delete a notification.

Auth: Required