Swagger Petstore - OpenAPI 3.1 (1.0.1)
Download OpenAPI specification:
This is a sample Pet Store Server based on the OpenAPI 3.1 specification. You can find out more about Swagger at https://swagger.io. In the third iteration of the pet store, we've switched to the design first approach! You can now help us improve the API whether it's by making changes to the definition itself or to the code. That way, with time, we can improve the API in general, and expose some of the new features in OAS3.
Some useful links:
Link to Docs: Docs
With Anchor: Docs - To the API Docs
Link to API Docs: WARNING: Link not valid!
With tag: Access to Petstore orders
With operationId: Returns pet inventories by status
Update an existing pet
MkDocs Redoc Plugin Linkung Example:
Link to Docs: Docs
With Anchor: Docs - To the API Docs
Link to API Docs: WARNING: Link not valid!
With tag: Access to Petstore orders
With operationId: Returns pet inventories by status
Authorizations:
Request Body schema: required
Update an existent pet in the store
| id | integer <int64> |
| name required | string |
object (Category) | |
| photoUrls required | Array of strings |
Array of objects (Tag) | |
| status | string Enum: "available" "pending" "sold" pet status in the store |
Responses
Response Schema:
| id | integer <int64> |
| name required | string |
object (Category) | |
| photoUrls required | Array of strings |
Array of objects (Tag) | |
| status | string Enum: "available" "pending" "sold" pet status in the store |
Request samples
- Payload
{- "id": 10,
- "name": "doggie",
- "category": {
- "id": 1,
- "name": "Dogs"
}, - "photoUrls": [
- "string"
], - "tags": [
- {
- "id": 0,
- "name": "string"
}
], - "status": "available"
}Response samples
- 200
{- "id": 10,
- "name": "doggie",
- "category": {
- "id": 1,
- "name": "Dogs"
}, - "photoUrls": [
- "string"
], - "tags": [
- {
- "id": 0,
- "name": "string"
}
], - "status": "available"
}Add a new pet to the store
Add a new pet to the store
Authorizations:
Request Body schema: required
Create a new pet in the store
| id | integer <int64> |
| name required | string |
object (Category) | |
| photoUrls required | Array of strings |
Array of objects (Tag) | |
| status | string Enum: "available" "pending" "sold" pet status in the store |
Responses
Response Schema:
| id | integer <int64> |
| name required | string |
object (Category) | |
| photoUrls required | Array of strings |
Array of objects (Tag) | |
| status | string Enum: "available" "pending" "sold" pet status in the store |
Request samples
- Payload
{- "id": 10,
- "name": "doggie",
- "category": {
- "id": 1,
- "name": "Dogs"
}, - "photoUrls": [
- "string"
], - "tags": [
- {
- "id": 0,
- "name": "string"
}
], - "status": "available"
}Response samples
- 200
{- "id": 10,
- "name": "doggie",
- "category": {
- "id": 1,
- "name": "Dogs"
}, - "photoUrls": [
- "string"
], - "tags": [
- {
- "id": 0,
- "name": "string"
}
], - "status": "available"
}Finds Pets by status
Multiple status values can be provided with comma separated strings
Authorizations:
query Parameters
| status | string Default: "available" Enum: "available" "pending" "sold" Status values that need to be considered for filter |
Responses
Response Schema:
| id | integer <int64> |
| name required | string |
object (Category) | |
| photoUrls required | Array of strings |
Array of objects (Tag) | |
| status | string Enum: "available" "pending" "sold" pet status in the store |
Response samples
- 200
[- {
- "id": 10,
- "name": "doggie",
- "category": {
- "id": 1,
- "name": "Dogs"
}, - "photoUrls": [
- "string"
], - "tags": [
- {
- "id": 0,
- "name": "string"
}
], - "status": "available"
}
]Finds Pets by tags
Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
Authorizations:
query Parameters
| tags | Array of strings Tags to filter by |
Responses
Response Schema:
| id | integer <int64> |
| name required | string |
object (Category) | |
| photoUrls required | Array of strings |
Array of objects (Tag) | |
| status | string Enum: "available" "pending" "sold" pet status in the store |
Response samples
- 200
[- {
- "id": 10,
- "name": "doggie",
- "category": {
- "id": 1,
- "name": "Dogs"
}, - "photoUrls": [
- "string"
], - "tags": [
- {
- "id": 0,
- "name": "string"
}
], - "status": "available"
}
]Find pet by ID
Returns a single pet
Authorizations:
path Parameters
| petId required | integer <int64> ID of pet to return |
Responses
Response Schema:
| id | integer <int64> |
| name required | string |
object (Category) | |
| photoUrls required | Array of strings |
Array of objects (Tag) | |
| status | string Enum: "available" "pending" "sold" pet status in the store |
Response samples
- 200
{- "id": 10,
- "name": "doggie",
- "category": {
- "id": 1,
- "name": "Dogs"
}, - "photoUrls": [
- "string"
], - "tags": [
- {
- "id": 0,
- "name": "string"
}
], - "status": "available"
}uploads an image
Authorizations:
path Parameters
| petId required | integer <int64> ID of pet to update |
query Parameters
| additionalMetadata | string Additional Metadata |
Request Body schema: application/octet-stream
Responses
Response Schema: application/json
| code | integer <int32> |
| type | string |
| message | string |
Response samples
- 200
{- "code": 0,
- "type": "string",
- "message": "string"
}Place an order for a pet
Place a new order in the store
Request Body schema:
| id | integer <int64> |
| petId | integer <int64> |
| quantity | integer <int32> |
| shipDate | string <date-time> |
| status | string Enum: "placed" "approved" "delivered" Order Status |
| complete | boolean |
Responses
Response Schema: application/json
| id | integer <int64> |
| petId | integer <int64> |
| quantity | integer <int32> |
| shipDate | string <date-time> |
| status | string Enum: "placed" "approved" "delivered" Order Status |
| complete | boolean |
Request samples
- Payload
{- "id": 10,
- "petId": 198772,
- "quantity": 7,
- "shipDate": "2019-08-24T14:15:22Z",
- "status": "approved",
- "complete": true
}Response samples
- 200
{- "id": 10,
- "petId": 198772,
- "quantity": 7,
- "shipDate": "2019-08-24T14:15:22Z",
- "status": "approved",
- "complete": true
}Find purchase order by ID
For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions.
path Parameters
| orderId required | integer <int64> ID of order that needs to be fetched |
Responses
Response Schema:
| id | integer <int64> |
| petId | integer <int64> |
| quantity | integer <int32> |
| shipDate | string <date-time> |
| status | string Enum: "placed" "approved" "delivered" Order Status |
| complete | boolean |
Response samples
- 200
{- "id": 10,
- "petId": 198772,
- "quantity": 7,
- "shipDate": "2019-08-24T14:15:22Z",
- "status": "approved",
- "complete": true
}Create user
This can only be done by the logged in user.
Request Body schema:
Created user object
| id | integer <int64> |
| username | string |
| firstName | string |
| lastName | string |
string | |
| password | string |
| phone | string |
| userStatus | integer <int32> User Status |
Responses
Request samples
- Payload
{- "id": 10,
- "username": "theUser",
- "firstName": "John",
- "lastName": "James",
- "email": "john@email.com",
- "password": "12345",
- "phone": "12345",
- "userStatus": 1
}Response samples
- default
{- "id": 10,
- "username": "theUser",
- "firstName": "John",
- "lastName": "James",
- "email": "john@email.com",
- "password": "12345",
- "phone": "12345",
- "userStatus": 1
}Creates list of users with given input array
Creates list of users with given input array
Request Body schema: application/json
| id | integer <int64> |
| username | string |
| firstName | string |
| lastName | string |
string | |
| password | string |
| phone | string |
| userStatus | integer <int32> User Status |
Responses
Response Schema:
| id | integer <int64> |
| username | string |
| firstName | string |
| lastName | string |
string | |
| password | string |
| phone | string |
| userStatus | integer <int32> User Status |
Request samples
- Payload
[- {
- "id": 10,
- "username": "theUser",
- "firstName": "John",
- "lastName": "James",
- "email": "john@email.com",
- "password": "12345",
- "phone": "12345",
- "userStatus": 1
}
]Response samples
- 200
{- "id": 10,
- "username": "theUser",
- "firstName": "John",
- "lastName": "James",
- "email": "john@email.com",
- "password": "12345",
- "phone": "12345",
- "userStatus": 1
}Logs user into the system
query Parameters
| username | string The user name for login |
| password | string The password for login in clear text |
Responses
| X-Rate-Limit | integer <int32> calls per hour allowed by the user |
| X-Expires-After | string <date-time> date in UTC when token expires |
Response Schema:
Response samples
- 200
Get user by user name
path Parameters
| username required | string The name that needs to be fetched. Use user1 for testing. |
Responses
Response Schema:
| id | integer <int64> |
| username | string |
| firstName | string |
| lastName | string |
string | |
| password | string |
| phone | string |
| userStatus | integer <int32> User Status |
Response samples
- 200
{- "id": 10,
- "username": "theUser",
- "firstName": "John",
- "lastName": "James",
- "email": "john@email.com",
- "password": "12345",
- "phone": "12345",
- "userStatus": 1
}Update user
This can only be done by the logged in user.
path Parameters
| username required | string name that need to be deleted |
Request Body schema:
Update an existent user in the store
| id | integer <int64> |
| username | string |
| firstName | string |
| lastName | string |
string | |
| password | string |
| phone | string |
| userStatus | integer <int32> User Status |
Responses
Request samples
- Payload
{- "id": 10,
- "username": "theUser",
- "firstName": "John",
- "lastName": "James",
- "email": "john@email.com",
- "password": "12345",
- "phone": "12345",
- "userStatus": 1
}