Document API

Prev Next

업로드한 이미지를 인식하여 인식 결과를 텍스트로 응답합니다. 인식 결과는 Verify API 호출 시 입력으로 사용할 수 있습니다.

요청

요청 형식을 설명합니다. 요청 형식은 다음과 같습니다.

메서드 URI
POST /document

요청 헤더

CLOVA eKYC API에서 공통으로 사용하는 헤더에 대한 정보는 CLOVA eKYC 요청 헤더를 참조해 주십시오.

요청 바디

요청 바디에 대한 설명은 다음과 같습니다.

Content-Type: application/json인 경우

Base64로 인코딩된 이미지를 전송할 때 사용합니다.

필드 타입 필수 여부 설명
requestId String Required 사용자가 지정한 요청 ID (10분간 재사용 불가)
timestamp Integer Required 요청 시간 (Unix Timestamp, 밀리초)
images Array Required 이미지 상세 정보: images
  • 1개의 이미지만 허용 (한국어)

images

images에 대한 설명은 다음과 같습니다.

필드 타입 필수 여부 설명
name String Required 이미지명
  • 이미지 식별 및 응답 결과 확인 시 사용
format String Required 이미지 형식
  • 이미지: jpg | jpeg | png
  • 페이지: pdf | tiff
    • 단일 페이지만 지원
data String Required Base64로 인코딩된 이미지 바이트

Content-Type: multipart/form-data인 경우

이미지 파일을 직접 업로드할 때 사용합니다.

필드 타입 필수 여부 설명
message Object Required 요청 데이터 정보
message.requestId String Required 사용자가 지정한 요청 ID (10분간 재사용 불가)
message.timestamp Integer Required 요청 시간 (Unix Timestamp, 밀리초)
message.images Array Required 이미지 상세 정보: message.images
  • 1개의 이미지만 허용 (한국어)
file File Required 이미지 파일

message.images

message.images에 대한 설명은 다음과 같습니다.

필드 타입 필수 여부 설명
name String Required 이미지명
  • 이미지 식별 및 응답 결과 확인 시 사용
format String Required 이미지 형식
  • 이미지: jpg | jpeg | png
  • 페이지: pdf | tiff
    • 단일 페이지만 지원

요청 예시

요청 예시는 다음과 같습니다.

Content-Type: application/json인 경우

요청 헤더 Content-Typeapplication/json인 경우, 요청 예시는 다음과 같습니다.

사업자등록증

curl --location --request POST 'https://{apigwId}.apigw-pub.fin-ntruss.com/ekyc/v1/{domainId}/{signature}/biz-license/document' \
--header 'X-EKYC-SECRET: {secret-key}' \
--header 'Content-Type: application/json' \
--data '{
  "requestId": "request-001",
  "timestamp": 1700000000000,
  "images": [
    {
      "name": "business-license",
      "format": "jpg",      
      "data": "{base64-encoded-image}"
    }
  ]
}'

신분증

curl --location --request POST 'https://{apigwId}.apigw-pub.fin-ntruss.com/ekyc/v1/{domainId}/{signature}/id-card/document' \
--header 'X-EKYC-SECRET: {secret-key}' \
--header 'Content-Type: application/json' \
--data '{
  "requestId": "request-002",
  "timestamp": 1700000000000,
  "images": [
    {
      "name": "identification-card",
      "format": "png",      
      "data": "{base64-encoded-image}"
    }
  ]
}'

Content-Type: multipart/form-data인 경우

요청 헤더 Content-Typemultipart/form-data인 경우, 요청 예시는 다음과 같습니다.

사업자등록증

curl --location --request POST 'https://{apigwId}.apigw-pub.fin-ntruss.com/ekyc/v1/{domainId}/{signature}/biz-license/document' \
--header 'X-EKYC-SECRET: {secret-key}' \
--header 'Content-Type: multipart/form-data' \
--form 'message={"requestId": "request-001", "timestamp": 1700000000000, "images": [{"name": "business-license", "format": "jpg"}]}' \
--form 'file=@"{image-file-path}"'

신분증

curl --location --request POST 'https://{apigwId}.apigw-pub.fin-ntruss.com/ekyc/v1/{domainId}/{signature}/id-card/document' \
--header 'X-EKYC-SECRET: {secret-key}' \
--header 'Content-Type: multipart/form-data' \
--form 'message={"requestId": "request-002", "timestamp": 1700000000000, "images": [{"name": "identification-card", "format": "png"}]}' \
--form 'file=@"{image-file-path}"'

