Get Order
Retrieve details about a specific order
GET
/
api
/
v2
/
orders
/
{id}
Get Order
curl --request GET \
--url https://api.example.com/api/v2/orders/{id}import requests
url = "https://api.example.com/api/v2/orders/{id}"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.example.com/api/v2/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.example.com/api/v2/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.example.com/api/v2/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.example.com/api/v2/orders/{id}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/v2/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_bodyGet Order
Retrieve information about an order, including payment status, customer details, and line items. Orders are created when a checkout session or payment link is successfully paid.Authentication
Authorization: Bearer glm_test_YOUR_API_KEY
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | Yes | Order ID (e.g., ord_abc123xyz) |
Request
GET /api/v2/orders/{id}
Response
All monetary amounts are integers in cents (e.g., 4995 = $49.95).
{
"id": "ord_abc123xyz",
"order_number": "ORD-2025-001234",
"checkout_id": "01HXYZ...",
"status": "completed",
"payment_status": "captured",
"receipt_url": "https://files.withgale.com/receipts/ord_abc123xyz.pdf?expires=...&signature=...",
"customer": {
"email": "jane@example.com",
"first_name": "Jane",
"last_name": "Doe",
"phone": "+1-555-123-4567",
"shipping_address": {
"address_line_1": "123 Main St",
"address_line_2": "Apt 4B",
"city": "New York",
"state": "NY",
"postal_code": "10001",
"country": "US"
},
"billing_address": {
"address_line_1": "123 Main St",
"city": "New York",
"state": "NY",
"postal_code": "10001",
"country": "US"
}
},
"line_items": [
{
"id": "li_123",
"product_id": "PROD-001",
"name": "Digital Thermometer",
"quantity": 1,
"price": 2995,
"hsa_fsa_eligible": true
}
],
"amounts": {
"subtotal": 2995,
"hsa_amount": 2995,
"regular_amount": 0,
"shipping": 995,
"tax": 245,
"discount": 0,
"total": 4235
},
"payment": {
"payment_id": "pay_xyz789",
"payment_method": "hsa_fsa_card",
"last4": "1111",
"brand": "visa",
"captured_at": "2025-10-18T15:30:00Z"
},
"metadata": {
"order_number": "ORDER-12345",
"platform": "SHOPIFY"
},
"created_at": "2025-10-18T15:00:00Z",
"completed_at": "2025-10-18T15:30:00Z",
"status_history": [
{
"status": "pending",
"timestamp": "2025-10-18T15:00:00Z",
"reason": "Order created"
},
{
"status": "processing",
"timestamp": "2025-10-18T15:01:00Z",
"reason": "Payment processing"
},
{
"status": "completed",
"timestamp": "2025-10-18T15:30:00Z",
"reason": "Payment captured"
}
]
}
receipt_url is a temporary link to the orderβs receipt PDF. It is null until the receipt is generated and expires after one hour. Request the order again for a new link.Response Fields
See Order Object for complete field descriptions.Examples
Basic Retrieval
curl https://api.withgale.com/api/v2/orders/ord_abc123xyz \
-H "Authorization: Bearer glm_test_YOUR_API_KEY"
Order Status
| Status | Description |
|---|---|
pending | Order created, awaiting payment |
processing | Payment being processed |
completed | Payment successful, order complete |
failed | Payment failed |
cancelled | Order cancelled |
Payment Status
| Status | Description |
|---|---|
pending | Payment not yet attempted |
authorized | Payment authorized (not captured) |
captured | Payment captured successfully |
failed | Payment failed |
refunded | Payment refunded (full or partial) |
disputed | Payment disputed/chargebacked |
Errors
| Status Code | Error Code | Description |
|---|---|---|
| 401 | unauthorized | Invalid or missing API key |
| 404 | not_found | Order not found |
| 429 | rate_limit_exceeded | Too many requests |
{
"error": {
"code": "not_found",
"message": "Order not found",
"param": "id"
}
}
Related
βI
Get Order
curl --request GET \
--url https://api.example.com/api/v2/orders/{id}import requests
url = "https://api.example.com/api/v2/orders/{id}"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.example.com/api/v2/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.example.com/api/v2/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.example.com/api/v2/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.example.com/api/v2/orders/{id}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/v2/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