获取宠物库存
返回按状态分类的宠物库存。
GET https://petstore3.swagger.io/api/v3/store/inventory
示例
- API Key
- OAuth 2.0
cURL
curl -X GET "https://petstore3.swagger.io/api/v3/store/inventory" \
-H "accept: application/json" \
-H "api_key: <YOUR_API_KEY>"
cURL
curl -X GET "https://petstore3.swagger.io/api/v3/store/inventory" \
-H "accept: application/json" \
-H "Authorization: Bearer <YOUR_OAUTH_TOKEN>"
响应
| 状态码 | 描述 |
|---|---|
| 200 | 操作成功 |
| default | 意外错误 |
响应示例
200: Successful operation
响应
{
"sold": 0,
"available": 0,
"pending": 0
}
API 为每个订单状态返回一个键,并将其值作为整数计数。没有宠物的状态仍会以 0 计数显示,响应中可以包含 sold、available 和 pending 以外的状态。
参数
无