Skip to main content

In-App Notifications (The Bell)

Author: Josh S. Sakweli, Backend Lead Team
Last Updated:Updated: 2025-10-26
2026-09-18 Version:Version: v1.0

Base URL:URL: http://localhost:8765/api/v1 (local) β€” https://dev.api.nextgate.com/nexgate.co/api/v1 (staging)

Short Description

TheThis Notificationdocument Managementis APIONLY providesfor a comprehensivethe in-app notification systembell β€” the πŸ”” icon, its red badge, and the list that allowsopens userswhen you tap it. It is not about push notifications on the lock screen, email, SMS, or chat unread badges. Those are different systems; Part 0 tells you which one you need.

v1.0 β€” verified end to receive,end manage,on staging on 2026-09-18: one account liked another's post, the owner's badge went from 0 to 1, and interactthe withbell notificationslist acrossshowed different"joshdoe servicesliked andyour shops.post" pointing at the right post. Every JSON sample below is a real staging response.

Short Description: Everything that happens to a user while they are not looking β€” a like, a new follower, an order shipped, a ticket bought β€” is saved as one row in their bell list. This API supportsreads creatingthat notifications,list, markingcounts unread rows for the badge, marks rows read, and deletes them. The server also sends a live notification.added event on the existing event stream so the badge moves without the app polling.

Hints:

  • Every endpoint needs Authorization: Bearer <accessToken>. A user only ever sees their own rows β€” there is no way to read someone else's bell.
  • Pages start at 1, not 0. page=0 returns 400 "Page index must not be less than zero".
  • The row's title is the whole sentence ("joshdoe liked your post"). message is an optional second line and is often an empty string. Never show an empty grey line.
  • createdAt and readAt carry no timezone. They are UTC. Append Z before parsing, or "2 minutes ago" will be off by your offset.
  • Tapping a row opens targetType + targetId. If your app does not know the targetType, stay on the bell list. That rule is what lets the backend add new notification types without breaking old app versions (Part 3).
  • Ignore unknown keys inside data. It carries values the server used to build the sentence; some of them asare read,internal.
  • filtering

Part 0 β€” Is this the right document?