응답

응답 형식을 설명합니다.

응답 바디

응답 바디에 대한 설명은 다음과 같습니다.

필드 타입 필수 여부 설명
requestId String - 사용자가 지정한 요청 ID
timestamp Integer - 응답 시간 (Unix Timestamp, 밀리초)
uid String - 시스템에서 생성한 고유 ID
images Array - 이미지 처리 결과: images

images

images에 대한 설명은 다음과 같습니다.

필드 타입 필수 여부 설명
uid String - 이미지 인식 결과 ID
name String - 이미지명
inferResult String - 인식 결과
  • SUCCESS | FAILURE | ERROR
    • SUCCESS: 인식 성공
    • FAILURE: 인식 실패
    • ERROR: 인식 오류
message String - 인식 결과 메시지
  • 성공할 경우, SUCCESS
  • 실패할 경우, 원인 노출
bizLicense Object - 사업자등록증 인식 결과: bizLicense
  • 도메인 유형이 사업자등록증인 경우 반환
idCard Object - 신분증 인식 결과: idCard
  • 도메인 유형이 신분증인 경우 반환
face Object - 얼굴 인식 결과: face
  • 도메인 유형이 신분증이고, 얼굴 사진 검출 옵션을 활성화한 경우 반환
inferDetailType String - Verify API 사용 시 전달할 인식(검증) 상세 유형
  • IC | DL | PP | AC | BL_CORP | BL_SOLE | BL_CERT_CORP | BL_CERT_SOLE
    • IC: 주민등록증
    • DL: 운전면허증
    • PP: 여권
    • AC: 외국인등록증
    • BL_CORP: 법인 사업자등록증
    • BL_SOLE: 개인 사업자등록증
    • BL_CERT_CORP: 법인 사업자등록증명
    • BL_CERT_SOLE: 개인 사업자등록증명
inferDetailResource String - Verify API 리소스(URI)
  • ic | dl | pp | ac | bl-corp | bl-sole | bl-cert-corp | bl-cert-sole
    • ic: 주민등록증
    • dl: 운전면허증
    • pp: 여권
    • ac: 외국인등록증
    • bl-corp: 법인 사업자등록증
    • bl-sole: 개인 사업자등록증
    • bl-cert-corp: 법인 사업자등록증명
    • bl-cert-sole: 개인 사업자등록증명
isGrayScale Boolean - 이미지 흑백 여부
  • true | false
    • true: 흑백
    • false: 컬러
  • 도메인 유형이 신분증인 경우 반환
  • 처리 중 오류가 발생한 경우 생략
참고

신분증 중 외국인등록증 진위 인증에 필요한 11자리 일련번호(0-000-000-0000)는 외국인등록증 후면에 위치하며, 직접 입력해야 합니다.

bizLicense

bizLicense에 대한 설명은 다음과 같습니다.

필드 타입 필수 여부 설명
meta Object - 메타 정보
meta.estimatedLanguage String - OCR 엔진에서 인식한 언어
  • ko | en | ja
    • ko: 한국어
    • en: 영어
    • ja: 일본어
result Object - 인식 결과
result.bisAddress TextBlock[] - 사업장 소재지
result.bisArea TextBlock[] - 사업장 면적
result.bisItem TextBlock[] - 종목
result.registerNumber TextBlock[] - 사업자등록번호
result.bisType TextBlock[] - 업태
result.companyName TextBlock[] - 상호
result.coRepName TextBlock[] - 공동 사업자명
result.corpName TextBlock[] - 법인명 (단체명)
result.corpRegisterNum TextBlock[] - 법인등록번호
result.coRepSocialNum TextBlock[] - 공동 사업자 주민등록번호
result.documentType FormattedText[] - 사업자등록증 유형
result.headAddress TextBlock[] - 본점 소재지
result.issuanceDate TextBlock[] - 발급 일자
result.issuanceReason TextBlock[] - 발급 사유
result.openDate TextBlock[] - 개업 일자
result.repName TextBlock[] - 대표자명
result.socialNumber TextBlock[] - 대표자 주민등록번호
result.taxType TextBlock[] - 과세 유형

idCard

