跳转到主要内容
POST
/
payment
/
open
/
institution
/
v1
/
pay
/
convert
发起闪兑
curl --request POST \
  --url https://openplatform.gateapi.io/payment/open/institution/v1/pay/convert \
  --header 'Content-Type: application/json' \
  --header 'X-GatePay-Certificate-ClientId: <x-gatepay-certificate-clientid>' \
  --header 'X-GatePay-Nonce: <x-gatepay-nonce>' \
  --header 'X-GatePay-On-Behalf-Of: <x-gatepay-on-behalf-of>' \
  --header 'X-GatePay-Signature: <x-gatepay-signature>' \
  --header 'X-GatePay-Timestamp: <x-gatepay-timestamp>' \
  --data '
{
  "clientReqId": "181147",
  "sellCurrency": "GT",
  "buyCurrency": "USDT",
  "buyAmount": "1",
  "sellAmount": "0.04464002",
  "quoteId": "PAY-2a5743d8"
}
'
{
  "status": "SUCCESS",
  "code": "000000",
  "errorMessage": "",
  "data": {
    "order_id": "327196066546229248",
    "userId": 10002,
    "sellCurrency": "GT",
    "buyCurrency": "USDT",
    "sellAmount": "0.04464002",
    "buyAmount": "1",
    "status": 1,
    "rate": 22.40142365527614,
    "quoteId": "PAY-2a5743d8",
    "createTime": 1739971221273
  }
}

概述

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

说明

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

请求头

X-GatePay-Certificate-ClientId
string
必填

商户客户端ID,在 GatePay 平台申请获得

示例:

"mZ96D37oKk-HrWJc"

X-GatePay-Signature
string
必填

请求签名,GatePay 通过此签名来确定此请求是否合法

示例:

"8504fe097f7297f8952c76e628ce59dbc93d1df64c95f26c73140ef365d4aa1471826ada0534315461682ec35c131d7e133c51d2ab0822fe7366650a111887ba"

X-GatePay-Timestamp
string
必填

请求生成时的 UTC 时间戳(毫秒)

示例:

"1740019013818"

X-GatePay-Nonce
string
必填

随机字符串,建议长度在 32 个字符以内

示例:

"9722139164"

X-GatePay-On-Behalf-Of
string
必填

必填代理归属请求头。请填写本次请求的发起方账户 ID;在机构代理商户 API 中通常填写目标子账户 ID,在机构代扣与划转接口中可填写机构账户 ID 或子账户 ID。

请求体

application/json
clientReqId
string
必填

客户端请求ID(由用户随机生成,目的是为了保证幂等)

quoteId
string
必填

报价ID(必须与 preview 接口返回的一致)

buyAmount
string
必填

购买数量(必须与 preview 接口返回的一致)

buyCurrency
string
必填

购买币种(必须与 preview 接口返回的一致)

sellAmount
string
必填

出售数量(必须与 preview 接口返回的一致)

sellCurrency
string
必填

出售币种(必须与 preview 接口返回的一致)

响应

200 - application/json

闪兑成功

status
string

SUCCESS 或 FAIL

code
string

错误码

errorMessage
string

错误信息

data
object