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

# Reference overview

> The Open Rails API is typed, schema-introspectable, and optimized for merchant and agent workflows.

The current public API surface is hosted from the dashboard origin:

```text theme={null}
https://dash.getopenrails.com
```

The hosted checkout surface is separate:

```text theme={null}
https://pay.getopenrails.com
```

## Gateway endpoints

These endpoints are the primary integration surface for merchants.

| Endpoint                                  | Purpose                                                       |
| ----------------------------------------- | ------------------------------------------------------------- |
| `POST /api/gateway/sessions`              | Create a hosted checkout session and receive a `checkoutUrl`. |
| `GET /api/gateway/customers`              | List customers with optional filters.                         |
| `GET /api/gateway/customers/{customerId}` | Fetch a single customer by ID.                                |
| `GET /api/gateway/payments`               | List payments with optional filters.                          |
| `GET /api/gateway/payments/{paymentId}`   | Fetch a single payment by ID or checkout session ID.          |
| `GET /api/gateway/invoices`               | List invoices with optional filters.                          |
| `GET /api/gateway/invoices/{invoiceId}`   | Fetch a single invoice by ID.                                 |

## Agent endpoints

These endpoints are optimized for automated and agent-driven workflows.

| Endpoint                            | Purpose                                                                                   |
| ----------------------------------- | ----------------------------------------------------------------------------------------- |
| `GET /api/agent/capabilities`       | Discover agent-safe entrypoints, actions, schemas, routes, CLI hints, and webhook events. |
| `GET /api/agent/routes`             | List available payment routes, economics, provider health, and KYC policy.                |
| `GET /api/agent/schema/{operation}` | Fetch JSON Schema for an operation before constructing a request.                         |
| `POST /api/agent/actions/{action}`  | Run checkout, fee estimate, and webhook example actions.                                  |

## Action names

* `checkout.preview`
* `checkout.create`
* `fees.estimate`
* `webhook.example`
* `webhook.verify_sample`

## ID prefixes

All resource IDs use stable prefixes so you can identify the type from the ID alone.

| Prefix  | Resource         |
| ------- | ---------------- |
| `cus_*` | Customer         |
| `pay_*` | Payment          |
| `inv_*` | Invoice          |
| `chk_*` | Checkout session |

## List envelope

All list endpoints return a consistent envelope:

```json theme={null}
{
  "object": "list",
  "data": [],
  "hasMore": false
}
```

Use `hasMore` to determine whether additional pages exist. Pass `limit` to control page size.

## Error shape

Errors are parseable and include an action, stable code, human-readable message, and optional field-level issues.

```json theme={null}
{
  "ok": false,
  "action": "checkout.create",
  "error": {
    "code": "invalid_input",
    "message": "Input did not match the action schema.",
    "suggestion": "Fetch /api/agent/schema/checkout.create and retry with the documented shape.",
    "issues": [
      {
        "path": "customer",
        "code": "invalid_format",
        "message": "Invalid email address"
      }
    ]
  }
}
```
