# 부가기능

## 1. SendEmail - 메일 재전송

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

```csharp
Response SendEmail(string CorpNum, string MgtKey, string Receiver, string UserID = null)
```

### 요청

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

### 응답

**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. SendSMS - 문자 재전송

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

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

```csharp
Response SendSMS(string CorpNum, string MgtKey, string Sender, string Receiver, string Contents, string UserID = null)
```

### 요청

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

### 응답

**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. SendFAX - 팩스 전송

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

```csharp
Response SendFAX(string CorpNum, string MgtKey, string Sender, string Receiver, string UserID = null)
```

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

### 응답

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

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

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

```csharp
Response AssignMgtKey(string CorpNum, string ItemKey, string MgtKey, string UserID = null)
```

### 요청

**Parameters**

- CorpNum `type: string` `length: 10` `required: Y` `description: 팝빌회원 사업자번호 ('-' 제외)`
- ItemKey `type: string` `length: 18` `required: Y` `description: 팝빌에서 현금영수증 관리 목적으로 할당한 식별번호`
  - [\[Search – 목록 조회\]](https://developers.popbill.com/reference/cashbill/dotnetcore/api/info#Search)를 통하여 CashbillInfo의 변수 'itemKey'를 확인
- MgtKey `type: string` `length: 24` `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 처리 실패에 대한 오류메시지`

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

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

```csharp
List<EmailConfig> ListEmailConfig(string CorpNum, string UserID = null)
```

### 요청

**Parameters**

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

### 응답

**List\<EmailConfig>**

- emailType `type: string` `length: -` `description: 메일 전송 유형`
  - `CSH_ISSUE`: 고객에게 현금영수증이 발행 되었음을 알려주는 메일
- sendYN `type: bool?` `length: -` `description: 전송 여부`
  - `true`: 전송
  - `false`: 미전송

### 예외

**PopbillException**

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

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

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

```csharp
Response UpdateEmailConfig(string CorpNum, string EmailType, bool SendYN, string UserID = null)
```

### 요청

**Parameters**

- CorpNum `type: string` `length: 10` `required: Y` `description: 팝빌회원 사업자번호 ('-' 제외)`
- EmailType `type: string` `length: -` `required: Y` `description: 메일 전송 유형`
  - `CSH_ISSUE`: 고객에게 현금영수증이 발행 되었음을 알려주는 메일
- SendYN `type: bool` `length: -` `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 처리 실패에 대한 오류메시지`
