Store API Functions
With these API functions, you can manage your pet store's inventory and orders.
Getting pet inventories
Returns pet inventories by status.
Endpoint: https://petstore3.swagger.io/api/v3/store/inventory
Operation: GET
Examples
- API Key
- OAuth 2.0
GET "https://petstore3.swagger.io/api/v3/store/inventory" \
-H "accept: application/json" \
-H "api_key: <YOUR_API_KEY>"
GET "https://petstore3.swagger.io/api/v3/store/inventory" \
-H "accept: application/json" \
-H "Authorization: Bearer <YOUR_OAUTH_TOKEN>"
Responses
| Code | Description |
|---|---|
| 200 | Successful operation |
| default | Unexpected error |
Response example
200: Successful operation
{
"sold": 0,
"available": 0,
"pending": 0
}
Parameters
None
Placing an order
Places an order for a pet.
Endpoint: https://petstore3.swagger.io/api/v3/store/order
Operation: POST
Examples
- API Key
- OAuth 2.0
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
}'
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
}'
Responses
| Code | Description |
|---|---|
| 200 | Successful operation |
| 400 | Invalid Order |
| default | Unexpected error |
Response example
200: Successful operation
{
"id": 0,
"petId": 0,
"quantity": 0,
"shipDate": "2025-08-11T15:13:06.939Z",
"status": "placed",
"complete": false
}
Parameters
Request body
| Name | Type | Description |
|---|---|---|
| body | Order object | (Required) The Order object for the pet. |
Finding an order
Finds an order by its ID.
Endpoint: https://petstore3.swagger.io/api/v3/store/order/{orderId}
Operation: GET
Examples
- API Key
- OAuth 2.0
GET "https://petstore3.swagger.io/api/v3/store/order/1" \
-H "accept: application/json" \
-H "api_key: <YOUR_API_KEY>"
GET "https://petstore3.swagger.io/api/v3/store/order/1" \
-H "accept: application/json" \
-H "Authorization: Bearer <YOUR_OAUTH_TOKEN>"
Responses
| Code | Description |
|---|---|
| 200 | Successful operation |
| 400 | Invalid ID supplied |
| 404 | Order not found |
| default | Unexpected error |
Response example
200: Successful operation
{
"id": 1,
"petId": 0,
"quantity": 0,
"shipDate": "2025-08-11T15:13:06.939Z",
"status": "placed",
"complete": false
}
Parameters
Path parameters
| Name | Type | Description |
|---|---|---|
| orderId | integer | ID of the purchase order to fetch |
Deleting an order
Deletes an order by its ID.
Endpoint: https://petstore3.swagger.io/api/v3/store/order/{orderId}
Operation: DELETE
Examples
- API Key
- OAuth 2.0
DELETE "https://petstore3.swagger.io/api/v3/store/order/1" \
-H "accept: application/json" \
-H "api_key: <YOUR_API_KEY>"
DELETE "https://petstore3.swagger.io/api/v3/store/order/1" \
-H "accept: application/json" \
-H "Authorization: Bearer <YOUR_OAUTH_TOKEN>"
Responses
| Code | Description |
|---|---|
| 200 | order deleted |
| 400 | Invalid ID supplied |
| 404 | Order not found |
| default | Unexpected error |
(A successful deletion returns a 200 code with no response body.)
Parameters
Path parameters
| Name | Type | Description |
|---|---|---|
| orderId | integer | ID of the order to delete |