创建链接
- Endpoint:
POST /aggregate-pay/api/gateway/createPaybylink - Tags: 收单/链接支付
Description
接口名称:createPaybylink
Parameters
| Field | In | Type | Required | Constraints | Description |
|---|---|---|---|---|---|
Content-Type | header | string | Yes | ||
sign | header | string | Yes | 签名信息请参考技术文档 |
Parameter Examples
Content-Type:"application/json"sign:"FPFVT3o227JrFRbqu19boZCpVVTF9KznxyRawUmxpfXilHV/0yK46haPhAjNu1hPUMy7Vw/ILXhfzffNm4Fj0apWknlTY9OJxnSoQxS9BTFtc61tn5yV1q69x/kkBl82/qwg+XTJ4fOzy7Mar3VaC1E2PlDA6RkkKBUyNE6RYgsdB+Su7an4+4HVTNAnoe74WyvBgxTLMNg28igBTdqxaO3w/UBY6ObVp7vkqkQGdL1Y+HgmMYaAVwrM3+ALWGId0sJ+YqTY4WJ+0xCRGhaSnybiIjZsQEYyID68WNUfuavDLDsEhaMm/HfQvf5p0R1Ltovp3wwJnEbQcjY458iX5A=="
Request Body
Content-Type: application/json
| Field | Type | Required | Constraints | Description | Enum |
|---|---|---|---|---|---|
version | string | Yes | maxLength: 8 | 接口版本 当前值为:1.1 | |
keyVersion | string | Yes | maxLength: 8 | 密钥版本 当前值为:1 | |
requestTime | string | Yes | maxLength: 32 | 请求时间,符合rfc3339规范,格式:yyyy-MM-dd'T'HH:mm:ss.SSSXXX 时间需要在当前时间两分钟内 | |
appId | string | Yes | maxLength: 64 | 商户应用Id,PayerMax分配给商户应用的唯一标识 | |
merchantNo | string | No | maxLength: 32 | 商户号,商户与PayerMax业务签约时生成的唯一标识 | |
data | object | Yes | 请求数据体 | ||
data.merchantLinkId | string | Yes | maxLength: 64 | 商户链接唯一订单号 | |
data.linkType | string | Yes | maxLength: 32 | 枚举值:ONETIME,当前仅支持ONETIME | ONETIME |
data.expiresTime | string | No | maxLength: 10 | 链接有效时长,单位为秒,最长可30天,默认24h,最小1h | |
data.country | string | Yes | maxLength: 2 | 国家代码,大写字母,如果所传的国家代码与币种不匹配,则以货币代码对应的地区展示收银台。国家上送参见【交易支持国家/地区与币种】 | |
data.currency | string | Yes | maxLength: 3 | 标价币种,大写字母,参见【交易支持国家/地区与币种】 | |
data.totalAmount | string | Yes | maxLength: 24 | 标价金额,金额的单位为元。 除以下国家外,按照各国币种支持的小数点位上送 注意:巴林、科威特、约旦、阿曼、突尼斯,本币只支持两位小数; 印尼、中国台湾、韩国、越南、智利、巴基斯坦、哥伦比亚、日本、冰岛、巴拉圭,本币不支持带小数金额。 | |
data.language | string | No | maxLength: 8 | 链接页面语言,默认英语 | |
data.description | string | Yes | maxLength: 256 | 订单描述,在链接页面展示给用户 | |
data.linkDescription | string | No | maxLength: 256 | 链接描述,不展示给用户,用于商户备注 | |
data.userInfo | object | Yes | 用户信息 | ||
data.userInfo.userId | string | Yes | maxLength: 64 | oneTime类可传入,用户在商户侧唯一id | |
data.userInfo.username | string | No | maxLength: 64 | oneTime类可传入,用户姓名 | |
data.goodsDetails | array[object] | Yes | 商品信息,支持传多个。 | ||
data.goodsDetails[].goodsName | string | Yes | maxLength: 128 | 商品名称 | |
data.goodsDetails[].goodsDescription | string | Yes | maxLength: 256 | 商品描述。 | |
data.goodsDetails[].quantity | string | Yes | maxLength: 16 | 商品数量 | |
data.goodsDetails[].price | string | Yes | maxLength: 24 | 商品价格,商户系统的报价 | |
data.goodsDetails[].goodsCurrency | string | Yes | maxLength: 3 | 商品报价币种,大写字母。参见【交易支持国家/地区与币种】 | |
data.goodsDetails[].showUrl | string | Yes | maxLength: 256 | 商品展示地址 | |
data.merchantInfo | object | Yes | 链接页面展示商户信息 | ||
data.merchantInfo.logoUrl | string | No | maxLength: 256 | 链接页面展示的商户logo图片 | |
data.merchantInfo.contactEmail | string | Yes | maxLength: 128 | 用户联系商户邮箱 | |
data.notifyUrl | string | Yes | maxLength: 256 | 服务端回调通知URL,以http/https开头,可以通过MerchantDashboard平台配置商户通知地址,如果订单中上送,则以此为准 |
Example
json
{
"version": "1.1",
"keyVersion": "1",
"requestTime": "2022-01-22T10:00:00.500+08:00",
"appId": "6666c8b036a24579974497c2f9a33333",
"merchantNo": "010213834784554",
"data": {
"merchantLinkId": "paylinktest001",
"linkType": "ONETIME",
"expiresTime": "86400",
"country": "ID",
"currency": "IDR",
"totalAmount": "40000",
"language": "en",
"description": "冬季新款运动鞋",
"linkDescription": "链接收款衣物鞋帽",
"userInfo": {
"userId": "98",
"username": "孟艳"
},
"goodsDetails": [
{
"goodsName": "运动鞋",
"goodsDescription": "冬季新款减震跑步运动鞋",
"quantity": "2",
"price": "20000",
"goodsCurrency": "IDR",
"showUrl": "http://example.com/400x400"
}
],
"merchantInfo": {
"logoUrl": "http://example.com/logo/100x100",
"contactEmail": "test@example.com"
},
"notifyUrl": "http://www.notifyUrl.example.com"
}
}Responses
200
| Field | Type | Required | Constraints | Description | Enum |
|---|---|---|---|---|---|
code | string | Yes | 返回码,’APPLY_SUCCESS’代表成功 | ||
msg | string | Yes | 返回描述,’Success.’ | ||
data | object | Yes | 返回数据体 | ||
data.linkId | string | Yes | maxLength: 64 | PMmax链接唯一单号 | |
data.merchantLinkId | string | Yes | maxLength: 64 | 商户链接唯一订单号 | |
data.linkUrl | string | Yes | maxLength: 256 | PayByLink url | |
data.linkStatus | string | Yes | maxLength: 16 | ACTIVE、EXPIRED | ACTIVE, EXPIRED |
data.qrCodeUrl | string | Yes | maxLength: 256 | PayByLink QRcode url | |
data.expiresAt | string | Yes | maxLength: 32 | 链接具体失效时间 |
Response Example: 1
成功示例
json
{
"code": "APPLY_SUCCESS",
"msg": "SUCCESS.",
"data": {
"linkId": "iwockllp",
"merchantLinkId": "paylinktest001",
"linkUrl": "https://www.payermax.link/qltvlsd",
"linkStatus": "ACTIVE",
"qrCodeUrl": "https://www.payermax.link/imagesqrcode",
"expiresAt": "2022-11-01T10:00:00.000+08:00"
}
}Response Example: 2
异常示例
json
{
"code": "xx"
}Enum Reference
data.linkType
ONETIME
data.linkStatus
ACTIVEEXPIRED
