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

# 发起退款

> 收银台退款接口 V2 版本，支持原路退、指定退等多种退款方式。

## 概述

本页说明 `POST /payment/open/institution/v2/standard/order/refund` 接口。完整的请求参数、响应结构与示例由上方关联的 OpenAPI 定义渲染。

## 说明

* 认证方式使用 GatePay 标准签名请求头。
* 本页展示同一接口的机构路径版本。
* 除创建子账户、查询子账户详情、分页查询子账户外，机构侧请求需携带 `X-GatePay-On-Behalf-Of`。
* `refundRequestId` 是商户侧退款请求唯一标识，查询退款详情时请使用该字段。
* `refundBearType` 按数值枚举传入。
* 商户后台手工发起的退款进度以后台展示为准，不应与 API 回调行为混为一谈。
* 对退款实现，建议同时保存 `refundRequestId`、原订单业务标识与查询结果，方便后续对账。
* 通用签名规则请参见 [/api-reference/version/100/cn/common/securityAndSignature](/api-reference/version/100/cn/common/securityAndSignature)。


## OpenAPI

````yaml api-reference/version/100/cn/openapi/institution/checkout-payment-openapi.json POST /payment/open/institution/v2/standard/order/refund
openapi: 3.1.0
info:
  title: GatePay 机构收银台支付 API
  description: Gate Pay 收银台支付 API，用于收银台下单、退款及订单查询。
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://openplatform.gateapi.io
security: []
paths:
  /payment/open/institution/v2/standard/order/refund:
    post:
      summary: 发起退款
      description: 收银台退款接口 V2 版本，支持原路退、指定退等多种退款方式。
      parameters:
        - $ref: '#/components/parameters/X-GatePay-Certificate-ClientId'
        - $ref: '#/components/parameters/X-GatePay-Signature'
        - $ref: '#/components/parameters/X-GatePay-Timestamp'
        - $ref: '#/components/parameters/X-GatePay-Nonce'
        - $ref: '#/components/parameters/X-GatePay-On-Behalf-Of'
      requestBody:
        description: 发起退款 请求参数
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CheckoutRefundV2Request'
            examples:
              basicExample:
                summary: 基础示例
                value:
                  prepayId: '35214673103159414'
                  refundRequestId: '202508271923022'
                  refundStyle: 2
                  refundToGateUid: '10002'
                  refundAmount: '0.018'
                  refundCurrency: USDT
                  refundPayChannel: 1
                  refundReason: bourne-test
                  refundBearType: 1
        required: true
      responses:
        '200':
          description: 退款成功
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CheckoutRefundV2Response'
              examples:
                successResponse:
                  summary: 成功响应
                  value:
                    code: '000000'
                    data:
                      refundRequestId: '202508271923022'
                      refundGateId: '1991045981847818240'
                      prepayId: '35214673103159414'
                      orderAmount: '10'
                      refundAmount: '0.018'
                      errMsg: ''
                      orderCurrency: USDT
                      payCurrency: USDT
                      payAmount: '0.018'
                    status: SUCCESS
                    errorMessage: ''
components:
  parameters:
    X-GatePay-Certificate-ClientId:
      name: X-GatePay-Certificate-ClientId
      in: header
      required: true
      description: 商户客户端ID
      schema:
        type: string
        example: mZ96D37oKk-HrWJc
    X-GatePay-Signature:
      name: X-GatePay-Signature
      in: header
      required: true
      description: 签名
      schema:
        type: string
    X-GatePay-Timestamp:
      name: X-GatePay-Timestamp
      in: header
      required: true
      description: 时间戳（毫秒）
      schema:
        type: string
        example: '1695611256106'
    X-GatePay-Nonce:
      name: X-GatePay-Nonce
      in: header
      required: true
      description: 随机数
      schema:
        type: string
        example: '1260554069'
    X-GatePay-On-Behalf-Of:
      name: X-GatePay-On-Behalf-Of
      in: header
      required: true
      schema:
        type: string
      description: >-
        必填代理归属请求头。请填写本次请求的发起方账户 ID；在机构代理商户 API 中通常填写目标子账户 ID，在机构代扣与划转接口中可填写机构账户
        ID 或子账户 ID。
  schemas:
    CheckoutRefundV2Request:
      type: object
      required:
        - refundRequestId
        - prepayId
        - refundAmount
        - refundReason
      properties:
        refundRequestId:
          type: string
          description: 商户退款ID
          example: '202508271923022'
        prepayId:
          type: string
          description: 订单ID
          example: '35214673103159414'
        refundAmount:
          type: string
          description: 退款金额
          example: '0.018'
        refundReason:
          type: string
          description: 退款原因
          example: bourne-test
        refundStyle:
          type: integer
          format: int64
          description: 退款方式 1:原路退 2:指定退
        refundPayChannel:
          type: integer
          format: int64
          description: 退款支付方式 1:Gate 2:Web3
        refundToGateUid:
          type: string
          description: 退款至用户id
          example: '10002'
        refundAddress:
          type: string
          description: 退款地址
        refundChain:
          type: string
          description: 退款网络
        refundBearType:
          type: integer
          description: 退款承担类型 1:需商家承担 2:需用户承担
          format: int64
        memo:
          type: string
          description: 退款备注
        needNotify:
          type: boolean
          description: 是否需要触发退款结果通知；true 表示按商户配置的回调地址发送通知
        refundLimit:
          type: boolean
          description: 退款是否限制次数
        refundCurrency:
          type: string
          description: 退款币种
          example: USDT
        refundFundStatementId:
          type: integer
          format: int64
          description: 发起退款的流水id
        refundSource:
          type: integer
          format: int64
          description: 退款发起的源头 0:订单 1:流水
        refundGateId:
          type: string
          description: 已有退款单ID，用于补充退款
        refundAmountTypeFull:
          type: integer
          description: 退款金额类型：1=全额，0=部分
        emailCode:
          type: string
          description: 邮箱验证码
        fundPass:
          type: string
          description: 资金密码
        smsCode:
          type: string
          description: 短信验证码
        totpCode:
          type: string
          description: TOTP验证码
        adjustOrderId:
          type: integer
          format: int64
          description: 调整订单ID
        opUserId:
          type: string
          description: 操作用户ID
    CheckoutRefundV2Response:
      type: object
      properties:
        status:
          type: string
          description: 响应状态
          example: SUCCESS
        code:
          type: string
          description: 响应码
          example: '000000'
        errorMessage:
          type: string
          description: 错误信息
          example: ''
        data:
          $ref: '#/components/schemas/CheckoutRefundV2Data'
    CheckoutRefundV2Data:
      type: object
      properties:
        refundRequestId:
          type: string
          description: 商户退款请求Id
          example: '202508271923022'
        prepayId:
          type: string
          description: 订单Id
          example: '35214673103159414'
        refundGateId:
          type: string
          description: Gatepay退款单Id
          example: '1991045981847818240'
        orderAmount:
          type: string
          description: 订单金额
          example: '10'
        refundAmount:
          type: string
          description: 退款金额
          example: '0.018'
        errMsg:
          type: string
          description: 错误信息
          example: ''
        orderCurrency:
          type: string
          description: 订单币种
          example: USDT
        payCurrency:
          type: string
          description: 退款币种
          example: USDT
        payAmount:
          type: string
          description: 商家支付金额
          example: '0.018'

````