{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/synci-io/json-schema/synci-io-update-financial-account-request-schema.json",
  "title": "UpdateFinancialAccountRequest",
  "x-generated": "2026-11-26",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/synci-io-openapi.yml#/components/schemas/UpdateFinancialAccountRequest",
  "type": "object",
  "properties": {
    "config": {
      "type": [
        "object",
        "null"
      ],
      "description": "The financial account's configuration",
      "properties": {
        "map_fields": {
          "type": [
            "object",
            "null"
          ],
          "description": "Which field(s) to use when mapping the \"payee\", \"description\" and \"date\" fields for a transaction.\nFor most cases, AUTO is the best option. Version 2 of the API replaces these fixed options with\nordered fallback chains; an account configured with a chain that has no equivalent here reads as AUTO.",
          "properties": {
            "payee": {
              "type": [
                "string",
                "null"
              ],
              "enum": [
                "AUTO",
                "NONE",
                "CREDITOR_NEGATIVE_DEBTOR_POSITIVE",
                "DEBTOR_NEGATIVE_CREDITOR_POSITIVE",
                "DEBTOR_NAME",
                "CREDITOR_NAME",
                "REMITTANCE_INFORMATION_STRUCTURED",
                "REMITTANCE_INFORMATION_UNSTRUCTURED",
                "REMITTANCE_INFORMATION_STRUCTURED_ARRAY",
                "REMITTANCE_INFORMATION_UNSTRUCTURED_ARRAY",
                "ADDITIONAL_INFORMATION",
                "ADDITIONAL_INFORMATION_STRUCTURED",
                "ADDITIONAL_DATA_STRUCTURED",
                null
              ]
            },
            "description": {
              "type": [
                "string",
                "null"
              ],
              "enum": [
                "AUTO",
                "NONE",
                "CREDITOR_NEGATIVE_DEBTOR_POSITIVE",
                "DEBTOR_NEGATIVE_CREDITOR_POSITIVE",
                "DEBTOR_NAME",
                "CREDITOR_NAME",
                "REMITTANCE_INFORMATION_STRUCTURED",
                "REMITTANCE_INFORMATION_UNSTRUCTURED",
                "REMITTANCE_INFORMATION_STRUCTURED_ARRAY",
                "REMITTANCE_INFORMATION_UNSTRUCTURED_ARRAY",
                "ADDITIONAL_INFORMATION",
                "ADDITIONAL_INFORMATION_STRUCTURED",
                "ADDITIONAL_DATA_STRUCTURED",
                null
              ]
            },
            "date": {
              "type": [
                "string",
                "null"
              ],
              "enum": [
                "AUTO",
                "BOOKING_DATE",
                "VALUE_DATE",
                null
              ]
            }
          }
        },
        "sync_start_date": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time",
          "description": "The date to start syncing transactions from. Cannot be earlier than the date the connection was authorized minus the connection's `max_historical_days`.\nWill default to today if not set."
        },
        "sync_auto": {
          "type": [
            "boolean",
            "null"
          ],
          "description": "Whether data should be synced automatically. If set to false, you will need to manually trigger a sync every time you want to refresh data."
        },
        "sync_pending_transactions": {
          "type": [
            "boolean",
            "null"
          ],
          "description": "Whether pending transactions should be synced. For some banks, setting this to true can cause duplicate transactions."
        },
        "pending_settlement_matching": {
          "type": [
            "boolean",
            "null"
          ],
          "description": "Whether a booked transaction can settle an existing pending transaction when the amount changed.\nCard pre-authorizations (fuel stations, hotels, car rentals) are often authorized with a placeholder amount\nthat changes when the transaction is booked, together with the transaction's identifiers.\nWhen enabled, a booked transaction that matches a pending transaction's counterparty (and card details,\nwhen the bank provides them) within `pending_settlement_max_days` days updates that pending transaction\ninstead of creating a duplicate.\nOnly pending transactions are matched this way; deduplication of booked transactions is unaffected.\nEnabled by default."
        },
        "pending_settlement_max_days": {
          "type": [
            "integer",
            "null"
          ],
          "description": "The maximum number of days between a pending transaction and its booked settlement\nfor `pending_settlement_matching` to link the two. Card settlements usually complete\nwithin a few days. Must be between 1 and 14. Defaults to 7.",
          "minimum": 1,
          "maximum": 14
        },
        "fuzzy_counterparty_matching": {
          "type": [
            "boolean",
            "null"
          ],
          "description": "Whether a counterparty name the bank re-words when a transaction settles can still match\nthe pending entry it replaces. Banks truncate the name to fit a fixed-width field and append\ndetail the pending entry never carried, so \"NORWEGIAN.COM\" can settle as \"NORWEGIAN.C 3284405123\".\nWhen the booked and pending copies of one transaction arrive in the same sync, that rename\nleaves the pending copy matching nothing and it is stored as a duplicate.\nWhen enabled, descriptors that align as a truncation or an extension of one another are\ntreated as the same counterparty, provided they align on at least `fuzzy_counterparty_min_chars`\ncharacters. Descriptors that conflict (`AMAZON 123` against `AMAZON 456`) never align.\nOnly pending transactions are matched this way; deduplication of booked transactions is unaffected.\nEnabled by default."
        },
        "fuzzy_counterparty_min_chars": {
          "type": [
            "integer",
            "null"
          ],
          "description": "The minimum number of characters two re-worded counterparty descriptors must align on for\n`fuzzy_counterparty_matching` to treat them as the same party. Raise it for banks whose\ndescriptors are short enough that distinct merchants collide. Must be between 1 and 60.\nDefaults to 6.",
          "minimum": 1,
          "maximum": 60
        },
        "sync_balances": {
          "type": [
            "boolean",
            "null"
          ],
          "description": "Whether balances should be synced."
        },
        "cleared_balance_type": {
          "anyOf": [
            {
              "description": "The balance type to read `balance.cleared` from: one of the types in the account's `balance.by_type`.\nFor cards that report the amount owed under a type other than the one Synci picks, such as `EXPECTED`.\n`null` goes back to the automatic order. The newest balance of this type is used; until the bank has\nreported one, the automatic order applies. `balance.available` is not affected.",
              "$ref": "#/$defs/BalanceTypeEnum"
            },
            {
              "type": "null"
            }
          ]
        },
        "sync_frequency_in_minutes": {
          "type": [
            "integer",
            "null"
          ],
          "description": "How often to sync data in minutes. The permitted minimum is set by the user's plan\n(`max_sync_frequency_minutes`); 30 is only the absolute lower bound any plan could set.",
          "minimum": 30,
          "maximum": 1440
        },
        "fields_for_duplicate_filtering": {
          "type": [
            "array",
            "null"
          ],
          "description": "An array of Transaction fields to use when filtering duplicate transactions.\nWhen a new transaction is synced, these fields are compared with existing transactions.\nIf the fields are identical, the new transaction is considered a duplicate and will be ignored.\nThis should only be used if you are struggling with duplicate transactions, and know which fields can be used to filter them. For everyone else, omit this field.",
          "items": {
            "type": "string",
            "enum": [
              "amount",
              "currency",
              "booked",
              "booking_date",
              "booking_datetime",
              "value_date",
              "value_datetime",
              "ultimate_debtor",
              "ultimate_creditor",
              "additional_data_structured",
              "additional_information",
              "additional_information_structured",
              "balance_after_transaction",
              "debtor.name",
              "debtor.bban",
              "debtor.iban",
              "debtor.pan",
              "debtor.masked_pan",
              "debtor.msisdn",
              "debtor.currency",
              "debtor.agent",
              "creditor.name",
              "creditor.bban",
              "creditor.iban",
              "creditor.id",
              "creditor.pan",
              "creditor.masked_pan",
              "creditor.msisdn",
              "creditor.currency",
              "creditor.agent",
              "remittance_information.structured",
              "remittance_information.unstructured",
              "remittance_information.structured_array",
              "remittance_information.unstructured_array",
              "codes.bank_transaction_code",
              "codes.merchant_category_code",
              "codes.proprietary_bank_transaction_code",
              "codes.purpose_code",
              "currency_exchange.source_currency",
              "currency_exchange.exchange_rate",
              "currency_exchange.unit_currency",
              "currency_exchange.target_currency",
              "currency_exchange.quotation_date",
              "currency_exchange.contract_identification",
              "external_identifiers.institution_transaction_id",
              "external_identifiers.integrator_transaction_id",
              "external_identifiers.end_to_end_id",
              "external_identifiers.entry_reference",
              "external_identifiers.check_id",
              "external_identifiers.mandate_id"
            ]
          }
        },
        "enrichment": {
          "type": "object",
          "properties": {
            "enabled": {
              "type": [
                "boolean",
                "null"
              ],
              "description": "Whether transaction enrichment is enabled"
            },
            "provider": {
              "anyOf": [
                {
                  "description": "The provider to use for transaction enrichment.",
                  "$ref": "#/$defs/EnrichmentProviderEnum"
                },
                {
                  "type": "null"
                }
              ]
            },
            "country": {
              "type": [
                "string",
                "null"
              ],
              "description": "The country where transactions are made. Providing a country significantly improves enrichment accuracy.",
              "minLength": 2,
              "maxLength": 2
            }
          }
        }
      }
    },
    "bic": {
      "type": [
        "string",
        "null"
      ],
      "description": "Institution Identifier Code (BIC/SWIFT code).",
      "maxLength": 255
    },
    "name": {
      "type": "string",
      "description": "Name of the account, as assigned by the financial institution.",
      "maxLength": 255
    },
    "custom_name": {
      "type": [
        "string",
        "null"
      ],
      "description": "Custom name for the account, as defined by the end user.",
      "maxLength": 255
    },
    "institution_name": {
      "type": [
        "string",
        "null"
      ],
      "description": "The lender's name on a manual account (\"Lånekassen\"). Omit to keep it, send null or blank to clear it. Provider accounts cannot set one.",
      "maxLength": 100
    },
    "display_name": {
      "type": [
        "string",
        "null"
      ],
      "description": "Name of the account as defined by the end user within online channels.",
      "maxLength": 255
    },
    "bban": {
      "type": "string",
      "description": "Basic Bank Account Number (BBAN). Must be provided if IBAN is not provided.",
      "maxLength": 255
    },
    "iban": {
      "type": "string",
      "description": "International Bank Account Number (IBAN). Must be provided if BBAN is not provided.",
      "maxLength": 255
    },
    "currency": {
      "type": [
        "string",
        "null"
      ],
      "description": "ISO 4217 currency code.",
      "pattern": "^[A-Z]{3}$",
      "minLength": 3,
      "maxLength": 3
    },
    "product_name": {
      "type": [
        "string",
        "null"
      ],
      "description": "Product Name of the Institution for this account, proprietary definition.",
      "maxLength": 255
    },
    "details": {
      "type": [
        "string",
        "null"
      ],
      "description": "Specifications that might be provided by the financial institution - characteristics of the account - characteristics of the relevant card.",
      "maxLength": 255
    },
    "owner_name": {
      "type": [
        "string",
        "null"
      ],
      "description": "Name of the legal account owner. If there is more than one owner, then e.g. two names might be noted here. For a corporate account, the corporate name is used for this attribute.",
      "maxLength": 255
    },
    "msisdn": {
      "type": [
        "string",
        "null"
      ],
      "description": "An alias to a payment account via a registered mobile phone number.",
      "maxLength": 255
    },
    "integrator_id": {
      "type": [
        "string",
        "null"
      ],
      "description": "The financial account ID provided by the integrator.",
      "maxLength": 255
    },
    "institution_id": {
      "type": [
        "string",
        "null"
      ],
      "description": "The financial account ID provided by the institution/bank.",
      "maxLength": 255
    }
  },
  "$defs": {
    "BalanceTypeEnum": {
      "type": "string",
      "enum": [
        "CLOSING_AVAILABLE",
        "CLOSING_BOOKED",
        "CLOSING_CLEARED",
        "EXPECTED",
        "FORWARD_AVAILABLE",
        "INTERIM_AVAILABLE",
        "INTERIM_CLEARED",
        "INFORMATION",
        "INTERIM_BOOKED",
        "NON_INVOICED",
        "OPENING_BOOKED",
        "OPENING_AVAILABLE",
        "OPENING_CLEARED",
        "PREVIOUSLY_CLOSED_BOOKED",
        "AUTHORISED",
        "OTHER"
      ],
      "title": "BalanceTypeEnum"
    },
    "EnrichmentProviderEnum": {
      "type": "string",
      "enum": [
        "NTROPY",
        "OPENAI",
        "GENIE",
        "ARRAY"
      ],
      "title": "EnrichmentProviderEnum"
    }
  }
}