> ## Documentation Index
> Fetch the complete documentation index at: https://docs.withgale.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Order Object

> The Order object represents a completed or in-progress purchase created from a checkout session or payment link

# Order Object

When a payment is successfully processed — via checkout session or payment link — an Order is created. Orders track payment status, fulfillment, and provide an immutable record of the transaction.

<Note>All monetary amounts are integers in cents (e.g., 4995 = \$49.95).</Note>

## The Order Object

```json theme={null}
{
  "id": "ord_01ABC...",
  "checkout_id": "cs_abc123",
  "reference_id": "your-order-123",
  "payment_link_id": null,
  "client_reference_id": null,
  "status": "completed",
  "is_recurring": false,
  "payment_status": "captured",
  "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,
      "is_recurring": false
    }
  ],
  "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": "2026-02-25T15:30:00Z"
  },
  "metadata": {
    "order_number": "ORDER-12345",
    "platform": "CUSTOM"
  },
  "created_at": "2026-02-25T15:00:00Z",
  "completed_at": "2026-02-25T15:30:00Z",
  "status_history": [
    {
      "status": "pending",
      "timestamp": "2026-02-25T15:00:00Z",
      "reason": "Order created"
    },
    {
      "status": "processing",
      "timestamp": "2026-02-25T15:01:00Z",
      "reason": "Payment processing"
    },
    {
      "status": "completed",
      "timestamp": "2026-02-25T15:30:00Z",
      "reason": "Payment captured"
    }
  ]
}
```

## Attributes

| Attribute | Type | Description |
| - | - | - |
| `id` | string | Unique order identifier (`ord_xxx`) |
| `checkout_id` | string | Checkout session ID (`cs_xxx`) |
| `reference_id` | string | Your order/cart reference — set for checkout session orders, null for payment link orders |
| `payment_link_id` | string | Payment link ID — set for payment link orders, null for checkout session orders |
| `client_reference_id` | string | Your reference passed via payment link — set for payment link orders, null for checkout session orders |
| `status` | enum | Fulfillment status (see below) |
| `is_recurring` | boolean | `true` if this is a subscription/recurring order, `false` for one-time purchases |
| `payment_status` | enum | Payment state (see below) |
| `amount` | integer | Order total in cents |
| `currency` | string | Lowercase ISO currency code (e.g. `usd`) |
| `customer` | object | Customer name and email |
| `line_items` | array | Ordered items (snapshot at time of purchase) |
| `created_at` | timestamp | When order was created |

## Amounts Object

| Field | Type | Description |
| - | - | - |
| `subtotal` | integer | Sum of all line item totals |
| `hsa_amount` | integer | Amount payable with HSA/FSA |
| `regular_amount` | integer | Amount requiring regular payment |
| `shipping` | integer | Shipping cost |
| `tax` | integer | Tax amount |
| `discount` | integer | Discount applied |
| `total` | integer | Final total charged |

## Line Item Attributes

| Attribute | Type | Description |
| - | - | - |
| `id` | string | Line item identifier |
| `product_id` | string | Your product ID |
| `name` | string | Product name |
| `quantity` | integer | Quantity ordered |
| `price` | integer | Unit price in cents |
| `hsa_fsa_eligible` | boolean | Whether this item is HSA/FSA eligible |
| `is_recurring` | boolean | Whether this line item is a recurring/subscription item |

## 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 |

## Order Lifecycle

An order moves through these states:

* **pending** - Order created, awaiting payment
* **processing** - Payment initiated
* **completed** - Payment captured successfully
* **failed** - Payment declined or failed
* **cancelled** - Order cancelled by customer or merchant
* **refunded** - Completed order was refunded (full or partial)
* **disputed** - Completed order has a chargeback filed

## Status History

Track all status changes:

```json theme={null}
{
  "status_history": [
    {
      "status": "pending",
      "timestamp": "2026-02-25T15:00:00Z",
      "reason": "Order created"
    },
    {
      "status": "processing",
      "timestamp": "2026-02-25T15:01:00Z",
      "reason": "Customer submitted payment"
    },
    {
      "status": "completed",
      "timestamp": "2026-02-25T15:30:00Z",
      "reason": "Payment captured successfully"
    }
  ]
}
```

## Related Endpoints

* [Get Order](/api-reference/endpoint/get-order) - GET /api/v2/orders/{id}
* [List Orders](/api-reference/endpoint/list-orders) - GET /api/v2/orders
* [Refund Order](/api-reference/endpoint/create-refund) - POST /api/v2/refunds


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.