Skip to main content
curl --request POST 'https://api.mayar.id/hl/v2/credit/customer/add-credit' \
--header 'Authorization: Bearer Paste-Your-API-Key-Here' \
--header 'Content-Type: application/json' \
--data-raw '{
    "customerId": "a1b2c3d4-e5f6-4789-a012-3456789abcde",
    "productId": "7c9d2e1f-4a5b-4c6d-8e9f-0a1b2c3d4e5f",
    "amount": 50000
}'
{
    "statusCode": 200,
    "messages": "success",
    "data": {
        "customerNewBalance": 150000
    }
}
Endpoint:
https://api.mayar.id/hl/v2/credit/customer/add-credit

Authorization

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

Request Body

customerId
string
required
The unique identifier of the customer to add credit to.
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).
amount
integer
required
The amount of credit to add to the customer’s add-on wallet. Must be a positive integer.

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 top-up result object.
data.customerNewBalance
integer
The customer’s updated total balance after the top-up.

Errors

400 Validation Error
object
Returned when required fields are missing or the amount is invalid.
400 Unauthorized
object
Returned when the API key does not have access to the specified product.