PetStore

Pet Store
Operations
Pet
POST /pet/{petId}/uploadImage
GET /pet/findByStatus
GET /pet/findByTags
GET /pet/{petId}
DELETE /pet/{petId}
uploads an image
POST /pet/{petId}/uploadImage

Authentication

petstore_auth
write:pets
read:pets

Path variables

petId
integer int64 required

ID of pet to update

Request body

multipart/form-data
Object
additionalMetadata
string

Additional data to pass to server

file
string binary

file to upload

Examples
{
    "additionalMetadata": "",
    "file": ""
}

Responses

200 200

successful operation

Example 1
curl -X POST "/pet/{petId}/uploadImage"  \
 -H "Content-Type: multipart/form-data"  \
 -d 'additionalMetadata=
&file='
Add a new pet to the store
POST /pet

Authentication

petstore_auth
write:pets
read:pets

Request body

application/json
Object
id
integer int64
category
Object
id
integer int64
name
string
name
string required
Example:
doggie
photoUrls
Array of string required
tags
Array
Object
id
integer int64
name
string
status
string

pet status in the store

Enumeration:
available
pending
sold

Responses

405 405

Invalid input

Update an existing pet
PUT /pet

Authentication

petstore_auth
write:pets
read:pets

Request body

application/json
Object
id
integer int64
category
Object
id
integer int64
name
string
name
string required
Example:
doggie
photoUrls
Array of string required
tags
Array
Object
id
integer int64
name
string
status
string

pet status in the store

Enumeration:
available
pending
sold

Responses

400 400

Invalid ID supplied

404 404

Pet not found

405 405

Validation exception

Finds Pets by status
GET /pet/findByStatus

Authentication

petstore_auth
write:pets
read:pets

Multiple status values can be provided with comma separated strings

Request parameters

status
array of string required

Status values that need to be considered for filter

Responses

200 200

successful operation

Body
application/json
Array
Object
id
integer int64
category
Object
id
integer int64
name
string
name
string required
Example:
doggie
photoUrls
Array of string required
tags
Array
Object
id
integer int64
name
string
status
string

pet status in the store

Enumeration:
available
pending
sold
400 400

Invalid status value

Finds Pets by tags
GET /pet/findByTags

Authentication

petstore_auth
write:pets
read:pets

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

Request parameters

tags
array of string required

Tags to filter by

Responses

200 200

successful operation

400 400

Invalid tag value

Find pet by ID
GET /pet/{petId}

Authentication

api_key

Returns a single pet

Path variables

petId
integer int64 required

ID of pet to return

Responses

200 200

successful operation

400 400

Invalid ID supplied

404 404

Pet not found

Updates a pet in the store with form data
POST /pet/{petId}

Authentication

petstore_auth
write:pets
read:pets

Path variables

petId
integer int64 required

ID of pet that needs to be updated

Request body

application/x-www-form-urlencoded
Object
name
string

Updated name of the pet

status
string

Updated status of the pet

Responses

405 405

Invalid input

Deletes a pet
DELETE /pet/{petId}

Authentication

petstore_auth
write:pets
read:pets

Path variables

petId
integer int64 required

Pet id to delete

Request headers

api_key
string optional

Responses

400 400

Invalid ID supplied

404 404

Pet not found

200 200

successful operation

Body
application/json
Array
Object
id
integer int64
category
Object
id
integer int64
name
string
name
string required
Example:
doggie
photoUrls
Array of string required
tags
Array
Object
id
integer int64
name
string
status
string

pet status in the store

Enumeration:
available
pending
sold
Store
POST /store/order
GET /store/order/{orderId}
DELETE /store/order/{orderId}
GET /store/inventory
Place an order for a pet
POST /store/order

Request body

application/json
Object
id
integer int64
petId
integer int64
quantity
integer int32
shipDate
string date-time
status
string

Order Status

Enumeration:
placed
approved
delivered
complete
boolean

Responses

200 200

successful operation

400 400

Invalid Order

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

Path variables

orderId
integer int64 required

ID of pet that needs to be fetched

Min: 1
Max: 10

Responses

200 200

successful operation

400 400

Invalid ID supplied

404 404

Order not found

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

Path variables

orderId
integer int64 required

ID of the order that needs to be deleted

Min: 1

Responses

400 400

Invalid ID supplied

404 404

Order not found

Returns pet inventories by status
GET /store/inventory

Authentication

api_key

Returns a map of status codes to quantities

Responses

200 200

successful operation

User
GET /user/{username}
PUT /user/{username}
DELETE /user/{username}
GET /user/login
POST /user
Creates list of users with given input array
POST /user/createWithArray

Request body

application/json
Array
Object
id
integer int64
username
string
firstName
string
lastName
string
email
string
password
string
phone
string
userStatus
integer int32

User Status

Responses

400 default

successful operation

Creates list of users with given input array
POST /user/createWithList

Request body

application/json
Array
Object
id
integer int64
username
string
firstName
string
lastName
string
email
string
password
string
phone
string
userStatus
integer int32

User Status

Responses

400 default

successful operation

Get user by user name
GET /user/{username}

Path variables

username
string required

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

Responses

200 200

successful operation

400 400

Invalid username supplied

404 404

User not found

Updated user
PUT /user/{username}

This can only be done by the logged in user.

Path variables

username
string required

name that need to be updated

Request body

application/json
Object
id
integer int64
username
string
firstName
string
lastName
string
email
string
password
string
phone
string
userStatus
integer int32

User Status

Responses

400 400

Invalid user supplied

404 404

User not found

Delete user
DELETE /user/{username}

This can only be done by the logged in user.

Path variables

username
string required

The name that needs to be deleted

Responses

400 400

Invalid username supplied

404 404

User not found

Logs user into the system
GET /user/login

Request parameters

username
string required

The user name for login

password
string required

The password for login in clear text

Responses

200 200

successful operation

400 400

Invalid username/password supplied

Logs out current logged in user session
GET /user/logout

Responses

400 default

successful operation

Create user
POST /user

This can only be done by the logged in user.

Request body

application/json
Object
id
integer int64
username
string
firstName
string
lastName
string
email
string
password
string
phone
string
userStatus
integer int32

User Status

Responses

400 default

successful operation

Type Definitions
ApiResponse
Object
Example:
{
    "code": 1,
    "type": "",
    "message": "",
    "[...]": ""
}
properties
code
integer int32
type
string
message
string
additional properties
string
Category
Object
id
integer int64
name
string
Order
Object
id
integer int64
petId
integer int64
quantity
integer int32
shipDate
string date-time
status
string

Order Status

Enumeration:
placed
approved
delivered
complete
boolean
Pet
Object
id
integer int64
category
Object
id
integer int64
name
string
name
string required
Example:
doggie
photoUrls
Array of string required
tags
Array
Object
id
integer int64
name
string
status
string

pet status in the store

Enumeration:
available
pending
sold
Tag
Object
id
integer int64
name
string
User
Object
id
integer int64
username
string
firstName
string
lastName
string
email
string
password
string
phone
string
userStatus
integer int32

User Status