Inventory
Track and update stock levels for pets in the store.
Authorizations
AuthorizationstringRequired
Pass your API key as a Bearer token in the Authorization header.
Responses
200
An array of inventory entries.
application/json
petIdinteger · int64RequiredExample:
The ID of the animal this entry tracks.
1quantityintegerRequiredExample:
Current stock count.
3statusstring · enumRequiredPossible values:
401
Missing or invalid API key.
application/json
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"
}
]Authorizations
AuthorizationstringRequired
Pass your API key as a Bearer token in the Authorization header.
Path parameters
petIdinteger · int64Required
The ID of the pet to update stock for.
Body
quantityintegerRequiredExample:
The new stock count.
5Responses
200
Updated inventory entry.
application/json
petIdinteger · int64RequiredExample:
The ID of the animal this entry tracks.
1quantityintegerRequiredExample:
Current stock count.
3statusstring · enumRequiredPossible values:
400
The request body is missing required fields or contains invalid values.
application/json
401
Missing or invalid API key.
application/json
404
The requested resource could not be found.
application/json
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"
}Last updated
Was this helpful?