Skip to main content
curl --request POST 'https://api.mayar.id/hl/v2/coupons/check' \
--header 'Authorization: Bearer Paste-Your-API-Key-Here' \
--data '{
    "couponCode": "HARIBAIK"
}'
{
    "statusCode": 200,
    "messages": "success",
    "data": {
        "couponCode": "HARIBAIK",
        "isUsed": false,
        "totalUsed": 12,
        "limit": 100,
        "remaining": 88
    }
}
Endpoint:
https://api.mayar.id/hl/v2/coupons/check

Authorization

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

Request Body

couponCode
string
required
Coupon code to check (1–50 characters).

Response

Successful Response

Main Structure (Root)

statusCode
integer
Status code from API.
messages
string
Status message that describes the status code.
data
object
Coupon usage details.

data Structure (Object)

couponCode
string
The coupon code that was checked.
isUsed
boolean
true when the coupon has reached its usage limit (totalUsed >= limit and limit > 0), otherwise false.
totalUsed
integer
Number of times the coupon has been used.
limit
integer
Maximum usage limit for the coupon (0 when no limit is set).
remaining
integer
Remaining usage quota (limit - totalUsed, never below 0).

Errors

400 Validation Error
object
Returned with messages: "Validation Error" when the request body fails validation (e.g. missing couponCode).
404 Kode kupon tidak ditemukan.
object
Returned with messages: "Kode kupon tidak ditemukan." when the coupon code does not exist for the authenticated account.