-

Swagger Petstore

-
-
-
-

Overview

-
-

- 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. -

-

Version information

- - -

- Version : 1.0.0 -

-
- -

Contact information

- - -

- Contact Email : apiteam@swagger.io -

-
- -

License information

- - -

- License : Apache 2.0 -License URL : http://www.apache.org/licenses/LICENSE-2.0.html -Terms of service : http://swagger.io/terms/ -

-
- -

URI scheme

- - -

- Host : petstore.swagger.io -BasePath : /v2 -Schemes : HTTPS, HTTP -

-
- -

Tags

- - -
    -
  • pet : Everything about your Pets
  • -
  • store : Access to Petstore orders
  • -
  • user : Operations about user
  • -
-
- -

External Docs

- - -

- Description : Find out more about Swagger -URL : http://swagger.io -

-
- -
- -
- -
-

Paths

-
-
-
-

Add a new pet to the store

-
-
POST/pet
-

Parameters

- - - - - - - - - - - - - - - - -
TypeNameDescriptionSchema

Body

body
required

Pet object that needs to be added to the store

Pet

-
- -

Responses

- - - - - - - - - - - - - - -
HTTP CodeDescriptionSchema
405Invalid inputNo Content
-
- -

Consumes

- - -
    -
  • application/json
  • -
  • application/xml
  • -
-
- -

Produces

- - -
    -
  • application/xml
  • -
  • application/json
  • -
-
- -

Tags

- - -
    -
  • pet
  • -
-
- -

Security

- - - - - - - - - - - - - - -
TypeNameScopes
oauth2petstore_authwrite:pets,read:pets
-
- -
- -
- -
-

Update an existing pet

-
-
PUT/pet
-

Parameters

- - - - - - - - - - - - - - - - -
TypeNameDescriptionSchema

Body

body
required

Pet object that needs to be added to the store

Pet

-
- -

Responses

- - - - - - - - - - - - - - - - - - - - - - - - -
HTTP CodeDescriptionSchema
400Invalid ID suppliedNo Content
404Pet not foundNo Content
405Validation exceptionNo Content
-
- -

Consumes

- - -
    -
  • application/json
  • -
  • application/xml
  • -
-
- -

Produces

- - -
    -
  • application/xml
  • -
  • application/json
  • -
-
- -

Tags

- - -
    -
  • pet
  • -
-
- -

Security

- - - - - - - - - - - - - - -
TypeNameScopes
oauth2petstore_authwrite:pets,read:pets
-
- -
- -
- -
-

Finds Pets by status

-
-
GET/pet/findByStatus
-

Description

- - -

- Multiple status values can be provided with comma separated strings -

-
- -

Parameters

- - - - - - - - - - - - - - - - -
TypeNameDescriptionSchema

Query

status
required

Status values that need to be considered for filter

< enum (available, pending, sold) > array(multi)

-
- -

Responses

- - - - - - - - - - - - - - - - - - - -
HTTP CodeDescriptionSchema
200successful operation< Pet > array
400Invalid status valueNo Content
-
- -

Produces

- - -
    -
  • application/xml
  • -
  • application/json
  • -
-
- -

Tags

- - -
    -
  • pet
  • -
-
- -

Security

- - - - - - - - - - - - - - -
TypeNameScopes
oauth2petstore_authwrite:pets,read:pets
-
- -
- -
- -
-

Finds Pets by tags

-
-
GET/pet/findByTags
-

- Caution : -This operation is deprecated. -

-

Description

- - -

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

-
- -

Parameters

- - - - - - - - - - - - - - - - -
TypeNameDescriptionSchema

Query

tags
required

Tags to filter by

< string > array(multi)

-
- -

Responses

- - - - - - - - - - - - - - - - - - - -
HTTP CodeDescriptionSchema
200successful operation< Pet > array
400Invalid tag valueNo Content
-
- -

Produces

- - -
    -
  • application/xml
  • -
  • application/json
  • -
-
- -

Tags

- - -
    -
  • pet
  • -
-
- -

Security

