> ## 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 Event

> Endpoint used to create an event product

<RequestExample>
  ```bash Request Example theme={null}
  curl --request POST 'https://api.mayar.id/hl/v2/products/event/create' \
  --header 'Authorization: Bearer Paste-Your-API-Key-Here' \
  --data-raw '{
          "name": "Bootcamp Coding Fullstack Asix",
          "description": "Workshop fullstack development 2 hari",
          "amount": 3100000,
          "crossoutPrice": 500000,
          "eventUrl": "https://meet.google.com/abc-defg-hij",
          "notes": "offline-jakarta",
          "terms": "Tiket tidak dapat di-refund",
          "redirectUrl": "https://example.com/event-thanks",
          "paymentType": "paid",
          "startAt": "2026-07-01T08:00:00.000Z",
          "eventStartAt": "2026-07-15T08:00:00.000Z",
          "eventEndAt": "2026-07-16T17:00:00.000Z",
          "expiredAt": "2026-07-10T17:00:00.000Z",
          "limit": 50,
          "event": {
              "eventAddress": "jl perjuangan no 32",
              "isOnlineEvent": false,
              "maxTicket": 5
          }
      }'
  ```
</RequestExample>

<ResponseExample>
  ```json Response Example 200 theme={null}
  {
      "statusCode": 200,
      "messages": "success",
      "data": {
          "id": "7f992557-8791-41b5-a1c8-c5641c3e72b5",
          "link": "https://testingmayar.myr.id/event/Bootcamp-Coding-Fullstack-Asix"
      }
  }
  ```
</ResponseExample>

Endpoint:

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

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

## Authorization

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

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

## Request Body

<ParamField path="name" type="string" required>
  Event product name.
</ParamField>

<ParamField path="description" type="string" required>
  Event product description in text or HTML format.
</ParamField>

<ParamField path="amount" type="integer" required>
  Event ticket or product price amount.
</ParamField>

<ParamField path="crossoutPrice" type="integer">
  Crossed-out price displayed as the original price.
</ParamField>

<ParamField path="eventUrl" type="string">
  Event URL, such as an online meeting link.
</ParamField>

<ParamField path="notes" type="string">
  Additional notes for the event.
</ParamField>

<ParamField path="terms" type="string">
  Terms and conditions for the event purchase.
</ParamField>

<ParamField path="redirectUrl" type="string">
  URL where the customer will be redirected after completing payment.
</ParamField>

<ParamField path="paymentType" type="string" required>
  Payment type for the event.
</ParamField>

<ParamField path="startAt" type="string | datetime" required>
  Sales start date in ISO 8601 format.
</ParamField>

<ParamField path="eventStartAt" type="string | datetime" required>
  Event start date in ISO 8601 format.
</ParamField>

<ParamField path="eventEndAt" type="string | datetime" required>
  Event end date in ISO 8601 format.
</ParamField>

<ParamField path="expiredAt" type="string | datetime" required>
  Event product expiration date in ISO 8601 format.
</ParamField>

<ParamField path="limit" type="number">
  Maximum participant or purchase limit.
</ParamField>

<ParamField path="event" type="object">
  Additional event details.
</ParamField>

### event Structure (Object)

<ParamField path="event.eventAddress" type="string">
  Event location or address.
</ParamField>

<ParamField path="event.isOnlineEvent" type="boolean">
  Indicates whether the event is conducted online.
</ParamField>

<ParamField path="event.maxTicket" type="number">
  Maximum number of tickets that can be purchased per transaction. Defaults to
  `50`.
</ParamField>

## Response

Successful Response

### Main Structure (Root)

<ResponseField name="statusCode" type="integer">
  Status code from API.
</ResponseField>

<ResponseField name="messages" type="string">
  Status message that describes the status code.
</ResponseField>

<ResponseField name="data" type="object">
  The created event product data.
</ResponseField>

### data Structure (Object)

<ResponseField name="data.id" type="string">
  Unique identifier of the event product.
</ResponseField>

<ResponseField name="data.link" type="string">
  Public URL of the created event product.
</ResponseField>

### Errors

<ResponseField name="400 Bad Request" type="object">
  Returned when the request body fails validation:
  `{ "statusCode": 400, "messages": "Validation Error" }`.
</ResponseField>

<ResponseField name="409 Conflict" type="object">
  Returned when a product with the same identifier already exists:
  `{ "statusCode": 409, "messages": "already exist" }`.
</ResponseField>
