{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/trustly/main/json-schema/trustly-financial-institution-account-schema.json",
  "title": "FinancialInstitutionAccount",
  "description": "Financial Institution account",
  "x-generated": "2026-10-12",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/trustly-accounts-api-openapi.yml#/components/schemas/FinancialInstitutionAccount",
  "type": "object",
  "properties": {
    "nameOnAccount": {
      "type": "string",
      "minLength": 1,
      "description": "Account owner name."
    },
    "name": {
      "type": "string",
      "minLength": 1,
      "description": "Account name."
    },
    "type": {
      "$ref": "#/$defs/FinancialInstitutionAccountType",
      "description": "Financial Institution Account Type:\n * `-1`: Unknown\n * `0`: Other\n * `1`: Checking\n * `2`: Savings        \n"
    },
    "profile": {
      "$ref": "#/$defs/FinancialInstitutionAccountProfile",
      "description": "Financial Institution Account Profile:\n * `-1`: Unknown\n * `0`: Other\n * `1`: Personal\n * `2`: Business            \n"
    },
    "verification": {
      "$ref": "#/$defs/FinancialInstitutionAccountVerification"
    },
    "accountNumber": {
      "type": "string",
      "minLength": 1,
      "maxLength": 4,
      "description": "Last 4 digits of the bank account selected"
    },
    "routingNumber": {
      "type": "string",
      "minLength": 1,
      "maxLength": 17,
      "description": "Bank Routing Number provided by the selected account."
    },
    "iban": {
      "type": "string",
      "minLength": 1,
      "description": "IBAN (International Bank Account Number) is an internationally agreed system of identifying bank accounts across national borders"
    },
    "token": {
      "type": "string",
      "minLength": 1,
      "description": "Account token for the returned account. This can be used to identify duplicate bank accounts in your system."
    },
    "accountId": {
      "type": "string"
    },
    "providerId": {
      "type": "string"
    },
    "paymentProvider": {
      "$ref": "#/$defs/PaymentProvider"
    },
    "verified": {
      "type": "boolean",
      "description": "If true, the account is verified."
    },
    "country": {
      "$ref": "#/$defs/FinancialInstitutionAccountCountry",
      "description": "2-character ISO code of the country for the bank account that was selected. Currently only the US, CA, UK, DE, and AU are supported."
    }
  },
  "required": [
    "name",
    "type",
    "profile",
    "verification",
    "accountNumber",
    "token",
    "verified"
  ],
  "$defs": {
    "Address": {
      "type": "object",
      "properties": {
        "address1": {
          "type": "string",
          "minLength": 1,
          "description": "Address line 1 (e.g., street or PO Box)"
        },
        "address2": {
          "type": "string",
          "description": "Address line 2 (e.g., apartment, suite or unit number)"
        },
        "city": {
          "type": "string",
          "minLength": 1,
          "description": "City, district, town or village"
        },
        "state": {
          "type": "string",
          "minLength": 2,
          "description": "State, province or region code"
        },
        "zip": {
          "type": "string",
          "minLength": 5,
          "description": "ZIP or Postal Code"
        },
        "country": {
          "type": "string",
          "minLength": 2,
          "description": "2 character [ISO Country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)"
        }
      },
      "required": [
        "country"
      ],
      "description": "Valid mailing or billing address associated with the customer",
      "title": "Address"
    },
    "FinancialInstitutionAccountCountry": {
      "type": "string",
      "enum": [
        "US",
        "CA",
        "UK",
        "DE",
        "AU"
      ],
      "description": "2-character ISO code of the country for the bank account that was selected. Currently only the US, CA, UK, DE, and AU are supported.",
      "title": "FinancialInstitutionAccountCountry"
    },
    "FinancialInstitutionAccountProfile": {
      "type": "string",
      "enum": [
        "-1",
        "0",
        "1",
        "2"
      ],
      "description": "Financial Institution Account Profile:\n * `-1`: Unknown\n * `0`: Other\n * `1`: Personal\n * `2`: Business            \n",
      "title": "FinancialInstitutionAccountProfile"
    },
    "FinancialInstitutionAccountType": {
      "type": "string",
      "enum": [
        "-1",
        "0",
        "1",
        "2"
      ],
      "description": "Financial Institution Account Type:\n * `-1`: Unknown\n * `0`: Other\n * `1`: Checking\n * `2`: Savings        \n",
      "title": "FinancialInstitutionAccountType"
    },
    "FinancialInstitutionAccountVerification": {
      "type": "object",
      "properties": {
        "verified": {
          "type": "boolean",
          "description": "true if the account is verified; false otherwise."
        },
        "type": {
          "$ref": "#/$defs/FinancialInstitutionAccountVerificationType",
          "description": "Verification Type:\n * `1`: Manual - The account was verified with manual account verification. For example, Manual Electronic Check and Micro Challenge Deposit.\n * `2`: Online Banking verification\t- The Account was verified using the Trustly Online Banking application.\n * `3`: Database verification\t- The Account was verified using the Trustly database or a Third-Party Service.  \n"
        },
        "hasEnoughFunds": {
          "type": "boolean",
          "description": "If true, there is enough balance in account."
        },
        "verificationDate": {
          "type": "integer",
          "description": "The date and time the verification was completed \n as a UNIX timestamp."
        },
        "score": {
          "$ref": "#/$defs/FinancialInstitutionAccountVerificationScore",
          "description": "Verification Score:\n * `0`: Invalid input. The account or routing number are invalid. (Verified Mapping = false)\n * `1`: There is a strong indication that the account is invalid. (Verified Mapping = false)\n * `2`: There are active non-bankable returns on this account that are less than 3 years old. (Verified Mapping = false)\n * `3`: There are administrative returns on this account. (Verified Mapping = false)\n * `4`: The format appears to be suspicious. (Verified Mapping = false)\n * `5`: There is no data on this account or format. (Verified Mapping = false)\n * `6`: We have not seen this account, but the format appears to be valid. (Verified Mapping = true)\n * `7`: We have seen this account but have not received a final disposition on the transaction. (Verified Mapping = true)\n * `8`: We have seen this account, but not in the last 6 months, and have seen no returns associated with the account. (Verified Mapping = true)\n * `9`: We have seen this account in the last 6 months and have seen no returns associated with the account. (Verified Mapping = true)\n * `10`: This account has been directly validated with/by the financial institution or 3rd party. We have the highest confidence that this account is valid. (Verified Mapping = true)\n"
        },
        "thirdPartyScore": {
          "$ref": "#/$defs/FinancialInstitutionAccountVerificationThirdPartyScore",
          "description": "Verification Third-Party Score:\n * `0`: Failed RT validation. (Verified Mapping = 0)\n * `100`: The supplier has a strong indication that this account is invalid. (Verified Mapping = 1)\n * `200`: The supplier has active non-bankable debt(s) on this account that are less than 3 years old. (Verified Mapping = 2)\n * `300`: The supplier has administrative returns on this account. (Verified Mapping = 3)\n * `400`: The supplier does not have Neg data on this account, but the format appears to be suspicious. (Verified Mapping = 4)\n * `500`: The supplier does not have data on this account or format. (Verified Mapping = 5)\n * `600`: The supplier has not seen this account, but the format appears valid. (Verified Mapping = 6)\n * `700`: The supplier has seen this account, but did not receive a final disposition on the transaction. (Verified Mapping = 7)\n * `800`: The supplier has seen this account, but not in the last 6 months. (Verified Mapping = 8)\n * `900`: The supplier has seen this account in the last 6 months. (Verified Mapping = 9)\n * `999`: The supplier has the highest confidence that this account is valid. (Verified Mapping = 10)\n"
        },
        "numberOfTries": {
          "type": "number",
          "format": "double",
          "description": "Number of tries allowed."
        },
        "numberOfAttemptsLeft": {
          "type": "number",
          "format": "double",
          "description": "Number of remaining attempts."
        }
      },
      "required": [
        "verified",
        "type",
        "hasEnoughFunds",
        "verificationDate"
      ],
      "title": "FinancialInstitutionAccountVerification"
    },
    "FinancialInstitutionAccountVerificationScore": {
      "type": "string",
      "enum": [
        "0",
        "1",
        "2",
        "3",
        "4",
        "5",
        "6",
        "7",
        "8",
        "9",
        "10"
      ],
      "description": "Verification Score:\n * `0`: Invalid input. The account or routing number are invalid. (Verified Mapping = false)\n * `1`: There is a strong indication that the account is invalid. (Verified Mapping = false)\n * `2`: There are active non-bankable returns on this account that are less than 3 years old. (Verified Mapping = false)\n * `3`: There are administrative returns on this account. (Verified Mapping = false)\n * `4`: The format appears to be suspicious. (Verified Mapping = false)\n * `5`: There is no data on this account or format. (Verified Mapping = false)\n * `6`: We have not seen this account, but the format appears to be valid. (Verified Mapping = true)\n * `7`: We have seen this account but have not received a final disposition on the transaction. (Verified Mapping = true)\n * `8`: We have seen this account, but not in the last 6 months, and have seen no returns associated with the account. (Verified Mapping = true)\n * `9`: We have seen this account in the last 6 months and have seen no returns associated with the account. (Verified Mapping = true)\n * `10`: This account has been directly validated with/by the financial institution or 3rd party. We have the highest confidence that this account is valid. (Verified Mapping = true)\n",
      "title": "FinancialInstitutionAccountVerificationScore"
    },
    "FinancialInstitutionAccountVerificationThirdPartyScore": {
      "type": "string",
      "enum": [
        "0",
        "100",
        "200",
        "300",
        "400",
        "500",
        "600",
        "700",
        "800",
        "900",
        "999"
      ],
      "description": "Verification Third-Party Score:\n * `0`: Failed RT validation. (Verified Mapping = 0)\n * `100`: The supplier has a strong indication that this account is invalid. (Verified Mapping = 1)\n * `200`: The supplier has active non-bankable debt(s) on this account that are less than 3 years old. (Verified Mapping = 2)\n * `300`: The supplier has administrative returns on this account. (Verified Mapping = 3)\n * `400`: The supplier does not have Neg data on this account, but the format appears to be suspicious. (Verified Mapping = 4)\n * `500`: The supplier does not have data on this account or format. (Verified Mapping = 5)\n * `600`: The supplier has not seen this account, but the format appears valid. (Verified Mapping = 6)\n * `700`: The supplier has seen this account, but did not receive a final disposition on the transaction. (Verified Mapping = 7)\n * `800`: The supplier has seen this account, but not in the last 6 months. (Verified Mapping = 8)\n * `900`: The supplier has seen this account in the last 6 months. (Verified Mapping = 9)\n * `999`: The supplier has the highest confidence that this account is valid. (Verified Mapping = 10)\n",
      "title": "FinancialInstitutionAccountVerificationThirdPartyScore"
    },
    "FinancialInstitutionAccountVerificationType": {
      "type": "string",
      "enum": [
        "1",
        "2",
        "3"
      ],
      "description": "Verification Type:\n * `1`: Manual - The account was verified with manual account verification. For example, Manual Electronic Check and Micro Challenge Deposit.\n * `2`: Online Banking verification\t- The Account was verified using the Trustly Online Banking application.\n * `3`: Database verification\t- The Account was verified using the Trustly database or a Third-Party Service.  \n",
      "title": "FinancialInstitutionAccountVerificationType"
    },
    "PaymentProvider": {
      "type": "object",
      "properties": {
        "paymentProviderId": {
          "type": "string",
          "minLength": 1,
          "description": "A unique identifier for the Payment Provider."
        },
        "type": {
          "type": "number",
          "format": "double"
        },
        "name": {
          "type": "string",
          "minLength": 1,
          "description": "Name of the payment provider"
        },
        "instantPayoutAvailable": {
          "type": "boolean",
          "description": "Whether payment provider supports instant payout."
        },
        "subType": {
          "$ref": "#/$defs/PaymentProviderSubType",
          "description": "Financial Institution Account Type:\n * `1000`: Online Banking\n * `2000`: Manual Entry\n * `2001`: Manual Entry with Challenge Deposit\n"
        },
        "swift": {
          "type": "string"
        },
        "address": {
          "$ref": "#/$defs/Address"
        },
        "country": {
          "$ref": "#/$defs/PaymentProviderCountry",
          "description": "2-letter ISO country code of the financial institution"
        },
        "instantPayment": {
          "type": "boolean"
        }
      },
      "required": [
        "name"
      ],
      "description": "Details of the Financial institution",
      "title": "PaymentProvider"
    },
    "PaymentProviderCountry": {
      "type": "string",
      "enum": [
        "US",
        "CA",
        "UK",
        "DE",
        "AU"
      ],
      "description": "2-letter ISO country code of the financial institution",
      "title": "PaymentProviderCountry"
    },
    "PaymentProviderSubType": {
      "type": "string",
      "enum": [
        "1000",
        "2000",
        "2001"
      ],
      "description": "Financial Institution Account Type:\n * `1000`: Online Banking\n * `2000`: Manual Entry\n * `2001`: Manual Entry with Challenge Deposit\n",
      "title": "PaymentProviderSubType"
    }
  }
}