# 申请退款

> 为入金通知 Webhook 的交易提交退款请求。

```yaml
openapi: 3.1.0
x-onerway-docs-version: original
x-onerway-spec-key: embedded-finance/refunds/apply-refund
info:
  title: 申请退款
  version: original
  description: 为入金通知 Webhook 的交易提交退款请求。
servers:
  - url: https://sandbox-baas.onerway.com/embedded-finance
    description: sandbox
  - url: https://baas.onerway.com
    description: production
paths:
  /api/v2/refund/apply:
    post:
      summary: 申请退款
      description: 为入金通知 Webhook 的交易提交退款请求。
      parameters:
        - name: apiKey
          in: header
          required: true
          description: 用于访问嵌入式金融 API 的 API key。
          schema:
            type: string
            description: 用于访问嵌入式金融 API 的 API key。
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                rechargeId:
                  type: integer
                  description: 申请退款的充值 ID。
                reasonForReturn:
                  type: string
                  description: 申请退款的原因。
                  enum:
                    - AccountCannotBeIdentified
                    - Other
                  x-enum-descriptions:
                    AccountCannotBeIdentified: 无法识别账户。
                    Other: 其他原因。
              required:
                - rechargeId
                - reasonForReturn
            examples:
              default:
                summary: 申请退款
                value:
                  rechargeId: 12345678
                  reasonForReturn: AccountCannotBeIdentified
      responses:
        "200":
          description: 退款请求成功
          content:
            application/json:
              schema:
                type: object
                properties:
                  respCode:
                    type: string
                    description: Onerway 返回的响应码；`20000` 表示请求成功。
                  respMsg:
                    type: string
                    description: 响应码对应的可读消息。
                  data:
                    type:
                      - object
                      - "null"
                    properties:
                      {}
                    description: 响应数据；成功示例中为 `null`。
                    x-onerway-value:
                      nullable: true
              examples:
                success:
                  summary: 退款请求成功
                  value:
                    respCode: "20000"
                    respMsg: Success
                    data: null
      security:
        - apiKeyAuth:
            []
components:
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      in: header
      name: apiKey
```
