API Reference
Store
API endpoints for Store
Returns a map of status codes to quantities.
Responses
200Successful operation
Example Response
{}Request Example
curl -X GET 'https://petstore.swagger.io/v2/store/inventory'GET
https://petstore.swagger.io/v2/store/inventorycurl -X GET 'https://petstore.swagger.io/v2/store/inventory'Creates a new order in the store.
Request Body
application/jsonidoptionalintegerOrder ID
petIdoptionalintegerID of the pet being ordered
quantityoptionalintegerNumber of pets ordered
shipDateoptionalstringEstimated ship date (ISO 8601)
statusoptional”placed” | “approved” | “delivered”Order status
Values:
placed approved deliveredcompleteoptionalbooleanWhether the order is complete
Responses
200Successful operation
Example Response
{
"id": 10,
"petId": 10,
"quantity": 0,
"shipDate": "2024-01-15T09:30:00.000Z",
"status": "placed",
"complete": true
}400Invalid order
Request Example
curl -X POST 'https://petstore.swagger.io/v2/store/order' \
-H 'Content-Type: application/json' \
-d '{"id":10,"petId":10,"quantity":0,"shipDate":"2024-01-15T09:30:00.000Z","status":"placed","complete":true}'POST
https://petstore.swagger.io/v2/store/ordercurl -X POST 'https://petstore.swagger.io/v2/store/order' \
-H 'Content-Type: application/json' \
-d '{
"id": 10,
"petId": 10,
"quantity": 0,
"shipDate": "2024-01-15T09:30:00.000Z",
"status": "placed",
"complete": true
}'Returns an order by its ID. Valid IDs are 1 to 10.
Parameters
orderIdrequiredintegerID of order to fetch (1-10)
Responses
200Successful operation
Example Response
{
"id": 10,
"petId": 10,
"quantity": 0,
"shipDate": "2024-01-15T09:30:00.000Z",
"status": "placed",
"complete": true
}400Invalid ID supplied
404Order not found
Request Example
curl -X GET 'https://petstore.swagger.io/v2/store/order/{orderId}'GET
https://petstore.swagger.io/v2/store/order/{orderId}curl -X GET 'https://petstore.swagger.io/v2/store/order/{orderId}'Deletes an order by its ID.
Parameters
orderIdrequiredintegerID of the order to delete
Responses
200Order deleted
400Invalid ID supplied
404Order not found
Request Example
curl -X DELETE 'https://petstore.swagger.io/v2/store/order/{orderId}'DELETE
https://petstore.swagger.io/v2/store/order/{orderId}curl -X DELETE 'https://petstore.swagger.io/v2/store/order/{orderId}'