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

# Introduction

> Public APIs for the FlexyPe checkout system: session creation, OTP-based authentication, and checkout flow.

The FlexyPe Checkout API lets you create checkout sessions, authenticate customers with phone-based OTP, and drive the checkout flow end to end. All endpoints accept and return JSON.

## Base URL

All API requests are made to:

```
https://api.flexype.io
```

## Authentication

Endpoints are authenticated with an API key sent as a bearer token in the `Authorization` header:

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

### API key management

<Steps>
  <Step title="Access API Keys">
    In the dashboard, navigate to **Settings → API Keys** to manage your keys.

    <Card title="Manage API keys" icon="key" href="dashboard.flexype.io/dashboard/settings/api-keys">
      Create, view, and revoke API keys for your store.
    </Card>
  </Step>

  <Step title="Generate a new key">
    Click **Generate API Key**, provide a name, and click **Generate**.
  </Step>

  <Step title="Store your key securely">
    The secret is shown **only once**. Copy it and store it somewhere secure — once you leave the page, the secret is no longer visible and you'll need to generate a new key.
  </Step>

  <Step title="Authenticate your API requests">
    Send the key as a bearer token on every request:

    ```bash theme={null}
    curl https://api.flexype.io/session/{sessionId} \
      -H "Authorization: Bearer YOUR_API_KEY"
    ```
  </Step>
</Steps>

<Warning>
  Never expose your secret API keys in client-side code or public repositories. Treat them like passwords.
</Warning>

## Rate limits

The API allows **100 requests per minute**. Requests without valid authentication headers are rate limited **by IP address**.

When you exceed a limit, the API responds with HTTP `429 Too Many Requests`. Back off and retry after a short delay.

## Response format

Every response wraps its result in a consistent envelope.

<CodeGroup>
  ```json Success theme={null}
  {
    "status": "SUCCESS",
    "data": { }
  }
  ```

  ```json Error theme={null}
  {
    "status": "FAILURE",
    "error": {
      "code": "error.invalid-request",
      "message": "Human-readable error message"
    }
  }
  ```
</CodeGroup>
