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 |