> ## 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.

# 收款人與目的地

> 建立第三方收款人以及接收出金的銀行或錢包端點。

當該端點由客戶擁有時,請使用客戶帳戶。當資金由其他個人或企業接收時,請使用收款人與目的地。

收款人記錄「誰」接收資金。目的地記錄他們「在哪裡」接收資金。

## 1. 建立收款人

使用 [`POST /v3/customers/{customerId}/recipients`](/api-reference/recipients/post-v3-customers-by-customer-id-recipients) 建立個人或企業。請傳送以下標頭:

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

```json theme={null}
{
  "type": "individual",
  "relationship": "contractor",
  "firstName": "Jason",
  "lastName": "Swipelux",
  "email": "jason@swipelux.com",
  "phone": "+14155551234",
  "address": {
    "streetLine1": "1 Market Street",
    "city": "San Francisco",
    "state": "CA",
    "postalCode": "94105",
    "country": "US"
  },
  "label": "Jason contractor"
}
```

在建立法幣目的地之前,請一併提供地址。將回傳的收款人 `data.id` 儲存為 `RECIPIENT_ID`,並保留其當前狀態。

## 2. 新增目的地

使用 [`POST /v3/customers/{customerId}/recipients/{recipientId}/destinations`](/api-reference/recipients/post-v3-customers-by-customer-id-recipients-by-recipient-id-destinations) 建立端點。請為此目的地使用新的金鑰:

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

<Tabs>
  <Tab title="銀行目的地">
    ```json theme={null}
    {
      "type": "ach",
      "currency": "USD",
      "details": {
        "routingNumber": "021000021",
        "accountNumber": "123456789",
        "accountType": "checking",
        "bankName": "Example Bank",
        "accountHolderName": "Jason Swipelux",
        "country": "US"
      }
    }
    ```
  </Tab>

  <Tab title="錢包目的地">
    ```json theme={null}
    {
      "type": "wallet",
      "currency": "USDC",
      "ownership": {
        "type": "self_custodied"
      },
      "details": {
        "network": "base",
        "address": "0x1111111111111111111111111111111111111111"
      }
    }
    ```
  </Tab>
</Tabs>

僅在收款人自身控管錢包時才使用 `self_custodied`。若錢包由其他托管方持有,請依照當前 API 參考中的相應變體處理。

將回傳的目的地 `data.id` 儲存為 `DESTINATION_ID`,並保留其當前狀態。

## 3. 等待目的地就緒

於建立報價前,讀取 [`GET /v3/customers/{customerId}/recipients/{recipientId}/destinations/{destinationId}`](/api-reference/recipients/get-v3-customers-by-customer-id-recipients-by-recipient-id-destinations-by-destination-id)。

僅在當前目的地狀態允許出金,且其幣別、方法與網路與預期的資金流動相符時繼續。收款人與目的地的狀態是互相獨立的。

在出金報價中請使用 `dst_` 開頭的目的地 ID。`rcp_` 開頭的收款人 ID 標識擁有者紀錄,不是報價的目的地。

接下來,請將就緒的目的地帶到[發送資金](/zh-Hant/integration/send-funds)。


## Related topics

- [發送資金](/zh-Hant/integration/send-funds.md)
- [上線](/zh-Hant/integration/go-live.md)
- [帳戶與錢包](/zh-Hant/integration/accounts.md)
- [支付方式](/zh-Hant/knowledge-base/compliance/payment-methods.md)
- [常見流程](/zh-Hant/integration/common-flows.md)
