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

> ## Agent Instructions
> Test in the sandbox first: base URL https://api-sandbox.y.uno (Test Mode in the Dashboard). Production is https://api.y.uno (Live Mode).
> Every API request needs the public-api-key and private-secret-key headers. Get them in the Dashboard at https://dashboard.y.uno/developers (Developers > Credentials); sandbox and production keys are different.
> Send an X-Idempotency-Key (a UUID) when creating payments, refunds and cancels, so retries do not create duplicates.
> Start with the Quickstart (https://docs.y.uno/docs/quickstart.md) and the agent guide (https://docs.y.uno/agents.md). To search these docs from a coding agent, connect the docs MCP server at https://docs.y.uno/mcp.

# 获取转移记录

> 说明追踪收款方和 onboarding 转移记录的常见用例和错误代码

## 用例

### 用例 1：验证转移是否完成

创建一次转移并验证其是否成功。

1. **发起转移**

```http theme={"theme":{"light":"github-dark","dark":"github-dark-dimmed"}}
   POST /v1/recipients/A/onboardings/O1/transfer
```

**响应**

```json theme={"theme":{"light":"github-dark","dark":"github-dark-dimmed"}}
{ "id": "T1", ... }
```

2. **检查状态**

```http theme={"theme":{"light":"github-dark","dark":"github-dark-dimmed"}}
   GET /v1/transfers/T1
```

响应：

```json theme={"theme":{"light":"github-dark","dark":"github-dark-dimmed"}}
   {
     "id": "T1",
     "destination_onboarding": { "status": "SUCCEEDED" }
   }
```

3. **结果**：转移成功 ✓

**判断是否成功：**

* 检查 `destination_onboarding.status`
* `SUCCEEDED`：转移成功完成
* `PENDING`：转移仍在进行中
* `FAILED`：转移失败

### 用例 2：显示卖家的转移历史

在 marketplace 的 Dashboard 中显示某个卖家的所有转移记录。

1. **加载卖家资料页面**：`seller_id = "770e8400-..."`
2. **获取转移历史**

```http theme={"theme":{"light":"github-dark","dark":"github-dark-dimmed"}}
GET /v1/recipients/770e8400-.../transfers
```

**响应**

```json theme={"theme":{"light":"github-dark","dark":"github-dark-dimmed"}}
[
  { "id": "T1", "created_at": "2026-01-15T16:59:22Z", ... },
  { "id": "T2", "created_at": "2026-01-10T08:30:00Z", ... }
]
```

3. **在 UI 中显示**

| 日期 | 来源 | 目标 | 状态 |
| - | - | - | - |
| 2026-01-15 | seller-123 | seller-456 | 成功 |
| 2026-01-10 | seller-123 | seller-789 | 成功 |

### 用例 3：审计包含撤回的转移链

追踪一个先被转移、随后又被撤回的 onboarding。

1. **原始转移**：O1 从收款方 A 转移到收款方 B，创建转移 T1
2. **随后撤回**：O1 从收款方 B 转回收款方 A，创建转移 T2（撤回）
3. **审计记录**

```http theme={"theme":{"light":"github-dark","dark":"github-dark-dimmed"}}
GET /v1/onboardings/O1/transfers
```

响应：

```json theme={"theme":{"light":"github-dark","dark":"github-dark-dimmed"}}
[
  {
    "id": "T1",
    "origin_onboarding": { "id": "O1", "recipient": { "id": "A" } },
    "destination_onboarding": { "id": "O2", "recipient": { "id": "B" } },
    "created_at": "2026-01-15T10:00:00Z"
  },
  {
    "id": "T2",
    "origin_onboarding": { "id": "O2", "recipient": { "id": "B" } },
    "destination_onboarding": { "id": "O1", "recipient": { "id": "A" } },
    "created_at": "2026-01-16T11:00:00Z"
  }
]
```

4. **分析**：onboarding 先被转出，随后又被撤回

### 用例 4：支持工单调查

查询一次失败的转移，以确定并解决根本原因。

1. **“转移 T1 失败了，能帮忙看看吗？”**
2. **查询该转移**

```http theme={"theme":{"light":"github-dark","dark":"github-dark-dimmed"}}
GET /v1/transfers/T1
```

**响应**

```json theme={"theme":{"light":"github-dark","dark":"github-dark-dimmed"}}
{
  "id": "T1",
  "origin_onboarding": {
    "id": "O1",
    "status": "TRANSFERRED",
    "recipient": { "id": "A", "email": "seller@example.com" }
  },
  "destination_onboarding": {
    "id": "O2",
    "status": "FAILED",
    "response_message": "Invalid bank account",
    "recipient": { "id": "B", "email": "newseller@example.com" }
  }
}
```

3. **已确定根本原因**：目标方的银行账户无效
4. **处理措施**：请收款方 B 更新银行账户信息

### 用例 5：合规审计

验证某个收款方的所有转移记录。

1. **请求转移报告**

```http theme={"theme":{"light":"github-dark","dark":"github-dark-dimmed"}}
GET /v1/recipients/770e8400-.../transfers
```

2. **系统返回所有转移记录**

```json theme={"theme":{"light":"github-dark","dark":"github-dark-dimmed"}}
[
  { "id": "T1", "created_at": "...", ... },
  { "id": "T2", "created_at": "...", ... },
  { "id": "T3", "created_at": "...", ... }
]
```

3. **导出为 CSV 以留存合规记录**
4. **报告包含**：
   * 转移日期
   * 来源与目标详情
   * 当前状态
   * 服务提供商信息

## 错误代码参考

| 代码 | HTTP 状态 | 描述 |
| :-: | :-: | :-: |
| `TRANSFER_NOT_FOUND` | 404 | 转移记录不存在 |
| `RECIPIENT_NOT_FOUND` | 404 | 收款方不存在 |
| `ONBOARDING_NOT_FOUND` | 404 | onboarding 不存在 |
| `FORBIDDEN` | 403 | 资源属于其他组织 |
| `UNAUTHORIZED` | 401 | 身份验证凭证无效 |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.