All protected endpoints require a valid JWT token obtained fromDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/Luisangelebp/SCO_Autolavados/llms.txt
Use this file to discover all available pages before exploring further.
POST /api/users/login. Include it in the Authorization header:
Payments
Payments capture money received from customers. Whether a payment starts as approved or unapproved depends on how it is created — see the individual endpoints for details. Approving a payment increments the AutoLavado’sbalanceUsd and/or balanceBs depending on the payment method.
Get All Payments
🔒 Requires: Any authenticated user (token required) Returns all payment records ordered by most recent first, with each payment’s customer details nested inside.UUID of the payment record.
UUID of the customer who made the payment.
Nested customer (User) object.
Payment method used.
Amount paid in USD.
Amount paid in bolívares.
Transaction reference number, if provided.
Whether the payment has been verified and applied to the business balance.
ISO 8601 datetime of the payment.
Create a Payment
🔒 Requires: Any authenticated user (token required) Registers a new incoming payment from a customer. Payments created through this endpoint are immediately markedapproved: true and the AutoLavado’s balance is updated in the same transaction. This endpoint is intended for in-person POS transactions where funds are confirmed at the time of creation.
UUID of the customer making the payment. Must correspond to an existing user.
Payment method. Accepted values:
Pago Movil, Efectivo, Binance, debit, transferencia, Zelle, Punto de Venta, cash.Amount in USD. For BS-only methods (e.g.
Pago Movil), pass 0.Amount in bolívares. Must be
0 when method is binance — Binance payments are USD-only.Transaction or confirmation reference number. Required for non-cash methods (e.g.
Pago Movil, transferencia). Optional for cash payments.approved: true for this endpoint):
UUID of the payment record.
UUID of the paying customer.
Payment method used.
Amount paid in USD.
Amount paid in bolívares.
Transaction reference number, if provided.
Always
true for payments created via this endpoint — funds are confirmed at POS creation time.ISO 8601 datetime of the payment.
Approve a Payment
🔒 Requires:ADMIN role
Verifies and approves a pending payment (one with approved: false). Sets approved: true and adds the payment amounts to the AutoLavado’s financial balances. The balance update is method-aware:
| Method | Balance updated |
|---|---|
Pago Movil, Efectivo BS, Punto de Venta | balanceBs incremented by mountBS |
Zelle, Efectivo USD, Binance, Cash | balanceUsd incremented by mountUSD |
| All other methods | Both balanceBs and balanceUsd incremented |
UUID of the payment to approve.
approved: true, plus a confirmation message:
Customer Orders
Customer Orders allow clients to submit product purchases and service requests through the web interface. An order starts asPENDING and moves to APPROVED or REJECTED after admin review.
Order Status Reference:
PENDING— Order has been created, inventory decremented, but not yet reviewed by an admin.APPROVED— Admin has approved the order and aSalesrecord has been generated.REJECTED— Admin has rejected the order. Inventory is restored and any linked service orders are markedCANCELLED.
POST /api/customer/orders/:id/pay links a payment to the order but does not change its status — the order remains PENDING until an admin calls the approve or reject endpoints.Get My Orders (Customer)
🔒 Requires:CUSTOMER role
Returns all orders belonging to the authenticated customer, based on the JWT token identity. Orders are returned in descending date order and include full details with linked items, services, and payment.
Get All Orders (Admin)
🔒 Requires:ADMIN role
Returns all customer orders across all customers. Includes full details with items, services, service orders, and linked payments.
Create a Customer Order
🔒 Requires:CUSTOMER role
Creates a new order from the customer-facing web interface. The customerId is taken automatically from the authenticated JWT token — it is not accepted in the request body. Each order can include a mix of product purchases and service requests. The following effects happen atomically in a single transaction:
- For product details (
itemId): Inventory is checked for sufficient stock and decremented bycantimmediately. - For service details (
serviceId): A newServiceOrdersentry is created inEn colastate and linked to this order.
UUID of the customer’s vehicle. Required when any
details entry includes a serviceId.Array of order line items. Each entry must have either
itemId or serviceId, along with cant:- Product line:
{ "itemId": "uuid", "cant": 2 } - Service line:
{ "serviceId": "uuid", "cant": 1 }
UPriceUsd in the request body.UUID of the customer order.
UUID of the customer who placed the order (from JWT token).
UUID of the linked payment.
null until POST /api/customer/orders/:id/pay is called.Current order status. Always
PENDING on creation.ISO 8601 datetime when the order was placed.
Pay for a Customer Order
🔒 Requires: Any authenticated user (token required) Creates aPayment record and links it to the customer order by setting its paymentId. The order status remains PENDING — admin approval is still required after payment is linked. The created payment starts with approved: false and must be approved separately via PATCH /api/payments/:id/approve.
UUID of the
OrderCustomers record to pay for.Payment method. Accepted values:
debit, Pago Movil, binance, cash, transferencia.Amount in USD.
Amount in bolívares. Must be
0 if method is binance.paymentId populated:
The payment created by this endpoint starts as
approved: false. An admin must verify the transaction and call PATCH /api/payments/:id/approve to apply the funds to the AutoLavado’s balance, then call PATCH /api/customer/orders/:id/approve to finalize the sale.Approve a Customer Order
🔒 Requires:ADMIN role
Approves a PENDING customer order that has an associated payment. Creates a Sales record (including line-item SalesDetails) and transitions the order status to APPROVED. The exchange rate and payment method are captured on the sale record.
UUID of the
OrderCustomers record to approve.The USD/BS exchange rate at the time of approval. Used to calculate the bolivar equivalent on the
Sales record.The payment method applied to this sale.
Reject a Customer Order
🔒 Requires:ADMIN role
Rejects a PENDING customer order. All side effects are reversed atomically:
- Product inventory is restored — the
quantitydecremented at order creation is added back. - Linked service orders are marked
CANCELLEDrather than deleted, preserving the audit trail. - The order is marked
REJECTED.
UUID of the
OrderCustomers record to reject.