# 1. QR Code 创建

# HTTP请求信息

# URL

{domain}/open-api/qr/generate

# 请求方式

POST

# Content-Type

application/json

# 请求参数

参数名 是否必填 类型 说明
timestamp long 当前时间戳
channelCode string 渠道码,参考QR渠道码列表
mchOrderId string 商户订单号,字母+数字,最大长度32
amount integer 金额,单位分,动态码必填,静态码非必填
notifyUrl string 商户交易通知 URL
customerName string 用户名,最大长度100
email string 用户邮箱
mobile string 用户手机号
remark string 备注
expireSeconds integer 过期时间,单位秒,范围30~3600,默认3600

# 响应参数

参数名 类型 说明
mchOrderId string 商户订单号,字母+数字,最大长度32
transactionId string 动态 QR Code 交易 ID
qrCodeContent string QR Code 内容
channelCode string 渠道码,参考QR渠道码列表
notifyUrl string 商户交易通知 URL
remark string 备注
qrStatus string QR Code 状态 (ACTIVE, INACTIVE, CANCELLED)
transactionStatus string 交易状态 (PENDING, COMPLETED, FAILED)
qrLink string 用户还款指引
createTime string QR Code创建时间
updateTime string QR Code更新时间
expiresTime string 过期时间

# 请求示例

# param 内容

{
  "timestamp": 1676017834369,
  "channelCode": "THAI_DYNAMIC_QR",
  "mchOrderId": "PC880001",
  "amount": 1000,
  "notifyUrl": "https://example.com/",
  "customerName": "Raja",
  "email": "raja@example.com",
  "mobile": "60128888888",
  "remark": "example",
  "expireSeconds": 300
}

如何构造请求体

# 请求体

{
  "appId": "c9b002aef1d7496c9df078d937896605",
  "sign": "tVa+aoAXH0ls1IoPznzkFyF+4v+iTZaCSttPWmYl1kCHeh8mwao8cqAD7Y7wdymcr9yavKh4bKT18KeLu27g7Q5GqhEQ0cm1dkARe+i2xoH32la4HAzBfPj9liULDawGoPbo739+FLgZnV79CLaiukvqtnkgI/Km6J/KccRPl2CtS4PUjxCyRicOAcv91KZiVOxyhoP9bKhvwtCkCIlkpBHKWskBPCxxfctoORjgXWj7FhRPLYBuRDaczfmr2um9aNXhVoH1XFZf7Gu67n6RmeB0kc2dHFPI89JEI0PwGq+bvbCAEUtHK4SlLexCtbMoCgGWKTJbSMDTvVF126jz8g==",
  "param": "{\"timestamp\":1676017834369,\"channelCode\":\"THAI_DYNAMIC_QR\",\"mchOrderId\":\"PC880001\",\"amount\":1000,\"notifyUrl\":\"https://example.com/\",\"customerName\":\"Raja\",\"email\":\"raja@example.com\",\"mobile\":\"60128888888\",\"remark\":\"example\",\"expireSeconds\":300}"
}

# 响应示例

响应码集合

{
    "code": 10000,
    "message": "Success",
    "data": {
        "mchOrderId": "PC880001",
        "transactionId": "C1051669624201385891",
        "qrCodeContent": "iVBORw0KGgoAAAANSUhEUgAAAGQAAABkCAIAAAD/gAIDAAAACXBIWXMAAA7EAAAOxAGVKw4bAAACV0lEQVR4nO2cwY7CMAwF6Wr//5fZW1WJbOKx3QDSzBHatHpyzIsTfDyfz4fE+Hn3C3wTigVQLIBiARQL8Pv60XEcXaOfP7XnmPEf3+FrzG+/482vGFkAxQIoFmCQs64k/P0811y/HX7Y9Rpdb37FyAIoFmAxDU+6ZsrysuEF86cX/UR8whpZAMUCKBYgmrOKDJc78TXQh1QojSyAYgE2TcO4WU8UG7ZhZAEUC6BYgGjO6soaQ+sQZ1i0iD+xiJEFUCzAYhp2bQEkNiyWXn8+ZuPmxYmRBVAsgGIBjs0riXjdMuES7sbIAigWIDoNi/t9xVrC3DrEB4y7Dc86VFEsQGkhHQ/7+GWVOZ77AY17fSMLoFgAxQJEj0nGawBzirWEBMuEGM+SRhZAsQCZfcPKWjc3KeaGe/7openROtyCYgEUC5Ap/sWtQ+UA4x3rlWKWNLIAigXIFP+GVKzD8kHBmdLlNv7DyAIoFkCxAIuqw3ytMMwvxUMGibXLnMaDmUYWQLEAC+sQN9mViuBy8OGAc+swHyeHkQVQLIBiAQY5q7HC/0ouzXUdhIwnaK1DFcUCbDr5124sriQmV+5UhJEFUCzApi5HxeVxcBbnin8upG9BsQCKBdjU5WiYLNpdS7HlwfJ2IwugWIDdXY5yD7q16h/HyAIoFkCxAB/XXuX1ltyV/kf6zSgWYHezsSE52zFv3Bx3G578uwXFAigWYFOXo1v7uHf9w8KqQyeKBdjU5Wg4YHA747HaaOhqla516ESxAIoF2N3l6KsxsgCKBVAsgGIBFAugWIA/BQySrn6cOmYAAAAASUVORK5CYII=",
        "channelCode": "THAI_DYNAMIC_QR",
        "notifyUrl": "https://example.com/",
        "remark": "example",
        "qrStatus": "ACTIVE",
        "transactionStatus": "PENDING",
        "qrLink": null,
        "createTime": "2022-11-28 16:30:01",
        "updateTime": null,
        "expiresTime": "2023-12-31 23:00:00"
    }
}