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

# Code Companion

> Give Claude Code, Cursor, Codex, and other AI coding tools direct access to Ziina's API documentation so they build against real schemas

AI coding tools write better integrations when they can read your documentation instead of recalling it. Ziina publishes these docs in formats built for exactly that: every page as plain Markdown, an index of the whole site, and the OpenAPI specs behind the API itself. Hand your agent those URLs once and it can look up an endpoint, a field name, or a scope at the moment it needs one.

## Set up your agent

The block below works in any tool that reads project rules — Claude Code, Cursor, Codex, Aider, Cline, and others. Paste it directly into a chat, or save it in `CLAUDE.md`, `.cursor/rules/`, or `AGENTS.md` so it applies to every session:

```markdown expandable theme={null}
You have access to Ziina's developer docs - the authoritative source for the
Ziina payments API (payment intents, transfers, refunds, webhooks, OAuth 2.0).
Always consult these before writing Ziina code:

- Index:      https://docs.ziina.com/llms.txt
- Full text:  https://docs.ziina.com/llms-full.txt
- Per-page:   append `.md` to any https://docs.ziina.com/... URL
- OpenAPI:    https://docs.ziina.com/api-reference/payment-service-openapi.json
              https://docs.ziina.com/api-reference/account-manager-openapi.json

Resource API base URL: https://api-v2.ziina.com/api
Auth: `Authorization: Bearer <access token>`

OAuth 2.0 runs on a separate host: https://auth.ziina.com
- Authorize:     GET  /oidc/auth
- Token/refresh: POST /oidc/token  (Basic auth, not Bearer)

Endpoint reference lives under `/api-reference/{payment-intent,transfer,refund,
webhook,account}`. OAuth 2.0 flow and scopes are at `/developers/oauth-2.0`.
Test cards are at `/test-cards`. Currency list is at `/supported-currencies`.

Rules:
1. Before recommending an endpoint, request/response field, status value,
   OAuth scope, or currency code, fetch the relevant doc or OpenAPI spec
   and verify. The OpenAPI specs are the source of truth for field names,
   required fields, and enums.
2. Never invent fields, status values, or scopes. If the docs don't cover
   it, say so and ask.
3. API keys from the business connect page carry every scope. OAuth 2.0
   tokens carry only what was granted, so check the scope an endpoint needs
   (`write_payment_intents`, `write_refunds`, `write_transfers`,
   `write_webhooks`, `read_account`) before writing the call.
4. Use `test: true` on endpoints whose schema declares it, along with the
   documented test cards. There is no separate sandbox host - test and live
   traffic share the same base URL and differ only by that flag.
5. Ask which integration approach is wanted before writing code: embedded
   checkout in an iframe (`embedded_url`), a hosted payment page
   (`redirect_url`), or OAuth 2.0 to act on a user's behalf. The choice
   changes the implementation, so confirm it rather than assuming.

Smoke test: fetch llms.txt, then tell me the minimum amount for a Ziina
payment. (Answer: 2 AED.)
```

