Skip to content
Get started

Add a new pet to the store

pets.create(PetCreateParams**kwargs) -> Pet
POST/pet

Add a new pet to the store

ParametersExpand Collapse
name: str
photo_urls: SequenceNotStr[str]
id: Optional[int]
category: Optional[CategoryParam]
id: Optional[int]
name: Optional[str]
status: Optional[Literal["available", "pending", "sold"]]

pet status in the store

Accepts one of the following:
"available"
"pending"
"sold"
tags: Optional[Iterable[Tag]]
id: Optional[int]
name: Optional[str]
ReturnsExpand Collapse
class Pet:
name: str
photo_urls: List[str]
id: Optional[int]
category: Optional[Category]
id: Optional[int]
name: Optional[str]
status: Optional[Literal["available", "pending", "sold"]]

pet status in the store

Accepts one of the following:
"available"
"pending"
"sold"
tags: Optional[List[Tag]]
id: Optional[int]
name: Optional[str]

Add a new pet to the store

import os
from maxf_docs_dev_7 import MaxfDocsDev7

client = MaxfDocsDev7(
    api_key=os.environ.get("PETSTORE_API_KEY"),  # This is the default and can be omitted
)
pet = client.pets.create(
    name="doggie",
    photo_urls=["string"],
)
print(pet.id)
{
  "name": "doggie",
  "photoUrls": [
    "string"
  ],
  "id": 10,
  "category": {
    "id": 1,
    "name": "Dogs"
  },
  "status": "available",
  "tags": [
    {
      "id": 0,
      "name": "name"
    }
  ]
}
Returns Examples
{
  "name": "doggie",
  "photoUrls": [
    "string"
  ],
  "id": 10,
  "category": {
    "id": 1,
    "name": "Dogs"
  },
  "status": "available",
  "tags": [
    {
      "id": 0,
      "name": "name"
    }
  ]
}