Create Order
Headers
Bearer token for authentication
Body Parameters
ID of the business to create the order for
Pickup time in HH:mm format (e.g., “14:30”)
Response
Success message: “Pedido generado pendiente de pago.”
Created order object
Error Responses
Error message when:
- Cart is empty (400)
- No products from specified business in cart (422)
- Insufficient stock for a product (422)
- Already has a pending unpaid order (200 with existing order)
Get My Orders
Headers
Bearer token for authentication
Response
Array of order objects
Cancel Order
Headers
Bearer token for authentication
Path Parameters
ID of the order to cancel
Response
Success message: “Pedido cancelado y stock devuelto”
Error Responses
Error message when:
- Order not found or doesn’t belong to user (404)
- Order is not in “Pendiente” status (400)
Pay for Order
Headers
Bearer token for authentication
Path Parameters
ID of the order to pay for
Response
Mercado Pago checkout URL to redirect the user
Error Responses
Error message when:
- Not authorized to pay this order (403)
- Order already paid (400)
After payment is processed, Mercado Pago will send a webhook notification to
/api/webhook/mercadopago to update the order status.