# 정보확인

## 1. GetInfo - 상태 확인

현금영수증 1건의 상태 및 요약정보를 확인합니다.

- 응답 객체 PBCbInfo 의 변수 ‘stateCode’를 통해 현금영수증의 상태코드를 확인합니다.

```vb
Function GetInfo(CorpNum As String, mgtKey As String, Optional UserID As String = "") As PBCbInfo
```

### 요청

**Parameters**

- CorpNum `type: String` `length: 10` `required: Y` `description: 팝빌회원 사업자번호 ('-' 제외)`
- mgtKey `type: String` `length: 24` `required: Y` `description: 파트너가 할당한 문서번호`
- UserID `type: String` `length: 50` `required: N` `description: 팝빌회원 아이디`

### 응답

**PBCbInfo**

- itemKey `type: String` `length: 18` `description: 팝빌에서 현금영수증 관리 목적으로 할당한 식별번호`
- mgtKey `type: String` `length: 24` `description: 문서번호`
  - 파트너가 할당하는 식별번호
- tradeDate `type: String` `length: 8` `description: 거래일자`
  - 형식 : yyyyMMdd
- tradeDT `type: String` `length: 14` `description: 거래일시`
  - 형식 : yyyyMMddHHmmss
- tradeType `type: String` `length: 4` `description: 문서형태`
  - `승인거래`
  - `취소거래`
- tradeUsage `type: String` `length: 5` `description: 거래구분`
  - `소득공제용`
  - `지출증빙용`
- tradeOpt `type: String` `length: 4` `description: 거래유형`
  - `일반`
  - `도서공연`
  - `대중교통`
- taxationType `type: String` `length: 3` `description: 과세형태`
  - `과세`
  - `비과세`
- totalAmount `type: String` `length: 9` `description: 거래금액 (공급가액+부가세+봉사료)`
- issueDT `type: String` `length: 14` `description: 발행일시`
  - 형식 : yyyyMMddHHmmss
- regDT `type: String` `length: 14` `description: 등록일시`
  - 형식 : yyyyMMddHHmmss
