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

# 查询订阅订单详情

> 查询订阅订单详情

## 概述

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

## 说明

* 认证方式使用 GatePay 标准签名请求头。
* 本页展示同一接口的机构路径版本。
* 除创建子账户、查询子账户详情、分页查询子账户外，机构侧请求需携带 `X-GatePay-On-Behalf-Of`。
* 通用签名规则请参见 [/api-reference/version/100/cn/common/securityAndSignature](/api-reference/version/100/cn/common/securityAndSignature)。


## OpenAPI

````yaml api-reference/version/100/cn/openapi/institution/subscription/orderDetail-openapi.json GET /open/institution/v1/order/detail
openapi: 3.1.0
info:
  title: GatePay 机构订阅 API
  description: GatePay 支付平台 API 接口文档
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://openplatform.gateapi.io/pay-subscription
security: []
paths:
  /open/institution/v1/order/detail:
    get:
      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'
        - $ref: '#/components/parameters/subscriptionOrderNo'
        - $ref: '#/components/parameters/merchantSubscriptionOrderNo'
      responses:
        '200':
          description: 查询订阅订单详情成功
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateSubscriptionPlanResponse'
              examples:
                successResponse:
                  summary: 成功响应
                  value:
                    code: '0'
                    message: ''
                    data:
                      subscriptionOrderNo: '63812942625112175'
                      merchantSubscriptionOrderNo: rhys-60
                      subscriptionLink: >-
                        https://119.28.35.132:13555/zh/web3-subscribe?subscriptionOrderNo=63812942625112175
                      planNo: '2033844612305932301'
                      planName: plan031701法币有试用期无优惠
                      planDesc: 计划描述01
                      merchantId: '10002'
                      productNo: '3'
                      productName: 优酷
                      priceNo: '7'
                      priceName: 包天
                      cryptoCurrency: USDT
                      chain: BSC
                      userAddress: '0xbe6D780C23E77D979Fad5FbEa249a44E5cAC0463'
                      userId: 10086001
                      authorizedAmount: '31.95'
                      cryptoAmount: '0.10026792'
                      paidCount: 0
                      totalPaidAmount: '0'
                      period: DAY
                      interval: 1
                      totalPayCount: 2
                      trialDays: 3
                      endTime: 0
                      lastPayTime: 0
                      promoAmount: '0'
                      promoRate: '0'
                      nextPayTime: 0
                      callbackUrl: https://gate.com
                      orderStatus: TRIAL
                      createTime: 1773921305887
                      updateTime: 1773893750000
                      priceType: FIX_AMOUNT
                      paymentChannel: GATEPAY
                      authTime: 1773921306000
                    success: true