- - - - - - - - - - - - - - -
TypeNameScopes
oauth2petstore_authwrite:pets,read:pets
-
- -
- -
- -
-

Updates a pet in the store with form data

-
-
POST/pet/{petId}
-

Parameters

- - - - - - - - - - - - - - - - - - - - - - - - - - - - -
TypeNameDescriptionSchema

Path

petId
required

ID of pet that needs to be updated

integer (int64)

FormData

name
optional

Updated name of the pet

string

FormData

status
optional

Updated status of the pet

string

-
- -

Responses

- - - - - - - - - - - - - - -
HTTP CodeDescriptionSchema
405Invalid inputNo Content
-
- -

Consumes

- - -
    -
  • application/x-www-form-urlencoded
  • -
-
- -

Produces

- - -
    -
  • application/xml
  • -
  • application/json
  • -
-
- -

Tags

- - -
    -
  • pet
  • -
-
- -

Security

- - - - - - - - - - - - - - -
TypeNameScopes
oauth2petstore_authwrite:pets,read:pets
-
- -
- -
- -
-

Find pet by ID

-
-
GET/pet/{petId}
-

Description

- - -

- Returns a single pet -

-
- -

Parameters

- - - - - - - - - - - - - - - - -
TypeNameDescriptionSchema

Path

petId
required

ID of pet to return

integer (int64)

-
- -

Responses

- - - - - - - - - - - - - - - - - - - - - - - - -
HTTP CodeDescriptionSchema
200successful operationPet
400Invalid ID suppliedNo Content
404Pet not foundNo Content
-
- -

Produces

- - -
    -
  • application/xml
  • -
  • application/json
  • -
-
- -

Tags

- - -
    -
  • pet
  • -
-
- -

Security

- - - - - - - - - - - - -
TypeName
apiKeyapi_key
-
- -
- -
- -
-

Deletes a pet

-
-
DELETE/pet/{petId}
-

Parameters

- - - - - - - - - - - - - - - - - - - - - - -
TypeNameDescriptionSchema

Header

api_key
optional

string

Path

petId
required

Pet id to delete

integer (int64)

-
- -

Responses

- - - - - - - - - - - - - - - - - - - -
HTTP CodeDescriptionSchema
400Invalid ID suppliedNo Content
404Pet not foundNo Content
-
- -

Produces

- - -
    -
  • application/xml
  • -
  • application/json
  • -
-
- -

Tags

- - -
    -
  • pet
  • -
-
- -

Security

- - - - - - - - - - - - - - -
TypeNameScopes
oauth2petstore_authwrite:pets,read:pets
-
- -
- -
- -
-

uploads an image

-
-
POST/pet/{petId}/uploadImage
-

Parameters

- - - - - - - - - - - - - - - - - - - - - - - - - - - - -
TypeNameDescriptionSchema

Path

petId
required

ID of pet to update

integer (int64)

FormData

additionalMetadata
optional

Additional data to pass to server

string

FormData

file
optional

file to upload

file

-
- -

Responses

- - - - - - - - - - - - - - -
HTTP CodeDescriptionSchema
200successful operationApiResponse
-
- -

Consumes

- - -
    -
  • multipart/form-data
  • -
-
- -

Produces

- - -
    -
  • application/json
  • -
-
- -

Tags

- - -
    -
  • pet
  • -
-
- -

Security

- - - - - - - - - - - - - - -
TypeNameScopes
oauth2petstore_authwrite:pets,read:pets
-
- -
- -
- -
-

Returns pet inventories by status

-
-
GET/store/inventory
-

Description

- - -

- Returns a map of status codes to quantities -

-
- -

Responses

- - - - - - - - - - - - - - -
HTTP CodeDescriptionSchema
200successful operation< string, integer (int32) > map
-
- -

Produces

- - -
    -
  • application/json
  • -
-
- -

Tags

- - -
    -
  • store
  • -
-
- -

Security

- - - - - - - - - - - - -
TypeName
apiKeyapi_key
-
- -
- -
- -
-

Place an order for a pet

-
-
POST/store/order
-

Parameters

- - - - - - - - - - - - - - - - -
TypeNameDescriptionSchema

