Orders
Create Order
Create a new order from the user’s cart
POST
Create Order
Creates a new order by converting all items in the authenticated user’s cart into an order. This endpoint:Documentation Index
Fetch the complete documentation index at: https://mintlify.com/GioTaipe/E-commerce/llms.txt
Use this file to discover all available pages before exploring further.
- Validates that the cart is not empty
- Calculates the total price based on current product prices
- Creates order items with the price at time of purchase
- Reduces product stock atomically
- Clears the cart after successful order creation
Authentication
This endpoint requires authentication. Include a valid JWT token in the Authorization header.Request
No request body is required. The order is created from the user’s current cart contents.Response
Unique identifier for the order
ID of the user who placed the order
Total amount for the order (decimal as string)
Current status of the order. Defaults to
pending.Possible values:pending- Order has been created but not yet processedshipped- Order has been shippeddelivered- Order has been deliveredcancelled- Order has been cancelled
ISO 8601 timestamp when the order was created
ISO 8601 timestamp when the order was last updated
Error Responses
400 Bad Request
Returned when:- The cart is empty
- Insufficient stock for one or more products
401 Unauthorized
Returned when the authentication token is missing or invalid.Create Order