# 고객 목록 조회

원문: https://commerce.bootpay.ai/api/customer/list

> 등록된 고객 목록을 조회합니다. 이름 · 이메일 · 전화번호는 암호화해 저장하므로 검색어는 앞글자가 아니라 전체 값과 정확히 같아야 합니다.

v1 API 상세: [회원](https://commerce.bootpay.ai/api/reference/v1/users)

등록된 고객 목록을 조회합니다.

## API 엔드포인트

::: endpoint
method: GET
url: https://api.bootapi.com/v1/users
auth: [Basic Auth](https://commerce.bootpay.ai/api/server/authentication)
scope: user:user_list
:::

## 요청 파라미터

::: parameters

| 파라미터 | 타입 | 필수 | 설명 |
|---------|------|------|------|
| keyword | String | N | 검색어 — 이름·이메일·전화번호·회원 ID. **정확히 일치**해야 합니다 |
| membership_type | Integer | N | 회원 유형 (`1`: 회원, `2`: 비회원). 숫자로 보냅니다 — 보내지 않으면 회원·비회원이 모두 나옵니다 |
| type | String | N | `user_group` 으로 보내면 `keyword` 에 그룹 ID 를 넣어 그 그룹의 구성원을 조회합니다 (기본 `user`) |
| page | Integer | N | 페이지 번호 (기본: 1) |
| limit | Integer | N | 페이지당 데이터 수 (기본: **24**, 최대 100) |

:::

::: warning 고객 검색은 부분 일치가 안 됩니다
이름·이메일·전화번호는 암호화해서 저장하기 때문에 앞글자나 일부만으로는 찾을 수 없습니다.
`홍길` 로는 `홍길동` 이 안 나옵니다 — 전체 값을 그대로 넣습니다.
회원 ID(`user_id`)를 넣으면 그 회원을 바로 찾습니다.
:::

::: info 같은 값을 다르게 적어도 찾습니다
하이픈이나 대소문자 차이는 서버가 맞춰 찾습니다. 주문서·문의에서 복사한 값을 그대로 넣어도 됩니다.

| 넣은 값 | 결과 |
|---|---|
| `010-4033-4678` · `01040334678` | 둘 다 찾습니다 |
| `RUPY1014@GMAIL.COM` · `rupy1014@gmail.com` | 둘 다 찾습니다 |

:::

## 코드 예제

::: code-group

```bash [cURL]
curl -X GET "https://api.bootapi.com/v1/users?page=1&limit=20&keyword=홍길동" \
  -H "Authorization: Basic {base64(client_key:secret_key)}"
```

```javascript [Node.js]
import { BootpayCommerce } from '@bootpay/backend-js'

const commerce = new BootpayCommerce({
    client_key: 'your-commerce-client-key',
    secret_key: 'your-commerce-secret-key',
    mode: 'production'
})

const response = await commerce.user.list({
    page: 1,
    limit: 20,
    keyword: '홍길동'
})
console.log(response)
```

```python [Python]
from bootpay_backend import BootpayCommerce

commerce = BootpayCommerce(
    client_key='your-commerce-client-key',
    secret_key='your-commerce-secret-key',
    mode='production'
)

response = commerce.user.list({'page': 1, 'limit': 20, 'keyword': '홍길동'})
print(response)
```

```php [PHP]
use Bootpay\ServerPhp\BootpayCommerceApi;

$commerce = new BootpayCommerceApi("your-commerce-client-key", "your-commerce-secret-key");
$response = $commerce->user->getList([
    'page' => 1,
    'limit' => 20,
    'keyword' => '홍길동'
]);
print_r($response);
```

```java [Java]
import kr.co.bootpay.store.BootpayStore;
import kr.co.bootpay.store.model.request.TokenPayload;
import kr.co.bootpay.store.model.request.user.UserListParams;
import kr.co.bootpay.store.model.response.BootpayStoreResponse;

TokenPayload tp = new TokenPayload("your-commerce-client-key", "your-commerce-secret-key");
BootpayStore commerce = new BootpayStore(tp).withToken();

UserListParams params = new UserListParams();
params.page = 1;
params.limit = 20;
params.keyword = "홍길동";

BootpayStoreResponse response = commerce.user.list(params);
System.out.println(response);
```

```ruby [Ruby]
require 'bootpay'

commerce = BootpayStore::RestClient.new(client_key: 'your-commerce-client-key', secret_key: 'your-commerce-secret-key')
response = commerce.users(
  page: 1,
  limit: 20,
  keyword: '홍길동'
)
puts response.data
```

```go [Go]
import "github.com/bootpay/backend-go/v2"

commerce := bootpay.NewCommerceAPI("your-commerce-client-key", "your-commerce-secret-key", nil, "production")
response, err := commerce.User.List(&bootpay.UserListParams{
    ListParams: bootpay.ListParams{Page: 1, Limit: 20, Keyword: "홍길동"},
})
fmt.Println(response, err)
```

```csharp [.NET]
using Bootpay.Commerce;
using Bootpay.Commerce.Models;
var commerce = new BootpayCommerceApi("your-commerce-client-key", "your-commerce-secret-key");
var response = await commerce.UserList(new UserListParams { Page = 1, Limit = 20, Keyword = "홍길동" });
Console.WriteLine(await response.Content.ReadAsStringAsync());
```

:::

## 응답

#### 성공 응답

```json
{
  "count": 5,
  "list": [
    {
      "user_id": "67e4b4425ec892162491d0ec",
      "login_id": "user001",
      "name": "홍길동",
      "email": "user@example.com",
      "phone": "01012345678",
      "membership_type": 1,
      "status": 1,
      "created_at": "2025-03-27T11:13:23+09:00"
    }
  ]
}
```

## 응답 필드 설명

| 필드 | 타입 | 설명 |
|------|------|------|
| `count` | Integer | 총 고객 수 |
| `list` | Array | 고객 목록 |
| &nbsp;&nbsp;└─ `user_id` | String | 고객 고유 ID |
| &nbsp;&nbsp;└─ `login_id` | String | 로그인 아이디 |
| &nbsp;&nbsp;└─ `name` | String | 고객 이름 |
| &nbsp;&nbsp;└─ `membership_type` | Integer | 회원 유형 (`1`: 회원, `2`: 비회원) |
| &nbsp;&nbsp;└─ `status` | Integer | 계정 상태. 목록에는 활성(`1`) 고객만 나옵니다 |