components:
  parameters:
    X-GatePay-Certificate-ClientId:
      name: X-GatePay-Certificate-ClientId
      in: header
      required: true
      description: 商户客户端ID，在 GatePay 平台申请获得
      schema:
        type: string
        example: 4186d0c6-6a35-55a9-8dc6-5312769dbff8
    X-GatePay-Signature:
      name: X-GatePay-Signature
      in: header
      required: true
      description: HMAC-SHA256签名，用于验证请求合法性
      schema:
        type: string
        example: >-
          672d5650dcc9bb22ebf25fa16c28d03c0e159d742a9176d4340a5da326d75dc8a2ec24c97fa6fc5d1533dd6e968863747e1d86a45e562cbe899f9ed7e9ca7f77
    X-GatePay-Timestamp:
      name: X-GatePay-Timestamp
      in: header
      required: true
      description: 时间戳（毫秒），与服务器时间差不能超过5分钟
      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。
    subscriptionOrderNo:
      name: subscriptionOrderNo
      in: query
      required: false
      description: 订阅订单编号（与merchantSubscriptionOrderNo任选一个）
      schema:
        type: string
        example: PLAN_20240101_001
    merchantSubscriptionOrderNo:
      name: merchantSubscriptionOrderNo
      in: query
      required: false
      description: 商户订阅订单编号（与subscriptionOrderNo任选一个）
      schema:
        type: string
        example: PRICE_ABC123
  schemas:
    CreateSubscriptionPlanResponse:
      type: object
      properties:
        code:
          type: string
          description: 响应码，0 表示成功
          example: '0'
        message:
          type: string
          description: 响应描述，成功时为空
          example: ''
        success:
          type: boolean
          description: 请求是否成功
          example: true
        data:
          type: object
          properties:
            subscriptionOrderNo:
              type: string
              description: 订阅订单编号
              example: SUB_ABC123456
            merchantSubscriptionOrderNo:
              type: string
              description: 商户订阅订单编号
              example: MSUB_20240312_001
            subscriptionLink:
              type: string
              description: 订阅页面链接，用于用户发起订阅授权
              format: uri
              example: https://pay.example.com/subscription/authorize?token=xxxxxx
            planNo:
              type: string
              description: 平台订阅计划编号
            planName:
              type: string
              description: 订阅计划名称
            planDesc:
              type: string
              description: 订阅计划描述
            merchantId:
              type: string
              description: 创建订阅计划的商户编号
            productNo:
              type: string
              description: 产品编号
            productName:
              type: string
              description: 产品名称
            priceNo:
              type: string
              description: 价格编号
            priceName:
              type: string
              description: 价格名称
            cryptoCurrency:
              type: string
              description: 加密货币币种
              example: USDT
            chain:
              type: string
              description: 加密货币网络
              example: TRON
            userAddress:
              type: string
              description: 用户授权的地址
            userId:
              type: integer
              format: int64
              description: 用户 ID；部分接入场景下返回，无则省略或为 null
            authorizedAmount:
              type: string
              description: 授权额度，用户需授权的代币数量
            cryptoAmount:
              type: string
              description: 单次扣款金额
            paidCount:
              type: integer
              description: 已扣款次数
              example: 2
            totalPaidAmount:
              type: string
              description: 已扣款总金额
            period:
              type: string
              description: 扣款周期
              example: ''
            interval:
              type: integer
              description: 扣款间隔
              example: 1
            totalPayCount:
              type: integer
              description: 一共需要完成的扣款次数
            trialDays:
              type: integer
              description: 试用天数
            endTime:
              type: integer
              format: int64
              description: 订阅自主结束的日期（时间戳，毫秒）
            lastPayTime:
              type: integer
              format: int64
              description: 最近一次扣款时间（时间戳，毫秒）
            promoAmount:
              type: string
              description: 首期特价金额
            promoRate:
              type: string
              description: 首期特价百分比
            nextPayTime:
              type: integer
              format: int64
              description: 下次扣款时间（时间戳，毫秒）
            callbackUrl:
              type: string
              description: 订阅成功后跳转的页面URL
              format: uri
            orderStatus:
              type: string
              enum:
                - CREATED
                - AUTHORIZED
                - CONFIRMING
                - TRIAL
                - RUNNING
                - UNPAID
                - COMPLETED
                - CANCELLED
                - CLOSED
                - BLOCKED
              description: >-
                订阅订单状态：`CREATED` 创建成功待用户授权；`AUTHORIZED`
                已授权，等待首次扣款或试用开始；`CONFIRMING` 确认中（首次确认订阅等待扣款结果）；`TRIAL`
                试用期中未发起扣款；`RUNNING` 正常运行中；`UNPAID`
                待支付（试用结束或运行中扣款失败且未达重试上限）；`COMPLETED` 已完成；`CANCELLED`
                已取消；`CLOSED` 已关闭（如扣款失败次数超限）；`BLOCKED` 拦截（已扣款但用户资金有风险）。
              example: TRIAL
            createTime:
              type: integer
              format: int64
              description: 订单创建时间（时间戳，毫秒）
            updateTime:
              type: integer
              format: int64
              description: 订单更新时间（时间戳，毫秒）
            priceType:
              type: string
              enum:
                - FIX_AMOUNT
                - ACCOUNT_AUTH
              description: 价格类型。FIX_AMOUNT 表示固定金额；ACCOUNT_AUTH 表示授权支付。
            paymentChannel:
              type: string
              enum:
                - GATEPAY
                - WEB3
              description: 支付渠道。GATEPAY 表示中心化支付；WEB3 表示链上交易。
            authTime:
              type: integer
              format: int64
              description: 用户确认授权的时间（时间戳，毫秒）

````