Skip to content
orders

Place an order

On this page
POST /orders
Production: https://petstore.example.com/v1Sandbox: https://sandbox.petstore.example.com/v1Live demo on docvia.dev; accepts any token: /api/petstore/v1
curl https://petstore.example.com/v1/orders \
  --request POST \
  --header 'Idempotency-Key: 3fa85f64-5717-4562-b3fc-2c963f66afa6' \
  --header 'X-Api-Key: <api-key>' \
  --header 'Content-Type: application/json' \
  --data '{
  "petId": 1042,
  "note": "string"
}'
Try it Sent from your browser; this site proxies the spec's own servers. Open in workspace
POST /api/petstore/v1/orders

/api/petstore/v1

Kept in memory for this visit and used on every page of this API; never saved.

Headers

Authorization

apiKey API key in the X-Api-Key header

Order endpoints use a separate key with the orders permission.

Header parameters

Idempotency-Key string<uuid> required

A unique key per order, so a retried request is not placed twice.

Request body

required
Body application/json
petId integer<int64> required
note string
max length 500
Example
{
  "petId": 1042,
  "note": "string"
}

Responses

The order was placed.

Response application/json
id string required read-only
petId integer<int64> required
status string required
One of placed approved completed
note string
Example
{
  "id": "ord_8f2k3",
  "petId": 0,
  "status": "placed",
  "note": "string"
}