Skip to main content
GET
/
orders
/
{id}
Get Order
curl --request GET \
  --url https://api.petstoreapi.com/v1/orders/{id}
import requests

url = "https://api.petstoreapi.com/v1/orders/{id}"

response = requests.get(url)

print(response.text)
const options = {method: 'GET'};

fetch('https://api.petstoreapi.com/v1/orders/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://api.petstoreapi.com/v1/orders/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main

import (
"fmt"
"net/http"
"io"
)

func main() {

url := "https://api.petstoreapi.com/v1/orders/{id}"

req, _ := http.NewRequest("GET", url, nil)

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.get("https://api.petstoreapi.com/v1/orders/{id}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.petstoreapi.com/v1/orders/{id}")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
{
  "id": 40238436,
  "petId": 69923630,
  "quantity": 87,
  "shipDate": "2024-12-09",
  "status": "approved",
  "complete": false
}
{
"type": "https://petstoreapi.com/errors/bad-request",
"title": "Bad Request",
"status": 400,
"detail": "Invalid value for parameter 'status'. Must be one of: available, pending, sold.",
"instance": "/pets"
}
{
"type": "https://petstoreapi.com/errors/not-found",
"title": "Not Found",
"status": 404,
"detail": "The requested pet with ID '123' was not found.",
"instance": "/pets/123"
}

Headers

X-Tenant-ID
string<uuid>

Optional tenant identifier for data isolation. When provided, all operations will be scoped to this tenant, ensuring data separation between different organizations or users. If omitted, operations will access the shared/public data pool where data may be visible to and modified by other users.

Path Parameters

id
string<uuid>
required

Unique identifier for the order

Response

Operation successful

Pet store order details

id
string<uuid>
required
read-only

Unique order identifier (UUID v7)

Examples:

"019b4139-1234-7abc-8def-123456789abc"

"019b4127-5678-7def-9012-234567890def"

petId
string<uuid>
required

ID of the pet being ordered

Examples:

"019b4132-70aa-764f-b315-e2803d882a24"

"019b4127-54d5-76d9-b626-0d4c7bfce5b6"

userId
string<uuid>
required

ID of the user placing the order

Examples:

"019b4138-e0af-70b9-8f0c-6ea97d495dfa"

"019b4128-6a6b-777c-9ae8-335e962c68d8"

status
enum<string>
required

Order status

Available options:
PLACED,
APPROVED,
SHIPPED,
DELIVERED,
CANCELLED
Examples:

"PLACED"

"APPROVED"

totalAmount
string
required

Total order amount

Examples:

"125.50"

"75.00"

"200.99"

currency
string
default:USD
required

Currency code for the order amount (ISO 4217)

Pattern: ^[A-Z]{3}$
Examples:

"USD"

"EUR"

"GBP"

createdAt
string<date-time>
required
read-only

Order creation timestamp (RFC 3339)

Examples:

"2025-12-21T13:56:23Z"

"2025-11-15T08:30:00Z"

updatedAt
string<date-time>
required
read-only

Order last update timestamp (RFC 3339)

Examples:

"2025-12-21T13:56:23Z"

"2025-12-21T15:30:45Z"

tenantId
string<uuid> | null
read-only

Optional tenant identifier for data isolation. When present, indicates this order belongs to a specific tenant. Null or omitted means the order is in the shared/public data pool.

Examples:

"550e8400-e29b-41d4-a716-446655440000"

"7c9e6679-7425-40de-944b-e07fc1f90ae7"