# 정보확인

## 1. GetInfo - 상태 확인

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

- 전자명세서 1건의 상태 및 요약정보를 확인합니다.

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

### Response

**응답 본문**

- itemCode `type: number` `length: 3` `description: 전자명세서 문서 유형`
  - `121`: 거래명세서
  - `122`: 청구서
  - `123`: 견적서
  - `124`: 발주서
  - `125`: 입금표
  - `126`: 영수증
- itemKey `type: string` `length: 18` `description: 팝빌번호`
  - 팝빌에서 전자명세서 관리 목적으로 할당한 식별번호
- invoiceNum `type: string` `length: 24` `description: 팝빌 승인번호`
  - 전자명세서 발행 시점에 팝빌에서 자동으로 할당
- mgtKey `type: string` `length: 24` `description: 파트너가 할당한 문서번호`
- taxType `type: string` `length: 2` `description: 과세형태`
  - `과세`
  - `영세`
  - `면세`
- writeDate `type: string` `length: 8` `description: 작성일자`
  - 형식 : yyyyMMdd
- regDT `type: string` `length: 14` `description: 임시저장일시`
  - 형식 : yyyyMMddHHmmss
- senderCorpName `type: string` `length: 200` `description: 발신자 상호`
- senderCorpNum `type: string` `length: 10` `description: 발신자 사업자번호`
- senderPrintYN `type: boolean` `length: -` `description: 발신자 인쇄여부`
  - `true`: 인쇄
  - `false`: 미인쇄
- receiverCorpName `type: string` `length: 200` `description: 수신자 상호`
- receiverCorpNum `type: string` `length: 10` `description: 수신자 사업자번호`
- receiverPrintYN `type: boolean` `length: -` `description: 수신자 인쇄여부`
  - `true`: 인쇄
  - `false`: 미인쇄
- supplyCostTotal `type: string` `length: 18` `description: 공급가액 합계`
  - 정수만 입력
  - 가능 마이너스 금액 입력 가능, 소수점 아래 자동 절사
- taxTotal `type: string` `length: 18` `description: 세액 합계`
  - 정수만 입력 가능
  - 마이너스 금액 입력 가능, 소수점 아래 자동 절사
- purposeType `type: string` `length: 2` `description: 영수/청구`
  - `영수`
  - `청구`
  - `없음`
- issueDT `type: string` `length: 14` `description: 발행일시`
  - 형식 : yyyyMMddHHmmss
