Swagger Petstore

This is a sample server Petstore server.

Learn about Swagger or join the IRC channel #swagger on irc.freenode.net.

For this sample, you can use the api key special-key to test the authorization filters

More information:
Contact Info: hello@helloreverb.com
Version: 1.0.0
BasePath:/v2
Apache 2.0
http://www.apache.org/licenses/LICENSE-2.0.html

Access

  1. APIKey KeyParamName:api_key KeyInQuery:false KeyInHeader:true
  2. OAuth AuthorizationUrl:http://petstore.swagger.io/api/oauth/dialogTokenUrl:

Methods

[ Jump to Models ]

Table of Contents

Pet

Store

User

Pet

Up
post /pets
Add a new pet to the store (addPet)

Consumes

This API call consumes the following media types via the Content-Type request header:
  • application/json
  • application/xml

Request body

body body_1 (optional)
Body Parameter — Pet object that needs to be added to the store

Produces

This API call produces the following media types according to the Accept request header; the media type will be conveyed by the Content-Type response header.
  • application/json
  • application/xml

Responses

405

Invalid input

Up
delete /pets/{petId}
Deletes a pet (deletePet)

Path parameters

petId (required)
Path Parameter — Pet id to delete format: int64

Request headers

Produces

This API call produces the following media types according to the Accept request header; the media type will be conveyed by the Content-Type response header.
  • application/json
  • application/xml

Responses

400

Invalid pet value

Up
get /pets/findByStatus
Finds Pets by status (findPetsByStatus)
Multiple status values can be provided with comma seperated strings

Query parameters

status (optional)
Query Parameter — Status values that need to be considered for filter

Return type

Example data

Content-Type: application/json
[ {
  "photoUrls" : [ "aeiou" ],
  "name" : "doggie",
  "id" : 0,
  "category" : {
    "name" : "aeiou",
    "id" : 6
  },
  "tags" : [ "" ],
  "status" : "aeiou"
} ]

Example data

Content-Type: application/xml

  123456789
  doggie
  aeiou
  aeiou

Produces

This API call produces the following media types according to the Accept request header; the media type will be conveyed by the Content-Type response header.
  • application/json
  • application/xml

Responses

200

successful operation

400

Invalid status value

Up
get /pets/findByTags
Finds Pets by tags (findPetsByTags)
Muliple tags can be provided with comma seperated strings. Use tag1, tag2, tag3 for testing.

Query parameters

tags (optional)
Query Parameter — Tags to filter by

Return type

Example data

Content-Type: application/json
[ {
  "photoUrls" : [ "aeiou" ],
  "name" : "doggie",
  "id" : 0,
  "category" : {
    "name" : "aeiou",
    "id" : 6
  },
  "tags" : [ "" ],
  "status" : "aeiou"
} ]

Example data

Content-Type: application/xml

  123456789
  doggie
  aeiou
  aeiou

Produces

This API call produces the following media types according to the Accept request header; the media type will be conveyed by the Content-Type response header.
  • application/json
  • application/xml

Responses

200

successful operation

400

Invalid tag value

Up
get /pets/{petId}
Find pet by ID (getPetById)
Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions

Path parameters

petId (required)
Path Parameter — ID of pet that needs to be fetched format: int64

Return type

Example data

Content-Type: application/json
{
  "photoUrls" : [ "aeiou" ],
  "name" : "doggie",
  "id" : 0,
  "category" : {
    "name" : "aeiou",
    "id" : 6
  },
  "tags" : [ "" ],
  "status" : "aeiou"
}

Example data

Content-Type: application/xml

  123456789
  doggie
  aeiou
  aeiou

Produces

This API call produces the following media types according to the Accept request header; the media type will be conveyed by the Content-Type response header.
  • application/json
  • application/xml

Responses

200

successful operation inline_response_200

400

Invalid ID supplied

404

Pet not found

Up
put /pets
Update an existing pet (updatePet)

Consumes

This API call consumes the following media types via the Content-Type request header:
  • application/json
  • application/xml

Request body

body body (optional)
Body Parameter — Pet object that needs to be added to the store

Produces

This API call produces the following media types according to the Accept request header; the media type will be conveyed by the Content-Type response header.
  • application/json
  • application/xml

Responses

400

