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:
Version: 1.0.11
BasePath:/api/v3
Apache 2.0
http://www.apache.org/licenses/LICENSE-2.0.html
Access
- APIKey KeyParamName:api_key KeyInQuery:false KeyInHeader:true
- OAuth AuthorizationUrl:https://petstore3.swagger.io/oauth/authorizeTokenUrl:
[ Jump to Models ]
Table of Contents
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 request header:
application/json
application/xml
application/x-www-form-urlencoded
Request body
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
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 request header;
the media type will be conveyed by the response header.
application/json
application/xml
Responses
200
Successful operation
Pet
400
Invalid input
422
Validation exception
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
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 request header;
the media type will be conveyed by the response header.
application/json
application/xml
Responses
200
successful operation
400
Invalid status value
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 request header;
the media type will be conveyed by the response header.
application/json
application/xml
Responses
200
successful operation
400
Invalid tag value
Find pet by ID (getPetById)
Returns a single pet
Path parameters
petId (required)
Path Parameter — ID of pet to return format: int64
Return type
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 request header;
the media type will be conveyed by the response header.
application/json
application/xml
Responses
200
successful operation
Pet
400
Invalid ID supplied
404
Pet not found
Update an existing pet (updatePet)
Update an existing pet by Id
Consumes
This API call consumes the following media types via the request header:
application/json
application/xml
application/x-www-form-urlencoded
Request body
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
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 request header;
the media type will be conveyed by the response header.
application/json
application/xml
Responses
200
Successful operation
Pet
400
Invalid ID supplied
404
Pet not found
422
Validation exception
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 request header:
Request body
body (optional)
Body Parameter —
Query parameters
additionalMetadata (optional)
Query Parameter — Additional Metadata
Return type
Example data
Content-Type: application/json
{
"code" : "",
"type" : "",
"message" : ""
}
Produces
This API call produces the following media types according to the request header;
the media type will be conveyed by the response header.
Responses
200
successful operation
ApiResponse
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
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 request header;
the media type will be conveyed by the 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
Example data
Content-Type: application/json
{
"petId" : "",
"quantity" : "",
"id" : "",
"shipDate" : "",
"complete" : "",
"status" : ""
}
Produces
This API call produces the following media types according to the request header;
the media type will be conveyed by the response header.
application/json
application/xml
Responses
200
successful operation
Order
400
Invalid ID supplied
404
Order not found
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 request header:
application/json
application/xml
application/x-www-form-urlencoded
Request body
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
Example data
Content-Type: application/json
{
"petId" : "",
"quantity" : "",
"id" : "",
"shipDate" : "",
"complete" : "",
"status" : ""
}
Produces
This API call produces the following media types according to the request header;
the media type will be conveyed by the response header.
Responses
200
successful operation
Order
400
Invalid input
422
Validation exception
Create user (createUser)
This can only be done by the logged in user.
Consumes
This API call consumes the following media types via the request header:
application/json
application/xml
application/x-www-form-urlencoded
Request body
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
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 request header;
the media type will be conveyed by the response header.
application/json
application/xml
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 request header:
Request body
body (optional)
Body Parameter —
Return type
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 request header;
the media type will be conveyed by the response header.
application/json
application/xml
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
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" : "",
"lastName" : "",
"password" : "",
"userStatus" : "",
"phone" : "",
"id" : "",
"email" : "",
"username" : ""
}
Produces
This API call produces the following media types according to the request header;
the media type will be conveyed by the response header.
application/json
application/xml
Responses
200
successful operation
User
400
Invalid username supplied
404
User not found
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 request header;
the media type will be conveyed by the response header.
application/xml
application/json
Responses
200
successful operation
400
Invalid username/password supplied
Logs out current logged in user session (logoutUser)
Responses
default
successful operation
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 request header:
application/json
application/xml
application/x-www-form-urlencoded
Request body
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
[ Jump to Methods ]
Table of Contents
Address
ApiResponse
Category
Customer
Order
Pet
Tag
User
street (optional)
city (optional)
state (optional)
zip (optional)
code (optional)
type (optional)
message (optional)
id (optional)
name (optional)
id (optional)
username (optional)
address (optional)
id (optional)
petId (optional)
quantity (optional)
shipDate (optional)
status (optional)
complete (optional)
id (optional)
name
category (optional)
photoUrls
tags (optional)
status (optional)
id (optional)
name (optional)
id (optional)
username (optional)
firstName (optional)
lastName (optional)
email (optional)
password (optional)
phone (optional)
userStatus (optional)
User Status format: int32