Swagger Petstore API Documentation

This is a sample server for the Petstore API. It demonstrates operations related to managing pets, store orders, and users. For more information, visit Swagger or join irc.freenode.net, #swagger.

Overview

Authentication

The API uses the following security schemes:

Tags

Endpoints

Pet Endpoints

POST /pet/{petId}/uploadImage

Summary: uploads an image

Description:

Operation ID: uploadFile

Tags: pet

Consumes: multipart/form-data

Produces: application/json

Security: petstore_auth (write:pets, read:pets)

Parameters:

Name In Description Required Type Format
petId path ID of pet to update true integer int64
additionalMetadata formData Additional data to pass to server false string
file formData file to upload false file

Responses:

Code Description Schema
200 successful operation ApiResponse

POST /pet

Summary: Add a new pet to the store

Description:

Operation ID: addPet

Tags: pet

Consumes: application/json, application/xml

Produces: application/json, application/xml

Security: petstore_auth (write:pets, read:pets)

Parameters:

Name In Description Required Type Format
body body Pet object that needs to be added to the store true Pet

Responses:

Code Description Schema
405 Invalid input

PUT /pet

Summary: Update an existing pet

Description:

Operation ID: updatePet

Tags: pet

Consumes: application/json, application/xml

Produces: application/json, application/xml

Security: petstore_auth (write:pets, read:pets)

Parameters:

Name In Description Required Type Format
body body Pet object that needs to be added to the store true Pet

Responses:

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

GET /pet/findByStatus

Summary: Finds Pets by status

Description: Multiple status values can be provided with comma separated strings

Operation ID: findPetsByStatus

Tags: pet

Produces: application/json, application/xml

Security: petstore_auth (write:pets, read:pets)

Parameters:

Name In Description Required Type Format
status query Status values that need to be considered for filter true array
Items: string (enum: available, pending, sold; default: available) Collection Format: multi

Responses:

Code Description Schema
200 successful operation array[Pet]
400 Invalid status value

GET /pet/findByTags

Summary: Finds Pets by tags

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

Operation ID: findPetsByTags

Tags: pet

Produces: application/json, application/xml

Security: petstore_auth (write:pets, read:pets)

Deprecated: true

Parameters:

Name In Description Required Type Format
tags query Tags to filter by true array
Items: string Collection Format: multi

Responses:

Code Description Schema
200 successful operation array[Pet]
400 Invalid tag value

GET /pet/{petId}

Summary: Find pet by ID

Description: Returns a single pet

Operation ID: getPetById

Tags: pet

Produces: application/json, application/xml

Security: api_key

Parameters:

Name In Description Required Type Format
petId path ID of pet to return true integer int64

Responses:

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

POST /pet/{petId}

Summary: Updates a pet in the store with form data

Description:

Operation ID: updatePetWithForm

Tags: pet

Consumes: application/x-www-form-urlencoded

Produces: application/json, application/xml

Security: petstore_auth (write:pets, read:pets)

Parameters:

Name In Description Required Type Format
petId path ID of pet that needs to be updated true integer int64
name formData Updated name of the pet false string
status formData Updated status of the pet false string

Responses:

Code Description Schema
405 Invalid input

DELETE /pet/{petId}

Summary: Deletes a pet

Description:

Operation ID: deletePet

Tags: pet

Produces: application/json, application/xml

Security: petstore_auth (write:pets, read:pets)

Parameters:

Name In Description Required Type Format
api_key header false string
petId path Pet id to delete true integer int64

Responses:

Code Description Schema
400 Invalid ID supplied
404 Pet not found

Store Endpoints

GET /store/inventory

Summary: Returns pet inventories by status

Description: Returns a map of status codes to quantities

Operation ID: getInventory

Tags: store

Produces: application/json

Security: api_key

Parameters: None

Responses:

Code Description Schema
200 successful operation object (additionalProperties: integer/int32)

POST /store/order

