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

> Endpoint to register a new customer for a membership (subscription) product with trial credit.

```bash Request Example theme={null}
curl --request POST 'https://api.mayar.id/credit/v2/credit/membership/customer/regist' \
--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"
    },
    "trialCredit": 50000,
    "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-08-20T09:10:57.994Z",
            "expiredAt": null,
            "createdAt": "2026-07-20T09:10:57.994Z",
            "updatedAt": "2026-07-20T09:10:57.994Z"
        },
        "paymentLink": "https://web.mayar.id/pay-membership/MBR8X2QK"
    }
}
```

Endpoint:

```Production Production theme={null}
https://api.mayar.id/credit/v2/credit/membership/customer/regist
```

```Sandbox Sandbox theme={null}
https://api.mayar.io/credit/v2/credit/membership/customer/regist
```

## Authorization

**Authorization** `string` *required*

Example:

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

## Request Body

**productId** `string` *required*

The unique identifier of the membership product.

**membershipTierId** `string`

The unique identifier of the membership tier to enroll the customer in.

**customerInfo** `object` *required*

The customer's contact details.

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

The customer's full name (3-250 characters).

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

The customer's email address (6-55 characters).

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

The customer's mobile phone number (10-15 characters).

**trialCredit** `integer`

Optional trial credit amount to grant to the customer upon registration.

**membershipMonthlyPeriod** `integer` *required*

The monthly billing period for the membership. Accepted values: `1`, `3`, `6`, `12`.

## Response

Successful Response — HTTP `201`

### Main Structure (Root)

**statusCode** `integer`

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

**message** `string`

Status message (singular — write endpoints use `message`).

**data** `object`

The registration result wrapper.

**data.membershipCustomer** `object`

The newly created membership customer record.

**data.paymentLink** `string`

The checkout URL for the member's first payment.

## Errors

**400 Validation Error** `object`

Returned when the request body fails validation.

**400 Email already registered** `object`

Returned when a customer with this email is already registered on this tier.

**400 Tier limit reached** `object`

Returned when the membership tier has reached its maximum member limit.


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