alipay.intl.ipromomerchant.cashlessvoucher.template.create

Overview

URL: /api/open/v1/promotion/cashlessVoucher/template/create

Use this interface to create a cashless voucher template.

Function logic

Create a coupon template, and templateId is returned synchronously. You can activate it and participate in the platform's investment promotion activities and query the coupon details online.

Request

Request parameters

Body

No

Name

Description

Type

Length

Required

Sample

1

requestId

Request ID, which supports idempotency.

string

64

M

211020000000000000044

2

name

Voucher template name

string

32

M

滿10減1夏日優惠券活動

3

voucherType

The type of the voucher:

  • FIXED_VOUCHER: The fixed face value deduction

string

32

M

券类型:FIXED_VOUCHER=固定面额

4

startTime

Voucher release start time. Coupons cannot be issued earlier than this time.

datetime

/

M

2011-07-04T12:08:56+05:30

5

endTime

Voucher release end time. You cannot issue vouchers later than this time.

datetime

/

M

2011-07-04T12:08:56+05:30

6

voucherRedemptionRules

Voucher redemption rules

RedemptionRules

/

M

{

 "quantityBudget": "1000",

 "limitCountPerUser": "1",

 "dayLimitCountPerUser": "1"

}

7

voucherUsageRules

Voucher usage rules

VoucherUsageRules

/

M

{

 "minPayAmount": {

   "currency": "HK",

   "value": "100"

 },

 "amount": {

   "currency": "HK",

   "value": "10"

 },

 "canSuperpose": false,

 "refundBack": false,

 "validPeriod": {

   "type": "ABSOLUTE",

   "startTime": "2021-03-04T12:08:56+05:30",

   "endTime": "2021-04-07T12:08:56+05:30"

 }

}

8

displayInfo

Voucher information, which is displayed on the card voucher package and collection page.

Map<String,DisplayInfo>

/

M

{ "zh_HK": {

"merchantName": "麦当劳",

"voucherDescription": "消费满100即可自动扣减",

"voucherUsageConditions": [

"商户自运营EFT商户",

"该红包适用于EFT"

]

},

"en_US": {

"merchantName": "MacDonald",

"voucherDescription": "Automatic deduction for consumption up to 100",

"voucherUsageConditions": [

"Businesses operating EFT businesses",

"A red envelope applies to EFT"

]

}

}

9

creatorId

Creator ID

string

32

M

10

passThroughInfo

Pass-through fields for risk control and extension.

string

2048

O

{}

Sample

copy
POST: /api/open/v1/promotion/cashlessVoucher/template/create HTTP/1.1
Content-Type: application/json; charset=UTF-8
Request-Time: 2020-04-29T17:18:47+08:00
client-id: 5J5XSU7Y2Y182W01981
Signature: algorithm=RSA256,keyVersion=1,signature=**
{
  "requestId": "211020000000000000044",
  "name": "滿10減1夏日優惠券活動",
  "voucherType": "FIXED_VOUCHER",
  "startTime": "2021-03-04T12:08:56+05:30",
  "endTime": "2021-07-04T12:08:56+05:30",
  "voucherRedemptionRules": {
     "quantityBudget": "1000",
     "limitCountPerUser": "1",
     "dayLimitCountPerUser": "1"
  },
  "voucherUsageRules": {
     "minPayAmount": {
        "currency": "HKD",
        "value": "100" 
    },
     "amount": {
        "currency": "HKD",
        "value": "10" 
    },
     "validPeriod": {
        "type": "ABSOLUTE",
        "startTime": "2021-03-04T12:08:56+05:30",
        "endTime": "2021-04-07T12:08:56+05:30" 
    }
  },
  displayInfo: {
    "zh_HK": {
      "merchantName": "麦当劳",
       "voucherDescription": "消费满100即可自动扣减",
      "voucherUsageConditions": [
        "商户自运营EFT商户",
        "该红包适用于EFT"
      ]
    },
    "en_US": {
      "merchantName": "MacDonald",
       "voucherDescription": "Automatic deduction for consumption up to 100",
      "voucherUsageConditions": [
        "Businesses operating EFT businesses",
        "A red envelope applies to EFT"
      ]
    }
  },
  creatorId: "2160400000000122",
  passThroughInfo: {
    
  }
}

Response

Response parameters

Body

No

Name

Description

Type

Length

Required

Sample

1

result

The result information

Result 

/

M

