# 회원 관리

## 1. CheckIsMember - 연동회원 가입여부 확인

| HTTP Method | 테스트(Sandbox)                              | 운영(Production)                       |
| ----------- | ----------------------------------------- | ------------------------------------ |
| GET         | <https://popbill-test.linkhub.co.kr/Join> | <https://popbill.linkhub.co.kr/Join> |

- 사업자번호를 조회하여 연동회원 가입여부를 확인합니다.

### Request

**요청 헤더**

- Accept-Language `required: N` `description: 응답 언어 설정`
  - `ko-KR`: 기본값
  - `en-US`
- Accept-Encoding `required: N` `description: 응답 압축 방식`
  - `gzip`

**Query 파라미터**

- CorpNum `type: string` `length: 10` `required: Y` `description: 팝빌회원 사업자번호 ('-' 제외)`
- LID `type: string` `length: -` `required: Y` `description: 팝빌에서 발급한 링크아이디`

**요청 예시**

```bash
curl --request GET \
  --url 'https://{domain}/Join?CorpNum={CorpNum}&LID={LID}'
```

### Response

**응답 본문**

- code `type: number` `length: -` `description: API 처리에 대한 응답코드`
  - `0`: 미가입
  - `1`: 가입
- message `type: string` `length: -` `description: API 처리에 대한 응답메시지`

**응답 예시**

```json
{
    "code": 1,
    "message": "가입"
}
```

## 2. CheckID - 연동회원 아이디 중복 확인

| HTTP Method | 테스트(Sandbox)                                 | 운영(Production)                          |
| ----------- | -------------------------------------------- | --------------------------------------- |
| GET         | <https://popbill-test.linkhub.co.kr/IDCheck> | <https://popbill.linkhub.co.kr/IDCheck> |

- 사용하고자 하는 아이디의 중복여부를 확인합니다.

### Request

**요청 헤더**

- Accept-Language `required: N` `description: 응답 언어 설정`
  - `ko-KR`: 기본값
  - `en-US`
- Accept-Encoding `required: N` `description: 응답 압축 방식`
  - `gzip`

**Query 파라미터**

- ID `type: string` `length: 50` `required: Y` `description: 중복여부를 확인할 아이디`

**요청 예시**

```bash
curl --request GET \
  --url 'https://{domain}/IDCheck?ID={ID}'
```

### Response

**응답 본문**

- code `type: number` `length: -` `description: API 처리에 대한 응답코드`
  - `0`: 미사용
  - `1`: 사용
- message `type: string` `length: -` `description: API 처리에 대한 응답메시지`

**응답 예시**

```json
{
    "code": 1,
    "message": "해당아이디는 사용중 입니다."
}
```

## 3. JoinMember - 연동회원 신규가입

| HTTP Method | 테스트(Sandbox)                              | 운영(Production)                       |
| ----------- | ----------------------------------------- | ------------------------------------ |
| POST        | <https://popbill-test.linkhub.co.kr/Join> | <https://popbill.linkhub.co.kr/Join> |

- 프로그램 공급사의 고객사를 팝빌 연동회원으로 가입하는 API 입니다.

> 회원의 정보가 현행화 되지 않은 경우 연동회원 신규가입 API 사용이 제한될 수 있으니 유의하시기 바랍니다.

### Request

**요청 헤더**

- Content-Type `required: Y` `description: 요청 본문 형식`
  - `application/json`
- Accept-Language `required: N` `description: 응답 언어 설정`
  - `ko-KR`: 기본값
  - `en-US`
- Accept-Encoding `required: N` `description: 응답 압축 방식`
  - `gzip`

**요청 본문**

- ID `type: string` `length: 50` `required: Y` `description: 아이디`
  - 6자 이상 50자 이하