- stateCode `type: number` `length: 3` `description: 상태코드`
  - [\[참고\] 팝빌 상태코드](https://developers.popbill.com/api-reference/statement/response-code#state-code)
- stateDT `type: string` `length: 14` `description: 상태 변경일시`
  - 형식 : yyyyMMddHHmmss
- stateMemo `type: string` `length: 200` `description: 상태메모`
- openYN `type: boolean` `length: -` `description: 개봉여부`
  - `true`: 개봉
  - `false`: 미개봉
- openDT `type: string` `length: 14` `description: 개봉 일시`
  - 형식 : yyyyMMddHHmmss

**응답 예시**

```json
{
    "itemCode": 121,
    "itemKey": "025102118531000001",
    "invoiceNum": "123456789020251021000003",
    "mgtKey": "20251021_004",
    "taxType": "과세",
    "writeDate": "20251021",
    "regDT": "20251021185310",
    "senderCorpName": "테스트 상호",
    "senderCorpNum": "1234567890",
    "senderPrintYN": false,
    "receiverCorpName": "공급받는자 상호",
    "receiverCorpNum": "8888888888",
    "receiverPrintYN": false,
    "supplyCostTotal": "200000",
    "taxTotal": "20000",
    "purposeType": "영수",
    "issueDT": "20251021185310",
    "stateCode": 200,
    "stateDT": "20251021185310",
    "openYN": false,
    "stateMemo": ""
}
```

## 2. GetInfos - 다수건 상태 확인

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

- 다수건의 전자명세서 상태 및 요약정보를 확인합니다. (1회 호출에 최대 1,000건 확인 가능)

### 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`: 영수증

**요청 본문**

- \- `type: array` `length: 1,000` `required: Y` `description: 문서번호 목록`
  - 최대 : 1,000건

**요청 예시**

```bash
curl --request POST \
  --url 'https://{domain}/Statement/{ItemCode}' \
  --header 'Authorization: Bearer {token}' \
  --data '["TEST0001", "TEST0002"]'
```

### Response

**응답 본문**

- itemCode `type: number` `length: 3` `description: 전자명세서 문서 유형`
  - `121`: 거래명세서
  - `122`: 청구서
  - `123`: 견적서
  - `124`: 발주서
  - `125`: 입금표
  - `126`: 영수증
- itemKey `type: string` `length: 18` `description: 팝빌번호`
  - 팝빌에서 전자명세서 관리 목적으로 할당한 식별번호
- invoiceNum `type: string` `length: 24` `description: 팝빌 승인번호`
  - 전자명세서 발행 시점에 팝빌에서 자동으로 할당
- mgtKey `type: string` `length: 24` `description: 파트너가 할당한 문서번호`
- taxType `type: string` `length: 2` `description: 과세형태`
  - `과세`
  - `영세`
  - `면세`
- writeDate `type: string` `length: 8` `description: 작성일자`
  - 형식 : yyyyMMdd
- regDT `type: string` `length: 14` `description: 임시저장일시`
  - 형식 : yyyyMMddHHmmss
- senderCorpName `type: string` `length: 200` `description: 발신자 상호`
- senderCorpNum `type: string` `length: 10` `description: 발신자 사업자번호`
- senderPrintYN `type: boolean` `length: -` `description: 발신자 인쇄여부`
  - `true`: 인쇄
  - `false`: 미인쇄
- receiverCorpName `type: string` `length: 200` `description: 수신자 상호`
- receiverCorpNum `type: string` `length: 10` `description: 수신자 사업자번호`
- receiverPrintYN `type: boolean` `length: -` `description: 수신자 인쇄여부`
  - `true`: 인쇄
  - `false`: 미인쇄
- supplyCostTotal `type: string` `length: 18` `description: 공급가액 합계`
  - 정수만 입력 가능
  - 마이너스 금액 입력 가능, 소수점 아래 자동 절사
- taxTotal `type: string` `length: 18` `description: 세액 합계`
  - 정수만 입력 가능
  - 마이너스 금액 입력 가능, 소수점 아래 자동 절사
- purposeType `type: string` `length: 2` `description: 영수/청구`
  - `영수`
  - `청구`
  - `없음`
- issueDT `type: string` `length: 14` `description: 발행일시`
  - 형식 : yyyyMMddHHmmss
- stateCode `type: number` `length: 3` `description: 상태코드`
  - [\[참고\] 팝빌 상태코드](https://developers.popbill.com/api-reference/statement/response-code#state-code)
- stateDT `type: string` `length: 14` `description: 상태 변경일시`
  - 형식 : yyyyMMddHHmmss
- stateMemo `type: string` `length: 200` `description: 상태메모`
- openYN `type: boolean` `length: -` `description: 개봉여부`
  - `true`: 개봉
  - `false`: 미개봉
- openDT `type: string` `length: 14` `description: 개봉 일시`
  - 형식 : yyyyMMddHHmmss

**응답 예시**

```json
[
    {
        "itemCode": 121,
        "itemKey": "025102118531000001",
        "invoiceNum": "123456789020251021000003",
        "mgtKey": "20251021_004",
        "taxType": "과세",
        "writeDate": "20251021",
        "regDT": "20251021185310",
        "senderCorpName": "테스트 상호",
        "senderCorpNum": "1234567890",
        "senderPrintYN": false,
        "receiverCorpName": "공급받는자 상호",
        "receiverCorpNum": "8888888888",
        "receiverPrintYN": false,
        "supplyCostTotal": "200000",
        "taxTotal": "20000",
        "purposeType": "영수",
        "issueDT": "20251021185310",
        "stateCode": 200,
        "stateDT": "20251021185310",
        "openYN": false,
        "stateMemo": ""
    }
]
```

## 3. GetDetailInfo - 상세정보 확인

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

- 전자명세서 1건의 상세정보를 확인합니다.

### 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: 파트너가 할당한 문서번호`

**Query 파라미터**

- Detail `type: -` `length: -` `required: Y` `description: 상세 정보`
  - 빈값으로 입력

**요청 예시**

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

### Response

**응답 본문**

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

**응답 예시**

```json
{
    "itemCode": 121,
    "mgtKey": "20251021_004",
    "invoiceNum": "123456789020251021000003",
    "writeDate": "20251021",
    "taxType": "과세",
    "senderCorpNum": "1234567890",
    "senderCorpName": "테스트 상호",
    "senderCEOName": "테스트 대표",
    "senderTaxRegID": "",
    "senderAddr": "테스트 주소",
    "senderBizClass": "테스트 종목",
    "senderBizType": "테스트 업태",
    "senderContactName": "테스트 담당자 성명",
    "senderDeptName": "테스트 부서명",
    "senderTEL": "070-111-222",
    "senderHP": "010-000-222",
    "senderEmail": "test@test.com",
    "receiverCorpNum": "8888888888",
    "receiverCorpName": "공급받는자 상호",
    "receiverCEOName": "공급받는자 대표자 성명",
    "receiverTaxRegID": "",
    "receiverAddr": "공급받는자 주소",
    "receiverBizClass": "공급받는자 업종",
    "receiverContactName": "공급받는자 담당자명",
    "receiverTEL": "010-0000-1111",
    "receiverHP": "010-1111-2222",
    "receiverEmail": "test@test.com",
    "supplyCostTotal": "200000",
    "serialNum": "123",
    "taxTotal": "20000",
    "totalAmount": "220000",
    "purposeType": "영수",
    "remark1": "비고1",
    "remark2": "비고2",
    "remark3": "비고3",
    "faxsendYN": false,
    "businessLicenseYN": false,
    "bankBookYN": false,
    "autoAcceptYN": false,
    "smssendYN": false,
    "detailList": [
        {
            "serialNum": 1,
            "purchaseDT": "20201006",
            "itemName": "Item Name 01",
            "spec": "spec",
            "qty": "1",
            "unitCost": "110000",
            "supplyCost": "100000",
            "tax": "10000",
            "remark": "Item reamrk"
        }
    ],
    "propertyBag": {}
}
```

## 4. CheckMgtKeyInUse - 문서번호 사용 여부 확인

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

- 파트너가 전자명세서 관리 목적으로 할당하는 문서번호의 사용여부를 확인합니다.
- 응답 본문의 `itemKey` 필드에 값이 존재하면 사용 중인 문서번호이며, 값이 존재하지 않으면 사용 가능한 문서번호 입니다.
- 이미 사용 중인 문서번호는 중복 사용이 불가하고, 전자명세서가 삭제된 경우에만 문서번호의 재사용이 가능합니다.

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

### Response

**응답 본문**

- itemCode `type: number` `length: 3` `description: 전자명세서 문서 유형`
  - `121`: 거래명세서
  - `122`: 청구서
  - `123`: 견적서
  - `124`: 발주서
  - `125`: 입금표
  - `126`: 영수증
- itemKey `type: string` `length: 18` `description: 팝빌번호`
  - 팝빌에서 전자명세서 관리 목적으로 할당한 식별번호
- invoiceNum `type: string` `length: 24` `description: 팝빌 승인번호`
  - 전자명세서 발행 시점에 팝빌에서 자동으로 할당
- mgtKey `type: string` `length: 24` `description: 파트너가 할당한 문서번호`
- taxType `type: string` `length: 2` `description: 과세형태`
  - `과세`
  - `영세`
  - `면세`
- writeDate `type: string` `length: 8` `description: 작성일자`
  - 형식 : yyyyMMdd
- regDT `type: string` `length: 14` `description: 임시저장일시`
  - 형식 : yyyyMMddHHmmss
- senderCorpName `type: string` `length: 200` `description: 발신자 상호`
- senderCorpNum `type: string` `length: 10` `description: 발신자 사업자번호`
- senderPrintYN `type: boolean` `length: -` `description: 발신자 인쇄여부`
  - `true`: 인쇄
  - `false`: 미인쇄
- receiverCorpName `type: string` `length: 200` `description: 수신자 상호`
- receiverCorpNum `type: string` `length: 10` `description: 수신자 사업자번호`
- receiverPrintYN `type: boolean` `length: -` `description: 수신자 인쇄여부`
  - `true`: 인쇄
  - `false`: 미인쇄
- supplyCostTotal `type: string` `length: 18` `description: 공급가액 합계`
  - 정수만 입력 가능
  - 마이너스 금액 입력 가능, 소수점 아래 자동 절사
- taxTotal `type: string` `length: 18` `description: 세액 합계`
  - 정수만 입력 가능
  - 마이너스 금액 입력 가능, 소수점 아래 자동 절사
- purposeType `type: string` `length: 2` `description: 영수/청구`
  - `영수`
  - `청구`
  - `없음`
- issueDT `type: string` `length: 14` `description: 발행일시`
  - 형식 : yyyyMMddHHmmss
- stateCode `type: number` `length: 3` `description: 상태코드`
  - [\[참고\] 팝빌 상태코드](https://developers.popbill.com/api-reference/statement/response-code#state-code)
- stateDT `type: string` `length: 14` `description: 상태 변경일시`
  - 형식 : yyyyMMddHHmmss
- stateMemo `type: string` `length: 200` `description: 상태메모`
- openYN `type: boolean` `length: -` `description: 개봉여부`
  - `true`: 개봉
  - `false`: 미개봉
- openDT `type: string` `length: 14` `description: 개봉 일시`
  - 형식 : yyyyMMddHHmmss

**응답 예시**

```json
{
    "itemKey": "025102118531000001"
}
```

## 5. Search - 목록 조회

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

- 검색조건에 해당하는 전자명세서를 조회합니다. (최대 조회기간 : 6개월)

> 매개변수 Page, PerPage, Order를 이용하여 페이징 기능을 구현할 수 있습니다.

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

- DType `type: string` `length: 1` `required: Y` `description: 검색일자 유형 (택 1)`
  - `R`: 등록일자
  - `W`: 작성일자
  - `I`: 발행일자
- SDate `type: string` `length: 8` `required: Y` `description: 검색 시작일자`
  - 형식 : yyyyMMdd
- EDate `type: string` `length: 8` `required: Y` `description: 검색 종료일자`
  - 형식 : yyyyMMdd
- State `type: string` `length: -` `required: N` `description: 전자명세서 상태코드`
  - 2, 3번째 자리에 와일드카드(\*) 사용가능. 예) 1\*\*,3\*\* [\[참고\] 팝빌 상태코드](https://developers.popbill.com/api-reference/statement/response-code#state-code)
  - 기본값 : 전체조회
- ItemCode `type: number` `length: -` `required: N` `description: 전자명세서 문서 유형 (다중 선택 가능)`
  - `121`: 거래명세서
  - `122`: 청구서
  - `123`: 견적서
  - `124`: 발주서
  - `125`: 입금표
  - `126`: 영수증
  - 다중 선택시 콤마(',')로 구분. 예) 121,122
  - 기본값 : 전체조회
- QString `type: string` `length: -` `required: N` `description: 조회 검색어(거래처 상호/사업자번호)`
  - 기본값 : 전체조회
- Page `type: number` `length: -` `required: N` `description: 목록 페이지번호`
  - 기본값 : 1
- PerPage `type: number` `length: -` `required: N` `description: 페이지당 표시할 목록 건수`
  - 최대 : 1,000건
  - 기본값 : 500건
- Order `type: string` `length: 1` `required: N` `description: 조회 기준일자 유형을 기준으로 하는 목록 정렬 방향`
  - `D`: 내림차순 : 기본값
  - `A`: 오름차순

**요청 예시**

```bash
curl --request GET \
  --url 'https://{domain}/Statement/Search?DType={DType}&SDate={SDate}&EDate={EDate}' \
  --header 'Authorization: Bearer {token}'
```

### Response

**응답 본문**

- code `type: number` `length: -` `description: API 처리에 대한 응답코드`
  - `1`: 성공
- message `type: string` `length: -` `description: API 처리에 대한 응답메시지`
- total `type: number` `length: -` `description: 총 검색결과 건수`
- perPage `type: number` `length: -` `description: 페이지당 목록 건수`
- pageNum `type: number` `length: -` `description: 페이지 번호`
- pageCount `type: number` `length: -` `description: 페이지 개수`
- list `type: array` `length: -` `description: 전자명세서 상태/요약정보`
  - [\[GetInfo – 상태 확인\]](#GetInfo) API의 리턴값 구성과 동일
  - 최대 : 1,000건
  - itemCode `type: number` `length: 3` `description: 전자명세서 문서 유형`
    - `121`: 거래명세서
    - `122`: 청구서
    - `123`: 견적서
    - `124`: 발주서
    - `125`: 입금표
    - `126`: 영수증
  - itemKey `type: string` `length: 18` `description: 팝빌번호`
    - 팝빌에서 전자명세서 관리 목적으로 할당한 식별번호
  - invoiceNum `type: string` `length: 24` `description: 팝빌 승인번호`
    - 전자명세서 발행 시점에 팝빌에서 자동으로 할당
  - mgtKey `type: string` `length: 24` `description: 파트너가 할당한 문서번호`
  - taxType `type: string` `length: 2` `description: 과세형태`
    - `과세`
    - `영세`
    - `면세`
  - writeDate `type: string` `length: 8` `description: 작성일자`
    - 형식 : yyyyMMdd
  - regDT `type: string` `length: 14` `description: 임시저장일시`
    - 형식 : yyyyMMddHHmmss
  - senderCorpName `type: string` `length: 200` `description: 발신자 상호`
  - senderCorpNum `type: string` `length: 10` `description: 발신자 사업자번호`
  - senderPrintYN `type: boolean` `length: -` `description: 발신자 인쇄여부`
    - `true`: 인쇄
    - `false`: 미인쇄
  - receiverCorpName `type: string` `length: 200` `description: 수신자 상호`
  - receiverCorpNum `type: string` `length: 10` `description: 수신자 사업자번호`
  - receiverPrintYN `type: boolean` `length: -` `description: 수신자 인쇄여부`
    - `true`: 인쇄
    - `false`: 미인쇄
  - supplyCostTotal `type: string` `length: 18` `description: 공급가액 합계`
    - 정수만 입력 가능
    - 마이너스 금액 입력 가능, 소수점 아래 자동 절사
  - taxTotal `type: string` `length: 18` `description: 세액 합계`
    - 정수만 입력 가능
    - 마이너스 금액 입력 가능, 소수점 아래 자동 절사
  - purposeType `type: string` `length: 2` `description: 영수/청구`
    - `영수`
    - `청구`
    - `없음`
  - issueDT `type: string` `length: 14` `description: 발행일시`
    - 형식 : yyyyMMddHHmmss
  - stateCode `type: number` `length: 3` `description: 상태코드`
    - [\[참고\] 팝빌 상태코드](https://developers.popbill.com/api-reference/statement/response-code#state-code)
  - stateDT `type: string` `length: 14` `description: 상태 변경일시`
    - 형식 : yyyyMMddHHmmss
  - stateMemo `type: string` `length: 200` `description: 상태메모`
  - openYN `type: boolean` `length: -` `description: 개봉여부`
    - `true`: 개봉
    - `false`: 미개봉
  - openDT `type: string` `length: 14` `description: 개봉 일시`
    - 형식 : yyyyMMddHHmmss

**응답 예시**

```json
{
    "code": 1,
    "total": 1,
    "perPage": 500,
    "pageNum": 1,
    "pageCount": 1,
    "list": [
        {
            "itemCode": 121,
            "itemKey": "025102611470500001",
            "invoiceNum": "123456789020251026000003",
            "mgtKey": "TEST202510261138",
            "taxType": "과세",
            "writeDate": "20251026",
            "regDT": "20251026114706",
            "senderCorpNum": "1234567890",
            "senderPrintYN": false,
            "receiverCorpName": "수신자 상호",
            "receiverPrintYN": false,
            "supplyCostTotal": "10000",
            "taxTotal": "1000",
            "purposeType": "청구",
            "issueDT": "20251026114716",
            "stateCode": 500,
            "stateDT": "20251026114841",
            "openYN": false,
            "stateMemo": "메모"
        }
    ],
    "message": "검색 완료"
}
```

## 6. GetLogs - 상태 변경이력 확인

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

- 전자명세서의 상태에 대한 변경이력을 확인합니다.

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

### Response

**응답 본문**

- docLogType `type: number` `length: 3` `description: 로그타입`
  - `100`: 임시저장
  - `101`: 수정
  - `102`: 개봉
  - `103`: 수신확인
  - `111`: 메일 재전송
  - `112`: 문자 재전송
  - `113`: 팩스 재전송
  - `122`: 문자 전송결과
  - `123`: 팩스 전송결과
  - `310`: 발행
  - `312`: 자동승인
  - `340`: 발행취소
- log `type: string` `length: 2000` `description: 이력정보`
- procType `type: string` `length: 3` `description: 처리형태`
  - `연동`: API를 통해 처리함
  - `일반`: 팝빌 사이트를 통해 처리함
  - `시스템`: 팝빌이 처리함
- procCorpName `type: string` `length: 70` `description: 처리회사명`
- procContactName `type: string` `length: 30` `description: 처리담당자`
- procMemo `type: string` `length: 200` `description: 처리메모`
- regDT `type: string` `length: 14` `description: 등록일시`
  - 형식 : yyyyMMddHHmmss
- ip `type: string` `length: 39` `description: 아이피`

**응답 예시**

```json
[
    {
        "ip": "112.***.**.27",
        "docLogType": 310,
        "procType": "연동",
        "procMemo": "담당자 이메일 : test@test.com",
        "log": "발행 되었습니다.",
        "procCorpName": "처리회사명",
        "procContactName": "처리담당자",
        "regDT": "20251021185310"
    }
]
```

## 7. GetURL - 문서함 팝업 URL

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

![문서함 팝업 URL 미리보기](https://developers.popbill.com/images/reference/statement/getURL.png)

**전자명세서 문서함의 팝업 URL을 반환합니다.**

- 권장 사이즈 : width = 1,280px (최소 1,000px) / height = 800px
- 반환되는 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: 접근 메뉴 (택 1)`
  - `TBOX`: 임시 문서함
  - `SWBOX`: 발행 문서함

**요청 예시**

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

### Response

**응답 본문**

- url `type: string` `length: -` `description: 전자명세서 문서함 팝업 URL`

**응답 예시**

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