Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/160906/Yakultt-App/llms.txt

Use this file to discover all available pages before exploring further.

The Yakult App notification system keeps delivery drivers informed in real time without requiring any manual configuration. Whenever an order is assigned to a driver or its status changes, the platform automatically creates and delivers a targeted notification visible only to that driver. Drivers access their full notification inbox through the Avisos tab in the mobile app, where they can review unread messages, mark items as read individually or all at once, and quickly navigate to the related order.

Notification Types

Every notification carries a tipo field that describes why it was created. The mobile app uses this value to display the appropriate icon and to help drivers prioritize their inbox.

asignacion 🚚

Triggered when an order is created with a driver already assigned, or when a driver is reassigned to an existing order. Alerts the driver that a delivery is now their responsibility.

estado 🔄

Triggered when the status of an order changes and the change was made by someone other than the assigned driver. Keeps the driver up to date on order progress without generating noise from their own actions.

info 🔔

General informational messages sent by the platform. Used for system-level updates and announcements not tied to a specific order action.
Notifications are only sent to the assigned repartidor. If the repartidor themselves updates the status of their own order, they do not receive a redundant estado notification — the system skips notification creation in that case to avoid inbox clutter.

Notification Data Structure

Each notification object contains the following fields.
{
  "id": 1,
  "ordenId": 5,
  "tipo": "asignacion",
  "titulo": "Nueva orden asignada",
  "mensaje": "Se te asignó la orden #5 de Tienda López.",
  "leida": false,
  "fecha": "15 Jan 10:23"
}

Field Reference

FieldTypeDescription
idnumberUnique notification ID
ordenIdnumberID of the related order. Use to deep-link into order detail.
tipostringOne of asignacion, estado, or info
titulostringShort subject line displayed in the notification list
mensajestringFull notification body with contextual details
leidabooleanfalse if unread, true once the driver has marked it read
fechastringHuman-readable timestamp formatted as DD Mon HH:MM

API Endpoints

All notification endpoints use the x-user-id header to identify the requesting driver. This numeric ID is provided automatically by the mobile app on every request.

Fetch Notifications

Returns the 50 most recent notifications for the authenticated driver, ordered by date descending.
GET /api/notificaciones
Required header: x-user-id: <userId>
curl https://your-api.com/api/notificaciones \
  -H "x-user-id: 3"
Response
[
  {
    "id": 1,
    "ordenId": 5,
    "tipo": "asignacion",
    "titulo": "Nueva orden asignada",
    "mensaje": "Se te asignó la orden #5 de Tienda López.",
    "leida": false,
    "fecha": "15 Jan 10:23"
  },
  {
    "id": 2,
    "ordenId": 5,
    "tipo": "estado",
    "titulo": "Orden #5 actualizada",
    "mensaje": "La orden de Tienda López cambió a \"En camino\".",
    "leida": true,
    "fecha": "15 Jan 11:05"
  }
]
The mobile app uses React Navigation’s useFocusEffect hook to re-fetch notifications every time the driver navigates to the Avisos tab. This lightweight polling approach means drivers always see a fresh inbox without the overhead of a persistent WebSocket connection.

Mark One Notification as Read

Update the leida flag to true for a single notification. Typically called when the driver taps a notification item in the list.
PUT /api/notificaciones/:id/leida
Required header: x-user-id: <userId>
curl -X PUT https://your-api.com/api/notificaciones/1/leida \
  -H "x-user-id: 3"
Response
{ "ok": true }

Mark All Notifications as Read

Bulk-update all of the driver’s unread notifications to leida: true in a single request. Invoked by the Mark all as read button in the Avisos tab.
PUT /api/notificaciones/leer-todas
Required header: x-user-id: <userId>
curl -X PUT https://your-api.com/api/notificaciones/leer-todas \
  -H "x-user-id: 3"
Response
{ "ok": true }

Mobile App — Avisos Tab

The Avisos tab is the driver’s notification inbox inside the Yakult mobile app. It surfaces all relevant alerts in a single, easy-to-scan list.
1

Unread Count Badge

A red badge on the Avisos tab icon shows the number of unread notifications. The count is derived from the leida: false entries returned by GET /api/notificaciones and refreshes every time the tab comes into focus.
2

Notification List

Notifications are displayed in reverse-chronological order. Each row shows the type icon, titulo, mensaje preview, and fecha. Unread items appear visually distinct from read ones.
3

Type Icons

The app renders a contextual icon based on the tipo field:
  • 🚚 asignacion — a new or reassigned delivery
  • 🔄 estado — an order status change
  • 🔔 info — a general system message
4

Tap to Mark as Read

Tapping any notification calls PUT /api/notificaciones/:id/leida, flips its leida flag to true, and navigates the driver to the related order detail screen using ordenId.
5

Mark All as Read

A Mark all as read button at the top of the tab calls PUT /api/notificaciones/leer-todas, immediately clearing the unread badge and updating the visual state of every item in the list.

Endpoint Summary

MethodEndpointHeaderDescription
GET/api/notificacionesx-user-idFetch the 50 most recent notifications
PUT/api/notificaciones/:id/leidax-user-idMark one notification as read
PUT/api/notificaciones/leer-todasx-user-idMark all notifications as read

Build docs developers (and LLMs) love