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

# Register Membership Member

> Endpoint to register a new membership member.

```bash Request Example theme={null}
curl --request POST 'https://api.mayar.id/hl/v2/memberships/members/create' \
--header 'Authorization: Bearer Paste-Your-API-Key-Here' \
--header 'Content-Type: application/json' \
--data-raw '{
    "productId": "7c9d2e1f-4a5b-4c6d-8e9f-0a1b2c3d4e5f",
    "membershipTierId": "9b2d4f6a-8c1e-4a3b-bd5c-6e7f8a9b0c1d",
    "customerInfo": {
        "name": "Budi Santoso",
        "email": "budi.santoso@example.com",
        "mobile": "081234567890"
    },
    "membershipMonthlyPeriod": 1
}'
```

```json Response Example 201 theme={null}
{
    "statusCode": 201,
    "message": "success",
    "data": {
        "membershipCustomer": {
            "id": "c4d5e6f7-a8b9-4c0d-8e1f-2a3b4c5d6e7f",
            "memberId": "MBR8X2QK",
            "userId": "348e083d-315a-4e5c-96b1-5a2a98c48413",
            "customerId": "a1b2c3d4-e5f6-4789-a012-3456789abcde",
            "membershipTierId": "9b2d4f6a-8c1e-4a3b-bd5c-6e7f8a9b0c1d",
            "paymentLinkId": "7c9d2e1f-4a5b-4c6d-8e9f-0a1b2c3d4e5f",
            "monthlyPaymentPeriod": 1,
            "status": "active",
            "nextPayment": "2026-07-20T09:10:57.994Z",
            "expiredAt": null,
            "createdAt": "2026-06-20T09:10:57.994Z",
            "updatedAt": "2026-06-20T09:10:57.994Z"
        }
    }
}
```

Endpoint:

```Production Production theme={null}
https://api.mayar.id/hl/v2/memberships/members/create
```

```Sandbox Sandbox theme={null}
https://api.mayar.io/hl/v2/memberships/members/create
```

## Authorization

**Authorization** `string` *required*

Example:

`Authorization | Bearer Paste-Your-API-Key-Here`

## Request Body

**productId** `string` *required*

The unique identifier of the product (payment link) the new member is registered
against. The product must belong to the authenticated user.

Example:

`7c9d2e1f-4a5b-4c6d-8e9f-0a1b2c3d4e5f`

**membershipTierId** `string` *required*

The unique identifier of the membership tier the member is enrolled in.

Example:

`9b2d4f6a-8c1e-4a3b-bd5c-6e7f8a9b0c1d`

**customerInfo** `object` *required*

The customer's contact details.

**customerInfo.name** `string` *required*

The customer's full name.

**customerInfo.email** `string` *required*

The customer's email address. A customer may only be registered once per tier —
re-using an email that already exists on the same tier responds
`400 "Email sudah terdaftar pada tier ini."`.

**customerInfo.mobile** `string` *required*

The customer's mobile phone number.

**membershipMonthlyPeriod** `integer` *required*

The monthly billing period for the membership (for example `1`).

## Response

Successful Response — HTTP `201`

### Main Structure (Root Object)

**statusCode** `integer`

Status code from the API. `201` on successful registration.

**message** `string`

Status message that describes the status code. Note the **singular** `message` key
(write endpoints use `message`; read/list endpoints use the plural `messages`).

**data** `object`

The registration result wrapper.

**data.membershipCustomer** `object`

The newly created membership customer record.

## Errors

All errors use the envelope `{ "statusCode": <code>, "message": "<reason>" }` (singular `message`).

```json Error Example 400 theme={null}
{
    "statusCode": 400,
    "message": "Email sudah terdaftar pada tier ini."
}
```

**statusCode** `integer`

The HTTP status code of the error.

**message** `string`

A human-readable description of the error.

Common errors:

| Status | `message` | When |
| - | - | - |
| `400` | `Validation Error` | The request body fails validation (missing or malformed fields). |
| `400` | `You are not authorized to edit this product!` | The `productId` does not belong to the authenticated user. |
| `400` | `Email sudah terdaftar pada tier ini.` | A customer with this email is already registered on the given tier. |
| `400` | `Paket membership ini telah mencapai batas limit anggota yang ditentukan.` | The tier has reached its configured member limit. |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.