Swagger Petstore - OpenAPI 3.0
SSwagger Petstore - OpenAPI 3.0
API Reference
POSTCreate a pet in the store/petPUTReplace a pet's details/petGETGet a pet by ID/pet/{petId}POSTUpdate a pet with form data/pet/{petId}DELETEDelete a pet/pet/{petId}GETFinds Pets by status./pet/findByStatusGETFinds Pets by tags./pet/findByTags
POSTUpload a pet image/pet/{petId}/uploadImage
GETGet pet inventory counts by status/store/inventoryPOSTCreate a pet order/store/order
GETFind purchase order by ID./store/order/{orderId}DELETEDelete purchase order by identifier./store/order/{orderId}
POSTCreate a user account/userGETGet a user by username/user/{username}PUTReplace a user account/user/{username}DELETEDelete a user account/user/{username}POSTCreate user accounts from a list/user/createWithListGETLog in a user/user/loginGETLog out a user/user/logout
llms.txtPowered by Octri
POST/store/order

Create a pet order

Creates a new order in the store for a pet. You can supply order details such as petId, quantity, and shipDate; status, if provided, must be one of the accepted values. The response contains the created order details.

  • IdempotentThe SDK sends Idempotency-Key, so a retried request is only applied once.

6 body fields

Optional order details, supplied as JSON, XML, or form data. All fields are optional.

idintegeroptional

The order's numeric identifier.

petIdintegeroptional

The identifier of the pet included in the order.

quantityintegeroptional

The number of pets in the order.

shipDatestringoptional

The shipment date and time in date-time format.

statusstringoptional

Order Status

Allowed:placedapproveddelivered
completebooleanoptional

Whether the order is complete.

4 status codes
200Returns the order object, including its identifier, pet ID, quantity, shipment date, status, and completion state.
idintegeroptional
petIdintegeroptional
quantityintegeroptional
shipDatestringoptional
statusstringoptional

Order Status

Allowed:placedapproveddelivered
completebooleanoptional
400Returned when the input is invalid.
422Returned when the request fails validation.
defaultUnexpected error

Error handling

A 400 is returned for invalid input, and a 422 for a validation exception. status, if provided, must be placed, approved, or delivered; shipDate, if provided, must use date-time format.

import { SwaggerPetstoreOpenAPI30 } from "swagger-petstore---openapi-3-0-sdk";

const client = new SwaggerPetstoreOpenAPI30({
  baseUrl: "/api/v3",
  auth: { bearer: process.env.SWAGGER_PETSTORE_TOKEN! },
});

const result = await client.store.placeOrder();
Response
{
  "id": 10,
  "petId": 198772,
  "quantity": 7,
  "shipDate": "2026-01-15T09:00:00Z",
  "status": "approved",
  "complete": true
}
PreviousGet pet inventory counts by stat…NextFind purchase order by ID.