Notification Management
Base URLURL:: https://api.nextgate.com/api/v1
The Notification Management API All API responses follow a consistent structure using our Globe Response Builder pattern: For better visual clarity, all endpoints use colored badges for HTTP methods with the following standard colors:Short Description
:enablesprovides authenticateda comprehensive in-app notification system that allows users to managereceive, theirmanage, in-appand interact with notifications across different services and shops. This API supports creating notifications, including retrieving paginated lists of notifications, viewing unread notifications, getting summary counts, marking notificationsthem as read, filtering by various criteria, and deletingmanaging them.notification This API is designed for users to interactlifecycle with theirfull personalpagination notification data securely and efficiently. It supports operations for individual, batch, and bulk actions on notifications.support.Hints
:
/notifications require Bearer Tokentoken authentication (except the Authorization:/notifications/in-appBearer your_token).endpointResponsesPagination: useList UTCendpoints timestampssupport inpagination ISOwith 8601 format (e.g.,default 2025-10-18T11:32:00Zpage=1). and size=20limiting:Limiting: Standard rate limits apply (100 requests per minute per user.user)PaginationTimezones: isAll usedtimestamps forare listreturned endpointsin ISO 8601 format with defaultlocal page=1server and size=20.timeTesting/sandboxNotification information:Types: UseSupported thetypes sandbox environment atinclude , https://sandbox.nextgate.com/api/v1INFOforWARNING, development.ERROR, SUCCESSLOW, MEDIUM, HIGH, URGENTORDER, PAYMENT, SHIPPING, PRODUCT, ACCOUNT
Standard Response Format
Success Response Structure
{
"success": true,
"httpStatus": "OK",
"message": "Operation completed successfully",
"action_time": "2025-10-18T11:32:00Z"26T10:30:45",
"data": {
// Actual response data goes here
}
}
Error Response Structure
{
"success": false,
"httpStatus": "BAD_REQUEST",
"message": "Error description",
"action_time": "2025-10-18T11:32:00Z"26T10:30:45",
"data": "Error description" // or detailed error object
}
Standard Response Fields
Field
Type
Description
successboolean
Always
true for successful operations, false for errors
httpStatusstring
HTTP status name (OK, BAD_REQUEST, NOT_FOUND, etc.)
messagestring
Human-readable message describing the operation result
action_timestring
ISO 8601 timestamp of when the response was generated
dataobject/string
Response payload for success, error details for failures
HTTP Method Badge Standards
GET - GET - Green (Safe, read-only operations)
Endpoints
1. Get My Notifications
PurposePurpose:: RetrievesRetrieve aall paginatednotifications list offor the authenticated user'suser in-appwith notifications.pagination support
EndpointEndpoint:: GET {base_url}/notifications/me
Access LevelLevel:: 🔒 Protected (AuthenticatedRequires userBearer only)Token Authentication)
AuthenticationAuthentication:: Bearer Token
Request Headers
:
| Header | Type | Required | Description |
|---|---|---|---|
Authorization |
string | Yes | Bearer token for authentication |
Query Parameters
:
| Parameter | Type | Required | Description | Validation | Default |
|---|---|---|---|---|---|
page |
integer | No | Page number |
1 | |
size |
integer | No | Number of items per page | 20 |
Success Response JSON Sample
:
{
"success": true,
"httpStatus": "OK",
"message": "Notifications retrieved successfully",
"action_time": "2025-10-18T11:32:00Z"26T10:30:45",
"data": {
"content"notifications": [
{
"id": "123e4567-e89b-12d3-a456-426614174000",
"userId": "223e4567-987fcdeb-51a2-43d7-9c4e-123456789abc",
"shopId": "456e7890-e89b-12d3-a456-426614174001",
"shopId": "323e4567-e89b-12d3-a456-426614174002",
"serviceId": "service-123"ORD-2024-001",
"serviceType": "ORDER",
"title": "Order Shipped"Confirmed",
"message": "Your order #ORD-2024-001 has been shipped."confirmed",
"type": "INFO"SUCCESS",
"priority": "NORMAL"MEDIUM",
"isRead": false,
"data": {
"orderId": "order-456"ORD-2024-001",
"amount": 150.00,
"currency": "USD"
},
"createdAt": "2025-10-17T10:00:00Z"26T09:15:30",
"readAt": null
}
],
"pageable"currentPage": {
"sort": {
"sorted": true,
"unsorted": false,
"empty": false
},
"pageNumber": 0,1,
"pageSize": 20,
"offset"totalElements": 0,45,
"paged"totalPages": 3,
"hasNext": true,
"unpaged"hasPrevious": false
},false,
"totalPages": 1,
"totalElements": 1,
"last"isFirst": true,
"numberOfElements": 1,
"first": true,
"size": 20,
"number": 0,
"sort": {
"sorted": true,
"unsorted": false,
"empty": false
},
"empty"isLast": false
}
}
Success Response Fields
:
| Field | Description |
|---|---|
notifications |
Array of |
|
Unique identifier |
|
ID of the user |
|
ID of the associated shop ( |
|
|
|
Type of service ( |
|
|
|
|
|
|
|
Priority level ( |
|
Whether the notification has been read |
|
Additional |
|
Timestamp when notification was created |
|
Timestamp when notification was read (null if unread) |
currentPage |
|
pageSize |
Number of items per page |
| totalElements | Total number of notifications |
| totalPages | Total number of pages |
| |
hasNext |
Whether |
hasPrevious |
|
isFirst |
Whether this is the first page |
| |
| |
| |
isLast |
Whether |
Error Response JSON Sample
:
{
"success": false,
"httpStatus": "BAD_REQUEST"UNAUTHORIZED",
"message": "InvalidToken paginationhas parameters"expired",
"action_time": "2025-10-18T11:32:00Z"26T10:30:45",
"data": "InvalidToken paginationhas parameters"expired"
}
Standard Error Types:
400 BAD_REQUEST: Invalid pagination parameters401 UNAUTHORIZED: Invalid or expired token404 NOT_FOUND: No notifications found
2. Get Unread Notifications
PurposePurpose:: RetrievesRetrieve aonly paginatedunread listnotifications offor the authenticated user's unread in-app notifications.user
EndpointEndpoint:: GET {base_url}/notifications/unread
Access LevelLevel:: 🔒 Protected (AuthenticatedRequires userBearer only)Token Authentication)
AuthenticationAuthentication:: Bearer Token
Request Headers
:
| Header | Type | Required | Description |
|---|---|---|---|
Authorization |
string | Yes | Bearer token for authentication |
Query Parameters
:
| Parameter | Type | Required | Description | Validation | Default |
|---|---|---|---|---|---|
page |
integer | No | Page number |
1 | |
size |
integer | No | Number of items per page | 20 |
Success Response JSON Sample
:
{
"success": true,
"httpStatus": "OK",
"message": "Unread notificationsNotifications retrieved successfully",
"action_time": "2025-10-18T11:32:00Z"26T10:30:45",
"data": {
"content"notifications": [
{
"id": "123e4567-223e4567-e89b-12d3-a456-426614174000"426614174002",
"userId": "223e4567-e89b-12d3-a456-426614174001"987fcdeb-51a2-43d7-9c4e-123456789abc",
"shopId": "323e4567-e89b-12d3-a456-426614174002",null,
"serviceId": "service-123"PAY-2024-050",
"serviceType": "ORDER"PAYMENT",
"title": "OrderPayment Shipped"Pending",
"message": "Your payment for order has#ORD-2024-001 beenis shipped."pending",
"type": "INFO"WARNING",
"priority": "NORMAL"HIGH",
"isRead": false,
"data": {
"orderId"paymentId": "order-456"PAY-2024-050",
"amount": 150.00
},
"createdAt": "2025-10-17T10:00:00Z"26T10:15:30",
"readAt": null
}
],
"pageable"currentPage": {
"sort": {
"sorted": true,
"unsorted": false,
"empty": false
},
"pageNumber": 0,1,
"pageSize": 20,
"offset"totalElements": 0,
"paged": true,
"unpaged": false
},12,
"totalPages": 1,
"totalElements"hasNext": 1,false,
"last"hasPrevious": false,
"isFirst": true,
"numberOfElements"isLast": 1,
"first": true,
"size": 20,
"number": 0,
"sort": {
"sorted": true,
"unsorted": false,
"empty": false
},
"empty": falsetrue
}
}
3. Get Unread Count
SuccessPurpose: ResponseGet Fields:
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
|
Error Response JSON Sample:
{
"success": false,
"httpStatus": "BAD_REQUEST",
"message": "Invalid pagination parameters",
"action_time": "2025-10-18T11:32:00Z",
"data": "Invalid pagination parameters"
}
Standard Error Types:
400 BAD_REQUEST: Invalid pagination parameters401 UNAUTHORIZED: Invalid or expired token404 NOT_FOUND: No unread notifications found
3. Get Notification Summary
Purpose: Retrieves a summary offor the authenticated user's notification counts (total, unread, read).user
EndpointEndpoint:: GET {base_url}/notifications/summaryunread-count
Access LevelLevel:: 🔒 Protected (AuthenticatedRequires userBearer only)Token Authentication)
AuthenticationAuthentication:: Bearer Token
Request Headers
:
| Header | Type | Required | Description |
|---|---|---|---|
Authorization |
string | Yes | Bearer token for authentication |
Purpose: Endpoint: GET Access Level: 🔒 Protected (Requires Bearer Token Authentication) Authentication: Bearer Token Success Response JSON Sample
{
"success": true,
"httpStatus": "OK",
"message": "Unread count retrieved successfully",
"action_time": "2025-10-26T10:30:45",
"data": {
"unreadCount": 12
}
}
Success Response Fields
Field
Description
unreadCount
Total number of unread notifications
4. Get Notification Summary
: Get a summary of all notifications including total, unread, and read counts{base_url}/notifications/summaryRequest Headers
Header
Type
Required
Description
Authorization
string
Yes
Bearer token for authentication
Success Response JSON Sample
{
"success": true,
"httpStatus": "OK",
"message": "Notification summary retrieved successfully",
"action_time": "2025-10-18T11:32:00Z"26T10:30:45",
"data": {
"totalCount"total": 10,45,
"unreadCount"unread": 3,12,
"readCount"read": 733
}
}
Success Response Fields
:
Field
Description
totaltotalCountTotal number of notifications
unreadunreadCountNumber of unread notifications
readreadCountNumber of read notifications
Error
Response5.
JSONGet Sample:
Shop
{by "success": false,
"httpStatus": "BAD_REQUEST",
"message": "User ID cannot be null",
"action_time": "2025-10-18T11:32:00Z",
"data": "User ID cannot be null"
}
StandardPurpose: ErrorRetrieve Types:
- filtered
400 BAD_REQUEST: User ID issues401 UNAUTHORIZED: Invalid or expired token
4. Mark Notification as Read
Purpose: Marksby a specific notification as read for the authenticated user.shop
EndpointEndpoint:: PATCHGET {base_url}/notifications/shop/{notificationId}/readshopId}
Access LevelLevel:: 🔒 Protected (AuthenticatedRequires userBearer only)Token Authentication)
AuthenticationAuthentication:: Bearer Token
Request Headers
:
| Header | Type | Required | Description |
|---|---|---|---|
Authorization |
string | Yes | Bearer token for authentication |
Path Parameters
:
| Parameter | Type | Required | Description | Validation |
|---|---|---|---|---|
| shopId | UUID | Yes | Unique identifier of the shop | Must be valid UUID format |
Query Parameters
| Parameter | Type | Required | Description | Validation | Default |
|---|---|---|---|---|---|
| page | integer | No | Page number (1-based) | Must be positive integer | 1 |
| size | integer | No | Number of items per page | Must be between 1-100 | 20 |
Success Response JSON Sample
{
"success": true,
"httpStatus": "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 added to your 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 type
Endpoint: GET {base_url}/notifications/service/{serviceType}
Access Level: 🔒 Protected (Requires Bearer Token Authentication)
Authentication: Bearer Token
Request Headers
| Header | Type | Required | Description |
|---|---|---|---|
| Authorization | string | Yes | Bearer token for authentication |
Path Parameters
| Parameter | Type | Required | Description | Validation |
|---|---|---|---|---|
| serviceType | string | Yes | Type of service (ORDER, PAYMENT, SHIPPING, PRODUCT, ACCOUNT) | Must not be empty |
Query Parameters
| Parameter | Type | Required | Description | Validation | Default |
|---|---|---|---|---|---|
| page | integer | No | Page number (1-based) | Must be positive integer | 1 |
| size | integer | No | Number of items per page | Must be between 1-100 | 20 |
Success Response JSON Sample
{
"success": true,
"httpStatus": "OK",
"message": "Notifications retrieved successfully",
"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-002 has been shipped",
"type": "SUCCESS",
"priority": "MEDIUM",
"isRead": false,
"data": {
"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 Notification by ID
Purpose: Retrieve a single notification by its unique identifier
Endpoint: GET {base_url}/notifications/{notificationId}
Access Level: 🔒 Protected (Requires Bearer Token Authentication)
Authentication: Bearer Token
Request Headers
| Header | Type | Required | Description |
|---|---|---|---|
| Authorization | string | Yes | Bearer token for authentication |
Path Parameters
| Parameter | Type | Required | Description | Validation |
|---|---|---|---|---|
| notificationId | UUID | Yes | Unique identifier of the notification |
Success Response JSON Sample
:
{
"success": true,
"httpStatus": "OK",
"message": "Notification markedretrieved as read"successfully",
"action_time": "2025-10-18T11:32:00Z"26T10:30:45",
"data": {
"id": "123e4567-e89b-12d3-a456-426614174000",
"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",
"type": "SUCCESS",
"priority": "MEDIUM",
"isRead": false,
"data": {
"orderId": "ORD-2024-001",
"amount": 150.00,
"currency": "USD"
},
"createdAt": "2025-10-26T09:15:30",
"readAt": null
}
}
Success Response Fields:
|
Error Response JSON Sample
:
{
"success": false,
"httpStatus": "NOT_FOUND",
"message": "Notification not found or access denied",
"action_time": "2025-10-18T11:32:00Z"26T10:30:45",
"data": "Notification not found or access denied"
}
Standard
Error8.
Types:
400 BAD_REQUEST: Invalid notification ID401 UNAUTHORIZED: Invalid or expired token403 FORBIDDEN: Access denied (not user's notification)404 NOT_FOUND:Mark Notificationnot found
5. Batch Mark as Read
PurposePurpose:: MarksMark multiplea notificationssingle notification as read for the authenticated user.
EndpointEndpoint:: PATCHPUT {base_url}/notifications/batch/{notificationId}/read
Access LevelLevel:: 🔒 Protected (AuthenticatedRequires userBearer only)Token Authentication)
AuthenticationAuthentication:: Bearer Token
Request Headers
:
| Header | Type | Required | Description |
|---|---|---|---|
Authorization |
string | Yes | Bearer token for authentication |
Request JSON Sample:
{
"notificationIds": [
"123e4567-e89b-12d3-a456-426614174000",
"223e4567-e89b-12d3-a456-426614174001"
]
}
Request BodyPath Parameters
:
| Parameter | Type | Required | Description | Validation |
|---|---|---|---|---|
|
Success Response JSON Sample:
{
"success": true,
"httpStatus": "OK",
"message": "2 notification(s) marked as read",
"action_time": "2025-10-18T11:32:00Z",
"data": null
}
Success Response Fields:
|
Error Response JSON Sample:
{
"success": false,
"httpStatus": "BAD_REQUEST",
"message": "Notification IDs cannot be empty",
"action_time": "2025-10-18T11:32:00Z",
"data": "Notification IDs cannot be empty"
}
Standard Error Types:
400 BAD_REQUEST: Empty or invalid notification IDs401 UNAUTHORIZED: Invalid or expired token403 FORBIDDEN: Access denied for some notifications404 NOT_FOUND: Some notifications not found
6. Mark All as Read
Purpose: Marks all notifications as read for the authenticated user.
Endpoint: PATCH {base_url}/notifications/read
Access Level: 🔒 Protected (Authenticated user only)
Authentication: Bearer Token
Request Headers:
| |
Success Response JSON Sample:
{
"success": true,
"httpStatus": "OK",
"message": "All notifications marked as read",
"action_time": "2025-10-18T11:32:00Z",
"data": null
}
Success Response Fields:
|
Error Response JSON Sample:
{
"success": false,
"httpStatus": "NOT_FOUND",
"message": "User not found",
"action_time": "2025-10-18T11:32:00Z",
"data": "User not found"
}
Standard Error Types:
7. Delete Notification
Purpose: Deletes a specific notification for the authenticated user.
Endpoint: DELETE {base_url}/notifications/{notificationId}
Access Level: 🔒 Protected (Authenticated user only)
Authentication: Bearer Token
Request Headers:
| |
Path Parameters:
notificationId |
UUID | Yes | Unique identifier of the notification |
Success Response JSON Sample
:
{
"success": true,
"httpStatus": "OK",
"message": "Notification deletedmarked successfully"as read",
"action_time": "2025-10-18T11:32:00Z"26T10:30:45",
"data": null
}
Success Response Fields:
|
Error Response JSON Sample
:
{
"success": false,
"httpStatus": "NOT_FOUND",
"message": "Notification not found or access denied",
"action_time": "2025-10-18T11:32:00Z"26T10:30:45",
"data": "Notification not found or access denied"
}
Standard Error Types:
400 BAD_REQUEST: Invalid notification ID401 UNAUTHORIZED: Invalid or expired token403 FORBIDDEN: Access denied404 NOT_FOUND: Notification not found
8.9. BatchMark DeleteMultiple Notifications
as Read
PurposePurpose:: DeletesMark multiple notifications foras theread authenticatedin user.a single request
EndpointEndpoint:: DELETEPUT {base_url}/notifications/batchread
Access LevelLevel:: 🔒 Protected (AuthenticatedRequires userBearer only)Token Authentication)
AuthenticationAuthentication:: Bearer Token
Request Headers
:
| Header | Type | Required | Description |
|---|---|---|---|
Authorization |
string | Yes | Bearer token for authentication |
| Content-Type | string | Yes | Must be application/json |
Request JSON Sample
:
{
"notificationIds": [
"123e4567-e89b-12d3-a456-426614174000",
"223e4567-e89b-12d3-a456-426614174001"426614174002",
"323e4567-e89b-12d3-a456-426614174003"
]
}
Request Body Parameters
:
| Parameter | Type | Required | Description | Validation |
|---|---|---|---|---|
notificationIds |
array | Yes |
Success Response JSON Sample
:
{
"success": true,
"httpStatus": "OK",
"message": "23 notification(s) deletedmarked successfully"as read",
"action_time": "2025-10-18T11:32:00Z"26T10:30:45",
"data": null
}
Success Response Fields:
|
Error Response JSON Sample
:
{
"success": false,
"httpStatus": "BAD_REQUEST",
"message": "NotificationSome IDsnotifications cannotnot befound empty"or access denied",
"action_time": "2025-10-18T11:32:00Z"26T10:30:45",
"data": "Notification IDs cannot be empty"
}
Standard Error Types:
400 BAD_REQUEST: Empty or invalid notification IDs401 UNAUTHORIZED: Invalid or expired token403 FORBIDDEN: Access denied for some notifications404 NOT_FOUND:Some notifications not found
9.10. DeleteMark All Notifications as Read Notifications
PurposePurpose:: DeletesMark all readunread notifications for the authenticated user.user as read
EndpointEndpoint:: DELETEPUT {base_url}/notifications/readread-all
Access LevelLevel:: 🔒 Protected (AuthenticatedRequires userBearer only)Token Authentication)
AuthenticationAuthentication:: Bearer Token
Request Headers
:
| Header | Type | Required | Description |
|---|---|---|---|
Authorization |
string | Yes | Bearer token for authentication |
Success Response JSON Sample
:
{
"success": true,
"httpStatus": "OK",
"message": "5All notifications marked as read",
"action_time": "2025-10-26T10:30:45",
"data": null
}
11. Delete Notification
Purpose: Delete a single notification permanently
Endpoint: DELETE {base_url}/notifications/{notificationId}
Access Level: 🔒 Protected (Requires Bearer Token Authentication)
Authentication: Bearer Token
Request Headers
| Header | Type | Required | Description |
|---|---|---|---|
| Authorization | string | Yes | Bearer token for authentication |
Path Parameters
| Parameter | Type | Required | Description | Validation |
|---|---|---|---|---|
| notificationId | UUID | Yes | Unique identifier of the notification | Must be valid UUID format |
Success Response JSON Sample
{
"success": true,
"httpStatus": "OK",
"message": "Notification deleted successfully",
"action_time": "2025-10-26T10:30:45",
"data": null
}
Error Response 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
Purpose: Delete multiple notifications in a single request
Endpoint: DELETE {base_url}/notifications/batch
Access Level: 🔒 Protected (Requires Bearer Token Authentication)
Authentication: Bearer Token
Request Headers
| Header | Type | Required | Description |
|---|---|---|---|
| Authorization | string | Yes | Bearer token for authentication |
| Content-Type | string | Yes | Must be application/json |
Request JSON Sample
{
"notificationIds": [
"123e4567-e89b-12d3-a456-426614174000",
"223e4567-e89b-12d3-a456-426614174002",
"323e4567-e89b-12d3-a456-426614174003"
]
}
Request Body Parameters
| Parameter | Type | Required | Description | Validation |
|---|---|---|---|---|
| notificationIds | array | Yes | Array of notification IDs to delete | Must not be empty, each element must be valid UUID |
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
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
| Header | Type | Required | Description |
|---|---|---|---|
| Authorization | string | Yes | Bearer token for authentication |
Success Response JSON Sample
{
"success": true,
"httpStatus": "OK",
"message": "15 read notification(s) deleted successfully",
"action_time": "2025-10-18T11:32:00Z"26T10:30:45",
"data": 515
}
Success Response Fields
:
| Field | Description |
|---|---|
data |
Number of notifications that were deleted |
14. Create In-App Notification
Purpose: Create a new in-app notification (Internal service-to-service endpoint)
Endpoint: POST {base_url}/notifications/in-app
Access Level: 🔒 Protected (Requires API Key or Service Authentication)
Authentication: API Key or Service Token
Request Headers
| Header | Type | Required | Description |
|---|---|---|---|
| X-API-Key | string | Yes | API key for service authentication |
| Content-Type | string | Yes | Must 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
| Parameter | Type | Required | Description | Validation |
|---|---|---|---|---|
| userId | UUID | Yes | ID of the user to receive the notification | Must be valid UUID |
| shopId | UUID | No | ID of the associated shop | Must be valid UUID if provided |
| serviceId | string | Yes | Identifier for the service that generated the notification | Max length 100 characters |
| serviceType | string | Yes | Type of service (ORDER, PAYMENT, SHIPPING, PRODUCT, ACCOUNT) | Max length 50 characters |
| title | string | Yes | Notification title | Max length 255 characters |
| message | string | Yes | Notification message content | Max length 1000 characters |
| type | string | Yes | Notification type (INFO, WARNING, ERROR, SUCCESS) | Max length 50 characters |
| priority | string | Yes | Priority level (LOW, MEDIUM, HIGH, URGENT) | Max length 20 characters |
| data | object | No | Additional metadata as JSON object | Any 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
| Field | Description |
|---|---|
| data | UUID 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)
- 400 BAD_REQUEST:
:General 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
Error Response Examples
Bad Request - General (400)
{
"success": false,
"httpStatus": "BAD_REQUEST",
"message": "User ID cannot be null",
"action_time": "2025-10-18T11:32:00Z"26T10:30:45",
"data": "User ID cannot be null"
}
StandardUnauthorized - 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
Types:
{
400 BAD_REQUEST"success": Userfalse,
ID issues
401 UNAUTHORIZED"httpStatus": Invalid"UNPROCESSABLE_ENTITY",
or"message": expired"Validation token 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
HTTP Method Badge Code Templates
GET Badge:
<span style="background-color: #28a745; color: white; padding: 4px 8px; border-radius: 4px; font-family: monospace; font-size: 12px; font-weight: bold;">GET</span>
POST Badge:
<span style="background-color: #007bff; color: white; padding: 4px 8px; border-radius: 4px; font-family: monospace; font-size: 12px; font-weight: bold;">POST</span>
PATCH Badge:
<span style="background-color: #fd7e14; color: white; padding: 4px 8px; border-radius: 4px; font-family: monospace; font-size: 12px; font-weight: bold;">PATCH</span>
DELETE Badge:
<span style="background-color: #dc3545; color: white; padding: 4px 8px; border-radius: 4px; font-family: monospace; font-size: 12px; font-weight: bold;">DELETE</span>
Common HTTP Status Codes
200OK:OK: Successful GET/PUT/PATCHPUT request201Created:Created: Successful POST request204 NoContent:Content: Successful DELETE request400 BadRequest:Request: Invalid request data401Unauthorized:Unauthorized: Authentication required/failed403Forbidden:Forbidden: Insufficient permissions404 NotFound:Found: Resource not found422 UnprocessableEntity:Entity: Validation errors429 Too ManyRequests:Requests: Rate limit exceeded500 Internal ServerError:Error: Server error
Authentication Types
- Bearer
TokenToken::IncludeAuthorization: Bearer your_tokenin headers (for user endpoints) - API Key: Include
X-API-Key: your_keyin headers (for service-to-service endpoints)
Data Format Standards
DatesDates::Use ISO 8601 format (2025-10-18T11:32:00Z)26T14:30:00)- IDs: All IDs
:use UUID format PaginationPagination::IncludeUsespage,1-basedsize,pagetotal_count,numbering- Boolean Fields: Use
trueorfalse(not 1/0)
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