You are building…SystemWhere
The πŸ”” icon, its badge, the list of "X liked your post" rowsIn-app notifications (this doc)/api/v1/notifications/* + notification.added on /api/v1/events
A banner on the lock screen when the app is closedPush (Firebase)Not live yet. Needs the app to register its device token first β€” separate doc
Unread counts on chat threadsChatchatbox-api-doc.md β€” unread.changed
Email and SMSNotification serverNothing for the app to do

The same event can reach a user through several of these at once. A like creates one bell row and, once push is live, one push. They are independent: reading the bell row does not clear the push, and vice versa.


Part 1 β€” How the bell works

  somebody likes your post
            β”‚
            β–Ό
  backend saves one row in YOUR bell list  ──────►  row: isRead=false
            β”‚
            β–Ό
  backend sends on /api/v1/events:
     event: notification.added
     data:  {"type":"SOC_POST_LIKED","unreadCount":4}
            β”‚
            β–Ό
  app sets the badge to 4  (no request needed)
  if the bell list is open β†’ refetch page 1

What the app does, screen by variousscreen

criteria,andmanagingnotificationlifecyclewithfullpaginationsupport.

Hints

Moment Call Why
App starts or comes back to the foregroundGET /notifications/unread-countThe event stream was not connected while you were away; this is the truth
notification.added arrivesnone β€” set the badge to unreadCount from the eventThe event already carries the new count
User opens the bellGET /notifications/me?page=1&size=20Newest first
User scrolls to the bottomGET /notifications/me?page=2… while hasNext is true
User taps a rowPUT /notifications/{id}/read, then open targetType/targetIdMark read first so the badge is right when they come back
"Mark all as read" buttonPUT /notifications/read-allThen set the badge to 0 locally
Swipe to deleteDELETE /notifications/{id}
"Clear read" buttonDELETE /notifications/readRemoves every row already read

Things the server does NOT tell you live

  • AuthenticationMarking Required:read sends no event. All endpoints under /notifications require Bearer token authentication exceptIf the same user has the app open on a phone and a tablet and reads on one, the other keeps its old badge until it next calls /notifications/in-unread-count. Call it whenever the app endpointreturns to the foreground.
  • Pagination:Deleting sends no event Listeither. endpointsUpdate supportyour paginationlist locally.

The live event

The bell rides the same stream the chat uses β€” GET /api/v1/events (see chatbox-api-doc.md β†’ "SSE stream" for connecting, reconnecting with default page=1Last-Event-ID, and size=20why

  • Pageweb Numbering:needs API uses 1-fetch-based pagestreaming). numberingDo (pagenot 1open a second stream for notifications.

    EventDataMeaning
    notification.added{"type": "SOC_POST_LIKED", "unreadCount": 4}A row was added to this user's bell. unreadCount is the firstnew page)total,
  • Ratecounted Limiting:after Standardthe raterow limitswas applysaved
  • type lets you do something special for a few types (100a requestssound perfor minutea pernew user)

  • order,
  • Timezones:for Allexample). timestampsFor areeverything returnedelse, just update the badge.


    Part 2 β€” The notification object

    Every list and single-row endpoint returns rows in ISOthis 8601shape. formatReal withstaging localrow:

    server
    {
      time
  • "id":
  • "6e902bb6-9b38-49c6-825e-22b951f39584", "userId": "02db7d92-b426-47b2-9171-cf15339c1376", "shopId": null, "serviceId": "2b5f3f0c-6d6e-4c4a-a10a-34b622a1fc68", "serviceType": "SOCIAL", "targetType": "POST", "targetId": "2b5f3f0c-6d6e-4c4a-a10a-34b622a1fc68", "title": "joshdoe liked your post", "message": "", "type": "SOC_POST_LIKED", "priority": "LOW", "isRead": false, "data": { "type": "SOC_POST_LIKED", "actor": { "name": "joshdoe" }, "postId": "2b5f3f0c-6d6e-4c4a-a10a-34b622a1fc68", "targetId": "2b5f3f0c-6d6e-4c4a-a10a-34b622a1fc68", "targetType": "POST", "mailAccount": "general" }, "createdAt": "2026-09-18T19:18:40.736493", "readAt": null }
    FieldTypeDescription
    idUUIDThe row. Use it to mark read or delete
    userIdUUIDThe owner β€” always the signed-in user
    shopIdUUID / nullSet when the row is about one of the user's shops (new order, low stock…)
    serviceIdstringNotificationLegacy Types:β€” do not use. SupportedKept typesfor includeolder apps. Use INFOtargetId
    serviceTypestringWhich area of the app it belongs to β€” use it for filter tabs. See values
    targetTypestringWhich screen a tap opens. See Part 3
    targetIdstring / nullThe id that screen needs. null for screens that need none (e.g. WALLET)
    titlestringThe sentence to show. Always present
    messagestringOptional second line (a snippet of the post, an amount…). Often "" β€” hide the line when empty
    typestringThe exact notification type, e.g. SOC_POST_LIKED, WARNINGORD_SHIPPED. 136 exist; new ones will be added. Do not switch on it for navigation β€” use targetType
    prioritystringLOW, ERROR, SUCCESS
  • Priority Levels: Supported priorities include LOWNORMAL, MEDIUM, HIGH, URGENT
  • .
  • Use it for styling only (e.g. bold HIGH/URGENT rows)
  • isReadbooleanfalse until the user reads it
    dataobjectThe values used to build the sentence. Useful for avatars (actor.name) or extra text. ServiceIgnore Types:keys you do not know
    createdAtstringWhen it happened. ISO 8601, UTC, no offset
    readAtstring / nullWhen it was marked read. UTC, no offset

    serviceType values

    For filter tabs ("All", "Social", "Orders"…) and for endpoint 5.

    ValueCovers
    SOCIALLikes, comments, follows, mentions, reposts
    CHATGroup invites, join requests, offers, missed calls, meetings
    LIVELive streams and Spaces
    ORDEROrders you bought or sold
    SHOPYour shop: applications, stock, reviews, WhatsApp setup
    CARTItems in your cart
    CHECKOUTCheckout sessions
    PAYMENTPayments made and received
    WALLETWallet top-ups, balance, payouts
    INSTALLMENTInstallment plans and dues
    GROUP_PURCHASEGroup buying
    EVENTEvents, tickets, bookings
    USERYour account: security, sessions, devices
    PROMOTIONALOffers and announcements
    ADMINOnly admins ever receive these

    Part 3 β€” Where a tap goes (targetType)

    Map each targetType you support to a screen, passing targetId when the table says it carries one. Anything else β€” a targetType you have not mapped, or CUSTOM / NONE β€” stays on the bell list, with the row marked read. ExamplesNever includecrash and never show an error on an unknown value; the backend adds new values over time.

    targetTypetargetId is…Opens
    POSTpost idThe post
    COMMENTcomment idThe comment, inside its post
    POLLpoll idThe poll
    STREAMstream idA live stream
    PROFILEaccount idSomebody's profile
    FOLLOW_REQUESTSβ€”Pending follow requests
    REPORT_HISTORYβ€”The user's reports
    MODERATION_NOTICEreport idA moderation decision
    CONVERSATIONconversation idA chat thread
    CHAT_LISTβ€”The chat list
    GROUP_INVITESconversation idGroup invites
    GROUP_JOIN_REQUESTSconversation idJoin requests for a group you manage
    CALLcall idA call (e.g. missed-call details)
    MEETINGmeeting idA meeting
    SPACEspace idA Space
    OFFERoffer idA personalised offer in chat
    SHOP_INBOXshop idThe shop's chat inbox
    ORDERorder idAn order you bought
    SHOP_ORDERorder idAn order your shop received
    ORDER_TRACKINGorder idDelivery tracking
    CARTβ€”The cart
    PRODUCTproduct idA product
    INVENTORYshop idThe shop's stock screen
    DISPUTEdispute idA dispute
    REVIEWreview idA review
    GROUP_PURCHASEgroup idA group purchase
    AGREEMENTagreement idAn installment agreement
    SHOPshop idA shop's public page
    SHOP_DASHBOARDshop idYour shop's dashboard
    SHOP_APPLICATIONshop idYour shop application
    WABA_SETTINGSshop idThe shop's WhatsApp settings
    DOWNLOADorder idDigital download for an order
    TRANSACTIONtransaction idOne transaction
    TRANSACTION_HISTORYβ€”All transactions
    CHECKOUTsession idA checkout session
    WALLETβ€”The wallet
    PAYOUT_SETTINGSβ€”Payout settings
    OTP_SCREENβ€”The code entry screen
    EVENTevent idAn event
    EVENT_DASHBOARDevent idOrganiser's dashboard for an event
    EVENTS_LISTβ€”The events list
    TICKETticket idA ticket
    BOOKINGbooking idA booking
    MY_BOOKINGSbooking idMy bookings, scrolled to that booking
    CLAIMclaim idAn organiser's fund claim
    SCANNER_MODEevent idThe ticket scanner for an event
    EVENT_REVIEWevent idReview an event you attended
    HOMEβ€”Home
    ONBOARDINGβ€”Finish onboarding
    ACCOUNT_SETTINGSβ€”Account settings
    SECURITY_SETTINGSβ€”Security settings
    ACTIVE_SESSIONSβ€”Signed-in sessions
    CHAT_DEVICESβ€”Chat devices
    APPEAL_FORMβ€”Appeal a decision
    ADMIN_* (7 values)variesAdmin panel only β€” the consumer apps can treat these as unknown
    CUSTOM, PAYMENTNONEβ€”Stay on the bell list

    If the target no longer exists (the post was deleted, for example), SHIPPING,the screen's own endpoint returns PRODUCT404,. ACCOUNT

  • Show that screen's normal "not available" state; do not delete the bell row automatically.


    Standard Response Format

    All API responses follow a consistent structure using our Globe Response Builder pattern:

    Success Response Structure

    {
      "success": true,
      "httpStatus": "OK",
      "message": "Operation completed successfully",
      "action_time": "2025-10-26T10:30:45"2026-09-18T19:23:04.211589898",
      "data": {
        // Actual response data goes here }
    }
    

    Error Response Structure

    {
      "success": false,
      "httpStatus": "BAD_REQUEST",
      "message": "Error description",
      "action_time": "2025-10-26T10:30:45"2026-09-18T19:23:06.226159977",
      "data": "Error description"
    }
    

    Standard Response Fields

    Field Type Description
    success boolean Always true for successful operations, false for errors
    httpStatus string HTTP status name (OK, BAD_REQUEST, NOT_FOUND, etc.)
    message string Human-readable message describing the operation result
    action_time string ISO 8601 timestamp of when the response was generated
    data object/string Response payload for success, error details for failures

    Responses may also carry action and context (always null here) β€” ignore them.

    The page object

    Endpoints 1, 2, 5 and 6 return this inside data:

    {
      "notifications": [ /* notification objects, newest first */ ],
      "currentPage": 1,
      "pageSize": 20,
      "totalElements": 1,
      "totalPages": 1,
      "hasNext": false,
      "hasPrevious": false,
      "isFirst": true,
      "isLast": true
    }
    
    FieldDescription
    notificationsThe rows, newest first
    currentPageThe page you asked for (starts at 1)
    pageSizeRows per page
    totalElementsRows across all pages
    totalPagesNumber of pages
    hasNextAsk for currentPage + 1 while this is true
    hasPrevious, isFirst, isLastConvenience flags

    New rows can arrive while the user scrolls, which shifts every later page by one. If you see the same id twice, keep one.


    HTTP Method Badge Standards

    For better visual clarity, all endpoints use colored badges for HTTP methods with the following standard colors:

    • GET - GET - Green (Safe, read-only operations)
    • POSTPUT - Blue (Create new resources)
    • PUT - Yellow (Update/replace entire resource)Update)
    • DELETE - DELETE - Red (Remove resources)

    Endpoints

    #MethodPathUse it for
    1GET/notifications/meThe bell list
    2GET/notifications/unreadOnly unread rows
    3GET/notifications/unread-countThe badge
    4GET/notifications/summaryTotal / unread / read counts
    5GET/notifications/service/{serviceType}A filter tab
    6GET/notifications/shop/{shopId}A shop owner's shop notifications
    7GET/notifications/{notificationId}One row
    8PUT/notifications/{notificationId}/readMark one read
    9PUT/notifications/readMark several read
    10PUT/notifications/read-allMark everything read
    11DELETE/notifications/{notificationId}Delete one
    12DELETE/notifications/batchDelete several
    13DELETE/notifications/readDelete every read row

    1. GetList My Notifications

    Purpose:Purpose: RetrieveThe allbell notificationslist β€” every row for the authenticatedsigned-in useruser, withread paginationand supportunread, newest first.

    Endpoint:Endpoint: GET {base_url}/notifications/me

    Access Level:Level: πŸ”’ Protected (Requires Bearer Token Authentication)

    Authentication:Authentication: Bearer Token

    Request Headers

    :

    Header Type Required Description
    Authorization string Yes Bearer token for authentication<accessToken>

    Query Parameters

    :

    Parameter Type Required Description Validation Default
    page integer No Page number (1-based) MustMin: be positive integer1 1
    size integer No Number of itemsRows per page MustMin: be between 1-1001 20

    Success Response JSON Sample

     (staging, 2026-09-18):

    {
      "success": true,
      "httpStatus": "OK",
      "message": "Notifications retrieved successfully",
      "action_time": "2025-10-26T10:30:45"2026-09-18T19:23:04.211589898",
      "data": {
        "notifications": [
          {
            "id": "123e4567-e89b-12d3-a456-426614174000"6e902bb6-9b38-49c6-825e-22b951f39584",
            "userId": "987fcdeb-51a2-43d7-9c4e-123456789abc"02db7d92-b426-47b2-9171-cf15339c1376",
            "shopId": "456e7890-e89b-12d3-a456-426614174001",null,
            "serviceId": "ORD-2024-001"2b5f3f0c-6d6e-4c4a-a10a-34b622a1fc68",
            "serviceType": "ORDER"SOCIAL",
            "targetType": "POST",
            "targetId": "2b5f3f0c-6d6e-4c4a-a10a-34b622a1fc68",
            "title": "Orderjoshdoe Confirmed"liked your post",
            "message": "Your order #ORD-2024-001 has been confirmed"",
            "type": "SUCCESS"SOC_POST_LIKED",
            "priority": "MEDIUM"LOW",
            "isRead": false,
            "data": { "orderId"actor": { "name": "ORD-2024-001"joshdoe" }, "amount": 150.00,
              "currency"postId": "USD"2b5f3f0c-6d6e-4c4a-a10a-34b622a1fc68" },
            "createdAt": "2025-10-26T09:15:30"2026-09-18T19:18:40.736493",
            "readAt": null
          }
        ],
        "currentPage": 1,
        "pageSize": 20,5,
        "totalElements": 45,1,
        "totalPages": 3,1,
        "hasNext": true,false,
        "hasPrevious": false,
        "isFirst": true,
        "isLast": falsetrue
      }
    }
    

    Success Response Fields

    : see pageobjectand norows, found".

    FieldDescription
    notificationsArray of notification objects
    notifications[].idUnique identifier for the notification
    notifications[].userIdID of the user who received the notification
    notifications[].shopIdID of the associated shop (nullable)
    notifications[].serviceIdIdentifier for the service that generated the notification
    notifications[].serviceTypeType of service (ORDER, PAYMENT, SHIPPING, etc.)
    notifications[].titleNotification title
    notifications[].messageNotification message content
    notifications[].typeNotification type (INFO, WARNING, ERROR, SUCCESS)
    notifications[].priorityPriority level (LOW, MEDIUM, HIGH, URGENT)
    notifications[].isReadWhether the notification hasobject. beenWith read
    notifications[].dataAdditional metadata as JSON object
    notifications[].createdAtTimestamp when notification was created
    notifications[].readAtTimestamp when notification was read (null if unread)
    currentPageCurrent page number (1-based)
    pageSizeNumber of items per page
    totalElementsTotal number of notifications
    totalPagesTotal number of pages
    hasNextWhether there is a[] nextand page
    hasPreviousWhether theremessage is a"No previousnotifications page
    isFirstWhether this is the first page
    isLastWhether this is the last page

    Error Response JSON Sample

     (staging, page=0):

    {
      "success": false,
      "httpStatus": "UNAUTHORIZED"BAD_REQUEST",
      "message": "TokenPage hasindex expired"must not be less than zero",
      "action_time": "2025-10-26T10:30:45"2026-09-18T19:23:06.226159977",
      "data": "TokenPage hasindex expired"must not be less than zero"
    }
    

    Standard Error Types:

    • 400 BAD_REQUEST: page is 0 or negative
    • 401 UNAUTHORIZED: Token missing, invalid or expired

    2. GetList Unread Notifications

    Purpose:Purpose: RetrieveOnly onlyrows unreadwith notificationsisRead=false, newest first β€” for thean authenticated"Unread" usertab.

    Endpoint:Endpoint: GET {base_url}/notifications/unread

    Access Level:Level: πŸ”’ Protected (Requires Bearer Token Authentication)

    Authentication:Authentication: Bearer Token

    Request Headers

    HeaderTypeRequiredDescription
    AuthorizationstringYesBearer token for authentication

    Query Parameters

    :

    Parameter Type Required Description Validation Default
    page integer No Page number (1-based) MustMin: be positive integer1 1
    size integer No Number of itemsRows per page MustMin: be between 1-1001 20

    Success Response JSON Sample

    {
      "success": true,identical "httpStatus":in "OK",shape "message":to "Notificationsendpoint retrieved1.

    successfully",
    "action_time":

    Marking "2025-10-26T10:30:45",a "data":row {read "notifications":removes [it {from "id":this "223e4567-e89b-12d3-a456-426614174002",list, "userId":so "987fcdeb-51a2-43d7-9c4e-123456789abc",every "shopId":later null,page "serviceId":shifts "PAY-2024-050",up "serviceType":by "PAYMENT",one. "title":If "Paymentyou Pending",mark "message":rows "Yourread paymentwhile the user scrolls this tab, refetch from page 1 instead of asking for orderthe #ORD-2024-001next page.

    Standard Error Types:

    • 400 BAD_REQUEST: page is pending",0 "type"or negative
    • 401 UNAUTHORIZED: "WARNING",Token "priority":missing, "HIGH",invalid "isRead":or false,expired
    • "data": { "paymentId": "PAY-2024-050", "amount": 150.00 }, "createdAt": "2025-10-26T10:15:30", "readAt": null } ], "currentPage": 1, "pageSize": 20, "totalElements": 12, "totalPages": 1, "hasNext": false, "hasPrevious": false, "isFirst": true, "isLast": true } }

    3. Get Unread Count

    Purpose:Purpose: GetThe number on the total count of unread notifications for the authenticated userbadge.

    Endpoint:Endpoint: GET {base_url}/notifications/unread-count

    Access Level:Level: πŸ”’ Protected (Requires Bearer Token Authentication)

    Authentication:Authentication: Bearer Token

    Request Headers

    HeaderTypeRequiredDescription
    AuthorizationstringYesBearer token for authentication

    Success Response JSON Sample

     (staging):

    {
      "success": true,
      "httpStatus": "OK",
      "message": "Unread count retrieved successfully",
      "action_time": "2025-10-26T10:30:45"2026-09-18T19:23:05.489594598",
      "data": { "unreadCount": 121 }
    }
    

    Success Response Fields

    :

    Field Description
    unreadCount TotalRows numberwith ofisRead=false. unreadShow notifications99+ above 99

    Call it when the app starts and every time it returns to the foreground. While the app is open, notification.added keeps the badge current without calling this.

    Standard Error Types:

    • 401 UNAUTHORIZED: Token missing, invalid or expired

    4. Get Notification Summary

    Purpose:Purpose: GetTotal, a summary of all notifications including total, unread,unread and read counts in one call.

    Endpoint:Endpoint: GET {base_url}/notifications/summary

    Access Level:Level: πŸ”’ Protected (Requires Bearer Token Authentication)

    Authentication:Authentication: Bearer Token

    Request Headers

    HeaderTypeRequiredDescription
    AuthorizationstringYesBearer token for authentication

    Success Response JSON Sample

     (staging):

    {
      "success": true,
      "httpStatus": "OK",
      "message": "Notification summary retrieved successfully",
      "action_time": "2025-10-26T10:30:45"2026-09-18T19:23:04.820411225",
      "data": { "total": 45,1, "unread": 12,1, "read": 330 }
    }
    

    Success Response Fields

    :

    Field Description
    total TotalAll number of notificationsrows
    unread NumberRows ofwith unreadisRead=false notificationsβ€” same number as endpoint 3
    read Numbertotal of- read notificationsunread

    Standard Error Types:

    • 401 UNAUTHORIZED: Token missing, invalid or expired

    5. Get NotificationsList by Shop

    Area (serviceType)

    Purpose:Purpose: RetrieveOne notificationsfilter filteredtab byβ€” ae.g. specificonly shopSOCIAL, or only ORDER.

    Endpoint:Endpoint: GET {base_url}/notifications/shop/service/{shopId}serviceType}

    Access Level:Level: πŸ”’ Protected (Requires Bearer Token Authentication)

    Authentication:Authentication: Bearer Token

    Request Headers

    HeaderTypeRequiredDescription
    AuthorizationstringYesBearer token for authentication

    Path Parameters

    :

    serviceType
    Parameter Type Required Description Validation
    shopIdserviceType UUIDstring Yes UniqueThe identifierareaOne of the shopMustvalues, beupper validcase. UUIDAn formatunknown value returns an empty list, not an error

    Query Parameters

    :

    Parameter Type Required Description Validation Default
    page integer No Page number (1-based) MustMin: be positive integer1 1
    size integer No Number of itemsRows per page MustMin: be between 1-1001 20

    Success Response JSON Sample

    {
      "success": true,identical "httpStatus":in "OK",
      "message": "Notifications retrieved successfully",
      "action_time": "2025-10-26T10:30:45",
      "data": {
        "notifications": [
          {
            "id": "323e4567-e89b-12d3-a456-426614174003",
            "userId": "987fcdeb-51a2-43d7-9c4e-123456789abc",
            "shopId": "456e7890-e89b-12d3-a456-426614174001",
            "serviceId": "PROD-2024-100",
            "serviceType": "PRODUCT",
            "title": "New Product Available",
            "message": "A new product has been addedshape to yourendpoint shop",
            "type": "INFO",
            "priority": "LOW",
            "isRead": true,
            "data": {
              "productId": "PROD-2024-100",
              "productName": "Sample Product"
            },
            "createdAt": "2025-10-25T14:20:00",
            "readAt": "2025-10-25T15:30:00"
          }
        ],
        "currentPage": 1,
        "pageSize": 20,
        "totalElements": 8,
        "totalPages": 1,
        "hasNext": false,
        "hasPrevious": false,
        "isFirst": true,
        "isLast": true
      }
    }
    

    6. Get Notifications by Service Type

    Purpose: Retrieve notifications filtered by service type1.

    Endpoint:Standard Error Types:

    • 400 BAD_REQUEST: page is 0 or negative
    • 401 UNAUTHORIZED: Token missing, invalid or expired

    6. List a Shop's Notifications

    Purpose: For a shop owner β€” only the rows about one of their shops (new orders, low stock, reviews…).

    Endpoint: GET {base_url}/notifications/service/shop/{serviceType}shopId}

    Access Level:Level: πŸ”’ Protected (Requiresuse Beareronly Tokenfor Authentication)a shop the signed-in user owns)

    Authentication:Authentication: Bearer Token

    Request Headers

    HeaderTypeRequiredDescription
    AuthorizationstringYesBearer token for authentication

    Path Parameters

    :

    Parameter Type Required Description Validation
    serviceTypeshopId stringUUID Yes TypeThe of service (ORDER, PAYMENT, SHIPPING, PRODUCT, ACCOUNT)shop MustValid not be emptyUUID

    Query Parameters

    :

    Parameter Type Required Description Validation Default
    page integer No Page number (1-based) MustMin: be positive integer1 1
    size integer No Number of itemsRows per page MustMin: be between 1-1001 20

    Success Response JSON Sample

    {
      "success": true,identical "httpStatus":in "OK",shape "message":to "Notificationsendpoint retrieved1; successfully",every "action_time": "2025-10-26T10:30:45",
      "data": {
        "notifications": [
          {
            "id": "423e4567-e89b-12d3-a456-426614174004",
            "userId": "987fcdeb-51a2-43d7-9c4e-123456789abc",
            "shopId": "456e7890-e89b-12d3-a456-426614174001",
            "serviceId": "ORD-2024-002",
            "serviceType": "ORDER",
            "title": "Order Shipped",
            "message": "Your order #ORD-2024-002row has beenthis shipped",shopId.

    "type"

    Standard Error Types:

    • 400 BAD_REQUEST: "SUCCESS",shopId "priority"is not a UUID, or page is 0 or negative
    • 401 UNAUTHORIZED: "MEDIUM",Token "isRead":missing, false,invalid "data":or {expired
    • "orderId": "ORD-2024-002", "trackingNumber": "TRK123456789" }, "createdAt": "2025-10-26T08:45:00", "readAt": null } ], "currentPage": 1, "pageSize": 20, "totalElements": 15, "totalPages": 1, "hasNext": false, "hasPrevious": false, "isFirst": true, "isLast": true } }

    7. Get One Notification by ID

    Purpose:Purpose: RetrieveFetch a single row β€” e.g. when the app opens from a link that carries a notification by its unique identifierid.

    Endpoint:Endpoint: GET {base_url}/notifications/{notificationId}

    Access Level:Level: πŸ”’ Protected (Requiresown Bearerrows Token Authentication)only)

    Authentication:Authentication: Bearer Token

    Request Headers

    HeaderTypeRequiredDescription
    AuthorizationstringYesBearer token for authentication

    Path Parameters

    :

    Parameter Type Required Description Validation
    notificationId UUID Yes UniqueThe identifier of the notificationrow Must be validValid UUID format

    Success Response JSON Sample

    :

    {
      "success": true,
      "httpStatus": "OK",
      "message": "Notification retrieved successfully",
      "action_time": "2025-10-26T10:30:45"2026-09-18T19:23:04.211589898",
      "data": { "id":/* "123e4567-e89b-12d3-a456-426614174000",one "userId":notification "987fcdeb-51a2-43d7-9c4e-123456789abc",object "shopId": "456e7890-e89b-12d3-a456-426614174001",
        "serviceId": "ORD-2024-001",
        "serviceType": "ORDER",
        "title": "Order Confirmed",
        "message": "Your order #ORD-2024-001 has been confirmed",
        "type": "SUCCESS",
        "priority": "MEDIUM",
        "isRead": false,
        "data": {
          "orderId": "ORD-2024-001",
          "amount": 150.00,
          "currency": "USD"
        },
        "createdAt": "2025-10-26T09:15:30",
        "readAt": null*/ }
    }
    

    Error Response JSON Sample

     (staging β€” a row that does not exist or is not yours):

    {
      "success": false,
      "httpStatus": "NOT_FOUND",
      "message": "Notification not found or access denied",
      "action_time": "2025-10-26T10:30:45"2026-09-18T19:23:06.905963899",
      "data": "Notification not found or access denied"
    }
    

    Standard Error Types:

    • 401 UNAUTHORIZED: Token missing, invalid or expired
    • 404 NOT_FOUND: No such row, or it belongs to someone else (the two are deliberately indistinguishable)

    8. Mark NotificationOne as Read

    Purpose:Purpose: MarkCall when the user taps a single notification as readrow.

    Endpoint:Endpoint: PUT {base_url}/notifications/{notificationId}/read

    Access Level:Level: πŸ”’ Protected (Requiresown Bearerrows Token Authentication)only)

    Authentication:Authentication: Bearer Token

    Request Headers

    HeaderTypeRequiredDescription
    AuthorizationstringYesBearer token for authentication

    Path Parameters

    :

    Parameter Type Required Description Validation
    notificationId UUID Yes UniqueThe identifier of the notificationrow Must be validValid UUID format

    Success Response JSON Sample

    :

    {
      "success": true,
      "httpStatus": "OK",
      "message": "Notification marked as read",
      "action_time": "2025-10-26T10:30:45"2026-09-18T19:25:00.000000000",
      "data": null
    }
    

    Error

    Marking Responsea JSONrow Sample

    that
    {is "success":already false,read "httpStatus":succeeds "NOT_FOUND",and "message":changes "Notificationnothing β€” safe to
    retry. The badge is not foundsent back; subtract 1 locally.

    Standard Error Types:

    • 401 UNAUTHORIZED: Token missing, invalid or accessexpired
    • denied",
    • 404 "action_time"NOT_FOUND: "2025-10-26T10:30:45",No "data":such "Notificationrow, or not foundyours
    • or access denied" }

    9. Mark Multiple NotificationsSeveral as Read

    Purpose:Purpose: Mark multiplea notifications asselection read in aone single requestcall.

    Endpoint:Endpoint: PUT {base_url}/notifications/read

    Access Level:Level: πŸ”’ Protected (Requiresown Bearerrows Token Authentication)only)

    Authentication:Authentication: Bearer Token

    Request Headers

    HeaderTypeRequiredDescription
    AuthorizationstringYesBearer token for authentication
    Content-TypestringYesMust be application/json

    Request JSON Sample

    :

    {
      "notificationIds": [
        "123e4567-e89b-12d3-a456-426614174000"6e902bb6-9b38-49c6-825e-22b951f39584",
        "223e4567-e89b-12d3-a456-426614174002",
        "323e4567-e89b-12d3-a456-426614174003"0c1d2e3f-4a5b-6c7d-8e9f-0a1b2c3d4e5f"
      ]
    }
    

    Request Body Parameters

    :

    Parameter Type Required Description Validation
    notificationIds array of UUID Yes Array of notification IDsRows to mark as read MustNot not be empty, each element must be valid UUIDempty

    Success Response JSON Sample

    :

    {
      "success": true,
      "httpStatus": "OK",
      "message": "32 notification(s) marked as read",
      "action_time": "2025-10-26T10:30:45"2026-09-18T19:25:00.000000000",
      "data": null
    }
    

    All or nothing: if even one id is missing or belongs to someone else, no row is changed and the call returns 400. Drop ids of rows you have deleted before sending.

    Error Response JSON Sample

    :

    {
      "success": false,
      "httpStatus": "BAD_REQUEST",
      "message": "Some notifications not found or access denied",
      "action_time": "2025-10-26T10:30:45"2026-09-18T19:25:00.000000000",
      "data": "Some notifications not found or access denied"
    }
    

    Standard Error Types:

    • 400 BAD_REQUEST: A listed id is missing or not yours; nothing was changed
    • 401 UNAUTHORIZED: Token missing, invalid or expired
    • 422 UNPROCESSABLE_ENTITY: notificationIds is empty

    10. Mark All Notifications as Read

    Purpose:Purpose: The "Mark all unread notifications for the authenticated user as readread" button.

    Endpoint:Endpoint: PUT {base_url}/notifications/read-all

    Access Level:Level: πŸ”’ Protected (Requires Bearer Token Authentication)

    Authentication:Authentication: Bearer Token

    Request Headers

    HeaderTypeRequiredDescription
    AuthorizationstringYesBearer token for authentication

    Success Response JSON Sample

    :

    {
      "success": true,
      "httpStatus": "OK",
      "message": "All notifications marked as read",
      "action_time": "2025-10-26T10:30:45"2026-09-18T19:25:00.000000000",
      "data": null
    }
    

    Set the badge to 0 locally afterwards.

    Standard Error Types:

    • 401 UNAUTHORIZED: Token missing, invalid or expired

    11. Delete Notification( DON'T USE)

    One

    Purpose:Purpose: DeleteSwipe ato single notification permanentlydelete.

    Endpoint:Endpoint: DELETE {base_url}/notifications/{notificationId}

    Access Level:Level: πŸ”’ Protected (Requiresown Bearerrows Token Authentication)only)

    Authentication:Authentication: Bearer Token

    Request Headers

    HeaderTypeRequiredDescription
    AuthorizationstringYesBearer token for authentication

    Path Parameters

    :

    Parameter Type Required Description Validation
    notificationId UUID Yes UniqueThe identifier of the notificationrow Must be validValid UUID format

    Success Response JSON Sample

    :

    {
      "success": true,
      "httpStatus": "OK",
      "message": "Notification deleted successfully",
      "action_time": "2025-10-26T10:30:45"2026-09-18T19:25:00.000000000",
      "data": null
    }
    

    Error

    Deleting Responsean JSON Sample

    {
      "success": false,
      "httpStatus": "NOT_FOUND",
      "message": "Notification not found or access denied",
      "action_time": "2025-10-26T10:30:45",
      "data": "Notification not found or access denied"
    }
    

    12. Batch Delete Notifications( DON'T USE)

    Purpose:unread Deleterow multiplelowers notificationsthe inunread acount singleβ€” requestadjust the badge. Deleted rows cannot be recovered.

    Endpoint:Standard Error Types:

    • 401 UNAUTHORIZED: Token missing, invalid or expired
    • 404 NOT_FOUND: No such row, or not yours

    12. Delete Several

    Purpose: Delete a selection in one call.

    Endpoint: DELETE {base_url}/notifications/batch

    Access Level:Level: πŸ”’ Protected (Requiresown Bearerrows Token Authentication)only)

    Authentication:Authentication: Bearer Token

    Request
    Headers

    This

    DELETEcarriesaJSONbody.MostHTTPclientssupportthat,butsomedefaulthelperscheckyourssends andthe
    Header Type Required Description
    Authorization string Yes Bearerdrop tokenit forβ€” authentication
    Content-TypestringYesMust beType: application/json
    body.

    Request JSON Sample

    :

    {
      "notificationIds": [
        "123e4567-e89b-12d3-a456-426614174000",
        "223e4567-e89b-12d3-a456-426614174002",
        "323e4567-e89b-12d3-a456-426614174003"6e902bb6-9b38-49c6-825e-22b951f39584"
      ]
    }
    

    Request Body Parameters

    :

    Parameter Type Required Description Validation
    notificationIds array of UUID Yes Array of notification IDsRows to delete MustNot not be empty, each element must be valid UUIDempty

    Success Response JSON Sample

    :

    {
      "success": true,
      "httpStatus": "OK",
      "message": "1 notification(s) deleted successfully",
      "action_time": "2026-09-18T19:25:00.000000000",
      "data": null
    }
    

    All or nothing, like endpoint 9: one bad id and nothing is deleted.

    Standard Error Types:

    • 400 BAD_REQUEST: A listed id is missing or not yours; nothing was deleted
    • 401 UNAUTHORIZED: Token missing, invalid or expired
    • 422 UNPROCESSABLE_ENTITY: notificationIds is empty

    13. Delete All Read

    Purpose: The "Clear read" button β€” removes every row already read. Unread rows stay.

    Endpoint: DELETE {base_url}/notifications/read

    Access Level: πŸ”’ Protected

    Authentication: Bearer Token

    Success Response JSON Sample:

    {
      "success": true,
      "httpStatus": "OK",
      "message": "3 notification(s) deleted successfully",
      "action_time": "2025-10-26T10:30:45",
      "data": null
    }
    

    Error Response JSON Sample

    {
      "success": false,
      "httpStatus": "BAD_REQUEST",
      "message": "Some notifications not found or access denied",
      "action_time": "2025-10-26T10:30:45",
      "data": "Some notifications not found or access denied"
    }
    

    13. Delete All Read Notifications( DON'T USE)

    Purpose: Delete all read notifications for the authenticated user

    Endpoint: DELETE {base_url}/notifications/read

    Access Level: πŸ”’ Protected (Requires Bearer Token Authentication)

    Authentication: Bearer Token

    Request Headers

    HeaderTypeRequiredDescription
    AuthorizationstringYesBearer token for authentication

    Success Response JSON Sample

    {
      "success": true,
      "httpStatus": "OK",
      "message": "15 read notification(s) deleted successfully",
      "action_time": "2025-10-26T10:30:45"2026-09-18T19:25:00.000000000",
      "data": 153
    }
    

    Success Response Fields

    :

    Field Description
    data NumberHow ofmany notifications thatrows were deleted (a number, not an object)

    The

    14.badge Createdoes In-Appnot Notification(change DON'Tβ€” USE)

    only

    Purpose:read Createrows awere new in-app notification (Internal service-to-service endpoint)removed.

    Endpoint: POST {base_url}/notifications/in-app

    Access Level: πŸ”’ Protected (Requires API Key or Service Authentication)

    Authentication: API Key or Service Token

    Request Headers

    HeaderTypeRequiredDescription
    X-API-KeystringYesAPI key for service authentication
    Content-TypestringYesMust be application/json

    Request JSON Sample

    {
      "userId": "987fcdeb-51a2-43d7-9c4e-123456789abc",
      "shopId": "456e7890-e89b-12d3-a456-426614174001",
      "serviceId": "ORD-2024-001",
      "serviceType": "ORDER",
      "title": "Order Confirmed",
      "message": "Your order #ORD-2024-001 has been confirmed and is being processed",
      "type": "SUCCESS",
      "priority": "MEDIUM",
      "data": {
        "orderId": "ORD-2024-001",
        "amount": 150.00,
        "currency": "USD",
        "items": 3
      }
    }
    

    Request Body Parameters

    ParameterTypeRequiredDescriptionValidation
    userIdUUIDYesID of the user to receive the notificationMust be valid UUID
    shopIdUUIDNoID of the associated shopMust be valid UUID if provided
    serviceIdstringYesIdentifier for the service that generated the notificationMax length 100 characters
    serviceTypestringYesType of service (ORDER, PAYMENT, SHIPPING, PRODUCT, ACCOUNT)Max length 50 characters
    titlestringYesNotification titleMax length 255 characters
    messagestringYesNotification message contentMax length 1000 characters
    typestringYesNotification type (INFO, WARNING, ERROR, SUCCESS)Max length 50 characters
    prioritystringYesPriority level (LOW, MEDIUM, HIGH, URGENT)Max length 20 characters
    dataobjectNoAdditional metadata as JSON objectAny valid JSON object

    Success Response JSON Sample

    {
      "success": true,
      "httpStatus": "OK",
      "message": "Notification saved successfully",
      "action_time": "2025-10-26T10:30:45",
      "data": "123e4567-e89b-12d3-a456-426614174000"
    }
    

    Success Response Fields

    FieldDescription
    dataUUID of the created notification

    Error Response JSON Sample

    {
      "success": false,
      "httpStatus": "UNPROCESSABLE_ENTITY",
      "message": "Validation failed",
      "action_time": "2025-10-26T10:30:45",
      "data": {
        "userId": "must not be null",
        "title": "must not be blank",
        "message": "must not be blank"
      }
    }
    

    Standard Error Types

    Application-Level Exceptions (400-499)

    :

    • 400401 BAD_REQUEST:UNAUTHORIZED: GeneralToken missing, invalid request data, random exceptions, or item already exists
    • 401 UNAUTHORIZED: Authentication issues (empty, invalid, expired, or malformed tokens)
    • 403 FORBIDDEN: Access denied, permission issues, verification failures, expired invitations
    • 404 NOT_FOUND: Requested resource does not exist
    • 422 UNPROCESSABLE_ENTITY: Validation errors with detailed field information
    • 429 TOO_MANY_REQUESTS: Rate limit exceeded

    Server-Level Exceptions (500+)

    • 500 INTERNAL_SERVER_ERROR: Unexpected server errors

    ErrorIntegration Response ExamplesChecklist

    Bad
      Request
    • -Badge Generalloads from unread-count on app start and on every return to the foreground
    •  notification.added on the existing /api/v1/events stream sets the badge from unreadCount β€” no second stream
    •  Pages start at 1; paging stops when hasNext is false; duplicate ids are dropped
    •  title is shown as the sentence; message line hidden when ""
    •  createdAt parsed as UTC
    •  A tap marks the row read, then opens targetType + targetId
    •  An unknown targetType stays on the bell list β€” no crash, no error
    •  A 404 from the target screen shows that screen's "not available" state
    •  Badge adjusted locally after mark-read and delete (400)

    no
    event comes back)
    
  •  Batch mark-read and batch delete send only ids still in the list
  •  Unknown keys in {data "success":and false,unknown "httpStatus":type "BAD_REQUEST",values "message":are "Userignored
  • ID cannot be null", "action_time": "2025-10-26T10:30:45", "data": "User ID cannot be null" }

    Unauthorized - Token Issues (401)

    {
      "success": false,
      "httpStatus": "UNAUTHORIZED",
      "message": "Token has expired",
      "action_time": "2025-10-26T10:30:45",
      "data": "Token has expired"
    }
    

    Forbidden - Access Denied (403)

    {
      "success": false,
      "httpStatus": "FORBIDDEN",
      "message": "Access denied: Insufficient permissions",
      "action_time": "2025-10-26T10:30:45",
      "data": "Access denied: Insufficient permissions"
    }
    

    Not Found (404)

    {
      "success": false,
      "httpStatus": "NOT_FOUND",
      "message": "Notification not found or access denied",
      "action_time": "2025-10-26T10:30:45",
      "data": "Notification not found or access denied"
    }
    

    Validation Error (422)

    {
      "success": false,
      "httpStatus": "UNPROCESSABLE_ENTITY",
      "message": "Validation failed",
      "action_time": "2025-10-26T10:30:45",
      "data": {
        "userId": "must not be null",
        "title": "must not be blank",
        "serviceType": "must not be blank",
        "priority": "must not be blank"
      }
    }
    

    Quick Reference Guide

    Common HTTP Status Codes

    • 200 OK:OK: Successful GET/PUT request
    • 201 Created: Successful POST request
    • 204 No Content: Successful DELETE request
    • 400 Bad Request:Request: Invalid request data (e.g. page=0, an id that is not yours in a batch)
    • 401 Unauthorized:Unauthorized: Authentication required/failed
    • 403 Forbidden: Insufficient permissions
    • 404 Not Found:Found: ResourceRow does not foundexist or is not yours
    • 422 Unprocessable Entity:Entity: Validation errors (empty notificationIds)
    • 429 Too Many Requests: Rate limit exceeded
    • 500 Internal Server Error:Error: Server error

    Authentication Types

    • Bearer Token:Token: Include Authorization: Bearer your_token<accessToken> in headers (for user endpoints)
    • API Key: Include X-API-Key: your_key in headers (for service-to-service endpoints)

    Data Format Standards

    • Dates:Dates Use: ISO 86018601, formatUTC without an offset (2025-10-26T14:30:00)2026-09-18T19:18:40.736493)
    • IDs:IDs All IDs use: UUID formatstrings
    • Pagination:Pagination Uses 1-based page numbering
    • Boolean Fields: Use: true or falsepage (notfrom 1/0)1) and size; response carries currentPage, totalPages, hasNext

    Notification Types

    • INFO: General informational notifications
    • WARNING: Warning or caution notifications
    • ERROR: Error or failure notifications
    • SUCCESS: Success or confirmation notifications

    Priority Levels

    • LOW: Low priority, can be checked later
    • MEDIUM: Normal priority
    • HIGH: High priority, needs attention soon
    • URGENT: Urgent priority, requires immediate attention

    Service Types