Notifications and push
In-app notifications
Prefix: /v1/notifications. Auth: Customer (Authorization: Bearer).
| Method | Path | Purpose |
|---|---|---|
GET | /v1/notifications | Paginated inbox |
GET | /v1/notifications/sse | Live stream (text/event-stream) |
PATCH | /v1/notifications/read-all | Mark all read |
PATCH | /v1/notifications/:notificationId/read | Mark one read |
List
Query: page, limit, optional status = unread | read.
results:
| Field | Meaning |
|---|---|
data[] | Notifications |
pagination | { total, page, limit, hasMore } |
unreadCount | Badge number |
Each notification:
| Field | Meaning |
|---|---|
_id | Use for mark-read |
type | Stable key (see below) |
status | unread | read |
title, body | { "en", "ar" } — pick Accept-Language |
data | Optional deep-link payload (orderId, orderNumber, ticketNumber, url, …) |
createdAt | ISO timestamp |
type values (customer)
type | When |
|---|---|
order.placed | Order submitted |
order.confirmed | Store accepted |
order.preparing | Picking started |
order.out_for_delivery | Driver on the way |
order.delivered | Delivered |
order.delivery_failed | Visit failed |
order.cancelled | Cancelled |
order.refunded | Refunded |
points.earned / points.redeemed / points.expiring | Loyalty |
wallet.credited / wallet.debited | Wallet |
coupon.received | Coupon granted |
offer.expiring | Offer ending |
review.requested | Ask for a review |
subscription.activated / expiring / expired | Pro |
account.welcome / account.password_changed | Account |
campaign.message | Marketing campaign |
support.ticket_created / support.replied / support.resolved | Support |
SSE
http
GET /v1/notifications/sse
Authorization: Bearer <accessToken>
Accept: text/event-streamThis is not the JSON envelope. Frames:
event: notification
data: { ...notification object... }data is the same shape as an inbox row. Keep the connection open. Reconnect with backoff on drop.
There is no picker/driver notification SSE. Fulfillment apps should poll their queues.
Push tokens
| Method | Path | Auth | Body |
|---|---|---|---|
POST | /v1/push/register | Customer | { "token": "...", "platform": "ios" | "android" } |
token is 10–256 characters.
FCM sending is not fully configured. Registering a token is safe; do not assume campaign push will arrive until ops enable FCM.