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 an image for a pet/pet/{petId}/uploadImage
GETList pet inventory by status/store/inventoryPOSTPlace an order for a pet/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 multiple user accounts/user/createWithListGETLog in a user/user/loginGETLog out the authenticated user/user/logout
llms.txtPowered by Octri
POST/store/order

Place an order for a pet

Creates a new order in the store for a pet. You can provide order details such as petId, quantity, shipDate, and status; status, if supplied, must be placed, approved, or delivered. A 200 response returns the order record.

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

6 body fields

Optional order details. Send the body as JSON, XML, or URL-encoded form data.

idintegeroptional

The order's numeric identifier.

petIdintegeroptional

The numeric identifier of the pet in the order.

quantityintegeroptional

The number of pets in the order.

shipDatestringoptional

The order's shipping date and time in date-time format.

statusstringoptional

Order Status

Allowed:placedapproveddelivered
completebooleanoptional

Whether the order is complete.

4 status codes
200Returns the order record, including its identifier, pet identifier, quantity, ship date, status, and completion flag.
idintegeroptional
petIdintegeroptional
quantityintegeroptional
shipDatestringoptional
statusstringoptional

Order Status

Allowed:placedapproveddelivered
completebooleanoptional
400Returned when the input is invalid.
422Returned when validation fails.
defaultReturned when an unexpected error occurs.

Error handling

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

import swaggerpetstoreopenapi30sdk.*
import swaggerpetstoreopenapi30sdk.methods.Store

val config = ClientConfig(
    baseUrl = "/api/v3",
    auth = ClientAuthConfig(bearer = System.getenv("SWAGGER_PETSTORE_TOKEN")),
)
val client = SwaggerPetstoreOpenAPI30(config)

val result = client.store.placeOrder(Store.PlaceOrderRequest())
Response
{
  "id": 10,
  "petId": 198772,
  "quantity": 7,
  "shipDate": "2026-01-15T09:00:00Z",
  "status": "approved",
  "complete": true
}
PreviousList pet inventory by statusNextFind purchase order by ID.