Create Promotion Code
curl --request POST \
--url https://uat-api.clinkbill.com/api/promotion-code/{id} \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <api-key>' \
--header 'X-Timestamp: <x-timestamp>' \
--data '
{
"code": "SUMMER2026",
"firstOrderOnly": true,
"maxRedemptionLimit": 100,
"validPeriodStart": 1780660800000,
"validPeriodEnd": 1783252800000
}
'HttpResponse<String> response = Unirest.post("https://uat-api.clinkbill.com/api/promotion-code/{id}")
.header("X-Timestamp", "<x-timestamp>")
.header("X-API-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"code\": \"SUMMER2026\",\n \"firstOrderOnly\": true,\n \"maxRedemptionLimit\": 100,\n \"validPeriodStart\": 1780660800000,\n \"validPeriodEnd\": 1783252800000\n}")
.asString();import requests
url = "https://uat-api.clinkbill.com/api/promotion-code/{id}"
payload = {
"code": "SUMMER2026",
"firstOrderOnly": True,
"maxRedemptionLimit": 100,
"validPeriodStart": 1780660800000,
"validPeriodEnd": 1783252800000
}
headers = {
"X-Timestamp": "<x-timestamp>",
"X-API-KEY": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'X-Timestamp': '<x-timestamp>',
'X-API-KEY': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
code: 'SUMMER2026',
firstOrderOnly: true,
maxRedemptionLimit: 100,
validPeriodStart: 1780660800000,
validPeriodEnd: 1783252800000
})
};
fetch('https://uat-api.clinkbill.com/api/promotion-code/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"code": 200,
"msg": "success",
"data": {
"couponId": "<string>",
"promotionCodeId": "<string>",
"code": "<string>",
"status": "active",
"firstOrderOnly": true,
"redemptionCount": 123,
"maxRedemptionLimit": 123,
"validPeriodEnd": 1754819711382,
"createTime": 1754819711382,
"mirroring": true
}
}"<string>"Promotion Code
创建促销码
Create a promotion code for a coupon.
POST
/
promotion-code
/
{id}
Create Promotion Code
curl --request POST \
--url https://uat-api.clinkbill.com/api/promotion-code/{id} \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <api-key>' \
--header 'X-Timestamp: <x-timestamp>' \
--data '
{
"code": "SUMMER2026",
"firstOrderOnly": true,
"maxRedemptionLimit": 100,
"validPeriodStart": 1780660800000,
"validPeriodEnd": 1783252800000
}
'HttpResponse<String> response = Unirest.post("https://uat-api.clinkbill.com/api/promotion-code/{id}")
.header("X-Timestamp", "<x-timestamp>")
.header("X-API-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"code\": \"SUMMER2026\",\n \"firstOrderOnly\": true,\n \"maxRedemptionLimit\": 100,\n \"validPeriodStart\": 1780660800000,\n \"validPeriodEnd\": 1783252800000\n}")
.asString();import requests
url = "https://uat-api.clinkbill.com/api/promotion-code/{id}"
payload = {
"code": "SUMMER2026",
"firstOrderOnly": True,
"maxRedemptionLimit": 100,
"validPeriodStart": 1780660800000,
"validPeriodEnd": 1783252800000
}
headers = {
"X-Timestamp": "<x-timestamp>",
"X-API-KEY": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'X-Timestamp': '<x-timestamp>',
'X-API-KEY': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
code: 'SUMMER2026',
firstOrderOnly: true,
maxRedemptionLimit: 100,
validPeriodStart: 1780660800000,
validPeriodEnd: 1783252800000
})
};
fetch('https://uat-api.clinkbill.com/api/promotion-code/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"code": 200,
"msg": "success",
"data": {
"couponId": "<string>",
"promotionCodeId": "<string>",
"code": "<string>",
"status": "active",
"firstOrderOnly": true,
"redemptionCount": 123,
"maxRedemptionLimit": 123,
"validPeriodEnd": 1754819711382,
"createTime": 1754819711382,
"mirroring": true
}
}"<string>"请求头
请求体
application/json
Parameters required to create a promotion code