List Orders
Retrieve a list of all orders with optional filtering
GET
/
api
/
v2
/
orders
List Orders
curl --request GET \
--url https://api.example.com/api/v2/ordersimport requests
url = "https://api.example.com/api/v2/orders"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.example.com/api/v2/orders', 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",
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"
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")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/v2/orders")
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_bodyList Orders
Returns a paginated list of orders, ordered by creation date (most recent first). Supports filtering by status, customer, payment status, and date range.Authentication
Authorization: Bearer glm_test_YOUR_API_KEY
Query Parameters
| Parameter | Type | Description |
|---|---|---|
limit | integer | Number of results per page (default: 10, max: 100) |
starting_after | string | Cursor for pagination (order ID) |
status | enum | Filter by status: pending, processing, completed, failed, cancelled |
payment_status | enum | Filter by payment status: pending, authorized, captured, failed, refunded, disputed |
customer_email | string | Filter by customer email |
created_after | timestamp | Filter orders created after this date |
created_before | timestamp | Filter orders created before this date |
Request
GET /api/v2/orders?limit=10&status=completed
Response
All monetary amounts are integers in cents (e.g., 4995 = $49.95).
{
"data": [
{
"id": "ord_abc123",
"order_number": "ORD-2025-001234",
"status": "completed",
"payment_status": "captured",
"customer": {
"email": "customer@example.com",
"first_name": "Jane",
"last_name": "Doe"
},
"amounts": {
"total": 4235,
"hsa_amount": 2995,
"regular_amount": 0
},
"payment": {
"payment_method": "hsa_fsa_card",
"last4": "1111"
},
"created_at": "2025-10-18T15:00:00Z",
"completed_at": "2025-10-18T15:30:00Z"
},
{
"id": "ord_def456",
"order_number": "ORD-2025-001235",
"status": "completed",
"payment_status": "captured",
"customer": {
"email": "member@example.com",
"first_name": "John",
"last_name": "Smith"
},
"amounts": {
"total": 9900,
"hsa_amount": 9900,
"regular_amount": 0
},
"payment": {
"payment_method": "hsa_fsa_card",
"last4": "2222"
},
"created_at": "2025-10-17T10:00:00Z",
"completed_at": "2025-10-17T10:15:00Z"
}
],
"has_more": true,
"next_cursor": "ord_def456"
}
Response Fields
| Field | Type | Description |
|---|---|---|
data | array | Array of order objects |
has_more | boolean | Whether more results are available |
next_cursor | string | Cursor for next page (use as starting_after) |
Examples
List All Orders
curl https://api.withgale.com/api/v2/orders \
-H "Authorization: Bearer glm_test_YOUR_API_KEY"
Filter by Status
curl "https://api.withgale.com/api/v2/orders?status=completed&limit=50" \
-H "Authorization: Bearer glm_test_YOUR_API_KEY"
Filter by Payment Status
curl "https://api.withgale.com/api/v2/orders?payment_status=captured" \
-H "Authorization: Bearer glm_test_YOUR_API_KEY"
Filter by Customer
curl "https://api.withgale.com/api/v2/orders?customer_email=jane@example.com" \
-H "Authorization: Bearer glm_test_YOUR_API_KEY"
Errors
| Status Code | Error Code | Description |
|---|---|---|
| 400 | invalid_request | Invalid query parameters |
| 401 | unauthorized | Invalid or missing API key |
| 429 | rate_limit_exceeded | Too many requests |
{
"error": {
"code": "invalid_request",
"message": "Invalid status value",
"param": "status"
}
}
Related
โI
List Orders
curl --request GET \
--url https://api.example.com/api/v2/ordersimport requests
url = "https://api.example.com/api/v2/orders"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.example.com/api/v2/orders', 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",
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"
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")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/v2/orders")
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