현금영수증 발행
현금영수증은 두 가지로 발행합니다. 이미 완료된 결제 건에 붙이는 결제 건 발행, 결제와 무관하게 단독으로 발행하는 별건 발행입니다. 모두 서버에서 Basic Auth로 호출합니다.
발행 방식을 고르는 기준과 발행 흐름은 가이드 현금영수증에 있습니다.
발행 유형과 값 규칙
발행 시 cash_receipt_type으로 용도를 지정합니다.
| 유형 | 값 | 용도 | 식별번호(identity_no) |
|---|---|---|---|
| 소득공제 | 소득공제 | 개인 소비자의 연말정산 소득공제 | 휴대폰번호 또는 주민등록번호 |
| 지출증빙 | 지출증빙 | 사업자의 비용 지출 증빙 | 사업자등록번호 |
identity_no는 현금영수증을 귀속시킬 대상을 식별하는 번호입니다. 소득공제는 보통 휴대폰번호, 지출증빙은 사업자등록번호를 사용합니다.
발행 상태값
| status | 의미 |
|---|---|
60 | 현금영수증발행완료 |
61 | 현금영수증발행취소 |
-60 | 현금영수증발행실패 |
-61 | 현금영수증취소실패 |
1. 결제 건에 발행
완료된 결제의 receipt_id에 현금영수증을 발행합니다. 계좌이체·가상계좌처럼 현금성 결제를 한 뒤 영수증만 따로 발행할 때 사용합니다.
요청 파라미터
| 파라미터 | 타입 | 필수 | 설명 |
|---|---|---|---|
receipt_id | String | Y | 현금영수증을 발행할 결제의 영수증 ID |
cash_receipt_type | String | N | 지출증빙이면 지출증빙, 그 외 모든 값은 소득공제로 처리. 생략하거나 빈 값이면 소득공제로 발행됩니다 |
identity_no | String | Y | 발행 식별번호 (휴대폰번호 / 주민번호 / 사업자번호) |
username | String | Y | 구매자명. PG와 무관하게 비어 있으면 RC_CASH_RECEIPT_NEED_USERNAME 오류. 다만 기본 채널로 발행할 때 PG로 전달되는 구매자명은 이 값이 아니라 원 결제의 extra.username(없으면 구매자)입니다 |
phone | String | N | 구매자 전화번호. 이니시스·나이스페이먼츠는 그대로 PG로 전달됩니다. 페이앱은 전화번호 자리에 identity_no를 넣어 보내므로 이 값을 쓰지 않고, 토스·기본 채널은 사용하지 않습니다 |
email | String | N | 구매자 이메일. 이니시스·나이스페이먼츠·페이앱은 PG로 전달됩니다. 토스·기본 채널은 사용하지 않습니다 |
pg | String | N | 현금영수증을 발행할 PG를 직접 지정. 생략하면 부트페이 기본 발행 채널을 사용합니다 |
test_production | Boolean | N | 샌드박스 프로젝트에서도 실제 발행을 강제할 때 true (기본 false) |
currency | String | N | 통화. 생략 시 WON |
응답 예시
응답은 결제 건 전체 정보를 그대로 돌려주고, 현금영수증 정보는 그 안의 결제수단 블록에 담깁니다.
원 결제가 계좌이체면 bank_data, 가상계좌면 vbank_data 안에 cash_receipt_* 필드가 들어갑니다.
| 필드 | 설명 |
|---|---|
cash_receipt_tid | 현금영수증 발행 PG 거래 ID (취소 시 사용) |
cash_receipt_no | 발행된 현금영수증 번호 (국세청 조회용) |
cash_receipt_type | 1 소득공제 / 2 지출증빙 |
cash_receipt_url | PG가 제공하는 현금영수증 확인 URL (일부 PG만 제공) |
/v2/request/receipt/cash/publishcurl -X POST "https://api.bootpay.co.kr/v2/request/receipt/cash/publish" \
-H "Authorization: Basic $(printf '%s' 'CLIENT_KEY:SECRET_KEY' | base64)" \
-H "Content-Type: application/json" \
-d '{
"receipt_id": "RECEIPT_ID",
"cash_receipt_type": "소득공제",
"identity_no": "01012345678",
"username": "홍길동",
"phone": "01012345678"
}'import { Bootpay } from '@bootpay/backend-js'
Bootpay.setConfiguration({
client_key: process.env.BOOTPAY_CLIENT_KEY,
secret_key: process.env.BOOTPAY_SECRET_KEY,
})
const response = await Bootpay.cashReceiptPublishOnReceipt({
receipt_id: '[ receipt_id ]',
cash_receipt_type: '소득공제', // 소득공제 | 지출증빙
identity_no: '01012345678', // 휴대폰번호 / 주민번호 / 사업자번호
username: '홍길동',
phone: '01012345678',
email: 'user@example.com',
})
console.log(response.bank_data.cash_receipt_no, response.bank_data.cash_receipt_url)from bootpay_backend import BootpayBackend
bootpay = BootpayBackend(client_key='CLIENT_KEY', secret_key='SECRET_KEY')
response = bootpay.cash_receipt_publish_on_receipt(
receipt_id='[ receipt_id ]',
cash_receipt_type='소득공제', # 소득공제 | 지출증빙
identity_no='01012345678', # 휴대폰번호 / 주민번호 / 사업자번호
username='홍길동',
phone='01012345678',
email='user@example.com'
)
print(response)use Bootpay\ServerPhp\BootpayApi;
BootpayApi::setClientKeyConfiguration('CLIENT_KEY', 'SECRET_KEY');
$response = BootpayApi::cashReceiptPublishOnReceipt([
'receipt_id' => '[ receipt_id ]',
'cash_receipt_type' => '소득공제',
'identity_no' => '01012345678',
'username' => '홍길동',
'phone' => '01012345678',
'email' => 'user@example.com',
]);
print_r($response);import kr.co.bootpay.pg.Bootpay;
import kr.co.bootpay.pg.model.request.CashReceipt;
Bootpay bootpay = Bootpay.withClientKey("CLIENT_KEY", "SECRET_KEY");
CashReceipt cashReceipt = new CashReceipt();
cashReceipt.receiptId = "[ receipt_id ]";
cashReceipt.cashReceiptType = "소득공제";
cashReceipt.identityNo = "01012345678";
cashReceipt.username = "홍길동";
cashReceipt.phone = "01012345678";
cashReceipt.email = "user@example.com";
var response = bootpay.requestCashReceiptByBootpay(cashReceipt);
System.out.println(response);bootpay = Bootpay::RestClient.new(client_key: 'CLIENT_KEY', secret_key: 'SECRET_KEY')
response = bootpay.cash_receipt_publish_on_receipt(
receipt_id: '[ receipt_id ]',
cash_receipt_type: '소득공제',
identity_no: '01012345678',
username: '홍길동',
phone: '01012345678',
email: 'user@example.com'
)
puts response.dataimport "github.com/bootpay/backend-go/v2"
api := bootpay.NewAPIWithClientKey("CLIENT_KEY", "SECRET_KEY", nil, "")
response, err := api.RequestCashReceiptByBootpay(bootpay.CashReceiptData{
ReceiptId: "[ receipt_id ]",
CashReceiptType: "소득공제",
IdentityNo: "01012345678",
Username: "홍길동",
Phone: "01012345678",
Email: "user@example.com",
})
fmt.Println(response, err)using Bootpay;
using Bootpay.models;
var bootpay = BootpayApi.WithClientKey("CLIENT_KEY", "SECRET_KEY");
var response = await bootpay.RequestCashReceiptByBootpay(new CashReceipt
{
receiptId = "[ receipt_id ]",
cashReceiptType = "소득공제",
identityNo = "01012345678",
username = "홍길동",
phone = "01012345678",
email = "user@example.com"
});
Console.WriteLine(await response.Content.ReadAsStringAsync());{
"receipt_id": "62f356871fc192036f9f4ae2",
"order_id": "order_1700000000",
"price": 10000,
"tax_free": 0,
"cancelled_price": 0,
"cancelled_tax_free": 0,
"order_name": "테스트 결제",
"company_name": "테스트상점",
"gateway_url": "https://api.bootpay.co.kr",
"metadata": {},
"sandbox": false,
"pg": "나이스페이먼츠",
"method": "계좌이체",
"method_symbol": "bank",
"method_origin": "계좌이체",
"method_origin_symbol": "bank",
"purchased_at": "2026-04-10T15:56:08+09:00",
"requested_at": "2026-04-10T15:55:41+09:00",
"status_locale": "결제완료",
"currency": "KRW",
"receipt_url": "https://.../receipts/...",
"status": 1,
"bank_data": {
"tid": "5zJ4xY7m0kODnyRpQWGrNWja7bkR78Kwv1M9ENjbeoPaZdL6",
"bank_code": "088",
"bank_name": "신한",
"cash_receipt_tid": "AxMBvpmjnoD4yKeq5bgrp5QbZ7MqQ8GX0lzW6YOQJ1w9NLRZ",
"cash_receipt_type": 1,
"cash_receipt_no": "158190158",
"cash_receipt_url": "https://.../receipts/cash-receipt/..."
}
}2. 별건 발행
결제와 무관하게 현금영수증만 단독으로 발행합니다. 오프라인에서 현금을 직접 받았을 때 씁니다.
요청 파라미터
| 파라미터 | 타입 | 필수 | 설명 |
|---|---|---|---|
pg | String | Y | 현금영수증 발행 PG (이니시스 / 토스 / 페이앱 / 나이스페이먼츠 / 라이트페이) |
order_name | String | Y | 현금영수증 주문명 |
order_id | String | Y | 가맹점 고유 주문번호 |
price | Integer | Y | 발행 금액 |
tax_free | Integer | N | 면세 금액 |
identity_no | String | Y | 발행 식별번호 (휴대폰번호 / 주민번호 / 사업자번호) |
cash_receipt_type | String | N | 소득공제 또는 지출증빙. 생략하거나 빈 값이면 소득공제로 발행됩니다 |
user.username | String | △ | 구매자명. 이니시스·페이앱·나이스페이먼츠는 PG로 전달, 토스는 미사용 |
user.phone | String | △ | 구매자 전화번호. 이니시스·페이앱·나이스페이먼츠는 PG로 전달, 토스는 미사용 |
user.email | String | N | 구매자 이메일. 이니시스·페이앱·나이스페이먼츠는 PG로 전달, 토스는 미사용 |
purchased_at | String | N | 현금을 수령한 시각(ISO8601 등). 생략하면 요청 시각으로 발행됩니다. 파싱에 실패해도 오류 없이 요청 시각으로 대체되니 형식을 직접 검증해서 보냅니다. 페이앱은 이 값을 발행 거래일시로 사용합니다 |
metadata | Object | N | 가맹점 커스텀 데이터. 응답의 metadata로 그대로 돌아옵니다 |
extra | Object | N | 부가 옵션. extra.service_price(봉사료), extra.minimum_price_limit(최소금액 검사 해제) 등 |
currency | String | N | 통화. 생략 시 WON |
user(이름·전화번호·이메일)는 이니시스·페이앱·나이스페이먼츠에서 그대로 PG로 전달됩니다. 서버가 user를 검증하지는 않기 때문에 빠뜨려도 부트페이 단계에서는 오류가 나지 않고, PG 응답 오류(RC_CASH_RECEIPT_FAILED)로 나타납니다. 토스는 user를 사용하지 않습니다.
응답 예시
cash_receipt_data에는 아래 필드가 담깁니다.
| 필드 | 설명 |
|---|---|
tid | 발행 PG 거래 ID |
cash_receipt_type | 1 소득공제 / 2 지출증빙 |
cash_receipt_no | 국세청 조회용 승인번호 |
receipt_url | PG가 제공하는 현금영수증 확인 URL (일부 PG만 제공) |
cancel_tid | 취소 거래 ID 자리. 취소한 뒤에만 나타나고 값이 없으면 키 자체가 빠지는데, 현재 현금영수증 취소 흐름에서는 채워지지 않습니다 |
별건 발행은 receipt_id를 새로 발급받습니다. 현금영수증 취소에 이 receipt_id가 필요하므로 저장해 둡니다.
/v2/request/cash/receiptcurl -X POST "https://api.bootpay.co.kr/v2/request/cash/receipt" \
-H "Authorization: Basic $(printf '%s' 'CLIENT_KEY:SECRET_KEY' | base64)" \
-H "Content-Type: application/json" \
-d '{
"pg": "나이스페이먼츠",
"order_name": "현장 수령 현금결제",
"order_id": "cash_1700000000",
"price": 10000,
"tax_free": 0,
"identity_no": "01012345678",
"cash_receipt_type": "소득공제",
"user": { "username": "홍길동", "phone": "01012345678" }
}'const response = await Bootpay.requestCashReceipt({
pg: '나이스페이먼츠',
order_name: '현장 수령 현금결제',
order_id: 'cash_' + Date.now(),
price: 10000,
tax_free: 0,
identity_no: '01012345678',
cash_receipt_type: '소득공제',
user: {
username: '홍길동',
phone: '01012345678',
email: 'user@example.com',
},
})
console.log(response.receipt_id, response.status) // status 60: 발행완료import time
response = bootpay.request_cash_receipt(
pg='나이스페이먼츠',
order_name='현장 수령 현금결제',
order_id=f'cash_{int(time.time())}',
price=10000,
tax_free=0,
identity_no='01012345678',
cash_receipt_type='소득공제',
user={
'username': '홍길동',
'phone': '01012345678',
'email': 'user@example.com'
}
)
print(response) # status 60: 발행완료$response = BootpayApi::requestCashReceipt([
'pg' => '나이스페이먼츠',
'order_name' => '현장 수령 현금결제',
'order_id' => 'cash_' . time(),
'price' => 10000,
'tax_free' => 0,
'identity_no' => '01012345678',
'cash_receipt_type' => '소득공제',
'user' => [
'username' => '홍길동',
'phone' => '01012345678',
'email' => 'user@example.com',
],
]);
print_r($response);import kr.co.bootpay.pg.model.request.CashReceipt;
import kr.co.bootpay.pg.model.request.User;
CashReceipt cashReceipt = new CashReceipt();
cashReceipt.pg = "나이스페이먼츠";
cashReceipt.orderName = "현장 수령 현금결제";
cashReceipt.orderId = "cash_" + System.currentTimeMillis();
cashReceipt.price = 10000.0; // Double 필드라 10000.0 처럼 씁니다
cashReceipt.taxFree = 0.0;
cashReceipt.identityNo = "01012345678";
cashReceipt.cashReceiptType = "소득공제";
cashReceipt.user = new User();
cashReceipt.user.username = "홍길동";
cashReceipt.user.phone = "01012345678";
cashReceipt.user.email = "user@example.com";
var response = bootpay.requestCashReceipt(cashReceipt);
System.out.println(response.get("receipt_id") + " " + response.get("status")); // status 60: 발행완료# Ruby 헬퍼는 purchased_at 을 필수 인자로 받습니다. nil 이면 요청 시각으로 발행됩니다
response = bootpay.request_cash_receipt(
pg: '나이스페이먼츠',
order_name: '현장 수령 현금결제',
order_id: "cash_#{Time.now.to_i}",
price: 10000,
tax_free: 0,
identity_no: '01012345678',
cash_receipt_type: '소득공제',
purchased_at: nil,
user: {
username: '홍길동',
phone: '01012345678',
email: 'user@example.com'
}
)
puts response.dataresponse, err := api.RequestCashReceipt(bootpay.CashReceiptData{
Pg: "나이스페이먼츠",
OrderName: "현장 수령 현금결제",
OrderId: fmt.Sprintf("cash_%d", time.Now().Unix()),
Price: 10000,
TaxFree: 0,
IdentityNo: "01012345678",
CashReceiptType: "소득공제",
User: bootpay.User{
Username: "홍길동",
Phone: "01012345678",
Email: "user@example.com",
},
})
fmt.Println(response, err)var response = await bootpay.RequestCashReceipt(new CashReceipt
{
pg = "나이스페이먼츠",
orderName = "현장 수령 현금결제",
orderId = $"cash_{DateTimeOffset.UtcNow.ToUnixTimeMilliseconds()}",
price = 10000,
taxFree = 0,
identityNo = "01012345678",
cashReceiptType = "소득공제",
user = new User
{
username = "홍길동",
phone = "01012345678",
email = "user@example.com"
}
});
Console.WriteLine(await response.Content.ReadAsStringAsync());{
"receipt_id": "62f356871fc192036f9f4ae2",
"order_id": "cash_1700000000",
"price": 10000,
"tax_free": 0,
"cancelled_price": 0,
"cancelled_tax_free": 0,
"order_name": "현장 수령 현금결제",
"company_name": "테스트상점",
"gateway_url": "https://api.bootpay.co.kr",
"metadata": {},
"sandbox": false,
"pg": "나이스페이먼츠",
"method": "현금영수증",
"method_symbol": "cash_receipt",
"method_origin": "현금영수증",
"method_origin_symbol": "cash_receipt",
"purchased_at": "2026-04-10T15:56:08+09:00",
"requested_at": "2026-04-10T15:56:02+09:00",
"status_locale": "현금영수증발행완료",
"currency": "KRW",
"status": 60,
"cash_receipt_data": {
"tid": "Ae75jWNka9lpP2YxJ4K87RXb62PYLrRGZwXLObgyB0vMDm1d",
"cash_receipt_type": 1,
"cash_receipt_no": "158190158",
"receipt_url": "https://.../receipts/cash-receipt/..."
}
}에러 코드
오류 코드
| 코드 | 의미 | 대처 방법 |
|---|---|---|
RC_NOT_FOUND | 영수증 정보를 찾지 못했습니다 | receipt_id가 올바른지 확인합니다 |
RC_NOT_CONFIRMED | 결제 완료 상태가 아닙니다 | 결제가 승인(status: 1)된 뒤에 발행합니다 |
RC_CASH_RECEIPT_PUBLISHED (2809) | 이미 현금영수증이 발행된 건입니다 | 결제 건 상태를 먼저 조회합니다 |
RC_CASH_RECEIPT_PUBLISH_UNABLE (2810) | 해당 결제의 PG로는 현금영수증을 발행할 수 없습니다 | 원 결제 PG가 이니시스·페이앱·토스·나이스페이먼츠인지 확인합니다 |
RC_CASH_RECEIPT_NO_NEED_PAY_METHOD (2814) | 현금영수증 발행이 불가능한 결제수단입니다 | 계좌이체·가상계좌 결제 건에만 발행할 수 있습니다. 원 결제 PG가 페이앱이면 카카오머니·네이버포인트 결제 건도 발행할 수 있습니다 |
RC_CASH_RECEIPT_NEED_USERNAME (2812) | 구매자명(username)이 비어 있습니다 | username을 함께 보냅니다 |
RC_CASH_RECEIPT_NEED_IDENTITY_NO (2813) | 식별번호(identity_no)가 비어 있습니다 | identity_no를 함께 보냅니다 |
RC_CASH_RECEIPT_PUBLISH_FAILED (2815) | 현금영수증 발행에 실패했습니다 | identity_no 형식과 PG의 현금영수증 지원 여부를 확인합니다 |
RC_CASH_RECEIPT_FAILED (2802) | 현금영수증 발행에 실패했습니다 | 별건 발행뿐 아니라 결제 건을 기본 채널(pg 생략)로 발행하다 실패한 경우에도 내려옵니다. message는 PG가 내려준 응답 메시지 그대로입니다 |
RC_CASH_PURCHASED_AT_INVALID (2800) | purchased_at 형식이 올바르지 않습니다 | 현재 미사용 — 파싱에 실패해도 이 오류 대신 요청 시각으로 대체 발행됩니다. 원하는 발행 시각이 있다면 형식을 직접 검증해서 보냅니다 |
별건 발행에서 추가로 발생하는 에러
별건 발행은 영수증을 새로 만들기 때문에 결제 요청과 같은 기본 검증을 함께 거칩니다.
오류 코드
| 코드 | 의미 | 대처 방법 |
|---|---|---|
RC_NAME_BLANK (2003) | 상품명을 입력해주세요 | order_name을 채워 보냅니다 |
RC_O_ID_BLANK (2005) | 가맹점에서 식별할 수 있는 order_id 값을 입력해주세요 | order_id를 채워 보냅니다 |
RC_PRICE_LEAST_LT (2004) | 100원보다 큰 금액을 결제할 수 있습니다 | price를 100원 이상으로 보냅니다. 소액을 허용하려면 extra.minimum_price_limit: false를 함께 보냅니다 |
RC_PG_NOT_FOUND (2001) | PG 정보를 찾지 못했습니다 | pg 값이 올바른 PG 이름인지 확인합니다 (HTTP 404) |
PM_NOT_FOUND_OR_UNIT_INVALID (2107) | 결제수단 정보를 찾지 못했습니다 | 지정한 PG에 현금영수증 결제수단이 열려 있는지 확인합니다 (HTTP 404) |
RC_CASH_RECEIPT_METHOD_NOT_FOUND (2803) | 요청한 PG에서는 현금영수증 발행 기능을 지원하지 않습니다 | 이니시스·토스·페이앱·나이스페이먼츠·라이트페이 중에서 고릅니다 (HTTP 404) |
RC_CASH_REQUEST_FAILED (2801) | 현금영수증 신청이 실패하였습니다 | 영수증 생성 단계에서 예기치 못한 오류가 난 경우입니다. message의 실패 사유를 확인합니다 |