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

# Requests and responses

> Common request headers, JSON shapes, list wrappers, and timestamps.

## Base URL

```text theme={null}
https://api.ionicfi.com
```

API reference paths include `/v1` unless explicitly documented as buyer routes.

## JSON

Authenticated API requests use JSON request bodies.

```http theme={null}
Content-Type: application/json
Authorization: Bearer sk_v1_test_...
```

## Common response fields

Most resource responses include:

| Field         | Meaning                                               |
| ------------- | ----------------------------------------------------- |
| `id`          | Prefixed object ID.                                   |
| `object`      | Resource type string.                                 |
| `merchant_id` | Merchant owner, when the resource is merchant-scoped. |
| `livemode`    | Whether the object belongs to live mode.              |
| `metadata`    | Merchant-defined key-value strings, when supported.   |
| `created_at`  | Unix timestamp in seconds.                            |
| `updated_at`  | Unix timestamp in seconds.                            |

## List responses

Most list responses use a wrapper:

```json theme={null}
{
  "data": [
    {
      "id": "prod_00000000000001",
      "object": "product"
    }
  ],
  "has_more": false
}
```

Some list endpoints use offset pagination only and omit `has_more`. Customer list responses include a `next_cursor` object when cursor data is available.

## Request IDs

Every response includes `X-Request-ID`. You can send this header yourself, or the server generates one.

<CodeGroup>
  ```ts TypeScript theme={null}
  import { Ionic } from "@ionicfi/sdk";

  const ionic = new Ionic({ token: process.env.IONIC_SECRET_KEY });

  const products = await ionic.catalog.products.list(
    {},
    { headers: { "X-Request-ID": "order-sync-1001" } },
  );
  ```

  ```bash curl theme={null}
  curl https://api.ionicfi.com/v1/products \
    -H "Authorization: Bearer sk_v1_test_..." \
    -H "X-Request-ID: order-sync-1001"
  ```
</CodeGroup>

Client-provided IDs are sanitized to `[a-zA-Z0-9_.-]` and capped at 128 characters.
