현금영수증 취소
발행한 현금영수증을 취소합니다. 결제 건에 발행한 영수증과 별건 발행한 영수증은 취소 엔드포인트가 다릅니다. 발행 시 사용한 방식에 맞춰 호출합니다.
모두 서버에서 Basic Auth로 호출합니다.
| 발행 방식 | 취소 엔드포인트 |
|---|---|
결제 건에 발행 (/request/receipt/cash/publish) | DELETE /v2/request/receipt/cash/cancel/{receipt_id} |
별건 발행 (/request/cash/receipt) | DELETE /v2/request/cash/receipt/{receipt_id} |
1. 결제 건 발행분 취소
결제 건에 발행한 현금영수증을 취소합니다. 취소 대상은 결제의 receipt_id입니다.
요청 파라미터
| 파라미터 | 위치 | 필수 | 설명 |
|---|---|---|---|
receipt_id | Path | Y | 현금영수증을 발행했던 결제의 영수증 ID |
DELETE
/v2/request/receipt/cash/cancel/{receipt_id}Base URLhttps://api.bootpay.co.kr
인증Basic Auth
curl -X DELETE "https://api.bootpay.co.kr/v2/request/receipt/cash/cancel/RECEIPT_ID" \
-H "Authorization: Basic $(printf '%s' 'CLIENT_KEY:SECRET_KEY' | base64)"import { Bootpay } from '@bootpay/backend-js'
Bootpay.setConfiguration({
client_key: process.env.BOOTPAY_CLIENT_KEY,
secret_key: process.env.BOOTPAY_SECRET_KEY,
})
await Bootpay.cashReceiptCancelOnReceipt({
receipt_id: '[ receipt_id ]',
})
// 성공 시 HTTP 200, 본문은 JSON 리터럴 null 입니다.from bootpay_backend import BootpayBackend
bootpay = BootpayBackend(client_key='CLIENT_KEY', secret_key='SECRET_KEY')
response = bootpay.cash_receipt_cancel_on_receipt(receipt_id='[ receipt_id ]')
print(response)use Bootpay\ServerPhp\BootpayApi;
BootpayApi::setClientKeyConfiguration('CLIENT_KEY', 'SECRET_KEY');
$response = BootpayApi::cashReceiptCancelOnReceipt('[ receipt_id ]');
print_r($response);import kr.co.bootpay.pg.Bootpay;
import kr.co.bootpay.pg.model.request.Cancel;
Bootpay bootpay = Bootpay.withClientKey("CLIENT_KEY", "SECRET_KEY");
Cancel cancel = new Cancel();
cancel.receiptId = "[ receipt_id ]";
var response = bootpay.requestCashReceiptCancelByBootpay(cancel);
System.out.println(response);bootpay = Bootpay::RestClient.new(client_key: 'CLIENT_KEY', secret_key: 'SECRET_KEY')
# Ruby 헬퍼는 cancel_username · cancel_message 를 필수 인자로 받지만 서버는 이 값을 쓰지 않습니다
response = bootpay.cash_receipt_cancel_on_receipt(
receipt_id: '[ receipt_id ]',
cancel_username: '홍길동',
cancel_message: '현금영수증 취소'
)
puts response.dataimport "github.com/bootpay/backend-go/v2"
api := bootpay.NewAPIWithClientKey("CLIENT_KEY", "SECRET_KEY", nil, "")
response, err := api.RequestCashReceiptCancelByBootpay(bootpay.CancelData{
ReceiptId: "[ receipt_id ]",
})
fmt.Println(response, err)using Bootpay;
using Bootpay.models;
var bootpay = BootpayApi.WithClientKey("CLIENT_KEY", "SECRET_KEY");
var response = await bootpay.RequestCashReceiptCancelByBootpay(new Cancel
{
receiptId = "[ receipt_id ]"
});
Console.WriteLine(await response.Content.ReadAsStringAsync());2. 별건 발행분 취소
별건 발행한 현금영수증을 취소합니다. 취소 대상은 별건 발행 응답에서 받은 receipt_id입니다.
요청 파라미터
| 파라미터 | 위치 | 필수 | 설명 |
|---|---|---|---|
receipt_id | Path | Y | 별건 발행 시 받은 현금영수증 영수증 ID |
cancel_username | Body | N | 취소자명 |
cancel_message | Body | N | 취소 사유 |
응답 예시
DELETE
/v2/request/cash/receipt/{receipt_id}Base URLhttps://api.bootpay.co.kr
인증Basic Auth
curl -X DELETE "https://api.bootpay.co.kr/v2/request/cash/receipt/RECEIPT_ID" \
-H "Authorization: Basic $(printf '%s' 'CLIENT_KEY:SECRET_KEY' | base64)" \
-H "Content-Type: application/json" \
-d '{ "cancel_username": "홍길동", "cancel_message": "오발행 취소" }'const response = await Bootpay.cancelCashReceipt({
receipt_id: '[ receipt_id ]',
cancel_username: '홍길동',
cancel_message: '오발행 취소',
})
console.log(response.status) // status 61: 발행취소response = bootpay.cancel_cash_receipt(
receipt_id='[ receipt_id ]',
cancel_username='홍길동',
cancel_message='오발행 취소'
)
print(response) # status 61: 발행취소$response = BootpayApi::cancelCashReceipt('[ receipt_id ]', [
'cancel_username' => '홍길동',
'cancel_message' => '오발행 취소',
]);
print_r($response);Cancel cancel = new Cancel();
cancel.receiptId = "[ receipt_id ]";
cancel.cancelUsername = "홍길동";
cancel.cancelMessage = "오발행 취소";
var response = bootpay.requestCashReceiptCancel(cancel);
System.out.println(response.get("status")); // 61: 발행취소response = bootpay.cancel_cash_receipt(
receipt_id: '[ receipt_id ]',
cancel_username: '홍길동',
cancel_message: '오발행 취소'
)
puts response.dataresponse, err := api.RequestCashReceiptCancel(bootpay.CancelData{
ReceiptId: "[ receipt_id ]",
CancelUsername: "홍길동",
CancelMessage: "오발행 취소",
})
fmt.Println(response, err)var response = await bootpay.RequestCashReceiptCancel(new Cancel
{
receiptId = "[ receipt_id ]",
cancelUsername = "홍길동",
cancelMessage = "오발행 취소"
});
Console.WriteLine(await response.Content.ReadAsStringAsync());JSON
{
"receipt_id": "62f356871fc192036f9f4ae2",
"order_id": "cash_1700000000",
"price": 10000,
"tax_free": 0,
"cancelled_price": 10000,
"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",
"cancelled_at": "2026-04-10T17:27:20+09:00",
"requested_at": "2026-04-10T15:56:02+09:00",
"status_locale": "현금영수증발행취소",
"currency": "KRW",
"status": 61,
"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_CASH_RECEIPT_CANCEL_NOT_ABLE (2816) | 별건으로 현금영수증 발행이 된 결제가 아닙니다 — 실제로는 "이 결제 건에 현금영수증이 발행되어 있지 않다"는 뜻입니다 (결제 건 발행분 취소) | 발행 여부를 먼저 조회합니다 |
RC_NOT_CASH_RECEIPT (2805) | 별건 현금영수증이 아닙니다 (별건 발행분 취소) | 결제 건 발행분은 /request/receipt/cash/cancel/{receipt_id}로 취소합니다 |
RC_CASH_RECEIPT_ALREADY_CANCELLED (2804) | 이미 취소된 현금영수증입니다 | 상태(status: 61)를 먼저 조회합니다 |
RC_CASH_RECEIPT_NOT_SUCCESS (2806) | 발행 완료 상태(status: 60)가 아닙니다 | 발행 결과를 먼저 확인합니다 |
RC_CASH_RECEIPT_CANCEL_FAILED (2047) | 현금영수증 취소에 실패했습니다 | PG가 취소 실패로 응답했거나 취소 처리 중 예외가 난 경우입니다. pg_error_code와 message로 PG 응답을 확인합니다. 발행 방식과 취소 엔드포인트가 어긋난 경우는 2805·2816으로 따로 내려옵니다 |
RC_CASH_RECEIPT_CANCEL_ERROR (2807) | 취소 처리 중 서버 오류가 발생했습니다 | message를 확인하고 재시도합니다 |