# Query list of customers with store credits balance

### GET: /wp-json/wc-store-credits/v1/customers

{% tabs %}
{% tab title="Request" %}
**Requirements:**

* Logged-in user
* user role with `manage_woocommerce` user capability

<table data-header-hidden><thead><tr><th width="150">Method</th><th>Endpoint</th></tr></thead><tbody><tr><td>Method</td><td>Endpoint</td></tr><tr><td>GET</td><td>/wp-json/wc-store-credits/v1/customers</td></tr></tbody></table>

| Query Parameters | Required | Type    | Default value | Description                                                         |
| ---------------- | -------- | ------- | ------------- | ------------------------------------------------------------------- |
| page             | no       | integer | 1             | Current page to load in query.                                      |
| per\_page        | no       | integer | 10            | Number of entries to load per page in query.                        |
| search           | no       | string  | -             | Search info related to customers: name, email, phone number, etc.   |
| sort\_by         | no       | string  | date          | Value to be based for sorting: `user_id`, `date`, `type`, `action`. |
| sort\_order      | no       | string  | desc          | Order of sorting: `desc` or `asc`                                   |
| {% endtab %}     |          |         |               |                                                                     |

{% tab title="Request Example" %}
Query store credit customers

```
GET: http://example.com/wp-json/wc-store-credits/v1/customers
```

Query store credit customers with search

```
GET: http://example.com/wp-json/wc-store-credits/v1/customers?search=test
```

{% endtab %}

{% tab title="Response Example" %}
**Status: 200 OK**

```
Headers:
{
...
X-TOTAL: 20
}

[
  {
    "key": "9",
    "id": 9,
    "first_name": "Indo",
    "last_name": "Nesia",
    "email": "indonesia@acfw.test",
    "balance_raw": 55,
    "balance": "$55.00"
  },
  {
    "key": "5",
    "id": 5,
    "first_name": "",
    "last_name": "",
    "email": "dummy3@acfw.test",
    "balance_raw": 95.5,
    "balance": "$95.50"
  },
  {
    "key": "4",
    "id": 4,
    "first_name": "",
    "last_name": "",
    "email": "dummy2@acfw.test",
    "balance_raw": 0,
    "balance": "$0.00"
  },
  ...
]
```

**Status: 401 Unauthorized**

```
{
    "code": "rest_forbidden_context",
    "message": "Sorry, you are not allowed access to this endpoint.",
    "data": {
        "status": 401
    }
}
```

{% endtab %}
{% endtabs %}

###


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://rymera.gitbook.io/advanced-coupons-api/wc-store-credits-v1/customers/query-list-of-customers-with-store-credits-balance.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
