Skip to content

在线支付下单 ​

简述 ​

  • 商户在线 Payin 下单接口

请求 URL ​

  • /pay/merchant/createOrder

请求参数 ​

  • body
参数名必选类型长度说明
merchantId是String32商户编码(平台分配)
merOrderId是String64商户订单号,在商户系统保证唯一
subMerId否String32二级商户号 如存在则上送
orderType是String32交易类型 固定值:online_payin
paymentType否String100支付方式,非必填(商户可指定支付方式)可多值,","(英文输入法)隔开。
取值内容:附录-支付方式
orderAmt是String12交易金额 两位小数 格式:100.00
orderCurrency是String10交易币种 例如:SAR
expireTime是String4订单有效时间 单位:min 默认 30min
serverNotifyUrl否String255服务端支付结果通知地址。商户如果传该字段,以此 URL 为准给商户服务端回调;如果未传该字段,以后端配置的 URL 给商户服务端回调
frontRedirectUrl是String255前端支付结果跳转地址
productInfo是List<Object>订单商品信息 可以多种商品。对象格式,(Object:productInfo)
customerInfo是Object客户信息,对象格式,(Object:customerInfo)
deliveryInfo条件Object物流信息,对象格式,(Object:deliveryInfo)
当 productInfo.productType=physical 必填
orderDesc否String128订单说明
cashierIsSdk否String2收银台接入方式,不传默认为 0
0:统一收银台
1:SDK 方式
  • Object:productInfo
参数名必选类型长度说明
productType是String32商品类型
virtual:虚拟商品
physical:实体商品
productName是String128商品名称
productSku否String100商品编码
productQuantity是String5商品数量
productUnitPrice是String12商品单价 如:1.00
productCurrency是String10币种 如:SAR
productDesc否String128商品描述
productAvatarUrl是String255商品图片链接
  • Object:customerInfo
参数名必选类型长度说明
customerUid是String40客户在商户的 uid,需要保证每个用户 uid 唯一
customerName是String128客户姓名
customerPlatform是String128客户在购买商品的 APP 平台名称
customerPhone条件String18客户手机号
当 productType=physical 必填
customerEmail是String64客户邮箱
  • Object:deliveryInfo
参数名必选类型长度说明
firstName是String64收货人:名
lastName是String64收货人:姓
phone是String18收货人手机号
country是String128收货地址:国家
city是String128收货地址:城市
address是String128收货地址:详细地址
zipCode是String10邮编

请求示例 ​

json
{
  "merchantId": "M12345678",
  "merOrderId": "202412131543011234578",
  "subMerId": "",
  "orderType": "online_payin",
  "paymentType": "stcpay,cardpay,applepay",
  "orderAmt": "100.00",
  "orderCurrency": "SAR",
  "expireTime": "30",
  "serverNotifyUrl": "https://xxxxx.com",
  "frontRedirectUrl": "https://xxxxx.com",
  "productInfo": [
    {
      "productType": "physical",
      "productName": "huawei phone",
      "productSku": "12345689",
      "productQuantity": "2",
      "productUnitPrice": "50.00",
      "productCurrency": "SAR",
      "productDesc": "abc",
      "productAvatarUrl": "www.xxxx.com"
    }
  ],
  "customerInfo": {
    "customerUid": "abce_2323_2323",
    "customerName": "Mr balck",
    "customerPlatform": "hongkong sg",
    "customerPhone": "5001999921",
    "customerEmail": "abcdef@163.com"
  },
  "deliveryInfo": {
    "firstName": "alfa",
    "lastName": "zhang",
    "phone": "5001999921",
    "country": "Saudi Arabia",
    "city": "Riyadh",
    "address": "chaoyang road xxxxx",
    "zipCode": "100000"
  },
  "orderMemo": "123457xxxxx",
  "cashierIsSdk": "0"
}

响应参数 ​

  • data
参数名类型说明
merchantIdString商户编码
orderIdString平台交易订单号
merOrderIdString商户订单号,原值返回
subMerIdString二级商户编号
orderTypeString支付类型 online_payin
paymentTypeString支付方式 可多值,"," 隔开。
取值内容: 附录-支付方式
paymentUrlString支付链接 跳转地址
orderStatusString交易状态:
init:初始化
pending:处理中
success:成功
fail:失败
expired:已过期

响应示例 ​

json
{
  "code": 10000,
  "message": "success",
  "data": {
    "merchantId": "M12345678",
    "orderId": "TRD20241213154012000995",
    "merOrderId": "202412131543011234578",
    "subMerId": "",
    "orderType": "online_payin",
    "paymentType": "applepay,stcpay,cardpay",
    "paymentUrl": "https://api-dev.gccpay.cn/en-US/order/TRD20241213154012000995",
    "orderStatus": "init"
  }
}