Swagger Petstore
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.
Introduction
This API is documented in OpenAPI format and is based on
Petstore sample provided by swagger.io team.
It was extended to illustrate features of generator-openapi-repo
tool and ReDoc documentation. In addition to standard
OpenAPI syntax we use a few vendor extensions.
OpenAPI Specification
This API is documented in OpenAPI format and is based on
Petstore sample provided by swagger.io team.
It was extended to illustrate features of generator-openapi-repo
tool and ReDoc documentation. In addition to standard
OpenAPI syntax we use a few vendor extensions.
Cross-Origin Resource Sharing
This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with W3C spec.
And that allows cross-domain communication from the browser.
All responses have a wildcard same-origin which makes them completely public and accessible to everyone, including any code on any site.
Authentication
Petstore offers two forms of authentication:
- API Key
- OAuth2
OAuth2 - an open protocol to allow secure authorization in a simple
and standard method from web, mobile and desktop applications.
Contact
Terms of Service
http://swagger.io/terms/License
Apache 2.0External Documentation
Find out how to create Github repo for your OpenAPI spec.Servers
Add a new pet to the store
Add new pet to the store inventory.
Authorizations
Get access to data while protecting your account credentials.
OAuth2 is also a safer and more secure way to give you access.
implicit Flow
http://petstore.swagger.io/api/oauth/dialog
write:pets
modify pets in your accountread:pets
read your pets
Request Body
Responses
Samples
Update an existing pet
Authorizations
Get access to data while protecting your account credentials.
OAuth2 is also a safer and more secure way to give you access.
implicit Flow
http://petstore.swagger.io/api/oauth/dialog
write:pets
modify pets in your accountread:pets
read your pets
Request Body
Responses
Samples
Find pet by ID
Returns a single pet
Authorizations
For this sample, you can use the api key special-key
to test the authorization filters.
Parameters
Path Parameters
ID of pet to return
int64
Responses
Samples
Updates a pet in the store with form data
Authorizations
Get access to data while protecting your account credentials.
OAuth2 is also a safer and more secure way to give you access.
implicit Flow
http://petstore.swagger.io/api/oauth/dialog
write:pets
modify pets in your accountread:pets
read your pets
Parameters
Path Parameters
ID of pet that needs to be updated
int64
Request Body
Responses
Samples
Deletes a pet
Authorizations
Get access to data while protecting your account credentials.
OAuth2 is also a safer and more secure way to give you access.
implicit Flow
http://petstore.swagger.io/api/oauth/dialog
write:pets
modify pets in your accountread:pets
read your pets
Parameters
Header Parameters
Bearer <TOKEN>
Path Parameters
Pet id to delete
int64
Responses
Samples
uploads an image
Authorizations
Get access to data while protecting your account credentials.
OAuth2 is also a safer and more secure way to give you access.
implicit Flow
http://petstore.swagger.io/api/oauth/dialog
write:pets
modify pets in your accountread:pets
read your pets
Parameters
Path Parameters
ID of pet to update
int64
Request Body
Responses
Samples
Finds Pets by status
Multiple status values can be provided with comma separated strings
Authorizations
Get access to data while protecting your account credentials.
OAuth2 is also a safer and more secure way to give you access.
implicit Flow
http://petstore.swagger.io/api/oauth/dialog
write:pets
modify pets in your accountread:pets
read your pets
Parameters
Query Parameters
Status values that need to be considered for filter
1
3
Responses
Samples
Finds Pets by tags
Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
Authorizations
Get access to data while protecting your account credentials.
OAuth2 is also a safer and more secure way to give you access.
implicit Flow
http://petstore.swagger.io/api/oauth/dialog
write:pets
modify pets in your accountread:pets
read your pets
Parameters
Query Parameters
Tags to filter by
Responses
Samples
Returns pet inventories by status
Returns a map of status codes to quantities
Authorizations
For this sample, you can use the api key special-key
to test the authorization filters.
Responses
Samples
Place an order for a pet
Request Body
Responses
Samples
Find purchase order by ID
For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions
Parameters
Path Parameters
ID of pet that needs to be fetched
int64
1
5
Responses
Samples
Delete purchase order by ID
For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors
Parameters
Path Parameters
ID of the order that needs to be deleted
1
Responses
Samples
Subscribe to the Store events
Create user
This can only be done by the logged in user.
Request Body
Responses
Samples
Get user by user name
Parameters
Path Parameters
The name that needs to be fetched. Use user1 for testing.
Responses
Samples
Updated user
This can only be done by the logged in user.
Parameters
Path Parameters
name that need to be updated