Tool-specific file locations are covered under [Editor setup](#editor-setup) below.

## Machine-readable formats

Add `.md` to the end of any documentation URL to get that page as Markdown. Four types of entry points are available:

| URL                                                                 | Contents                                                                           |
| :------------------------------------------------------------------ | :--------------------------------------------------------------------------------- |
| `https://docs.ziina.com/llms.txt`                                   | An index of every page with its URL and a one-line summary                         |
| `https://docs.ziina.com/llms-full.txt`                              | The complete text of the documentation in a single file                            |
| `https://docs.ziina.com/developers/oauth-2.0.md`                    | Any individual page, as Markdown                                                   |
| `https://docs.ziina.com/api-reference/payment-service-openapi.json` | Request and response schemas for payment intents, transfers, refunds, and webhooks |

## Editor setup

Each tab below is self-contained — copy the one that matches your editor.

<Tabs>
  <Tab title="Cursor">
    Create `.cursor/rules/ziina.mdc` in your repo, or add the same content to
    your user-level rules to apply it across every project:

    ```markdown expandable theme={null}
    ---
    description: Ziina API docs
    alwaysApply: true
    ---

    Authoritative sources for the Ziina payments API (payment intents,
    transfers, refunds, webhooks, OAuth 2.0):

    - Index:      https://docs.ziina.com/llms.txt
    - Full text:  https://docs.ziina.com/llms-full.txt
    - Per-page:   append `.md` to any https://docs.ziina.com/... URL
    - OpenAPI:    https://docs.ziina.com/api-reference/payment-service-openapi.json
                  https://docs.ziina.com/api-reference/account-manager-openapi.json

    Resource API base URL: https://api-v2.ziina.com/api
    Auth: `Authorization: Bearer <access token>`

    OAuth 2.0 runs on a separate host: https://auth.ziina.com
    - Authorize:     GET  /oidc/auth
    - Token/refresh: POST /oidc/token  (Basic auth, not Bearer)

    Endpoint reference lives under `/api-reference/{payment-intent,transfer,
    refund,webhook,account}`. OAuth 2.0 flow and scopes are at
    `/developers/oauth-2.0`. Test cards are at `/test-cards`. Currency list
    is at `/supported-currencies`.

    Rules:
    1. Before recommending an endpoint, request/response field, status value,
       OAuth scope, or currency code, fetch the relevant doc or OpenAPI spec
       and verify. The OpenAPI specs are the source of truth for field names,
       required fields, and enums.
    2. Never invent fields, status values, or scopes. If the docs don't cover
       it, say so and ask.
    3. API keys from the business connect page carry every scope. OAuth 2.0
       tokens carry only what was granted, so check the scope an endpoint
       needs (`write_payment_intents`, `write_refunds`, `write_transfers`,
       `write_webhooks`, `read_account`) before writing the call.
    4. Use `test: true` on endpoints whose schema declares it, along with the
       documented test cards. There is no separate sandbox host - test and
       live traffic share the same base URL and differ only by that flag.
    5. Ask which integration approach is wanted before writing code: embedded
       checkout in an iframe (`embedded_url`), a hosted payment page
       (`redirect_url`), or OAuth 2.0 to act on a user's behalf. The choice
       changes the implementation, so confirm it rather than assuming.
    ```
  </Tab>

  <Tab title="Claude Code">
    Add the following to `CLAUDE.md` at your repo root:

    ```markdown expandable theme={null}
    ## Ziina API

    Authoritative sources for the Ziina payments API (payment intents,
    transfers, refunds, webhooks, OAuth 2.0):

    - Index:      https://docs.ziina.com/llms.txt
    - Full text:  https://docs.ziina.com/llms-full.txt
    - Per-page:   append `.md` to any https://docs.ziina.com/... URL
    - OpenAPI:    https://docs.ziina.com/api-reference/payment-service-openapi.json
                  https://docs.ziina.com/api-reference/account-manager-openapi.json

    Resource API base URL: https://api-v2.ziina.com/api
    Auth: `Authorization: Bearer <access token>`

    OAuth 2.0 runs on a separate host: https://auth.ziina.com
    - Authorize:     GET  /oidc/auth
    - Token/refresh: POST /oidc/token  (Basic auth, not Bearer)

    Endpoint reference lives under `/api-reference/{payment-intent,transfer,
    refund,webhook,account}`. OAuth 2.0 flow and scopes are at
    `/developers/oauth-2.0`. Test cards are at `/test-cards`. Currency list
    is at `/supported-currencies`.

    Rules:
    1. Before recommending an endpoint, request/response field, status value,
       OAuth scope, or currency code, fetch the relevant doc or OpenAPI spec
       and verify. The OpenAPI specs are the source of truth for field names,
       required fields, and enums.
    2. Never invent fields, status values, or scopes. If the docs don't cover
       it, say so and ask.
    3. API keys from the business connect page carry every scope. OAuth 2.0
       tokens carry only what was granted, so check the scope an endpoint
       needs (`write_payment_intents`, `write_refunds`, `write_transfers`,
       `write_webhooks`, `read_account`) before writing the call.
    4. Use `test: true` on endpoints whose schema declares it, along with the
       documented test cards. There is no separate sandbox host - test and
       live traffic share the same base URL and differ only by that flag.
    5. Ask which integration approach is wanted before writing code: embedded
       checkout in an iframe (`embedded_url`), a hosted payment page
       (`redirect_url`), or OAuth 2.0 to act on a user's behalf. The choice
       changes the implementation, so confirm it rather than assuming.
    ```

    To give Claude Code searchable access to these docs rather than plain URLs,
    also register the documentation server:

    ```bash theme={null}
    claude mcp add --transport http ziina-docs https://docs.ziina.com/mcp
    ```
  </Tab>

  <Tab title="Codex">
    Codex reads `AGENTS.md` files. Put this in `~/.codex/AGENTS.md` to apply it
    to every project on your machine:

    ```markdown expandable theme={null}
    ## Ziina API

    Authoritative sources for the Ziina payments API (payment intents,
    transfers, refunds, webhooks, OAuth 2.0):

    - Index:      https://docs.ziina.com/llms.txt
    - Full text:  https://docs.ziina.com/llms-full.txt
    - Per-page:   append `.md` to any https://docs.ziina.com/... URL
    - OpenAPI:    https://docs.ziina.com/api-reference/payment-service-openapi.json
                  https://docs.ziina.com/api-reference/account-manager-openapi.json

    Resource API base URL: https://api-v2.ziina.com/api
    Auth: `Authorization: Bearer <access token>`

    OAuth 2.0 runs on a separate host: https://auth.ziina.com
    - Authorize:     GET  /oidc/auth
    - Token/refresh: POST /oidc/token  (Basic auth, not Bearer)

    Endpoint reference lives under `/api-reference/{payment-intent,transfer,
    refund,webhook,account}`. OAuth 2.0 flow and scopes are at
    `/developers/oauth-2.0`. Test cards are at `/test-cards`. Currency list
    is at `/supported-currencies`.

    Rules:
    1. Before recommending an endpoint, request/response field, status value,
       OAuth scope, or currency code, fetch the relevant doc or OpenAPI spec
       and verify. The OpenAPI specs are the source of truth for field names,
       required fields, and enums.
    2. Never invent fields, status values, or scopes. If the docs don't cover
       it, say so and ask.
    3. API keys from the business connect page carry every scope. OAuth 2.0
       tokens carry only what was granted, so check the scope an endpoint
       needs (`write_payment_intents`, `write_refunds`, `write_transfers`,
       `write_webhooks`, `read_account`) before writing the call.
    4. Use `test: true` on endpoints whose schema declares it, along with the
       documented test cards. There is no separate sandbox host - test and
       live traffic share the same base URL and differ only by that flag.
    5. Ask which integration approach is wanted before writing code: embedded
       checkout in an iframe (`embedded_url`), a hosted payment page
       (`redirect_url`), or OAuth 2.0 to act on a user's behalf. The choice
       changes the implementation, so confirm it rather than assuming.
    ```

    For rules your whole team shares, put the same content in `AGENTS.md` at the
    repo root instead. Codex reads every `AGENTS.md` from the repo root down to
    your working directory, so in a monorepo you can scope it to just the service
    that talks to Ziina.
  </Tab>

  <Tab title="AGENTS.md">
    Append the following to `AGENTS.md` at your repo root, which Aider, Jules,
    and other tools following the convention will read:

    ```markdown expandable theme={null}
    ## Ziina payments

    Authoritative sources for the Ziina payments API (payment intents,
    transfers, refunds, webhooks, OAuth 2.0):

    - Index:      https://docs.ziina.com/llms.txt
    - Full text:  https://docs.ziina.com/llms-full.txt
    - Per-page:   append `.md` to any https://docs.ziina.com/... URL
    - OpenAPI:    https://docs.ziina.com/api-reference/payment-service-openapi.json
                  https://docs.ziina.com/api-reference/account-manager-openapi.json

    Resource API base URL: https://api-v2.ziina.com/api
    Auth: `Authorization: Bearer <access token>`

    OAuth 2.0 runs on a separate host: https://auth.ziina.com
    - Authorize:     GET  /oidc/auth
    - Token/refresh: POST /oidc/token  (Basic auth, not Bearer)

    Endpoint reference lives under `/api-reference/{payment-intent,transfer,
    refund,webhook,account}`. OAuth 2.0 flow and scopes are at
    `/developers/oauth-2.0`. Test cards are at `/test-cards`. Currency list
    is at `/supported-currencies`.

    Rules:
    1. Before recommending an endpoint, request/response field, status value,
       OAuth scope, or currency code, fetch the relevant doc or OpenAPI spec
       and verify. The OpenAPI specs are the source of truth for field names,
       required fields, and enums.
    2. Never invent fields, status values, or scopes. If the docs don't cover
       it, say so and ask.
    3. API keys from the business connect page carry every scope. OAuth 2.0
       tokens carry only what was granted, so check the scope an endpoint
       needs (`write_payment_intents`, `write_refunds`, `write_transfers`,
       `write_webhooks`, `read_account`) before writing the call.
    4. Use `test: true` on endpoints whose schema declares it, along with the
       documented test cards. There is no separate sandbox host - test and
       live traffic share the same base URL and differ only by that flag.
    5. Ask which integration approach is wanted before writing code: embedded
       checkout in an iframe (`embedded_url`), a hosted payment page
       (`redirect_url`), or OAuth 2.0 to act on a user's behalf. The choice
       changes the implementation, so confirm it rather than assuming.
    ```
  </Tab>
</Tabs>

Using a tool that isn't listed? Paste the block from
[Set up your agent](#set-up-your-agent) directly into the conversation — it
carries the same sources and rules.

## Testing

To confirm your agent is reading the documentation rather than relying on memory, ask it:

> "Fetch [https://docs.ziina.com/llms.txt](https://docs.ziina.com/llms.txt) and tell me the minimum amount for a Ziina payment."

The correct answer is **2 AED**, which appears on the [Payment Intent](/api-reference/payment-intent/index) page. An agent that reaches for the docs will find it. One that isn't wired up will approximate, or reason its way to a plausible-sounding number from the currency page instead.

## Docs MCP

Rules give your agent a list of URLs to fetch. The documentation server goes further and exposes search and retrieval as tools it can call directly, which tends to be quicker and uses less context than pulling down whole pages.

<CodeGroup>
  ```json Cursor theme={null}
  {
    "mcpServers": {
      "ziina-docs": {
        "url": "https://docs.ziina.com/mcp"
      }
    }
  }
  ```

  ```bash Claude Code theme={null}
  claude mcp add --transport http ziina-docs https://docs.ziina.com/mcp
  ```
</CodeGroup>

In Cursor, put that entry in `~/.cursor/mcp.json` to enable it everywhere, or `.cursor/mcp.json` to scope it to a single repo. The endpoint speaks streamable HTTP and works with any MCP client.

Three tools are available: `search_ziina` searches across these docs, `query_docs_filesystem_ziina` browses pages as a read-only filesystem, and `submit_feedback` reports a page that's wrong or unclear. Everything is scoped to published content on this site — the server has no access to your Ziina account, cannot move money, and cannot read authenticated data.

<Warning>
  There is no separate sandbox host. Test and live traffic share
  `https://api-v2.ziina.com/api`, separated only by the
  [`test` parameter](/api-reference/payment-intent/create#body-test) — an agent
  that omits it will move real money. Set the flag in your development config
  and use our [test cards](/test-cards).
</Warning>

## Next steps

<CardGroup>
  <Card title="Custom integration" icon="link" href="/developers/custom-integration">
    Get an access token and make your first API call
  </Card>

  <Card title="OAuth 2.0" icon="code" href="/developers/oauth-2.0">
    Scopes and the full authorization flow
  </Card>

  <Card title="API Reference" icon="book" href="/api-reference/introduction">
    Every endpoint, with schemas
  </Card>

  <Card title="Test cards" icon="credit-card" href="/test-cards">
    Card numbers for testing your integration
  </Card>
</CardGroup>

## Need help?

If you have questions, visit our [help center](https://ziina.com/help-center) or contact us at [support@ziina.com](mailto:support@ziina.com).
