跳转到主要内容
POST
Create Promotion Code

授权

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"

路径参数

id
string
必填

Unique identifier of the coupon

请求体

application/json

Parameters required to create a promotion code

code
string

Customer-facing promotion code. If omitted, a code can be generated by the platform.

Pattern: ^[a-zA-Z0-9]{1,32}$
示例:

"SUMMER2026"

firstOrderOnly
boolean

Whether this promotion code is limited to first orders only

restrictedCustomerIds
string[]

Customer IDs allowed to redeem this promotion code. Empty means unrestricted.

minimumSpend
object

Minimum spend by currency. Key is an ISO currency code.

示例:
perCustomerRedemptionLimit
integer<int32>

Redemption limit per customer

maxRedemptionLimit
integer<int32>

Maximum total redemptions for this promotion code

validPeriodStart
integer<int64>

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

示例:

1780660800000

validPeriodEnd
integer<int64>

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

示例:

1780660800000

响应

Promotion code 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