developers.kci-nfc.co.id
Open API Developer Portal
PR
3 baru
12
Partner Aktif
3 dalam review
28.4%
4,28M
API Calls Bulan Ini
vs 3,33M bulan lalu
Baik
142ms
P99 Response Time
SLA target < 500ms
Sempurna
99.96%
API Uptime
Target: 99.9%
API Reference
Semua endpoint v1 — klik untuk lihat detail
GET
/open-api/v1/stations
List semua stasiun dengan info dan koordinat
No Auth
GET
/open-api/v1/stations/{id}
Detail stasiun, fasilitas, jam operasi
No Auth
GET
/open-api/v1/fare/calculate
Hitung estimasi tarif origin → destination
API Key
GET
/open-api/v1/journeys
Riwayat perjalanan user (dengan consent)
journey:read
GET
/open-api/v1/stats/traffic
Traffic per stasiun per jam (anonymized)
API Key
GET
/open-api/v1/user/profile
Profil dasar user (consent required)
profile:read
GET
/open-api/v1/user/balance
Saldo wallet user (consent required)
balance:read
POST
/open-api/v1/webhooks
Register endpoint webhook partner
API Key
DEL
/open-api/v1/webhooks/{id}
Hapus webhook registration
API Key
Contoh Request — /stations
Go SDK Copy
import "github.com/kci-nfc/sdk-go"

func main() {
    client := nfcgate.NewClient(
        "nfcg_live_k7f2a9...",
    )

    stations, err := client.Stations.List(
        context.Background(),
        &nfcgate.StationListParams{
            Line: nfcgate.String("bogor"),
        },
    )
    if err != nil {
        log.Fatal(err)
    }
    for _, s := range stations.Data {
        fmt.Printf("%s: %s\n", s.ID, s.Name)
    }
}
Sample Response
200 OK
application/json Copy
{
  "data": [
    {
      "id": "STN_JDA",
      "name": "Juanda",
      "line": ["bogor"],
      "lat": -6.1661,
      "lng": 106.8310,
      "gates_online": 2,
      "gates_total": 2
    }
  ],
  "meta": {
    "total": 81,
    "page": 1
  }
}
Webhook Events
journey.completed
Perjalanan pengguna selesai (tap-out)
~3.800/hari
station.crowded
Kepadatan stasiun > 80% kapasitas
~15/hari
gate.offline
Gate NFC terputus dari backend
< 5/hari
fare_cap.reached
Pengguna mencapai fare cap harian/mingguan
~1.200/hari
fraud.detected
Transaksi terindikasi fraud oleh AI
~5/hari
Partner Aktif
PartnerTierCalls/HariStatus
TravelKu App
Aplikasi travel planning
Pro 42.891 Aktif
Komuter Community
Platform komunitas KRL
Free 8.234 Aktif
TransitData.id
Analitik data transportasi
Enterprise 218.471 Aktif
CityMapper ID
Navigasi kota berbasis transit
Pro 31.028 Aktif
Free
Rp 0
1.000 req/hari
Public endpoints
Fare calculate
Station info
Scoped endpoints
Webhook events
SLA guarantee
Pro
Rp 999K/bln
100.000 req/hari
Semua public endpoints
Scoped endpoints + OAuth
Webhook events (5 events)
Traffic analytics data
SLA 99.5%
Custom rate limits
Enterprise
Custom
Unlimited / custom quota
Semua Pro features
All webhook events
Dedicated support
Custom rate limits
SLA 99.9%
On-premise option
API Usage — 30 Hari Terakhir
Semua partner
Authentication
Dua metode autentikasi tersedia: API Key (server-to-server) dan OAuth 2.0 (user-scoped)
API Key Authentication
Server-to-Server
Cocok untuk backend-to-backend tanpa konteks user. Gunakan header X-API-Key di setiap request.
HTTP Request Copy
GET /open-api/v1/stations
X-API-Key: nfcg_live_k7f2a9b3c4d5e6f7...
Accept: application/json
Format API Key
nfcg_live_→ Production key
nfcg_test_→ Sandbox key
OAuth 2.0 (PKCE)
User-Scoped
Untuk endpoint yang memerlukan persetujuan user. Flow: PKCE Authorization Code dengan redirect ke KCI Auth Server.
OAuth Flow Copy
// 1. Redirect user ke:
https://auth.kci-nfc.co.id/oauth/authorize
  ?client_id=your_client_id
  &response_type=code
  &scope=journey:read profile:read
  &code_challenge=BASE64URL(SHA256(code_verifier))

