Skip to main content
curl --request GET 'https://api.mayar.id/hl/v2/coupons/c9aa143a-53f9-44e7-a9c6-83229ad7199b' \
--header 'Authorization: Bearer Paste-Your-API-Key-Here' \
--data ''
{
    "statusCode": 200,
    "messages": "success",
    "data": {
        "id": "c9aa143a-53f9-44e7-a9c6-83229ad7199b",
        "createdAt": 1755665561029,
        "expiredAt": 1893488774933,
        "productDiscount": [],
        "discountType": "monetary",
        "discountProductType": "all",
        "eligibleCustomerType": "all",
        "name": "Diskon Murmer",
        "minimumPurchase": 500000,
        "isLifeTime": null,
        "totalCoupons": 100,
        "value": 100000,
        "coupons": [
            {
                "id": "532858fe-3722-4cf4-a8eb-f7c6765aba17",
                "code": "haribaik",
                "createdAt": 1755665561256,
                "discountId": "c9aa143a-53f9-44e7-a9c6-83229ad7199b",
                "endMonthTrial": null,
                "expiredAt": 1893488774933,
                "isActive": true,
                "limit": 100,
                "type": "reusable",
                "updatedAt": 1755665561256,
                "userId": "348e083d-315a-4e5c-96b1-5a2a98c48413"
            }
        ]
    }
}
Endpoint:
https://api.mayar.id/hl/v2/coupons/{uuId}

Authorization

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

Path Parameters

uuId
string
required
A unique identifier obtained when creating a discount. If accessed through the dashboard, it can be found in the URL on the discount details page.Example:c9aa143a-53f9-44e7-a9c6-83229ad7199b

Response

Successful Response

Main Structure (Root)

statusCode
integer
Status code from API.
messages
string
Status message that describes the status code.
data
object
The discount details, including its coupons.

data Structure (Object)

id
string<uuid>
Discount ID.
createdAt
integer
Creation time (timestamp in ms).
expiredAt
integer | null
Expiration time (timestamp in ms), or null when the discount does not expire.
productDiscount
array of object
Product-specific discount rules (empty if not applied).
discountType
string
Discount type.
discountProductType
string
Discount product scope.
eligibleCustomerType
string
Eligible customer scope.
name
string
Discount name.
minimumPurchase
integer | null
Minimum purchase amount required to apply the discount. null if not set.
isLifeTime
boolean | null
Indicates if the discount is lifetime (true/false) or null.
totalCoupons
integer
Total number of coupons available.
value
number
Discount value.
coupons
array of object
List of coupons associated with this discount.

coupons Structure (Array Of Object)

id
string<uuid>
Coupon ID (UUID).
code
string
Coupon code.
createdAt
integer
Coupon creation time (timestamp in ms).
discountId
string<uuid>
Related Discount ID.
endMonthTrial
string | null
End of trial month (if applicable).
expiredAt
integer | null
Coupon expiration time (timestamp in ms), or null when it does not expire.
isActive
boolean
Whether the coupon is active (true or false).
limit
integer
Maximum usage limit for the coupon.
type
string
Coupon type.
updatedAt
integer
Last updated time (timestamp in ms).
userId
string<uuid>
ID of the account that owns the coupon.