The Orders API is the operational core of Yakult App. Creating an order automatically deducts the sold quantities from each product’s stock in a single database transaction and, when a delivery driver (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.
repartidor) is assigned at creation time, fires an in-app notification to alert them. Status transitions follow the lifecycle Pendiente → En camino → Entregado; any status change triggered by someone other than the assigned driver also sends a notification so drivers stay informed in real time. No global authentication middleware is applied — callers identify themselves via the x-user-id header where needed.
GET /api/ordenes
Returns all orders with their line items, client details, and assigned personnel, ordered from most recent to oldest. Example requestUnique numeric order ID.
Name of the client who placed the order.
Phone number of the client.
Name of the sales promotor who created the order, or
null if unassigned.Numeric ID of the assigned delivery driver, or
null if unassigned.Name of the assigned delivery driver, or
null if unassigned.Sum of all line item subtotals.
Current status:
Pendiente, En camino, or Entregado.Formatted order date, e.g.
"15 Jan".Line items included in the order.
POST /api/ordenes
Creates a new order, deducts stock for every line item in a single transaction, and optionally notifies the assigned delivery driver. No authentication is required; includex-user-id in the header if needed for downstream notification logic.
Stock deduction is performed as part of order creation in a transaction. If any step fails, the entire operation rolls back. The API does not validate that stock is sufficient before deducting — check
GET /api/productos beforehand if needed.ID of the client receiving the order.
ID of the promotor creating the order. Pass
null to leave unassigned.ID of the delivery driver responsible for fulfillment. Pass
null to leave unassigned. If provided, an in-app notification is sent to this user immediately.Array of line items. Must contain at least one entry.
Pre-calculated grand total for the order.
Auto-generated ID of the newly created order.
| Status | Reason |
|---|---|
500 | A database error occurred; the transaction was rolled back. |
PUT /api/ordenes/:id/estado
Updates the status of an existing order. If the change is triggered by someone other than the assigned delivery driver, the driver receives an in-app notification.Numeric ID of the order to update.
New status for the order. Typical values:
Pendiente, En camino, or Entregado.x-user-id header so the API can determine whether to notify the repartidor (the notification is skipped when the actor is the same user as the assigned driver).
Example request
PUT /api/ordenes/:id/repartidor
Assigns or unassigns a delivery driver for an existing order. When a driver is assigned, they receive an in-app notification.Numeric ID of the order to update.
ID of the delivery driver to assign, or
null to remove the current assignment.DELETE /api/ordenes/:id
Permanently deletes an order and all of its line items in a single transaction. If any step fails, the entire operation is rolled back.Deleting an order does not restore the stock that was deducted when the order was created. Adjust inventory manually via
PUT /api/productos/:id if needed.Numeric ID of the order to delete.
| Status | Reason |
|---|---|
500 | A database error occurred; the transaction was rolled back. |