Skip to main content
curl --request POST 'https://api.mayar.id/hl/v1/coupon/validate' \
--header 'Authorization: Bearer Paste-Your-API-Key-Here' \
--data '{
  "paymentLinkId": "4d26ea37-d093-4b92-8f5f-0faec64d65b0",
  "tickets": [],
  "couponCode": "NFRBFUK",
  "finalAmount": 0,
  "customerEmail": ""
}'
{
    "statusCode": 200,
    "messages": "Success",
    "data": {
        "valid": true,
        "coupon": {
            "id": "08d233e9-91bc-4d9b-afc2-1dbbe38a1186",
            "code": "143KYCN",
            "discountType": "percentage",
            "discountValue": 10,
            "minimumPurchase": null,
            "eligibleCustomerType": "all"
        }
    }
}
Endpoint:
https://api.mayar.id/hl/v1/coupon/validate

Authorization

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

Request Body

Unique identifier of the payment link.
tickets
array
List of selected tickets for the checkout. Leave empty if not applicable.
couponCode
string
required
Coupon code applied to the checkout. Leave empty if not used.
finalAmount
integer
required
Final amount to be paid after discounts or adjustments.
customerEmail
string
Email address of the customer performing the checkout.

Response

Successful Response

Main Structure (Root)

statusCode
integer
Status code form API.
messages
string
Status message that describes the status code.
data
array of object
Main response data.

data Structure (Array Of Object)

valid
boolean
Indicates whether the coupon is valid or not.
coupon
object
Object containing coupon details.
coupon.id
string
Unique identifier of the coupon.
coupon.code
string
Coupon code applied to the checkout.
coupon.discountType
string
Type of discount applied (e.g., percentage, fixed).
coupon.discountValue
number
Discount value based on the discount type.
coupon.minimumPurchase
number | null
Minimum purchase amount required to use the coupon. Returns null if not set.
coupon.eligibleCustomerType
string
Type of customers eligible to use the coupon (e.g., all, new, existing).