创建 GMPay 订单
POST
https://pay.example.com/payments/gmpay/v1/order/create-transaction在商户服务器上签名,创建订单后引导买家打开 payment_url。token 和 network 必须同时传入,也可以同时省略,让买家在收银台选择。
请求参数
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
pid | string | 是 | 商户 PID,用于查找 API Key,并参与签名。 |
order_id | string | 是 | 商户订单号,最长 32 字符,不能重复。 |
currency | string | 是 | 法币币种,如 cny、usd。 |
token | string | 条件必填 | 收款币种,如 usdt、trx、usdc、sol。GMPay 可与 network 同时省略以创建状态 4 占位订单。 |
network | string | 条件必填 | 收款网络,如 tron、solana、ethereum、binance、polygon、plasma。GMPay 可与 token 同时省略以创建状态 4 占位订单。 |
amount | number | 是 | 法币金额,必须大于 0.01。 |
notify_url | string | 是 | 支付成功异步回调地址。 |
redirect_url | string | 否 | 支付完成后的同步跳转地址。 |
name | string | 否 | 商品/订单名称。 |
payment_type | string | 否 | GMPay 兼容字段,不要求必须传;如果传了非空值,必须参与 GMPay signature 计算。普通 GMPay 不传时后台会存为 Gmpay;传 Epay(大小写不敏感)会统一存为 Epay 并使用 EPay 回调格式,且 PID 必须是数字。 |
signature | string | 是 | 64 位小写十六进制 GMPay HMAC-SHA256 签名。 |
示例使用演示密钥 epusdt_secret_key 签名。更改参数或商户密钥后,请在商户服务端重新签名。
相关文档
响应
application/json
响应字段
status_codeinteger业务结果码,商户可据此判断具体原因。
messagestring便于阅读的结果说明。
dataobject接口返回的数据,失败时为 null。
trade_idstringorder_idstringstatusintegerexpiration_timeintegerpayment_urlstring
request_idstring请求标识,可用于排查日志。
application/json
响应字段
status_codeinteger业务结果码,商户可据此判断具体原因。
messagestring便于阅读的结果说明。
datanull接口返回的数据,失败时为 null。
request_idstring请求标识,可用于排查日志。
application/json
响应字段
status_codeinteger业务结果码,商户可据此判断具体原因。
messagestring便于阅读的结果说明。
datanull接口返回的数据,失败时为 null。
request_idstring请求标识,可用于排查日志。
application/json
响应字段
status_codeinteger业务结果码,商户可据此判断具体原因。
messagestring便于阅读的结果说明。
datanull接口返回的数据,失败时为 null。
request_idstring请求标识,可用于排查日志。
application/json
响应字段
status_codeinteger业务结果码,商户可据此判断具体原因。
messagestring便于阅读的结果说明。
datanull接口返回的数据,失败时为 null。
request_idstring请求标识,可用于排查日志。
application/json
响应字段
status_codeinteger业务结果码,商户可据此判断具体原因。
messagestring便于阅读的结果说明。
datanull接口返回的数据,失败时为 null。
request_idstring请求标识,可用于排查日志。
application/json
响应字段
status_codeinteger业务结果码,商户可据此判断具体原因。
messagestring便于阅读的结果说明。
datanull接口返回的数据,失败时为 null。
request_idstring请求标识,可用于排查日志。
application/json
响应字段
status_codeinteger业务结果码,商户可据此判断具体原因。
messagestring便于阅读的结果说明。
datanull接口返回的数据,失败时为 null。
request_idstring请求标识,可用于排查日志。
application/json
响应字段
status_codeinteger业务结果码,商户可据此判断具体原因。
messagestring便于阅读的结果说明。
datanull接口返回的数据,失败时为 null。
request_idstring请求标识,可用于排查日志。
application/json
响应字段
status_codeinteger业务结果码,商户可据此判断具体原因。
messagestring便于阅读的结果说明。
datanull接口返回的数据,失败时为 null。
request_idstring请求标识,可用于排查日志。