> ## Documentation Index
> Fetch the complete documentation index at: https://docs.leuwongrr.online/llms.txt
> Use this file to discover all available pages before exploring further.

# Quickstart

> Cara cepat memakai LeuwongRR User API dari token sampai request pertama.

# Quickstart

Ikuti langkah berikut untuk mulai memakai LeuwongRR User API.

## 1. Login ke akun LeuwongRR

Buka dashboard member:

```txt theme={null}
https://leuwongrr.online/login
```

## 2. Buka User API Access

Masuk ke halaman token API user:

```txt theme={null}
https://leuwongrr.online/user/api-access
```

## 3. Generate User API Token

Buat token mode **Sandbox** untuk testing atau **Production** untuk integrasi live.

<Warning>
  Jangan simpan token di HTML publik, JavaScript frontend, GitHub public repository, URL query, screenshot, atau chat publik.
</Warning>

## 4. Test health endpoint

Endpoint health tidak membutuhkan token.

```bash theme={null}
curl https://leuwongrr.online/api/v1/health
```

Contoh response:

```json theme={null}
{
  "success": true,
  "message": "OK",
  "data": {
    "service": "LeuwongRR REST API v1",
    "enabled": true
  }
}
```

## 5. Validate token

Gunakan endpoint validasi token untuk memastikan token aktif.

```bash theme={null}
curl -X POST "https://leuwongrr.online/api/v1/auth/token/validate" \
  -H "Authorization: Bearer YOUR_USER_API_TOKEN" \
  -H "Accept: application/json"
```

## 6. Test profil user

```bash theme={null}
curl -H "Authorization: Bearer YOUR_USER_API_TOKEN" \
  -H "Accept: application/json" \
  https://leuwongrr.online/api/v1/me
```

Contoh response:

```json theme={null}
{
  "success": true,
  "message": "OK",
  "data": {
    "user": {
      "id": 1,
      "name": "LeuwongRR User",
      "email": "user@example.com"
    }
  }
}
```

## 7. Cek saldo user

```bash theme={null}
curl -H "Authorization: Bearer YOUR_USER_API_TOKEN" \
  -H "Accept: application/json" \
  https://leuwongrr.online/api/v1/me/balance
```

Contoh response:

```json theme={null}
{
  "success": true,
  "message": "OK",
  "data": {
    "balance": {
      "amount": 25000,
      "formatted": "Rp25.000",
      "currency": "IDR"
    },
    "updated_at": "2026-04-29 09:30:00"
  }
}
```

## 8. Cek status invoice

```bash theme={null}
curl -H "Authorization: Bearer YOUR_USER_API_TOKEN" \
  -H "Accept: application/json" \
  https://leuwongrr.online/api/v1/me/invoices/INV202605010001/status
```

## Checklist integrasi

* Token dibuat dari halaman User API Access
* Token dikirim lewat header, bukan URL
* Request dilakukan dari backend/server/bot
* Endpoint yang digunakan hanya public safe endpoint dan endpoint `/me`
* Saldo dicek melalui `/api/v1/me/balance`, bukan endpoint berbasis `user_id`
* Sistem menangani error `401`, `403`, `404`, `422`, dan `429`
