# 현금영수증 단건발급 API

{% hint style="warning" %}
**Deprecated**

이 문서는 더 이상 관리되지 않습니다.

[PortOne 개발자센터](https://developers.portone.io/)를 이용해주세요.
{% endhint %}

### 현금영수증을 발급할 수 있습니다.

포트원을 통해 발생된 현금성 거래(**가상계좌,게좌이체**)의 포트원 거래번호(<mark style="color:red;">**`imp_uid`**</mark>)를 기준으로 현금영수증이 발급 됩니다. 현금영수증 발급 금액은 **현금성 거래의 금액으로 자동 적용**됩니다. 부분취소된 거래인 경우 **남은 잔액으로 발급**됩니다.

<details>

<summary><strong>지원되는 PG사</strong> 확인하기</summary>

* **KG 이니시스**
* **NHN KCP**
* **Settle Bank**
* **NICE Payments**
* **PayJoa(다우)**
* **KICC**
* **헥토파이낸셜**
* **케이에스넷**
* **스마트로 - 신모듈**
* **토스페이먼츠 - 신모듈**

</details>

## 현금거래에 대한 현금영수증을 발급합니다.

<mark style="color:green;">`POST`</mark> `https://api.iamport.kr/receipts/{imp_uid}`

현금영수증 발행을 처리하는 포트원 API 입니다.

#### Path Parameters

| Name                                       | Type   | Description                                  |
| ------------------------------------------ | ------ | -------------------------------------------- |
| imp\_uid<mark style="color:red;">\*</mark> | String | <mark style="color:red;">**포트원 거래번호**</mark> |

#### Request Body

| Name                                            | Type    | Description                                                                                                                                                                               |
| ----------------------------------------------- | ------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| product\_type<mark style="color:red;">\*</mark> | String  | <mark style="color:red;">**현금영수증 발행대상 식별정보**</mark>                                                                                                                                       |
| identifier<mark style="color:red;">\*</mark>    | String  | <mark style="color:red;">**현금영수증 발행대상 식별정보**</mark>                                                                                                                                       |
| identifier\_type                                | String  | <p><strong>현금영수증 식별정보 구분코드</strong></p><p><code>person : 주민등록번호</code></p><p><code>business : 사업자등록번호</code></p><p><code>phone : 휴대폰번호</code></p><p><code>taxcard : 국세청현금영수증카드</code></p> |
| type                                            | String  | <p><strong>현금영수증 발행 구분코드</strong></p><p><code>소득공제용(개인) : person</code></p><p><code>지출증빙용(법인) : company</code></p><p><code>기본값 : person</code></p>                                        |
| company\_tel                                    | String  | <p><strong>발행 상점 고객센터 번호</strong></p><p>(페이조아인 경우만 필수)</p>                                                                                                                                |
| company\_name                                   | String  | <p><strong>상점 사업자 명</strong></p><p>(페이조아인 경우만 필수)</p>                                                                                                                                     |
| corp\_reg\_no                                   | String  | <p><strong>상점 사업자 번호</strong></p><p>(페이조아인 경우만 필수)</p>                                                                                                                                    |
| buyer\_name                                     | String  | **구매자 이름**                                                                                                                                                                                |
| buyer\_email                                    | String  | **구매자 Email 주**                                                                                                                                                                           |
| buyer\_tel                                      | String  | **구매자 전화번호**                                                                                                                                                                              |
| tax\_free                                       | integer | **면세금액**                                                                                                                                                                                  |

{% tabs %}
{% tab title="200: OK 성공" %}
{% tabs %}
{% tab title="ReceiptResponse" %}
**`code`** <mark style="color:red;">**\***</mark> <mark style="color:purple;">**integer**</mark>

**응답코드**

0이면 정상적인 조회, 0 이 아닌 값이면 message를 확인해봐야 합니다

**`message`** <mark style="color:red;">**\***</mark> <mark style="color:green;">**string**</mark>

**응답메세지**

code 값이 0이 아닐 때, '존재하지 않는 결제정보입니다'와 같은 오류 메세지를 포함합니다

**`response`** <mark style="color:red;">**`(ReceiptAnnotation, optional)`**</mark>
{% endtab %}
{% endtabs %}

{% tabs %}
{% tab title="ReceiptAnnotation" %}
**`imp_uid`** <mark style="color:red;">**\***</mark> <mark style="color:green;">**`string`**</mark>

**`포트원 거래번호`**

**`receipt_tid`** <mark style="color:green;">**`string`**</mark>

**`현금영수증 PG사 발행고유번호`**

**`apply_num`** <mark style="color:red;">**\***</mark> <mark style="color:green;">**`string`**</mark>

**`현금영수증 국세청 발행번호`**

**`type`** <mark style="color:red;">**\***</mark> <mark style="color:green;">**`string`**</mark>

**`현금영수증 발행대상 타입`**

* 개인 : `person`
* 사업자 : `company`

**`amount`** <mark style="color:red;">**\***</mark> <mark style="color:orange;">**`integer`**</mark>

**`현금영수증 발행금액`**

**`vat`** <mark style="color:red;">**\***</mark> <mark style="color:orange;">**`integer`**</mark>

**`부가세`**

**`receipt_url`** <mark style="color:green;">**`string`**</mark>

**`발행된 현금영수증 URL`**

**`applied_at`** <mark style="color:red;">**\***</mark> <mark style="color:orange;">**`integer`**</mark>

**현금영수증 발행시각** `UNIX TIMESTAMP`

**`cancelled_at`** <mark style="color:orange;">**`integer`**</mark>

**`현금영수증 발행취소시각`** `UNIX TIMESTAMP`
{% endtab %}
{% endtabs %}
{% endtab %}

{% tab title="400: Bad Request 필수 파라미터가 누락된 경우, 결제완료(paid)가 아닌 결제 건에 대해 발행요청한 경우, 이미 현금영수증 발행된 건에 대해 요청한 경우" %}

```javascript
{
    // Response
}
```

{% endtab %}

{% tab title="401: Unauthorized 인증 Token이 전달되지 않았거나 유효하지 않은 경우" %}

```javascript
{
    // Response
}
```

{% endtab %}

{% tab title="500: Internal Server Error 현금영수증 발행에 실패한 경우" %}

```javascript
{
    // Response
}
```

{% endtab %}
{% endtabs %}

### **주요 요청 파라미터 상세 설명**

> **`identifier`** <mark style="color:red;">**\***</mark> <mark style="color:green;">**`string`**</mark>
>
> **`현금영수증 식별정보 구분코드`**
>
> 국세청현금영수증카드, 휴대폰번호, 주민등록번호, 사업자등록번호 를 기재합니다.

> **`identifier_type`** <mark style="color:red;">**\***</mark> <mark style="color:green;">**`string`**</mark>
>
> **`현금영수증 식별정보 구분코드`**
>
> **KICC, 세틀뱅크**인 경우에만 <mark style="color:red;">**필수**</mark>
>
> KG이니시스/NHN KCP/나이스페이먼츠/페이조아는 **identifier 만으로 자동 처리**

<details>

<summary>Response Model Schema</summary>

```json
{
  "code": 0,
  "message": "string",
  "response": {
    "imp_uid": "string",
    "receipt_tid": "string",
    "apply_num": "string",
    "type": "person",
    "amount": 0,
    "vat": 0,
    "receipt_url": "string",
    "applied_at": 0,
    "cancelled_at": 0
 }
}
```

</details>

{% hint style="success" %}
**Swagger Test Link**

[**https://api.iamport.kr/#!/receipts/issueReceipt**](https://api.iamport.kr/#!/receipts/issueReceipt)
{% endhint %}
