# 부가기능

## 1. GetSealURL - 인감 및 첨부문서 등록 팝업 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/taxinvoice/getSealURL.png)

**전자세금계산서에 첨부될 인감, 사업자등록증, 통장사본을 등록하는 팝업 URL을 반환합니다.**

- 권장 사이즈 : width = 600px / height = 755px
- 반환되는 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: 고정값 : SEAL`

**요청 예시**

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

### Response

**응답 본문**

- url `type: string` `length: -` `description: 인감 및 첨부문서 등록 팝업 URL`

**응답 예시**

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

## 2. AttachFile - 파일 첨부

| HTTP Method | 테스트(Sandbox)                                                                | 운영(Production)                                                         |
| ----------- | --------------------------------------------------------------------------- | ---------------------------------------------------------------------- |
| POST        | <https://popbill-test.linkhub.co.kr/Taxinvoice/{MgtKeyType}/{MgtKey}/Files> | <https://popbill.linkhub.co.kr/Taxinvoice/{MgtKeyType}/{MgtKey}/Files> |

- “임시저장” 상태의 세금계산서에 1개의 파일을 첨부합니다. (최대 5개)

### Request

**요청 헤더**

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

**Path 파라미터**

- MgtKeyType `type: string` `length: -` `required: Y` `description: 문서번호 유형 (택 1)`
  - `SELL`: 매출
  - `BUY`: 매입
  - `TRUSTEE`: 위수탁
- MgtKey `type: string` `length: 24` `required: Y` `description: 파트너가 할당한 문서번호`

**요청 본문**

- Filedata `type: file` `length: -` `required: Y` `description: 파일 데이터`

**요청 예시**

```bash
curl --request POST \
  --url 'https://{domain}/Taxinvoice/{MgtKeyType}/{MgtKey}/Files' \
  --header 'Authorization: Bearer {token}' \
  --header 'Content-Type: multipart/form-data' \
  --form 'Filedata=@"/path/test.jpg"'
```

### Response

**응답 본문**

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

**응답 예시**

```json
{
    "code": 1,
    "message": "첨부 완료"
}
```

## 3. DeleteFile - 첨부파일 삭제

| HTTP Method | 테스트(Sandbox)                                                                         | 운영(Production)                                                                  |
| ----------- | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------- |
| POST        | <https://popbill-test.linkhub.co.kr/Taxinvoice/{MgtKeyType}/{MgtKey}/Files/{FileID}> | <https://popbill.linkhub.co.kr/Taxinvoice/{MgtKeyType}/{MgtKey}/Files/{FileID}> |

- “임시저장” 상태의 세금계산서에 첨부된 1개의 파일을 삭제합니다.
- 파일 식별을 위해 첨부시 할당되는 FileID는 함수 [\[GetFiles – 첨부파일 목록 확인\]](https://developers.popbill.com/api-reference/taxinvoice/api/etc#GetFiles) 를 호출하여 확인합니다.

### 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-HTTP-Method-Override `required: Y` `description: 요청 메서드 재정의`
  - `DELETE`
- X-PB-UserID `required: N` `description: 팝빌회원 아이디`

**Path 파라미터**

- MgtKeyType `type: string` `length: -` `required: Y` `description: 문서번호 유형 (택 1)`
  - `SELL`: 매출
  - `BUY`: 매입
  - `TRUSTEE`: 위수탁
- MgtKey `type: string` `length: 24` `required: Y` `description: 파트너가 할당한 문서번호`
- FileID `type: string` `length: 255` `required: Y` `description: 팝빌이 할당한 파일 식별번호`
  - 함수 [\[GetFiles – 첨부파일 목록 확인\]](https://developers.popbill.com/api-reference/taxinvoice/api/etc#GetFiles)의 리턴값 중 attachedFile 필드 참조

**요청 예시**

```bash
curl --request POST \
  --url 'https://{domain}/Taxinvoice/{MgtKeyType}/{MgtKey}/Files/{FileID}' \
  --header 'Authorization: Bearer {token}' \
  --header 'X-HTTP-Method-Override: DELETE'
