Swagger Petstore - OpenAPI 3.0
POST/store/order

Place an order for a pet

Creates a new order for a pet in the store. All fields are optional — supply petId and quantity at minimum to place a basic order. status must be one of placed, approved, or delivered if provided. Returns the created order object with its identifier.

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

6 body fields

Order details. All fields are optional.

idintegeroptional
The order's unique identifier. Assigned by the store if omitted.
petIdintegeroptional
The identifier of the pet being ordered.
quantityintegeroptional
The number of pets to order.
shipDatestringoptional
The expected ship date in ISO 8601 datetime format.
statusstringoptional
Order Status
Allowed:placedapproveddelivered
completebooleanoptional
Set to true if the order is complete, false otherwise.

4 status codes
200Returns the created order object with all supplied fields and its assigned identifier.
idintegeroptional
petIdintegeroptional
quantityintegeroptional
shipDatestringoptional
statusstringoptional
Order Status
Allowed:placedapproveddelivered
completebooleanoptional
400Returned when the request body contains invalid input, such as non-integer values for `petId` or `quantity`.
422Returned when the request body fails schema validation, such as an invalid `status` value.
defaultUnexpected error

Error handling

A 400 is returned when the request body contains invalid input, such as a non-integer petId or quantity. A 422 is returned when the request body fails validation — ensure status, if supplied, is one of the accepted values.