Cria um novo pedido
Cria um pedido com os itens do carrinho, o valor total e a quantidade total.
POST
/create-order
curl \
--request POST 'http://localhost:8000/create-order' \
--header "Content-Type: application/json" \
--data '{"user_id":1,"cartItems":[{"id":101,"quantity":2}],"totalAmount":50.75,"totalQuantity":3}'
Request examples
{
"user_id": 1,
"cartItems": [
{
"id": 101,
"quantity": 2
}
],
"totalAmount": 50.75,
"totalQuantity": 3
}
Response examples (201)
{
"message": "Order created successfully!",
"order_id": 123
}
Response examples (400)
{
"message": "The given data was invalid."
}