Skip to main content
curl --request POST 'https://api.mayar.id/hl/v2/credit/generate/immutable/checkout' \
--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"
    },
    "creditAmount": 50000
}'
{
    "statusCode": 200,
    "message": "success",
    "data": {
        "checkoutLink": "https://web.mayar.id/pl/checkout?product=7c9d2e1f-4a5b-4c6d-8e9f-0a1b2c3d4e5f&immutable=eyJhbGciOiJIUzI1NiJ9.eyJjdXN0b21lck5hbWUiOiJcdTAwMjZndDsiLCJjdXN0b21lckVtYWlsIjoiY..."
    }
}
Endpoint:
https://api.mayar.id/hl/v2/credit/generate/immutable/checkout

Authorization

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

Request Body

productId
string
required
The unique identifier of the credit-based or membership product.
customerInfo
object
required
The customer’s contact details to pre-fill in the checkout link.
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.
creditAmount
integer
required
The amount of credit to set as the default value in the checkout. For membership products this determines the tier pricing displayed.

Response

Successful Response

Main Structure (Root)

statusCode
integer
Status code from the API.
message
string
Status message (singular — write endpoints use message).
data
object
The checkout link result.
The immutable checkout URL with customer information embedded as an HMAC-signed token. This URL can be safely shared with the customer.

Errors

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