# 계좌 관리

## 1. RegistBankAccount - 계좌 등록

계좌조회 서비스를 이용할 계좌를 팝빌에 등록합니다.

```csharp
Response RegistBankAccount(String CorpNum, EasyFinBankAccountForm info, String UserID)
```

> 계좌를 등록할 때 결제기간만큼 포인트가 차감됩니다. 단, 파트너 포인트를 이용하는 경우에는 1개월 요금이 과금됩니다.

### 요청

**Parameters**

- CorpNum `type: String` `length: 10` `required: Y` `description: 팝빌회원 사업자번호 ('-' 제외)`
- info `type: EasyFinBankAccountForm` `length: -` `required: Y` `description: 계좌 정보`
  - BankCode `type: String` `length: 4` `required: Y` `description: 은행 기관코드`
    - [\[참고\] 조회 가능한 금융기관](https://developers.popbill.com/guide/easyfinbank/introduction/easy-intro#banklist)
  - AccountNumber `type: String` `length: 30` `required: Y` `description: 계좌번호`
  - AccountPWD `type: String` `length: 4` `required: Y` `description: 계좌 비밀번호`
  - AccountType `type: String` `length: 2` `required: Y` `description: 계좌 유형`
    - `법인`
    - `개인`
  - IdentityNumber `type: String` `length: 10` `required: Y` `description: 실명번호 ('-' 제외)`
    - {AccountType}="법인" 경우 사업자번호
    - {AccountType}="개인" 경우 생년월일 (형식 : yyMMdd)
  - AccountName `type: String` `length: 100` `required: N` `description: 계좌 별칭`
  - BankID `type: String` `length: 50` `required: 조건부` `description: 인터넷뱅킹 아이디`
    - {BankCode}="0004"(국민은행) 경우 필수
  - FastID `type: String` `length: 50` `required: 조건부` `description: 조회전용 계정 아이디`
    - {BankCode}="0031"(아이엠뱅크) or "0088"(신한은행) or "0048"(신협중앙회) 경우 필수
  - FastPWD `type: String` `length: 50` `required: 조건부` `description: 조회전용 계정 비밀번호`
    - {BankCode}="0031"(아이엠뱅크) or "0088"(신한은행) or "0048"(신협중앙회) 경우 필수
  - UsePeriod `type: String` `length: 2` `required: N` `description: 정액제 이용할 개월수`
    - `1`: 1개월 : 기본값
    - `2`: 2개월
    - `3`: 3개월
    - `4`: 4개월
    - `5`: 5개월
    - `6`: 6개월
    - `7`: 7개월
    - `8`: 8개월
    - `9`: 9개월
    - `10`: 10개월
    - `11`: 11개월
    - `12`: 12개월
    - 파트너 포인트 사용시 입력값에 관계 없이 기본값 적용
  - Memo `type: String` `length: 200` `required: N` `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 처리 실패에 대한 오류메시지`

## 2. UpdateBankAccount - 계좌정보 수정

팝빌에 등록된 계좌정보를 수정합니다.

```csharp
Response UpdateBankAccount(String CorpNum, EasyFinBankAccountForm info, String UserID)
```

### 요청

**Parameters**

- CorpNum `type: String` `length: 10` `required: Y` `description: 팝빌회원 사업자번호 ('-' 제외)`
- info `type: EasyFinBankAccountForm` `length: -` `required: Y` `description: 수정할 계좌 정보`
  - BankCode `type: String` `length: 4` `required: Y` `description: 은행 기관코드`
    - [\[참고\] 조회 가능한 금융기관](https://developers.popbill.com/guide/easyfinbank/introduction/easy-intro#banklist)
  - AccountNumber `type: String` `length: 30` `required: Y` `description: 계좌번호`
  - AccountPWD `type: String` `length: 4` `required: Y` `description: 계좌 비밀번호`
  - AccountType `type: String` `length: 2` `required: Y` `description: 계좌 유형`
    - `법인`
    - `개인`
  - IdentityNumber `type: String` `length: 10` `required: Y` `description: 실명번호 ('-' 제외)`
    - {AccountType}="법인" 경우 사업자번호
    - {AccountType}="개인" 경우 생년월일 (형식 : yyMMdd)
  - AccountName `type: String` `length: 100` `required: N` `description: 계좌 별칭`
  - BankID `type: String` `length: 50` `required: 조건부` `description: 인터넷뱅킹 아이디`
    - {BankCode}="0004"(국민은행) 경우 필수
  - FastID `type: String` `length: 50` `required: 조건부` `description: 조회전용 계정 아이디`
    - {BankCode}="0031"(아이엠뱅크) or "0088"(신한은행) or "0048"(신협중앙회) 경우 필수
  - FastPWD `type: String` `length: 50` `required: 조건부` `description: 조회전용 계정 비밀번호`
    - {BankCode}="0031"(아이엠뱅크) or "0088"(신한은행) or "0048"(신협중앙회) 경우 필수
  - UsePeriod `type: String` `length: 2` `required: N` `description: 정액제 이용할 개월수`
    - `1`: 1개월 : 기본값
    - `2`: 2개월
    - `3`: 3개월
    - `4`: 4개월
    - `5`: 5개월
    - `6`: 6개월
    - `7`: 7개월
    - `8`: 8개월
    - `9`: 9개월
    - `10`: 10개월
    - `11`: 11개월
    - `12`: 12개월
    - 파트너 포인트 사용시 입력값에 관계 없이 기본값 적용
  - Memo `type: String` `length: 200` `required: N` `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 처리 실패에 대한 오류메시지`

## 3. GetBankAccountInfo - 계좌정보 확인

팝빌에 등록된 계좌 정보를 확인합니다.

```csharp
EasyFinBankAccount GetBankAccountInfo(String CorpNum, String BankCode, String AccountNumber, String UserID)
```

### 요청

**Parameters**

- CorpNum `type: String` `length: 10` `required: Y` `description: 팝빌회원 사업자번호 ('-' 제외)`
- BankCode `type: String` `length: 4` `required: Y` `description: 은행 기관코드`
  - [\[참고\] 조회 가능한 금융기관](https://developers.popbill.com/guide/easyfinbank/introduction/easy-intro#banklist)
- AccountNumber `type: String` `length: 30` `required: Y` `description: 계좌번호`
- UserID `type: String` `length: 50` `required: N` `description: 팝빌회원 아이디`

### 응답

**EasyFinBankAccount**

- accountNumber `type: String` `length: 30` `description: 계좌번호`
- bankCode `type: String` `length: 4` `description: 은행 기관코드`
  - [\[참고\] 조회 가능한 금융기관](https://developers.popbill.com/guide/easyfinbank/introduction/easy-intro#banklist)
- accountName `type: String` `length: 100` `description: 계좌 별칭`
- accountType `type: String` `length: 2` `description: 계좌 유형`
  - `법인`
  - `개인`
- state `type: int?` `length: 1` `description: 계좌 상태`
  - `1`: 사용
  - `2`: 정지
- regDT `type: String` `length: 14` `description: 팝빌에 계좌를 등록한 일시`
  - 형식 : yyyyMMddHHmmss
- contractDT `type: String` `length: 14` `description: 정액제 서비스 시작일시`
  - 형식 : yyyyMMddHHmmss
- useEndDate `type: String` `length: 8` `description: 정액제 서비스 만료일자`
  - 형식 : yyyyMMdd
- baseDate `type: int?` `length: 2` `description: 자동연장 결제일`
  - `5`
  - `15`
  - `25`
- contractState `type: int?` `length: 1` `description: 정액제 서비스 상태`
  - `1`: 사용 또는 사용제한
  - `2`: 해지
- closeRequestYN `type: bool?` `length: -` `description: 정액제 서비스 해지신청 여부`
  - `true`: 신청
  - `false`: 미신청
- useRestrictYN `type: bool?` `length: -` `description: 정액제 서비스 사용제한 여부`
  - `true`: 사용제한
  - `false`: 사용
- closeOnExpired `type: bool?` `length: -` `description: 정액제 서비스 해지 구분`
  - `true`: 일반해지 (정액제 서비스 만료일 해지)
  - `false`: 중도해지 (요청 즉시 해지)
- unPaidYN `type: bool?` `length: -` `description: 미수금 보유 여부`
  - `true`: 보유
  - `false`: 미보유
- memo `type: String` `length: 200` `description: 메모`

### 예외

**PopbillException**

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

## 4. ListBankAccount - 계좌정보 목록 조회

팝빌에 등록된 계좌정보 목록을 반환합니다.

```csharp
List<EasyFinBankAccount> ListBankAccount(String CorpNum, String UserID)
```

### 요청

**Parameters**

- CorpNum `type: String` `length: 10` `required: Y` `description: 팝빌회원 사업자번호 ('-' 제외)`
- UserID `type: String` `length: 50` `required: N` `description: 팝빌회원 아이디`

### 응답

**List\<EasyFinBankAccount>**

- accountNumber `type: String` `length: 30` `description: 계좌번호`
- bankCode `type: String` `length: 4` `description: 은행 기관코드`
  - [\[참고\] 조회 가능한 금융기관](https://developers.popbill.com/guide/easyfinbank/introduction/easy-intro#banklist)
- accountName `type: String` `length: 100` `description: 계좌 별칭`
- accountType `type: String` `length: 2` `description: 계좌 유형`
  - `법인`
  - `개인`
- state `type: int?` `length: 1` `description: 계좌 상태`
  - `1`: 사용
  - `2`: 정지
- regDT `type: String` `length: 14` `description: 팝빌에 계좌를 등록한 일시`
  - 형식 : yyyyMMddHHmmss
- contractDT `type: String` `length: 14` `description: 정액제 서비스 시작일시`
  - 형식 : yyyyMMddHHmmss
- useEndDate `type: String` `length: 8` `description: 정액제 서비스 만료일자`
  - 형식 : yyyyMMdd
- baseDate `type: int?` `length: 2` `description: 자동연장 결제일`
  - `5`
  - `15`
  - `25`
- contractState `type: int?` `length: 1` `description: 정액제 서비스 상태`
  - `1`: 사용 또는 사용제한
  - `2`: 해지
- closeRequestYN `type: bool?` `length: -` `description: 정액제 서비스 해지신청 여부`
  - `true`: 신청
  - `false`: 미신청
- useRestrictYN `type: bool?` `length: -` `description: 정액제 서비스 사용제한 여부`
  - `true`: 사용제한
  - `false`: 사용
- closeOnExpired `type: bool?` `length: -` `description: 정액제 서비스 해지 구분`
  - `true`: 일반해지 (정액제 서비스 만료일 해지)
  - `false`: 중도해지 (요청 즉시 해지)
- unPaidYN `type: bool?` `length: -` `description: 미수금 보유 여부`
  - `true`: 보유
  - `false`: 미보유
- memo `type: String` `length: 200` `description: 메모`

### 예외

**PopbillException**

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

## 5. GetBankAccountMgtURL - 계좌 등록 팝업 URL

![계좌 등록 팝업 URL 미리보기](https://developers.popbill.com/images/reference/easyfinbank/getBankAccountMgtURL.png)

**계좌를 등록하는 팝업 URL을 반환합니다.**

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

```csharp
String GetBankAccountMgtURL(String CorpNum, String UserID)
```

### 요청

**Parameters**

- CorpNum `type: String` `length: 10` `required: Y` `description: 팝빌회원 사업자번호 ('-' 제외)`
- UserID `type: String` `length: 50` `required: N` `description: 팝빌회원 아이디`

### 응답

String - 요청에 대한 응답 URL

### 예외

**PopbillException**

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

## 6. CloseBankAccount - 정액제 해지요청

팝빌에 등록된 계좌의 정액제 해지를 요청합니다.

```csharp
Response CloseBankAccount(String CorpNum, String BankCode, String AccountNumber, String CloseType, String UserID)
```

### 요청

**Parameters**

- CorpNum `type: String` `length: 10` `required: Y` `description: 팝빌회원 사업자번호 ('-' 제외)`
- BankCode `type: String` `length: 4` `required: Y` `description: 은행 기관코드`
  - [\[참고\] 조회 가능한 금융기관](https://developers.popbill.com/guide/easyfinbank/introduction/easy-intro#banklist)
- AccountNumber `type: String` `length: 30` `required: Y` `description: 계좌번호`
- CloseType `type: String` `length: 2` `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 처리 실패에 대한 오류메시지`

## 7. RevokeCloseBankAccount - 정액제 해지요청 취소

신청한 정액제 해지요청을 취소합니다.

```csharp
Response RevokeCloseBankAccount(String CorpNum, String BankCode, String AccountNumber, String UserID)
```

### 요청

**Parameters**

- CorpNum `type: String` `length: 10` `required: Y` `description: 팝빌회원 사업자번호 ('-' 제외)`
- BankCode `type: String` `length: 4` `required: Y` `description: 은행 기관코드`
  - [\[참고\] 조회 가능한 금융기관](https://developers.popbill.com/guide/easyfinbank/introduction/easy-intro#banklist)
- AccountNumber `type: String` `length: 30` `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 처리 실패에 대한 오류메시지`

## 8. DeleteBankAccount - 계좌 삭제

등록된 계좌를 삭제합니다.

```csharp
Response DeleteBankAccount(String CorpNum, String BankCode, String AccountNumber, String UserID)
```

> 정액제가 아닌 종량제 이용 시에만 등록된 계좌를 삭제할 수 있습니다.\
> 정액제 이용시 [\[CloseBankAccount – 정액제 해지요청\]](https://developers.popbill.com/reference/easyfinbank/dotnet/api/manage#CloseBankAccount) 함수를 사용하여 정액제를 해지할 수 있습니다.

### 요청

**Parameters**

- CorpNum `type: String` `length: 10` `required: Y` `description: 팝빌회원 사업자번호 ('-' 제외)`
- BankCode `type: String` `length: 4` `required: Y` `description: 은행 기관코드`
  - [\[참고\] 조회 가능한 금융기관](https://developers.popbill.com/guide/easyfinbank/introduction/easy-intro#banklist)
- AccountNumber `type: String` `length: 30` `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 처리 실패에 대한 오류메시지`
