Skip to main content
GitHub
4 min read

API Reference

Store

API endpoints for Store

Content-Typeapplication/json
Version1.0.0

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'
GEThttps://petstore.swagger.io/v2/store/inventory
curl -X GET 'https://petstore.swagger.io/v2/store/inventory'

POST/store/order

Place an order for a pet

Creates a new order in the store.

Request Body

application/json
idoptionalinteger
Order ID
petIdoptionalinteger
ID of the pet being ordered
quantityoptionalinteger
Number of pets ordered
shipDateoptionalstring
Estimated ship date (ISO 8601)
statusoptional”placed” | “approved” | “delivered”
Order status
Values: placed approved delivered
completeoptionalboolean
Whether 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}'
POSThttps://petstore.swagger.io/v2/store/order
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
}'

Returns an order by its ID. Valid IDs are 1 to 10.

Parameters

orderIdrequiredinteger
ID 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}'
GEThttps://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

orderIdrequiredinteger
ID 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}'
DELETEhttps://petstore.swagger.io/v2/store/order/{orderId}
curl -X DELETE 'https://petstore.swagger.io/v2/store/order/{orderId}'