The Status Change endpoint allows administrators to move a sale through its payment lifecycle. Submitting a newDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/fredy-rizo/ecommerce-delivery/llms.txt
Use this file to discover all available pages before exploring further.
status object updates the sale record, triggers relevant business logic (such as decrementing product stock when a payment is confirmed), and sends an FCM push notification to the buyer. Once an order reaches Entregado (Delivered) status, it becomes immutable — further status changes are rejected.
Endpoint
Authentication
Requires a valid user Token in the request headers.Path Parameters
The MongoDB ObjectId of the sale whose status is being updated.
Request Body
An object describing the new status to assign to the sale.
Valid Status Values
The following are the only recognised status combinations. Both
name and value must be provided together as a pair.name | value | Description |
|---|---|---|
"Pagado" | "1" | Payment confirmed. Decrements product stock (minCant) by cantBuy. |
"Pendiente" | "2" | Awaiting payment from the buyer. This is the initial status set at order creation. |
"Cancelado" | "3" | Order has been cancelled. |
"Validando" | "4" | Payment proof submitted and under admin review. Set automatically by the Upload Proof endpoint. |
"Entregado" | "5" | Order has been delivered. Terminal state — cannot be changed once set. |
Business Logic
Stock Decrement (Pagado)
When the new status is{ name: "Pagado", value: "1" }, the server uses $inc to subtract cantBuy from the corresponding product’s minCant field in the products collection.
FCM Push Notification (Buyer)
After every successful status update, the buyer receives a push notification if they have an active FCM token:| Field | Value |
|---|---|
title | "Actualizacion de tu pedido" |
body | "El estado de tu compra con codigo {codeSale} a cambiado a {status.name}" |
data.saleId | The saleId from the path parameter |
data.type | "status_update" |