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
License: Apache 2.0
Terms of service: http://swagger.io/terms/
Base URL: petstore.swagger.io/v2
Available Tags: DELETE, GET, POST, PUT, createWithArray, createWithList, findByStatus, findByTag, inventory, login, logout, order, pet, store, uploadImage, user
Paths
/pet
POST /pet
pet
POST
Summary

Add a new pet to the store

Parameters
Name Located In Description Required Schema

body

body

Pet object that needs to be added to the store

Yes

{
   "id": "int64",
   "category": {
      "id": "int64",
      "name": "string"
   },
   "name": "string",
   "photoUrls": [
      "string"
   ],
   "tags": [
      {
         "id": "int64",
         "name": "string"
      }
   ],
   "status": "string"     /* pet status in the store */
}

Responses
Code Description Schema

405

Invalid input


PUT /pet
pet
PUT
Summary

Update an existing pet

Parameters
Name Located In Description Required Schema

body

body

Pet object that needs to be added to the store

Yes

{
   "id": "int64",
   "category": {
      "id": "int64",
      "name": "string"
   },
   "name": "string",
   "photoUrls": [
      "string"
   ],
   "tags": [
      {
         "id": "int64",
         "name": "string"
      }
   ],
   "status": "string"     /* pet status in the store */
}

Responses
Code Description Schema

400

Invalid ID supplied


404

Pet not found


405

Validation exception


/pet/findByStatus
GET /pet/findByStatus
pet
findByStatus
GET
Summary

Finds Pets by status

Description

Multiple status values can be provided with comma separated strings

Parameters
Name Located In Description Required Schema

status

query

Status values that need to be considered for filter

Yes

["available", "pending", "sold"]

Responses
Code Description Schema

200

successful operation

[
   {
      "id": "int64",
      "category": {
         "id": "int64",
         "name": "string"
      },
      "name": "string",
      "photoUrls": [
         "string"
      ],
      "tags": [
         {
            "id": "int64",
            "name": "string"
         }
      ],
      "status": "string"     /* pet status in the store */
   }
]

400

Invalid status value


/pet/findByTags
GET /pet/findByTags
pet
findByTag
GET
Summary

Finds Pets by tags

Description

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

Parameters
Name Located In Description Required Schema

tags

query

Tags to filter by

Yes

["string"]

Responses
Code Description Schema

200

successful operation

[
   {
      "id": "int64",
      "category": {
         "id": "int64",
         "name": "string"
      },
      "name": "string",
      "photoUrls": [
         "string"
      ],
      "tags": [
         {
            "id": "int64",
            "name": "string"
         }
      ],
      "status": "string"     /* pet status in the store */
   }
]

400

Invalid tag value


/pet/{petId}
GET /pet/{petId}
pet
GET
Summary

Find pet by ID

Description

Returns a single pet

Parameters
Name Located In Description Required Schema

petId

path

ID of pet to return

Yes

integer

Responses
Code Description Schema

200

successful operation

{
   "id": "int64",
   "category": {
      "id": "int64",
      "name": "string"
   },
   "name": "string",
   "photoUrls": [
      "string"
   ],
   "tags": [
      {
         "id": "int64",
         "name": "string"
      }
   ],
   "status": "string"     /* pet status in the store */
}

400

Invalid ID supplied


404

Pet not found


POST /pet/{petId}
pet
POST
Summary

Updates a pet in the store with form data

Parameters
Name Located In Description Required Schema

petId

path

ID of pet that needs to be updated

Yes

integer

name

formData

Updated name of the pet

No

string

status

formData

Updated status of the pet

No

string

Responses
Code Description Schema

405

Invalid input


DELETE /pet/{petId}
pet
DELETE
Summary

Deletes a pet

Parameters
Name Located In Description Required Schema

api_key

header

No

string

petId

path

Pet id to delete

Yes

integer

Responses
Code Description Schema

400

Invalid ID supplied


404

Pet not found


/pet/{petId}/uploadImage
POST /pet/{petId}/uploadImage
uploadImage
pet
POST
Summary

uploads an image

Parameters
Name Located In Description Required Schema

petId

path

ID of pet to update

Yes

integer

additionalMetadata

formData

Additional data to pass to server

No

string

file

formData

file to upload

No

file

Responses
Code Description Schema

200

successful operation

{
   "code": "int32",
   "type": "string",
   "message": "string"
}

/store/inventory
GET /store/inventory
store
inventory
GET
Summary

Returns pet inventories by status

Description

Returns a map of status codes to quantities

Responses
Code Description Schema

200

