# 시작하기 (Quickstart)

## 1. 파트너 등록 및 키 발급

운영팀에 파트너 등록을 요청하면 클라이언트 ID(`X-Client-Id`)와 API 키(`X-API-Key`)를 발급받습니다.
키는 발급 시 1회만 표시되며 서버에는 해시로만 저장됩니다 — 시크릿 매니저에 보관하세요.
키는 환경(SANDBOX/LIVE)에 결속됩니다. URL은 동일합니다.

EN — Register as a partner via the operations team; you receive a client id (`X-Client-Id`) and an
API key (`X-API-Key`). The key is shown once and stored as a hash. Keys are bound to an environment
(SANDBOX or LIVE); the base URL is shared.

## 2. 연결 확인 (whoami)

```bash
curl -s https://trendy.storydot.kr/superapp/api/fi/whoami \
  -H "X-Client-Id: YOUR_CLIENT_ID" \
  -H "X-API-Key: YOUR_API_KEY"
```

```json
{
  "success": true,
  "data": {
    "clientId": "YOUR_CLIENT_ID",
    "name": "Example Bank",
    "environment": "SANDBOX",
    "rateLimitTier": "STANDARD",
    "status": "ACTIVE"
  },
  "message": "OK"
}
```

## 3. 샌드박스 첫 점수 조회

`SANDBOX-TIER-A`는 항상 820점(EXCELLENT)을 반환합니다. 전체 표는 [sandbox.md](sandbox.md).

EN — Canonical subject `SANDBOX-TIER-A` always scores 820 (EXCELLENT). Full table: [sandbox.md](sandbox.md).

```bash
curl -s https://trendy.storydot.kr/superapp/api/fi/score/query \
  -H "X-Client-Id: YOUR_CLIENT_ID" \
  -H "X-API-Key: YOUR_SANDBOX_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "pairwiseSub": "SANDBOX-TIER-A", "purpose": "UNDERWRITING" }'
```

거부 케이스 연습: `SANDBOX-NO-CONSENT`는 항상 동의 없음(DENIED)으로 응답합니다.

EN — Rehearse denial with `SANDBOX-NO-CONSENT`, which is always denied.

## 4. 라이브 전환

통합 테스트 후 라이브 키를 발급받아 헤더의 키만 교체하면 됩니다. 라이브에서는:

- 사용자가 동의한 경우에만 점수 반환(기본 차단)
- 동의 없음/주체 없음은 동일 라벨(DENIED)로 거부 — 존재 추론 불가
- 모든 조회는 해시체인 접근로그에 기록되어 사용자에게 공개

EN — After integration testing, request a LIVE key and swap it in your headers. In LIVE, scores are
returned only under consent (deny-by-default); denials use one identical label; every query is written
to a hash-chained access log visible to the user.

## 5. 다음 단계

[auth.md](auth.md) · [api-reference.md](api-reference.md) · [webhooks.md](webhooks.md) · [errors.md](errors.md)
