Skip to content
Get started

Add a new pet to the store

client.pets.create(PetCreateParams { name, photoUrls, id, 3 more } body, RequestOptionsoptions?): Pet { name, photoUrls, id, 3 more }
POST/pet

Add a new pet to the store

ParametersExpand Collapse
body: PetCreateParams { name, photoUrls, id, 3 more }
name: string
photoUrls: Array<string>
id?: number
formatint64
category?: Category { id, name }
id?: number
formatint64
name?: string
status?: "available" | "pending" | "sold"

pet status in the store

One of the following:
"available"
"pending"
"sold"
tags?: Array<Tag { id, name } >
id?: number
formatint64
name?: string
ReturnsExpand Collapse
Pet { name, photoUrls, id, 3 more }
name: string
photoUrls: Array<string>
id?: number
formatint64
category?: Category { id, name }
id?: number
formatint64
name?: string
status?: "available" | "pending" | "sold"

pet status in the store

One of the following:
"available"
"pending"
"sold"
tags?: Array<Tag { id, name } >
id?: number
formatint64
name?: string

Add a new pet to the store

import RpTestDocs1 from 'rp-test-docs-1';

const client = new RpTestDocs1({
  apiKey: process.env['PETSTORE_API_KEY'], // This is the default and can be omitted
});

const pet = await client.pets.create({ name: 'doggie', photoUrls: ['string'] });

console.log(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"
    }
  ]
}