Pets

Creating a new pet

Add a new pet to the store

Add a new pet to the store

POST/api/v3/pet
Authorization
Body

Create a new pet in the store

idinteger (int64)
Example: 10
name*string
Example: "doggie"
categoryobject
photoUrls*array of string
tagsarray of object
statusenum

pet status in the store

availablependingsold
Response

Successful operation

Body
idinteger (int64)
Example: 10
name*string
Example: "doggie"
categoryobject
photoUrls*array of string
tagsarray of object
statusenum

pet status in the store

availablependingsold
Request
const response = await fetch('/api/v3/pet', {
    method: 'POST',
    headers: {
      "Content-Type": "application/json"
    },
    body: JSON.stringify({
      "name": "doggie",
      "photoUrls": [
        "text"
      ]
    }),
});
const data = await response.json();
Response
{
  "id": 10,
  "name": "doggie",
  "category": {
    "id": 1,
    "name": "Dogs"
  },
  "photoUrls": [
    "text"
  ],
  "tags": [
    {
      "id": 0,
      "name": "text"
    }
  ],
  "status": "available"
}

Updating a pet

Update an existing pet

Update an existing pet by Id

PUT/api/v3/pet
Authorization
Body

Update an existent pet in the store

idinteger (int64)
Example: 10
name*string
Example: "doggie"
categoryobject
photoUrls*array of string
tagsarray of object
statusenum

pet status in the store

availablependingsold
Response

Successful operation

Body
idinteger (int64)
Example: 10
name*string
Example: "doggie"
categoryobject
photoUrls*array of string
tagsarray of object
statusenum

pet status in the store

availablependingsold
Request
const response = await fetch('/api/v3/pet', {
    method: 'PUT',
    headers: {
      "Content-Type": "application/json"
    },
    body: JSON.stringify({
      "name": "doggie",
      "photoUrls": [
        "text"
      ]
    }),
});
const data = await response.json();
Response
{
  "id": 10,
  "name": "doggie",
  "category": {
    "id": 1,
    "name": "Dogs"
  },
  "photoUrls": [
    "text"
  ],
  "tags": [
    {
      "id": 0,
      "name": "text"
    }
  ],
  "status": "available"
}

Good to know: These API methods were auto-generated from an example OpenAPI file. You'll see that it's not editable – that's because the contents are synced to a URL! Any time the linked file changes, the documentation will change too.

Last updated