Swagger Petstore

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
1.0.0
Contact
apiteam@swagger.io
Terms of Service
http://swagger.io/terms/
License
Apache 2.0

Security

petstore_auth (OAuth 2.0)

Flow implicit
Authorization URL http://petstore.swagger.io/oauth/dialog
Scopes
write:pets modify pets in your account
read:pets read your pets

api_key (API Key)

Name api_key
In header

Tags

Name Description
pet Everything about your Pets
store Access to Petstore orders
user Operations about user

Update an existing pet

PUT /pet

Scope

write:pets read:pets

Tags

pet

Request

Pet object that needs to be added to the store

Response

Status Description
400 Invalid ID supplied
404 Pet not found
405 Validation exception

Body Schema

id
integer (optional)
category
Category (optional)
name
string (required)
photoUrls
array [string] (required)
tags
array [Tag] (optional)
status
string (optional)

pet status in the store

  • available
  • pending
  • sold

Add a new pet to the store

POST /pet

Scope

write:pets read:pets

Tags

pet

Request

Pet object that needs to be added to the store

Response

Status Description
405 Invalid input

Body Schema

id
integer (optional)
category
Category (optional)
name
string (required)
photoUrls
array [string] (required)
tags
array [Tag] (optional)
status
string (optional)

pet status in the store

  • available
  • pending
  • sold

Finds Pets by status

GET /pet/findByStatus

Multiple status values can be provided with comma separated strings

Scope

write:pets read:pets

Tags

pet

Request

Status values that need to be considered for filter

Response

Status Description
200 successful operation
400 Invalid status value

Response Schema

id
integer (optional)
category
Category (optional)
name
string (required)
photoUrls
array [string] (required)
tags
array [Tag] (optional)
status
string (optional)

pet status in the store

  • available
  • pending
  • sold

Finds Pets by tags

GET /pet/findByTags

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

Scope

write:pets read:pets

Tags

pet

Request

Tags to filter by

Response

Status Description
200 successful operation
400 Invalid tag value

Response Schema

id
integer (optional)
category
Category (optional)
name
string (required)
photoUrls
array [string] (required)
tags
array [Tag] (optional)
status
string (optional)

pet status in the store

  • available
  • pending
  • sold

Find pet by ID

GET /pet/{petId}

Returns a single pet

Scope

Tags

pet

Request

ID of pet to return

Response

Status Description
200 successful operation
400 Invalid ID supplied
404 Pet not found

Response Schema

id
integer (optional)
category
Category (optional)
name
string (required)
photoUrls
array [string] (required)
tags
array [Tag] (optional)
status
string (optional)

pet status in the store

  • available
  • pending
  • sold

Updates a pet in the store with form data

POST /pet/{petId}

Scope

write:pets read:pets

Tags

pet

Request

ID of pet that needs to be updated

Updated name of the pet

Updated status of the pet

Response

Status Description
405 Invalid input

Deletes a pet

DELETE /pet/{petId}

Scope

write:pets read:pets

Tags

pet

Request

Pet id to delete

Response

Status Description
400 Invalid ID supplied
404 Pet not found

uploads an image

POST /pet/{petId}/uploadImage

Scope

write:pets read:pets

Tags

pet

Request

ID of pet to update

Additional data to pass to server

file to upload

Response

Status Description
200 successful operation

Response Schema

code
integer (optional)
type
string (optional)
message
string (optional)

Returns pet inventories by status

GET /store/inventory

Returns a map of status codes to quantities

Scope

Tags

store

Response

Status Description
200 successful operation

Place an order for a pet

POST /store/order

Tags

store

Request

order placed for purchasing the pet

Response

Status Description
200 successful operation
400 Invalid Order

Body Schema

id
integer (optional)
petId
integer (optional)
quantity
integer (optional)
shipDate
string (optional)
status
string (optional)

Order Status

  • placed
  • approved
  • delivered
complete
boolean (optional)

Response Schema

id
integer (optional)
petId
integer (optional)
quantity
integer (optional)
shipDate
string (optional)
status
string (optional)

Order Status

  • placed
  • approved
  • delivered
complete
boolean (optional)

Find purchase order by ID

GET /store/order/{orderId}

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

Tags

store

Request

ID of pet that needs to be fetched

Response

Status Description
200 successful operation
400 Invalid ID supplied
404 Order not found

Response Schema

id
integer (optional)
petId
integer (optional)
quantity
integer (optional)
shipDate
string (optional)
status
string (optional)

Order Status

  • placed
  • approved
  • delivered
complete
boolean (optional)

Delete purchase order by ID

DELETE /store/order/{orderId}

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

Tags

store

Request

ID of the order that needs to be deleted

Response

Status Description
400 Invalid ID supplied
404 Order not found

Create user

POST /user

This can only be done by the logged in user.

Tags

user

Request

Created user object

Response

Status Description
default successful operation

Body Schema

id
integer (optional)
username
string (optional)
firstName
string (optional)
lastName
string (optional)
email
string (optional)
password
string (optional)
phone
string (optional)
userStatus
integer (optional)

User Status


Creates list of users with given input array

POST /user/createWithArray

Tags

user

Request

List of user object

Response

Status Description
default successful operation

Creates list of users with given input array

POST /user/createWithList

Tags

user

Request

List of user object

Response

Status Description
default successful operation

Logs user into the system

GET /user/login

Tags

user

Request

The user name for login

The password for login in clear text

Response

Status Description
200 successful operation
400 Invalid username/password supplied

Logs out current logged in user session

GET /user/logout

Tags

user

Response

Status Description
default successful operation

Get user by user name

GET /user/{username}

Tags

user

Request

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

Response

Status Description
200 successful operation
400 Invalid username supplied
404 User not found

Response Schema

id
integer (optional)
username
string (optional)
firstName
string (optional)
lastName
string (optional)
email
string (optional)
password
string (optional)
phone
string (optional)
userStatus
integer (optional)

User Status


Updated user

PUT /user/{username}

This can only be done by the logged in user.

Tags

user

Request

name that need to be updated

Updated user object

Response

Status Description
400 Invalid user supplied
404 User not found

Body Schema

id
integer (optional)
username
string (optional)
firstName
string (optional)
lastName
string (optional)
email
string (optional)
password
string (optional)
phone
string (optional)
userStatus
integer (optional)

User Status


Delete user

DELETE /user/{username}

This can only be done by the logged in user.

Tags

user

Request

The name that needs to be deleted

Response

Status Description
400 Invalid username supplied
404 User not found