Download OpenAPI specification:Download
This is a sample server Petstore server.
You can find out more about Swagger at
http://swagger.io or on irc.freenode.net, #swagger.
For this sample, you can use the api key special-key
to test the authorization filters.
This API is documented in OpenAPI format and is based on Petstore sample provided by swagger.io team. It was extended to illustrate features of generator-openapi-repo tool and ReDoc documentation. In addition to standard OpenAPI syntax we use a few vendor extensions.
This API is documented in OpenAPI format and is based on Petstore sample provided by swagger.io team. It was extended to illustrate features of generator-openapi-repo tool and ReDoc documentation. In addition to standard OpenAPI syntax we use a few vendor extensions.
This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with W3C spec. And that allows cross-domain communication from the browser. All responses have a wildcard same-origin which makes them completely public and accessible to everyone, including any code on any site.
Petstore offers two forms of authentication:
Get access to data while protecting your account credentials. OAuth2 is also a safer and more secure way to give you access.
Security Scheme Type | OAuth2 |
---|---|
implicit OAuth Flow | Authorization URL: http://petstore.swagger.io/api/oauth/dialog Scopes:
|
Information about a new pet in the systems
object Categories this pet belongs to | |
name required | string The name given to a pet |
photoUrls required | Array of strings <url> <= 20 items The list of URL to a cute photos featuring pet |
friend | object Recursive |
Array of objects (Tag) non-empty Tags attached to the pet | |
status | string Enum: "available" "pending" "sold" Pet status in the store |
petType | string Type of a pet cat cat dog bee |
huntingSkill required | string Default: "lazy" Enum: "clueless" "lazy" "adventurous" "aggressive" The measured skill for hunting |
{- "category": {
- "name": "string",
- "sub": {
- "prop1": "string"
}
}, - "name": "Guru",
- "photoUrls": [
- "string"
], - "friend": { },
- "tags": [
- {
- "name": "string"
}
], - "status": "available",
- "petType": "cat",
- "huntingSkill": "adventurous"
}
Add new pet to the store inventory.
write:pets
read:pets
) cookieParam required | integer <int64> Some cookie |
Accept-Language | string Default: en-AU Example: en-US The language you prefer for messages. Supported values are en-AU, en-CA, en-GB, en-US |
Pet object that needs to be added to the store
object Categories this pet belongs to | |
name required | string The name given to a pet |
photoUrls required | Array of strings <url> <= 20 items The list of URL to a cute photos featuring pet |
friend | object Recursive |
Array of objects (Tag) non-empty Tags attached to the pet | |
status | string Enum: "available" "pending" "sold" Pet status in the store |
petType | string Type of a pet cat cat dog bee |
huntingSkill required | string Default: "lazy" Enum: "clueless" "lazy" "adventurous" "aggressive" The measured skill for hunting |
{- "category": {
- "name": "string",
- "sub": {
- "prop1": "string"
}
}, - "name": "Guru",
- "photoUrls": [
- "string"
], - "friend": { },
- "tags": [
- {
- "name": "string"
}
], - "status": "available",
- "petType": "cat",
- "huntingSkill": "adventurous"
}
write:pets
read:pets
) cookieParam required | integer <int64> Some cookie |
Accept-Language | string Default: en-AU Example: en-US The language you prefer for messages. Supported values are en-AU, en-CA, en-GB, en-US |
Pet object that needs to be added to the store
object Categories this pet belongs to | |
name required | string The name given to a pet |
photoUrls required | Array of strings <url> <= 20 items The list of URL to a cute photos featuring pet |
friend | object Recursive |
Array of objects (Tag) non-empty Tags attached to the pet | |
status | string Enum: "available" "pending" "sold" Pet status in the store |
petType | string Type of a pet cat cat dog bee |
huntingSkill required | string Default: "lazy" Enum: "clueless" "lazy" "adventurous" "aggressive" The measured skill for hunting |
{- "category": {
- "name": "string",
- "sub": {
- "prop1": "string"
}
}, - "name": "Guru",
- "photoUrls": [
- "string"
], - "friend": { },
- "tags": [
- {
- "name": "string"
}
], - "status": "available",
- "petType": "cat",
- "huntingSkill": "adventurous"
}
Returns a single pet
petId required | integer <int64> Deprecated ID of pet to return |
{- "id": 0,
- "category": {
- "id": 0,
- "name": "string",
- "sub": {
- "prop1": "string"
}
}, - "name": "Guru",
- "photoUrls": [
- "string"
], - "friend": { },
- "tags": [
- {
- "id": 0,
- "name": "string"
}
], - "status": "available",
- "petType": "cat",
- "huntingSkill": "adventurous"
}
write:pets
read:pets
) petId required | integer <int64> ID of pet that needs to be updated |
name | string Updated name of the pet |
status | string Updated status of the pet |
write:pets
read:pets
) petId required | integer <int64> Pet id to delete |
api_key | string Example: Bearer <TOKEN> |
write:pets
read:pets
) petId required | integer <int64> ID of pet to update |
{- "code": 0,
- "type": "string",
- "message": "string"
}
Multiple status values can be provided with comma separated strings
write:pets
read:pets
) status required | Array of strings [ 1 .. 3 ] items Items Enum: "available" "pending" "sold" Status values that need to be considered for filter |
[- {
- "id": 0,
- "category": {
- "id": 0,
- "name": "string",
- "sub": {
- "prop1": "string"
}
}, - "name": "Guru",
- "photoUrls": [
- "string"
], - "friend": { },
- "tags": [
- {
- "id": 0,
- "name": "string"
}
], - "status": "available",
- "petType": "string"
}
]
Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
write:pets
read:pets
) tags required | Array of strings Tags to filter by |
[- {
- "id": 0,
- "category": {
- "id": 0,
- "name": "string",
- "sub": {
- "prop1": "string"
}
}, - "name": "Guru",
- "photoUrls": [
- "string"
], - "friend": { },
- "tags": [
- {
- "id": 0,
- "name": "string"
}
], - "status": "available",
- "petType": "string"
}
]
order placed for purchasing the pet
quantity | integer <int32> >= 1 Default: 1 |
shipDate | string <date-time> Estimated ship date |
status | string Enum: "placed" "approved" "delivered" Order Status |
requestId | string Unique Request Id |
{- "quantity": 1,
- "shipDate": "2019-08-24T14:15:22Z",
- "status": "placed",
- "requestId": "string"
}
{- "id": 0,
- "petId": 0,
- "quantity": 1,
- "shipDate": "2019-08-24T14:15:22Z",
- "status": "placed",
- "complete": false
}
For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions
orderId required | integer <int64> [ 1 .. 5 ] ID of pet that needs to be fetched |
{- "id": 0,
- "petId": 0,
- "quantity": 1,
- "shipDate": "2019-08-24T14:15:22Z",
- "status": "placed",
- "complete": false
}
Add subscription for a store events
callbackUrl required | string <uri> This URL will be called by the server when the desired event will occur |
eventName required | string Enum: "orderInProgress" "orderShipped" "orderDelivered" Event name for the subscription |
{- "eventName": "orderInProgress"
}
{- "subscriptionId": "AAA-123-BBB-456"
}
{- "orderId": "123",
- "timestamp": "2018-10-19T16:46:45Z",
- "status": "inProgress"
}
This can only be done by the logged in user.
Created user object
Pet (object) or Tag (object) | |
username | string >= 4 characters User supplied username |
firstName | string non-empty User first name |
lastName | string non-empty User last name |
string <email> User email address | |
password | string <password> >= 8 characters /(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])/ User password, MUST contain a mix of upper and lower case letters, as well as digits |
phone | string/^\+(?:[0-9]-?){6,14}[0-9]$/ User phone number in international format |
userStatus | integer <int32> User status |
addresses | Array of any <= 10 characters >= 0 items |
{- "pet": {
- "category": {
- "name": "string",
- "sub": {
- "prop1": "string"
}
}, - "name": "Guru",
- "photoUrls": [
- "string"
], - "friend": { },
- "tags": [
- {
- "name": "string"
}
], - "status": "available",
- "petType": "string"
}, - "username": "John78",
- "firstName": "John",
- "lastName": "Smith",
- "email": "john.smith@example.com",
- "password": "drowssaP123",
- "phone": "+1-202-555-0192",
- "userStatus": 0,
- "addresses": [
- {
- "city": "string",
- "country": "string",
- "street": "string"
}, - 0
]
}
username required | string The name that needs to be fetched. Use user1 for testing. |
{- "id": 0,
- "pet": {
- "id": 0,
- "category": {
- "id": 0,
- "name": "string",
- "sub": {
- "prop1": "string"
}
}, - "name": "Guru",
- "photoUrls": [
- "string"
], - "friend": { },
- "tags": [
- {
- "id": 0,
- "name": "string"
}
], - "status": "available",
- "petType": "string"
}, - "username": "John78",
- "firstName": "John",
- "lastName": "Smith",
- "email": "john.smith@example.com",
- "password": "drowssaP123",
- "phone": "+1-202-555-0192",
- "userStatus": 0,
- "addresses": [
- {
- "city": "string",
- "country": "string",
- "street": "string"
}, - 0
]
}
This can only be done by the logged in user.
username required | string name that need to be deleted |
Updated user object
Pet (object) or Tag (object) | |
username | string >= 4 characters User supplied username |
firstName | string non-empty User first name |
lastName | string non-empty User last name |
string <email> User email address | |
password | string <password> >= 8 characters /(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])/ User password, MUST contain a mix of upper and lower case letters, as well as digits |
phone | string/^\+(?:[0-9]-?){6,14}[0-9]$/ User phone number in international format |
userStatus | integer <int32> User status |
addresses | Array of any <= 10 characters >= 0 items |
{- "pet": {
- "category": {
- "name": "string",
- "sub": {
- "prop1": "string"
}
}, - "name": "Guru",
- "photoUrls": [
- "string"
], - "friend": { },
- "tags": [
- {
- "name": "string"
}
], - "status": "available",
- "petType": "string"
}, - "username": "John78",
- "firstName": "John",
- "lastName": "Smith",
- "email": "john.smith@example.com",
- "password": "drowssaP123",
- "phone": "+1-202-555-0192",
- "userStatus": 0,
- "addresses": [
- {
- "city": "string",
- "country": "string",
- "street": "string"
}, - 0
]
}
List of user object
Pet (object) or Tag (object) | |
username | string >= 4 characters User supplied username |
firstName | string non-empty User first name |
lastName | string non-empty User last name |
string <email> User email address | |
password | string <password> >= 8 characters /(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])/ User password, MUST contain a mix of upper and lower case letters, as well as digits |
phone | string/^\+(?:[0-9]-?){6,14}[0-9]$/ User phone number in international format |
userStatus | integer <int32> User status |
addresses | Array of any <= 10 characters >= 0 items |
[- {
- "pet": {
- "category": {
- "name": "string",
- "sub": {
- "prop1": "string"
}
}, - "name": "Guru",
- "photoUrls": [
- "string"
], - "friend": { },
- "tags": [
- {
- "name": "string"
}
], - "status": "available",
- "petType": "string"
}, - "username": "John78",
- "firstName": "John",
- "lastName": "Smith",
- "email": "john.smith@example.com",
- "password": "drowssaP123",
- "phone": "+1-202-555-0192",
- "userStatus": 0,
- "addresses": [
- {
- "city": "string",
- "country": "string",
- "street": "string"
}, - 0
]
}
]
List of user object
Pet (object) or Tag (object) | |
username | string >= 4 characters User supplied username |
firstName | string non-empty User first name |
lastName | string non-empty User last name |
string <email> User email address | |
password | string <password> >= 8 characters /(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])/ User password, MUST contain a mix of upper and lower case letters, as well as digits |
phone | string/^\+(?:[0-9]-?){6,14}[0-9]$/ User phone number in international format |
userStatus | integer <int32> User status |
addresses | Array of any <= 10 characters >= 0 items |
[- {
- "pet": {
- "category": {
- "name": "string",
- "sub": {
- "prop1": "string"
}
}, - "name": "Guru",
- "photoUrls": [
- "string"
], - "friend": { },
- "tags": [
- {
- "name": "string"
}
], - "status": "available",
- "petType": "string"
}, - "username": "John78",
- "firstName": "John",
- "lastName": "Smith",
- "email": "john.smith@example.com",
- "password": "drowssaP123",
- "phone": "+1-202-555-0192",
- "userStatus": 0,
- "addresses": [
- {
- "city": "string",
- "country": "string",
- "street": "string"
}, - 0
]
}
]
id | |
object Categories this pet belongs to | |
name required | string The name given to a pet |
photoUrls required | Array of strings <url> <= 20 items The list of URL to a cute photos featuring pet |
friend | object Recursive |
Array of objects (Tag) non-empty Tags attached to the pet | |
status | string Enum: "available" "pending" "sold" Pet status in the store |
petType | string Type of a pet cat cat dog bee |
huntingSkill required | string Default: "lazy" Enum: "clueless" "lazy" "adventurous" "aggressive" The measured skill for hunting |
{- "id": 0,
- "category": {
- "id": 0,
- "name": "string",
- "sub": {
- "prop1": "string"
}
}, - "name": "Guru",
- "photoUrls": [
- "string"
], - "friend": { },
- "tags": [
- {
- "id": 0,
- "name": "string"
}
], - "status": "available",
- "petType": "cat",
- "huntingSkill": "adventurous"
}
id | integer <int64> Order ID |
petId | integer <int64> Pet ID |
quantity | integer <int32> >= 1 Default: 1 |
shipDate | string <date-time> Estimated ship date |
status | string Enum: "placed" "approved" "delivered" Order Status |
complete | boolean Default: false Indicates whenever order was completed or not |
requestId | string Unique Request Id |
{- "quantity": 1,
- "shipDate": "2018-10-19T16:46:45Z",
- "status": "placed",
- "complete": false
}