Swagger Petstore (1.0.0)

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.

Authentication

petstore_auth

Security Scheme Type OAuth2
implicit OAuth Flow
Authorization URL: http://petstore.swagger.io/oauth/dialog
Scopes:
  • write:pets -

    modify pets in your account

  • read:pets -

    read your pets

api_key

Security Scheme Type API Key
Header parameter name: api_key

pet

Everything about your Pets

Add a new pet to the store

Authorizations:
petstore_auth (write:petsread:pets)
Request Body schema:

Pet object that needs to be added to the store

id
integer <int64>
object (Category)
name
required
string
photoUrls
required
Array of strings
Array of objects (Tag)
status
string
Enum: "available" "pending" "sold"

pet status in the store

Responses

Request samples

Content type
{
  • "id": 0,
  • "category": {
    },
  • "name": "doggie",
  • "photoUrls": [
    ],
  • "tags": [
    ],
  • "status": "available"
}

Update an existing pet

Authorizations:
petstore_auth (write:petsread:pets)
Request Body schema:

Pet object that needs to be added to the store

id
integer <int64>
object (Category)
name
required
string
photoUrls
required
Array of strings
Array of objects (Tag)
status
string
Enum: "available" "pending" "sold"

pet status in the store

Responses

Request samples

Content type
{
  • "id": 0,
  • "category": {
    },
  • "name": "doggie",
  • "photoUrls": [
    ],
  • "tags": [
    ],
  • "status": "available"
}

Finds Pets by status

Multiple status values can be provided with comma separated strings

Authorizations:
petstore_auth (write:petsread:pets)
query Parameters
status
required
Array of strings
Items Enum: "available" "pending" "sold"

Status values that need to be considered for filter

Responses

Response samples

Content type
No sample

Finds Pets by tags Deprecated

Muliple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.

Authorizations:
petstore_auth (write:petsread:pets)
query Parameters
tags
required
Array of strings

Tags to filter by

Responses

Response samples

Content type
No sample

Find pet by ID

Returns a single pet

Authorizations:
path Parameters
petId
required
integer <int64>

ID of pet to return

Responses

Response samples

Content type
No sample

Updates a pet in the store with form data

Authorizations:
petstore_auth (write:petsread:pets)
path Parameters
petId
required
integer <int64>

ID of pet that needs to be updated

Request Body schema: application/x-www-form-urlencoded
name
string

Updated name of the pet

status
string

Updated status of the pet

Responses

Deletes a pet

Authorizations:
petstore_auth (write:petsread:pets)
path Parameters
petId
required
integer <int64>

Pet id to delete

header Parameters
api_key
string

Responses

uploads an image

Authorizations:
petstore_auth (write:petsread:pets)
path Parameters
petId
required
integer <int64>

ID of pet to update

Request Body schema: multipart/form-data
additionalMetadata
string

Additional data to pass to server

file
string <binary>

file to upload

Responses

Response samples

Content type
application/json
{
  • "code": 0,
  • "type": "string",
  • "message": "string"
}

store

Access to Petstore orders

Returns pet inventories by status

Returns a map of status codes to quantities

Authorizations:

Responses

Response samples

Content type
application/json
{
  • "property1": 0,
  • "property2": 0
}

Place an order for a pet

Request Body schema: application/json

order placed for purchasing the pet

id
integer <int64>
petId
integer <int64>
quantity
integer <int32>
shipDate
string <date-time>
status
string
Enum: "placed" "approved" "delivered"

Order Status

complete
boolean
Default: false

Responses

Request samples

Content type
application/json
{
  • "id": 0,
  • "petId": 0,
  • "quantity": 0,
  • "shipDate": "2019-08-24T14:15:22Z",
  • "status": "placed",
  • "complete": false
}

Response samples

Content type
No sample

Find purchase order by ID

For valid response try integer IDs with value >= 1 and <= 10. Other values will generated exceptions

path Parameters
orderId
required
integer <int64> [ 1 .. 10 ]

ID of pet that needs to be fetched

Responses

Response samples

Content type
No sample

Delete purchase order by ID

For valid response try integer IDs with positive integer value. Negative or non-integer values will generate API errors

path Parameters
orderId
required
integer <int64> >= 1

ID of the order that needs to be deleted

Responses

user

Operations about user

Create user

This can only be done by the logged in user.

Request Body schema: application/json

Created user object

id
integer <int64>
username
string
firstName
string
lastName
string
email
string
password
string
phone
string
userStatus
integer <int32>

User Status

Responses

Request samples

Content type
application/json
{
  • "id": 0,
  • "username": "string",
  • "firstName": "string",
  • "lastName": "string",
  • "email": "string",
  • "password": "string",
  • "phone": "string",
  • "userStatus": 0
}

Creates list of users with given input array

Request Body schema: application/json

List of user object

Array ()
id
integer <int64>
username
string
firstName
string
lastName
string
email
string
password
string
phone
string
userStatus
integer <int32>

User Status

Responses

Request samples

Content type
application/json
[
  • {
    }
]

Creates list of users with given input array

Request Body schema: application/json

List of user object

Array ()
id
integer <int64>
username
string
firstName
string
lastName
string
email
string
password
string
phone
string
userStatus
integer <int32>

User Status

Responses

Request samples

Content type
application/json
[
  • {
    }
]

Logs user into the system

query Parameters
username
required
string

The user name for login

password
required
string

The password for login in clear text

Responses

Response samples

Content type
No sample

Logs out current logged in user session

Responses

Get user by user name

path Parameters
username
required
string

The name that needs to be fetched. Use user1 for testing.

Responses

Response samples

Content type
No sample

Updated user

This can only be done by the logged in user.

path Parameters
username
required
string

name that need to be updated

Request Body schema: application/json

Updated user object

id
integer <int64>
username
string
firstName
string
lastName
string
email
string
password
string
phone
string
userStatus
integer <int32>

User Status

Responses

Request samples

Content type
application/json
{
  • "id": 0,
  • "username": "string",
  • "firstName": "string",
  • "lastName": "string",
  • "email": "string",
  • "password": "string",
  • "phone": "string",
  • "userStatus": 0
}

Delete user

This can only be done by the logged in user.

path Parameters
username
required
string

The name that needs to be deleted

Responses