Common Data Types
This document describes common data structures used throughout the FinHub API. All endpoints follow these conventions unless explicitly documented otherwise.Purpose: Standard data structures used across all FinHub API endpoints.Use these schemas for consistent request/response formatting.
BaseResponse<T>
All API responses are wrapped in this standard structure:Success Response Example
Error Response Example
AmountDto
Financial amounts use scaled integers to avoid floating-point precision issues.How It Works
Thevalue field contains the amount multiplied by 10^scale:
- €50,000.00 =
{ "value": "5000000", "scale": 2, "currency": "EUR" } - €100.00 =
{ "value": "10000", "scale": 2, "currency": "EUR" } - €0.01 =
{ "value": "1", "scale": 2, "currency": "EUR" }
Examples
Request with Amount
Response with Amount
Why Scaled Integers?Floating-point numbers (like
1000.00) can cause precision errors in financial calculations.
Scaled integers ensure exact arithmetic:- Addition:
"1000" + "500" = "1500" - Subtraction:
"1000" - "500" = "500" - Comparison:
"1000" > "500" = true
AddressDto
Physical address structure used for customer registration and KYC.Example
Address Types
ContactDto
Contact information (email, phone, etc.) for customers.Example
Contact Types
PersonDto
Personal information for individual customers, directors, shareholders, etc.Example
TelephoneNumberDto
Telephone number with metadata (used for organizations).Example
Standard HTTP Headers
Request Headers
All API requests should include these headers:Example Request Headers
Standard Error Responses
400 Bad Request
403 Forbidden
404 Not Found
500 Internal Server Error
Enums Reference
Gender
AddressType
ContactType
CustomerType
CustomerStatus
Date and Time Formats
All dates and times use ISO 8601 format:Examples
Pagination (Future)
Pagination is not yet implemented in v2.1. All list endpoints currently return complete results.
Future versions will support cursor-based pagination.
Validation Rules
Email Format
- Must match RFC 5322 standard
- Example:
user@example.com
Phone Number Format
- Must use E.164 format
- Example:
+37060012345
Country Codes
- Must use ISO 3166-1 alpha-2 (2-letter codes)
- Examples:
LT,GB,DE,US
Currency Codes
- Must use ISO 4217 (3-letter codes)
- Examples:
EUR,USD,GBP
Related Resources
Customer APIs
Customer registration and management
Financial Operations
Transfers, payments, and wallet operations
Verification & Compliance
KYC, AML, and compliance workflows