Swagger Petstore

Information

Base URL

http://petstore.swagger.io/v2

Version 1.0.0
Description

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.

Contact Emailapiteam@swagger.io
License Apache 2.0
Terms Of Service http://swagger.io/terms/

Table of Contents

pet

Everything about your Pets

Index Method Path Summary
1 PUT /pet Update an existing pet
2 POST /pet Add a new pet to the store
3 GET /pet/findByStatus Finds Pets by status
4 GET /pet/findByTags Finds Pets by tags
5 DELETE /pet/{petId} Deletes a pet
6 POST /pet/{petId} Updates a pet in the store with form data
7 GET /pet/{petId} Find pet by ID
8 POST /pet/{petId}/uploadImage uploads an image

store

Access to Petstore orders

Index Method Path Summary
1 GET /store/inventory Returns pet inventories by status
2 POST /store/order Place an order for a pet
3 DELETE /store/order/{orderId} Delete purchase order by ID
4 GET /store/order/{orderId} Find purchase order by ID

user

Operations about user

Index Method Path Summary
1 POST /user Create user
2 POST /user/createWithArray Creates list of users with given input array
3 POST /user/createWithList Creates list of users with given input array
4 GET /user/login Logs user into the system
5 GET /user/logout Logs out current logged in user session
6 DELETE /user/{username} Delete user
7 PUT /user/{username} Updated user
8 GET /user/{username} Get user by user name

pet

PUT /pet

Summary Update an existing pet
Notes
Consumes application/json,application/xml
Produces application/xml,application/json

Parameters

Name Parameter Type Data Type Required Description
body body
Pet
Property Type Description Format Required ReadOnly
id int64 int64 N
category Category N
category.id int64 int64 N
category.name string N
name string Y
photoUrls[] array[string] Y
tags[] array[Tag] N
tags[].id int64 int64 N
tags[].name string N
status string pet status in the store N
Y Pet object that needs to be added to the store

Responses

HTTP Status Code Reason Response Type
400 Invalid ID supplied
404 Pet not found
405 Validation exception

POST /pet

Summary Add a new pet to the store
Notes
Consumes application/json,application/xml
Produces application/xml,application/json

Parameters

Name Parameter Type Data Type Required Description
body body
Pet
Property Type Description Format Required ReadOnly
id int64 int64 N
category Category N
category.id int64 int64 N
category.name string N
name string Y
photoUrls[] array[string] Y
tags[] array[Tag] N
tags[].id int64 int64 N
tags[].name string N
status string pet status in the store N
Y Pet object that needs to be added to the store

Responses

HTTP Status Code Reason Response Type
405 Invalid input

GET /pet/findByStatus

Summary Finds Pets by status
Notes Multiple status values can be provided with comma separated strings
Consumes
Produces application/xml,application/json

Parameters

Name Parameter Type Data Type Required Description
status query
array
Y Status values that need to be considered for filter

Responses

HTTP Status Code Reason Response Type
200 successful operation
array[Pet]
Property Type Description Format Required ReadOnly
[].id int64 int64 N
[].category Category N
[].category.id int64 int64 N
[].category.name string N
[].name string Y
[].photoUrls[] array[string] Y
[].tags[] array[Tag] N
[].tags[].id int64 int64 N
[].tags[].name string N
[].status string pet status in the store N
400 Invalid status value

GET /pet/findByTags

Summary Finds Pets by tags
Notes Muliple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
Consumes
Produces application/xml,application/json

Parameters

Name Parameter Type Data Type Required Description
tags query
array
Y Tags to filter by

Responses

HTTP Status Code Reason Response Type
200 successful operation
array[Pet]
Property Type Description Format Required ReadOnly
[].id int64 int64 N
[].category Category N
[].category.id int64 int64 N
[].category.name string N
[].name string Y
[].photoUrls[] array[string] Y
[].tags[] array[Tag] N
[].tags[].id int64 int64 N
[].tags[].name string N
[].status string pet status in the store N
400 Invalid tag value

DELETE /pet/{petId}

Summary Deletes a pet
Notes
Consumes
Produces application/xml,application/json

Parameters

Name Parameter Type Data Type Required Description
api_key header
string
N
petId path
int64
Y Pet id to delete

Responses

HTTP Status Code Reason Response Type
400 Invalid ID supplied
404 Pet not found

POST /pet/{petId}

Summary Updates a pet in the store with form data
Notes
Consumes application/x-www-form-urlencoded
Produces application/xml,application/json

Parameters

Name Parameter Type Data Type Required Description
petId path
int64
Y ID of pet that needs to be updated
name formData
string
N Updated name of the pet
status formData
string
N Updated status of the pet

Responses

HTTP Status Code Reason Response Type
405 Invalid input

GET /pet/{petId}

Summary Find pet by ID
Notes Returns a single pet
Consumes
Produces application/xml,application/json

Parameters

Name Parameter Type Data Type Required Description
petId path
int64
Y ID of pet to return

Responses

HTTP Status Code Reason Response Type
200 successful operation
Pet
Property Type Description Format Required ReadOnly
id int64 int64 N
category Category N
category.id int64 int64 N
category.name string N
name string Y
photoUrls[] array[string] Y
tags[] array[Tag] N
tags[].id int64 int64 N
tags[].name string N
status string pet status in the store N
400 Invalid ID supplied
404 Pet not found

