订购宠物
为宠物下达一份购买订单。
POST https://petstore3.swagger.io/api/v3/store/order
示例
- API Key
- OAuth 2.0
cURL
POST "https://petstore3.swagger.io/api/v3/store/order" \
-H "accept: application/json" \
-H "Content-Type: application/json" \
-H "api_key: <YOUR_API_KEY>" \
-d '{
"id": 0,
"petId": 0,
"quantity": 0,
"shipDate": "2025-08-11T15:13:06.939Z",
"status": "placed",
"complete": false
}'
cURL
POST "https://petstore3.swagger.io/api/v3/store/order" \
-H "accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <YOUR_OAUTH_TOKEN>" \
-d '{
"id": 0,
"petId": 0,
"quantity": 0,
"shipDate": "2025-08-11T15:13:06.939Z",
"status": "placed",
"complete": false
}'
响应
| 状态码 | 描述 |
|---|---|
| 200 | 操作成功 |
| 400 | 订单无效 |
| default | 意外错误 |
响应示例
200: 操作成功
Response
{
"id": 0,
"petId": 0,
"quantity": 0,
"shipDate": "2025-08-11T15:13:06.939Z",
"status": "placed",
"complete": false
}
参数
请求正文
| 参数名 | 类型 | 描述 |
|---|---|---|
body | Order 对象 | 必填。 宠物的 Order 对象。 |