// 2. Tukar code dengan access_token
POST /oauth/token
  code: "auth_code_dari_callback"
  code_verifier: "plain_code_verifier"
Scopes yang tersedia:
journey:read profile:read balance:read
Rate Limiting & Error Codes
Rate Limit Headers
Response Headers
X-RateLimit-Limit: 1000
X-RateLimit-Remaining: 842
X-RateLimit-Reset: 1709856000
Error Codes
CodeArti
401API Key tidak valid / expired
429Rate limit terlampaui
403Scope tidak cukup
404Resource tidak ditemukan
500Internal server error
Webhook Documentation
Terima notifikasi real-time dari NFC Gate AFC ke server Anda
Semua Webhook Events
journey.tap_in
User tap masuk gate
~4K/hari
journey.completed
Perjalanan selesai (tap-out)
~3.8K/hari
station.crowded
Kepadatan stasiun > 80%
~15/hari
gate.offline
Gate NFC terputus
<5/hari
fare_cap.reached
User capai fare cap
~1.2K/hari
fraud.detected
Transaksi terindikasi fraud
~5/hari
Payload Contoh
journey.completed
POST ke endpoint Anda Copy
{
  "event": "journey.completed",
  "timestamp": "2026-03-08T14:32:07Z",
  "data": {
    "journey_id": "jrn_7f2a9b3c",
    "tap_in": {
      "station": "STN_GMB",
      "time": "2026-03-08T13:58:21Z"
    },
    "tap_out": {
      "station": "STN_MGR",
      "time": "2026-03-08T14:32:07Z"
    },
    "fare": 5000,
    "payment_method": "qris_tap",
    "fare_cap_applied": false
  },
  "signature": "sha256=abc123..."
}
Verifikasi Signature
Go Copy
func verifyWebhook(body []byte, sig, secret string) bool {
    mac := hmac.New(sha256.New, []byte(secret))
    mac.Write(body)
    expected := "sha256=" + hex.EncodeToString(mac.Sum(nil))
    return hmac.Equal([]byte(sig), []byte(expected))
}
SDK & Library
Official SDK tersedia untuk Go, JavaScript/TypeScript, dan Python
Go SDK
v1.4.2 · Official
Installation
go get github.com/kci-nfc/sdk-go
Full support semua endpoint. Type-safe. Context support. Auto-retry dengan exponential backoff.
JavaScript / TS
v1.3.1 · Official
npm
npm install @kci-nfc/sdk
TypeScript full support. ESM + CJS. Node.js 18+ dan browser (CORS). Async/await native.
Python SDK
v1.2.0 · Official
pip
pip install kci-nfc
Python 3.9+. Sync dan Async (asyncio). Pydantic model. Auto-pagination untuk list endpoints.
Contoh SDK Usage — TypeScript
TypeScript Copy
import { NFCGateClient } from '@kci-nfc/sdk';

const client = new NFCGateClient({
  apiKey: 'nfcg_live_k7f2a9...',
});

// Get all stations
const stations = await client.stations.list({ line: 'bogor' });

// Calculate fare
const fare = await client.fare.calculate({
  from: 'STN_GMB',
  to: 'STN_MGR',
});

