# 고객 정보 변경 API

플랫폼 서비스에서 특정 비즈니스의 고객 정보를 변경할 수 있는 API를 제공합니다.

<br>

## `PATCH` kit-api/v1/customers/\[customerId]

Method: PATCH\
Endpoint: kit-api/v1/customers/\[customerId] Param: customerId는 변경할 고객의 id(숫자) 값을 의미

<br>

## Example

```
...kit-api/v1/customers/1
```

```json
{
  "input": {
    "title": "김철수 매니저",
    "customKey": "B5-k159402",
    "ceo": "김대표",
    "registrationNumber": "789-30-01467",
    "address": "서울특별시 서초구 프릭스로 551",
    "industry": "정보통신업",
    "category": "응용 소프트웨어 개발 및 공급업",
    "managers": [
      {
        "name": "이담당자",
        "email": "prix-customer-manager@email.com",
        "position": "이담당자 직책",
        "note": "이담당자 메모",
        "contact": "이담당자 연락처",
        "roles": ["TAX_BILL", "SUB_TAX_BILL", "CONTRACT"] // 담당자 역할
      }
    ]
  }
}
```

<br>

## Request Body

| Key                      | Description                                                             | Required |
| ------------------------ | ----------------------------------------------------------------------- | -------- |
| input.title              | 한글, 영어 대소문자, 숫자, -, , \_, 등으로 구성된 40자 이하의 새로 생성할 고객 이름 (같은 비즈니스 내 중복불가) | no       |
| input.customKey          | 영어 대소문자, 숫자, -, \_로 구성된 40자 이하의 변경할 키 (같은 비즈니스 내 중복불가)                  | no       |
| input.ceo                | 대표자명                                                                    | no       |
| input.registrationNumber | 사업자등록번호 (10자리 숫자, 해외기업은 15자리까지)                                         | no       |
| input.address            | 사업장 주소                                                                  | no       |
| input.industry           | 업태                                                                      | no       |
| input.category           | 업종                                                                      | no       |
| input.managers           | 새로 생성할 고객 정보 - 고객사 담당자 목록                                               | no       |

### Request Body : input.managers

| Key      | Description                                        | Required |
| -------- | -------------------------------------------------- | -------- |
| name     | 고객사 담당자 이름                                         | yes      |
| email    | 고객사 담당자 이메일                                        | no       |
| position | 고객사 담당자 직책                                         | no       |
| note     | 고객사 담당자 노트                                         | no       |
| contact  | 고객사 담당자 연락처                                        | no       |
| roles    | 고객사 담당자 역할 목록 (세금계산서 기본 담당자, 세금계산서 추가 담당자, 계약 담당자) | no       |

<br>

## Response

```json
{
  "ok": true,
  "data": {
    "id": 1,
    "title": "김철수 매니저",
    "customKey": "B5-k159402",
    "ceo": "김대표",
    "registrationNumber": "789-30-01467",
    "address": "서울특별시 서초구 프릭스로 551",
    "industry": "정보통신업",
    "category": "응용 소프트웨어 개발 및 공급업",
    "managers": [
      {
        "name": "이담당자",
        "email": "prix-customer-manager@email.com",
        "position": "이담당자 직책",
        "note": "이담당자 메모",
        "contact": "이담당자 연락처",
        "roles": ["TAX_BILL", "SUB_TAX_BILL", "CONTRACT"] // 담당자 역할
      }
    ]
  }
}
```

```json
{
  "ok": false, // api 실패
  "message": "error message", // Error가 존재하면 message(string)로 전달
  "errorCode": "ERROR_CODE"
}
```

<br>

## Error Codes

| Status Code | Error Code                        | Description                              |
| ----------- | --------------------------------- | ---------------------------------------- |
| 404         | NOT\_FOUND\_CUSTOMER              | 존재하지 않는 고객인 경우                           |
| 409         | ALREADY\_CUSTOMER\_EXISTS         | 해당 title 또는 customKey를 가진 고객이 이미 존재하는 경우 |
| 400         | CUSTOMER\_MANAGER\_NAME\_REQUIRED | 고객사 담당자 이름이 누락된 경우                       |
| 400         | CUSTOMER\_INVALID\_MANAGER\_ROLE  | 유효하지 않은 고객사 담당자 역할                       |
| 400         | CUSTOMER\_MANAGER\_MAX\_COUNT     | 최대 고객사 담당자 수를 초과한 경우                     |

<br>


---

# 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://api-kit.prix.im/platform/update-customer.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.
