# 부가기능

## 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/statement/getSealURL.png)

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

- 권장 사이즈 : width = 600px / height = 755px
- 반환되는 URL은 30초 동안만 사용이 가능합니다.
- 반환되는 URL에서만 유효한 세션을 포함하고 있습니다.

> 인감을 등록한 이후 전자명세서를 발행하는 경우, 자동으로 등록된 인감이 첨부되어 전자명세서가 발행됩니다.

### Request

**요청 헤더**

- Authorization `required: Y` `description: 인증 토큰`
  - [\[참고\] 인증 및 헤더 설정](https://developers.popbill.com/api-reference/statement/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/Statement/{ItemCode}/{MgtKey}/Files> | <https://popbill.linkhub.co.kr/Statement/{ItemCode}/{MgtKey}/Files> |

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

### Request

**요청 헤더**

- Authorization `required: Y` `description: 인증 토큰`
  - [\[참고\] 인증 및 헤더 설정](https://developers.popbill.com/api-reference/statement/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 파라미터**

- ItemCode `type: number` `length: -` `required: Y` `description: 전자명세서 문서 유형 (택 1)`
  - `121`: 거래명세서
  - `122`: 청구서
  - `123`: 견적서
  - `124`: 발주서
  - `125`: 입금표
  - `126`: 영수증
- MgtKey `type: string` `length: 24` `required: Y` `description: 파트너가 할당한 문서번호`

**요청 본문**

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

**요청 예시**

```bash
curl --request POST \
  --url 'https://{domain}/Statement/{ItemCode}/{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/Statement/{ItemCode}/{MgtKey}/Files/{FileID}> | <https://popbill.linkhub.co.kr/Statement/{ItemCode}/{MgtKey}/Files/{FileID}> |

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

### Request

**요청 헤더**

- Authorization `required: Y` `description: 인증 토큰`
  - [\[참고\] 인증 및 헤더 설정](https://developers.popbill.com/api-reference/statement/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 파라미터**

- ItemCode `type: number` `length: -` `required: Y` `description: 전자명세서 문서 유형 (택 1)`
  - `121`: 거래명세서
  - `122`: 청구서
  - `123`: 견적서
  - `124`: 발주서
  - `125`: 입금표
  - `126`: 영수증
- MgtKey `type: string` `length: 24` `required: Y` `description: 파트너가 할당한 문서번호`
- FileID `type: string` `length: 255` `required: Y` `description: 팝빌이 할당한 파일 식별번호`
  - [\[GetFiles – 첨부파일 목록 확인\]](https://developers.popbill.com/api-reference/statement/api/etc#GetFiles) API의 리턴값 중 \`attachedFile\` 필드 참조

**요청 예시**

```bash
curl --request POST \
  --url 'https://{domain}/Statement/{ItemCode}/{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/Statement/{ItemCode}/{MgtKey}/Files> | <https://popbill.linkhub.co.kr/Statement/{ItemCode}/{MgtKey}/Files> |

- 전자명세서에 첨부된 파일목록을 확인합니다.

### Request

**요청 헤더**

- Authorization `required: Y` `description: 인증 토큰`
  - [\[참고\] 인증 및 헤더 설정](https://developers.popbill.com/api-reference/statement/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 파라미터**

- ItemCode `type: number` `length: -` `required: Y` `description: 전자명세서 문서 유형 (택 1)`
  - `121`: 거래명세서
  - `122`: 청구서
  - `123`: 견적서
  - `124`: 발주서
  - `125`: 입금표
  - `126`: 영수증
- MgtKey `type: string` `length: 24` `required: Y` `description: 파트너가 할당한 문서번호`

**요청 예시**

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

### Response

**응답 본문**

- serialNum `type: number` `length: 1` `description: 첨부파일 일련번호`
- attachedFile `type: string` `length: 255` `description: 팝빌이 할당한 파일 식별번호`
- 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/Statement/{ItemCode}/{MgtKey}> | <https://popbill.linkhub.co.kr/Statement/{ItemCode}/{MgtKey}> |

- “승인대기”, “발행완료” 상태의 전자명세서와 관련된 발행 안내 메일을 재전송 합니다.

### Request

**요청 헤더**

- Authorization `required: Y` `description: 인증 토큰`
  - [\[참고\] 인증 및 헤더 설정](https://developers.popbill.com/api-reference/statement/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 파라미터**

- ItemCode `type: number` `length: -` `required: Y` `description: 전자명세서 문서 유형 (택 1)`
  - `121`: 거래명세서
  - `122`: 청구서
  - `123`: 견적서
  - `124`: 발주서
  - `125`: 입금표
  - `126`: 영수증
- MgtKey `type: string` `length: 24` `required: Y` `description: 파트너가 할당한 문서번호`

**요청 본문**

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

**요청 예시**

```bash
curl --request POST \
  --url 'https://{domain}/Statement/{ItemCode}/{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/Statement/{ItemCode}/{MgtKey}> | <https://popbill.linkhub.co.kr/Statement/{ItemCode}/{MgtKey}> |

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

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

### Request

**요청 헤더**

- Authorization `required: Y` `description: 인증 토큰`
  - [\[참고\] 인증 및 헤더 설정](https://developers.popbill.com/api-reference/statement/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 파라미터**

- ItemCode `type: number` `length: -` `required: Y` `description: 전자명세서 문서 유형 (택 1)`
  - `121`: 거래명세서
  - `122`: 청구서
  - `123`: 견적서
  - `124`: 발주서
  - `125`: 입금표
  - `126`: 영수증
- 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}/Statement/{ItemCode}/{MgtKey}' \
  --header 'Authorization: Bearer {token}' \
  --header 'Content-Type: application/json' \
  --header 'X-HTTP-Method-Override: SMS' \
  --data '{
    "sender": "발신번호",
    "receiver": "수신번호",
    "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/Statement/{ItemCode}/{MgtKey}> | <https://popbill.linkhub.co.kr/Statement/{ItemCode}/{MgtKey}> |

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

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

### Request

**요청 헤더**

- Authorization `required: Y` `description: 인증 토큰`
  - [\[참고\] 인증 및 헤더 설정](https://developers.popbill.com/api-reference/statement/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 파라미터**

- ItemCode `type: number` `length: -` `required: Y` `description: 전자명세서 문서 유형 (택 1)`
  - `121`: 거래명세서
  - `122`: 청구서
  - `123`: 견적서
  - `124`: 발주서
  - `125`: 입금표
  - `126`: 영수증
- 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}/Statement/{ItemCode}/{MgtKey}' \
  --header 'Authorization: Bearer {token}' \
  --header 'Content-Type: application/json' \
  --header 'X-HTTP-Method-Override: FAX' \
  --data '{
    "sender": "발신번호",
    "receiver": "수신번호"
  }'
```

### Response

**응답 본문**

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

**응답 예시**

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

## 8. FAXSend - 선팩스 전송

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

- 전자명세서를 팩스로 전송하는 함수로, 팝빌에 데이터를 저장하는 과정이 없습니다.
- 팝빌 사이트 \[ 팩스 > 결과 > 전송결과 ] 메뉴에서 전송결과를 확인할 수 있습니다.

### Request

**요청 헤더**

- Authorization `required: Y` `description: 인증 토큰`
  - [\[참고\] 인증 및 헤더 설정](https://developers.popbill.com/api-reference/statement/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: 팝빌회원 아이디`

**요청 본문**

- itemCode `type: number` `length: 3` `required: Y` `description: 전자명세서 문서 유형 (택 1)`
  - `121`: 거래명세서
  - `122`: 청구서
  - `123`: 견적서
  - `124`: 발주서
  - `125`: 입금표
  - `126`: 영수증
- mgtKey `type: string` `length: 24` `required: Y` `description: 문서번호`
  - 전자명세서 관리를 위해 파트너가 할당하는 식별번호
  - 영문 대소문자, 숫자, 특수문자('-','\_')만 이용 가능
- formCode `type: string` `length: 8` `required: N` `description: 맞춤양식 코드`
  - 기본값 : 팝빌에서 설정한 기본양식 사용
- writeDate `type: string` `length: 8` `required: Y` `description: 작성일자`
  - 형식 : yyyyMMdd
- taxType `type: string` `length: 2` `required: 조건부` `description: 과세형태 (택 1)`
  - `과세`
  - `영세`
  - `면세`
  - {itemCode}=121 경우 필수
- purposeType `type: string` `length: 2` `required: Y` `description: 영수/청구 (택 1)`
  - `영수`
  - `청구`
  - `없음`
- serialNum `type: string` `length: 30` `required: N` `description: 일련번호`
- taxTotal `type: string` `length: 18` `required: Y` `description: 세액 합계`
  - 정수만 입력 가능
  - 마이너스 금액 입력 가능, 소수점 아래 자동 절사
- supplyCostTotal `type: string` `length: 18` `required: Y` `description: 공급가액 합계`
  - 정수만 입력 가능
  - 마이너스 금액 입력 가능, 소수점 아래 자동 절사
- totalAmount `type: string` `length: 18` `required: N` `description: 합계금액`
  - 정수만 입력 가능
  - 마이너스 금액 입력 가능, 소수점 아래 자동 절사
- remark1 `type: string` `length: 150` `required: N` `description: 비고1`
- remark2 `type: string` `length: 150` `required: N` `description: 비고2`
- remark3 `type: string` `length: 150` `required: N` `description: 비고3`
- senderCorpNum `type: string` `length: 10` `required: Y` `description: 발신자 사업자번호 ('-' 제외)`
- senderTaxRegID `type: string` `length: 4` `required: N` `description: 발신자 종사업장 식별번호`
  - 종사업장 식별번호는 4자리 숫자로만 구성
- senderCorpName `type: string` `length: 200` `required: N` `description: 발신자 상호`
- senderCEOName `type: string` `length: 100` `required: N` `description: 발신자 대표자성명`
- senderAddr `type: string` `length: 300` `required: N` `description: 발신자 주소`
- senderBizType `type: string` `length: 100` `required: N` `description: 발신자 업태`
- senderBizClass `type: string` `length: 100` `required: N` `description: 발신자 종목`
- senderContactName `type: string` `length: 100` `required: N` `description: 발신자 성명`
- senderDeptName `type: string` `length: 40` `required: N` `description: 발신자 부서명`
- senderTEL `type: string` `length: 20` `required: N` `description: 발신자 연락처`
- senderHP `type: string` `length: 20` `required: N` `description: 발신자 휴대전화`
- senderEmail `type: string` `length: 100` `required: N` `description: 발신자 메일주소`
- senderFAX `type: string` `length: 20` `required: N` `description: 발신자 팩스번호`
- receiverCorpNum `type: string` `length: 10` `required: N` `description: 수신자 사업자번호 ('-' 제외)`
- receiverTaxRegID `type: string` `length: 4` `required: N` `description: 수신자 종사업장 식별번호`
  - 종사업장 식별번호는 4자리 숫자로만 구성
- receiverCorpName `type: string` `length: 200` `required: N` `description: 수신자 상호`
- receiverCEOName `type: string` `length: 100` `required: N` `description: 수신자 대표자성명`
- receiverAddr `type: string` `length: 300` `required: N` `description: 수신자 주소`
- receiverBizType `type: string` `length: 100` `required: N` `description: 수신자 업태`
- receiverBizClass `type: string` `length: 100` `required: N` `description: 수신자 종목`
- receiverContactName `type: string` `length: 100` `required: N` `description: 수신자 성명`
- receiverDeptName `type: string` `length: 40` `required: N` `description: 수신자 부서명`
- receiverTEL `type: string` `length: 20` `required: N` `description: 수신자 연락처`
- receiverHP `type: string` `length: 20` `required: N` `description: 수신자 휴대전화`
- receiverEmail `type: string` `length: 100` `required: N` `description: 수신자 메일주소`
- receiverFAX `type: string` `length: 20` `required: N` `description: 수신자 팩스번호`
- businessLicenseYN `type: boolean` `length: -` `required: N` `description: 팝빌에 등록된 사업자등록증 첨부 여부`
  - `true`: 첨부
  - `false`: 미첨부 : 기본값
  - 팝빌 사이트 또는 [\[GetSealURL - 인감 및 첨부문서 등록 팝업 URL\]](https://developers.popbill.com/api-reference/statement/api/etc#GetSealURL)을 이용하여 등록
- bankBookYN `type: boolean` `length: -` `required: N` `description: 팝빌에 등록된 통장사본 첨부 여부`
  - `true`: 첨부
  - `false`: 미첨부 : 기본값
  - 팝빌 사이트 또는 [\[GetSealURL - 인감 및 첨부문서 등록 팝업 URL\]](https://developers.popbill.com/api-reference/statement/api/etc#GetSealURL)을 이용하여 등록
- smssendYN `type: boolean` `length: -` `required: N` `description: 알림문자 전송 여부`
  - `true`: 전송
  - `false`: 미전송 : 기본값
  - 수신자 : 수신자 휴대폰번호 {receiverHP}
  - 문자 전송 포인트가 차감(단, 전송실패 건은 환불)
- propertyBag `type: object` `length: -` `required: N` `description: 추가속성`
  - 전자명세서 종류별 추가할 속성을 "key", "value" 형식으로 값을 입력 [\[참고\] 기본양식 추가속성](https://developers.popbill.com/guide/statement/introduction/statement-form#propertybag-table)
- detailList `type: array` `length: -` `required: N` `description: 거래 물품 상세정보`
  - 길이 제한 없음
  - serialNum `type: number` `length: -` `required: Y` `description: 일련번호`
    - 1부터 순차적으로 입력
  - purchaseDT `type: string` `length: 8` `required: N` `description: 거래일자`
    - 형식 : yyyyMMdd
  - itemName `type: string` `length: 100` `required: N` `description: 품명`
  - spec `type: string` `length: 60` `required: N` `description: 규격`
  - qty `type: string` `length: 12` `required: N` `description: 수량`
    - 소수점 아래 2번째 자리까지 입력 가능
  - unitCost `type: string` `length: 18` `required: N` `description: 단가`
    - 소수점 아래 2번째 자리까지 입력 가능
    - 마이너스 금액 입력 가능
  - supplyCost `type: string` `length: 18` `required: N` `description: 공급가액`
    - 정수만 입력 가능
    - 마이너스 금액 입력 가능, 소수점 아래 자동 절사
  - tax `type: string` `length: 18` `required: N` `description: 세액`
    - 정수만 입력 가능
    - 마이너스 금액 입력 가능, 소수점 아래 자동 절사
  - remark `type: string` `length: 100` `required: N` `description: 비고`
  - spare1 `type: string` `length: 100` `required: N` `description: 여분1`
  - spare2 `type: string` `length: 100` `required: N` `description: 여분2`
  - spare3 `type: string` `length: 100` `required: N` `description: 여분3`
  - spare4 `type: string` `length: 100` `required: N` `description: 여분4`
  - spare5 `type: string` `length: 100` `required: N` `description: 여분5`
  - spare6 `type: string` `length: 100` `required: N` `description: 여분6`
  - spare7 `type: string` `length: 100` `required: N` `description: 여분7`
  - spare8 `type: string` `length: 100` `required: N` `description: 여분8`
  - spare9 `type: string` `length: 100` `required: N` `description: 여분9`
  - spare10 `type: string` `length: 100` `required: N` `description: 여분10`
  - spare11 `type: string` `length: 100` `required: N` `description: 여분11`
  - spare12 `type: string` `length: 100` `required: N` `description: 여분12`
  - spare13 `type: string` `length: 100` `required: N` `description: 여분13`
  - spare14 `type: string` `length: 100` `required: N` `description: 여분14`
  - spare15 `type: string` `length: 100` `required: N` `description: 여분15`
  - spare16 `type: string` `length: 100` `required: N` `description: 여분16`
  - spare17 `type: string` `length: 100` `required: N` `description: 여분17`
  - spare18 `type: string` `length: 100` `required: N` `description: 여분18`
  - spare19 `type: string` `length: 100` `required: N` `description: 여분19`
  - spare20 `type: string` `length: 100` `required: N` `description: 여분20`
- sendNum `type: string` `length: -` `required: Y` `description: 발신번호`
  - 팝빌에 사전등록되지 않은 발신번호를 입력시 '원발신번호'로 전송됨
- receiveNum `type: string` `length: -` `required: Y` `description: 수신번호`

**요청 예시**

```bash
curl --request POST \
  --url 'https://{domain}/Statement' \
  --header 'Authorization: Bearer {token}' \
  --header 'Content-Type: application/json' \
  --header 'X-HTTP-Method-Override: FAX' \
  --data '{
    "itemCode": 121,
    "mgtKey": "TEST00017",
    "writeDate": "20251024",
    "taxType": "과세",
    "purposeType": "청구",
    "taxTotal": "1000",
    "supplyCostTotal": "10000",
    "senderCorpNum": "1234567890",
    "receiverCorpName": "수신자 상호",
    "sendNum": "16009854",
    "receiveNum": "02-6442-9700"
  }'
```

### Response

**응답 본문**

- receiptNum `type: string` `length: 18` `description: 접수번호`

**응답 예시**

```json
{
    "receiptNum": "025102415352200002"
}
```

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

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

- 하나의 전자명세서에 다른 전자명세서를 첨부합니다.

### Request

**요청 헤더**

- Authorization `required: Y` `description: 인증 토큰`
  - [\[참고\] 인증 및 헤더 설정](https://developers.popbill.com/api-reference/statement/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 파라미터**

- ItemCode `type: number` `length: -` `required: Y` `description: 전자명세서 문서 유형 (택 1)`
  - `121`: 거래명세서
  - `122`: 청구서
  - `123`: 견적서
  - `124`: 발주서
  - `125`: 입금표
  - `126`: 영수증
- MgtKey `type: string` `length: 24` `required: Y` `description: 파트너가 할당한 문서번호`

**요청 본문**

- ItemCode `type: number` `length: -` `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}/Statement/{ItemCode}/{MgtKey}/AttachStmt' \
  --header 'Authorization: Bearer {token}' \
  --header 'Content-Type: application/json' \
  --data '{
    "ItemCode": 121,
    "MgtKey": "TEST00001"
  }'
```

### Response

**응답 본문**

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

**응답 예시**

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

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

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

- 하나의 전자명세서에 첨부된 다른 전자명세서를 해제합니다.

### Request

**요청 헤더**

- Authorization `required: Y` `description: 인증 토큰`
  - [\[참고\] 인증 및 헤더 설정](https://developers.popbill.com/api-reference/statement/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 파라미터**

- ItemCode `type: number` `length: -` `required: Y` `description: 전자명세서 문서 유형 (택 1)`
  - `121`: 거래명세서
  - `122`: 청구서
  - `123`: 견적서
  - `124`: 발주서
  - `125`: 입금표
  - `126`: 영수증
- MgtKey `type: string` `length: 24` `required: Y` `description: 파트너가 할당한 문서번호`

**요청 본문**

- ItemCode `type: number` `length: -` `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}/Statement/{ItemCode}/{MgtKey}/DetachStmt' \
  --header 'Authorization: Bearer {token}' \
  --header 'Content-Type: application/json' \
  --data '{
    "ItemCode": 121,
    "MgtKey": "TEST00001"
  }'
```

### 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/Statement/EmailSendConfig> | <https://popbill.linkhub.co.kr/Statement/EmailSendConfig> |

- 전자명세서 관련 메일 항목에 대한 발송설정을 확인합니다.

### Request

**요청 헤더**

- Authorization `required: Y` `description: 인증 토큰`
  - [\[참고\] 인증 및 헤더 설정](https://developers.popbill.com/api-reference/statement/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}/Statement/EmailSendConfig' \
  --header 'Authorization: Bearer {token}'
```

### Response

**응답 본문**

- emailType `type: string` `length: -` `description: 메일 전송 유형`
  - `SMT_ISSUE`: 수신자에게 전자명세서가 발행 되었음을 알려주는 메일
  - `SMT_ACCEPT`: 발신자에게 전자명세서가 승인 되었음을 알려주는 메일
  - `SMT_DENY`: 발신자에게 전자명세서가 거부 되었음을 알려주는 메일
  - `SMT_CANCEL`: 수신자에게 전자명세서가 취소 되었음을 알려주는 메일
  - `SMT_CANCEL_ISSUE`: 수신자에게 전자명세서가 발행취소 되었음을 알려주는 메일
- sendYN `type: boolean` `length: -` `description: 전송 여부`
  - `true`: 전송
  - `false`: 미전송

**응답 예시**

```json
[
    {
        "emailType": "SMT_ISSUE",
        "sendYN": true
    },
    {
        "emailType": "SMT_ACCEPT",
        "sendYN": true
    },
    {
        "emailType": "SMT_DENY",
        "sendYN": true
    },
    {
        "emailType": "SMT_CANCEL",
        "sendYN": true
    },
    {
        "emailType": "SMT_CANCEL_ISSUE",
        "sendYN": true
    }
]
```

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

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

- 전자명세서 관련 메일 항목에 대한 발송설정을 수정합니다.

### Request

**요청 헤더**

- Authorization `required: Y` `description: 인증 토큰`
  - [\[참고\] 인증 및 헤더 설정](https://developers.popbill.com/api-reference/statement/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: 메일 전송 유형`
  - `SMT_ISSUE`: 수신자에게 전자명세서가 발행 되었음을 알려주는 메일
  - `SMT_ACCEPT`: 발신자에게 전자명세서가 승인 되었음을 알려주는 메일
  - `SMT_DENY`: 발신자에게 전자명세서가 거부 되었음을 알려주는 메일
  - `SMT_CANCEL`: 수신자에게 전자명세서가 취소 되었음을 알려주는 메일
  - `SMT_CANCEL_ISSUE`: 수신자에게 전자명세서가 발행취소 되었음을 알려주는 메일
- SendYN `type: boolean` `length: -` `required: Y` `description: 전송 여부`
  - `true`: 전송
  - `false`: 미전송

**요청 예시**

```bash
curl --request POST \
  --url 'https://{domain}/Statement/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": "수정 완료"
}
```
