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

# 地址支付直付订单退款

> 对直付地址支付单发起退款

## 概述

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

对直付地址支付单发起退款，只支持直付地址支付单。

## 说明

* 认证方式使用 GatePay 标准签名请求头。
* 本页展示同一接口的机构路径版本。
* 除创建子账户、查询子账户详情、分页查询子账户外，机构侧请求需携带 `X-GatePay-On-Behalf-Of`。
* 商户退款请求号字段为 `refundRequestId`（不要使用已废弃的 `refundGateId`）。
* 响应为标准 `status` / `code` / `errorMessage` / `data` 包装，业务字段在 `data` 内。
* 通用签名规则请参见 [/api-reference/version/100/cn/common/securityAndSignature](/api-reference/version/100/cn/common/securityAndSignature)。


## OpenAPI

````yaml api-reference/version/100/cn/openapi/institution/address-payment-openapi.json POST /payment/open/institution/v1/pay/address/refund
openapi: 3.0.1
info:
  title: GatePay 地址支付 API
  version: 1.0.0
  description: GatePay 地址支付接口（中文描述）
servers:
  - url: https://openplatform.gateapi.io
security: []
paths:
  /payment/open/institution/v1/pay/address/refund:
    post:
      summary: 直付订单退款
      description: 对直付地址支付单发起退款
      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:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RefundRequest'
            example:
              refundRequestId: '483902480932841787'
              prepayId: '1665553233227833'
              refundAmount: '20'
              refundReason: test refund function
              receiverId: 598816
      responses:
        '200':
          description: 成功响应
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RefundResponse'
              example:
                status: SUCCESS
                code: '000000'
                errorMessage: ''
                data:
                  refundRequestId: '483902480932841787'
                  prepayId: '1665553233227833'
                  orderAmount: '14.9'
                  refundAmount: '4.9'
components:
  parameters:
    X-GatePay-Certificate-ClientId:
      name: X-GatePay-Certificate-ClientId
      in: header
      required: true
      description: 商户客户端ID
      schema:
        type: string
        example: 4186d0c6-6a35-55a9-8dc6-5312769dbff8
    X-GatePay-Signature:
      name: X-GatePay-Signature
      in: header
      required: true
      description: 签名
      schema:
        type: string
        example: 672d5650dcc9bb22ebf25fa16c28d03c0e159d742a9176d4340a5da326d75dc8
    X-GatePay-Timestamp:
      name: X-GatePay-Timestamp
      in: header
      required: true
      description: 毫秒级时间戳，与服务端时间偏差不得超过30秒
      schema:
        type: string
        example: '1672905655498'
    X-GatePay-Nonce:
      name: X-GatePay-Nonce
      in: header
      required: true
      description: 随机数
      schema:
        type: string
        example: '9578'
    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:
    RefundRequest:
      type: object
      properties:
        prepayId:
          type: string
          description: 对应支付单订单id
        refundAmount:
          type: string
          description: 退款金额
        refundReason:
          type: string
          description: 退款原因
        receiverId:
          type: integer
          description: 地址支付退款接收人在gate系统的user_id
          format: int64
        refundRequestId:
          type: string
          description: 商户退款请求号
      required:
        - refundRequestId
        - prepayId
    RefundResponse:
      type: object
      description: 标准响应包装；业务字段在 data 内
      properties:
        status:
          type: string
          description: 状态
          example: SUCCESS
        code:
          type: string
          description: 业务码
          example: '000000'
        errorMessage:
          type: string
          description: 错误信息
        data:
          $ref: '#/components/schemas/RefundData'
    RefundData:
      type: object
      description: 直付地址支付退款业务数据
      properties:
        refundRequestId:
          type: string
          description: 商户退款请求ID
        prepayId:
          type: string
          description: 拟退款的订单id
        orderAmount:
          type: string
          description: 订单金额
        refundAmount:
          type: string
          description: 退款金额
      required:
        - refundRequestId
        - prepayId
        - orderAmount
        - refundAmount

````