Skip to main content
curl --request POST 'https://api.mayar.id/hl/v2/name-services/create' \
--header 'Authorization: Bearer Paste-Your-API-Key-Here' \
--data-raw '{
    "name": "Premium Newsletter",
    "description": "Monthly premium newsletter access",
    "website": "https://testingmayar.myr.id",
    "amount": 50000,
    "urlHook": "https://webhook.example.com/name-service",
    "image": "https://media.mayar.id/images/a1b2c3d4-e5f6-4789-a012-3456789abcde.png",
    "payload": {
        "plan": "premium",
        "durationInDays": 30
    }
}'
{
    "statusCode": 200,
    "messages": "success"
}
Endpoint:
https://api.mayar.id/hl/v2/name-services/create

Authorization

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

Request Body

name
string
required
Name of the service. Used to derive a URL-friendly slug for the entry.
payload
object
Arbitrary configuration object for the service. Stored as serialized JSON.
description
string
Short description of the service.
website
string
Public website URL associated with the service.
amount
number | integer
Price (in IDR) associated with the service.
urlHook
string
Webhook URL notified for events related to this service.
image
string
Image URL representing the service.

Response

Successful Response

Main Structure (Root)

statusCode
integer
Status code returned by the API.
messages
string
Status message that describes the status code. Returns "success" when the service is created. This success response does not include a data field.

Errors

500 Server Error
object
Returned with messages set to the error description when the service cannot be created (for example, when a required field such as name is missing or malformed).