Replace the sample credentials, merchant key, transaction ID, and KTP image
with values for your integration.
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": 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