idCard에 대한 설명은 다음과 같습니다.

필드 타입 필수 여부 설명
meta Object - 메타 정보
meta.estimatedLanguage String - OCR 엔진에서 인식한 언어
  • ko | en | ja
    • ko: 한국어
    • en: 영어
    • ja: 일본어
result Object - 인식 결과
result.isConfident Boolean - 신뢰성 여부
  • true | false
    • true: ID별로 필요한 내용이 있음
    • false: ID별로 필요한 내용이 없음
result.ic Object - 주민등록증
result.ic.name FormattedText[] - 이름
result.ic.personalNum FormattedText[] - 주민등록번호 (뒤 7자리 마스킹)
result.ic.address FormattedText[] - 주소
result.ic.issueDate FormattedDate[] - 발급 일자 (전체 마스킹)
result.ic.authority FormattedText[] - 발급 기관
result.dl Object - 운전면허증
result.dl.type TextBlock - 면허 종류
result.dl.num FormattedText[] - 면허번호, 뒤 8자리 마스킹
result.dl.name FormattedText[] - 이름
result.dl.personalNum FormattedText[] - 주민등록번호, 뒤 7자리 마스킹
result.dl.address FormattedText[] - 주소
result.dl.renewStartDate FormattedDate[] - 적성 검사 (갱신) 기간 시작 일자
result.dl.renewEndDate FormattedDate[] - 적성 검사 (갱신) 기간 종료 일자
result.dl.condition FormattedText[] - 면허 조건
result.dl.code FormattedText[] - 암호일련번호 (위조 방지를 위한 숫자)
  • 6자리 번호(숫자와 영문 혼합) 또는 6자리 번호(숫자 4자리와 영문 2자)
result.dl.organDonation TextBlock - 장기ㆍ조직 기증
result.dl.issueDate FormattedDate[] - 발급 일자 (전체 마스킹)
result.dl.authority FormattedText[] - 발급 기관
result.pp Object - 여권
result.pp.type FormattedText[] - 여권 종류
result.pp.issueCountry TextBlock - 발행 국가
result.pp.num FormattedText[] - 여권번호 (전체 마스킹)
result.pp.surName FormattedText[] -
result.pp.givenName FormattedText[] - 이름
result.pp.nationality FormattedText[] - 국적
result.pp.birthDate FormattedDate[] - 생년월일
result.pp.personalNum FormattedText[] - 주민등록번호 (전체 마스킹)
result.pp.sex FormattedText[] - 성별
result.pp.issueDate FormattedDate[] - 발급 일자
result.pp.expireDate FormattedDate[] - 만료 일자
result.pp.authority TextBlock - 발급 기관
result.pp.fullNameKor FormattedText[] - 한글 성명
result.pp.mrz1 FormattedText[] - 기계판독영역 (MRZ) 1 (전체 마스킹)
result.pp.mrz2 FormattedText[] - 기계판독영역 (MRZ) 2 (전체 마스킹)
result.ac Object - 외국인등록증
result.ac.alienRegNum FormattedText[] - 외국인등록번호 (뒤 7자리 마스킹)
result.ac.alienRegNumEtc FormattedText[] - 외국인등록번호 기타 (전체 마스킹)
result.ac.sex FormattedText[] - 성별
result.ac.name FormattedText[] - 이름
result.ac.nationality FormattedText[] - 국적
result.ac.visaType FormattedText[] - 발급 유형
result.ac.issueDate FormattedDate[] - 발급 일자 (전체 마스킹)
result.ac.authority FormattedText[] - 발급 기관
result.ac.authorityEng FormattedText[] - 발급 기관 (영문)
result.ac.serialNum FormattedText[] - 일련번호
result.rois BoundingPoly - 신분증 외곽 인식
result.idtype String - ID 유형
  • ID Card | Driver's License | Passport | Alien Registration Card | unknown
    • ID Card: 주민등록증
    • Driver's License: 운전면허증
    • Passport: 여권
    • Alien Registration Card: 외국인등록증
    • unknown: 알 수 없음

face

face에 대한 설명은 다음과 같습니다.

필드 타입 필수 여부 설명
result String - 처리 결과
  • SUCCESS | ERROR
    • SUCCESS: 얼굴 인식 성공
    • ERROR: 얼굴 인식 오류
