Skip to main content

Notifications

This section covers the endpoints for managing user notifications.

Available Endpoints

List Notifications

Get a list of notifications for the authenticated user.

Endpoint

  • Method: GET
  • URL: /v1/customer/notifications

Request Headers

HeaderValueRequired
Content-Typeapplication/jsonYes
Acceptapplication/jsonYes
AuthorizationBearer tokenYes

Query Parameters

ParameterTypeDescriptionRequiredDefault
per_pageintegerNumber of items per pageNo10
is_readbooleanFilter by read statusNonull

Success Response

{
"success": true,
"message": "تم جلب البيانات بنجاح",
"data": {
"notifications": [
{
"id": "uuid",
"title": "string",
"body": "string",
"type": "string",
"is_read": false,
"created_at": "datetime",
"data": {
"key": "value"
}
}
],
"current_page": 1,
"from": 1,
"last_page": 1,
"per_page": 10,
"to": 1,
"total": 1
},
"statusCode": 200
}

Mark Notification as Read

Mark a specific notification as read.

Endpoint

  • Method: POST
  • URL: /v1/customer/notifications/{id}/read

Request Headers

HeaderValueRequired
Content-Typeapplication/jsonYes
Acceptapplication/jsonYes
AuthorizationBearer tokenYes

Path Parameters

ParameterTypeDescriptionRequired
idstringNotification IDYes

Success Response

{
"success": true,
"message": "تم تحديث البيانات بنجاح.",
"data": [],
"statusCode": 200
}

Mark All Notifications as Read

Mark all notifications as read for the authenticated user.

Endpoint

  • Method: POST
  • URL: /v1/customer/notifications/read-all

Request Headers

HeaderValueRequired
Content-Typeapplication/jsonYes
Acceptapplication/jsonYes
AuthorizationBearer tokenYes

Success Response

{
"success": true,
"message": "تم تحديث حالة جميع الإشعارات بنجاح",
"data": null,
"statusCode": 200
}

Delete Notification

Delete a specific notification.

Endpoint

  • Method: DELETE
  • URL: /v1/customer/notifications/{id}

Request Headers

HeaderValueRequired
Content-Typeapplication/jsonYes
Acceptapplication/jsonYes
AuthorizationBearer tokenYes

Path Parameters

ParameterTypeDescriptionRequired
idstringNotification IDYes

Success Response

{
"success": true,
"message": "تم حذف البيانات بنجاح.",
"data": [],
"statusCode": 200
}

Error Response

Notification Not Found (404)
{
"success": false,
"message": "لم يتم العثور على الإشعار",
"data": null,
"statusCode": 404
}
Unauthorized (401)
{
"success": false,
"message": "غير مصرح",
"data": null,
"statusCode": 401
}

Overview

Notification Information

Each notification includes:

  • Unique identifier
  • Title
  • Body content
  • Type (e.g., 'session', 'order', 'system')
  • Read status
  • Creation timestamp
  • Additional data (type-specific)

Important Notes

  • Notifications are paginated
  • Can be filtered by read status
  • Support different types of notifications
  • Include additional data based on type
  • Notifications are automatically created for various events
  • Read status is tracked per user
  • Notifications can be deleted
  • All operations require authentication