For the complete documentation index, see llms.txt. This page is also available as Markdown.

Inventory

Track and update stock levels for pets in the store.

List inventory

get
/inventory

Returns current stock levels for all pets in the store.

授权
Authorizationstring必填

Pass your API key as a Bearer token in the Authorization header.

响应
200

An array of inventory entries.

application/json
petIdinteger · int64必填

The ID of the animal this entry tracks.

Example: 1
quantityinteger必填

Current stock count.

Example: 3
statusstring · enum必填可能的值:
get/inventory
curl -L https://petstore.example.com/v1/inventory \
  -H 'Authorization: Bearer YOUR_API_KEY'
[
  {
    "petId": 1,
    "quantity": 3,
    "status": "available"
  },
  {
    "petId": 2,
    "quantity": 0,
    "status": "sold"
  }
]
Experimental

Update stock level

patch
/inventory/{petId}

Updates the stock quantity for a specific pet. Use this to record new arrivals, returns, or manual adjustments.

授权
Authorizationstring必填

Pass your API key as a Bearer token in the Authorization header.

路径参数
petIdinteger · int64必填

The ID of the pet to update stock for.

请求体
quantityinteger必填

The new stock count.

Example: 5
响应
200

Updated inventory entry.

application/json
petIdinteger · int64必填

The ID of the animal this entry tracks.

Example: 1
quantityinteger必填

Current stock count.

Example: 3
statusstring · enum必填可能的值:
patch/inventory/{petId}
curl -L -X PATCH https://petstore.example.com/v1/inventory/1 \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{"quantity": 5}'
{
  "petId": 1,
  "quantity": 3,
  "status": "available"
}

最后更新于