API essentials
Use the data models
Build valid Pet, Order, User, Category, Tag, and ApiResponse payloads.
These six schemas define the reusable request and response shapes in contract version 1.0.27. Properties are optional unless marked required.
Pet
name and photoUrls are required.
| Property | Type | Required | Details |
|---|---|---|---|
id | integer, int64 | No | Example: 10 |
name | string | Yes | Example: doggie |
category | Category | No | Pet category |
photoUrls | array of strings | Yes | Photo locations |
tags | array of Tag | No | Pet tags |
status | string | No | available, pending, or sold |
Order
| Property | Type | Required | Details |
|---|---|---|---|
id | integer, int64 | No | Example: 10 |
petId | integer, int64 | No | Example: 198772 |
quantity | integer, int32 | No | Example: 7 |
shipDate | string, date-time | No | Shipment date and time |
status | string | No | placed, approved, or delivered; example: approved |
complete | boolean | No | Whether the order is complete |
User
| Property | Type | Required | Details |
|---|---|---|---|
id | integer, int64 | No | Example: 10 |
username | string | No | Example: theUser |
firstName | string | No | Example: John |
lastName | string | No | Example: James |
email | string | No | Example: john@email.com |
password | string | No | Example in the contract: 12345 |
phone | string | No | Example: 12345 |
userStatus | integer, int32 | No | User status; example: 1 |
Category
| Property | Type | Required | Details |
|---|---|---|---|
id | integer, int64 | No | Example: 1 |
name | string | No | Example: Dogs |
Tag
| Property | Type | Required | Details |
|---|---|---|---|
id | integer, int64 | No | Tag identifier |
name | string | No | Tag name |
ApiResponse
The image-upload operation returns this schema.
| Property | Type | Required | Details |
|---|---|---|---|
code | integer, int32 | No | Response code value |
type | string | No | Response type |
message | string | No | Response message |
Next, use a model in Add a pet, Place an order, or Create a user.