Skip to main content
curl --request GET 'https://api.mayar.id/hl/v2/credit/customer/balance?customerId=a1b2c3d4-e5f6-4789-a012-3456789abcde&productId=7c9d2e1f-4a5b-4c6d-8e9f-0a1b2c3d4e5f' \
--header 'Authorization: Bearer Paste-Your-API-Key-Here'
{
    "statusCode": 200,
    "messages": "success",
    "data": {
        "customerBalance": 50000,
        "customerBalanceMain": 50000,
        "customerBalanceAddon": 0
    }
}
{
    "statusCode": 200,
    "messages": "success",
    "data": {
        "customerBalance": 50000,
        "customerBalanceMembership": 50000,
        "customerBalanceAddon": 0,
        "customerDetail": {
            "customerName": "Budi Santoso",
            "customerEmail": "budi.santoso@example.com",
            "customerMobile": "081234567890"
        },
        "membershipCustomerDetail": {
            "nextPayment": "2026-08-15T15:29:59.430Z",
            "expiredAt": "2026-07-15T15:29:59.430Z",
            "status": "active"
        }
    }
}
Endpoint:
https://api.mayar.id/hl/v2/credit/customer/balance?customerId=(customerId)&productId=(productId)

Authorization

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

Query Parameters

customerId
string
required
The unique identifier of the customer whose credit balance you want to retrieve.
productId
string
required
The unique identifier of the credit-based or membership product.
membershipTierId
string
The unique identifier of the membership tier (required when the product is a membership product with multiple tiers).

Response

Successful Response

Main Structure (Root)

statusCode
integer
Status code from the API.
messages
string
Status message that describes the status code.
data
object
The credit balance object. Shape depends on the product type (credit-usage vs membership).

data Structure (Object)

customerBalance
integer
Total customer balance across all wallets.
customerBalanceMain
integer
Main wallet balance (credit-usage product only).
customerBalanceMembership
integer
Membership wallet balance (membership product only).
customerBalanceAddon
integer
Add-on wallet balance (merchant top-up credit).
customerDetail
object
Customer detail information (membership product only).
membershipCustomerDetail
object
Membership customer detail including nextPayment, expiredAt, and status (membership product only).

Errors

400 Invalid query parameters
object
Returned with messages: "Invalid query parameters" when required parameters are missing or fail validation.
400 Unauthorized
object
Returned when the API key does not have access to the specified product.