> ## Documentation Index
> Fetch the complete documentation index at: https://docs.yuko.so/llms.txt
> Use this file to discover all available pages before exploring further.

# Get customer balance

Returns the current loyalty points balance for a customer, including total earned and redeemed.

**GET /public/customers/balance**

#### **Authorizations**

**Authorization**

**string**

**header**

**required**

Bearer authentication header of the form `Bearer <token>`, where `<token>` is your REST API token.

#### **Required Scope**

**`customers:read`**

This endpoint requires the `customers` scope with **Read Access**. Configure token scopes in Settings → Integrations → REST API.

#### **Query Parameters**

**customer\_id**

**string**

**required**

The platform customer ID (e.g. Shopify customer ID)

Example:

`"9049402769586"`

#### **Response**

**200 - application/json**

**data**

**object**

Hide child attributes

**data.customer\_id**

**string**

The platform customer ID.

Example:

`"9049402769586"`

**data.balance**

**integer**

The customer's current redeemable points balance.

Example:

`350`

**data.earned**

**integer**

Total loyalty points ever earned by the customer.

Example:

`500`

**data.redeemed**

**integer**

Total points the customer has redeemed.

Example:

`150`

<RequestExample>
  ```bash cURL theme={null}
  curl --request GET \
    --url "https://api.yukoapp.com/api/v1/public/customers/balance?customer_id=9049402769586" \
    --header "Authorization: Bearer py_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
  ```

  ```javascript JavaScript theme={null}
  const customerId = "9049402769586";

  const response = await fetch(
    `https://api.yukoapp.com/api/v1/public/customers/balance?customer_id=${customerId}`,
    {
      method: "GET",
      headers: {
        Authorization: "Bearer py_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
      },
    }
  );

  const data = await response.json();
  ```

  ```php PHP theme={null}
  $customerId = "9049402769586";

  $ch = curl_init();
  curl_setopt($ch, CURLOPT_URL, "https://api.yukoapp.com/api/v1/public/customers/balance?customer_id={$customerId}");
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
  curl_setopt($ch, CURLOPT_HTTPHEADER, [
      "Authorization: Bearer py_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
  ]);

  $response = curl_exec($ch);
  curl_close($ch);

  $data = json_decode($response, true);
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={null}
  {
    "data": {
      "customer_id": "9049402769586",
      "balance": 350,
      "earned": 500,
      "redeemed": 150
    }
  }
  ```

  ```json 404 theme={null}
  {
    "error": {
      "code": "not_found",
      "message": "Customer not found"
    }
  }
  ```

  ```json 401 theme={null}
  {
    "error": {
      "code": "invalid_token",
      "message": "Invalid or revoked API token"
    }
  }
  ```
</ResponseExample>
