Create a new order from the user’s cart
cURL
curl --request POST \ --url https://api.example.com/orders
{ "id": 42, "userId": 5, "total": "149.97", "status": "pending", "createdAt": "2026-03-06T10:30:00.000Z", "updatedAt": "2026-03-06T10:30:00.000Z" }
Authorization: Bearer <your-token>
pending
shipped
delivered
cancelled
{ "error": "El carrito está vacío" }
{ "error": "Stock insuficiente para el producto \"Wireless Headphones\"" }
{ "error": "Usuario no autenticado" }