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

# Search Customer By Email

> Endpoint to retrieve customer details by email

<RequestExample>
  ```bash Request Example theme={null}
  curl --request GET 'https://api.mayar.id/hl/v2/customers/detail?email=budi.santoso@example.com' \
    --header 'Authorization: Bearer Paste-Your-API-Key-Here'
  ```
</RequestExample>

<ResponseExample>
  ```json Response Example 200 theme={null}
  {
      "statusCode": 200,
      "messages": "success",
      "data": {
          "id": "a1b2c3d4-e5f6-4789-a012-3456789abcde",
          "createdAt": 1761557824548,
          "email": "budi.santoso@example.com",
          "mobile": "081234567890",
          "name": "Budi Santoso",
          "status": "active",
          "updatedAt": 1761557824548,
          "userId": "348e083d-315a-4e5c-96b1-5a2a98c48413",
          "user": {
              "id": "348e083d-315a-4e5c-96b1-5a2a98c48413",
              "name": "Toko Mayar Demo",
              "urlHook": "https://webhook.example.com/mayar-payment-webhook",
              "email": "merchant@example.com",
              "paymeLink": "testingmayar",
              "isSelfDomain": false,
              "accountId": "be305ea4-5fe1-4bb9-a5c8-6bc1d0bfd279",
              "account": {
                  "id": "be305ea4-5fe1-4bb9-a5c8-6bc1d0bfd279",
                  "name": "Mayar Demo Account",
                  "imageId": "efeecb5d-acac-45f8-8249-396f8a5b6a95",
                  "logo": {
                      "id": "efeecb5d-acac-45f8-8249-396f8a5b6a95",
                      "fileType": "jpeg",
                      "url": "https://media.mayar.id/images/efeecb5d-acac-45f8-8249-396f8a5b6a95.jpeg"
                  }
              }
          }
      }
  }
  ```
</ResponseExample>

Endpoint:

<CodeGroup>
  ```Production Production theme={null}
  https://api.mayar.id/hl/v2/customers/detail?email={inputyourcustomeremail}
  ```

  ```Sandbox Sandbox theme={null}
  https://api.mayar.club/hl/v2/customers/detail?email={inputyourcustomeremail}
  ```
</CodeGroup>

## Authorization

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

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

## Query Parameters

<ParamField query="email" type="string" required>
  Customer email address used to search customer details. Returns
  `400` with `Email query parameter is required` when omitted, and `404`
  with `Customer not found` when no customer matches the email.
</ParamField>

## Response

Successful Response

## Main Structure (Root)

<ResponseField name="statusCode" type="integer">
  Status code returned by the API.
</ResponseField>

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

<ResponseField name="data" type="object">
  Customer detail object.
</ResponseField>

### data Structure (Object)

<ResponseField name="data.id" type="string">
  Unique customer ID.
</ResponseField>

<ResponseField name="data.createdAt" type="number">
  Unix timestamp in milliseconds indicating when the customer was created.
</ResponseField>

<ResponseField name="data.email" type="string">
  Customer email address.
</ResponseField>

<ResponseField name="data.mobile" type="string">
  Customer phone number.
</ResponseField>

<ResponseField name="data.name" type="string">
  Customer full name.
</ResponseField>

<ResponseField name="data.status" type="string">
  Current customer status.
</ResponseField>

<ResponseField name="data.updatedAt" type="number">
  Unix timestamp in milliseconds indicating when the customer was last updated.
</ResponseField>

<ResponseField name="data.userId" type="string">
  Unique user ID associated with the customer.
</ResponseField>

<ResponseField name="data.user" type="object">
  User information object associated with the customer.
</ResponseField>

<ResponseField name="data.user.id" type="string">
  Unique user ID.
</ResponseField>

<ResponseField name="data.user.name" type="string">
  User full name.
</ResponseField>

<ResponseField name="data.user.urlHook" type="string">
  Webhook URL configured by the user.
</ResponseField>

<ResponseField name="data.user.email" type="string">
  User email address.
</ResponseField>

<ResponseField name="data.user.paymeLink" type="string">
  User payment link identifier.
</ResponseField>

<ResponseField name="data.user.isSelfDomain" type="boolean">
  Indicates whether the user uses a custom domain.
</ResponseField>

<ResponseField name="data.user.accountId" type="string">
  Unique account ID associated with the user.
</ResponseField>

<ResponseField name="data.user.account" type="object">
  Account information object.
</ResponseField>

<ResponseField name="data.user.account.id" type="string">
  Unique account ID.
</ResponseField>

<ResponseField name="data.user.account.name" type="string">
  Account name.
</ResponseField>

<ResponseField name="data.user.account.imageId" type="string">
  Unique image ID associated with the account logo.
</ResponseField>

<ResponseField name="data.user.account.logo" type="object">
  Account logo object.
</ResponseField>

<ResponseField name="data.user.account.logo.id" type="string">
  Unique logo image ID.
</ResponseField>

<ResponseField name="data.user.account.logo.fileType" type="string">
  Logo file type.
</ResponseField>

<ResponseField name="data.user.account.logo.url" type="string">
  Public URL of the account logo image.
</ResponseField>