Invalid ID supplied

404

Pet not found

405

Validation exception

Up
post /pets/{petId}
Updates a pet in the store with form data (updatePetWithForm)

Path parameters

petId (required)
Path Parameter — ID of pet that needs to be updated

Consumes

This API call consumes the following media types via the Content-Type request header:
  • application/x-www-form-urlencoded

Form parameters

name (required)
Form Parameter — Updated name of the pet
status (required)
Form Parameter — Updated status of the pet

Produces

This API call produces the following media types according to the Accept request header; the media type will be conveyed by the Content-Type response header.
  • application/json
  • application/xml

Responses

405

Invalid input

Store

Up
delete /stores/order/{orderId}
Delete purchase order by ID (deleteOrder)
For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors

Path parameters

orderId (required)
Path Parameter — ID of the order that needs to be deleted

Produces

This API call produces the following media types according to the Accept request header; the media type will be conveyed by the Content-Type response header.
  • application/json
  • application/xml

Responses

400

Invalid ID supplied

404

Order not found

Up
get /stores/order/{orderId}
Find purchase order by ID (getOrderById)
For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions

Path parameters

orderId (required)
Path Parameter — ID of pet that needs to be fetched

Return type

Example data

Content-Type: application/json
{
  "petId" : 6,
  "quantity" : 1,
  "id" : 0,
  "shipDate" : "2000-01-23T04:56:07.000+00:00",
  "complete" : true,
  "status" : "aeiou"
}

Example data

Content-Type: application/xml

  123456789
  123456789
  123
  2000-01-23T04:56:07.000Z
  aeiou
  true

Produces

This API call produces the following media types according to the Accept request header; the media type will be conveyed by the Content-Type response header.
  • application/json
  • application/xml

Responses

200

successful operation inline_response_200_1

400

Invalid ID supplied

404

Order not found

Up
post /stores/order
Place an order for a pet (placeOrder)

Request body

body body_2 (optional)
Body Parameter — order placed for purchasing the pet

Return type

Example data

Content-Type: application/json
{
  "petId" : 6,
  "quantity" : 1,
  "id" : 0,
  "shipDate" : "2000-01-23T04:56:07.000+00:00",
  "complete" : true,
  "status" : "aeiou"
}

Example data

Content-Type: application/xml

  123456789
  123456789
  123
  2000-01-23T04:56:07.000Z
  aeiou
  true

Produces

This API call produces the following media types according to the Accept request header; the media type will be conveyed by the Content-Type response header.
  • application/json
  • application/xml

Responses

200

successful operation inline_response_200_1

400

Invalid Order

User

Up
post /users
Create user (createUser)
This can only be done by the logged in user.

Request body

body body_3 (optional)
Body Parameter — Created user object

Produces

This API call produces the following media types according to the Accept request header; the media type will be conveyed by the Content-Type response header.
  • application/json
  • application/xml

Responses

default

successful operation

Up
post /users/createWithArray
Creates list of users with given input array (createUsersWithArrayInput)

Request body

body body_4 (optional)
Body Parameter — List of user object

Produces

This API call produces the following media types according to the Accept request header; the media type will be conveyed by the Content-Type response header.
  • application/json
  • application/xml

Responses

default

successful operation

Up
post /users/createWithList
Creates list of users with given input array (createUsersWithListInput)

Request body

body body_4 (optional)
Body Parameter — List of user object

Produces

This API call produces the following media types according to the Accept request header; the media type will be conveyed by the Content-Type response header.
  • application/json
  • application/xml

Responses

default

successful operation

Up
delete /users/{username}
Delete user (deleteUser)
This can only be done by the logged in user.

Path parameters

username (required)
Path Parameter — The name that needs to be deleted

Produces

This API call produces the following media types according to the Accept request header; the media type will be conveyed by the Content-Type response header.
  • application/json
  • application/xml

Responses

400

Invalid username supplied

404

User not found

Up
get /users/{username}
Get user by user name (getUserByName)

Path parameters

username (required)
Path Parameter — The name that needs to be fetched. Use user1 for testing.

Return type

Example data

Content-Type: application/json
{
  "firstName" : "aeiou",
  "lastName" : "aeiou",
  "password" : "aeiou",
  "userStatus" : 6,
  "phone" : "aeiou",
  "id" : 0,
  "email" : "aeiou",
  "username" : "aeiou"
}