Summary: Place an order for a pet

Description:

Operation ID: placeOrder

Tags: store

Consumes: application/json

Produces: application/json, application/xml

Parameters:

Name In Description Required Type Format
body body order placed for purchasing the pet true Order

Responses:

Code Description Schema
200 successful operation Order
400 Invalid Order

GET /store/order/{orderId}

Summary: Find purchase order by ID

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

Operation ID: getOrderById

Tags: store

Produces: application/json, application/xml

Parameters:

Name In Description Required Type Format
orderId path ID of pet that needs to be fetched true integer int64
Maximum: 10, Minimum: 1

Responses:

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

DELETE /store/order/{orderId}

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

Operation ID: deleteOrder

Tags: store

Produces: application/json, application/xml

Parameters:

Name In Description Required Type Format
orderId path ID of the order that needs to be deleted true integer int64
Minimum: 1

Responses:

Code Description Schema
400 Invalid ID supplied
404 Order not found

User Endpoints

POST /user/createWithList

Summary: Creates list of users with given input array

Description:

Operation ID: createUsersWithListInput

Tags: user

Consumes: application/json

Produces: application/json, application/xml

Parameters:

Name In Description Required Type Format
body body List of user object true array[User]

Responses:

Code Description Schema
default successful operation

GET /user/{username}

Summary: Get user by user name

Description:

Operation ID: getUserByName

Tags: user

Produces: application/json, application/xml

Parameters:

Name In Description Required Type Format
username path The name that needs to be fetched. Use user1 for testing. true string

Responses:

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

PUT /user/{username}

Summary: Updated user

Description: This can only be done by the logged in user.

Operation ID: updateUser

Tags: user

Consumes: application/json

Produces: application/json, application/xml

Parameters:

Name In Description Required Type Format
username path name that need to be updated true string
body body Updated user object true User

Responses:

Code Description Schema
400 Invalid user supplied
404 User not found

DELETE /user/{username}

Summary: Delete user

Description: This can only be done by the logged in user.

Operation ID: deleteUser

Tags: user

Produces: application/json, application/xml

Parameters:

Name In Description Required Type Format
username path The name that needs to be deleted true string

Responses:

Code Description Schema
400 Invalid username supplied
404 User not found

GET /user/login

Summary: Logs user into the system

Description:

Operation ID: loginUser

Tags: user

Produces: application/json, application/xml

Parameters:

Name In Description Required Type Format
username query The user name for login true string
password query The password for login in clear text true string

Responses:

Code Description Schema Headers
200 successful operation string X-Expires-After (string/date-time: date in UTC when token expires), X-Rate-Limit (integer/int32: calls per hour allowed by the user)
400 Invalid username/password supplied

GET /user/logout

Summary: Logs out current logged in user session

Description:

Operation ID: logoutUser

Tags: user

Produces: application/json, application/xml

Parameters: None

Responses:

Code Description Schema
default successful operation

POST /user/createWithArray

Summary: Creates list of users with given input array

Description:

Operation ID: createUsersWithArrayInput

Tags: user

Consumes: application/json

Produces: application/json, application/xml

Parameters:

Name In Description Required Type Format
body body List of user object true array[User]

Responses:

Code Description Schema
default successful operation

POST /user

Summary: Create user

Description: This can only be done by the logged in user.

Operation ID: createUser

Tags: user

Consumes: application/json

Produces: application/json, application/xml

Parameters:

Name In Description Required Type Format
body body Created user object true User

Responses:

Code Description Schema
default successful operation

Models

ApiResponse

Type: object

Properties:

Category

Type: object

Properties:

XML: name=Category

Pet

Type: object

Required: name, photoUrls

Properties:

XML: name=Pet

Tag

Type: object

Properties:

XML: name=Tag

Order

Type: object

Properties:

XML: name=Order

User

Type: object

Properties:

XML: name=User

External Documentation

Find out more about Swagger: http://swagger.io