Create a coupon template-CreateCouponTemplate

更新时间:
复制 MD 格式

Function overview

Creates a coupon template.

Request parameters

Name

Type

Required

Example

Description

Name

string

Yes

Template test

The name of the template.

UseScene

string

Yes

OPERATIONAL

  • Coupon for activity: ACTIVITIES_STAMPS

  • Operational activity: OPERATIONAL

Reason

string

Yes

For testing

The reason for the request.

UniversalType

string

Yes

UNIVERSAL

  • Universal coupon: UNIVERSAL

  • Non-universal coupon: NONUNIVERSAL

CouponType

string

Yes

VOUCHER

  • Threshold-based coupon: CERTAIN

  • Discount coupon: DISCOUNT

UsageCount

integer

Yes

0

The number of times the coupon can be used. A value of 0 indicates unlimited use.

CouponAmount

number

Yes

100

The face value of the coupon. Unit: CNY.

DiscountRate

number

Yes

0.8

The discount rate. For example, 0.75. The value must be between 0 and 1.

ControlType

string

Yes

AMOUNT

  • Control by total amount: AMOUNT

  • Control by total quantity: NUMBER

MaxRelease

number

Yes

100

The maximum number of coupons that can be issued.

PerLimitNum

integer

Yes

1

The maximum number of coupons that a single user can receive.

ValidityType

string

Yes

RELATIVE

  • Relative time: RELATIVE

  • Absolute time: ABSOLUTE

CouponStartTime

string

Yes

1577851200

The time when the coupon becomes valid. This parameter is required when ValidityType is set to ABSOLUTE.

Convert the time to a Long UNIX timestamp. For example, "2020-01-01 12:00:00" is converted to 1577851200.

CouponEndTime

string

Yes

1577851200

The time when the coupon expires. This parameter is required when ValidityType is set to ABSOLUTE.

Convert the time to a Long UNIX timestamp. For example, "2020-01-01 12:00:00" is converted to 1577851200.

RelativeSecond

integer

No

10

The validity period in seconds for a relative time coupon. If StartTime is not set, the validity period starts from the day the coupon is generated. If StartTime is set, the validity period starts from the specified StartTime.

Description

string

No

Test

The description of the coupon's terms and conditions. This is for display purposes.

StartTime

string

No

1577851200

The time when the template becomes valid.

Convert the time to a Long UNIX timestamp. For example, "2020-01-01 12:00:00" is converted to 1577851200.

EndTime

string

No

1577851200

The time when the template expires.

Convert the time to a Long UNIX timestamp. For example, "2020-01-01 12:00:00" is converted to 1577851200.

CertainMoney

number

No

200

The minimum spending amount for a threshold-based coupon. Unit: CNY. For example, a value of 200 means the coupon can be used on orders of CNY 200 or more.

Operator

string

Yes

xxx

The operator. For system operations, set this to the application name. For manual operations by an employee, set this to the employee ID.

SellerId

integer

Yes

123123563464

The coupon issuer. This is the partner's UID.

ItemCodeSet

array

No

The commodity specification codes. This parameter specifies the applicable products for a product-specific coupon. It is required when UniversalType is set to NONUNIVERSAL.

string

No

ecs

The commodity specification code.

OrderTypeSet

array

No

The order types that the coupon supports.

  • New purchase: "BUY"

  • Renewal: "RENEW"

  • Upgrade: "UPGRADE"

  • Downgrade: "DOWNGRADE"

string

No

1

The order type.

ExtendsMap

map

No

The extended fields.

Type

string

Yes

APPLY

The template request type.

APPLY: Coupons are issued automatically after the template is approved.

Site

string

Yes

CHINA

The applicable site.

  • China: CHINA

UserPkAmount

string

Yes

12341234,100

The UID of the applicant and the coupon amount, separated by a comma (,). Use a vertical bar (|) to separate different users. For example: uid1,100|uid2,900.

Market

string

Yes

CHINA

The marketplace.

  • China marketplace: CHINA

CommodityType

string

Yes

FULLSITE_SELF

The commodity type.

  • All self-operated products on the site: FULLSITE_SELF

MarketType

integer

Yes

10

The marketplace type.

  • Alibaba Cloud Marketplace: 10

ClientType

string

Yes

UNIVERSAL

The client type.

  • Universal: UNIVERSAL

Currency

object

Yes

USD

Amount and Currency

CouponFixedType

string

No

FIXED

The face value type.

  • Fixed value: FIXED

  • Non-fixed value: NONFIXED

UpperLimit

number

No

100

The maximum discount amount for a single coupon.

RequestId

string

Yes

vsdvnjwegiq

Used for end-to-end tracking.

FromApp

string

Yes

test

The source application of the request.

Request examples

http(s)://resellertrade.aliyuncs.com?Action=CreateCouponTemplate
&SellerId=153******4157
&Name=TestTemplate
&<Common request parameters>

[
 {
 "fromApp": "budget-aliyun-inc-com",
 "param": {
 "sellerId":1938******65,
 "clientType": "PC",
 "commodityType": "OFFICIAL_SELF",
 "controlType": "NUMBER",
 "couponEndTime": 1652889599000,
 "couponStartTime": 1650267067000,
 "couponType": "DISCOUNT",
 "currency": "CNY",
 "description": "Coupon test",
 "discountRate": 0.8,
 "endTime": 1652889599000,
 "itemCodeSet": [
 "vm"
 ],
 "market": "CHINA",
 "marketType": 3003,
 "maxRelease": 10,
 "name": "Coupon test",
 "operator": "123456",
 "orderTypeSet": [
 "DOWNGRADE",
 "BUY",
 "UPGRADE",
 "RENEW"
 ],
 "perLimitNum": 1,
 "site": "CHINA",
 "spId": 25773208367,
 "startTime": 1650267053000,
 "type": "NORMAL",
 "universalType": "NONUNIVERSAL",
 "usageCount": 1,
 "useScene": "304",
 "validityType": "ABSOLUTE"
 },
 "requestId": "request-212c253e16502671028073268e03a6"
}
]

Response parameters

Parameter

Parameter type

Description

success

boolean

Indicates whether the request was successful.

requestId

String

The request ID.

data

Long

The template ID.

code

String

The error code.

message

String

Fault cause

Response examples

[
 {
 "RequestId":"E40EC2C2-8AD5-4D01-B54C-F6F8EC176ED3",
 "Data":293987****7654,
 "Code":"success",
 "Success":true
 }
]