# 全额提取内推账户余额

通过账户 ID 全额提取内推账户下的积分/现金。全额提现后，内推人在飞书招聘系统中的积分/现金余额会变为 0，对应的积分/现金奖励状态也会变为「已发放」。

## 请求

基本 | &nbsp;
---|---
HTTP URL | https://open.feishu.cn/open-apis/hire/v1/referral_account/:referral_account_id/withdraw
HTTP Method | POST
接口频率限制 | [100 次/分钟](https://open.feishu.cn/document/ukTMukTMukTM/uUzN04SN3QjL1cDN)
支持的应用类型 | Custom App、Store App
权限要求<br>**调用该 API 所需的权限。开启其中任意一项权限即可调用** | 更新内推账号信息(hire:referral_account)

### 请求头

名称 | 类型 | 必填 | 描述
---|---|---|---
Authorization | string | 是 | `tenant_access_token`<br>**值格式**："Bearer `access_token`"<br>**示例值**："Bearer t-7f1bcd13fc57d46bac21793a18e560"<br>[了解更多：如何选择与获取 access token](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-choose-which-type-of-token-to-use)
Content-Type | string | 是 | **固定值**："application/json; charset=utf-8"

### 路径参数

名称 | 类型 | 描述
---|---|---
referral_account_id | string | 账户 ID，通过[注册内推账户](https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/referral_account/create)生成<br>**示例值**："6942778198054125570"

### 请求体

名称 | 类型 | 必填 | 描述
---|---|---|---
withdraw_bonus_type | int\[\] | 是 | 提取的奖励类型<br>**示例值**：[1]<br>**可选值有**：<br>- 1：积分<br>- 2：现金
external_order_id | string | 是 | 外部提取单 ID，由请求方提供，用于保证接口的幂等性，需要保证唯一。传入重复 ID 会返回原 ID 对应的提取详情<br>**示例值**："6942778198054125570"

### 请求体示例
```json
{
    "withdraw_bonus_type": [
        1
    ],
    "external_order_id": "6942778198054125570"
}
```

## 响应

### 响应体

名称 | 类型 | 描述
---|---|---
code | int | 错误码，非 0 表示失败
msg | string | 错误描述
data | \- | \-
external_order_id | string | 提取单 ID
trans_time | string | 交易时间，毫秒时间戳
withdrawal_details | bonus_amount | 提取详情
point_bonus | int | 提取的积分数量
cash_bonus | cash\[\] | 提取的现金奖励
currency_type | string | 币种，详情可查看：[枚举常量介绍](https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/enum)中「币种（currency）枚举定义」
amount | number(float) | 数额，保留到小数点后两位

### 响应体示例
```json
{
    "code": 0,
    "msg": "SUCCESS",
    "data": {
        "external_order_id": "6942778198054125570",
        "trans_time": "1683634459543",
        "withdrawal_details": {
            "point_bonus": 100,
            "cash_bonus": [
                {
                    "currency_type": "CNY",
                    "amount": 100
                }
            ]
        }
    }
}
```

### 错误码

HTTP状态码 | 错误码 | 描述 | 排查建议
---|---|---|---
500 | 1002001 | 系统错误 | 请根据实际报错信息定位或咨询[技术支持](https://applink.feishu.cn/TLJpeNdW)
400 | 1002002 | 参数错误 | 检查参数是否正确，例如类型，大小
400 | 1002553 | 账户不存在 | 请检查入参`referral_account_id `，或[注册内推账户](https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/referral_account/create)
400 | 1002555 | 账户已停用 | 已停用账户无法提取余额，请参考[停用内推账户](https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/referral_account/deactivate)

