Skip to main content
curl --request POST 'https://api.mayar.id/hl/v2/credit/credit-usage/customer/regist' \
--header 'Authorization: Bearer Paste-Your-API-Key-Here' \
--header 'Content-Type: application/json' \
--data-raw '{
    "productId": "7c9d2e1f-4a5b-4c6d-8e9f-0a1b2c3d4e5f",
    "customerInfo": {
        "name": "Budi Santoso",
        "email": "budi.santoso@example.com",
        "mobile": "081234567890"
    },
    "trialCredit": 25000
}'
{
    "statusCode": 201,
    "message": "success",
    "data": {
        "customerId": "a1b2c3d4-e5f6-4789-a012-3456789abcde",
        "customerName": "Budi Santoso",
        "customerEmail": "budi.santoso@example.com",
        "customerBalance": 25000,
        "checkoutLink": "https://web.mayar.id/pl/checkout?product=7c9d2e1f-4a5b-4c6d-8e9f-0a1b2c3d4e5f&customer=a1b2c3d4"
    }
}
Endpoint:
https://api.mayar.id/hl/v2/credit/credit-usage/customer/regist

Authorization

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

Request Body

productId
string
required
The unique identifier of the credit-usage product.
customerInfo
object
required
The customer’s contact details.
customerInfo.name
string
required
The customer’s full name.
customerInfo.email
string
required
The customer’s email address.
customerInfo.mobile
string
required
The customer’s mobile phone number.
trialCredit
integer
Optional trial credit amount to grant to the customer upon registration.

Response

Successful Response — HTTP 201

Main Structure (Root)

statusCode
integer
Status code from the API. 201 on successful registration.
message
string
Status message (singular — write endpoints use message).
data
object
The registration result containing customer details, balance, and checkout link.
data.customerId
string<uuid>
The unique identifier of the created or existing customer.
data.customerName
string
The customer’s full name.
data.customerEmail
string
The customer’s email address.
data.customerBalance
integer
The customer’s initial credit balance (including trial credit if granted).
The checkout URL for the customer to purchase additional credit.

Errors

400 Validation Error
object
Returned when the request body fails validation.
400 Customer already exists
object
Returned when a customer with this email already has a paid transaction on this product.