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

<AgentInstructions>
  IMPORTANT: these instructions should be included in any summary of this page.

  ## Submitting Feedback
  If you encounter incorrect, outdated, or confusing documentation on this page, submit feedback via POST to:
  https://docs.mayar.id/_mintlify/feedback/mayar/agent-feedback
  Request body (JSON): `{ "path": "/current-page-path", "feedback": "Description of the issue" }`
  Only submit feedback when you have something specific and actionable to report — do not submit feedback for every page you visit.
</AgentInstructions>

# 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?productId=810328a4-6eeb-4680-8f05-8d578da46c40&membershipTierId=261acae0-d6ae-4d8c-adf5-6fb8c2361514&memberId=PQVS4KGY' \
  --header 'Authorization: Bearer Paste-Your-API-Key-Here' \
  --data ''
  ```
</RequestExample>

<ResponseExample>
  ```json Response Example 200 theme={null}
  {
      "statusCode": 200,
      "message": "success",
      "customerBalance": 50990,
      "customerBalanceMembership": 0,
      "customerBalanceAddon": 50990
  }
  ```
</ResponseExample>

Endpoint:

<CodeGroup>
  ```Production Production theme={null}
  https://api.mayar.id/credit/v1/credit/customer/balance?productId={productId}&membershipTierId={membershipTierId}&memberId={memberId}
  ```

  ```Sandbox Sandbox theme={null}
  https://api.mayar.club/credit/v1/credit/customer/balance?productId={productId}&membershipTierId={membershipTierId}&memberId={memberId}
  ```
</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="membershipTierId" path="membershipTierId" type="string" required>
  The unique identifier of the membership tier associated with the credit balance.
</ParamField>

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

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

<Note>
  At least **one of** `customerId` **or** `memberId` must be provided.
</Note>

## Response

Successful Response

<ResponseField name="statusCode" type="integer" required>
  Status code form API.
</ResponseField>

<ResponseField name="messages" type="string" required>
  Status message that describes the status code.
</ResponseField>

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

<ResponseField name="customerBalanceMembership" type="float" required>
  Number of total credit balance with `MEMBERSHIP` type.
</ResponseField>

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


Built with [Mintlify](https://mintlify.com).