Skip to content

:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.

feat(data-warehouse): add fintoc transfer batches table (#126930)

Tom Owers383b22577db6
diff --git a/products/warehouse_sources/backend/temporal/data_imports/sources/COVERAGE_GAPS_APPENDIX.md b/products/warehouse_sources/backend/temporal/data_imports/sources/COVERAGE_GAPS_APPENDIX.md
index ab30eee85c14..02a76d3117a1 100644
--- a/products/warehouse_sources/backend/temporal/data_imports/sources/COVERAGE_GAPS_APPENDIX.md
+++ b/products/warehouse_sources/backend/temporal/data_imports/sources/COVERAGE_GAPS_APPENDIX.md
@@ -4693,6 +4693,7 @@ Diffed against: <https://docs.fintoc.com/_llms/v2026-02-01/en/api-reference.txt>
- [ ] `Entities (GET /v2/entities)` — group business accounts and transfer activity by legal account holder (medium)
- [ ] `Fiscal invoices and tax filings (GET /v1/invoices; GET /v1/tax_returns; GET /v1/tax_statements)` — analyze fiscal sales records and tax filings separately from recurring payment invoices (medium)
- [ ] `Payment links (GET /v1/payment_links)` — track requested payment amounts, link status, and collection activity across payment links (medium)
+- [x] `Transfer batches (GET /v2/transfer_batches)` — group outbound transfers by the Dashboard approval batch and track batch status and settled amounts (medium)
Note: The versioned vendor index and linked pages supplied embedded OpenAPI operations and object fields. Current accounts and movements use v1 open banking routes; business accounts and fiscal invoices are separate resources. Movement and payout reads require parent IDs; fiscal records require suitable link tokens and represent three grouped operations. Webhook configuration, token refresh, and uploads are excluded; source webhook updates do not create an event history table.
diff --git a/products/warehouse_sources/backend/temporal/data_imports/sources/fintoc/canonical_descriptions.py b/products/warehouse_sources/backend/temporal/data_imports/sources/fintoc/canonical_descriptions.py
index 6ad87742152f..ded24f1dc1c6 100644
--- a/products/warehouse_sources/backend/temporal/data_imports/sources/fintoc/canonical_descriptions.py
+++ b/products/warehouse_sources/backend/temporal/data_imports/sources/fintoc/canonical_descriptions.py
@@ -13,6 +13,19 @@ CANONICAL_DESCRIPTIONS: CanonicalDescriptions = {
"docs_url": "https://docs.fintoc.com/api/business-accounts-api/transfers/transfers-list",
"columns": {"id": "Transfer identifier.", "direction": "Whether the transfer is inbound or outbound."},
},
+ "transfer_batches": {
+ "description": "Batches of outbound transfers approved together in the Dashboard.",
+ "docs_url": "https://docs.fintoc.com/api/business-accounts-api/transfer-batches/transfer-batches-list",
+ "columns": {
+ "id": "Transfer batch identifier.",
+ "amount": "Total amount of the batch, in the smallest currency unit.",
+ "settled_amount": "Amount of the batch that has settled, in the smallest currency unit.",
+ "status": "Batch status: pending_authorization, rejected, expired, in_progress, succeeded, partially_succeeded, or failed.",
+ "transfer_count": "Number of transfers in the batch.",
+ "succeeded_count": "Number of transfers in the batch that succeeded.",
+ "created_at": "Time the batch was created.",
+ },
+ },
"refunds": {
"description": "Refunds of payments, including their disbursement status.",
"docs_url": "https://docs.fintoc.com/api/payments-api/refunds/refunds-list",
diff --git a/products/warehouse_sources/backend/temporal/data_imports/sources/fintoc/settings.py b/products/warehouse_sources/backend/temporal/data_imports/sources/fintoc/settings.py
index d837611fb4d8..fc3a13f4390f 100644
--- a/products/warehouse_sources/backend/temporal/data_imports/sources/fintoc/settings.py
+++ b/products/warehouse_sources/backend/temporal/data_imports/sources/fintoc/settings.py
@@ -42,6 +42,7 @@ ENDPOINTS: dict[str, FintocEndpoint] = {
"transfer.outbound.reversed",
),
),
+ "transfer_batches": FintocEndpoint(path="/v2/transfer_batches"),
"refunds": FintocEndpoint(
path="/v1/refunds",
page_size_param="per_page",
diff --git a/products/warehouse_sources/backend/temporal/data_imports/sources/fintoc/tests/test_fintoc.py b/products/warehouse_sources/backend/temporal/data_imports/sources/fintoc/tests/test_fintoc.py
index 881b8ac086ad..2c6dcac77bb8 100644
--- a/products/warehouse_sources/backend/temporal/data_imports/sources/fintoc/tests/test_fintoc.py
+++ b/products/warehouse_sources/backend/temporal/data_imports/sources/fintoc/tests/test_fintoc.py
@@ -61,6 +61,36 @@ def test_http_retry_classification(
manager.save_state.assert_not_called()
+ "name,path,page_size_param",
+ [("transfer_batches", "/v2/transfer_batches", "limit"), ("refunds", "/v1/refunds", "per_page")],
+)
+def test_top_level_endpoint_walks_link_pages_to_the_end(
+ http_mock: MagicMock,
+ manager: MagicMock,
+ inputs: MagicMock,
+ name: str,
+ path: str,
+ page_size_param: str,
+) -> None:
+ calls: list[tuple[str, dict[str, list[str]]]] = []
+
+ def respond(request: PreparedRequest) -> tuple[int, object, dict[str, str]]:
+ parts = urlsplit(request.url or "")
+ query = parse_qs(parts.query)
+ calls.append((parts.path, query))
+ if "starting_after" not in query:
+ return 200, [{"id": "first"}], {"Link": f'<https://api.fintoc.com{path}?starting_after=first>; rel="next"'}
+ return 200, [{"id": "last"}], {}
+
+ http_mock.side_effect = respond
+ result = FintocAPI("sk_test_example", "2026-02-01").source(name, [], inputs, manager)
+ rows = [row for page in cast(Iterable[Any], result.items()) for row in page]
+ assert rows == [{"id": "first"}, {"id": "last"}]
+ assert [call_path for call_path, _ in calls] == [path, path]
+ assert calls[0][1][page_size_param] == ["300"]
+
+
def test_movements_fanout_keeps_account_keys_and_tokens_private(
http_mock: MagicMock,
manager: MagicMock,