跳转到主要内容
POST

授权

X-API-KEY
string
header
必填

Your secret API key obtained from the Clink dashboard (Developers section)

请求头

X-Timestamp
string
必填

Current timestamp in milliseconds since Unix epoch (required for request signing)

示例:

"1783513683000"

请求体

application/json

Parameters required to create a coupon

couponName
string
必填

Coupon name

Maximum string length: 40
discountType
enum<string>
必填

Discount type

可用选项:
percentage,
fixed_amount
applyType
enum<string>
必填

Coupon applicability type

可用选项:
none,
product,
price
durationType
enum<string>
必填

Discount duration type

可用选项:
once,
repeating,
forever
percentage
number

Percentage discount. Used when discountType is percentage.

必填范围: 0 <= x <= 100
fixedAmounts
object

Fixed discount amount by currency. Used when discountType is fixed_amount.

示例:
applicableProducts
string[]

Product IDs this coupon applies to

applicablePrices
object

Price IDs this coupon applies to, grouped by product ID

durationMonths
integer<int32>

Number of billing periods for repeating coupons

maxRedemptionCount
integer<int32>

Maximum total redemptions for this coupon

validPeriodStart
integer<int64>

Coupon validity start time as a 13-digit Unix timestamp in milliseconds

示例:

1780660800000

validPeriodEnd
integer<int64>

Coupon validity end time as a 13-digit Unix timestamp in milliseconds

示例:

1780660800000

promotionCodes
object[]

Promotion codes to create together with the coupon

Maximum array length: 20

响应

Coupon created successfully

Body of the response message

code
integer<int32>

Response status code, 200 when success

示例:

200

msg
string

Brief description of what happened, 'success' when happy case

示例:

"success"

data
object