# 부가기능

## 1. SendEmail - 메일 재전송

현금영수증과 관련된 안내 메일을 재전송 합니다.

```vb
Function SendEmail(CorpNum As String, mgtKey As String, Receiver As String, Optional UserID As String = "") As PBResponse
```

### 요청

**Parameters**

- CorpNum `type: String` `length: 10` `required: Y` `description: 팝빌회원 사업자번호 ('-' 제외)`
- mgtKey `type: String` `length: 24` `required: Y` `description: 메일 재전송할 현금영수증 문서번호`
- Receiver `type: String` `length: -` `required: Y` `description: 수신자 메일주소`
- UserID `type: String` `length: 50` `required: N` `description: 팝빌회원 아이디`

### 응답

**PBResponse**

- code `type: Long` `length: -` `description: API 처리에 대한 응답코드`
  - `1`: 성공
- message `type: String` `length: -` `description: API 처리에 대한 응답메시지`
- confirmNum `type: String` `length: 9` `description: 국세청승인번호`
  - 현금영수증 발행 시점에 팝빌에서 자동으로 할당 RegistIssue, RevokeRegistIssue API 사용할 경우만 존재
- tradeDate `type: String` `length: 8` `description: 거래일자`
  - 현금영수증 발행 시점에 팝빌에서 자동으로 할당 RegistIssue, RevokeRegistIssue API 사용할 경우만 존재 형식 : yyyyMMdd

### 예외

**Err**

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

## 2. SendSMS - 문자 재전송

현금영수증과 관련된 안내 SMS(단문) 문자를 재전송하는 함수로, 팝빌 사이트 \[ 문자 > 결과 > 전송결과 ] 메뉴에서 전송결과를 확인할 수 있습니다.

- 메시지는 최대 90byte까지 입력 가능하고, 초과한 내용은 자동으로 삭제되어 전송합니다. (한글 최대 45자)

```vb
Function SendSMS(CorpNum As String, mgtKey As String, Sender As String, Receiver As String, Contents As String, Optional UserID As String = "") As PBResponse
```

### 요청

**Parameters**

- CorpNum `type: String` `length: 10` `required: Y` `description: 팝빌회원 사업자번호 ('-' 제외)`
- mgtKey `type: String` `length: 24` `required: Y` `description: 파트너가 할당한 문서번호`
- Sender `type: String` `length: -` `required: Y` `description: 발신번호`
- Receiver `type: String` `length: -` `required: Y` `description: 수신번호`
- Contents `type: String` `length: 90` `required: Y` `description: 메시지 내용`
  - 최대 90 byte까지 입력 가능하고, 초과한 내용은 자동으로 삭제되어 전송
- UserID `type: String` `length: 50` `required: N` `description: 팝빌회원 아이디`

### 응답

**PBResponse**

- code `type: Long` `length: -` `description: API 처리에 대한 응답코드`
  - `1`: 성공
- message `type: String` `length: -` `description: API 처리에 대한 응답메시지`
- confirmNum `type: String` `length: 9` `description: 국세청승인번호`
  - 현금영수증 발행 시점에 팝빌에서 자동으로 할당 RegistIssue, RevokeRegistIssue API 사용할 경우만 존재
- tradeDate `type: String` `length: 8` `description: 거래일자`
  - 현금영수증 발행 시점에 팝빌에서 자동으로 할당 RegistIssue, RevokeRegistIssue API 사용할 경우만 존재 형식 : yyyyMMdd

### 예외

**Err**

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

## 3. SendFax - 팩스 전송

현금영수증을 팩스로 전송하는 함수로, 팝빌 사이트 \[ 팩스 > 결과 > 전송결과 ] 메뉴에서 전송결과를 확인할 수 있습니다.

```vb
Function SendFax(CorpNum As String, mgtKey As String, Sender As String, Receiver As String, Optional UserID As String = "") As PBResponse
```

> API 호출 시 포인트가 차감됩니다.

### 요청

**Parameters**

- CorpNum `type: String` `length: 10` `required: Y` `description: 팝빌회원 사업자번호 ('-' 제외)`
- mgtKey `type: String` `length: 24` `required: Y` `description: 파트너가 할당한 문서번호`
- Sender `type: String` `length: -` `required: Y` `description: 발신번호`
- Receiver `type: String` `length: -` `required: Y` `description: 수신번호`
- UserID `type: String` `length: 50` `required: N` `description: 팝빌회원 아이디`

### 응답

**PBResponse**

