# 포인트 관리

## 1. GetUnitCost - 발행 단가 확인

세금계산서 발행시 과금되는 포인트 단가를 확인합니다.

```ruby
def getUnitCost(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 처리 실패에 대한 오류메시지`

## 2. 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 처리 실패에 대한 오류메시지`

## 3. 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 처리 실패에 대한 오류메시지`

## 4. 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 처리 실패에 대한 오류메시지`

## 5. 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 처리 실패에 대한 오류메시지`

## 6. 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 처리 실패에 대한 오류메시지`

## 7. 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 처리 실패에 대한 오류메시지`

## 8. 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 처리 실패에 대한 오류메시지`