Body

body
required

order placed for purchasing the pet

Order

-
- -

Responses

- - - - - - - - - - - - - - - - - - - -
HTTP CodeDescriptionSchema
200successful operationOrder
400Invalid OrderNo Content
-
- -

Produces

- - -
    -
  • application/xml
  • -
  • application/json
  • -
-
- -

Tags

- - -
    -
  • store
  • -
-
- -
- -
- -
-

Find purchase order by ID

-
-
GET/store/order/{orderId}
-

Description

- - -

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

-
- -

Parameters

- - - - - - - - - - - - - - - - -
TypeNameDescriptionSchema

Path

orderId
required

ID of pet that needs to be fetched

integer (int64)

-
- -

Responses

- - - - - - - - - - - - - - - - - - - - - - - - -
HTTP CodeDescriptionSchema
200successful operationOrder
400Invalid ID suppliedNo Content
404Order not foundNo Content
-
- -

Produces

- - -
    -
  • application/xml
  • -
  • application/json
  • -
-
- -

Tags

- - -
    -
  • store
  • -
-
- -
- -
- -
-

Delete purchase order by ID

-
-
DELETE/store/order/{orderId}
-

Description

- - -

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

-
- -

Parameters

- - - - - - - - - - - - - - - - -
TypeNameDescriptionSchema

Path

orderId
required

ID of the order that needs to be deleted

integer (int64)

-
- -

Responses

- - - - - - - - - - - - - - - - - - - -
HTTP CodeDescriptionSchema
400Invalid ID suppliedNo Content
404Order not foundNo Content
-
- -

Produces

- - -
    -
  • application/xml
  • -
  • application/json
  • -
-
- -

Tags

- - -
    -
  • store
  • -
-
- -
- -
- -
-

Create user

-
-
POST/user
-

Description

- - -

- This can only be done by the logged in user. -

-
- -

Parameters

- - - - - - - - - - - - - - - - -
TypeNameDescriptionSchema

Body

body
required

Created user object

User

-
- -

Responses

- - - - - - - - - - - - - - -
HTTP CodeDescriptionSchema
defaultsuccessful operationNo Content
-
- -

Produces

- - -
    -
  • application/xml
  • -
  • application/json
  • -
-
- -

Tags

- - -
    -
  • user
  • -
-
- -
- -
- -
-

Creates list of users with given input array

-
-
POST/user/createWithArray
-

Parameters

- - - - - - - - - - - - - - - - -
TypeNameDescriptionSchema

Body

body
required

List of user object

< User > array

-
- -

Responses

- - - - - - - - - - - - - - -
HTTP CodeDescriptionSchema
defaultsuccessful operationNo Content
-
- -

Produces

- - -
    -
  • application/xml
  • -
  • application/json
  • -
-
- -

Tags

- - -
    -
  • user
  • -
-
- -
- -
- -
-

Creates list of users with given input array

-
-
POST/user/createWithList
-

Parameters

- - - - - - - - - - - - - - - - -
TypeNameDescriptionSchema

Body

body
required

List of user object

< User > array

-
- -

Responses

- - - - - - - - - - - - - - -
HTTP CodeDescriptionSchema
defaultsuccessful operationNo Content
-
- -

Produces

- - -
    -
  • application/xml
  • -
  • application/json
  • -
-
- -

Tags

- - -
    -
  • user
  • -
-
- -
- -
- -
-

Logs user into the system

-
-
GET/user/login
-

Parameters

- - - - - - - - - - - - - - - - - - - - - - -
TypeNameDescriptionSchema

Query

password
required

The password for login in clear text

string

Query

username
required

The user name for login

string

-
- -

Responses

- - - - - - - - - - - - - - - - - - - -
HTTP CodeDescriptionSchema

200

successful operation
Headers :
X-Rate-Limit (integer (int32)) : calls per hour allowed by the user.
X-Expires-After (string (date-time)) : date in UTC when token expires.

string

400Invalid username/password suppliedNo Content
-
- -

Produces

- - -
    -
  • application/xml
  • -
  • application/json
  • -
