Skip to content

创建收款订单

该接口用于向系统提交订单信息,创建一笔待收款的订单。

请求信息

请求路径

POST /v1/payment

请求头 (Headers)

请求头中需要包含认证信息和内容类型。

字段类型描述
X-API-Keystring您的 API Key,用于标识调用方身份。
X-Timestampstring当前请求的时间戳 (Unix epoch time, 秒)。
X-Noncestring随机字符串 (Nonce),每次请求必须使用唯一的 Nonce。
X-Signaturestring请求内容的签名。

请求体 (Request Body)

请求体为 JSON 格式,包含订单的详细信息。

字段类型描述必填示例值
order_nostring商户侧订单号,全局唯一,只能使用字母或数字。长度应在8-32个字符内。"Pay1678886400"
currencystring订单币种代码,例如 EUR, USDUSDT 等。"USDT "
amountstring订单金额。请注意使用 string 类型以保证精度。"0.1"
chain_typestring收款链类型。目前只支持 bsc"bsc"
product_namestring商品或服务名称,长度应在32个字符内。"Test product name"
notify_urlstring收款结果异步通知回调地址。"http://your.domain/notify"
redirect_urlstring收款完成后同步跳转回商户的 URL。"http://your.domain/redirect"
metastring附加元数据,您可以在此字段中传递任何自定义信息。"metadata"

请求体示例 (JSON):

json
{
  "order_no": "Pay1678886400000",
  "currency": "EUR",
  "amount": "0.1",
  "chain_type": "BSC",
  "product_name": "Test product name",
  "notify_url": "http://your.domain/notify",
  "redirect_url": "http://your.domain/redirect",
  "meta": "id:123"
}

响应信息

成功响应示例 (JSON)

当请求成功 (HTTP 状态码 200) 时:

json
{
  "code": 10000,
  "message": "OK",
  "data": {
    "id": "5104887808",
    "order_no": "Pay1756198910",
    "currency": "EUR",
    "amount": "0.1",
    "order_amount": "0.12",
    "cancel_time": 1756200711,
    "state": 1,
    "pay_url": "https://zaepe.com/pay/377bcf79-c7af-438c-bd04-822254e218a7"
  }
}
字段类型描述
idstring收款系统内部订单 ID。
order_nostring商户侧订单号,与请求时提交的 order_no 相同。
currencystring订单币种代码,与请求时提交的 currency 相同。
amountstring原始订单金额,与请求时提交的 amount 相同。请注意,这里是字符串类型。
order_amountstring实际需收款的USDT金额。 可能与 amount 不同,例如汇率转换后的金额。请注意,这里是字符串类型。
cancel_timeint订单的取消/过期时间(Unix Mtimestamp, 秒)。超过此时间订单将自动关闭或无法收款。
stateint订单当前状态。具体数值含义请参考 订单状态
pay_urlstring收款页面 URL。商户应引导用户访问此 URL 完成收款。

错误响应示例 (JSON)

当请求失败 (HTTP 状态码非 200) 时:

json
{
  "code": 10003,
  "message": "参数 `currency` 无效: 币种不存在"
}