To read bank transactions through BankSync’s API, connect the bank, create a scoped workspace key, list banks and accounts, then request transactions for a bounded period and follow pagination. Before scheduling the job, make retries safe and make incomplete results visible.
This checklist is for your own workspace. A customer-installed product uses the app installation route. The first acceptance test is a small period you can compare with bank records—not simply an HTTP success response.
Build the smallest verifiable path
Choose one account and period
Use bank records you can independently compare. Keep the first output private.
Create a read-only credential
Give the script the scopes needed for its reads and store the secret outside source code.
Discover resource identifiers
List connections and accounts; use returned identifiers rather than example values.
Retrieve a bounded period
Follow the endpoint’s documented date filters and pagination until the requested window is complete.
Write records repeatably
Preserve source identity and make retries safe for your own destination.
Validate the result
Compare known transactions and a compatible opening-to-closing balance check.
Add scheduling and recovery
Only automate after the small path and its failure cases are understood.
Make a first read-only request
Create the key from the web app’s Developers panel with banks:read. Keep its secret in your environment as BANKSYNC_API_KEY; do not put it into source code or a workbook formula. Use a workspace with API-key access and a bank you have already connected.
The authentication guide documents the header. This single-line shell request lists your bank connections:
curl --fail --silent --show-error -H "X-API-Key: ${BANKSYNC_API_KEY}" 'https://api.banksync.io/v1/banks'
This is a request example, not a full importer. Read the returned connection IDs before proceeding.
Read connections, then accounts, then transactions
| Step | GET path under https://api.banksync.io | Use the result |
|---|---|---|
| List connections | /v1/banks | Choose the returned bank connection ID as bid |
| List that bank’s accounts | /v1/banks/{bid}/accounts | Choose the intended returned account ID as aid |
| Read a transaction period | /v1/banks/{bid}/accounts/{aid}/transactions | Pass from and to date filters; follow the returned cursor |
| Read its balance separately | /v1/banks/{bid}/accounts/{aid}/balances | Inspect the snapshot freshness as well as the amount |
Replace {bid} and {aid} with identifiers returned by the earlier requests; they are not bank names or account numbers. The generated API reference defines the current parameters and response shapes.
Treat a reporting period as a unit of work
A month can span several response pages. Mark it complete only after every required page and account succeeds. If page three fails, the first two pages are partial evidence, not the full month.
Keep a checkpoint that identifies what has been committed. Commit records before advancing the checkpoint so a crash cannot skip data. Make repeated writes safe using the source record’s identity within its account and connection context. Choose the upsert or append strategy according to the actual provider semantics; do not assume every transaction is immutable.
Failure cases to test before scheduling
| Test | Expected result | Unsafe shortcut |
|---|---|---|
| The same page is processed twice | No second copy of accepted source records | Deduplicate solely by amount and merchant |
| One account fails | Report shows that account as incomplete | Treat failure as zero activity |
| Rate limit response | Wait according to the documented retry instruction | Retry in a tight loop |
| Permission is missing | Actionable error naming the access problem | Repeatedly reconnect the bank |
| Destination write fails | Checkpoint does not advance past uncommitted data | Mark the whole run complete anyway |
| New records arrive late | A controlled re-read can incorporate them | Assume yesterday’s data can never change |
Distinguish a key problem from a bank problem
BankSync documents separate errors for invalid credentials, insufficient permissions and rate limits. Its error-handling guide explains the cases and the Retry-After instruction for throttling. Use the returned error and context to select an action.
A credential failure is not fixed by hammering the transaction endpoint. A bank-consent problem is not solved by renaming a worksheet. Keep error handling close to the failing stage and show the operator what needs attention.
Log enough to diagnose a run: timestamp, requested period, affected account identifier, status and a request or job reference when available. Avoid logging authentication headers or full financial payloads by default.
Check meaning before adding automation
For a small fixture, include a purchase, credit, refund and transfer. Verify the currency and sign convention. Decide whether pending entries belong in the report and how the final posted version will be treated. A date field should have a documented meaning rather than being whichever timestamp happened to be easiest to parse.
Use decimal-safe monetary handling in your own application. Do not add different currencies into a single amount without an explicit conversion method and rate date. Keep raw amounts traceable even if a presentation layer displays rounded values.
Test an interrupted run by restarting it. The result should match a completed clean run under your chosen data rules. If it does not, fix recovery before increasing frequency.
Operate the workflow with a clear finish line
Schedule at a cadence justified by the reporting need and documented source behaviour. Spread requests when the workload exceeds the available rate budget. More keys are not automatically more capacity; the service’s limit may be shared at workspace level.
Give the operator a small run summary: accounts attempted, periods completed, records accepted and exceptions. A report should state when its inputs are incomplete instead of quietly presenting old and new records as one current view.
If most of the code is scheduling, field mapping and destination delivery, revisit whether a managed feed is the simpler owner of that work. Keep custom code for the behaviour your project actually needs.
For balances, the current endpoint distinguishes balanceAsOf from retrievedAt: the source snapshot time and the time BankSync retrieved it. A null source timestamp means freshness is unknown. Some reads can also come from a cache; the API reference documents Age and X-BankSync-Cache. Recording the time your script ran does not turn an older balance into a current one.
What should happen when I hit the rate limit?
Wait for the returned Retry-After interval and retry the failed request, rather than restarting the whole account loop. BankSync’s workspace API budget is shared across keys; generating another key is not a capacity fix. Scheduled BankSync feeds do not consume that API request budget. Consult the current rate-limit table before choosing polling frequency.
New to the terminology? Start with what open banking is and how it works.
