Skip to main content
创建支付订单是商户接入的第一步。商户服务端调用此接口生成订单并获得收银台地址。

接口信息

项目说明
请求方式POST
路径/api/merchant/payment/create
Content-Typeapplication/json
鉴权方式RSA 签名(详见 签名与鉴权

请求参数

{
  "merchant_transaction_id": "TXN20260101001",
  "amount": 100.00,
  "currency_code": "USD",
  "description": "订单描述",
  "redirect_url": "https://merchant.com/payment/return",
  "cancel_url": "https://merchant.com/payment/cancel",
  "products": [
    {
      "product_id": "PROD001",
      "name": "Product Name",
      "description": "Product description",
      "price": 100.00,
      "quantity": 1,
      "category": "Electronics",
      "sku": "SKU-001",
      "url": "https://merchant.com/product/PROD001"
    }
  ],
  "shipping": {
    "name": "Jane Smith",
    "address": {
      "country": "US",
      "state": "CA",
      "city": "San Francisco",
      "street": "1st Street",
      "zip": "94105"
    }
  },
  "customer": {
    "full_name": "John Doe",
    "address": {
      "country": "US",
      "state": "CA",
      "city": "San Francisco",
      "street": "1st Street",
      "zip": "94105"
    }
  }
}

字段说明

字段类型必填说明
merchant_transaction_idString商户侧订单号,需全局唯一
amountBigDecimal订单金额,> 0,最多两位小数
currency_codeString币种代码,如 USDEURCNY
descriptionString订单描述,会展示在收银台页面
redirect_urlString支付成功后用户跳转回的地址
cancel_urlString用户取消支付时的跳转地址
productsArray商品列表,至少 1 个
shippingObject收货信息,实物商品时必填
customerObject客户信息

商品信息(products[])

字段类型必填说明
product_idString商品 ID
nameString商品名称
descriptionString商品描述
priceBigDecimal商品单价
quantityInteger数量
categoryString商品分类
skuString商品 SKU
urlString商品详情链接

收货信息(shipping)

字段类型必填说明
nameString收货人姓名
addressObject收货地址

地址信息(address)

字段类型必填说明
countryString国家
stateString州/省
cityString城市
streetString街道
zipString邮编

客户信息(customer)

字段类型必填说明
full_nameString客户姓名
addressObject客户地址

响应参数

{
  "code": 200,
  "msg": "success",
  "data": {
    "order_id": "1000126011700000100001",
    "pay_url": "https://cashier-api.paymatrixpay.com/pay/xxx"
  }
}
字段类型说明
order_idString平台生成的订单号,唯一标识
pay_urlString收银台地址,引导用户跳转到此 URL 完成支付

错误码

错误码说明
200成功
1001005商户交易号重复
1001015参数校验失败
1001016签名验证失败
500系统错误

请求示例

curl -X POST "https://openapi.paymatrixpay.com/api/merchant/payment/create" \
  -H "Content-Type: application/json" \
  -H "X-Merchant-Id: 10001" \
  -H "X-Timestamp: 1737004800000" \
  -H "X-Nonce: a3f7b2c1d4e5" \
  -H "X-Signature: <RSA_SIGNATURE>" \
  -d '{
    "merchant_transaction_id": "ORDER-20260101-001",
    "amount": 100.00,
    "currency_code": "USD",
    "description": "Premium Subscription - Monthly",
    "redirect_url": "https://merchant.com/payment/return",
    "cancel_url": "https://merchant.com/payment/cancel",
    "products": [
      {
        "product_id": "PROD001",
        "name": "Premium Plan",
        "description": "Monthly premium subscription",
        "price": 100.00,
        "quantity": 1,
        "category": "Subscription"
      }
    ],
    "customer": {
      "full_name": "John Doe"
    }
  }'

成功响应示例

{
  "code": 200,
  "msg": "success",
  "data": {
    "order_id": "1000126011700000100001",
    "pay_url": "https://cashier-api.paymatrixpay.com/pay/1000126011700000100001"
  }
}

下一步

  • 将用户重定向到 pay_url 完成支付
  • 配置 Webhook 接收支付结果通知
  • 或调用 支付查询 接口主动轮询状态

相关页面