{"openapi":"3.1.0","info":{"title":"GET /api/v1/credit/bank-feeds","version":"1.0.0","description":"Bank feeds"},"servers":[{"url":"https://api.ondayzero.com","description":"Production"}],"paths":{"/api/v1/credit/bank-feeds":{"get":{"tags":["credit"],"summary":"Bank feeds","description":"Every bank feed on your program business, newest first, optionally for one line, merchant id or merchant business.","operationId":"list_credit_bank_feeds","parameters":[{"name":"credit_line_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"One line's feeds.","title":"Credit Line Id"},"description":"One line's feeds."},{"name":"external_merchant_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"One merchant's feeds, by your id.","title":"External Merchant Id"},"description":"One merchant's feeds, by your id."},{"name":"merchant_business_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"One merchant business's feeds.","title":"Merchant Business Id"},"description":"One merchant business's feeds."},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_BankFeedListResponse_"}}}},"401":{"description":"Unauthorized - Missing or expired token, an MCP OAuth token used against the REST API, or no access to this business","content":{"application/json":{"example":{"error":"unauthorized","message":"Authentication required","code":"AUTH_001","request_id":"3f0e7c2a-9b4d-4e1a-8c6f-2d5b7a1e9c30"},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"error":"forbidden","message":"You don't have permission to access this resource","code":"AUTH_002","request_id":"3f0e7c2a-9b4d-4e1a-8c6f-2d5b7a1e9c30"},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"example":{"error":"validation_error","message":"Validation failed: amount: Input should be a valid integer","errors":{"amount":"Input should be a valid integer"},"code":"GEN_002","request_id":"3f0e7c2a-9b4d-4e1a-8c6f-2d5b7a1e9c30"}}}}},"x-fastapi-operation-id":"list_credit_bank_feeds_api_v1_credit_bank_feeds_get"}}},"components":{"schemas":{"BankFeedAccount":{"properties":{"account_id":{"type":"string","title":"Account Id","description":"The partner's account id (Stripe's fca_…)."},"institution_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Institution Name","description":"The bank."},"display_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Display Name","description":"The account's name."},"last4":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last4","description":"The last four digits."},"status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status","description":"Stripe's status for the account: active, ..."},"transactions":{"type":"integer","title":"Transactions","description":"Posted transactions DayZero holds for it.","default":0},"first_transaction_on":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"First Transaction On","description":"The earliest transaction's date."},"last_transaction_on":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Last Transaction On","description":"The latest transaction's date."},"balance_cents":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Balance Cents","description":"The latest reported current balance, in cents."},"balance_on":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Balance On","description":"The day that balance is for."},"skipped_reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Skipped Reason","description":"Why the account's data is not used: covered_by_plaid (the same account already reaches DayZero through Plaid, so taking it twice would count its money twice) or credit_account (a card, not cash)."}},"type":"object","required":["account_id"],"title":"BankFeedAccount","description":"One account in the feed. No numbers."},"BankFeedListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/BankFeedResponse"},"type":"array","title":"Items","description":"The feeds, newest first."}},"type":"object","title":"BankFeedListResponse","description":"Bank feeds on the program's business."},"BankFeedResponse":{"properties":{"id":{"type":"string","title":"Id","description":"The bank feed's id."},"status":{"type":"string","enum":["pending","active","error","removed"],"title":"Status","description":"pending: registered, first sync not finished. active: synced and kept current. error: the last sync failed (`last_error`); it is tried again. removed: no longer synced."},"created":{"type":"boolean","title":"Created","description":"False when the call returned the feed already registered.","default":false},"provider":{"type":"string","title":"Provider","description":"stripe_fc_bigquery."},"app_id":{"type":"string","title":"App Id","description":"Your organisation id the dataset is named after."},"dataset":{"type":"string","title":"Dataset","description":"The BigQuery dataset read, project.dataset."},"program_id":{"type":"string","title":"Program Id","description":"The program the feed is under."},"credit_line_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Credit Line Id","description":"The line, if any."},"external_merchant_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"External Merchant Id","description":"Your id for the merchant."},"merchant_business_id":{"type":"string","title":"Merchant Business Id","description":"The merchant's DayZero business the data lands on: the `subject_business_id` for `POST /credit/underwriting/assessments`."},"merchant_business_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Merchant Business Name","description":"The merchant business's name."},"merchant_business_created":{"type":"boolean","title":"Merchant Business Created","description":"Whether registering this feed created the merchant's business.","default":false},"first_synced_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"First Synced At","description":"When the history first landed, UTC. Underwriting waits for it."},"last_synced_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Synced At","description":"The last successful sync, UTC."},"last_error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Error","description":"While status is error: not_shared (the dataset is not readable by DayZero's service account: grant it READER), not_found (no dataset for this app_id), not_configured, auth_failed, bigquery_error or sync_failed."},"last_error_detail":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Error Detail","description":"What the failing call said."},"latest_transaction_on":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Latest Transaction On","description":"The newest transaction's date across accounts."},"latest_balance_on":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Latest Balance On","description":"The newest reported balance's date."},"accounts":{"items":{"$ref":"#/components/schemas/BankFeedAccount"},"type":"array","title":"Accounts","description":"The accounts seen in the dataset."},"sandbox":{"type":"boolean","title":"Sandbox","description":"True on a sandbox program.","default":false},"created_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Created At","description":"When the feed was registered, UTC."}},"type":"object","required":["id","status","provider","app_id","dataset","program_id","merchant_business_id"],"title":"BankFeedResponse","description":"A merchant's bank feed and where it stands."},"SuccessEnvelope_BankFeedListResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/BankFeedListResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[BankFeedListResponse]"},"ErrorResponse":{"title":"ErrorResponse","type":"object","description":"Envelope returned by every non-2xx response. Branch on `code` (stable) rather than `message` (human-readable, may change).","required":["error","message","code"],"properties":{"error":{"type":"string","description":"Error category: `validation_error`, `unauthorized`, `forbidden`, `not_found`, `conflict`, `rate_limited`, `server_error`, or `service_unavailable`."},"message":{"type":"string","description":"Human-readable explanation, safe to show to end users."},"code":{"type":"string","description":"Stable machine-readable code in `CATEGORY_NNN` form (e.g. `NOT_FOUND_006`, `AUTH_010`, `GEN_002`)."},"request_id":{"type":"string","description":"Correlation id for support requests. Echoes the `x-request-id` request header when one was supplied."},"errors":{"type":"object","additionalProperties":{"type":"string"},"description":"Field-level validation messages keyed by field name. Present on 400/422 validation failures only."}}}},"securitySchemes":{"BearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"API Token","description":"API token authentication. Format: `Bearer dz_...`"}}},"security":[{"BearerAuth":[]}]}