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

# Get Checkout Status

> Retrieve the status and order details for a checkout session or payment link

# Get Checkout Status

Universal status polling endpoint for both checkout sessions and payment link flows. Use this when you need to check whether a payment has completed — for example, if a webhook was missed or you want to confirm status on page load.

## Endpoint

```
GET /api/v2/checkout/{checkout_id}
```

The `checkout_id` is the `cs_xxx` value returned when the cart was created.

## Authentication

```bash theme={null}
Authorization: Bearer glm_test_YOUR_API_KEY
```

## Path Parameters

| Parameter     | Type   | Description                |
| :------------ | :----- | :------------------------- |
| `checkout_id` | string | The checkout ID (`cs_xxx`) |

## Response

**Before payment (awaiting customer):**

```json theme={null}
{
  "checkout_id": "cs_abc123",
  "status": "pending",
  "order": null
}
```

**After successful payment:**

```json theme={null}
{
  "checkout_id": "cs_abc123",
  "status": "completed",
  "order": {
    "id": "ord_01ABC...",
    "status": "completed",
    "is_recurring": false,
    "payment_status": "captured",
    "amount": 4995,
    "currency": "usd",
    "payment_link_id": "pl_abc123",
    "client_reference_id": "your-order-123",
    "reference_id": null,
    "customer": {
      "email": "jane@example.com",
      "name": "Jane Doe"
    },
    "line_items": [
      {
        "product_id": "PROD-001",
        "name": "Digital Thermometer",
        "quantity": 1,
        "unit_amount": 4995,
        "amount": 4995,
        "currency": "usd",
        "is_recurring": false
      }
    ],
    "created_at": "2026-03-31T12:00:00Z"
  }
}
```

**After failed payment:**

```json theme={null}
{
  "checkout_id": "cs_abc123",
  "status": "failed",
  "order": {
    "id": "ord_01DEF...",
    "status": "failed",
    "is_recurring": false,
    "payment_status": "failed",
    "amount": 4995,
    "currency": "usd",
    "customer": {
      "email": "jane@example.com",
      "name": "Jane Doe"
    },
    "created_at": "2026-03-31T12:01:00Z"
  }
}
```

## Status Values

| Status      | Description                           |
| :---------- | :------------------------------------ |
| `pending`   | Cart exists, no payment attempted yet |
| `completed` | Payment captured successfully         |
| `failed`    | Payment failed or declined            |

## Example

```bash theme={null}
curl https://api.withgale.com/api/v2/checkout/cs_abc123 \
  -H "Authorization: Bearer glm_test_YOUR_API_KEY"
```

## Errors

| Status Code | Error Code     | Description           |
| :---------- | :------------- | :-------------------- |
| 401         | `unauthorized` | Invalid API key       |
| 404         | `not_found`    | Checkout ID not found |

## Related

* [Webhooks](/developer-manual/webhooks)
* [Order Object](/api-reference/objects/order)
* [Create Checkout Session](/api-reference/endpoint/create-checkout-v2)
