# Quickstart

Choose one authentication method, then replace the credential placeholders,
transaction ID, NIK, and selfie with values for your integration.

## Basic Authentication

```bash
curl -X POST https://stg-b2b-api.privy.id/api/v1/insights \
  -H 'Authorization: Basic <BASE64_USERNAME_PASSWORD>' \
  -H 'Merchant-Key: <MERCHANT_KEY>' \
  -H "Content-Type: application/json" \
  -d '{
    "transaction_id": "insights-request-001",
    "nik": "3173050101900001",
    "selfie": "/9j/4AAQSkZJRgABAQAAAQABAAD...",
    "channel": "web"
  }'
```

## Bearer HMAC Authentication

```bash
curl -X POST https://stg-b2b-api.privy.id/api/v1/insights \
  -H 'Authorization: Bearer <ACCESS_TOKEN>' \
  -H 'Timestamp: <TIMESTAMP>' \
  -H 'Signature: <SIGNATURE>' \
  -H "Content-Type: application/json" \
  -d '{
    "transaction_id": "insights-request-001",
    "nik": "3173050101900001",
    "selfie": "/9j/4AAQSkZJRgABAQAAAQABAAD...",
    "channel": "web"
  }'
```

A successful request returns HTTP `200`:

```json
{
  "code": 200,
  "status": "success",
  "client_transaction_id": "insights-request-001",
  "data": {
    "score": 98
  },
  "balance": 100,
  "transaction_id": "019c1234-5678-7abc-8def-0123456789ab",
  "message": "insights successful"
}
```

The `score` above is illustrative. Privy does not define a public pass
threshold for this endpoint.
