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

# Regist New Customer

> This endpoint is used to register new customers into the membership credit product.

```bash Request Example theme={null}
curl --request POST 'https://api.mayar.id/credit/v1/credit/credit-usage/customer/regist' \
--header 'Authorization: Bearer Paste-Your-API-Key-Here' \
--header 'Content-Type: application/json' \
--data-raw '{
    "productId": "43eadce2-bc52-4e38-a832-93fb835f2a69",
    "trialCredit": 300, //optional
    "customerInfo": {
        "name" : "john doe",
        "email" : "johndoe@gmail.com",
        "mobile" : "08777777777"
    }
}'
```

```json Response Example 200 theme={null}
{
    "statusCode": 200,
    "message": "success",
    "data": {
      "customerId": "bcf56452-ec21-4791-aca2-7a41b033e9d2",
      "paymentLinkId": "43eadce2-bc52-4e38-a832-93fb835f2a69"
    }
}
```

Endpoint:

```Production Production theme={null}
https://api.mayar.id/credit/v1/credit/credit-usage/customer/regist
```

```Sandbox Sandbox theme={null}
https://api.mayar.io/credit/v1/credit/credit-usage/customer/regist
```

## Authorization

**Authorization** `string` *required*

Example:

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

## Request Body

**productId** `string` *required*

The unique identifier of the product associated with the credit.

**trialCredit** `integer`

The trial credit amount to grant upon registration.

**customerInfo** `array of object` *required*

Object containing customer details.

### customerInfo Structure (Array Of Object)

**name** `string` *required*

Full name of the customer.

**email** `string` *required*

Email address of the customer.

**mobile** `string` *required*

Mobile phone number of the customer.

## Response

Successful Response

### Main Structure (Root)

**statusCode** `integer`

Indicates the HTTP status of the request (e.g. `200` for success).

**message** `string`

A descriptive message about the outcome of the request.

**customerId** `string`

Unique identifier of the related customer record.

**paymentLink.id** `string`

Unique identifier of the credit usage product aka productId.


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