# 정액제 신청 / 포인트 관리

## 1. GetFlatRateState - 정액제 서비스 상태 확인

계좌조회 정액제 서비스 상태를 확인합니다.

```vb
Function GetFlatRateState(CorpNum As String, BankCode As String, AccountNumber As String, Optional UserID As String = "") As PBEasyFinBankFlatRate
```

### 요청

**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: 팝빌회원 아이디`

### 응답

**PBEasyFinBankFlatRate**

- referenceID `type: String` `length: 18` `description: 계좌아이디`
  - 팝빌이 계좌를 식별하는 값
- contractDT `type: String` `length: 14` `description: 정액제 서비스 시작일시`
  - 형식 : yyyyMMddHHmmss
- useEndDate `type: String` `length: 8` `description: 정액제 서비스 만료일자`
  - 형식 : yyyyMMdd
- baseDate `type: Integer` `length: 2` `description: 자동연장 결제일`
  - `5`
  - `15`
  - `25`
- state `type: Integer` `length: 1` `description: 정액제 서비스 상태`
  - `1`: 사용 또는 사용제한
  - `2`: 해지
- closeRequestYN `type: Boolean` `length: -` `description: 정액제 서비스 해지신청 여부`
  - `True`: 신청
  - `False`: 미신청
- useRestrictYN `type: Boolean` `length: -` `description: 정액제 서비스 사용제한 여부`
  - `True`: 사용제한
  - `False`: 사용
- closeOnExpired `type: Boolean` `length: -` `description: 정액제 서비스 해지 구분`
  - `True`: 일반해지 (정액제 서비스 만료일 해지)
  - `False`: 중도해지 (요청 즉시 해지)
- unPaidYN `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. GetFlatRatePopUpURL - 정액제 신청 팝업 URL

![정액제 신청 팝업 URL 미리보기](https://developers.popbill.com/images/reference/point/getFlatRatePopUpURL_easyfinbank.png)

**정액제를 신청하는 팝업 URL을 반환합니다.**

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

```vb
Function GetFlatRatePopUpURL(CorpNum As String, Optional UserID As String = "") As String
```

### 요청

**Parameters**

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

### 응답

String - 요청에 대한 응답 URL

### 예외

**Err**

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

## 3. GetChargeInfo - 과금정보 확인

팝빌 계좌조회 API 서비스 과금정보를 확인합니다.

```vb
Function GetChargeInfo(CorpNum As String, Optional UserID As String = "") As PBChargeInfo
```

### 요청

**Parameters**

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

### 응답

**PBChargeInfo**

- unitCost `type: String` `length: 12` `description: 요금`
- chargeMethod `type: String` `length: 3` `description: 과금유형`
  - `연동`
  - `파트너`
- rateSystem `type: String` `length: 3` `description: 요금제도`
  - `정액제`
  - `종량제`

### 예외

**Err**

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

## 4. GetBalance - 연동회원 잔여포인트 확인

연동회원의 잔여포인트를 확인합니다.

```vb
Function GetBalance(CorpNum As String) As Double
```

### 요청

**Parameters**

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

### 응답

Double - 연동회원 잔여포인트

### 예외

**Err**

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

## 5. GetChargeURL - 연동회원 포인트 충전 팝업 URL

![연동회원 포인트 충전 팝업 URL 미리보기](https://developers.popbill.com/images/reference/point/getChargeURL.png)

**연동회원 포인트를 충전하는 팝업 URL을 반환합니다.**

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

```vb
Function GetChargeURL(CorpNum As String, UserID As String) As String
```

### 요청

**Parameters**

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

### 응답

String - 요청에 대한 응답 URL

### 예외

**Err**

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

## 6. GetPaymentURL - 연동회원 포인트 결제내역 팝업 URL

![연동회원 포인트 결제내역 팝업 URL 미리보기](https://developers.popbill.com/images/reference/point/getPaymentURL.png)

**연동회원 포인트 결제내역 팝업 URL을 반환합니다.**

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

```vb
Function GetPaymentURL(CorpNum As String, UserID As String) As String
```

### 요청

**Parameters**

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

### 응답

String - 요청에 대한 응답 URL

### 예외

**Err**

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

## 7. GetUseHistoryURL - 연동회원 포인트 사용내역 팝업 URL

![연동회원 포인트 사용내역 팝업 URL 미리보기](https://developers.popbill.com/images/reference/point/getUseHistoryURL.png)

**연동회원 포인트 사용내역 팝업 URL을 반환합니다.**

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

```vb
Function GetUseHistoryURL(CorpNum As String, UserID As String) As String
```

### 요청

**Parameters**

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

### 응답

String - 요청에 대한 응답 URL

### 예외

**Err**

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

## 8. GetPartnerBalance - 파트너 잔여포인트 확인

파트너의 잔여포인트를 확인합니다.

```vb
Function GetPartnerBalance(CorpNum As String) As Double
```

### 요청

**Parameters**

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

### 응답

Double - 파트너 잔여포인트

### 예외

**Err**

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

## 9. GetPartnerURL - 파트너 포인트 충전 팝업 URL

![파트너 포인트 충전 팝업 URL 미리보기](https://developers.popbill.com/images/reference/point/getPartnerURL.png)

**파트너 포인트를 충전하는 팝업 URL을 반환합니다.**

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

```vb
Function GetPartnerURL(CorpNum As String, TOGO As String) As String
```

### 요청

**Parameters**

- CorpNum `type: String` `length: 10` `required: Y` `description: 팝빌회원 사업자번호 ('-' 제외)`
- TOGO `type: String` `length: 4` `required: Y` `description: 고정값 : "CHRG"`

### 응답

String - 요청에 대한 응답 URL

### 예외

**Err**

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