-
- -

Tags

- - -
    -
  • user
  • -
-
- -
- -
- -
-

Logs out current logged in user session

-
-
GET/user/logout
-

Responses

- - - - - - - - - - - - - - -
HTTP CodeDescriptionSchema
defaultsuccessful operationNo Content
-
- -

Produces

- - -
    -
  • application/xml
  • -
  • application/json
  • -
-
- -

Tags

- - -
    -
  • user
  • -
-
- -
- -
- -
-

Get user by user name

-
-
GET/user/{username}
-

Parameters

- - - - - - - - - - - - - - - - -
TypeNameDescriptionSchema

Path

username
required

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

string

-
- -

Responses

- - - - - - - - - - - - - - - - - - - - - - - - -
HTTP CodeDescriptionSchema
200successful operationUser
400Invalid username suppliedNo Content
404User not foundNo Content
-
- -

Produces

- - -
    -
  • application/xml
  • -
  • application/json
  • -
-
- -

Tags

- - -
    -
  • user
  • -
-
- -
- -
- -
-

Updated user

-
-
PUT/user/{username}
-

Description

- - -

- This can only be done by the logged in user. -

-
- -

Parameters

- - - - - - - - - - - - - - - - - - - - - - -
TypeNameDescriptionSchema

Path

username
required

name that need to be updated

string

Body

body
required

Updated user object

User

-
- -

Responses

- - - - - - - - - - - - - - - - - - - -
HTTP CodeDescriptionSchema
400Invalid user suppliedNo Content
404User not foundNo Content
-
- -

Produces

- - -
    -
  • application/xml
  • -
  • application/json
  • -
-
- -

Tags

- - -
    -
  • user
  • -
-
- -
- -
- -
-

Delete user

-
-
DELETE/user/{username}
-

Description

- - -

- This can only be done by the logged in user. -

-
- -

Parameters

- - - - - - - - - - - - - - - - -
TypeNameDescriptionSchema

Path

username
required

The name that needs to be deleted

string

-
- -

Responses

- - - - - - - - - - - - - - - - - - - -
HTTP CodeDescriptionSchema
400Invalid username suppliedNo Content
404User not foundNo Content
-
- -

Produces

- - -
    -
  • application/xml
  • -
  • application/json
  • -
-
- -

Tags

- - -
    -
  • user
  • -
-
- -
- -
- -
- -
-

Definitions

-
-
-
-

ApiResponse

-
- - - - - - - - - - - - - - - - - - -
NameSchema

code
optional

integer (int32)

message
optional

string

type
optional

string

-
-
- -
-

Category

-
- - - - - - - - - - - - - - -
NameSchema

id
optional

integer (int64)

name
optional

string

-
-
- -
-

Order

-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionSchema

complete
optional

Default : false

boolean

id
optional

integer (int64)

petId
optional

integer (int64)

quantity
optional

integer (int32)

shipDate
optional

string (date-time)

status
optional

Order Status

enum (placed, approved, delivered)

-
-
- -
-

Pet

-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionSchema

category
optional

Category

id
optional

integer (int64)

name
required

Example : "doggie"

string

photoUrls
required

< string > array

status
optional

pet status in the store

enum (available, pending, sold)

tags
optional

< Tag > array

-
-
- -
-

Tag

-
- - - - - - - - - - - - - - -
NameSchema

id
optional

integer (int64)

name
optional

string

-
-
- -
-

User

-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameDescriptionSchema

email
optional

string

firstName
optional

string

id
optional

integer (int64)

lastName
optional

string

password
optional

string

phone
optional

string

userStatus
optional

User Status

integer (int32)

username
optional

string

-
-
- -
- -
-

Security

-
-
-
-

petstore_auth

-
-

- Type : oauth2 -Flow : implicit -Token URL : https://petstore.swagger.io/oauth/authorize -

- - - - - - - - - - - - - - -
NameDescription
write:petsmodify pets in your account
read:petsread your pets
-
-
- -
-

api_key

-
-

- Type : apiKey -Name : api_key -In : HEADER -

-
-
- -
- -