Bank Statements API

Bank Statements API

The Bank Statements API enables you to fetch and create bank statements with period-based grouping and reconciliation status tracking. Bank statements include transaction details, balance information, and reconciliation status indicators.

Available Endpoints

Get Bank Statements by Period

GET /api/v2/banking/bank-statements/by-period

Retrieve bank statements grouped by specified time interval (day, month, year). Each statement includes transaction counts, balance information, and reconciliation status.

Query Parameters

Parameter Type Required Description
bank_account_id integer Yes ID of the bank account
interval string Yes Time interval for grouping. See Interval Values
from_date string Yes Start date (YYYY-MM-DD)
to_date string Yes End date (YYYY-MM-DD)

Interval Values

Value Description
day Group transactions by day
month Group transactions by calendar month
year Group transactions by calendar year

Example Request

GET /api/v2/banking/bank-statements/by-period?bank_account_id=123&interval=month&from_date=2024-01-01&to_date=2024-03-31

Example Response

{
  "data": [
    {
      "bank_account_id": 123,
      "period_start": "2024-01-01",
      "period_end": "2024-01-31",
      "period_start_balance": "10000.00",
      "period_end_balance": "12500.00",
      "total_transactions": 45,
      "reconciled_transactions": 42,
      "unreconciled_transactions": 3,
      "is_reconciled": false,
      "is_balanced": true,
      "import_documents": [
        {
          "id": 456,
          "document_type": "BANK_STATEMENT",
          "document_date": "2024-01-31",
          "document_number": "BS-2024-01"
        }
      ]
    }
  ]
}

Create Bank Statement

POST /api/v2/banking/bank-statements

Create a new bank statement with transactions and balance information. The endpoint validates transaction matching and balance consistency.

Request Body

{
  "bank_account_id": 123,
  "period_start": "2024-01-01",
  "period_end": "2024-01-31",
  "period_start_balance": "10000.00",
  "period_end_balance": "12500.00",
  "transactions": [
    {
      "booking_date": "2024-01-15",
      "amount": "2500.00",
      "currency": "NOK",
      "memo": "Customer payment"
    }
  ]
}

Response

{
  "data": {
    "bank_account_id": 123,
    "period_start": "2024-01-01",
    "period_end": "2024-01-31",
    "period_start_balance": "10000.00",
    "period_end_balance": "12500.00",
    "total_transactions": 1,
    "reconciled_transactions": 0,
    "unreconciled_transactions": 1,
    "is_reconciled": false,
    "is_balanced": true
  }
}

Error Responses

Status Code Description
400 INVALID_REQUEST Missing required parameters or invalid date range
403 FORBIDDEN Bank account not accessible
422 VALIDATION_ERROR Invalid balance or transaction data

Relaterte artikler