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

# Get Membership Members

> Endpoint to list the members of a membership product.

<RequestExample>
  ```bash Request Example theme={null}
  curl --request GET 'https://api.mayar.id/hl/v2/memberships/members?productId=7c9d2e1f-4a5b-4c6d-8e9f-0a1b2c3d4e5f&limit=10' \
  --header 'Authorization: Bearer Paste-Your-API-Key-Here'
  ```
</RequestExample>

<ResponseExample>
  ```json Response Example 200 theme={null}
  {
      "statusCode": 200,
      "messages": "success",
      "data": [
          {
              "id": "c4d5e6f7-a8b9-4c0d-8e1f-2a3b4c5d6e7f",
              "createdAt": "2026-01-15T15:29:59.659Z",
              "customerId": "a1b2c3d4-e5f6-4789-a012-3456789abcde",
              "membershipTierId": "9b2d4f6a-8c1e-4a3b-bd5c-6e7f8a9b0c1d",
              "nextPayment": "2026-02-15T15:29:59.430Z",
              "status": "inactive",
              "updatedAt": "2026-02-15T17:30:03.531Z",
              "userId": "348e083d-315a-4e5c-96b1-5a2a98c48413",
              "memberId": "MBR8X2QK",
              "membershipTier.name": "Paket 1",
              "membershipTier.gracePeriodInDays": "0",
              "customer.name": "Budi Santoso",
              "customer.mobile": "081234567890",
              "customer.email": "budi.santoso@example.com"
          }
      ],
      "hasMore": false,
      "nextStartingAfter": "1768490999659"
  }
  ```
</ResponseExample>

Endpoint:

<CodeGroup>
  ```Production Production theme={null}
  https://api.mayar.id/hl/v2/memberships/members?productId=(productId)
  ```

  ```Sandbox Sandbox theme={null}
  https://api.mayar.club/hl/v2/memberships/members?productId=(productId)
  ```
</CodeGroup>

## Authorization

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

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

## Query Parameters

<ParamField query="productId" path="productId" type="string" required>
  The unique identifier of the membership product whose members you want to list.
  If missing or malformed the endpoint responds `400 "Invalid query parameters"`.
</ParamField>

<ParamField query="searchTerm" path="searchTerm" type="string">
  Filter members by a search term (for example a customer name or email).
</ParamField>

<ParamField query="startDate" path="startDate" type="string">
  Start of the date range to filter by.
</ParamField>

<ParamField query="endDate" path="endDate" type="string">
  End of the date range to filter by.
</ParamField>

<ParamField query="isChurnedMember" path="isChurnedMember" type="boolean">
  When set, filters churned members. When this filter is used the response also
  includes a `totalMember` sibling field alongside `data`.
</ParamField>

<ParamField query="limit" path="limit" default="10" type="integer">
  Number of items to return per page. Defaults to `10`, with a maximum of `50`.
</ParamField>

<ParamField query="startingAfter" path="startingAfter" type="string">
  Cursor for forward pagination. Pass the `nextStartingAfter` value from the
  previous response (a Unix timestamp in milliseconds, as a string) to fetch the
  next page.
</ParamField>

## Response

Successful Response

### Main Structure (Root)

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

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

<ResponseField name="data" type="array of object">
  List of membership members for the product.
</ResponseField>

<ResponseField name="hasMore" type="boolean">
  Information on whether there is additional data to be retrieved (true/false).
</ResponseField>

<ResponseField name="nextStartingAfter" type="string | null">
  Cursor to pass as `startingAfter` to fetch the next page. `null` when there is
  no further data.
</ResponseField>

<ResponseField name="totalMember" type="integer">
  Total number of members. Only present when the `isChurnedMember` filter is used.
</ResponseField>

### data Structure (Array Of Object)

Each member row carries the membership-customer fields plus a few flattened,
dotted-key columns for the related tier and customer.

<ResponseField name="id" type="string<uuid>">
  Unique identifier of the membership-customer record.
</ResponseField>

<ResponseField name="createdAt" type="string">
  ISO 8601 timestamp (UTC) of when the member was created.
</ResponseField>

<ResponseField name="customerId" type="string<uuid>">
  Unique identifier of the customer.
</ResponseField>

<ResponseField name="membershipTierId" type="string<uuid>">
  Unique identifier of the member's tier.
</ResponseField>

<ResponseField name="nextPayment" type="string">
  ISO 8601 timestamp (UTC) of the member's next scheduled payment.
</ResponseField>

<ResponseField name="status" type="string">
  Current status of the member (for example `active`, `inactive`).
</ResponseField>

<ResponseField name="updatedAt" type="string">
  ISO 8601 timestamp (UTC) of the last update.
</ResponseField>

<ResponseField name="userId" type="string<uuid>">
  The user ID of the owner of the product.
</ResponseField>

<ResponseField name="memberId" type="string">
  Public membership code of the member.
</ResponseField>

<ResponseField name="membershipTier.name" type="string">
  Name of the member's tier (flattened dotted-key column).
</ResponseField>

<ResponseField name="membershipTier.gracePeriodInDays" type="string">
  Grace-period days of the member's tier, as a string (flattened dotted-key column).
</ResponseField>

<ResponseField name="customer.name" type="string">
  Name of the customer (flattened dotted-key column).
</ResponseField>

<ResponseField name="customer.mobile" type="string">
  Mobile number of the customer (flattened dotted-key column).
</ResponseField>

<ResponseField name="customer.email" type="string">
  Email address of the customer (flattened dotted-key column).
</ResponseField>

## Errors

<ResponseField name="400 Invalid query parameters" type="object">
  Returned with `messages: "Invalid query parameters"` when `productId` is missing
  or the query parameters fail validation.
</ResponseField>
