CreateTemplate
Create Voucher Template
API:xxx/createTemplate
Request Method: POST
Alipay+ Rewards will call this interface to create a voucher template in Wallet side.
Direction: Alipay+ Rewards ---> Wallet
Request
(M=Madantory, C=Conditional, O=Optional)
header
Field | Type | Length | Mandatory | Detail | Sample |
clientId | String | 8 | M | Client ID | 2110200000000044 |
signature | String | 1024 | M | Signature | algorithm=sha256withrsa,keyVersion=2,signature=xxxxxxxxxxxyyyyyyyyyyyyyyzzzzzzzzz== |
encrypt | String | 32 | O | encrypt method | algorithm=rsa, keyVersion=2 |
Content-type | String | / | M | Http content type | application/json; charset=UTF-8 |
body
Field | Type | Length | Madantory | Description | Sample |
requestId | String | 32 | M | Requestid, used for identify a unique request. | 62021122800135202000000000263818 |
startTime | String | 32 | M | Voucher Template validity from follows the ISO-8601 standard | 2022-03-17T12:08:56+05:30 |
endTime | String | 32 | M | Voucher Template validity to follows the ISO-8601 standard | 2022-04-17T12:08:56+05:30 |
voucherType | String | 32 | M | Voucher type
| PAYMENTVOUCHER |
title | String | 256 | M | Template title | { "en_US":"Up to $50 available", "bahasa_MY":"bahasa_MY" } |
brandName | String | 4096 | M | Brand name | { "en_US":"Up to $50 available", "bahasa_MY":"bahasa_MY" } |
logo | String | 1024 | M | Brand logo URL | |
picture | String | 1024 | M | Voucher main picture URL | |
scenario | String | 1024 | M |
| |
discountInfo | DiscountInfo | 1024 | M | Discount info | |
codeType | String | 32 | M |
| |
codeStandard | String | 32 | C |
| |
button | Button | 1024 | O | ||
description | String | 4096 | M | Description | { "en_US":"Up to $50 available", "bahasa_MY":"bahasa_MY" } |
termsAndConditions | String | 4096 | M | T&C | { "en_US":"Up to $50 available", "bahasa_MY":"bahasa_MY" } |
howToUse | Map<String,List<String>> | 4096 | M | How to use | { "en_US": [{step1:xxx},{step2:xxx}] } |
discountInfo
Field | Type | Mandatory | Length | Detail | Sample |
discountType | String | M |
| EXCHANGE | |
discountRate | String | C |
| 90% | |
capAmount | Amount | C |
| ||
amount | Amount | C | discountType=FIXEDAMOUNT | ||
valueText | String | C | discountType=EXCHANGE |
|
Amount
Field | Type | Mandatory | Length | Detail | Sample |
value | String | C | Cent | 10000 (100.00 MYR) | |
currency | String | C | MYR | MYR |
Button
Field | Type | Mandatory | Length | Detail |
buttonType | String | M |
| usage |
buttonLabel | String | O | Button text | Use It |
buttonUrl | String | C | URL buttonType=WEB_PAGE |
Response
body
Field | Type | Length | Madantory | Description | Sample |
templateId | String | 32 | M | TemplateId created in wallet side | T00000000000001 |
resultInfo | ResultInfo | / | M | Result Info |
ResultInfo
Field | Type | Length | Madantory | Description | Sample |
resultStatus | String | 32 | M | S - Successful F - Failed U - Unknown | S |
resultCode | String | 32 | M | Error Code | SYSTEM_BUSY |
resultMessage | String | 256 | M | Error Message | system busy,retry again. |
Error Code
ResultCode | ResultStatus | ResultMessage |
SUCCESS | S | Success |
PARAM_ILLEGAL | F | Illegal parameters exist. For example, a non-numeric input, or an invalid date. |
REQUEST_TRAFFIC_EXCEED_LIMIT | U | The request traffic exceeds the limit. |
SYSTEM_ERROR | U | System process occour error |
Sample
request
{
"requestId":"121212812811211jhkjhkj9878jkjkj",
"startTime":"2022-03-17T12:08:56+05:30",
"endTime":"2022-12-17T12:08:56+05:30",
"voucherType":"MERCHANTVOUCHER",
"title":{
"en_US":"Up to $50 available",
"bahasa_MY":"bahasa_MY"
},
"brandName":{
"en_US":"foodpada",
"bahasa_MY":"foodpada"
},
"logo":"http://img/logo.img",
"picture":"http://img/8772.png",
"scenario":"ONLINE",
"discountInfo":{
"discountType":"FIXEDAMOUNT",
"amount":{
"value":"100",
"currency":"MYR"
}
},
"codeType":"BARCODE",
"codeStandard":"CODE128",
"button":{
"buttonType":"WEB_PAGE",
"buttonLabel":"Use Now",
"buttonUrl":"http://foodpada.com"
},
"description":{
"en_US":"Rp1RB off for MobaPay Store",
"bahasa_MY":"Rp1RB off for MobaPay Store"
},
"termsAndConditions":{
"en_US":"Voucher can be used for single transaction minimum of Rp1.300",
"bahasa_MY":"Voucher can be used for single transaction minimum of Rp1.300"
},
"howToUse":{
"en_US":[
"step1:go to merchant web site",
"step2:copy the code",
"step3:use the code"
]
}
}
response
{
"templateId":"2022101919050111540210000000000108100021",
"resultInfo":{
"resultStatus":"S",
"resultCode":"SUCCESS",
"resultMessage":"Success."
}
}