Create a pet

Adds a pet to the store. The name must be unique within the store, and the species must be one the store already sells; anything else is rejected with a 400.

Request body

FieldTypeDescription
namestringWhat the pet is called, at most 64 characters.
speciesstringOne of the species listed by the species endpoint.

Responses

201 Created

The pet was stored. Its new id is in the Location header, and the body holds the pet as stored.

{"id": 7, "name": "Rex", "species": "dog"}

400 Bad Request

A required field is missing, the name is taken, or the species is not one the store sells.