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

# 帳戶與錢包

> 為資金流程選擇所需的客戶名下帳戶或發行資源。

每個帳戶皆歸屬於單一客戶。請從兩個面向來選擇:由誰管理,以及它是錢包還是銀行帳戶。

## 選擇帳戶

| 帳戶     | 用途                                    |
| ------ | ------------------------------------- |
| 發行錢包   | 持有托管的穩定幣餘額、供出金使用、接收入金,或作為發行銀行帳戶的結算目標。 |
| 發行銀行帳戶 | 為客戶提供可重複使用、結算至發行錢包的銀行資料。              |
| 外部錢包   | 記錄客戶擁有的區塊鏈地址。                         |
| 外部銀行帳戶 | 記錄客戶擁有的銀行帳戶,以進行第一方出金。                 |

`issued` 表示 Swipelux 建立並管理該資源。`external` 則記錄客戶擁有的端點。第三方端點應歸類於[收款人與目的地](/zh-Hant/integration/recipients),而不是客戶帳戶清單。

<h2 id="create-the-account">
  建立帳戶
</h2>

使用 [`POST /v3/customers/{customerId}/accounts`](/api-reference/accounts/post-v3-customers-by-customer-id-accounts)。搭配下方任一請求主體傳送以下標頭:

```http theme={null}
X-API-Key: ${SWIPELUX_API_KEY}
Idempotency-Key: account-create-001
Content-Type: application/json
```

<Tabs>
  <Tab title="發行錢包">
    ```json theme={null}
    {
      "origin": "issued",
      "type": "wallet",
      "currency": "USDC",
      "network": "base",
      "label": "Settlement wallet"
    }
    ```
  </Tab>

  <Tab title="發行銀行帳戶">
    ```json theme={null}
    {
      "origin": "issued",
      "type": "bank",
      "method": "ach",
      "country": "US",
      "currency": "USD",
      "settlement": {
        "accountId": "${SETTLEMENT_WALLET_ID}"
      },
      "label": "USD account"
    }
    ```
  </Tab>

  <Tab title="外部錢包">
    ```json theme={null}
    {
      "origin": "external",
      "type": "wallet",
      "currency": "USDC",
      "network": "polygon",
      "details": {
        "address": "0x4997b0a68bebc1b0d80a93567ba7002be92b8b11"
      },
      "label": "Customer Polygon wallet"
    }
    ```
  </Tab>

  <Tab title="外部銀行帳戶">
    ```json theme={null}
    {
      "origin": "external",
      "type": "bank",
      "methods": ["ach", "wire"],
      "country": "US",
      "currency": "USD",
      "details": {
        "routingNumber": "021000021",
        "accountNumber": "123456789",
        "accountType": "checking",
        "bankName": "Example Bank",
        "accountHolderName": "Acme Payments SAS"
      },
      "label": "Customer operating account"
    }
    ```
  </Tab>
</Tabs>

僅使用當前客戶與能力回傳的幣別、網路、方法與帳戶類型。切勿從其他客戶或其他環境複製可用性。

## 等待帳戶可用

從建立回應中儲存 `data.id`、`data.status` 與 `data.openTaskIds`。在報價轉帳或顯示銀行資料前,使用 [`GET /v3/customers/{customerId}/accounts/{accountId}`](/api-reference/accounts/get-v3-customers-by-customer-id-accounts-by-account-id) 讀取最新的帳戶。

僅在帳戶當前狀態允許下一步操作時使用該帳戶。若仍有待辦任務 ID,請依照[能力與任務](/zh-Hant/integration/onboarding/capabilities-and-requirements) 完成。

發行的銀行帳戶在佈建期間可能會回傳 `details: null`。僅在最近一次讀取回傳完整資料後才呈現銀行資料。若 `details.referenceRequired` 為 true,請與銀行資料一起顯示完整的 `details.reference`。

## 明確地保持帳戶角色

對於出金,發行錢包是 `in.accountId` 中的來源。客戶名下的銀行帳戶則為 `destinationId`。對於發行的銀行帳戶,`settlement.accountId` 是接收匹配存款的發行錢包。

接下來,請在[接收資金](/zh-Hant/integration/receive-funds)、[發送資金](/zh-Hant/integration/send-funds) 或[發行銀行帳戶](/zh-Hant/integration/issue-bank-account) 中使用已就緒的帳戶。


## Related topics

- [發行銀行帳戶](/zh-Hant/integration/issue-bank-account.md)
- [錢包架構與出金](/zh-Hant/knowledge-base/compliance/custody-and-wallet-controls.md)
- [整合總覽](/zh-Hant/integration/overview.md)
- [快速入門](/zh-Hant/integration/quickstart.md)
- [客戶](/zh-Hant/integration/onboarding/customers.md)