- code `type: Long` `length: -` `description: API 처리에 대한 응답코드`
  - `1`: 성공
- message `type: String` `length: -` `description: API 처리에 대한 응답메시지`
- confirmNum `type: String` `length: 9` `description: 국세청승인번호`
  - 현금영수증 발행 시점에 팝빌에서 자동으로 할당 RegistIssue, RevokeRegistIssue API 사용할 경우만 존재
- tradeDate `type: String` `length: 8` `description: 거래일자`
  - 현금영수증 발행 시점에 팝빌에서 자동으로 할당 RegistIssue, RevokeRegistIssue API 사용할 경우만 존재 형식 : yyyyMMdd

### 예외

**Err**

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

## 4. AssignMgtKey - 문서번호 할당

팝빌 사이트를 통해 발행하여 문서번호가 할당되지 않은 현금영수증에 문서번호를 할당합니다.

```vb
Function AssignMgtKey(CorpNum As String, itemKey As String, mgtKey As String, Optional UserID As String = "") As PBResponse
```

### 요청

**Parameters**

- CorpNum `type: String` `length: 10` `required: Y` `description: 팝빌회원 사업자번호 ('-' 제외)`
- itemKey `type: String` `length: 18` `required: Y` `description: 팝빌에서 현금영수증 관리 목적으로 할당한 식별번호`
  - [\[Search – 목록 조회\]](https://developers.popbill.com/reference/cashbill/vba/api/info#Search)를 통하여 PBCbInfo의 변수 'itemKey'를 확인
- mgtKey `type: String` `length: 24` `required: Y` `description: 파트너가 할당한 문서번호`
- UserID `type: String` `length: 50` `required: N` `description: 팝빌회원 아이디`

### 응답

**PBResponse**

- code `type: Long` `length: -` `description: API 처리에 대한 응답코드`
  - `1`: 성공
- message `type: String` `length: -` `description: API 처리에 대한 응답메시지`
- confirmNum `type: String` `length: 9` `description: 국세청승인번호`
  - 현금영수증 발행 시점에 팝빌에서 자동으로 할당 RegistIssue, RevokeRegistIssue API 사용할 경우만 존재
- tradeDate `type: String` `length: 8` `description: 거래일자`
  - 현금영수증 발행 시점에 팝빌에서 자동으로 할당 RegistIssue, RevokeRegistIssue API 사용할 경우만 존재 형식 : yyyyMMdd

### 예외

**Err**

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

## 5. ListEmailConfig - 알림메일 발송설정 조회

현금영수증 관련 메일 항목에 대한 발송설정을 확인합니다.

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

### 요청

**Parameters**

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

### 응답

**PBEmailConfig**

- emailType `type: String` `length: -` `description: 메일 전송 유형`
  - `CSH_ISSUE`: 고객에게 현금영수증이 발행 되었음을 알려주는 메일
- sendYN `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 처리 실패에 대한 오류메시지`

## 6. UpdateEmailConfig - 알림메일 발송설정 수정

현금영수증 관련 메일 항목에 대한 발송설정을 수정합니다.

```vb
Function UpdateEmailConfig(CorpNum As String, emailType As String, sendYN As Boolean, Optional UserID As String = "") As PBResponse
```

### 요청

**Parameters**

- CorpNum `type: String` `length: 10` `required: Y` `description: 팝빌회원 사업자번호 ('-' 제외)`
- emailType `type: String` `length: -` `required: Y` `description: 메일 전송 유형`
  - `CSH_ISSUE`: 고객에게 현금영수증이 발행 되었음을 알려주는 메일
- sendYN `type: Boolean` `length: -` `required: Y` `description: 전송 여부`
- UserID `type: String` `length: 50` `required: N` `description: 팝빌회원 아이디`

### 응답

**PBResponse**

- code `type: Long` `length: -` `description: API 처리에 대한 응답코드`
  - `1`: 성공
- message `type: String` `length: -` `description: API 처리에 대한 응답메시지`
- confirmNum `type: String` `length: 9` `description: 국세청승인번호`
  - 현금영수증 발행 시점에 팝빌에서 자동으로 할당 RegistIssue, RevokeRegistIssue API 사용할 경우만 존재
- tradeDate `type: String` `length: 8` `description: 거래일자`
  - 현금영수증 발행 시점에 팝빌에서 자동으로 할당 RegistIssue, RevokeRegistIssue API 사용할 경우만 존재 형식 : yyyyMMdd

### 예외

**Err**

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