Skip to main content
Endpoint:

Authorization

string
required
Example:Authorization | Bearer Paste-Your-API-Key-Here

Request Body

string
required
Coupon code applied to the checkout.
Unique identifier of the payment link the coupon is applied to.
number | integer
Transaction amount used to check the minimum-purchase requirement. Defaults to 0 when omitted.
string
Email address of the customer performing the checkout. Required to validate coupons restricted to new or old customers.
string
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).
array
List of selected tickets for the checkout. Leave empty if not applicable.

Response

Successful Response

Main Structure (Root)

integer
Status code from API.
string
Status message that describes the status code.
object
Coupon validation result.

data Structure (Object)

boolean
Indicates whether the coupon is valid for the checkout.
object
Object containing the validated coupon details.
string<uuid>
Unique identifier of the coupon.
string
Coupon code applied to the checkout.
string
Type of discount applied (monetary or percentage).
number
Discount value based on the discount type.
number | null
Minimum purchase amount required to use the coupon. Returns null if not set.
string
Type of customers eligible to use the coupon (all, new, or old).

Errors

This endpoint returns a messages string describing why a coupon cannot be applied. The notable cases:
object
Returned with messages: "Validation Error" when the request body fails validation (e.g. missing couponCode or paymentLinkId).
object
Returned with messages: "Gagal! Kode diskon ini tidak ditemukan." when the coupon does not exist or is not valid for the payment link.
object
Returned with messages: "Gagal! Kode diskon ini sudah tidak aktif." when the discount is inactive.
object
Returned with messages: "Gagal! Kode diskon ini belum berlaku dan tidak dapat digunakan." when the discount start date has not been reached.
object
Returned with messages: "Gagal! Kode diskon ini telah kadaluarsa dan tidak dapat digunakan." when the discount has expired.
object
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).
object
Returned with messages: "Kode diskon ini hanya berlaku untuk transaksi dengan harga minimal {amount}." when amount is below the discount’s minimum purchase.
object
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.
object
Returned with messages: "Gagal! Kode diskon telah mencapai batas pemakaian dan tidak dapat digunakan kembali." when the coupon has reached its usage limit.