All notable changes to the codat Elixir package will be documented in this file.

The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.

Unreleased

0.1.0 - 2025-05-14

Added

Core Infrastructure

  • Codat.Client — typed client struct with full config validation via NimbleOptions
  • Codat.Config — merged configuration from app config, env vars, and runtime options
  • Codat.Error — structured error type with type, message, correlation_id, retry_after
  • Codat.Telemetry — telemetry events for all HTTP operations ([:codat, :request, :start/stop/exception])
  • Codat.QueryBuilder — composable query expression builder for Codat's filter language
  • Codat.Pagination — page struct, Stream-based lazy pagination, and concurrent fetch_all/2
  • Codat.APIuse macro that generates standard CRUD, streaming, and model-inspection functions

HTTP Client

  • Codat.HTTP.ClientReq + Finch based client with:
    • Base64 API key authentication
    • Exponential backoff retry with full jitter (configurable max_retries, retry_base_delay)
    • Rate-limit awareness: auto-pauses on 429 and retries after Retry-After header
    • Structured %Codat.Error{} on all failure paths
    • Telemetry events on every request

Platform API (Codat.Platform.*)

  • Companies — list, get, create, update, delete, stream, get_access_token
  • Connections — list, get, create, delete, unlink, get_authorization_url
  • APIKeys — list, create, delete
  • Webhooks — list, get, create, update, delete, enable, disable, messages
  • PushOperations — list, get, poll_until_done (with configurable polling interval and timeout)
  • DataStatus — get all, get for type, refresh all, refresh single type, pull operation history
  • Files — list, upload, download, download_all (zip)

Accounting API (Codat.Accounting.*)

  • Invoices — full CRUD + attachments, create/update model
  • Bills — full CRUD + attachments
  • Customers — full CRUD
  • Suppliers — full CRUD
  • Accounts — list, get, create
  • BankAccounts — list, get, create, update
  • BankTransactions — list, get, create
  • Payments — list, get, create
  • CreditNotes — full CRUD
  • BillPayments — list, get, create, delete
  • BillCreditNotes — full CRUD
  • JournalEntries — list, get, create, delete
  • Journals — list, get, create
  • Items — list, get, create
  • PurchaseOrders — full CRUD
  • Transfers — list, get, create
  • DirectCosts — list, get, create, delete
  • DirectIncomes — list, get, create
  • TaxRates — list, get
  • TrackingCategories — list, get
  • CompanyInfo — get, refresh
  • BalanceSheet — get with period options
  • ProfitAndLoss — get with period options
  • CashFlowStatement — get with period options

Bank Feeds API (Codat.BankFeeds.*)

  • SourceAccounts — list, get, create, update, delete, update_batch
  • Transactions — list, get, create
  • AccountMapping — get_options, set
  • Connections — get_info

Lending API (Codat.Lending.*)

  • AccountsReceivable — invoices, customers, payments, credit_notes
  • AccountsPayable — bills, suppliers, bill_payments
  • Banking — accounts, transactions, transaction_categories
  • FinancialStatements — balance_sheet, profit_and_loss, cash_flow_statement
  • DataIntegrity — status, summaries, details
  • ExcelReports — generate, status, download
  • CompanyInfo — get

Expenses API (Codat.Expenses.*)

  • Sync — initialize, list, get, complete, get_transaction_updates
  • Transactions — create, update
  • Accounts — list, get
  • Customers — list, get
  • Suppliers — list, get
  • TaxRates — list, get
  • TrackingCategories — list, get
  • Mappings — get_options

Bill Pay API (Codat.BillPay.*)

  • Bills — list, get, stream, fetch_all
  • Suppliers — list, get, stream, fetch_all
  • Payments — list, get, create, delete
  • Companies — get_mapping_options
  • Connections — get_info

Webhooks (Codat.Webhooks.*)

  • Verifier — Svix-compatible HMAC-SHA256 signature verification with replay protection
  • Plug — drop-in Plug for Phoenix/Plug apps with body caching, verification, and dispatch
  • BodyReaderPlug.Parsers body reader that preserves the raw body for signature verification
  • Handler@behaviour for implementing typed event handlers
  • NoOpHandler — log-and-ignore handler for dev/test
  • BroadcastHandler — PubSub broadcast handler (requires Phoenix.PubSub)
  • Dispatcher — macro-based event router supporting string, list, regex, and catch-all patterns
  • EventTypes — compile-time constants (macros) and runtime helpers for all event type strings
  • VerificationError — structured exception raised by verify!/4