인증 정보 조회·검증
백엔드에서 receipt_id로 본인인증 정보를 조회해 완료 여부를 검증하고 필요한 값만 저장합니다. 클라이언트의 done 이벤트가 아니라 서버가 조회한 status 값으로 완료를 판단합니다.
API 정보
인증 헤더는 서버 인증과 같은 Basic Auth(client_key:secret_key) 방식이고, 서버 SDK에 키를 설정하면 자동으로 처리됩니다.
GET
/v2/certificate/{receipt_id}Base URLhttps://api.bootpay.co.kr
인증Basic Auth
조회·검증 코드
import { Bootpay } from '@bootpay/backend-js'
Bootpay.setConfiguration({
client_key: '[ Client Key ]',
secret_key: '[ Secret Key ]'
})
app.post('/auth/certificate', async (req, res) => {
const { receipt_id } = req.body
const certificate = await Bootpay.certificate(receipt_id)
// status 12(본인인증완료)일 때만 인증 완료로 처리한다.
if (certificate.status !== 12) {
return res.status(400).json({ message: '본인인증이 완료되지 않았습니다.' })
}
// 조회 응답값만 저장한다. 클라이언트가 보낸 값은 신뢰하지 않는다.
// unique = CI(기관 공통), di = DI(가맹점별)
const data = certificate.authenticate_data
await saveVerifiedUser({
name: data.name,
birth: data.birth,
ci: data.unique,
di: data.di
})
return res.json({ verified: true })
})from bootpay_backend import BootpayBackend
bootpay = BootpayBackend(
client_key='[ Client Key ]',
secret_key='[ Secret Key ]',
)
@app.route('/auth/certificate', methods=['POST'])
def auth_certificate():
receipt_id = request.get_json().get('receipt_id')
certificate = bootpay.certificate(receipt_id)
# status 12(본인인증완료)일 때만 인증 완료로 처리한다.
if certificate.get('status') != 12:
return jsonify(message='본인인증이 완료되지 않았습니다.'), 400
# 조회 응답값만 저장한다. 클라이언트가 보낸 값은 신뢰하지 않는다.
# unique = CI(기관 공통), di = DI(가맹점별)
data = certificate.get('authenticate_data')
save_verified_user(
name=data.get('name'),
birth=data.get('birth'),
ci=data.get('unique'),
di=data.get('di')
)
return jsonify(verified=True)$receipt_id = json_decode(file_get_contents('php://input'), true)['receipt_id'];
BootpayApi::setClientKeyConfiguration('[ Client Key ]', '[ Secret Key ]');
$certificate = BootpayApi::certificate($receipt_id);
// status 12(본인인증완료)일 때만 인증 완료로 처리한다.
if ($certificate->status !== 12) {
http_response_code(400);
echo json_encode(['message' => '본인인증이 완료되지 않았습니다.']);
exit;
}
// 조회 응답값만 저장한다. 클라이언트가 보낸 값은 신뢰하지 않는다.
// unique = CI(기관 공통), di = DI(가맹점별)
$data = $certificate->authenticate_data;
saveVerifiedUser($data->name, $data->birth, $data->unique, $data->di);
echo json_encode(['verified' => true]);@PostMapping("/auth/certificate")
public ResponseEntity<?> authCertificate(@RequestBody Map<String, String> body) throws Exception {
String receiptId = body.get("receipt_id");
Bootpay bootpay = Bootpay.withClientKey("[ Client Key ]", "[ Secret Key ]");
HashMap<String, Object> certificate = bootpay.certificate(receiptId);
// status 12(본인인증완료)일 때만 인증 완료로 처리한다.
int status = ((Number) certificate.get("status")).intValue();
if (status != 12) {
return ResponseEntity.badRequest().body(Map.of("message", "본인인증이 완료되지 않았습니다."));
}
// 조회 응답값만 저장한다. 클라이언트가 보낸 값은 신뢰하지 않는다.
// unique = CI(기관 공통), di = DI(가맹점별)
@SuppressWarnings("unchecked")
Map<String, Object> data = (Map<String, Object>) certificate.get("authenticate_data");
saveVerifiedUser(data.get("name"), data.get("birth"), data.get("unique"), data.get("di"));
return ResponseEntity.ok(Map.of("verified", true));
}post '/auth/certificate' do
receipt_id = JSON.parse(request.body.read)['receipt_id']
bootpay = Bootpay::RestClient.new(client_key: '[ Client Key ]', secret_key: '[ Secret Key ]')
certificate = bootpay.certificate(receipt_id).data
# status 12(본인인증완료)일 때만 인증 완료로 처리한다. 응답 키는 심볼이다.
if certificate[:status] != 12
halt 400, { message: '본인인증이 완료되지 않았습니다.' }.to_json
end
# 조회 응답값만 저장한다. 클라이언트가 보낸 값은 신뢰하지 않는다.
# unique = CI(기관 공통), di = DI(가맹점별)
data = certificate[:authenticate_data]
save_verified_user(name: data[:name], birth: data[:birth], ci: data[:unique], di: data[:di])
{ verified: true }.to_json
endfunc authCertificate(w http.ResponseWriter, r *http.Request) {
var body map[string]string
json.NewDecoder(r.Body).Decode(&body)
receiptId := body["receipt_id"]
api := bootpay.NewAPIWithClientKey("[ Client Key ]", "[ Secret Key ]", nil, "")
certificate, err := api.Certificate(receiptId)
if err != nil {
http.Error(w, "인증 정보를 조회하지 못했습니다.", http.StatusBadRequest)
return
}
// status 12(본인인증완료)일 때만 인증 완료로 처리한다.
// 조회 실패 응답(error_code)에는 status 가 없으므로 comma-ok 로 읽는다.
status, _ := certificate["status"].(float64)
if int(status) != 12 {
http.Error(w, "본인인증이 완료되지 않았습니다.", http.StatusBadRequest)
return
}
// 조회 응답값만 저장한다. 클라이언트가 보낸 값은 신뢰하지 않는다.
// unique = CI(기관 공통), di = DI(가맹점별)
data := certificate["authenticate_data"].(map[string]interface{})
saveVerifiedUser(data["name"], data["birth"], data["unique"], data["di"])
json.NewEncoder(w).Encode(map[string]bool{"verified": true})
}[HttpPost("/auth/certificate")]
public async Task<IActionResult> AuthCertificate([FromBody] Dictionary<string, string> body)
{
var receiptId = body["receipt_id"];
var bootpay = BootpayApi.WithClientKey("[ Client Key ]", "[ Secret Key ]");
var response = await bootpay.Certificate(receiptId);
var certificate = JsonConvert.DeserializeObject<Dictionary<string, object>>(
await response.Content.ReadAsStringAsync()
);
// status 12(본인인증완료)일 때만 인증 완료로 처리한다.
if (Convert.ToInt32(certificate["status"]) != 12)
{
return BadRequest(new { Message = "본인인증이 완료되지 않았습니다." });
}
// 조회 응답값만 저장한다. 클라이언트가 보낸 값은 신뢰하지 않는다.
// unique = CI(기관 공통), di = DI(가맹점별)
var data = (JObject)certificate["authenticate_data"];
SaveVerifiedUser(data["name"], data["birth"], data["unique"], data["di"]);
return Ok(new { Verified = true });
}응답
JSON
{
"receipt_id": "6244f60c1fc19202e42e8c4e",
"authentication_id": "auth_1718000000000",
"gateway_url": "https://gw.bootpay.co.kr",
"metadata": {},
"pg": "다날",
"method": "인증",
"method_symbol": "auth",
"method_origin": "인증",
"method_origin_symbol": "auth",
"status": 12,
"status_locale": "본인인증완료",
"requested_at": "2026-06-11T09:30:01+09:00",
"authenticated_at": "2026-06-11T09:30:29+09:00",
"authenticate_data": {
"name": "홍길동",
"phone": "01012345678",
"birth": "19900101",
"gender": 1,
"foreigner": "0",
"carrier": "SKT",
"unique": "[ CI 값 ]",
"di": "[ DI 값 ]",
"tid": "danal_tid_..."
}
}응답 필드
| 필드 | 타입 | 필수 | 설명 |
|---|---|---|---|
| receipt_id | String | Y | 부트페이 인증 거래 ID |
| authentication_id | String | Y | 요청 시 보낸 가맹점 고유 인증번호 |
| gateway_url | String | Y | 인증을 처리한 게이트웨이 URL |
| metadata | Object | N | 요청 시 보낸 커스텀 데이터. 없으면 {} |
| pg | String | Y | 인증을 처리한 PG |
| method | String | Y | 인증 수단. 본인인증 건은 인증 |
| method_symbol | String | N | 인증 수단 코드. 본인인증 건은 auth |
| method_origin | String | N | PG가 내려준 원본 수단명. 본인인증 건은 인증 |
| method_origin_symbol | String | N | 원본 수단 코드. 본인인증 건은 auth |
| status | Integer | Y | 인증 상태. 12(본인인증완료)일 때만 완료로 처리합니다 |
| status_locale | String | N | 상태의 한글 표기. 한글 라벨이 없는 상태(50·51·-50·-12)에서는 키 자체가 빠집니다 |
| requested_at | Datetime | Y | 인증 요청 시각 |
| authenticated_at | Datetime | N | 인증 완료 시각. 미완료 건은 비어 있습니다 |
| cancelled_at | Datetime | N | 취소 시각. 값이 없으면 키가 빠집니다 |
| authenticate_data | Object | Y | 인증된 사용자 정보 |
| ∟ name | String | N | 이름 |
| ∟ phone | String | N | 휴대폰 번호 |
| ∟ birth | String | N | 생년월일. PG 원본 형식 그대로 전달됩니다 (예: 다날 19900101) |
| ∟ gender | Integer | N | 성별 (1: 남자, 0: 여자) |
| ∟ foreigner | - | N | 내·외국인 구분값. PG마다 타입이 다릅니다 (다날은 원본 문자열 "0"/"1", KCP는 Integer 0/1) |
| ∟ carrier | String | N | 통신사 (예: SKT). 다날은 phone · foreigner · carrier 를 추가 제공을 신청해야 줍니다 |
| ∟ unique | String | N | CI(연계정보). 기관 공통 식별값이라 어느 가맹점에서 인증해도 같은 값입니다 |
| ∟ di | String | N | DI(중복가입 확인정보). 가맹점별 식별값이라 중복 가입 방지에 사용합니다 |
| ∟ tid | String | Y | PG 거래 ID |
status 값
| status | 의미 | 설명 |
|---|---|---|
50 | 본인인증준비 | 인증 요청이 막 생성된 내부 초기 상태 |
51 | 본인인증승인전 | SMS/PASS 발송 완료, OTP 검증(승인) 대기 상태 |
12 | 본인인증완료 | 인증이 완료되어 authenticate_data를 받을 수 있는 상태 |
-50 | 본인인증실패 | 인증 요청·발송 단계에서 실패한 상태 |
-12 | 본인인증승인오류 | OTP 승인 단계에서 실패한 상태 |
본인인증 흐름에서는 12 외의 값을 모두 미완료로 처리합니다. 상태 사이의 흐름은 가이드 본인인증 › 인증 상태에 있습니다.
인증 정보 저장 설계
30분 안에 저장해야 합니다
조회 API는 승인 완료 시각(authenticated_at)부터 30분이 지나면 AUTH_EXPIRED로 차단됩니다. 그래서 "나중에 필요하면 receipt_id로 다시 조회한다"는 설계는 동작하지 않습니다. 인증 직후 조회해서 필요한 값만 내 DB에 저장합니다.
30분이 지난 뒤 조회하면 AUTH_EXPIRED 에러가 반환되고, 사용자는 처음부터 다시 인증해야 합니다.
중복 가입은 DI로 판단합니다
authenticate_data의 unique는 CI(기관 공통), di는 DI(가맹점별)입니다. 둘이 어떻게 다른지는 가이드 본인인증 › CI와 DI에 있습니다. 회원 테이블에 DI를 저장해 두고, 신규 가입 시 같은 DI가 이미 있으면 중복 가입으로 처리합니다. CI·DI 모두 개인 식별정보라 평문 노출을 피하고 암호화 저장하며, 조회용으로만 쓰도록 접근을 제한합니다.
JavaScript
// 중복 가입 방지 예시
const certificate = await Bootpay.certificate(receipt_id)
if (certificate.status !== 12) throw new Error('본인인증 미완료')
const { unique: ci, di, name, birth } = certificate.authenticate_data
const existing = await User.findByDi(di) // 중복 가입 판단은 DI로
if (existing) {
// 이미 가입된 사람 — 아이디 찾기·계정 통합 안내로 유도한다.
return { duplicated: true, maskedEmail: mask(existing.email) }
}
await User.create({ ci, di, name, birth })저장은 최소한으로
에러 코드
오류 코드
| 코드 | 상황 | 처리 |
|---|---|---|
AUTH_NOT_FOUND (2407) | 인증 정보를 찾지 못했습니다 | receipt_id가 올바른지 확인합니다 |
AUTH_NOT_CONFIRMED (2408) | 아직 승인(status: 12)되지 않은 건입니다 | 사용자 인증 완료 후 다시 조회합니다 |
AUTH_EXPIRED (2409) | 승인 완료 후 30분이 지나 조회할 수 없습니다 | 인증을 처음부터 다시 요청합니다 |
RC_NOT_AUTH (2064) | 본인인증 건이 아닙니다 (결제·정기결제 영수증) | 본인인증으로 발급된 receipt_id인지 확인합니다 |
API_ONLY_SELLER (600) | 판매점 계정만 호출할 수 있습니다 | 연동키가 판매점 프로젝트의 것인지 확인합니다 |
APP_KEY_CHAIN_SESSION_INVALID (1225) | 연동키 세션이 해당 인증 건과 맞지 않습니다 | 인증을 요청할 때 쓴 것과 같은 프로젝트 연동키로 조회합니다 |
전체 목록은 에러 코드표에서 확인합니다.