> ## Documentation Index
> Fetch the complete documentation index at: https://docs.mayar.id/llms.txt
> Use this file to discover all available pages before exploring further.

# Create Name Service

> Endpoint used to create a name service (power-up store) entry

<RequestExample>
  ```bash Request Example theme={null}
  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
      }
  }'
  ```
</RequestExample>

<ResponseExample>
  ```json Response Example 200 theme={null}
  {
      "statusCode": 200,
      "messages": "success"
  }
  ```
</ResponseExample>

Endpoint:

<CodeGroup>
  ```Production Production theme={null}
  https://api.mayar.id/hl/v2/name-services/create
  ```

  ```Sandbox Sandbox theme={null}
  https://api.mayar.club/hl/v2/name-services/create
  ```
</CodeGroup>

## Authorization

<ResponseField name="Authorization" type="string" required>
  Example:

  `Authorization | Bearer Paste-Your-API-Key-Here`
</ResponseField>

## Request Body

<ParamField body="name" type="string" required>
  Name of the service. Used to derive a URL-friendly slug for the entry.
</ParamField>

<ParamField body="payload" type="object">
  Arbitrary configuration object for the service. Stored as serialized JSON.
</ParamField>

<ParamField body="description" type="string">
  Short description of the service.
</ParamField>

<ParamField body="website" type="string">
  Public website URL associated with the service.
</ParamField>

<ParamField body="amount" type="number | integer">
  Price (in IDR) associated with the service.
</ParamField>

<ParamField body="urlHook" type="string">
  Webhook URL notified for events related to this service.
</ParamField>

<ParamField body="image" type="string">
  Image URL representing the service.
</ParamField>

## Response

Successful Response

### Main Structure (Root)

<ResponseField name="statusCode" type="integer">
  Status code returned by the API.
</ResponseField>

<ResponseField name="messages" type="string">
  Status message that describes the status code. Returns `"success"` when the
  service is created. This success response does not include a `data` field.
</ResponseField>

## Errors

<ResponseField name="500 Server Error" type="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).
</ResponseField>
