PrivyPrivy
Sign in
  • Documentation
Back to Documentation
B2B Digital Certificate Issuance Support
OverviewChangelog
Insights API
Face Compare API
KTP OCR API
    v2
      OverviewQuickstartEnvironmentsAuthenticationRequest FieldsOCR ResultsErrors
ID Card Forgery
API Explorer
powered by Zudoku
Sign in
v2

Quickstart

Replace the sample credentials, merchant key, transaction ID, and KTP image with values for your integration.

TerminalCode
curl -X POST https://stg-b2b-api.privy.id/api/v2/ocr \ -H 'Authorization: Basic <BASE64_USERNAME_PASSWORD>' \ -H 'Merchant-Key: <MERCHANT_KEY>' \ -H "Content-Type: application/json" \ -d '{ "trId": "ktp-ocr-001", "ktp": "/9j/4AAQSkZJRgABAQAAAQABAAD..." }'

A successful request returns HTTP 200:

Code
{ "code": 200, "status": "ok", "result": { "nik": "3173050101900001", "nama": "BUDI SANTOSO", "tanggal_lahir": "01-01-1990", "tempat_lahir": "JAKARTA", "alamat": "JL CONTOH NO 1", "provinsi": "DKI JAKARTA", "kota": "JAKARTA SELATAN" }, "balance": 100, "transaction_id": "019c1234-5678-7abc-8def-0123456789ab", "message": "get data successfully" }

The returned fields depend on what can be extracted from the submitted image.

Last modified on October 23, 2026
OverviewEnvironments
JSON