# Patron API — Quick Reference

**Config file (production):** `.env` only  
**Auth:** `api.basic.username` / `api.basic.password` (default `DLRL` / `DLRL@2026`)  
**Base URL:** `app.baseURL` in `.env`

| Method | Endpoint |
|--------|----------|
| POST | `/api/patron/upsert` |
| GET | `/api/patron/view` |
| GET | `/api/patron/view?cardnumber=XXX` |
| GET | `/api/patron/overdue` |
| GET | `/api/patron/overdue?cardnumber=XXX` |

### Change production settings in `.env`

```
CI_ENVIRONMENT = production
app.baseURL = 'http://14.139.92.12/dlrl_koha_api/'
app.indexPage = ''

database.default.hostname = 14.139.92.12
database.default.database = koha_library
database.default.username = cqr
database.default.password = ********
database.default.DBDriver = MySQLi
database.default.port = 3306
database.default.DBDebug = false

api.basic.username = DLRL
api.basic.password = DLRL@2026
api.defaultBranchCode = DLRL
api.attributeCodes = DESIG,DIV,RT
```

**Files to change:**
| File | When |
|------|------|
| `.env` | Always — all production settings |
| `public/.htaccess` (`RewriteBase`) | Only if public URL folder name changes |

**Attribute codes:**

| Code | Description |
|------|-------------|
| `DESIG` | Designation |
| `DIV` | DIVISION |
| `RT` | RETIRED_TRANSFERED |

**Category codes:**

| Code | Description |
|------|-------------|
| `OFC` | Officers |
| `STAFF` | Staff |

Full examples: see `PATRON_API_USER_MANUAL.pdf`
