Skip to content

Get Order

The Get Order endpoint is used to retrieve information about an existing store order from the Petstore system.

This operation returns order details based on the order ID provided in the request path.

Endpoint

GET /store/order/{orderId}

Base URL

https://petstore.swagger.io/v2/store/order/{orderId}

Path Parameters

Parameter Type Required Description
orderId integer Yes Unique identifier of the order

Request Headers

Header Required Description
accept No Specifies the expected response format
api_key No API key used for authorized requests

Supported Response Formats

The endpoint supports the following response formats:

Content Type Usage
application/json JSON response payload
application/xml XML response payload

Sample Request

curl -X GET "https://petstore.swagger.io/v2/store/order/5001" \
-H "accept: application/json"
import requests

url = "https://petstore.swagger.io/v2/store/order/5001"

response = requests.get(url)

print(response.json())
fetch("https://petstore.swagger.io/v2/store/order/5001", {
  method: "GET",
  headers: {
    "accept": "application/json"
  }
})
.then(response => response.json())
.then(data => console.log(data));

Successful Response

{
  "id": 5001,
  "petId": 101,
  "quantity": 1,
  "shipDate": "2026-05-13T10:00:00.000Z",
  "status": "placed",
  "complete": true
}
<Order>
  <id>5001</id>
  <petId>101</petId>
  <quantity>1</quantity>
  <shipDate>2026-05-13T10:00:00.000Z</shipDate>
  <status>placed</status>
  <complete>true</complete>
</Order>

Response Codes

Status Code Description
200 Order details retrieved successfully
400 Invalid order ID supplied
404 Order not found

Error Response Example

{
  "code": 404,
  "type": "error",
  "message": "Order not found"
}

Notes

  • The orderId value must reference an existing order record.
  • Invalid or non-existing order IDs may return an error response.
  • JSON is the preferred response format for most integrations.
  • Authentication may be required for protected environments or restricted resources.