# 계좌 거래내역 확인

## 1. Search - 수집 내역 확인

금융기관에서 수집된 계좌 거래내역을 확인합니다.

```csharp
EasyFinBankSearchResult Search(String CorpNum, String JobID, String[] TradeType, String SearchString, int Page, int PerPage, String Order, String UserID)
```

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

### 요청

**Parameters**

- CorpNum `type: String` `length: 10` `required: Y` `description: 팝빌회원 사업자번호 ('-' 제외)`
- JobID `type: String` `length: 18` `required: Y` `description: 팝빌에서 할당한 작업아이디`
  - [\[RequestJob - 수집 요청\]](https://developers.popbill.com/reference/easyfinbank/dotnet/api/job#RequestJob) API의 반환값
- TradeType `type: String[ ]` `length: -` `required: N` `description: 거래유형 (다중선택 가능)`
  - `I`: 입금
  - `O`: 출금
  - 기본값 : 전체조회
- SearchString `type: String` `length: -` `required: N` `description: 조회 검색어`
  - `입·출금액`: 입금 또는 출금 금액을 입력
  - `거래 내역 메모`: [\[SaveMemo – 거래 내역 메모저장\]](https://developers.popbill.com/reference/easyfinbank/dotnet/api/search#SaveMemo) 을 사용하여 저장한 값
  - `비고`: EasyFinBankSearchDetail의 변수 'remark1', 'remark2', 'remark3'
  - 기본값 : 전체조회
- Page `type: int` `length: -` `required: N` `description: 목록 페이지번호`
  - 기본값 : 1
- PerPage `type: int` `length: -` `required: N` `description: 페이지당 표시할 목록 건수`
  - 최대 : 1,000건
  - 기본값 : 500건
- Order `type: String` `length: -` `required: N` `description: 목록 정렬 방향`
  - `D`: 내림차순 : 기본값
  - `A`: 오름차순
  - API를 호출하고 반환 받은 거래일시(trdt) 기준
- UserID `type: String` `length: 50` `required: N` `description: 팝빌회원 아이디`

### 응답

**EasyFinBankSearchResult**

- code `type: long` `length: -` `description: API 처리에 대한 응답코드`
  - `1`: 성공
- message `type: String` `length: -` `description: API 처리에 대한 응답 메시지`
- total `type: long` `length: -` `description: 총 검색결과 건수`
- perPage `type: long` `length: -` `description: 페이지 당 목록 건수`
- pageNum `type: long` `length: -` `description: 페이지 번호`
- pageCount `type: long` `length: -` `description: 페이지 개수`
- lastScrapDT `type: String` `length: 14` `description: 최종 조회일시`
  - 형식 : yyyyMMddHHmmss
- balance `type: String` `length: 20` `description: 현재 잔액`
- list `type: List<EasyFinBankSearchDetail>` `length: 1,000` `description: 거래내역 조회 목록`
  - 최대 : 1,000건
  - tid `type: String` `length: 32` `description: 거래내역 아이디`
    - 거래 내역에 대해 팝빌이 할당한 고유 식별값
  - trdate `type: String` `length: 8` `description: 거래일자`
    - 형식 : yyyyMMdd
  - trserial `type: long?` `length: -` `description: 거래일련번호`
    - 거래일자별 거래 내역 순번
  - trdt `type: String` `length: 14` `description: 거래일시`
    - 형식 : yyyyMMddHHmmss
  - accIn `type: String` `length: 20` `description: 입금액`
  - accOut `type: String` `length: 20` `description: 출금액`
  - balance `type: String` `length: 20` `description: 잔액`
  - remark1 `type: String` `length: 500` `description: 비고 1`
    - {BankCode}="0003"(기업은행) 경우 받는분 계좌번호
    - {BankCode}="0004"(국민은행) 경우 내통장 표시내용
  - remark2 `type: String` `length: 500` `description: 비고 2`
    - 은행별 제공 정보 다름(거래구분, 거래종류, 거래내용, 적요 등)
  - remark3 `type: String` `length: 500` `description: 비고 3`
    - 은행별 제공 정보 다름(거래내용, 적요, 내역, 비고 등)
  - remark4 `type: String` `length: 500` `description: 비고 4`
    - 은행별 제공 정보 다름(거래점, 취급점, 처리점 등)
  - regDT `type: String` `length: 14` `description: 등록일시`
    - 형식 : yyyyMMddHHmmss
  - memo `type: String` `length: 100` `description: 거래 내역 메모`
    - [\[SaveMemo – 거래 내역 메모저장\]](https://developers.popbill.com/reference/easyfinbank/dotnet/api/search#SaveMemo)을 사용하여 저장한 값

### 예외

**PopbillException**

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

## 2. Summary - 수집 내역 합계

금융기관에서 수집된 계좌 거래내역의 입금 및 출금 합계정보를 제공합니다.

```csharp
EasyFinBankSummary Summary(String CorpNum, String JobID, String[] TradeType, String SearchString)
```

### 요청

**Parameters**

- CorpNum `type: String` `length: 10` `required: Y` `description: 팝빌회원 사업자번호 ('-' 제외)`
- JobID `type: String` `length: 18` `required: Y` `description: 팝빌에서 할당한 작업아이디`
  - [\[RequestJob - 수집 요청\]](https://developers.popbill.com/reference/easyfinbank/dotnet/api/job#RequestJob) API의 반환값
- TradeType `type: String[ ]` `length: -` `required: N` `description: 거래유형 (다중선택 가능)`
  - `I`: 입금
  - `O`: 출금
  - 기본값 : 전체조회
- SearchString `type: String` `length: -` `required: N` `description: 조회 검색어`
  - `입·출금액`: 입금 또는 출금 금액을 입력
  - `거래 내역 메모`: [\[SaveMemo – 거래 내역 메모저장\]](https://developers.popbill.com/reference/easyfinbank/dotnet/api/search#SaveMemo) 을 사용하여 저장한 값
  - `비고`: EasyFinBankSearchDetail의 변수 'remark1', 'remark2', 'remark3'
  - 기본값 : 전체조회
- UserID `type: String` `length: 50` `required: N` `description: 팝빌회원 아이디`

### 응답

**EasyFinBankSummary**

- count `type: long?` `length: -` `description: 수집 건수`
- cntAccIn `type: long?` `length: -` `description: 입금거래 건수`
- cntAccOut `type: long?` `length: -` `description: 출금거래 건수`
- totalAccIn `type: long?` `length: -` `description: 입금액 합계`
- totalAccOut `type: long?` `length: -` `description: 출금액 합계`

### 예외

**PopbillException**

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

## 3. SaveMemo - 거래 내역 메모저장

한 건의 거래 내역에 메모를 저장합니다.

```csharp
Response SaveMemo(String CorpNum, String TID, String Memo, String UserID)
```

### 요청

**Parameters**

- CorpNum `type: String` `length: 10` `required: Y` `description: 팝빌회원 사업자번호 ('-' 제외)`
- TID `type: String` `length: 32` `required: Y` `description: 메모를 저장할 거래내역 아이디`
  - [\[Search - 수집 내역 확인\]](https://developers.popbill.com/reference/easyfinbank/dotnet/api/search#Search) API를 호출하고 반환 받은 거래내역 아이디(tid)
- Memo `type: String` `length: 100` `required: Y` `description: 거래내역에 저장할 메모`
- UserID `type: String` `length: 50` `required: N` `description: 팝빌회원 아이디`

### 응답

**Response**

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

### 예외

**PopbillException**

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