cURL
curl --request POST \ --url https://api.example.com/orders/{id}/products \ --header 'Content-Type: application/json' \ --data ' { "productId": "<string>", "count": 123 } '
200 OK
400 Bad Request
404 Not Found
409 Conflict
{ "code": "ORDER_NOT_FOUND", "message": "没有找到订单", "orderId": "order_123" }
{ "code": "ORDER_CANNOT_BE_MODIFIED", "message": "订单无法变更", "orderId": "order_123" }
{ "code": "PRODUCT_NOT_IN_ORDER", "message": "订单不包含产品", "productId": "prod_123", "orderId": "order_123" }
curl -X POST https://api.example.com/orders/order_abc123def456/products \ -H "Content-Type: application/json" \ -d '{ "productId": "prod_123456", "count": 5 }'