Skip to main content
POST
/
coupon
curl --request POST \
  --url https://uat-api.clinkbill.com/api/coupon \
  --header 'Content-Type: application/json' \
  --header 'X-API-KEY: <api-key>' \
  --header 'X-Timestamp: <api-key>' \
  --data '
{
  "couponName": "Summer Sale",
  "discountType": "percentage",
  "percentage": 20,
  "applyType": "product",
  "applicableProducts": [
    "prd_xxxxx"
  ],
  "durationType": "once",
  "maxRedemptionCount": 100,
  "validPeriodStart": 1780660800000,
  "validPeriodEnd": 1783252800000,
  "promotionCodes": [
    {
      "code": "SUMMER2026",
      "maxRedemptionLimit": 100
    }
  ]
}
'
{
  "code": 200,
  "msg": "success",
  "data": {
    "couponId": "<string>",
    "couponName": "<string>",
    "percentage": 123,
    "fixedAmounts": {},
    "durationMonths": 123,
    "maxRedemptionCount": 123,
    "redeemedCount": 123,
    "validPeriodEnd": 1754819711382,
    "mirroring": true,
    "terms": "<string>"
  }
}

Authorizations

X-API-KEY
string
header
required

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

X-Timestamp
string
header
required

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

Body

application/json

Parameters required to create a coupon

couponName
string
required

Coupon name

Maximum string length: 40
discountType
enum<string>
required

Discount type

Available options:
percentage,
fixed_amount
applyType
enum<string>
required

Coupon applicability type

Available options:
none,
product,
price
durationType
enum<string>
required

Discount duration type

Available options:
once,
repeating,
forever
percentage
number

Percentage discount. Used when discountType is percentage.

Required range: 0 <= x <= 100
fixedAmounts
object

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

Example:
{ "USD": 5, "EUR": 4.5 }
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

Example:

1780660800000

validPeriodEnd
integer<int64>

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

Example:

1780660800000

promotionCodes
object[]

Promotion codes to create together with the coupon

Maximum array length: 20

Response

Coupon created successfully

Body of the response message

code
integer<int32>

Response status code, 200 when success

Example:

200

msg
string

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

Example:

"success"

data
object