Documentation Index
Fetch the complete documentation index at: https://docs.finhub.cloud/llms.txt
Use this file to discover all available pages before exploring further.
Authentication & Headers
Every FinCard Virtual API request must carry a valid Bearer JWT token and a set of required context headers. Missing any of them returnsHTTP 400 Missing required header(s).
Step 1 — Obtain a Session Token
Call the login endpoint once to obtain a short-lived JWT. Pass it asAuthorization: Bearer <token> in all subsequent requests.
expiresIn is in seconds. Tokens are valid for 1 hour. Re-authenticate before expiry — there is no refresh token endpoint.Step 2 — Include Headers on Every Request
All 46 FinCard Virtual endpoints require the following headers:| Header | Required | Example | Description |
|---|---|---|---|
Authorization | Yes | Bearer eyJ0eXAi... | JWT from login |
Content-Type | Yes | application/json | Always JSON |
X-Tenant-ID | Yes | tenant_acme | Your tenant identifier |
X-Forwarded-For | Yes | 203.0.113.42 | End-user IP address |
X-Forwarded-From | Yes | my-backend-service | Originating service name |
platform | Yes | web | ios | android | Client platform |
deviceId | Yes | device-abc-123 | Unique device or session ID |
User-Agent | No | MyApp/2.1 | Client user-agent (recommended) |
Complete Request Example
Response Envelope
Every response — success or error — is wrapped in the same envelope:| Field | Type | Description |
|---|---|---|
success | Boolean | true = operation succeeded |
code | Integer | 200 = OK, -1 = business error, 401 = unauthorized, 500 = server error |
msg | String | Human-readable status message |
data | Object | Array | Response payload (varies per endpoint) |
Even HTTP
200 responses can have "success": false for business-level errors (e.g. card not found, insufficient balance). Always check success and code.Error Reference
| HTTP | code | Cause | Action |
|---|---|---|---|
| 400 | 500 | Missing required header | Add all required headers |
| 401 | 401 | Missing or expired token | Re-authenticate via /api/auth/login |
| 401 | 401 | Empty authorization token | Include Authorization: Bearer <token> |
| 200 | -1 | Business error (e.g. card not found) | Check msg for details |
| 200 | 200 | Success | Process data payload |