- stateMemo `type: String` `length: 200` `description: 상태메모`
- stateCode `type: Integer` `length: 3` `description: 상태코드`
  - [\[참고\] 팝빌 상태코드](https://developers.popbill.com/reference/cashbill/vb/response-code#state-code)
- stateDT `type: String` `length: 14` `description: 상태 변경일시`
  - 형식 : yyyyMMddHHmmss
- identityNum `type: String` `length: 19` `description: 식별번호`
  - {tradeUsage} 값이 "소득공제용" 경우 주민등록/휴대폰/카드번호/자진발급용 번호(010-000-1234) 반환
  - {tradeUsage} 값이 "지출증빙용" 경우 사업자번호/휴대폰/카드번호 반환
- itemName `type: String` `length: 70` `description: 주문상품명`
- customerName `type: String` `length: 70` `description: 구매자(고객) 성명`
- confirmNum `type: String` `length: 9` `description: 국세청승인번호`
  - 현금영수증 발행 시점에 팝빌에서 자동으로 할당
- orgConfirmNum `type: String` `length: 9` `description: 당초 국세청승인번호`
  - {tradeType}="취소거래" 경우 반환
- orgTradeDate `type: String` `length: 8` `description: 당초 거래일자`
  - {tradeType}="취소거래" 경우 반환
- ntssendDT `type: String` `length: 14` `description: 국세청 전송일시`
  - 형식 : yyyyMMddHHmmss
- ntsresultDT `type: String` `length: 14` `description: 국세청 처리결과 수신일시`
  - 형식 : yyyyMMddHHmmss
- ntsresultCode `type: String` `length: 4` `description: 국세청 결과코드`
  - [\[참고\] 국세청 결과코드](https://developers.popbill.com/reference/cashbill/vb/response-code#nts-result)
- ntsresultMessage `type: String` `length: 30` `description: 국세청 결과메시지`
- printYN `type: Boolean` `length: -` `description: 인쇄여부`
  - `True`: 인쇄
  - `False`: 미인쇄

### 예외

**Err**

- LastErrCode `type: Long` `length: -` `description: API 처리 실패에 대한 오류코드`
  - 음의 정수 8자리 숫자값 [\[참고\] 오류코드](https://developers.popbill.com/error-code)
- LastErrMessage `type: String` `length: -` `description: API 처리 실패에 대한 오류메시지`

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

다수건의 현금영수증 상태 및 요약 정보를 확인합니다. (1회 호출에 최대 1,000건 확인 가능)

- 리턴값 PBCbInfo 의 변수 ‘stateCode’를 통해 현금영수증의 상태코드를 확인합니다.

```vb
Function GetInfos(CorpNum As String, MgtKeyList As Collection, Optional UserID As String = "") As Collection
```

> 문서번호를 통해 현금영수증 목록을 구현하는 경우 활용합니다.

### 요청

**Parameters**

- CorpNum `type: String` `length: 10` `required: Y` `description: 팝빌회원 사업자번호 ('-' 제외)`
- MgtKeyList `type: Collection` `length: 1,000` `required: Y` `description: 문서번호 목록`
  - 최대 : 1,000건
- UserID `type: String` `length: 50` `required: N` `description: 팝빌회원 아이디`

### 응답

**PBCbInfo**

- itemKey `type: String` `length: 18` `description: 팝빌에서 현금영수증 관리 목적으로 할당한 식별번호`
- mgtKey `type: String` `length: 24` `description: 문서번호`
  - 파트너가 할당하는 식별번호
- tradeDate `type: String` `length: 8` `description: 거래일자`
  - 형식 : yyyyMMdd
- tradeDT `type: String` `length: 14` `description: 거래일시`
  - 형식 : yyyyMMddHHmmss
- tradeType `type: String` `length: 4` `description: 문서형태`
  - `승인거래`
  - `취소거래`
- tradeUsage `type: String` `length: 5` `description: 거래구분`
  - `소득공제용`
  - `지출증빙용`
- tradeOpt `type: String` `length: 4` `description: 거래유형`
  - `일반`
  - `도서공연`
  - `대중교통`
- taxationType `type: String` `length: 3` `description: 과세형태`
  - `과세`
  - `비과세`
- totalAmount `type: String` `length: 9` `description: 거래금액 (공급가액+부가세+봉사료)`
- issueDT `type: String` `length: 14` `description: 발행일시`
  - 형식 : yyyyMMddHHmmss
- regDT `type: String` `length: 14` `description: 등록일시`
  - 형식 : yyyyMMddHHmmss
- stateMemo `type: String` `length: 200` `description: 상태메모`
- stateCode `type: Integer` `length: 3` `description: 상태코드`
  - [\[참고\] 팝빌 상태코드](https://developers.popbill.com/reference/cashbill/vb/response-code#state-code)
- stateDT `type: String` `length: 14` `description: 상태 변경일시`
  - 형식 : yyyyMMddHHmmss
- identityNum `type: String` `length: 19` `description: 식별번호`
  - {tradeUsage} 값이 "소득공제용" 경우 주민등록/휴대폰/카드번호/자진발급용 번호(010-000-1234) 반환
  - {tradeUsage} 값이 "지출증빙용" 경우 사업자번호/휴대폰/카드번호 반환
- itemName `type: String` `length: 70` `description: 주문상품명`
- customerName `type: String` `length: 70` `description: 구매자(고객) 성명`
- confirmNum `type: String` `length: 9` `description: 국세청승인번호`
  - 현금영수증 발행 시점에 팝빌에서 자동으로 할당
- orgConfirmNum `type: String` `length: 9` `description: 당초 국세청승인번호`
  - {tradeType}="취소거래" 경우 반환
- orgTradeDate `type: String` `length: 8` `description: 당초 거래일자`
  - {tradeType}="취소거래" 경우 반환
- ntssendDT `type: String` `length: 14` `description: 국세청 전송일시`
  - 형식 : yyyyMMddHHmmss
- ntsresultDT `type: String` `length: 14` `description: 국세청 처리결과 수신일시`
  - 형식 : yyyyMMddHHmmss
- ntsresultCode `type: String` `length: 4` `description: 국세청 결과코드`
  - [\[참고\] 국세청 결과코드](https://developers.popbill.com/reference/cashbill/vb/response-code#nts-result)
- ntsresultMessage `type: String` `length: 30` `description: 국세청 결과메시지`
- printYN `type: Boolean` `length: -` `description: 인쇄여부`
  - `True`: 인쇄
  - `False`: 미인쇄

### 예외

**Err**

- LastErrCode `type: Long` `length: -` `description: API 처리 실패에 대한 오류코드`
  - 음의 정수 8자리 숫자값 [\[참고\] 오류코드](https://developers.popbill.com/error-code)
- LastErrMessage `type: String` `length: -` `description: API 처리 실패에 대한 오류메시지`

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

현금영수증 1건의 상세정보를 확인합니다.

```vb
Function GetDetailInfo(CorpNum As String, mgtKey As String, Optional UserID As String = "") As PBCashbill
```

### 요청

**Parameters**

- CorpNum `type: String` `length: 10` `required: Y` `description: 팝빌회원 사업자번호 ('-' 제외)`
- mgtKey `type: String` `length: 24` `required: Y` `description: 파트너가 할당한 문서번호`
- UserID `type: String` `length: 50` `required: N` `description: 팝빌회원 아이디`

### 응답

**PBCashbill**

- mgtKey `type: String` `length: 24` `description: 문서번호`
  - 문서 관리를 위해 파트너가 할당하는 식별번호
- confirmNum `type: String` `length: 9` `description: 국세청승인번호`
  - 현금영수증 발행 시점에 팝빌에서 자동으로 할당
- orgConfirmNum `type: String` `length: 9` `description: 당초 국세청승인번호`
  - {tradeType}="취소거래" 경우 반환
- orgTradeDate `type: String` `length: 8` `description: 당초 거래일자`
  - {tradeType}="취소거래" 경우 반환
- tradeDate `type: String` `length: 8` `description: 거래일자`
  - 현금영수증 발행 시점에 팝빌에서 자동으로 할당
  - {tradeDT}의 yyyyMMdd
- tradeDT `type: String` `length: 14` `description: 거래일시`
  - 형식 : yyyyMMddHHmmss
- tradeType `type: String` `length: 4` `description: 문서형태`
  - `승인거래`
  - `취소거래`
- tradeUsage `type: String` `length: 5` `description: 거래구분`
  - `소득공제용`
  - `지출증빙용`
- tradeOpt `type: String` `length: 4` `description: 거래유형`
  - `일반`
  - `도서공연`
  - `대중교통`
- taxationType `type: String` `length: 3` `description: 과세형태`
  - `과세`
  - `비과세`
- totalAmount `type: String` `length: 9` `description: 거래금액 (공급가액+부가세+봉사료)`
- supplyCost `type: String` `length: 9` `description: 공급가액`
- tax `type: String` `length: 9` `description: 부가세`
- serviceFee `type: String` `length: 9` `description: 봉사료`
- franchiseCorpNum `type: String` `length: 10` `description: 가맹점 사업자번호`
  - 팝빌회원 사업자번호 ('-' 제외)
- franchiseTaxRegID `type: String` `length: 4` `description: 가맹점 종사업장 식별번호`
  - 종사업장 식별번호는 4자리 숫자로만 구성
- franchiseCorpName `type: String` `length: 200` `description: 가맹점 상호`
- franchiseCEOName `type: String` `length: 100` `description: 가맹점 대표자 성명`
- franchiseAddr `type: String` `length: 400` `description: 가맹점 주소`
- franchiseTEL `type: String` `length: 20` `description: 가맹점 전화번호`
- identityNum `type: String` `length: 19` `description: 식별번호`
  - {tradeUsage} 값이 "소득공제용" 경우 주민등록/휴대폰/카드번호/자진발급용 번호(010-000-1234) 반환
  - {tradeUsage} 값이 "지출증빙용" 경우 사업자번호/휴대폰/카드번호 반환
- customerName `type: String` `length: 70` `description: 구매자(고객) 성명`
- itemName `type: String` `length: 70` `description: 주문 상품명`
- orderNumber `type: String` `length: 200` `description: 주문번호`
- email `type: String` `length: 100` `description: 구매자(고객) 메일`
- hp `type: String` `length: 20` `description: 구매자(고객) 휴대폰`
- smssendYN `type: Boolean` `length: -` `description: 구매자 알림문자 전송 여부`
  - `True`: 전송
  - `False`: 미전송
  - 수신자 : 구매자 휴대폰번호 {hp}
- cancelType `type: Integer` `length: 1` `description: 취소사유`
  - `1`: 거래취소
  - `2`: 오류발급취소
  - `3`: 기타
  - {tradeType}="취소거래" 경우 반환

### 예외

**Err**

- LastErrCode `type: Long` `length: -` `description: API 처리 실패에 대한 오류코드`
  - 음의 정수 8자리 숫자값 [\[참고\] 오류코드](https://developers.popbill.com/error-code)
- LastErrMessage `type: String` `length: -` `description: API 처리 실패에 대한 오류메시지`

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

파트너가 현금영수증 관리 목적으로 할당하는 문서번호 사용여부를 확인합니다.

- 이미 사용 중인 문서번호는 중복 사용이 불가하고, 현금영수증이 삭제된 경우에만 문서번호의 재사용이 가능합니다.

```vb
Function CheckMgtKeyInUse(CorpNum As String, mgtKey As String) As PBResponse
```

### 요청

**Parameters**

- CorpNum `type: String` `length: 10` `required: Y` `description: 팝빌회원 사업자번호 ('-' 제외)`
- mgtKey `type: String` `length: 24` `required: Y` `description: 확인할 문서번호`

### 응답

**PBResponse**

- code `type: Long` `length: -` `description: API 처리에 대한 응답코드`
  - `1`: 성공
- message `type: String` `length: -` `description: API 처리에 대한 응답메시지`
- confirmNum `type: String` `length: 9` `description: 국세청승인번호`
  - 현금영수증 발행 시점에 팝빌에서 자동으로 할당 RegistIssue, RevokeRegistIssue API 사용할 경우만 존재
- tradeDate `type: String` `length: 8` `description: 거래일자`
  - 현금영수증 발행 시점에 팝빌에서 자동으로 할당 RegistIssue, RevokeRegistIssue API 사용할 경우만 존재 형식 : yyyyMMdd

### 예외

**Err**

- LastErrCode `type: Long` `length: -` `description: API 처리 실패에 대한 오류코드`
  - 음의 정수 8자리 숫자값 [\[참고\] 오류코드](https://developers.popbill.com/error-code)
- LastErrMessage `type: String` `length: -` `description: API 처리 실패에 대한 오류메시지`

## 5. Search - 목록 조회

검색조건에 해당하는 현금영수증을 조회합니다. (최대 조회기간 : 6개월)

```vb
Function Search(CorpNum As String, DType As String, SDate As String, EDate As String, state As Collection, tradeType As Collection, tradeUsage As Collection, taxationType As Collection, Page As Integer, PerPage As Integer, Order As String, Optional QString As String, Optional tradeOpt As Collection = Null, Optional franchiseTaxRegID As String) As PBCBSearchList
```

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

### 요청

**Parameters**

- CorpNum `type: String` `length: 10` `required: Y` `description: 팝빌회원 사업자번호 ('-' 제외)`
- DType `type: String` `length: 1` `required: Y` `description: 검색일자 유형 (택 1)`
  - `R`: 등록일자
  - `T`: 거래일자
  - `I`: 발행일시
- SDate `type: String` `length: 8` `required: Y` `description: 검색 시작일자`
  - 형식 : yyyyMMdd
- EDate `type: String` `length: 8` `required: Y` `description: 검색 종료일자`
  - 형식 : yyyyMMdd
- state `type: Collection` `length: -` `required: N` `description: 현금영수증 상태코드`
  - 2, 3번째 자리에 와일드카드(\*) 사용가능. 예) "3\*\*"
  - [\[참고\] 팝빌 상태코드](https://developers.popbill.com/reference/cashbill/vb/response-code#state-code)
  - 기본값 : 전체조회
- tradeType `type: Collection` `length: -` `required: N` `description: 현금영수증 문서형태 (다중 선택 가능)`
  - `N`: 승인 현금영수증
  - `C`: 취소 현금영수증
  - 기본값 : 전체조회
- tradeUsage `type: Collection` `length: -` `required: N` `description: 거래구분 (다중 선택 가능)`
  - `P`: 소득공제용
  - `C`: 지출증빙용
  - 기본값 : 전체조회
- taxationType `type: Collection` `length: -` `required: Y` `description: 과세형태 (다중 선택 가능)`
  - `T`: 과세
  - `N`: 비과세
- Page `type: int` `length: -` `required: N` `description: 목록 페이지번호`
  - 기본값 : 1
- PerPage `type: int` `length: -` `required: N` `description: 페이지당 표시할 목록 건수`
  - 최대 : 1,000건
  - 기본값 : 500건
- Order `type: String` `length: 1` `required: Y` `description: 조회 기준일자 유형을 기준으로 하는 목록 정렬 방향`
  - `D`: 내림차순 : 기본값
  - `A`: 오름차순
- QString `type: String` `length: -` `required: N` `description: 조회 검색어(식별번호)`
  - 기본값 : 전체조회
- tradeOpt `type: Collection` `length: -` `required: N` `description: 거래유형 (다중 선택 가능)`
  - `N`: 일반
  - `B`: 도서공연
  - `T`: 대중교통
  - 기본값 : 전체조회
- FranchiseTaxRegID `type: String` `length: -` `required: N` `description: 가맹점 종사업장번호`
  - 다수건 검색시 콤마(',')로 구분. 예) 1234,1000
  - 기본값 : 전체조회

### 응답

**PBCBSearchList**

- code `type: Integer` `length: -` `description: API 처리에 대한 응답코드`
  - `1`: 성공
- message `type: String` `length: -` `description: API 처리에 대한 응답메시지`
- total `type: Integer` `length: -` `description: 총 검색결과 건수`
- perPage `type: Integer` `length: -` `description: 페이지당 목록 건수`
- pageNum `type: Integer` `length: -` `description: 페이지 번호`
- pageCount `type: Integer` `length: -` `description: 페이지 개수`
- list `type: PBCbInfo[ ]` `length: -` `description: 현금영수증 상태/요약정보`
  - 함수 [\[GetInfo - 상태 확인\]](https://developers.popbill.com/reference/cashbill/vb/api/info#GetInfo)의 리턴값 구성과 동일
  - 최대 1,000건
  - itemKey `type: String` `length: 18` `description: 팝빌에서 현금영수증 관리 목적으로 할당한 식별번호`
  - mgtKey `type: String` `length: 24` `description: 문서번호`
    - 파트너가 할당하는 식별번호
  - tradeDate `type: String` `length: 8` `description: 거래일자`
    - 형식 : yyyyMMdd
  - tradeDT `type: String` `length: 14` `description: 거래일시`
    - 형식 : yyyyMMddHHmmss
  - tradeType `type: String` `length: 4` `description: 문서형태`
    - `승인거래`
    - `취소거래`
  - tradeUsage `type: String` `length: 5` `description: 거래구분`
    - `소득공제용`
    - `지출증빙용`
  - tradeOpt `type: String` `length: 4` `description: 거래유형`
    - `일반`
    - `도서공연`
    - `대중교통`
  - taxationType `type: String` `length: 3` `description: 과세형태`
    - `과세`
    - `비과세`
  - totalAmount `type: String` `length: 9` `description: 거래금액 (공급가액+부가세+봉사료)`
  - issueDT `type: String` `length: 14` `description: 발행일시`
    - 형식 : yyyyMMddHHmmss
  - regDT `type: String` `length: 14` `description: 등록일시`
    - 형식 : yyyyMMddHHmmss
  - stateMemo `type: String` `length: 200` `description: 상태메모`
  - stateCode `type: Integer` `length: 3` `description: 상태코드`
    - [\[참고\] 팝빌 상태코드](https://developers.popbill.com/reference/cashbill/vb/response-code#state-code)
  - stateDT `type: String` `length: 14` `description: 상태 변경일시`
    - 형식 : yyyyMMddHHmmss
  - identityNum `type: String` `length: 19` `description: 식별번호`
    - {tradeUsage} 값이 "소득공제용" 경우 주민등록/휴대폰/카드번호/자진발급용 번호(010-000-1234) 반환
    - {tradeUsage} 값이 "지출증빙용" 경우 사업자번호/휴대폰/카드번호 반환
  - itemName `type: String` `length: 70` `description: 주문상품명`
  - customerName `type: String` `length: 70` `description: 구매자(고객) 성명`
  - confirmNum `type: String` `length: 9` `description: 국세청승인번호`
    - 현금영수증 발행 시점에 팝빌에서 자동으로 할당
  - orgConfirmNum `type: String` `length: 9` `description: 당초 국세청승인번호`
    - {tradeType}="취소거래" 경우 반환
  - orgTradeDate `type: String` `length: 8` `description: 당초 거래일자`
    - {tradeType}="취소거래" 경우 반환
  - ntssendDT `type: String` `length: 14` `description: 국세청 전송일시`
    - 형식 : yyyyMMddHHmmss
  - ntsresultDT `type: String` `length: 14` `description: 국세청 처리결과 수신일시`
    - 형식 : yyyyMMddHHmmss
  - ntsresultCode `type: String` `length: 4` `description: 국세청 결과코드`
    - [\[참고\] 국세청 결과코드](https://developers.popbill.com/reference/cashbill/vb/response-code#nts-result)
  - ntsresultMessage `type: String` `length: 30` `description: 국세청 결과메시지`
  - printYN `type: Boolean` `length: -` `description: 인쇄여부`
    - `True`: 인쇄
    - `False`: 미인쇄

### 예외

**Err**

- LastErrCode `type: Long` `length: -` `description: API 처리 실패에 대한 오류코드`
  - 음의 정수 8자리 숫자값 [\[참고\] 오류코드](https://developers.popbill.com/error-code)
- LastErrMessage `type: String` `length: -` `description: API 처리 실패에 대한 오류메시지`

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

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

**현금영수증 문서함의 팝업 URL을 반환합니다.**

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

```vb
Function GetURL(CorpNum As String, UserID As String, TOGO As String) As String
```

### 요청

**Parameters**

- CorpNum `type: String` `length: 10` `required: Y` `description: 팝빌회원 사업자번호 ('-' 제외)`
- UserID `type: String` `length: 50` `required: N` `description: 팝빌회원 아이디`
- TOGO `type: String` `length: -` `required: Y` `description: 접근 메뉴 (택 1)`
  - `TBOX`: 임시 문서함
  - `PBOX`: 발행 문서함
  - `WRITE`: 현금영수증 작성

### 응답

String - 요청에 대한 응답 URL

### 예외

**Err**

- LastErrCode `type: Long` `length: -` `description: API 처리 실패에 대한 오류코드`
  - 음의 정수 8자리 숫자값 [\[참고\] 오류코드](https://developers.popbill.com/error-code)
- LastErrMessage `type: String` `length: -` `description: API 처리 실패에 대한 오류메시지`
