Authentication for FinHub API Sandbox Integration
/api/v2/auth/sandbox/token
endpoint, which requires both user credentials and API client credentials. This authentication method is specific to the sandbox environment.
Sandbox | Production |
---|---|
Parameters must be manually added to the request | Parameters are automatically provided by the system |
Uses /api/v2/auth/sandbox/token endpoint | Uses standard OAuth2 endpoints |
Requires both user and client credentials | Typically requires only client credentials |
Designed for testing and development | Designed for live operations |
Header | Description | Required | Example |
---|---|---|---|
Content-Type | Media type of the request body | Yes | application/json |
sec-ch-ua-platform | Client platform information | Yes | Windows |
X-Forwarded-For | Client IP address | Yes | 127.0.0.1 |
User-Agent | Client user agent information | Yes | Mozilla/5.0 (Windows NT 10.0; Win64; x64) |
X-Tenant-ID | Tenant identifier for multi-tenant operations | Yes | 1234567 |
Parameter | Description | Required | Source |
---|---|---|---|
username | Sandbox username | Yes | Provided in welcome email |
password | Sandbox password | Yes | Provided in welcome email |
customerId | Client ID for your sandbox tenant | Yes | Developer Portal > API Access |
customerSecret | Client secret for your sandbox tenant | Yes | Developer Portal > API Access |
accountType | Type of account (b2b or b2c) | Yes | Based on your integration type |
Authorization
header of all subsequent API requests:
expires_in
field of the response (in seconds). Your application should:
Status Code | Description | Possible Cause | Solution |
---|---|---|---|
400 | Bad Request | Invalid request format | Check request body format and required fields |
401 | Unauthorized | Invalid credentials | Verify username, password, client ID, and client secret |
403 | Forbidden | Insufficient permissions | Verify tenant ID and account permissions |
429 | Too Many Requests | Rate limit exceeded | Implement exponential backoff and retry strategy |
500 | Internal Server Error | Server-side issue | Contact FinHub support |
https://auth.sandbox.finhub.com/oauth2/token
https://auth.finhub.com/oauth2/token