Download OpenAPI specification:Download
This is a sample Pet Store Server based on the OpenAPI 3.0 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.
If you're looking for the Swagger 2.0/OAS 2.0 version of Petstore, then click here. Alternatively, you can load via the Edit > Load Petstore OAS 2.0
menu option!
Some useful links:
Update an existing pet by Id
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 |
{- "id": 10,
- "name": "doggie",
- "category": {
- "id": 1,
- "name": "Dogs"
}, - "photoUrls": [
- "string"
], - "tags": [
- {
- "id": 0,
- "name": "string"
}
], - "status": "available"
}
{- "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
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 |
{- "id": 10,
- "name": "doggie",
- "category": {
- "id": 1,
- "name": "Dogs"
}, - "photoUrls": [
- "string"
], - "tags": [
- {
- "id": 0,
- "name": "string"
}
], - "status": "available"
}
{- "id": 10,
- "name": "doggie",
- "category": {
- "id": 1,
- "name": "Dogs"
}, - "photoUrls": [
- "string"
], - "tags": [
- {
- "id": 0,
- "name": "string"
}
], - "status": "available"
}
Multiple status values can be provided with comma separated strings
status | string Default: "available" Enum: "available" "pending" "sold" Status values that need to be considered for filter |
[- {
- "id": 10,
- "name": "doggie",
- "category": {
- "id": 1,
- "name": "Dogs"
}, - "photoUrls": [
- "string"
], - "tags": [
- {
- "id": 0,
- "name": "string"
}
], - "status": "available"
}
]
Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
tags | Array of strings Tags to filter by |
[- {
- "id": 10,
- "name": "doggie",
- "category": {
- "id": 1,
- "name": "Dogs"
}, - "photoUrls": [
- "string"
], - "tags": [
- {
- "id": 0,
- "name": "string"
}
], - "status": "available"
}
]
Returns a single pet
petId required | integer <int64> ID of pet to return |
{- "id": 10,
- "name": "doggie",
- "category": {
- "id": 1,
- "name": "Dogs"
}, - "photoUrls": [
- "string"
], - "tags": [
- {
- "id": 0,
- "name": "string"
}
], - "status": "available"
}
petId required | integer <int64> ID of pet to update |
additionalMetadata | string Additional Metadata |
{- "code": 0,
- "type": "string",
- "message": "string"
}
Place a new order in the store
id | integer <int64> |
petId | integer <int64> |
quantity | integer <int32> |
shipDate | string <date-time> |
status | string Enum: "placed" "approved" "delivered" Order Status |
complete | boolean |
{- "id": 10,
- "petId": 198772,
- "quantity": 7,
- "shipDate": "2019-08-24T14:15:22Z",
- "status": "approved",
- "complete": true
}
{- "id": 10,
- "petId": 198772,
- "quantity": 7,
- "shipDate": "2019-08-24T14:15:22Z",
- "status": "approved",
- "complete": true
}
For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions.
orderId required | integer <int64> ID of order that needs to be fetched |
{- "id": 10,
- "petId": 198772,
- "quantity": 7,
- "shipDate": "2019-08-24T14:15:22Z",
- "status": "approved",
- "complete": true
}
This can only be done by the logged in user.
Created user object
id | integer <int64> |
username | string |
firstName | string |
lastName | string |
string | |
password | string |
phone | string |
userStatus | integer <int32> User Status |
{- "id": 10,
- "username": "theUser",
- "firstName": "John",
- "lastName": "James",
- "email": "john@email.com",
- "password": "12345",
- "phone": "12345",
- "userStatus": 1
}
{- "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
id | integer <int64> |
username | string |
firstName | string |
lastName | string |
string | |
password | string |
phone | string |
userStatus | integer <int32> User Status |
[- {
- "id": 10,
- "username": "theUser",
- "firstName": "John",
- "lastName": "James",
- "email": "john@email.com",
- "password": "12345",
- "phone": "12345",
- "userStatus": 1
}
]
{- "id": 10,
- "username": "theUser",
- "firstName": "John",
- "lastName": "James",
- "email": "john@email.com",
- "password": "12345",
- "phone": "12345",
- "userStatus": 1
}
username required | string The name that needs to be fetched. Use user1 for testing. |
{- "id": 10,
- "username": "theUser",
- "firstName": "John",
- "lastName": "James",
- "email": "john@email.com",
- "password": "12345",
- "phone": "12345",
- "userStatus": 1
}
This can only be done by the logged in user.
username required | string name that need to be deleted |
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 |
{- "id": 10,
- "username": "theUser",
- "firstName": "John",
- "lastName": "James",
- "email": "john@email.com",
- "password": "12345",
- "phone": "12345",
- "userStatus": 1
}