Example data

Content-Type: application/xml

  123456789
  aeiou
  aeiou
  aeiou
  aeiou
  aeiou
  aeiou
  123

Produces

This API call produces the following media types according to the Accept request header; the media type will be conveyed by the Content-Type response header.
  • application/json
  • application/xml

Responses

200

successful operation body_4

400

Invalid username supplied

404

User not found

Up
get /users/login
Logs user into the system (loginUser)

Query parameters

username (optional)
Query Parameter — The user name for login
password (optional)
Query Parameter — The password for login in clear text

Return type

String

Example data

Content-Type: application/json
"aeiou"

Example data

Content-Type: application/xml
aeiou

Produces

This API call produces the following media types according to the Accept request header; the media type will be conveyed by the Content-Type response header.
  • application/json
  • application/xml

Responses

200

successful operation String

400

Invalid username/password supplied

Up
get /users/logout
Logs out current logged in user session (logoutUser)

Produces

This API call produces the following media types according to the Accept request header; the media type will be conveyed by the Content-Type response header.
  • application/json
  • application/xml

Responses

default

successful operation

Up
put /users/{username}
Updated user (updateUser)
This can only be done by the logged in user.

Path parameters

username (required)
Path Parameter — name that need to be deleted

Request body

body body_5 (optional)
Body Parameter — Updated user object

Produces

This API call produces the following media types according to the Accept request header; the media type will be conveyed by the Content-Type response header.
  • application/json
  • application/xml

Responses

400

Invalid user supplied

404

User not found

Models

[ Jump to Methods ]

Table of Contents

  1. Category -
  2. Order -
  3. Pet -
  4. Tag -
  5. User -
  6. body -
  7. body_1 -
  8. body_2 -
  9. body_3 -
  10. body_4 -
  11. body_5 -
  12. inline_response_200 -
  13. inline_response_200_1 -
  14. pets_category -

Category - Up

id (optional)
Long format: int64
name (optional)

Order - Up

id (optional)
Long format: int64
petId (optional)
Long format: int64
quantity (optional)
Integer format: int32
shipDate (optional)
Date format: date-time
status (optional)
String Order Status
complete (optional)

Pet - Up

id (optional)
Long format: int64
category (optional)
name
photoUrls
tags (optional)
status (optional)
String pet status in the store

Tag - Up

id (optional)
Long format: int64
name (optional)

User - Up

id (optional)
Long format: int64
username (optional)
firstName (optional)
lastName (optional)
email (optional)
password (optional)
phone (optional)
userStatus (optional)
Integer User Status format: int32

body - Up

id (optional)
Long format: int64
category (optional)
name
photoUrls
tags (optional)
status (optional)
String pet status in the store

body_1 - Up

id (optional)
Long format: int64
category (optional)
name
photoUrls
tags (optional)
status (optional)
String pet status in the store

body_2 - Up

id (optional)
Long format: int64
petId (optional)
Long format: int64
quantity (optional)
Integer format: int32
shipDate (optional)
Date format: date-time
status (optional)
String Order Status
complete (optional)

body_3 - Up

id (optional)
Long format: int64
username (optional)
firstName (optional)
lastName (optional)
email (optional)
password (optional)
phone (optional)
userStatus (optional)
Integer User Status format: int32

body_4 - Up

id (optional)
Long format: int64
username (optional)
firstName (optional)
lastName (optional)
email (optional)
password (optional)
phone (optional)
userStatus (optional)
Integer User Status format: int32

body_5 - Up

id (optional)
Long format: int64
username (optional)
firstName (optional)
lastName (optional)
email (optional)
password (optional)
phone (optional)
userStatus (optional)
Integer User Status format: int32

inline_response_200 - Up

id (optional)
Long format: int64
category (optional)
name
photoUrls
tags (optional)
status (optional)
String pet status in the store

inline_response_200_1 - Up

id (optional)
Long format: int64
petId (optional)
Long format: int64
quantity (optional)
Integer format: int32
shipDate (optional)
Date format: date-time
status (optional)
String Order Status
complete (optional)

pets_category - Up

id (optional)
Long format: int64
name (optional)