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.