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

# 请求报销审批

`requestReimbursement`

提交经理审批请求，通过在同一账户下的消费账户之间划转资金来为用户报销。获批后，Fluz 将处理该笔报销。

## Scopes

| Action | Scope                   |
| ------ | ----------------------- |
| 创建请求   | `REQUEST_REIMBURSEMENT` |
| 列出请求   | `LIST_APPROVALS`        |
| 批准或拒绝  | `MANAGE_APPROVALS`      |

## Webhook 标识符

| Field          | Value    |
| -------------- | -------- |
| `approvalType` | `PAYOUT` |
| `approvalCode` | `500401` |

Webhook 事件：在执行失败时会触发 `APPROVAL_CREATE`、`APPROVAL_APPROVE`、`APPROVAL_DECLINE` 和 `APPROVAL_HANDLER_ERROR`。

## 创建请求

### RequestReimbursementInput

| Field                          | Type   | Required | Description         |
| ------------------------------ | ------ | -------- | ------------------- |
| `amount`                       | Float  | Yes      | 报销金额。必须大于零          |
| `sourceUserCashBalanceId`      | UUID   | Yes      | 提款的消费账户（通常为公司或共享余额） |
| `destinationUserCashBalanceId` | UUID   | Yes      | 入账的消费账户（通常为请求人余额）   |
| `memo`                         | String | No       | 交易备注                |
| `categoryId`                   | UUID   | No       | 交易类别 ID             |

来源和目标必须是不同的消费账户。

### 示例 Mutation

```graphql theme={null}
mutation {
  requestReimbursement(
    input: {
      amount: 75.00
      sourceUserCashBalanceId: "6d1b4b19-deef-42f5-80d7-ec34804ce090"
      destinationUserCashBalanceId: "bb584e49-d030-4a6e-a5a9-1c34368cbaed"
      memo: "Client dinner reimbursement"
    }
  ) {
    success
    messageId
    error {
      code
      message
    }
  }
}
```

### 示例响应

```json theme={null}
{
  "data": {
    "requestReimbursement": {
      "success": true,
      "messageId": "1234567890"
    }
  }
}
```

## 批准请求

使用 `approvalId` 调用 `approveApprovalRequest`。需要 `MANAGE_APPROVALS`。

```graphql theme={null}
mutation {
  approveApprovalRequest(approvalId: "07df5653-43a8-4532-9881-3ab5857bbe12") {
    success
    approvalId
    action
  }
}
```

批准后，Fluz 将处理该笔报销转账。

## 拒绝请求

使用 `approvalId` 调用 `declineApprovalRequest`。需要 `MANAGE_APPROVALS`。

```graphql theme={null}
mutation {
  declineApprovalRequest(approvalId: "07df5653-43a8-4532-9881-3ab5857bbe12") {
    success
    approvalId
    action
  }
}
```

当请求被拒绝时，不会处理任何报销。
