Swagger Petstore - OpenAPI 3.1

This is a sample Pet Store Server based on the OpenAPI 3.1 specification. You can find out more about Swagger at https://swagger.io. In the third iteration of the pet store, we've switched to the design first approach! You can now help us improve the API whether it's by making changes to the definition itself or to the code. That way, with time, we can improve the API in general, and expose some of the new features in OAS3.

Some useful links:

More information: https://helloreverb.com
Contact Info: apiteam@swagger.io
Version: 1.0.11
BasePath:/api/v3
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:https://petstore3.swagger.io/oauth/authorizeTokenUrl:

Methods

[ Jump to Models ]

Table of Contents

Pet

Store

User

Pet

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

Consumes

This API call consumes the following media types via the Content-Type request header:

Request body

body Pet (required)
Body Parameter — Create a new pet in the store

Form parameters

id (required)
Form Parameter — format: int64
name (required)
Form Parameter
category (required)
Form Parameter
photoUrls (required)
Form Parameter
tags (required)
Form Parameter
status (required)
Form Parameter

Return type

Pet

Example data

Content-Type: application/json
{
  "photoUrls" : "",
  "name" : "",
  "id" : "",
  "category" : {
    "name" : "",
    "id" : ""
  },
  "tags" : "",
  "status" : ""
}

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.

Responses

200

Successful operation Pet

400

Invalid input

422

Validation exception

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

Path parameters

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

Request headers

Responses

400

Invalid pet value

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

Query parameters

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

Example data

Content-Type: application/json
""

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.

Responses

200

successful operation

400

Invalid status value

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

Query parameters

tags (optional)
Query Parameter — Tags to filter by

Example data

Content-Type: application/json
""

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.

Responses

200

successful operation

400

Invalid tag value

Up
get /pet/{petId}
Find pet by ID (getPetById)
Returns a single pet

Path parameters

petId (required)
Path Parameter — ID of pet to return format: int64

Return type

Pet

Example data

Content-Type: application/json
{
  "photoUrls" : "",
  "name" : "",
  "id" : "",
  "category" : {
    "name" : "",
    "id" : ""
  },
  "tags" : "",
  "status" : ""
}

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.

Responses

200

successful operation Pet

400

Invalid ID supplied

404

Pet not found

Up
put /pet
Update an existing pet (updatePet)
Update an existing pet by Id

Consumes

This API call consumes the following media types via the Content-Type request header:

Request body

body Pet (required)
Body Parameter — Update an existent pet in the store

Form parameters

id (required)
Form Parameter — format: int64
name (required)
Form Parameter
category (required)
Form Parameter
photoUrls (required)
Form Parameter
tags (required)
Form Parameter
status (required)
Form Parameter

Return type

Pet

Example data

Content-Type: application/json
{
  "photoUrls" : "",
  "name" : "",
  "id" : "",
  "category" : {
    "name" : "",
    "id" : ""
  },
  "tags" : "",
  "status" : ""
}

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.

Responses

200

Successful operation Pet

400

Invalid ID supplied

404

Pet not found

422

Validation exception

Up
post /pet/{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 format: int64

Query parameters

name (optional)
Query Parameter — Name of pet that needs to be updated
status (optional)
Query Parameter — Status of pet that needs to be updated

Responses

400

Invalid input

Up
post /pet/{petId}/uploadImage
uploads an image (uploadFile)

Path parameters

petId (required)
Path Parameter — ID of pet to update format: int64

Consumes

This API call consumes the following media types via the Content-Type request header:

Request body

body (optional)
Body Parameter

Query parameters

additionalMetadata (optional)
Query Parameter — Additional Metadata

Return type

ApiResponse

Example data

Content-Type: application/json
{
  "code" : "",
  "type" : "",
  "message" : ""
}

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.

Responses

200

successful operation ApiResponse

Store

Up
delete /store/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 format: int64

Responses

400

Invalid ID supplied

404

Order not found

Up
get /store/inventory
Returns pet inventories by status (getInventory)
Returns a map of status codes to quantities

Example data

Content-Type: application/json
""

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.

Responses

200

successful operation

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

Path parameters

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

Return type

Order

Example data

Content-Type: application/json
{
  "petId" : "",
  "quantity" : "",
  "id" : "",
  "shipDate" : "",
  "complete" : "",
  "status" : ""
}

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.

Responses

200

successful operation Order

400

Invalid ID supplied

404

Order not found

Up
post /store/order
Place an order for a pet (placeOrder)
Place a new order in the store

Consumes

This API call consumes the following media types via the Content-Type request header:

Request body

body Order (optional)
Body Parameter

Form parameters

id (optional)
Form Parameter — format: int64
petId (optional)
Form Parameter — format: int64
quantity (optional)
Form Parameter — format: int32
shipDate (optional)
Form Parameter — format: date-time
status (optional)
Form Parameter
complete (optional)
Form Parameter

Return type

Order

Example data

Content-Type: application/json
{
  "petId" : "",
  "quantity" : "",
  "id" : "",
  "shipDate" : "",
  "complete" : "",
  "status" : ""
}

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.

Responses

200

successful operation Order

400

Invalid input

422

Validation exception

User

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

Consumes

This API call consumes the following media types via the Content-Type request header:

Request body

body User (optional)
Body Parameter — Created user object

Form parameters

id (optional)
Form Parameter — format: int64
username (optional)
Form Parameter
firstName (optional)
Form Parameter
lastName (optional)
Form Parameter
email (optional)
Form Parameter
password (optional)
Form Parameter
phone (optional)
Form Parameter
userStatus (optional)
Form Parameter — format: int32

Return type

User

Example data

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

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.

Responses

default

successful operation User

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

Consumes

This API call consumes the following media types via the Content-Type request header:

Request body

body (optional)
Body Parameter

Return type

User

Example data

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

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.

Responses

200

Successful operation User

default

successful operation

Up
delete /user/{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

Responses

400

Invalid username supplied

404

User not found

Up
get /user/{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

User

Example data

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

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.

Responses

200

successful operation User

400

Invalid username supplied

404

User not found

Up
get /user/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

Example data

Content-Type: application/json
""

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.

Responses

200

successful operation

400

Invalid username/password supplied

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

Responses

default

successful operation

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

Path parameters

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

Consumes

This API call consumes the following media types via the Content-Type request header:

Request body

body User (optional)
Body Parameter — Update an existent user in the store

Form parameters

id (optional)
Form Parameter — format: int64
username (optional)
Form Parameter
firstName (optional)
Form Parameter
lastName (optional)
Form Parameter
email (optional)
Form Parameter
password (optional)
Form Parameter
phone (optional)
Form Parameter
userStatus (optional)
Form Parameter — format: int32

Responses

default

successful operation

Models

[ Jump to Methods ]

Table of Contents

  1. Address
  2. ApiResponse
  3. Category
  4. Customer
  5. Order
  6. Pet
  7. Tag
  8. User

Address Up

street (optional)
city (optional)
state (optional)
zip (optional)

ApiResponse Up

code (optional)
format: int32
type (optional)
message (optional)

Category Up

id (optional)
format: int64
name (optional)

Customer Up

id (optional)
format: int64
username (optional)
address (optional)

Order Up

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

Pet Up

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

Tag Up

id (optional)
format: int64
name (optional)

User Up

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