POST /pet/{petId}/uploadImage

Summary uploads an image
Notes
Consumes multipart/form-data
Produces application/json

Parameters

Name Parameter Type Data Type Required Description
petId path
int64
Y ID of pet to update
additionalMetadata formData
string
N Additional data to pass to server
file formData
file
N file to upload

Responses

HTTP Status Code Reason Response Type
200 successful operation
ApiResponse
Property Type Description Format Required ReadOnly
code int32 int32 N
type string N
message string N

store

GET /store/inventory

Summary Returns pet inventories by status
Notes Returns a map of status codes to quantities
Consumes
Produces application/json

Parameters

No Parameters

Responses

HTTP Status Code Reason Response Type
200 successful operation
object

POST /store/order

Summary Place an order for a pet
Notes
Consumes
Produces application/xml,application/json

Parameters

Name Parameter Type Data Type Required Description
body body
Order
Property Type Description Format Required ReadOnly
id int64 int64 N
petId int64 int64 N
quantity int32 int32 N
shipDate datetime date-time N
status string Order Status N
complete boolean N
Y order placed for purchasing the pet

Responses

HTTP Status Code Reason Response Type
200 successful operation
Order
Property Type Description Format Required ReadOnly
id int64 int64 N
petId int64 int64 N
quantity int32 int32 N
shipDate datetime date-time N
status string Order Status N
complete boolean N
400 Invalid Order

DELETE /store/order/{orderId}

Summary Delete purchase order by ID
Notes For valid response try integer IDs with positive integer value. Negative or non-integer values will generate API errors
Consumes
Produces application/xml,application/json

Parameters

Name Parameter Type Data Type Required Description
orderId path
int64
Y ID of the order that needs to be deleted

Responses

HTTP Status Code Reason Response Type
400 Invalid ID supplied
404 Order not found

GET /store/order/{orderId}

Summary Find purchase order by ID
Notes For valid response try integer IDs with value >= 1 and <= 10. Other values will generated exceptions
Consumes
Produces application/xml,application/json

Parameters

Name Parameter Type Data Type Required Description
orderId path
int64
Y ID of pet that needs to be fetched

Responses

HTTP Status Code Reason Response Type
200 successful operation
Order
Property Type Description Format Required ReadOnly
id int64 int64 N
petId int64 int64 N
quantity int32 int32 N
shipDate datetime date-time N
status string Order Status N
complete boolean N
400 Invalid ID supplied
404 Order not found

user

POST /user

Summary Create user
Notes This can only be done by the logged in user.
Consumes
Produces application/xml,application/json

Parameters

Name Parameter Type Data Type Required Description
body body
User
Property Type Description Format Required ReadOnly
id int64 int64 N
username string N
firstName string N
lastName string N
email string N
password string N
phone string N
userStatus int32 User Status int32 N
Y Created user object

Responses

HTTP Status Code Reason Response Type
default successful operation

POST /user/createWithArray

Summary Creates list of users with given input array
Notes
Consumes
Produces application/xml,application/json

Parameters

Name Parameter Type Data Type Required Description
body body
array[User]
Y List of user object

Responses

HTTP Status Code Reason Response Type
default successful operation

POST /user/createWithList

Summary Creates list of users with given input array
Notes
Consumes
Produces application/xml,application/json

Parameters

Name Parameter Type Data Type Required Description
body body
array[User]
Y List of user object

Responses

HTTP Status Code Reason Response Type
default successful operation

GET /user/login

Summary Logs user into the system
Notes
Consumes
Produces application/xml,application/json

Parameters

Name Parameter Type Data Type Required Description
username query
string
Y The user name for login
password query
string
Y The password for login in clear text

Responses

HTTP Status Code Reason Response Type
200 successful operation
string
400 Invalid username/password supplied

GET /user/logout

Summary Logs out current logged in user session
Notes
Consumes
Produces application/xml,application/json

Parameters

No Parameters

Responses

HTTP Status Code Reason Response Type
default successful operation

DELETE /user/{username}

Summary Delete user
Notes This can only be done by the logged in user.
Consumes
Produces application/xml,application/json

Parameters

Name Parameter Type Data Type Required Description
username path
string
Y The name that needs to be deleted

Responses

HTTP Status Code Reason Response Type
400 Invalid username supplied
404 User not found

PUT /user/{username}

Summary Updated user
Notes This can only be done by the logged in user.
Consumes
Produces application/xml,application/json

Parameters

Name Parameter Type Data Type Required Description
username path
string
Y name that need to be updated
body body
User
Property Type Description Format Required ReadOnly
id int64 int64 N
username string N
firstName string N
lastName string N
email string N
password string N
phone string N
userStatus int32 User Status int32 N
Y Updated user object

Responses

HTTP Status Code Reason Response Type
400 Invalid user supplied
404 User not found

GET /user/{username}

Summary Get user by user name
Notes
Consumes
Produces application/xml,application/json

Parameters

Name Parameter Type Data Type Required Description
username path
string
Y The name that needs to be fetched. Use user1 for testing.

Responses

HTTP Status Code Reason Response Type
200 successful operation
User
Property Type Description Format Required ReadOnly
id int64 int64 N
username string N
firstName string N
lastName string N
email string N
password string N
phone string N
userStatus int32 User Status int32 N
400 Invalid username supplied
404 User not found