Authorization
Example:
Authorization | Bearer Paste-Your-API-Key-HereRequest Body
Coupon code applied to the checkout.
Unique identifier of the payment link the coupon is applied to.
Transaction amount used to check the minimum-purchase requirement. Defaults to
0 when omitted.Email address of the customer performing the checkout. Required to validate
coupons restricted to
new or old customers.Membership tier ID. Used together with
paymentLinkType of
membership_payment to resolve the payment link for membership checkouts.Type of the payment link (example:
membership_payment).List of selected tickets for the checkout. Leave empty if not applicable.
Response
Successful ResponseMain Structure (Root)
Status code from API.
Status message that describes the status code.
Coupon validation result.
data Structure (Object)
Indicates whether the coupon is valid for the checkout.
Object containing the validated coupon details.
Unique identifier of the coupon.
Coupon code applied to the checkout.
Type of discount applied (
monetary or percentage).Discount value based on the discount type.
Minimum purchase amount required to use the coupon. Returns
null if not set.Type of customers eligible to use the coupon (
all, new, or old).Errors
This endpoint returns amessages string describing why a coupon cannot be
applied. The notable cases:
Returned with
messages: "Validation Error" when the request body fails
validation (e.g. missing couponCode or paymentLinkId).Returned with
messages: "Gagal! Kode diskon ini tidak ditemukan." when the
coupon does not exist or is not valid for the payment link.Returned with
messages: "Gagal! Kode diskon ini sudah tidak aktif." when the
discount is inactive.Returned with
messages: "Gagal! Kode diskon ini belum berlaku dan tidak dapat digunakan."
when the discount start date has not been reached.Returned with
messages: "Gagal! Kode diskon ini telah kadaluarsa dan tidak dapat digunakan."
when the discount has expired.Returned with
messages: "Gagal! Kode diskon tidak dapat digunakan untuk produk {productLabel}"
when the payment link type is not eligible for discounts (e.g. payment requests
or fundraising links).Returned with
messages: "Kode diskon ini hanya berlaku untuk transaksi dengan harga minimal {amount}."
when amount is below the discount’s minimum purchase.Returned with a
messages string explaining that the coupon is restricted to
new or old (existing) customers when customerEmail does not satisfy the
eligibility rule.Returned with
messages: "Gagal! Kode diskon telah mencapai batas pemakaian dan tidak dapat digunakan kembali."
when the coupon has reached its usage limit.