message String - 처리 메시지
faces Object[] - 얼굴 인식 결과
faces[].boundingPoly BoundingPoly - 얼굴 영역의 다각형 좌표
faces[].boundingBox Vertex[] - 얼굴 영역의 사각형 좌표
faces[].confidence Float - 얼굴 검증 신뢰도
  • 0~1 (값이 클수록 신뢰도가 높음)
faces[].landmark Object[] - 특징 정보
faces[].landmark.type String - 특징 유형
  • CHIN | LEFT_EYEBROW | RIGHT_EYEBROW | BRIDGE_OF_NOSE | NOSE | LEFT_EYE | RIGHT_EYE | LIBS | MOUTH | LEFT_PUPIL | RIGHT_PUPIL
faces[].landmark.position Float[] - 특징 좌표
  • [x, y]
faces[].alignedImage String - 정렬된 이미지
faces[].attributes Object - 속성 정보
faces[].attributes.eulerAngle Object - 오일러 각
faces[].attributes.eulerAngle.pitch Float - Pitch (Tilt)
faces[].attributes.eulerAngle.roll Float - Roll
faces[].attributes.eulerAngle.yaw Float - Yaw (Pan)
faces[].attributes.eulerAngle.pose String - Pose
faces[].attributes.eyeOpen Object - 눈을 뜨고 있는지에 대한 속성
faces[].attributes.eyeOpen.left Object - 왼쪽 눈 정보
faces[].attributes.eyeOpen.right Object - 오른쪽 눈 정보
faces[].attributes.eyeOpen.{left/right}.isOpen boolean - 눈을 뜨고 있는지 여부
faces[].attributes.eyeOpen.{left/right}.aspectRatio Float - 눈을 뜬 정도
faces[].attributes.maskOption Object - 마스크를 썼는지에 대한 속성
faces[].attributes.maskOption.isWearing boolean - 마스크를 썼는지 여부
faces[].attributes.mouthOpen Object - 입을 벌리고 있는지에 대한 속성
faces[].attributes.mouthOpen.isOpen Boolean - 입을 벌리고 있는지 여부
faces[].attributes.mouthOpen.aspectRatio Float - 입을 벌린 정도
faces[].feature Float[] - 얼굴 특징 벡터 (512차원)
count Integer - 인식된 얼굴 개수

응답 상태 코드

CLOVA eKYC API에서 공통으로 사용하는 응답 상태 코드에 대한 정보는 CLOVA eKYC 응답 상태 코드를 참조해 주십시오.

응답 예시

응답 예시는 다음과 같습니다.

사업자등록증

{
    "requestId": "request-001",
    "timestamp": 1700000000000,
    "uid": "a1b2c3d4e5f6g7h8i9j0k1l2m3",
    "images": [
        {
            "uid": "0123456789abcdef0123456789abcdef",
            "name": "business-license",
            "inferResult": "SUCCESS",
            "message": "SUCCESS",
            "bizLicense": {
                "meta": {
                    "estimatedLanguage": "ko"
                },
                "result": {
                    "bisAddress": [
                        {
                            "text": "경기도 성남시 분당구 불정로 6 (정자동, 그린팩토리)",
                            "boundingPolys": [
                                {
                                    "vertices": [
                                        { "x": 227.0, "y": 350.0 },
                                        { "x": 284.0, "y": 350.0 },
                                        { "x": 284.0, "y": 372.0 },
                                        { "x": 227.0, "y": 372.0 }
                                    ]
                                }
                            ]
                        }
                    ],
                    "bisItem": [
                        {
                            "text": "전자지급결제대행",
                            "boundingPolys": [...]
                        }
                    ],
                    "registerNumber": [
                        {
                            "text": "XXX-XX-XXXXX",
                            "boundingPolys": [...]
                        }
                    ],
                    "bisType": [
                        {
                            "text": "금융 및 보험업",
                            "boundingPolys": [...]
                        }
                    ],
                    "corpName": [
                        {
                            "text": "네이버파이낸셜 주식회사",
                            "boundingPolys": [...]
                        }
                    ],
                    "corpRegisterNum": [
                        {
                            "text": "111111-2222222",
                            "boundingPolys": [...]
                        }
                    ],
                    "documentType": [
                        {
                            "text": "사업자등록증",
                            "formatted": { "value": "사업자등록증" },
                            "boundingPolys": [...],
                            "maskingPolys": []
                        }
                    ],
                    "headAddress": [
                        {
                            "text": "경기도 성남시 분당구 불정로 6 (정자동, 그린팩토리)",
                            "boundingPolys": [...]
                        }
                    ],
                    "issuanceDate": [
                        {
                            "text": "2019년 11월 05일",
                            "boundingPolys": [...]
                        }
                    ],
                    "issuanceReason": [
                        {
                            "text": "정정",
                            "boundingPolys": [...]
                        }
                    ],
                    "openDate": [
                        {
                            "text": "2019년 11월 01일",
                            "boundingPolys": [...]
                        }
                    ],
                    "repName": [
                        {
                            "text": "홍길동",
                            "boundingPolys": [...]
                        }
                    ],
                    "taxType": [
                        {
                            "text": "법인사업자",
                            "boundingPolys": [...]
                        }
                    ]
                }
            },
            "inferDetailType": "BL_CORP",
            "inferDetailResource": "bl-corp"
        }
    ]
}

