When a buyer decides to purchase a product on TuKit, this endpoint registers the order in the system. The controller looks up the product by itsDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/fredy-rizo/tukit/llms.txt
Use this file to discover all available pages before exploring further.
productId path parameter, builds the cart with line-item subtotals (using discountPrice when present, otherwise price), and associates the cart with the authenticated buyer. The quantity per line is fixed at 1 (cantBuy: 1). After a successful order creation the cart’s confirmed_payment status is unset until the buyer uploads a proof-of-payment image and the seller validates it.
Create the order
Call
POST /api/shopping-cart/:productId with the product list and client details. The API returns a savedBuy object containing the new cart _id you will need in the next step.Upload payment proof
Call
POST /api/shopping-cart/load/:shoppingCartId/voucher with the payment screenshot or bank transfer receipt as multipart/form-data. See Upload Proof.Seller confirms payment
The product owner calls
POST /api/shopping-cart/update-payment/:shoppingCartId/confirmed with confirmed_payment: {key: 1, name: "Pago"} to approve the transaction. See Confirm Payment.Method and path
Authentication
A valid JWT must be passed in thetoken-access request header. The token is obtained from the login endpoint. The authenticated user becomes the buyer (user) on the created cart document.
| Header | Required | Description |
|---|---|---|
token-access | ✅ Yes | JWT issued at login |
Path parameters
The MongoDB
_id of the product being purchased. The controller calls Product.findById(productId) and returns 404 if no matching document exists.Request body
Array of product objects used only to compute the order total. The controller iterates this array to sum subtotals; the actual product snapshot stored on the cart document is always fetched from the database using
productId. Only price (and optionally discountPrice) are read from each element for the calculation.Buyer name details stored on the cart document.
The
cantBuy quantity is always set to 1 by the server regardless of any value provided in the request body. Each product line has its subtotal computed as cantBuy × (discountPrice ?? price). The total and subtotal fields on the cart document both equal the sum of all product subtotals.Responses
200 — Order created
"Compra registrada. Para confirmar el producto, debe cargar el justificante de pago"trueThe full persisted
ShoppingCart document.Error responses
| Status | msj | Cause |
|---|---|---|
403 | "Sin token" | token-access header is missing |
401 | "Token inexistente" | JWT is invalid or expired |
404 | "Producto no encontrado" | No Product document matches productId |
500 | (error object) | Unexpected server error |