- Password `type: string` `length: 20` `required: Y` `description: 비밀번호`
  - 8자 이상 20자 이하
  - 영문, 숫자, 특수문자(\~!@#$%^&\*()\_+) 포함
- LinkID `type: string` `length: 20` `required: Y` `description: 파트너 링크아이디`
  - 팝빌에서 발급한 링크아이디
- CorpNum `type: string` `length: 10` `required: Y` `description: 사업자번호 ('-' 제외)`
- CEOName `type: string` `length: 100` `required: Y` `description: 대표자 성명`
- CorpName `type: string` `length: 200` `required: Y` `description: 회사명`
- Addr `type: string` `length: 300` `required: Y` `description: 사업장 주소`
- BizType `type: string` `length: 100` `required: Y` `description: 업태`
- BizClass `type: string` `length: 100` `required: Y` `description: 종목`
- ContactName `type: string` `length: 100` `required: Y` `description: 담당자 성명`
- ContactEmail `type: string` `length: 100` `required: Y` `description: 담당자 메일`
- ContactTEL `type: string` `length: 20` `required: Y` `description: 담당자 휴대폰`

**요청 예시**

```bash
curl --request POST \
  --url 'https://{domain}/Join' \
  --header 'Content-Type: application/json' \
  --data '{
    "ID": "test",
    "Password": "test",
    "LinkID": "TESTER",
    "CorpNum": "1234567890",
    "CEOName": "대표자명",
    "CorpName": "회사명",
    "Addr": "주소",
    "BizType": "업태",
    "BizClass": "종목",
    "ContactName": "담당자명",
    "ContactEmail": "test@test.com",
    "ContactTEL": "01012345678"
  }'
```

### Response

**응답 본문**

- code `type: number` `length: -` `description: API 처리에 대한 응답코드`
  - `1`: 성공
- message `type: string` `length: -` `description: API 처리에 대한 응답메시지`

**응답 예시**

```json
{
    "code": 1,
    "message": "가입 완료"
}
```

## 4. QuitMember - 연동회원 탈퇴

| HTTP Method | 테스트(Sandbox)                                     | 운영(Production)                              |
| ----------- | ------------------------------------------------ | ------------------------------------------- |
| POST        | <https://popbill-test.linkhub.co.kr/QuitRequest> | <https://popbill.linkhub.co.kr/QuitRequest> |

- 팝빌 연동회원을 탈퇴 처리합니다.
- 관리자를 포함한 모든 담당자가 일괄 삭제 처리됩니다.

> 잔여포인트가 존재하는 경우, \[환불신청 → 회원탈퇴] 프로세스로 구현하시기를 권장합니다.\
> 회원탈퇴 직후 동일 사업자번호 및 아이디로 재가입이 가능합니다.

### Request

**요청 헤더**

- Authorization `required: Y` `description: 인증 토큰`
  - [\[참고\] 인증 및 헤더 설정](https://developers.popbill.com/api-reference/taxinvoice/getting-started/authorization)
- Content-Type `required: Y` `description: 요청 본문 형식`
  - `application/json`
- Accept-Language `required: N` `description: 응답 언어 설정`
  - `ko-KR`: 기본값
  - `en-US`
- Accept-Encoding `required: N` `description: 응답 압축 방식`
  - `gzip`
- X-PB-UserID `required: N` `description: 팝빌회원 아이디`

**요청 본문**

- quitReason `type: string` `length: 200` `required: Y` `description: 회원 탈퇴 사유`

**요청 예시**

```bash
curl --request POST \
  --url 'https://{domain}/QuitRequest' \
  --header 'Authorization: Bearer {token}' \
  --header 'Content-Type: application/json' \
  --data '{
    "quitReason": "회원 탈퇴 사유"
  }'
```

### Response

**응답 본문**

- code `type: number` `length: -` `description: API 처리에 대한 응답코드`
  - `1`: 성공
- message `type: string` `length: -` `description: API 처리에 대한 응답메시지`

**응답 예시**

```json
{
    "code": 1,
    "message": "신청 완료"
}
```

## 5. GetCorpInfo - 회사정보 확인

| HTTP Method | 테스트(Sandbox)                                  | 운영(Production)                           |
| ----------- | --------------------------------------------- | ---------------------------------------- |
| GET         | <https://popbill-test.linkhub.co.kr/CorpInfo> | <https://popbill.linkhub.co.kr/CorpInfo> |

- 연동회원의 회사정보를 확인합니다.

### Request

**요청 헤더**

- Authorization `required: Y` `description: 인증 토큰`
  - [\[참고\] 인증 및 헤더 설정](https://developers.popbill.com/api-reference/taxinvoice/getting-started/authorization)
- Accept-Language `required: N` `description: 응답 언어 설정`
  - `ko-KR`: 기본값
  - `en-US`
- Accept-Encoding `required: N` `description: 응답 압축 방식`
  - `gzip`
- X-PB-UserID `required: N` `description: 팝빌회원 아이디`

**요청 예시**

```bash
curl --request GET \
  --url 'https://{domain}/CorpInfo' \
  --header 'Authorization: Bearer {token}'
```

### Response

**응답 본문**

- ceoname `type: string` `length: 100` `description: 대표자 성명`
- corpName `type: string` `length: 200` `description: 회사명`
- addr `type: string` `length: 300` `description: 주소`
- bizType `type: string` `length: 100` `description: 업태`
- bizClass `type: string` `length: 100` `description: 종목`

**응답 예시**

```json
{
    "ceoname": "대표자명",
    "corpName": "회사명",
    "addr": "주소",
    "bizType": "업태",
    "bizClass": "종목"
}
```

## 6. UpdateCorpInfo - 회사정보 수정

| HTTP Method | 테스트(Sandbox)                                  | 운영(Production)                           |
| ----------- | --------------------------------------------- | ---------------------------------------- |
| POST        | <https://popbill-test.linkhub.co.kr/CorpInfo> | <https://popbill.linkhub.co.kr/CorpInfo> |

- 연동회원의 회사정보를 수정합니다.

### Request

**요청 헤더**

- Authorization `required: Y` `description: 인증 토큰`
  - [\[참고\] 인증 및 헤더 설정](https://developers.popbill.com/api-reference/taxinvoice/getting-started/authorization)
- Content-Type `required: Y` `description: 요청 본문 형식`
  - `application/json`
- Accept-Language `required: N` `description: 응답 언어 설정`
  - `ko-KR`: 기본값
  - `en-US`
- Accept-Encoding `required: N` `description: 응답 압축 방식`
  - `gzip`
- X-PB-UserID `required: N` `description: 팝빌회원 아이디`

**요청 본문**

- ceoname `type: string` `length: 100` `required: Y` `description: 대표자 성명`
- corpName `type: string` `length: 200` `required: Y` `description: 회사명`
- addr `type: string` `length: 300` `required: Y` `description: 주소`
- bizType `type: string` `length: 100` `required: Y` `description: 업태`
- bizClass `type: string` `length: 100` `required: Y` `description: 종목`

**요청 예시**

```bash
curl --request POST \
  --url 'https://{domain}/CorpInfo' \
  --header 'Authorization: Bearer {token}' \
  --header 'Content-Type: application/json' \
  --data '{
    "ceoname": "대표자명",
    "corpName": "회사명",
    "addr": "주소",
    "bizType": "업태",
    "bizClass": "종목"
  }'
```

### Response

**응답 본문**

- code `type: number` `length: -` `description: API 처리에 대한 응답코드`
  - `1`: 성공
- message `type: string` `length: -` `description: API 처리에 대한 응답메시지`

**응답 예시**

```json
{
    "code": 1,
    "message": "수정 완료"
}
```

## 7. RegistContact - 담당자 추가

| HTTP Method | 테스트(Sandbox)                                 | 운영(Production)                          |
| ----------- | -------------------------------------------- | --------------------------------------- |
| POST        | <https://popbill-test.linkhub.co.kr/IDs/New> | <https://popbill.linkhub.co.kr/IDs/New> |

- 연동회원에 담당자를 추가합니다.

### Request

**요청 헤더**

- Authorization `required: Y` `description: 인증 토큰`
  - [\[참고\] 인증 및 헤더 설정](https://developers.popbill.com/api-reference/taxinvoice/getting-started/authorization)
- Content-Type `required: Y` `description: 요청 본문 형식`
  - `application/json`
- Accept-Language `required: N` `description: 응답 언어 설정`
  - `ko-KR`: 기본값
  - `en-US`
- Accept-Encoding `required: N` `description: 응답 압축 방식`
  - `gzip`
- X-PB-UserID `required: N` `description: 팝빌회원 아이디`

**요청 본문**

- id `type: string` `length: 50` `required: Y` `description: 아이디`
  - 6자 이상 50자 이하
- password `type: string` `length: 20` `required: Y` `description: 비밀번호`
  - 8자 이상 20자 이하
  - 영문, 숫자, 특수문자(\~!@#$%^&\*()\_+) 포함
- personName `type: string` `length: 100` `required: Y` `description: 담당자 성명`
- tel `type: string` `length: 20` `required: Y` `description: 담당자 휴대폰`
- email `type: string` `length: 100` `required: Y` `description: 담당자 메일`
- searchRole `type: number` `length: 1` `required: N` `description: 권한`
  - `1`: 개인권한
  - `2`: 읽기권한
  - `3`: 회사권한 : 기본값

**요청 예시**

```bash
curl --request POST \
  --url 'https://{domain}/IDs/New' \
  --header 'Authorization: Bearer {token}' \
  --header 'Content-Type: application/json' \
  --data '{
    "id": "test",
    "password": "test",
    "personName": "담당자명",
    "tel": "01012345678",
    "email": "test@test.com"
  }'
```

### Response

**응답 본문**

- code `type: number` `length: -` `description: API 처리에 대한 응답코드`
  - `1`: 성공
- message `type: string` `length: -` `description: API 처리에 대한 응답메시지`

**응답 예시**

```json
{
    "code": 1,
    "message": "추가 완료"
}
```

## 8. GetContactInfo - 담당자 정보 확인

| HTTP Method | 테스트(Sandbox)                                 | 운영(Production)                          |
| ----------- | -------------------------------------------- | --------------------------------------- |
| POST        | <https://popbill-test.linkhub.co.kr/Contact> | <https://popbill.linkhub.co.kr/Contact> |

- 연동회원에 추가된 담당자 정보를 확인합니다.

### Request

**요청 헤더**

- Authorization `required: Y` `description: 인증 토큰`
  - [\[참고\] 인증 및 헤더 설정](https://developers.popbill.com/api-reference/taxinvoice/getting-started/authorization)
- Content-Type `required: Y` `description: 요청 본문 형식`
  - `application/json`
- Accept-Language `required: N` `description: 응답 언어 설정`
  - `ko-KR`: 기본값
  - `en-US`
- Accept-Encoding `required: N` `description: 응답 압축 방식`
  - `gzip`
- X-PB-UserID `required: N` `description: 팝빌회원 아이디`

**요청 본문**

- id `type: string` `length: 50` `required: Y` `description: 담당자 아이디`

**요청 예시**

```bash
curl --request POST \
  --url 'https://{domain}/Contact' \
  --header 'Authorization: Bearer {token}' \
  --header 'Content-Type: application/json' \
  --data '{
    "id": "test"
  }'
```

### Response

**응답 본문**

- id `type: string` `length: 50` `description: 담당자 아이디`
- personName `type: string` `length: 100` `description: 담당자 성명`
- tel `type: string` `length: 20` `description: 담당자 휴대폰`
- email `type: string` `length: 100` `description: 담당자 메일`
- regDT `type: string` `length: 14` `description: 등록일시`
  - 형식 : yyyyMMddHHmmss
- searchRole `type: number` `length: 1` `description: 권한`
  - `1`: 개인권한
  - `2`: 읽기권한
  - `3`: 회사권한
- mgrYN `type: boolean` `length: -` `description: 역할`
  - `true`: 관리자
  - `false`: 담당자
  - 팝빌 사이트 \[ 마이페이지 > 회사정보 > 담당자 관리 ] 메뉴에서 수정 가능
- state `type: number` `length: 1` `description: 계정상태`
  - `1`: 사용중

**응답 예시**

```json
{
    "id": "test",
    "personName": "담당자명",
    "tel": "010-1234-5678",
    "email": "test@test.com",
    "regDT": "20250711112027",
    "mgrYN": true,
    "state": 1,
    "searchRole": 3
}
```

## 9. ListContact - 담당자 목록 확인

| HTTP Method | 테스트(Sandbox)                             | 운영(Production)                      |
| ----------- | ---------------------------------------- | ----------------------------------- |
| GET         | <https://popbill-test.linkhub.co.kr/IDs> | <https://popbill.linkhub.co.kr/IDs> |

- 연동회원에 추가된 담당자 목록을 확인합니다.

### Request

**요청 헤더**

- Authorization `required: Y` `description: 인증 토큰`
  - [\[참고\] 인증 및 헤더 설정](https://developers.popbill.com/api-reference/taxinvoice/getting-started/authorization)
- Accept-Language `required: N` `description: 응답 언어 설정`
  - `ko-KR`: 기본값
  - `en-US`
- Accept-Encoding `required: N` `description: 응답 압축 방식`
  - `gzip`
- X-PB-UserID `required: N` `description: 팝빌회원 아이디`

**요청 예시**

```bash
curl --request GET \
  --url 'https://{domain}/IDs' \
  --header 'Authorization: Bearer {token}'
```

### Response

**응답 본문**

- id `type: string` `length: 50` `description: 담당자 아이디`
- personName `type: string` `length: 100` `description: 담당자 성명`
- tel `type: string` `length: 20` `description: 담당자 휴대폰`
- email `type: string` `length: 100` `description: 담당자 메일`
- regDT `type: string` `length: 14` `description: 등록일시`
  - 형식 : yyyyMMddHHmmss
- searchRole `type: number` `length: 1` `description: 권한`
  - `1`: 개인권한
  - `2`: 읽기권한
  - `3`: 회사권한
- mgrYN `type: boolean` `length: -` `description: 역할`
  - `true`: 관리자
  - `false`: 담당자
  - 팝빌 사이트 \[ 마이페이지 > 회사정보 > 담당자 관리 ] 메뉴에서 수정 가능
- state `type: number` `length: 1` `description: 계정상태`
  - `1`: 사용중

**응답 예시**

```json
[
  {
      "id": "test",
      "personName": "담당자명",
      "tel": "010-1234-5678",
      "email": "test@test.com",
      "regDT": "20250711112027",
      "mgrYN": true,
      "state": 1,
      "searchRole": 3
  }
]
```

## 10. UpdateContact - 담당자 정보 수정

| HTTP Method | 테스트(Sandbox)                             | 운영(Production)                      |
| ----------- | ---------------------------------------- | ----------------------------------- |
| POST        | <https://popbill-test.linkhub.co.kr/IDs> | <https://popbill.linkhub.co.kr/IDs> |

- 연동회원에 추가된 담당자 정보를 수정합니다.

### Request

**요청 헤더**

- Authorization `required: Y` `description: 인증 토큰`
  - [\[참고\] 인증 및 헤더 설정](https://developers.popbill.com/api-reference/taxinvoice/getting-started/authorization)
- Content-Type `required: Y` `description: 요청 본문 형식`
  - `application/json`
- Accept-Language `required: N` `description: 응답 언어 설정`
  - `ko-KR`: 기본값
  - `en-US`
- Accept-Encoding `required: N` `description: 응답 압축 방식`
  - `gzip`
- X-PB-UserID `required: N` `description: 팝빌회원 아이디`

**요청 본문**

- id `type: string` `length: 50` `required: Y` `description: 아이디`
  - 6자 이상 50자 이하
- personName `type: string` `length: 100` `required: Y` `description: 담당자 성명`
- tel `type: string` `length: 20` `required: Y` `description: 담당자 휴대폰`
- email `type: string` `length: 100` `required: Y` `description: 담당자 메일`
- searchRole `type: number` `length: 1` `required: N` `description: 권한`
  - `1`: 개인권한
  - `2`: 읽기권한
  - `3`: 회사권한 : 기본값

**요청 예시**

```bash
curl --request POST \
  --url 'https://{domain}/IDs' \
  --header 'Authorization: Bearer {token}' \
  --header 'Content-Type: application/json' \
  --data '{
    "id": "test",
    "personName": "담당자명",
    "tel": "01012345678",
    "email": "test@test.com",
    "searchRole": 3
  }'
```

### Response

**응답 본문**

- code `type: number` `length: -` `description: API 처리에 대한 응답코드`
  - `1`: 성공
- message `type: string` `length: -` `description: API 처리에 대한 응답메시지`

**응답 예시**

```json
{
    "code": 1,
    "message": "수정 완료"
}
```

## 11. DeleteContact - 담당자 삭제

| HTTP Method | 테스트(Sandbox)                                        | 운영(Production)                                 |
| ----------- | --------------------------------------------------- | ---------------------------------------------- |
| POST        | <https://popbill-test.linkhub.co.kr/Contact/Delete> | <https://popbill.linkhub.co.kr/Contact/Delete> |

- 연동회원에 추가된 담당자를 삭제합니다.

### Request

**요청 헤더**

- Authorization `required: Y` `description: 인증 토큰`
  - [\[참고\] 인증 및 헤더 설정](https://developers.popbill.com/api-reference/taxinvoice/getting-started/authorization)
- Accept-Language `required: N` `description: 응답 언어 설정`
  - `ko-KR`: 기본값
  - `en-US`
- Accept-Encoding `required: N` `description: 응답 압축 방식`
  - `gzip`
- X-PB-UserID `required: Y` `description: 팝빌회원 아이디`
  - 관리자만 요청 가능

**Query 파라미터**

- ContactID `type: string` `length: 50` `required: Y` `description: 삭제할 담당자 아이디`
  - 관리자는 삭제 불가

**요청 예시**

```bash
curl --request POST \
  --url 'https://{domain}/Contact/Delete?ContactID={ContactID}' \
  --header 'Authorization: Bearer {token}'
```

### Response

**응답 본문**

- code `type: number` `length: -` `description: API 처리에 대한 응답코드`
  - `1`: 성공
- message `type: string` `length: -` `description: API 처리에 대한 응답메시지`

**응답 예시**

```json
{
    "code": 1,
    "message": "삭제 완료"
}
```

## 12. GetAccessURL - 팝빌 로그인 팝업 URL

| HTTP Method | 테스트(Sandbox)                                | 운영(Production)                         |
| ----------- | ------------------------------------------- | -------------------------------------- |
| GET         | <https://popbill-test.linkhub.co.kr/Member> | <https://popbill.linkhub.co.kr/Member> |

![팝빌 로그인 팝업 URL 미리보기](https://developers.popbill.com/images/reference/member/getAccessURL.png)

**팝빌 회원 로그인 상태의 팝업 URL을 반환합니다.**

- 권장 사이즈 : width = 1,280px (최소 1,000px) / height = 800px
- 반환되는 URL은 30초 동안만 사용이 가능합니다.
- 반환되는 URL은 팝빌회원의 로그인 세션을 포함하고 있으니 사용에 유의하여 주시기 바랍니다.

### Request

**요청 헤더**

- Authorization `required: Y` `description: 인증 토큰`
  - [\[참고\] 인증 및 헤더 설정](https://developers.popbill.com/api-reference/taxinvoice/getting-started/authorization)
- Accept-Language `required: N` `description: 응답 언어 설정`
  - `ko-KR`: 기본값
  - `en-US`
- Accept-Encoding `required: N` `description: 응답 압축 방식`
  - `gzip`
- X-PB-UserID `required: N` `description: 팝빌회원 아이디`

**Query 파라미터**

- TG `type: string` `length: -` `required: Y` `description: 고정값 : LOGIN`

**요청 예시**

```bash
curl --request GET \
  --url 'https://{domain}/Member?TG=LOGIN' \
  --header 'Authorization: Bearer {token}'
```

### Response

**응답 본문**

- url `type: string` `length: -` `description: 팝빌 로그인 팝업 URL`

**응답 예시**

```json
{
    "url": "https://test.popbill.com/App/API?T=FFXMY6SEHFVDD27TUYBESQ7...XYK2NPF5NLWKD2==="
}
```
