---
title: 현금영수증 이메일 전송
description: POST /v2/cash-receipts/{id}/send-email 로 현금영수증을 지정한 이메일 주소로 보내요.
sidebar:
  order: 7
  badge: POST
---

```http
POST /v2/cash-receipts/{id}/send-email
```

현금영수증을 지정한 이메일 주소로 보내요. 팝빌이 현금영수증 메일을 보내요. 구매자가 영수증을 다시 요청했을 때 써요.

주문과 연결된 현금영수증은 발급할 때 구매자에게 안내 메일을 자동으로 보낼 수 있어요. 대시보드 **현금영수증 > 발급 설정**을 확인하세요.

## 경로 파라미터

| 파라미터 | 타입 | 설명 |
| --- | --- | --- |
| `id` | string | 현금영수증 ID예요. `crt_`로 시작해요. |

## 요청 본문

| 필드 | 타입 | 필수 | 설명 |
| --- | --- | --- | --- |
| `email` | string | 예 | 받을 이메일 주소예요. 100자까지예요. |

## 요청 예시

```bash cURL
curl -X POST https://api.paysync.kr/v2/cash-receipts/crt_a1b2c3d4e5f6g7h8i9j0k1l2/send-email \
  -H "Authorization: Bearer $PAYSYNC_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "email": "hong@example.com" }'
```

```js Node.js
const res = await fetch(`https://api.paysync.kr/v2/cash-receipts/${cashReceiptId}/send-email`, {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.PAYSYNC_API_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({ email: "hong@example.com" }),
});
const { code } = await res.json();
```

```python Python
import os
import requests

res = requests.post(
    f"https://api.paysync.kr/v2/cash-receipts/{cash_receipt_id}/send-email",
    headers={"Authorization": f"Bearer {os.environ['PAYSYNC_API_KEY']}"},
    json={"email": "hong@example.com"},
)
print(res.json())
```

## 응답

```json 200 OK
{
  "code": "10001"
}
```

## 오류

| HTTP | `code` | 발생 조건 |
| --- | --- | --- |
| 401 | `290006` | API 키가 올바르지 않아요. |
| 403 | `290007` | 읽기 전용 API 키예요. |
| 404 | `20015` | 현금영수증이 없어요. |
| 409 | `240020` | 발급에 실패했거나 국세청 승인번호가 없는 현금영수증이에요. |
| 422 | `30007` | JSON 본문을 읽을 수 없거나 `email`이 없어요. |
| 422 | `240001` | 현금영수증 ID 형식이 틀렸어요. |
| 422 | `240018` | `email` 형식이 틀렸어요. |
| 502 | `240009` | 팝빌 호출이 실패했어요. `data`에 팝빌 오류 `code`와 `message`가 와요. |
