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

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

홈택스수집 정액제 서비스 상태를 확인합니다.

```ruby
def getFlatRateState(corpNum, userID = "")
```

### 요청

**Parameters**

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

### 응답

**FlatRateState**

- referenceID `type: String` `length: 10` `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`: 미보유

### 예외

**PopbillException**

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

## 2. GetFlatRatePopUpURL - 정액제 신청 팝업 URL

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

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

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

```ruby
def getFlatRatePopUpURL(corpNum, userID = "")
```

### 요청

**Parameters**

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

### 응답

String - 요청에 대한 응답 URL

### 예외

**PopbillException**

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

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

팝빌 홈택스수집 API 서비스 과금정보를 확인합니다.

```ruby
def getChargeInfo(corpNum, userID = "")
```

### 요청

**Parameters**

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

### 응답

**ChargeInfo**

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

### 예외

**PopbillException**

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

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

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

```ruby
def getBalance(corpNum)
```

### 요청

**Parameters**

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

### 응답

Float - 연동회원 잔여포인트

### 예외

**PopbillException**

- code `type: Integer` `length: -` `description: API 처리 실패에 대한 오류코드`
  - 음의 정수 8자리 숫자값 [\[참고\] 오류코드](https://developers.popbill.com/error-code)
- message `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에서만 유효한 세션을 포함하고 있습니다.

```ruby
def getChargeURL(corpNum, userID)
```

### 요청

**Parameters**

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

### 응답

String - 요청에 대한 응답 URL

### 예외

**PopbillException**

- code `type: Integer` `length: -` `description: API 처리 실패에 대한 오류코드`
  - 음의 정수 8자리 숫자값 [\[참고\] 오류코드](https://developers.popbill.com/error-code)
- message `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에서만 유효한 세션을 포함하고 있습니다.

```ruby
def getPaymentURL(corpNum, userID = "")
```

### 요청

**Parameters**

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

### 응답

String - 요청에 대한 응답 URL

### 예외

**PopbillException**

- code `type: Integer` `length: -` `description: API 처리 실패에 대한 오류코드`
  - 음의 정수 8자리 숫자값 [\[참고\] 오류코드](https://developers.popbill.com/error-code)
- message `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에서만 유효한 세션을 포함하고 있습니다.

```ruby
def getUseHistoryURL(corpNum, userID = "")
```

### 요청

**Parameters**

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

### 응답

String - 요청에 대한 응답 URL

### 예외

**PopbillException**

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

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

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

```ruby
def getPartnerBalance(corpNum)
```

### 요청

**Parameters**

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

### 응답

Float - 파트너 잔여포인트

### 예외

**PopbillException**

- code `type: Integer` `length: -` `description: API 처리 실패에 대한 오류코드`
  - 음의 정수 8자리 숫자값 [\[참고\] 오류코드](https://developers.popbill.com/error-code)
- message `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에서만 유효한 세션을 포함하고 있습니다.

```ruby
def getPartnerURL(corpNum, togo)
```

### 요청

**Parameters**

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

### 응답

String - 요청에 대한 응답 URL

### 예외

**PopbillException**

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