빌링키 결제 요청
발급받은 빌링키로 서버에서 현재 시점의 결제를 요청합니다(POST /v2/subscribe/payment).
미래 특정 시점에 한 번 실행할 결제는 같은 빌링키를 사용하더라도 예약결제의 예약 API(reserve_execute_at)로 등록합니다. 청구 대상과 호출 시점은 가맹점 스케줄러가 정합니다.
이 API는 호출 즉시 1회 결제만 시도하고 자동 재시도를 하지 않습니다. 잔액 부족·한도 초과 등으로 실패하면 재청구 큐와 고객 안내는 가맹점이 직접 구현합니다.
결제 요청 흐름
API 엔드포인트
POST
/v2/subscribe/paymentBase URLhttps://api.bootpay.co.kr
인증Basic Auth
결제 요청과 예약결제 구분
| 목적 | API | 실행 시각 파라미터 |
|---|---|---|
| 지금 결제 요청 | POST /v2/subscribe/payment | 없음 |
| 미래 1회 결제 예약 | POST /v2/subscribe/payment/reserve | reserve_execute_at |
execute_at은 이 문서의 결제 요청 API에 넣는 공식 요청 파라미터가 아닙니다. 예약 실행 시각은 예약 API의 reserve_execute_at으로 전달해야 합니다. 일부 SDK 내부 모델이나 응답 필드에서 execute_at이라는 이름이 보이더라도, 연동할 때는 어느 엔드포인트를 호출하는지를 기준으로 구분합니다.
요청 파라미터
요청 파라미터
| 파라미터 | 타입 | 필수 | 설명 |
|---|---|---|---|
| billing_key | String | Y | 부트페이에서 발급한 빌링키 |
| wallet_key | String | N | 우선순위 빌링키 결제에 사용하는 지갑 키. 지정하면 billing_key 대신 이 값으로 빌링키를 찾습니다 |
| price | Number | Y | 결제 금액. KRW는 100원 이상, USD는 0.01 이상이어야 합니다 |
| order_name | String | Y | 상품명, 주문명 (미입력 시 RC_NAME_BLANK 2003) |
| order_id | String | Y | 가맹점 고유 주문번호 (미입력 시 RC_O_ID_BLANK 2005) |
| tax_free | Number | N | 비과세 금액 (price 이하) |
| metadata | Object | N | 커스텀 데이터 (결제 완료/취소 시 반환) |
| user | Object | N | 구매자 정보 (페이앱: 전화번호 필수) |
| items | Array | N | 상품 정보 (페이코: 필수) |
| extra | Object | N | 추가 옵션. 할부 관련 값은 대부분 이 객체 안에서 읽습니다 |
| card_quota | String | N | 카드 할부 개월 수 (00, 02, 03 등). 아래 주의사항을 참고합니다 |
| card_interest | String | N | 무이자 할부 여부 (일부 PG만 지원). 아래 주의사항을 참고합니다 |
| feedback_url | String | N | 웹훅 수신 URL (미입력 시 관리자 설정값) |
| content_type | String | N | 웹훅 데이터 타입 (application/json 또는 application/x-www-form-urlencoded) |
코드 예제
import { Bootpay } from '@bootpay/backend-js'
Bootpay.setConfiguration({
client_key: '[ Client Key ]',
secret_key: '[ Secret Key ]'
})
try {
const response = await Bootpay.requestSubscribePayment({
billing_key: '[ billing_key ]',
order_name: '월 정기결제 - 2025년 1월',
order_id: 'monthly_' + Date.now(),
price: 9900,
tax_free: 0
})
console.log(response)
} catch (e) {
console.log(e)
}from bootpay_backend import BootpayBackend
import time
bootpay = BootpayBackend(client_key='CLIENT_KEY', secret_key='SECRET_KEY')
response = bootpay.request_subscribe_payment(
billing_key='[ billing_key ]',
order_name='월 정기결제 - 2025년 1월',
order_id=f'monthly_{int(time.time())}',
price=9900,
tax_free=0
)
print(response)use Bootpay\ServerPhp\BootpayApi;
BootpayApi::setClientKeyConfiguration('CLIENT_KEY', 'SECRET_KEY');
$response = BootpayApi::requestSubscribePayment([
'billing_key' => '[ billing_key ]',
'order_name' => '월 정기결제 - 2025년 1월',
'order_id' => 'monthly_' . time(),
'price' => 9900,
'tax_free' => 0,
]);
print_r($response);import kr.co.bootpay.pg.Bootpay;
import kr.co.bootpay.pg.model.request.SubscribePayload;
Bootpay bootpay = Bootpay.withClientKey("CLIENT_KEY", "SECRET_KEY");
SubscribePayload payload = new SubscribePayload();
payload.billingKey = "[ billing_key ]";
payload.orderName = "월 정기결제 - 2025년 1월";
payload.orderId = "monthly_" + System.currentTimeMillis();
payload.price = 9900.0; // Double 필드라 9900 처럼 정수로 쓰면 컴파일되지 않습니다
payload.taxFree = 0.0;
var response = bootpay.requestSubscribe(payload);
System.out.println(response);bootpay = Bootpay::RestClient.new(client_key: 'CLIENT_KEY', secret_key: 'SECRET_KEY')
response = bootpay.request_subscribe_payment(
billing_key: '[ billing_key ]',
order_name: '월 정기결제 - 2025년 1월',
order_id: "monthly_#{Time.now.to_i}",
price: 9900,
tax_free: 0
)
puts response.dataimport "github.com/bootpay/backend-go/v2"
api := bootpay.NewAPIWithClientKey("CLIENT_KEY", "SECRET_KEY", nil, "")
response, err := api.RequestSubscribe(bootpay.SubscribePayload{
BillingKey: "[ billing_key ]",
OrderName: "월 정기결제 - 2025년 1월",
OrderId: fmt.Sprintf("monthly_%d", time.Now().Unix()),
Price: 9900,
TaxFree: 0,
})
fmt.Println(response, err)using Bootpay;
using Bootpay.models;
var bootpay = BootpayApi.WithClientKey("CLIENT_KEY", "SECRET_KEY");
var response = await bootpay.RequestSubscribe(new SubscribePayload
{
billingKey = "[ billing_key ]",
orderName = "월 정기결제 - 2025년 1월",
orderId = $"monthly_{DateTimeOffset.UtcNow.ToUnixTimeMilliseconds()}",
price = 9900,
taxFree = 0
});
Console.WriteLine(await response.Content.ReadAsStringAsync());응답
빌링키 결제 요청 응답도 결제 상태에 따라 나눠서 처리합니다. 성공 응답의 receipt_id는 이후 결제 조회·취소·웹훅 멱등 처리의 기준입니다.
{
"receipt_id": "6261104e1fc19202e6f9420e",
"order_id": "monthly_1705289520000",
"price": 9900,
"tax_free": 0,
"cancelled_price": 0,
"cancelled_tax_free": 0,
"order_name": "월 정기결제 - 2025년 1월",
"company_name": "부트페이 주식회사",
"metadata": {
"user_id": "1234"
},
"pg": "나이스페이먼츠",
"method": "카드",
"method_symbol": "card",
"method_origin": "카드자동",
"method_origin_symbol": "card_rebill",
"currency": "KRW",
"requested_at": "2025-01-15T14:31:58+09:00",
"purchased_at": "2025-01-15T14:32:00+09:00",
"receipt_url": "https://npg.nicepay.co.kr/issue/...",
"status_locale": "결제완료",
"status": 1
}{
"receipt_id": "6261104e1fc19202e6f9420e",
"order_id": "monthly_1705289520000",
"price": 9900,
"tax_free": 0,
"order_name": "월 정기결제 - 2025년 1월",
"pg": "나이스페이먼츠",
"method": "계좌이체",
"method_symbol": "bank",
"method_origin": "계좌자동이체",
"method_origin_symbol": "automatic_transfer_rest",
"currency": "KRW",
"requested_at": "2025-01-15T14:31:58+09:00",
"purchased_at": "2025-01-15T14:32:00+09:00",
"status_locale": "결제완료",
"status": 1
}{
"error_code": "RC_CONFIRM_FAILED",
"pg_error_code": "F113",
"message": "한도초과 또는 잔액부족으로 결제가 거절되었습니다.",
"payload": {
"ResultCode": "F113",
"ResultMsg": "한도초과 또는 잔액부족"
}
}에러 코드
오류 코드
| 코드 | 메시지 | 대처 방법 |
|---|---|---|
SUBSCRIBE_BK_NOT_FOUND (2309) | 빌링키 발급 내역을 찾지 못했습니다 | billing_key가 올바른지 확인합니다 |
SUBSCRIBE_BK_EXPIRED (2310) | 빌링키 유효기간 만료 | 빌링키를 새로 발급받습니다 |
RC_NAME_BLANK (2003) | 상품명을 입력합니다 | order_name 값을 입력합니다 |
RC_O_ID_BLANK (2005) | order_id 값을 입력합니다 | order_id를 유니크한 값으로 입력합니다 |
RC_PRICE_LEAST_LT (2004) | 100원보다 큰 금액을 결제할 수 있습니다 | KRW는 price를 100원 이상, USD는 0.01 이상으로 설정합니다 |
RC_PROVIDER_NOT_ALLOW (2104) | 가맹점이 탈퇴/차단 상태 | 부트페이 관리자에서 가맹점 상태를 확인합니다 |
RC_PROVIDER_PAYMENT_NOT_ALLOW (2102) | 서비스 이용료 미납으로 결제 불가 | 부트페이 서비스 이용료를 납부합니다 |
RC_NOT_CONFIRM_READY (2023) | 결제 승인 대기 상태가 아니다 | 결제 상태를 확인 후 재시도합니다 |
RC_CONFIRM_METHOD_NOT_FOUND (2025) | 결제 승인 함수가 구현되지 않은 PG입니다 | PG사에 문의합니다 |
RC_CONFIRM_FAILED (2026) | PG사가 결제 승인을 거절했습니다 | 한도초과·잔액부족·카드 정지 등 실제 승인 거절이 이 코드로 내려옵니다. pg_error_code와 message로 사유를 확인하고 고객에게 안내합니다 |
RC_CONFIRM_CRITICAL_FAILED (2085) | 서버에서 치명적인 오류 발생 | 부트페이 관리자에 문의합니다 |
RC_REQUEST_FAILED (2013) | 결제 요청 처리 중 예상치 못한 예외가 발생했습니다 | 승인 거절이 아니라 요청 단계의 예외 fallback입니다. 요청 파라미터를 확인 후 재시도합니다 |