{

"resultStatus":"S",

"resultCode":"SUCCESS",

"resultMessage":"success"

 }

2

templateId

Voucher template ID

string

64

M

123456789

Sample

copy
client-id:TEST_5X00000000000000
content-type:application/json;charset=UTF-8
response-time:2020-03-13T09:59:22Z
signature:algorithm=RSA256,keyVersion=1,signature=rlux%2FDjx44EuIDEW3pEkttG1vw%2FAOdbyxHN7xF2SuHDJ8F%2BW4Q4fXZl7iVAn7zeR0CwWkqHZvJ6pdMVz5FNy7pFIQoACilNx1UJd3gT%2FNN0WLn%2BomEzTgBBu2oKy0nrE%2BHKZN9SbA0R9oWH2gpO1yiry%2FGZhW%2F9JYs2hHIufEx60MfAYaUOsU2m%2FpRpAgzsIV6Cxlb2bDaenMfUR8l1OtSfRp80jy%2BknR5JSQ77GKGU%2BXn6aFTJggnSTSqSO6MflWBQ8c1jF0%2BkN9u6KzSKRhNWuiBs3jQ80bt19xPyM8Du4FNKdAzGPkpIM7589Wa30XFdjnkSOmqJCmzr5UK5CXQ%3D%3D
tracerid:0be9923a15840935597895255e8e44.0.1.1
{
  "result": {
    "resultStatus": "S",
    "resultCode": "SUCCESS",
    "resultMessage": "success"
  },
  "templateId": "73708217433946187370821743394618",
}

Result codes

Business result codes

No

resultCode

resultStatus

resultMessage

1

SUCCESS

S

Success

2

PROCESS_FAIL

F

General business failure. No retry.

3

UNKNOWN_EXCEPTION

U

API failed due to unknown reasons. Retry.

4

PARAM_ILLEGAL

F

Illegal parameters. For example, non-numeric input, invalid date. Non-empty check.

5

TEMPLATE_IN_PROCESS

F

The template is processing. For more details, call the query interface.

6

TEMPLATE_DATE_INCORRECT

F

The template date is incorrect, the start time can not be greater than the end time.

7

TEMPLATE_PERIOD_DATE_INCORRECT

F

The template period date is incorrect.

8

TEMPLATE_LIMIT_EXCEED

F

The limit range of the coupon template is abnormal. The coupon template number must be greater than one.

9

AMOUNT_EXCEED

F

Amount or minPayAmount exceeds the limit.

10

DISPLAY_INFO_CONTENT_INCORRECT

F

The displayInfo parameter content of the coupon template is abnormal.

11

CURRENCY_INCORRECT

F

The currency is abnormal.

12

MULTI_LANGUAGE_INCORRECT

F

Multi language is abnormal.

13

VOUCHER_TYPE_NOT_SUPPORT

F

The voucher type does not support.

14

TEMPLATE_PERIOD_TYPE_NOT_SUPPORT

F

The template period type does not support.

15

CONTRACT_INVALID

F

Invalid product contract

16

SERVICE_NOT_AVAILABLE

F

Service degradation not available.

17

TEMPLATE_NOT_EXIST

F

The template data is invalid.

18

TEMPLATE_STATUS_NOT_SUPPORT

F

The template status does not support.

19

TEMPLATE_CONTENT_NOT_APPROVED

F

Illegal template content

20

MERCHANT_CONTRACT_NOT_EXIST

F

The merchant contract does not exist.

21

NO_MERCHANT_CONTRACT_BEEN_SIGNED

F

No product contract has been signed.

Supernet result codes

No

ResultCode

ResultStatus

resultMessage

1

INVALID_SIGNATURE

F

The signature is invalid.

2

PROCESS_FAIL

F

General business failure. No retry.

3

CLIENT_FORBIDDEN_ACCESS_API

F

Client is not authorized to use this API.

4

UNKNOWN_CLIENT

F

Unknown client

5

INVALID_CLIENT_STATUS

F

Invalid client status

6

REQUEST_TRAFFIC_EXCEED_LIMIT

F

Request traffic exceed limit.

7

KEY_NOT_FOUND

F

The key is not found.

8

ACCESS_DENIED

F

Access denied

9

API_IS_INVALID

F

API is invalid or not active.

10

UNKNOWN_EXCEPTION

F

API failed due to unknown reason.

11

OAUTH_FAILED

F

oAuth authentication failed.

12

NO_INTERFACE_DEF

F

API is not defined.