Skip to main content
GET
/
v2
/
orders
List Orders
curl --request GET \
  --url https://api.example.com/v2/orders

List 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

ParameterTypeDescription
limitintegerNumber of results per page (default: 10, max: 100)
starting_afterstringCursor for pagination (order ID)
statusenumFilter by status: pending, processing, completed, failed, cancelled
payment_statusenumFilter by payment status: pending, authorized, captured, failed, refunded, disputed
customer_emailstringFilter by customer email
created_aftertimestampFilter orders created after this date
created_beforetimestampFilter orders created before this date

Request

GET /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

FieldTypeDescription
dataarrayArray of order objects
has_morebooleanWhether more results are available
next_cursorstringCursor for next page (use as starting_after)

Examples

List All Orders

curl https://api.withgale.com/v2/orders \
  -H "Authorization: Bearer glm_test_YOUR_API_KEY"

Filter by Status

curl "https://api.withgale.com/v2/orders?status=completed&limit=50" \
  -H "Authorization: Bearer glm_test_YOUR_API_KEY"

Filter by Payment Status

curl "https://api.withgale.com/v2/orders?payment_status=captured" \
  -H "Authorization: Bearer glm_test_YOUR_API_KEY"

Filter by Customer

curl "https://api.withgale.com/v2/orders?customer_email=jane@example.com" \
  -H "Authorization: Bearer glm_test_YOUR_API_KEY"

Errors

Status CodeError CodeDescription
400invalid_requestInvalid query parameters
401unauthorizedInvalid or missing API key
429rate_limit_exceededToo many requests
Example error:
{
  "error": {
    "code": "invalid_request",
    "message": "Invalid status value",
    "param": "status"
  }
}