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

> This is endpoint is used to get a customer credit balance.

<RequestExample>
  ```bash Request Example theme={null}
  curl --request GET 'https://api.mayar.id/credit/v1/credit/customer/balance?customerId=9de4b4b4-525c-4ee0-ac9c-b29c3e10fe55&productId=2b649982-411e-42e0-9b9c-0a17f9a55d44' \
  --header 'Authorization: Bearer Paste-Your-API-Key-Here' \
  --data ''
  ```
</RequestExample>

<ResponseExample>
  ```json Response Example 200 theme={null}
  {
      "statusCode": 200,
      "message": "success",
      "customerBalance": 30001,
      "customerMainBalance": 29801,
      "customerBalanceAddon": 500
  }
  ```
</ResponseExample>

Endpoint:

<CodeGroup>
  ```Production Production theme={null}
  https://api.mayar.id/credit/v1/credit/customer/balance?customerId={customerID}
  ```

  ```Sandbox Sandbox theme={null}
  https://api.mayar.club/credit/v1/credit/customer/balance?customerId{customerID}
  ```
</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 product associated with the credit balance.
</ParamField>

<ParamField query="customerId" path="customerId" type="string">
  The unique identifier of the customer whose credit balance is being queried balance.
</ParamField>

## Response

Successful Response

<ResponseField name="statusCode" type="integer">
  Indicates the status of the activation process.
</ResponseField>

<ResponseField name="message" type="string">
  Additional messages related to the activation process.
</ResponseField>

<ResponseField name="customerBalance" type="float">
  Number of total credit balance.
</ResponseField>

<ResponseField name="customerBalanceMain" type="float">
  Number of total credit balance with `MAIN` type.
</ResponseField>

<ResponseField name="customerBalanceAddon" type="float">
  Number of total credit balance with `ADD_ON` type.
</ResponseField>
