Account Service
Manages account creation and balance inquiries.
Endpoints
Create Account
POST /account/create
Create a new account.
Request Body
| Field | Type | Required | Description | Example |
|---|---|---|---|---|
| customerId | string | Yes | Customer identifier | "cst-123e4567-e89b-12d3-a456-426614174000" |
| name | string | No | Account name | "Main Account" |
| string | No | Customer email address | "john.doe@example.com" | |
| routerData | object | No | Router-specific configuration data | { "connectionType": "SOAP" } |
| customerName | string | No | Customer name | "John Doe" |
Example Request:
{
"customerId": "cst-123e4567-e89b-12d3-a456-426614174000",
"name": "Main Account",
"email": "john.doe@example.com",
"routerData": {
"connectionType": "SOAP",
"connectionFormat": "ISO20022",
"endpoint": "https://bank-api.example.com/soap"
},
"customerName": "John Doe"
}
Success Response
Returns the external account ID.
{
"externalId": "acc-789e4567-e89b-12d3-a456-426614174000"
}
Error Responses
- 400 Bad Request: Validation failed (missing or invalid fields)
- 500 Internal Server Error: Failed to create account
Balance Inquiry
POST /account/balance-inquiry
Request account balance using ISO 20022 CAMT.052.
Request Body
| Field | Type | Required | Description | Example |
|---|---|---|---|---|
| accountId | string | Yes | Account identifier (IBAN or BBAN) | "US12345678901234567890" |
| routerData | object | No | Router-specific configuration data | { "connectionType": "SOAP" } |
Example Request:
{
"accountId": "US12345678901234567890",
"routerData": {
"connectionType": "SOAP",
"connectionFormat": "ISO20022",
"endpoint": "https://bank-api.example.com/soap"
}
}
Success Response
Returns account balance details.
{
"currentBalance": "15800.00",
"availableBalance": "15234.75",
"ledgerBalance": "15800.00",
"currency": "USD",
"asOfDateTime": "2025-08-27T14:35:22Z"
}
Error Responses
- 404 Not Found: Account not found or cannot be accessed
- 500 Internal Server Error: Balance inquiry failed
Error Format
All error responses follow this format:
{
"statusCode": "ERROR_CODE",
"error": ["Description of the error"],
"requestId": "72e32108-6260-45e9-bb12-325fe3b61e42",
"path": "endpoint path",
"timestamp": "2025-11-19T16:32:57.915Z"
}
Field Descriptions
| Field | Type | Description |
|---|---|---|
| externalId | string | Unique identifier for the created account |
| accountId | string | Account identifier (IBAN or BBAN) |
| name | string | Account name |
| string | Customer email address | |
| routerData | object | Router-specific configuration data |
| customerName | string | Customer name |
| currentBalance | string | Current account balance |
| availableBalance | string | Available balance for transactions |
| ledgerBalance | string | Ledger balance (if provided by bank) |
| currency | string | Currency code |
| asOfDateTime | string | ISO8601 timestamp of balance inquiry |
For more details, see CreateAccountDto and BalanceInquiryDto, BalanceResponseDto definitions.