```

### Response

**응답 본문**

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

**응답 예시**

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

## 4. GetFiles - 첨부파일 목록 확인

| HTTP Method | 테스트(Sandbox)                                                                | 운영(Production)                                                         |
| ----------- | --------------------------------------------------------------------------- | ---------------------------------------------------------------------- |
| GET         | <https://popbill-test.linkhub.co.kr/Taxinvoice/{MgtKeyType}/{MgtKey}/Files> | <https://popbill.linkhub.co.kr/Taxinvoice/{MgtKeyType}/{MgtKey}/Files> |

- 세금계산서에 첨부된 파일목록을 확인합니다.

### 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: 팝빌회원 아이디`

**Path 파라미터**

- MgtKeyType `type: string` `length: -` `required: Y` `description: 문서번호 유형 (택 1)`
  - `SELL`: 매출
  - `BUY`: 매입
  - `TRUSTEE`: 위수탁
- MgtKey `type: string` `length: 24` `required: Y` `description: 파트너가 할당한 문서번호`

**요청 예시**

```bash
curl --request GET \
  --url 'https://{domain}/Taxinvoice/{MgtKeyType}/{MgtKey}/Files' \
  --header 'Authorization: Bearer {token}'
```

### Response

**응답 본문**

- serialNum `type: number` `length: -` `description: 첨부파일 일련번호`
- attachedFile `type: string` `length: 255` `description: 팝빌이 할당한 파일 식별번호`
  - 팝빌이 첨부파일 관리를 위해 할당한 식별번호
  - 함수 [\[DeleteFile – 첨부파일 삭제\]](https://developers.popbill.com/api-reference/taxinvoice/api/etc#DeleteFile)호출을 위한 필수값
- fileSize `type: number` `length: -` `description: 파일 사이즈`
- displayName `type: string` `length: 255` `description: 파일명`
- regDT `type: string` `length: 14` `description: 첨부일시`
  - 형식 : yyyyMMddHHmmss

**응답 예시**

```json
[
    {
        "displayName": "test.webp",
        "attachedFile": "AF22CFC2-8CFF-4CD7-8F04-3E94BA78667E.PBF",
        "fileSize": 23162,
        "regDT": "20260904115420",
        "serialNum": 2
    }
]
```

## 5. SendEmail - 메일 재전송

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

- 세금계산서와 관련된 안내 메일을 재전송 합니다.

### 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-HTTP-Method-Override `required: Y` `description: 요청 메서드 재정의`
  - `EMAIL`
- X-PB-UserID `required: N` `description: 팝빌회원 아이디`

**Path 파라미터**

- MgtKeyType `type: string` `length: -` `required: Y` `description: 문서번호 유형 (택 1)`
  - `SELL`: 매출
  - `BUY`: 매입
  - `TRUSTEE`: 위수탁
- MgtKey `type: string` `length: 24` `required: Y` `description: 파트너가 할당한 문서번호`

**요청 본문**

- receiver `type: string` `length: -` `required: Y` `description: 수신자 메일주소`

**요청 예시**

```bash
curl --request POST \
  --url 'https://{domain}/Taxinvoice/{MgtKeyType}/{MgtKey}' \
  --header 'Authorization: Bearer {token}' \
  --header 'Content-Type: application/json' \
  --header 'X-HTTP-Method-Override: EMAIL' \
  --data '{
    "receiver": "test@test.com"
  }'
```

### Response

**응답 본문**

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

**응답 예시**

```json
{
    "code": 1,
    "message": "이메일 재전송 완료"
}
```

## 6. SendSMS - 문자 재전송

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

- 세금계산서와 관련된 안내 SMS(단문) 문자를 재전송하는 함수로, 팝빌 사이트 \[ 문자 > 결과 > 전송결과 ] 메뉴에서 전송결과를 확인할 수 있습니다.
- 메시지는 최대 90byte까지 입력 가능하고, 초과한 내용은 자동으로 삭제되어 전송합니다. (한글 최대 45자)

> API 호출 시 포인트가 차감됩니다.

### 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-HTTP-Method-Override `required: Y` `description: 요청 메서드 재정의`
  - `SMS`
- X-PB-UserID `required: N` `description: 팝빌회원 아이디`

**Path 파라미터**

- MgtKeyType `type: string` `length: -` `required: Y` `description: 문서번호 유형 (택 1)`
  - `SELL`: 매출
  - `BUY`: 매입
  - `TRUSTEE`: 위수탁
- MgtKey `type: string` `length: 24` `required: Y` `description: 파트너가 할당한 문서번호`

**요청 본문**

- sender `type: string` `length: -` `required: Y` `description: 발신번호`
- receiver `type: string` `length: -` `required: Y` `description: 수신번호`
- contents `type: string` `length: 90` `required: Y` `description: 메시지 내용`
  - 최대 90 byte까지 입력 가능하고, 초과한 내용은 자동으로 삭제되어 전송

**요청 예시**

```bash
curl --request POST \
  --url 'https://{domain}/Taxinvoice/{MgtKeyType}/{MgtKey}' \
  --header 'Authorization: Bearer {token}' \
  --header 'Content-Type: application/json' \
  --header 'X-HTTP-Method-Override: SMS' \
  --data '{
    "sender": "01012345678",
    "receiver": "01012345678",
    "contents": "메시지 내용"
  }'
```

### Response

**응답 본문**

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

**응답 예시**

```json
{
    "code": 1,
    "message": "문자알림 재전송 완료"
}
```

## 7. SendFAX - 팩스 전송

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

- 세금계산서를 팩스로 전송하는 함수로, 팝빌 사이트 \[ 팩스 > 결과 > 전송결과 ] 메뉴에서 전송결과를 확인할 수 있습니다.

> API 호출 시 포인트가 차감됩니다.

### 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-HTTP-Method-Override `required: Y` `description: 요청 메서드 재정의`
  - `FAX`
- X-PB-UserID `required: N` `description: 팝빌회원 아이디`

**Path 파라미터**

- MgtKeyType `type: string` `length: -` `required: Y` `description: 문서번호 유형 (택 1)`
  - `SELL`: 매출
  - `BUY`: 매입
  - `TRUSTEE`: 위수탁
- MgtKey `type: string` `length: 24` `required: Y` `description: 파트너가 할당한 문서번호`

**요청 본문**

- sender `type: string` `length: -` `required: Y` `description: 발신번호`
- receiver `type: string` `length: -` `required: Y` `description: 수신번호`

**요청 예시**

```bash
curl --request POST \
  --url 'https://{domain}/Taxinvoice/{MgtKeyType}/{MgtKey}' \
  --header 'Authorization: Bearer {token}' \
  --header 'Content-Type: application/json' \
  --header 'X-HTTP-Method-Override: FAX' \
  --data '{
    "sender": "01012345678",
    "receiver": "01012345678"
  }'
```

### Response

**응답 본문**

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

**응답 예시**

```json
{
    "code": 1,
    "message": "팩스 재전송 완료"
}
```

## 8. AttachStatement - 전자명세서 첨부

| HTTP Method | 테스트(Sandbox)                                                                     | 운영(Production)                                                              |
| ----------- | -------------------------------------------------------------------------------- | --------------------------------------------------------------------------- |
| POST        | <https://popbill-test.linkhub.co.kr/Taxinvoice/{MgtKeyType}/{MgtKey}/AttachStmt> | <https://popbill.linkhub.co.kr/Taxinvoice/{MgtKeyType}/{MgtKey}/AttachStmt> |

- 팝빌 전자명세서 API를 통해 발행한 전자명세서를 세금계산서에 첨부합니다.

### 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: 팝빌회원 아이디`

**Path 파라미터**

- MgtKeyType `type: string` `length: -` `required: Y` `description: 문서번호 유형 (택 1)`
  - `SELL`: 매출
  - `BUY`: 매입
  - `TRUSTEE`: 위수탁
- MgtKey `type: string` `length: 24` `required: Y` `description: 파트너가 할당한 문서번호`

**요청 본문**

- ItemCode `type: number` `length: 3` `required: Y` `description: 첨부할 전자명세서 문서 유형 (택 1)`
  - `121`: 거래명세서
  - `122`: 청구서
  - `123`: 견적서
  - `124`: 발주서
  - `125`: 입금표
  - `126`: 영수증
  - 전자명세서 발행시 입력한 값과 동일하게 작성
- MgtKey `type: string` `length: 24` `required: Y` `description: 첨부할 전자명세서 문서번호`

**요청 예시**

```bash
curl --request POST \
  --url 'https://{domain}/Taxinvoice/{MgtKeyType}/{MgtKey}/AttachStmt' \
  --header 'Authorization: Bearer {token}' \
  --header 'Content-Type: application/json' \
  --data '{
    "ItemCode": 121,
    "MgtKey": "첨부할 전자명세서 문서번호"
  }'
```

### Response

**응답 본문**

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

**응답 예시**

```json
{
    "code": 1,
    "message": "첨부 완료"
}
```

## 9. DetachStatement - 전자명세서 첨부해제

| HTTP Method | 테스트(Sandbox)                                                                     | 운영(Production)                                                              |
| ----------- | -------------------------------------------------------------------------------- | --------------------------------------------------------------------------- |
| POST        | <https://popbill-test.linkhub.co.kr/Taxinvoice/{MgtKeyType}/{MgtKey}/DetachStmt> | <https://popbill.linkhub.co.kr/Taxinvoice/{MgtKeyType}/{MgtKey}/DetachStmt> |

- 세금계산서에 첨부된 전자명세서를 해제합니다.

### 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: 팝빌회원 아이디`

**Path 파라미터**

- MgtKeyType `type: string` `length: -` `required: Y` `description: 문서번호 유형 (택 1)`
  - `SELL`: 매출
  - `BUY`: 매입
  - `TRUSTEE`: 위수탁
- MgtKey `type: string` `length: 24` `required: Y` `description: 파트너가 할당한 문서번호`

**요청 본문**

- ItemCode `type: number` `length: 3` `required: Y` `description: 첨부해제할 전자명세서 문서 유형 (택 1)`
  - `121`: 거래명세서
  - `122`: 청구서
  - `123`: 견적서
  - `124`: 발주서
  - `125`: 입금표
  - `126`: 영수증
  - 전자명세서 발행시 입력한 값과 동일하게 작성
- MgtKey `type: string` `length: 24` `required: Y` `description: 첨부해제할 전자명세서 문서번호`

**요청 예시**

```bash
curl --request POST \
  --url 'https://{domain}/Taxinvoice/{MgtKeyType}/{MgtKey}/DetachStmt' \
  --header 'Authorization: Bearer {token}' \
  --header 'Content-Type: application/json' \
  --data '{
    "ItemCode": 121,
    "MgtKey": "첨부해제할 전자명세서 문서번호"
  }'
```

### Response

**응답 본문**

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

**응답 예시**

```json
{
    "code": 1,
    "message": "첨부해제 완료"
}
```

## 10. AssignMgtKey - 문서번호 할당

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

- 팝빌 사이트를 통해 발행하여 문서번호가 할당되지 않은 세금계산서에 문서번호를 할당합니다.

### Request

**요청 헤더**

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

**Path 파라미터**

- ItemKey `type: string` `length: 18` `required: Y` `description: 파트너가 할당한 문서번호`
- MgtKeyType `type: string` `length: -` `required: Y` `description: 문서번호 유형 (택 1)`
  - `SELL`: 매출
  - `BUY`: 매입
  - `TRUSTEE`: 위수탁

**요청 본문**

- MgtKey `type: string` `length: 24` `required: Y` `description: 파트너가 할당한 문서번호`

**요청 예시**

```bash
curl --request POST \
  --url 'https://{domain}/Taxinvoice/{ItemKey}/{MgtKeyType}' \
  --header 'Authorization: Bearer {token}' \
  --header 'Content-Type: application/x-www-form-urlencoded; charset=utf-8' \
  --data-urlencode 'MgtKey=TEST0001'
```

### Response

**응답 본문**

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

**응답 예시**

```json
{
    "code": 1,
    "message": "할당 완료"
}
```

## 11. ListEmailConfig - 알림메일 발송설정 조회

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

- 세금계산서 관련 메일 항목에 대한 발송설정을 확인합니다.

### 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}/Taxinvoice/EmailSendConfig' \
  --header 'Authorization: Bearer {token}'
```

### Response

**응답 본문**

- emailType `type: string` `length: -` `description: 메일 전송 유형`
  - `TAX_ISSUE_INVOICER`: (정발행) 공급자에게 세금계산서가 발행 되었음을 알려주는 메일
  - `TAX_CHECK`: (정발행) 공급자에게 세금계산서가 수신확인 되었음을 알려주는 메일
  - `TAX_CANCEL_ISSUE`: (정발행) 공급받는자에게 세금계산서가 발행취소 되었음을 알려주는 메일
  - `TAX_REQUEST`: (역발행) 공급자에게 세금계산서를 전자서명 하여 발행을 요청하는 메일
  - `TAX_CANCEL_REQUEST`: (역발행) 공급자에게 역발행 요청이 취소 되었음을 알려주는 메일
  - `TAX_REFUSE`: (역발행) 공급받는자에게 세금계산서가 거부 되었음을 알려주는 메일
  - `TAX_REVERSE_ISSUE`: (역발행) 공급받는자에게 전자세금계산서 발행 사실을 안내하는 메일
  - `TAX_TRUST_ISSUE`: (위수탁 발행) 공급받는자에게 세금계산서가 발행 되었음을 알려주는 메일
  - `TAX_TRUST_ISSUE_TRUSTEE`: (위수탁 발행) 수탁자에게 세금계산서가 발행 되었음을 알려주는 메일
  - `TAX_TRUST_ISSUE_INVOICER`: (위수탁 발행) 공급자에게 세금계산서가 발행 되었음을 알려주는 메일
  - `TAX_TRUST_CANCEL_ISSUE`: (위수탁 발행) 공급받는자에게 세금계산서가 발행취소 되었음을 알려주는 메일
  - `TAX_TRUST_CANCEL_ISSUE_INVOICER`: (위수탁 발행) 공급자에게 세금계산서가 발행취소 되었음을 알려주는 메일
  - `TAX_CLOSEDOWN`: (처리결과) 거래처의 휴폐업 여부를 확인하여 안내하는 메일
  - `TAX_NTSFAIL_INVOICER`: (처리결과) 세금계산서 국세청 전송실패를 안내하는 메일
  - `ETC_CERT_EXPIRATION`: (정기발송) 팝빌에 등록된 인증서의 만료예정을 안내하는 메일
- sendYN `type: boolean` `length: -` `description: 전송 여부`
  - `true`: 전송
  - `false`: 미전송

**응답 예시**

```json
[
    {
        "emailType": "TAX_ISSUE_INVOICER",
        "sendYN": false
    },
    {
        "emailType": "TAX_CHECK",
        "sendYN": true
    },
    {
        "emailType": "TAX_CANCEL_ISSUE",
        "sendYN": true
    },
    {
        "emailType": "TAX_REQUEST",
        "sendYN": true
    },
    {
        "emailType": "TAX_CANCEL_REQUEST",
        "sendYN": true
    },
    {
        "emailType": "TAX_REFUSE",
        "sendYN": true
    },
    {
        "emailType": "TAX_REVERSE_ISSUE",
        "sendYN": true
    },
    {
        "emailType": "TAX_TRUST_ISSUE",
        "sendYN": true
    },
    {
        "emailType": "TAX_TRUST_ISSUE_TRUSTEE",
        "sendYN": false
    },
    {
        "emailType": "TAX_TRUST_ISSUE_INVOICER",
        "sendYN": true
    },
    {
        "emailType": "TAX_TRUST_CANCEL_ISSUE",
        "sendYN": true
    },
    {
        "emailType": "TAX_TRUST_CANCEL_ISSUE_INVOICER",
        "sendYN": true
    },
    {
        "emailType": "TAX_CLOSEDOWN",
        "sendYN": true
    },
    {
        "emailType": "TAX_NTSFAIL_INVOICER",
        "sendYN": true
    },
    {
        "emailType": "ETC_CERT_EXPIRATION",
        "sendYN": true
    }
]
```

## 12. UpdateEmailConfig - 알림메일 발송설정 수정

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

- 세금계산서 관련 메일 항목에 대한 발송설정을 수정합니다.

### 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 파라미터**

- EmailType `type: string` `length: -` `required: Y` `description: 메일 전송 유형`
  - `TAX_ISSUE_INVOICER`: (정발행) 공급자에게 세금계산서가 발행 되었음을 알려주는 메일
  - `TAX_CHECK`: (정발행) 공급자에게 세금계산서가 수신확인 되었음을 알려주는 메일
  - `TAX_CANCEL_ISSUE`: (정발행) 공급받는자에게 세금계산서가 발행취소 되었음을 알려주는 메일
  - `TAX_REQUEST`: (역발행) 공급자에게 세금계산서를 전자서명 하여 발행을 요청하는 메일
  - `TAX_CANCEL_REQUEST`: (역발행) 공급자에게 역발행 요청이 취소 되었음을 알려주는 메일
  - `TAX_REFUSE`: (역발행) 공급받는자에게 세금계산서가 거부 되었음을 알려주는 메일
  - `TAX_REVERSE_ISSUE`: (역발행) 공급받는자에게 전자세금계산서 발행 사실을 안내하는 메일
  - `TAX_TRUST_ISSUE`: (위수탁 발행) 공급받는자에게 세금계산서가 발행 되었음을 알려주는 메일
  - `TAX_TRUST_ISSUE_TRUSTEE`: (위수탁 발행) 수탁자에게 세금계산서가 발행 되었음을 알려주는 메일
  - `TAX_TRUST_ISSUE_INVOICER`: (위수탁 발행) 공급자에게 세금계산서가 발행 되었음을 알려주는 메일
  - `TAX_TRUST_CANCEL_ISSUE`: (위수탁 발행) 공급받는자에게 세금계산서가 발행취소 되었음을 알려주는 메일
  - `TAX_TRUST_CANCEL_ISSUE_INVOICER`: (위수탁 발행) 공급자에게 세금계산서가 발행취소 되었음을 알려주는 메일
  - `TAX_CLOSEDOWN`: (처리결과) 거래처의 휴폐업 여부를 확인하여 안내하는 메일
  - `TAX_NTSFAIL_INVOICER`: (처리결과) 세금계산서 국세청 전송실패를 안내하는 메일
  - `ETC_CERT_EXPIRATION`: (정기발송) 팝빌에 등록된 인증서의 만료예정을 안내하는 메일
- SendYN `type: boolean` `length: -` `required: Y` `description: 전송 여부`
  - `true`: 전송
  - `false`: 미전송

**요청 예시**

```bash
curl --request POST \
  --url 'https://{domain}/Taxinvoice/EmailSendConfig?EmailType={EmailType}&SendYN={SendYN}' \
  --header 'Authorization: Bearer {token}'
```

### Response

**응답 본문**

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

**응답 예시**

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

## 13. GetSendToNTSConfig - 국세청 전송 옵션 설정 상태 확인

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

- 연동회원의 국세청 전송 옵션 설정 상태를 확인합니다. [\[참고\] 팝빌 국세청 전송 정책](https://developers.popbill.com/guide/taxinvoice/introduction/policy-of-send-to-nts)

> 국세청 전송 옵션 설정은 팝빌 사이트 [(www.popbill.com)](https://www.popbill.com) 로그인 > 전자세금계산서 > 관리 > 환경설정 메뉴에서 설정할 수 있으며, API로 설정은 불가능 합니다.

### 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}/Taxinvoice/SendToNTSConfig' \
  --header 'Authorization: Bearer {token}'
```

### Response

**응답 본문**

- sendToNTS `type: boolean` `length: -` `description: 국세청 전송 옵션 설정 상태`
  - `true`: 발행 즉시 전송
  - `false`: 익일 자동 전송

**응답 예시**

```json
{
    "sendToNTS": true
}
```
