{
 "openapi": "3.1.0",
 "info": {
  "title": "Bank Connections (Accounting)",
  "version": "20261030b",
  "description": "One configured integration with one bank — endpoint, credentials, file transfer, the identifiers the bank assigned, and how often to collect. Credentials are encrypted on the way in and never come back out."
 },
 "servers": [
  {
   "url": "https://{tenant}.tranxact.ai",
   "variables": {
    "tenant": {
     "default": "demo"
    }
   }
  }
 ],
 "components": {
  "securitySchemes": {
   "bearer": {
    "type": "http",
    "scheme": "bearer"
   }
  },
  "schemas": {
   "bank-connections": {
    "type": "object",
    "required": [
     "provider_id",
     "code",
     "name"
    ],
    "properties": {
     "id": {
      "type": "string",
      "format": "uuid",
      "description": "Id",
      "readOnly": true
     },
     "org_id": {
      "type": "string",
      "format": "uuid",
      "description": "Org id",
      "readOnly": true
     },
     "provider_id": {
      "type": "string",
      "format": "uuid",
      "description": "Bank"
     },
     "code": {
      "type": "string",
      "description": "Connection code"
     },
     "name": {
      "type": "string",
      "description": "Name"
     },
     "environment": {
      "type": "string",
      "description": "Environment",
      "enum": [
       "sandbox",
       "uat",
       "production"
      ]
     },
     "integration_type": {
      "type": "string",
      "description": "Channel"
     },
     "auth_method": {
      "type": "string",
      "description": "Authentication"
     },
     "base_url": {
      "type": "string",
      "description": "API endpoint"
     },
     "token_url": {
      "type": "string",
      "description": "OAuth token endpoint"
     },
     "client_id": {
      "type": "string",
      "description": "Client ID"
     },
     "client_secret_cipher": {
      "type": "string",
      "description": "Client secret cipher",
      "readOnly": true
     },
     "api_key_cipher": {
      "type": "string",
      "description": "Api key cipher",
      "readOnly": true
     },
     "scopes": {
      "type": "array",
      "items": {
       "type": "string"
      },
      "description": "Scopes"
     },
     "certificate_cipher": {
      "type": "string",
      "description": "Certificate cipher",
      "readOnly": true
     },
     "certificate_expires": {
      "type": "string",
      "format": "date",
      "description": "Certificate expires"
     },
     "sftp_host": {
      "type": "string",
      "description": "SFTP host"
     },
     "sftp_port": {
      "type": "integer",
      "description": "SFTP port"
     },
     "sftp_username": {
      "type": "string",
      "description": "SFTP username"
     },
     "sftp_key_cipher": {
      "type": "string",
      "description": "Sftp key cipher",
      "readOnly": true
     },
     "inbound_dir": {
      "type": "string",
      "description": "Inbound directory"
     },
     "outbound_dir": {
      "type": "string",
      "description": "Outbound directory"
     },
     "pgp_key_id": {
      "type": "string",
      "description": "PGP key id"
     },
     "company_id": {
      "type": "string",
      "description": "Bank-assigned company id"
     },
     "ach_company_id": {
      "type": "string",
      "description": "ACH company id"
     },
     "ach_company_name": {
      "type": "string",
      "description": "ACH company name"
     },
     "originator_id": {
      "type": "string",
      "description": "Originator id"
     },
     "division_code": {
      "type": "string",
      "description": "Division code"
     },
     "webhook_url": {
      "type": "string",
      "description": "Webhook URL"
     },
     "webhook_secret_cipher": {
      "type": "string",
      "description": "Webhook secret cipher",
      "readOnly": true
     },
     "notification_email": {
      "type": "string",
      "description": "Notification email"
     },
     "poll_interval_minutes": {
      "type": "integer",
      "description": "Collect every (minutes)"
     },
     "statement_format": {
      "type": "string",
      "description": "Statement format"
     },
     "payment_format": {
      "type": "string",
      "description": "Payment file format"
     },
     "auto_reconcile": {
      "type": "boolean",
      "description": "Match the feed automatically"
     },
     "auto_post": {
      "type": "boolean",
      "description": "Auto post"
     },
     "match_tolerance": {
      "type": "string",
      "format": "decimal",
      "description": "Amount tolerance"
     },
     "match_window_days": {
      "type": "integer",
      "description": "Date window (days)"
     },
     "platform_connection_id": {
      "type": "string",
      "format": "uuid",
      "description": "Platform connection"
     },
     "status": {
      "type": "string",
      "description": "Status"
     },
     "last_tested_at": {
      "type": "string",
      "format": "date-time",
      "description": "Last tested at",
      "readOnly": true
     },
     "last_test_ok": {
      "type": "boolean",
      "description": "Last test ok",
      "readOnly": true
     },
     "last_test_message": {
      "type": "string",
      "description": "Last test message",
      "readOnly": true
     },
     "last_sync_at": {
      "type": "string",
      "format": "date-time",
      "description": "Last sync at",
      "readOnly": true
     },
     "owner_id": {
      "type": "string",
      "format": "uuid",
      "description": "Owner"
     },
     "notes": {
      "type": "string",
      "description": "Notes"
     },
     "created_at": {
      "type": "string",
      "format": "date-time",
      "description": "Created at",
      "readOnly": true
     },
     "org_unit_id": {
      "type": "string",
      "format": "uuid",
      "description": "Org unit id",
      "readOnly": true
     },
     "link_session_id": {
      "type": "string",
      "format": "uuid",
      "description": "Link session id",
      "readOnly": true
     },
     "aggregator_id": {
      "type": "string",
      "format": "uuid",
      "description": "Aggregator id",
      "readOnly": true
     },
     "external_item_id": {
      "type": "string",
      "description": "External item id",
      "readOnly": true
     },
     "ofx_url": {
      "type": "string",
      "description": "Ofx url",
      "readOnly": true
     },
     "ofx_org": {
      "type": "string",
      "description": "Ofx org",
      "readOnly": true
     },
     "ofx_fid": {
      "type": "string",
      "description": "Ofx fid",
      "readOnly": true
     },
     "ofx_version": {
      "type": "integer",
      "description": "Ofx version",
      "readOnly": true
     },
     "ofx_app_id": {
      "type": "string",
      "description": "Ofx app id",
      "readOnly": true
     },
     "ofx_app_ver": {
      "type": "string",
      "description": "Ofx app ver",
      "readOnly": true
     },
     "ofx_user_id": {
      "type": "string",
      "description": "Ofx user id",
      "readOnly": true
     },
     "ofx_password_cipher": {
      "type": "string",
      "description": "Ofx password cipher",
      "readOnly": true
     },
     "ofx_client_uid": {
      "type": "string",
      "description": "Ofx client uid",
      "readOnly": true
     },
     "credential_stored_at": {
      "type": "string",
      "format": "date-time",
      "description": "Credential stored at",
      "readOnly": true
     },
     "credential_last_ok_at": {
      "type": "string",
      "format": "date-time",
      "description": "Credential last ok at",
      "readOnly": true
     },
     "credential_expires_at": {
      "type": "string",
      "format": "date-time",
      "description": "Credential expires at",
      "readOnly": true
     },
     "credential_status": {
      "type": "string",
      "description": "Credential status",
      "readOnly": true
     },
     "credential_message": {
      "type": "string",
      "description": "Credential message",
      "readOnly": true
     },
     "pulled_through": {
      "type": "string",
      "format": "date",
      "description": "Pulled through",
      "readOnly": true
     },
     "oauth_client_id": {
      "type": "string",
      "format": "uuid",
      "description": "Oauth client id",
      "readOnly": true
     },
     "oauth_access_cipher": {
      "type": "string",
      "description": "Oauth access cipher",
      "readOnly": true
     },
     "oauth_refresh_cipher": {
      "type": "string",
      "description": "Oauth refresh cipher",
      "readOnly": true
     },
     "oauth_expires_at": {
      "type": "string",
      "format": "date-time",
      "description": "Oauth expires at",
      "readOnly": true
     },
     "consent_expires_at": {
      "type": "string",
      "format": "date-time",
      "description": "Consent expires at",
      "readOnly": true
     },
     "data_api_base": {
      "type": "string",
      "description": "Data api base",
      "readOnly": true
     },
     "data_api_standard": {
      "type": "string",
      "description": "Data api standard",
      "readOnly": true
     },
     "xf_text_1": {
      "type": "string",
      "description": "Xf text 1",
      "readOnly": true
     },
     "xf_text_2": {
      "type": "string",
      "description": "Xf text 2",
      "readOnly": true
     },
     "xf_text_3": {
      "type": "string",
      "description": "Xf text 3",
      "readOnly": true
     },
     "xf_text_4": {
      "type": "string",
      "description": "Xf text 4",
      "readOnly": true
     },
     "xf_text_5": {
      "type": "string",
      "description": "Xf text 5",
      "readOnly": true
     },
     "xf_num_1": {
      "type": "string",
      "format": "decimal",
      "description": "Xf num 1",
      "readOnly": true
     },
     "xf_num_2": {
      "type": "string",
      "format": "decimal",
      "description": "Xf num 2",
      "readOnly": true
     },
     "xf_num_3": {
      "type": "string",
      "format": "decimal",
      "description": "Xf num 3",
      "readOnly": true
     },
     "xf_date_1": {
      "type": "string",
      "format": "date",
      "description": "Xf date 1",
      "readOnly": true
     },
     "xf_date_2": {
      "type": "string",
      "format": "date",
      "description": "Xf date 2",
      "readOnly": true
     },
     "created_by": {
      "type": "string",
      "format": "uuid",
      "description": "Created by",
      "readOnly": true
     },
     "updated_at": {
      "type": "string",
      "format": "date-time",
      "description": "Updated at",
      "readOnly": true
     },
     "updated_by": {
      "type": "string",
      "format": "uuid",
      "description": "Updated by",
      "readOnly": true
     }
    }
   }
  }
 },
 "security": [
  {
   "bearer": []
  }
 ],
 "paths": {
  "/api/accounting/bank-connections": {
   "get": {
    "summary": "list bank-connections",
    "operationId": "list_bank_connections_0_4",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   },
   "post": {
    "summary": "create bank-connections",
    "operationId": "create_bank_connections_1_4",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/accounting/bank-connections/{id}": {
   "get": {
    "summary": "get bank-connections",
    "operationId": "get_bank_connections_0_5",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   },
   "put": {
    "summary": "change bank-connections",
    "operationId": "change_bank_connections_1_5",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   },
   "delete": {
    "summary": "delete bank-connections",
    "operationId": "delete_bank_connections_2_5",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/accounting/bank-connections/{id}/copy": {
   "post": {
    "summary": "Copy",
    "operationId": "action_bank_connections_0_6",
    "description": "Body keys: overrides, preview, withLines",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/accounting/bank-connections/{id}/credentials": {
   "put": {
    "summary": "Credentials",
    "operationId": "action_bank_connections_0_6",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/accounting/bank-connections/{id}/test": {
   "post": {
    "summary": "Test",
    "operationId": "action_bank_connections_0_6",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/accounting/bank-connections/{id}/transactions": {
   "post": {
    "summary": "Transactions",
    "operationId": "action_bank_connections_0_6",
    "description": "Body keys: accountId, externalAccountId, transactions*",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/accounting/bank-connections/{id}/webhook": {
   "post": {
    "summary": "Webhook",
    "operationId": "action_bank_connections_0_6",
    "description": "Body keys: signature, payload",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/accounting/bank-connections/{id}/sync": {
   "post": {
    "summary": "Sync",
    "operationId": "action_bank_connections_0_6",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/accounting/bank-connections/{id}/direct-connect": {
   "put": {
    "summary": "Direct connect",
    "operationId": "action_bank_connections_0_6",
    "description": "Body keys: userId, credential, ofxUrl, ofxOrg, ofxFid, ofxVersion",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/accounting/bank-connections/{id}/pull": {
   "post": {
    "summary": "Pull",
    "operationId": "action_bank_connections_0_6",
    "description": "Body keys: from, overlapDays",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/accounting/bank-connections/{id}/direct-accounts": {
   "get": {
    "summary": "Direct accounts",
    "operationId": "action_bank_connections_0_6",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   },
   "post": {
    "summary": "Direct accounts",
    "operationId": "action_bank_connections_1_6",
    "description": "Body keys: accounts",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/accounting/bank-connections/{id}/oauth/refresh": {
   "post": {
    "summary": "Oauth refresh",
    "operationId": "action_bank_connections_0_7",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  }
 }
}