// Listen to webhooks
client.webhooks.on('journey.completed', (event) => {
  console.log(`Fare: Rp ${event.data.fare}`);
});
GET /open-api/v1/stations No Auth Required
Deskripsi
Mendapatkan daftar semua stasiun KCI beserta informasi detail: nama, kode, jalur kereta, koordinat GPS, jumlah gate, fasilitas, dan jam operasional. Tidak memerlukan autentikasi.
Query Parameters
ParamTipeDefaultKeterangan
linestringFilter berdasarkan jalur: bogor, bekasi, cikarang
limitinteger20Jumlah item per halaman (max 81)
pageinteger1Halaman ke-N
qstringCari berdasarkan nama stasiun
Response 200 OK
application/json Copy
{
  "data": [
    {
      "id": "STN_GMB",
      "name": "Gambir",
      "code": "GMB",
      "line": ["bogor", "cikarang"],
      "lat": -6.1769,
      "lng": 106.8317,
      "gates_online": 4,
      "gates_total": 4,
      "facilities": [
        "elevator", "toilet", "musholla"
      ],
      "operating_hours": {
        "open": "05:00",
        "close": "24:00"
      }
    }
  ],
  "meta": {
    "total": 81,
    "page": 1,
    "limit": 20
  }
}
GET /open-api/v1/fare/calculate API Key Required
Query Parameters
ParamReqKeterangan
fromKode stasiun asal (contoh: STN_GMB)
toKode stasiun tujuan (contoh: STN_DPK)
user_typeTipe penumpang: adult (default), student, disabled
payment_methodqris_tap, emv_visa, emv_mc, google_pay, apple_pay
Response 200 OK
JSON Copy
{
  "from": "STN_GMB",
  "to": "STN_DPK",
  "distance_km": 28.4,
  "fare": 8000,
  "currency": "IDR",
  "user_type": "adult",
  "discounts": [],
  "fare_cap": {
    "daily": 10000,
    "weekly": 50000,
    "monthly": 150000
  }
}
GET /open-api/v1/stats/traffic API Key Required
Deskripsi
Data kepadatan penumpang per stasiun per jam, dalam bentuk anonymized aggregate. Berguna untuk aplikasi perencanaan perjalanan dan navigasi kota.
ParamTipeKeterangan
station_idstringID stasiun (opsional, all jika tidak diisi)
datedateFormat YYYY-MM-DD (default: hari ini)
granularitystringhourly (default) atau daily
Response 200 OK
JSON Copy
{
  "station_id": "STN_MGR",
  "date": "2026-03-08",
  "granularity": "hourly",
  "data": [
    {
      "hour": 7,
      "tap_in": 1284,
      "tap_out": 892,
      "crowd_level": "high"
    },
    {
      "hour": 8,
      "tap_in": 2847,
      "tap_out": 1923,
      "crowd_level": "critical"
    }
  ]
}
GET /open-api/v1/journeys OAuth: journey:read
Endpoint Scoped: Memerlukan OAuth 2.0 dengan scope journey:read dan persetujuan eksplisit dari user.
Query Parameters
ParamTipeKeterangan
from_datedateTanggal mulai (YYYY-MM-DD)
to_datedateTanggal akhir
limitintegerMax 100 per halaman
payment_methodstringFilter berdasarkan metode bayar
Response
JSON Copy
{
  "data": [
    {
      "id": "jrn_7f2a9b3c",
      "tap_in_station": "STN_GMB",
      "tap_out_station": "STN_MGR",
      "tap_in_time": "2026-03-08T13:58:21Z",
      "tap_out_time": "2026-03-08T14:32:07Z",
      "fare_charged": 5000,
      "payment_method": "qris_tap",
      "fare_cap_applied": false
    }
  ],
  "meta": {
    "total": 38,
    "page": 1
  }
}
GET /open-api/v1/user/profile OAuth: profile:read
Data yang Dikembalikan
Nama lengkap (no KTP)
Email & nomor HP (masked)
Status KYC (verified/pending)
Tipe penumpang (student/disabled)
NIK (tidak pernah dikembalikan)
Data biometrik
Response
JSON Copy
{
  "id": "usr_28471",
  "name": "Ahmad Wibowo",
  "email": "a***@email.com",
  "phone": "+62 812-****-7890",
  "kyc_status": "verified",
  "user_type": "adult",
  "registered_at": "2026-01-15T09:00:00Z"
}
GET /open-api/v1/user/balance OAuth: balance:read
Mengembalikan saldo wallet KCI Pay user beserta informasi fare capping dan limit transaksi.
Gunakan dengan bijak: Jangan tampilkan saldo user tanpa persetujuan eksplisit. Gunakan hanya untuk fitur yang memerlukan informasi saldo (seperti top-up reminder).
Response
JSON Copy
{
  "balance": 85000,
  "currency": "IDR",
  "fare_cap": {
    "daily_spent": 7500,
    "daily_limit": 10000,
    "weekly_spent": 32000,
    "weekly_limit": 50000,
    "monthly_spent": 95000,
    "monthly_limit": 150000
  },
  "transaction_limit": 2000000
}
POST /open-api/v1/webhooks API Key Required
Request Body
application/json Copy
{
  "url": "https://yourapp.com/webhooks/kci",
  "events": [
    "journey.completed",
    "fare_cap.reached",
    "station.crowded"
  ],
  "secret": "your_webhook_secret_key",
  "active": true
}
Response 201 Created
JSON Copy
{
  "id": "wh_a1b2c3d4",
  "url": "https://yourapp.com/webhooks/kci",
  "events": [
    "journey.completed",
    "fare_cap.reached",
    "station.crowded"
  ],
  "active": true,
  "created_at": "2026-03-08T09:00:00Z"
}
DELETE /open-api/v1/webhooks/{id} API Key Required
Menghapus registrasi webhook secara permanen. Setelah dihapus, event tidak akan dikirim lagi ke URL tersebut.
Path ParamKeterangan
idID webhook (dari response POST /webhooks)
Response 204 No Content
204 No Content — Webhook berhasil dihapus
Tidak ada response body. Status 404 dikembalikan jika ID tidak ditemukan.
Partner Management
Kelola API partner yang terdaftar dan akses mereka
12
Partner Aktif
3
Dalam Review
4,28M
Calls Bulan Ini
4
Enterprise Tier
PartnerTierAPI Calls Hari IniLimit/HariPenggunaanWebhookStatusAksi
TravelKu App
PT TravelKu Nusantara
Pro42.891100.000
43%
3 eventsAktif
TransitData.id
PT Transit Analytics
Enterprise218.471Unlimited
OK
5 eventsAktif
CityMapper ID
CityMapper Pte Ltd
Pro31.028100.000
31%
2 eventsAktif
Komuter Community
Platform komunitas KRL
Free8.23410.000
82%
TidakAktif
Usage Statistics
Statistik penggunaan API seluruh partner
28%
4,28M
Total Calls Bulan Ini
Bagus
99.8%
Success Rate
142ms
P99 Latency
0.2%
Error Rate
API Calls — 30 Hari
Top Endpoints by Calls
EndpointCalls Bulan IniSuccess%Avg LatencyP99 Latency
GET /stations1.84M99.9%42ms98ms
GET /stats/traffic1.21M99.7%88ms142ms
GET /fare/calculate0.92M99.8%31ms67ms
GET /journeys0.24M98.9%124ms312ms
POST /webhooks0.07M100%18ms44ms
Billing & Tier Management
Kelola tagihan dan tier API partner
Free
Rp 0
10.000 req/hari
Public endpoints
Fare calculate
Station info
Scoped endpoints
Webhook events
SLA guarantee
Pro
Rp 999K/bln
100.000 req/hari
Semua public endpoints
Scoped endpoints + OAuth
5 webhook events
Traffic analytics
SLA 99.5%
Custom rate limits
Enterprise
Custom
Unlimited / custom quota
Semua Pro features
All webhook events
Dedicated support
Custom rate limits
SLA 99.9%
On-premise option
Tagihan Terakhir
PeriodeTierTotal CallsAmountStatus
Feb 2026Pro3,21MRp 999.000Paid
Jan 2026Pro2,89MRp 999.000Paid
Des 2025Free0,31MRp 0Paid
API Status Page
Status operasional semua layanan NFC Gate Open API
Semua Sistem Beroperasi Normal
Diperbarui: 8 Mar 2026 · 15:41 WIB
Uptime 30 hari
99.96%
Status Komponen
API Gateway (v1)
P50: 28ms · P99: 98ms
Operational
OAuth 2.0 Auth Server
Token issue: <50ms
Operational
Webhook Delivery
Avg delivery: 1.2s
Operational
Fare Calculation Engine
Real-time
Operational
Sandbox Environment
Isolasi penuh dari production
Operational
Incident History (90 hari)
14 Jan 2026 — API Gateway Degraded (resolved)
Durasi: 23 menit · Dampak: <5% request terdampak · Root cause: memory spike pada container
29 Des 2025 — Webhook Delivery Delay (resolved)
Durasi: 11 menit · Delay rata-rata: 4.2s (normal: 1.2s) · Root cause: Redis backpressure
Tidak ada incident lain dalam 90 hari terakhir