curl --request GET 'https://api.mayar.id/hl/v1/coupon/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"
            }
        ]
    }
}
curl --request GET 'https://api.mayar.id/hl/v1/coupon/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/v1/coupon/{id}

Authorization

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

Path Parameter

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

Response

Successful Response

Main Structure (Root)

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

data Structure (Array Of Object)

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

coupons Structure (Array Of Object)

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