Create PayByLink
- Endpoint:
POST /aggregate-pay/api/gateway/createPaybylink - Tags: Collection Service/PayByLink
Description
Endpoint: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 | API version. Current value: 1.1 | ||
keyVersion | string | Yes | Signature Algorithm Version, Current value: 1 | ||
requestTime | string | Yes | Request time, compliant with rfc3339 specification, format: yyyy-MM-dd'T'HH:mm:ss.SSSXXX The time must be within two minutes of the current time | ||
appId | string | Yes | Merchant AppId,The unique identifier assigned to the merchant app by PayerMax | ||
merchantNo | string | No | maxLength: 32 | Merchant Id, the unique identifier generated when the merchant signs the contract with PayerMax | |
data | object | Yes | Request data body | ||
data.merchantLinkId | string | Yes | maxLength: 64 | Merchant link unique order number. | |
data.linkType | string | Yes | maxLength: 32 | Enumeration value: ONETIME, currently only supports ONETIME. | ONETIME |
data.expiresTime | string | No | maxLength: 10 | The link has a valid time, in seconds, up to 30 days, default 24h, minimum 1h. | |
data.currency | string | Yes | maxLength: 3 | Currency code, uppercase letters, seeTrading Supported Countries/Regions and Currencies】 | |
data.country | string | Yes | maxLength: 2 | Country code, uppercase letters. If the passed country code does not match the currency, the cash register will be displayed in the region corresponding to the currency code. the country must be sent, see【Trading Supported Countries/Regions and Currencies】 | |
data.totalAmount | string | Yes | maxLength: 24 | The order amount sent by the merchant, the unit of the amount is yuan. Except for the following countries, it will be sent according to the decimal point supported by the currency of each country. Note: For Bahrain, Kuwait, Iraq, Jordan, Tunisia, Libya, and Omar, local currencies only support two decimal places; for Indonesia, Taiwan, Pakistan, and Colombia, local currencies do not support amounts with decimals. | |
data.language | string | No | maxLength: 8 | Link page language, default English. | |
data.description | string | Yes | maxLength: 256 | Order description, displayed to the user on the link page. | |
data.linkDescription | string | No | maxLength: 256 | Link description, not displayed to users, used for merchant notes. | |
data.userInfo | object | Yes | User Info. | ||
data.userInfo.userId | string | Yes | maxLength: 64 | The oneTime class can be passed in, and the user’s unique id on the merchant side. | |
data.userInfo.username | string | No | maxLength: 64 | oneTime type can be passed in, user name. | |
data.goodsDetails | array[object] | Yes | Commodity information, support multiple uploads. | ||
data.goodsDetails[].goodsName | string | Yes | maxLength: 128 | product name. | |
data.goodsDetails[].goodsDescription | string | Yes | maxLength: 256 | product description. | |
data.goodsDetails[].quantity | string | Yes | maxLength: 16 | Number of Products. | |
data.goodsDetails[].price | string | Yes | maxLength: 24 | Commodity price. | |
data.goodsDetails[].goodsCurrency | string | Yes | maxLength: 3 | Commodity quotation currency, uppercase letters, see 【Trading Supported Countries/Regions and Currencies】 | |
data.goodsDetails[].showUrl | string | Yes | maxLength: 128 | Product display address. | |
data.merchantInfo | object | No | The link page displays merchant information. | ||
data.merchantInfo.logoUrl | string | No | maxLength: 256 | Merchant logo image displayed on the link page. | |
data.merchantInfo.contactEmail | string | Yes | maxLength: 128 | User contact merchant email. | |
data.notifyUrl | string | Yes | maxLength: 256 | Server-side callback notification URL, starting with http/https. The merchant notification address can be configured through the MerchantDashboard platform. If it is sent in the order, this shall prevail |
Example
json
{
"version": "1.1",
"keyVersion": "1.0",
"requestTime": "2022-01-22T10:00:00.500+08:00",
"appId": "6666c8b036a24579974497c2f9a33333",
"merchantNo": "010213834784554",
"data": {
"merchantLinkId": "APIFOXPAYLINKDEV1678695157845",
"linkType": "ONETIME",
"expiresTime": "950400",
"country": "JP",
"currency": "JPY",
"totalAmount": "4000",
"language": "en",
"description": "winter new sports shoes",
"linkDescription": "Link to receive clothing, shoes and hats",
"userInfo": {
"userId": "98",
"username": "Meng Yan"
},
"goodsDetails": [
{
"goodsName": "sports shoes",
"goodsDescription": "New winter shock-absorbing running sneakers",
"quantity": "2",
"price": "2000",
"goodsCurrency": "JPY",
"showUrl": "http://example.com/400x400"
}
],
"merchantInfo": {
"logoUrl": "http://example.com/logo/100x100",
"contactEmail": "test@example.com"
},
"notifyUrl": "http://notifyUrl.example.com"
}
}Responses
200
| Field | Type | Required | Constraints | Description | Enum |
|---|---|---|---|---|---|
code | string | Yes | Return code, ‘APPLY_SUCCESS’ means success | ||
msg | string | Yes | Return message, ‘Success.’ | ||
data | object | Yes | Return data body. | ||
data.linkId | string | Yes | maxLength: 64 | PMmax link unique number. | |
data.merchantLinkId | string | Yes | maxLength: 64 | Merchant link unique order number. | |
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 | The specific time when the link expires. |
Response Example
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"
}
}Enum Reference
data.linkType
ONETIME
data.linkStatus
ACTIVEEXPIRED
