Skip to content

商户信息 ​

查询当前商户的基本信息,以及今日、昨日已支付订单的笔数和金额。

请求地址 ​

项目值
地址https://{实例域名}/api/v1/merchant/info
方法POST
Content-Typeapplication/x-www-form-urlencoded 或 application/json
响应JSON,带签名

请求参数 ​

只需 公共参数,没有业务参数。

字段类型必填说明示例
pidstring是商户 ID10001
timestampstring视安全级别Unix 秒1764472000
sign_typestring否MD5 / RSAMD5
signstring是签名—

请求示例 ​

bash
curl -X POST https://pay.example.com/api/v1/merchant/info \
  -d pid=10001 \
  -d timestamp=1764472000 \
  -d sign_type=MD5 \
  -d sign=0e1f2a3b4c5d6e7f8a9b0c1d2e3f4a5b
text
POST /api/v1/merchant/info HTTP/1.1
Host: pay.example.com
Content-Type: application/x-www-form-urlencoded

pid=10001&timestamp=1764472000&sign_type=MD5&sign=0e1f2a3b4c5d6e7f8a9b0c1d2e3f4a5b

响应参数 ​

字段类型说明示例
codeinteger1 成功1
msgstring说明succ
pidstring商户 ID10001
namestring商户名称示例商店
activestring启用状态,固定为 1(停用的商户无法通过认证)1
security_levelstring凭据安全级别:0 兼容、1 标准、2 严格1
orders_todaystring今日(北京时间)创建且已支付的订单笔数128
money_todaystring上述订单的下单金额 money 合计(元)2547.20
orders_lastdaystring昨日创建且已支付的订单笔数301
money_lastdaystring上述订单的下单金额合计(元)6012.90
timestamp / sign_type / signstring响应签名字段—

成功响应示例 ​

json
{
  "code": 1,
  "msg": "succ",
  "pid": "10001",
  "name": "示例商店",
  "active": "1",
  "security_level": "1",
  "orders_today": "128",
  "money_today": "2547.20",
  "orders_lastday": "301",
  "money_lastday": "6012.90",
  "timestamp": "1764472000",
  "sign_type": "MD5",
  "sign": "2a3b4c5d6e7f8a9b0c1d2e3f4a5b6c7d"
}

失败响应示例 ​

json
{ "code": -3, "msg": "商户已停用或未配置对接凭据" }

注意事项 ​

  • 统计按订单创建时间归属日期,只统计当前状态为已支付的订单;金额为下单金额 money,不是实付金额,也不扣除退款。
  • 本接口可用于联调时验证凭据和签名是否正确。

相关接口 ​

Xpay 产品文档