successful operation

{
   "additionalProperties_1": "int32"
}

/store/order
POST /store/order
store
order
POST
Summary

Place an order for a pet

Parameters
Name Located In Description Required Schema

body

body

order placed for purchasing the pet

Yes

{
   "id": "int64",
   "petId": "int64",
   "quantity": "int32",
   "shipDate": "string",
   "status": "string",     /* Order Status */
   "complete": "boolean"
}

Responses
Code Description Schema

200

successful operation

{
   "id": "int64",
   "petId": "int64",
   "quantity": "int32",
   "shipDate": "string",
   "status": "string",     /* Order Status */
   "complete": "boolean"
}

400

Invalid Order


/store/order/{orderId}
GET /store/order/{orderId}
store
order
GET
Summary

Find purchase order by ID

Description

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

Parameters
Name Located In Description Required Schema

orderId

path

ID of pet that needs to be fetched

Yes

integer

Responses
Code Description Schema

200

successful operation

{
   "id": "int64",
   "petId": "int64",
   "quantity": "int32",
   "shipDate": "string",
   "status": "string",     /* Order Status */
   "complete": "boolean"
}

400

Invalid ID supplied


404

Order not found


DELETE /store/order/{orderId}
store
order
DELETE
Summary

Delete purchase order by ID

Description

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

Parameters
Name Located In Description Required Schema

orderId

path

ID of the order that needs to be deleted

Yes

integer

Responses
Code Description Schema

400

Invalid ID supplied


404

Order not found


/user
POST /user
user
POST
Summary

Create user

Description

This can only be done by the logged in user.

Parameters
Name Located In Description Required Schema

body

body

Created user object

Yes

{
   "id": "int64",
   "username": "string",
   "firstName": "string",
   "lastName": "string",
   "email": "string",
   "password": "string",
   "phone": "string",
   "userStatus": "int32"     /* User Status */
}

Responses
Code Description Schema

default

successful operation


/user/createWithArray
POST /user/createWithArray
user
createWithArray
POST
Summary

Creates list of users with given input array

Parameters
Name Located In Description Required Schema

body

body

List of user object

Yes

[
   {
      "id": "int64",
      "username": "string",
      "firstName": "string",
      "lastName": "string",
      "email": "string",
      "password": "string",
      "phone": "string",
      "userStatus": "int32"     /* User Status */
   }
]

Responses
Code Description Schema

default

successful operation


/user/createWithList
POST /user/createWithList
user
createWithList
POST
Summary

Creates list of users with given input array

Parameters
Name Located In Description Required Schema

body

body

List of user object

Yes

[
   {
      "id": "int64",
      "username": "string",
      "firstName": "string",
      "lastName": "string",
      "email": "string",
      "password": "string",
      "phone": "string",
      "userStatus": "int32"     /* User Status */
   }
]

Responses
Code Description Schema

default

successful operation


/user/login
GET /user/login
user
login
GET
Summary

Logs user into the system

Parameters
Name Located In Description Required Schema

username

query

The user name for login

Yes

string

password

query

The password for login in clear text

Yes

string

Responses
Code Description Schema

200

successful operation

"string"

400

Invalid username/password supplied


/user/logout
GET /user/logout
user
logout
GET
Summary

Logs out current logged in user session

Responses
Code Description Schema

default

successful operation


/user/{username}
GET /user/{username}
user
GET
Summary

Get user by user name

Parameters
Name Located In Description Required Schema

username

path

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

Yes

string

Responses
Code Description Schema

200

successful operation

{
   "id": "int64",
   "username": "string",
   "firstName": "string",
   "lastName": "string",
   "email": "string",
   "password": "string",
   "phone": "string",
   "userStatus": "int32"     /* User Status */
}

400

Invalid username supplied


404

User not found


PUT /user/{username}
user
PUT
Summary

Updated user

Description

This can only be done by the logged in user.

Parameters
Name Located In Description Required Schema

username

path

name that need to be updated

Yes

string

body

body

Updated user object

Yes

{
   "id": "int64",
   "username": "string",
   "firstName": "string",
   "lastName": "string",
   "email": "string",
   "password": "string",
   "phone": "string",
   "userStatus": "int32"     /* User Status */
}

Responses
Code Description Schema

400

Invalid user supplied


404

User not found


DELETE /user/{username}
user
DELETE
Summary

Delete user

Description

This can only be done by the logged in user.

Parameters
Name Located In Description Required Schema

username

path

The name that needs to be deleted

Yes

string

Responses
Code Description Schema

400

Invalid username supplied


404

User not found