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

# API 概覽

> 端點、請求格式，以及如何閱讀 Fluz GraphQL API 的回應。

Fluz API 在每個環境中皆為單一 GraphQL 端點。本頁為[GraphQL API 的運作方式](/concepts/graphql)之參考補充。

## 瀏覽參考文件

<CardGroup cols={2}>
  <Card title="查詢（Queries）" icon="search" href="/api-reference/queries/approval-requests">
    讀取操作 — 取得錢包、交易、商家、卡片優惠與帳戶資料。
  </Card>

  <Card title="變更（Mutations）" icon="square-pen" href="/api-reference/mutations/add-authorized-user">
    寫入操作 — 核發卡片、移轉資金、註冊使用者與企業，以及管理核准流程。
  </Card>
</CardGroup>

### 型別

<CardGroup cols={3}>
  <Card title="物件（Objects）" icon="box" href="/api-reference/types/account">
    查詢與變更所回傳的回應結構。
  </Card>

  <Card title="輸入物件（Input objects）" icon="text-cursor-input" href="/api-reference/types/add-bank-card-input">
    傳遞給操作的引數。
  </Card>

  <Card title="列舉（Enums）" icon="list-ordered" href="/api-reference/types/account-type">
    固定的一組允許值，例如狀態與卡片網路。
  </Card>

  <Card title="聯合（Unions）" icon="combine" href="/api-reference/types/stock-info-type">
    會解析為多個物件型別之一的欄位。
  </Card>

  <Card title="介面（Interfaces）" icon="plug" href="/api-reference/types/basic-user-cash-balance">
    由多個物件實作的共享欄位契約。
  </Card>

  <Card title="純量（Scalars）" icon="hash" href="/api-reference/types/date-time">
    基本值，例如 DateTime 與 UUID。
  </Card>
</CardGroup>

### 慣例

<CardGroup cols={2}>
  <Card title="驗證" icon="key" href="/api-reference/authentication">
    Authorization 標頭、權杖端點，以及 OAuth 授權重新導向。
  </Card>

  <Card title="錯誤" icon="triangle-alert" href="/api-reference/errors">
    錯誤包裝、網域代碼前綴，以及重試指引。
  </Card>

  <Card title="速率限制" icon="gauge" href="/api-reference/rate-limits">
    依表面（surface）的請求限制與 429 的樣貌。
  </Card>

  <Card title="分頁" icon="chevrons-right" href="/api-reference/pagination">
    偏移量輸入、頁面大小上限，以及連線式回應。
  </Card>
</CardGroup>

<Card title="REST 端點" icon="route" horizontal href="/api-reference/rest/upload-sole-proprietorship-document">
  有一個操作在 GraphQL 之外 — 用於獨資業者註冊的檔案上傳。
</Card>

## 端點

| 環境      | GraphQL 端點                                                       |
| ------- | ---------------------------------------------------------------- |
| Staging | `https://transactional-graph.staging.fluzapp.com/api/v1/graphql` |
| Live    | `https://transactional-graph.fluzapp.com/api/v1/graphql`         |

存取權杖會透過相同端點的 `generateUserAccessToken` 變更產生，並以你的 API Key 授權 — 參見[驗證](/api-reference/authentication)。

## 標頭

| 標頭              | 必填 | 說明                                                                         |
| --------------- | -- | -------------------------------------------------------------------------- |
| `Authorization` | 是  | `Bearer <access_token>`（呼叫 `generateUserAccessToken` 時為 `Basic <API_KEY>`） |
| `Content-Type`  | 是  | `application/json`                                                         |

## 回應包裝

```json theme={null}
{
  "data": { ... },
  "errors": [ ... ]
}
```

* `data` — 成功的載荷（發生錯誤時可能為部分資料）。
* `errors` — 失敗陣列，每個項目包含 `code`、`message` 和 `path`。

## 綱要（Schema）

Staging 開放內省，因此你可以直接將工具（Apollo Studio、GraphiQL、codegen）指向該環境。在 live 中，請向你的帳戶團隊索取目前的 SDL。