신분증

{
    "requestId": "request-002",
    "timestamp": 1700000000000,
    "uid": "a1b2c3d4e5f6g7h8i9j0k1l2m3",
    "images": [
        {
            "uid": "0123456789abcdef0123456789abcdef",
            "name": "identification-card",
            "inferResult": "SUCCESS",
            "message": "SUCCESS",
            "idCard": {
                "meta": {
                    "estimatedLanguage": "ko"
                },
                "result": {
                    "isConfident": true,
                    "ic": {
                        "name": [
                            {
                                "text": "홍길순",
                                "formatted": { "value": "홍길순" },
                                "boundingPolys": [
                                    {
                                        "vertices": [
                                            { "x": 87.12531, "y": 128.30472 },
                                            { "x": 354.70047, "y": 122.730225 },
                                            { "x": 355.77777, "y": 174.43933 },
                                            { "x": 88.2026, "y": 180.01381 }
                                        ]
                                    }
                                ],
                                "maskingPolys": []
                            }
                        ],
                        "personalNum": [
                            {
                                "text": "111111-2222222",
                                "formatted": { "value": "111111-2222222" },
                                "boundingPolys": [...],
                                "maskingPolys": [...],
                                "maskingText": "111111-*******"
                            }
                        ],
                        "address": [
                            {
                                "text": "경기도 성남시 분당구 불정로 6 (정자동, 그린팩토리)",
                                "formatted": { "value": "경기도 성남시 분당구 불정로 6 (정자동, 그린팩토리)" },
                                "boundingPolys": [...],
                                "maskingPolys": []
                            }
                        ],
                        "issueDate": [
                            {
                                "text": "2012. 6. 1.",
                                "formatted": {
                                    "year": "2012",
                                    "month": "06",
                                    "day": "01"
                                },
                                "boundingPolys": [...],
                                "maskingPolys": [...],
                                "maskingText": "**********"
                            }
                        ],
                        "authority": [
                            {
                                "text": "경기도 성남시장",
                                "formatted": { "value": "경기도 성남시장" },
                                "boundingPolys": [...],
                                "maskingPolys": []
                            }
                        ]
                    },
                    "rois": [
                        {
                            "vertices": [
                                { "x": -28.767818, "y": 6.7013874 },
                                { "x": 756.80585, "y": -29.431211 },
                                { "x": 749.05365, "y": 466.8993 },
                                { "x": 8.251797, "y": 480.46704 }
                            ]
                        }
                    ],
                    "idtype": "ID Card"
                }
            },
            "face": {
                "result": "SUCCESS",
                "message": "Success",
                "faces": [
                    {
                        "boundingPoly": {
                            "vertices": [
                                { "x": 548.0829, "y": 73.06664 },
                                { "x": 648.30365, "y": 73.06664 },
                                { "x": 648.30365, "y": 215.3121 },
                                { "x": 548.0829, "y": 215.3121 }
                            ]
                        },
                        "boundingBox": [...],
                        "confidence": 0.99917346,
                        "landmark": [
                            {
                                "type": "CHIN",
                                "position": [543.59534, 134.98737]
                            },
                            ...
                        ],
                        "feature": [-0.020869667, 0.1342391, ...]
                    }
                ],
                "count": 1
            },
            "inferDetailType": "IC",
            "inferDetailResource": "ic",
            "isGrayScale": false
        }
    ]
}