Class: ThePlaidApi::AccountIdentity
- Defined in:
- lib/the_plaid_api/models/account_identity.rb
Overview
Identity information about an account
Instance Attribute Summary collapse
-
#account_id ⇒ String
Plaid’s unique identifier for the account.
-
#balances ⇒ AccountBalance
A set of fields describing the balance for an account.
-
#holder_category ⇒ HolderCategory
Indicates the account’s categorization as either a personal or a business account.
-
#mask ⇒ String
The last 2-4 alphanumeric characters of either the account’s displayed mask or the account’s official account number.
-
#name ⇒ String
The name of the account, either assigned by the user or by the financial institution itself.
-
#official_name ⇒ String
The official name of the account as given by the financial institution.
-
#owners ⇒ Array[Owner]
Data returned by the financial institution about the account owner or owners.
-
#persistent_account_id ⇒ String
A unique and persistent identifier for accounts that can be used to trace multiple instances of the same account across different Items for depository accounts.
-
#subtype ⇒ AccountSubtype
See the [Account type schema](plaid.com/docs/api/accounts/#account-type-schema) for a full listing of account types and corresponding subtypes.
-
#type ⇒ AccountType
‘investment:` Investment account.
-
#verification_insights ⇒ VerificationInsights
Insights from performing database verification for the account.
-
#verification_name ⇒ String
The account holder name that was used for micro-deposit and/or database verification.
-
#verification_status ⇒ VerificationStatus5
Indicates an Item’s micro-deposit-based verification or database verification status.
Class Method Summary collapse
-
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
-
.names ⇒ Object
A mapping from model property names to API property names.
-
.nullables ⇒ Object
An array for nullable fields.
-
.optionals ⇒ Object
An array for optional fields.
Instance Method Summary collapse
-
#initialize(account_id:, balances:, mask:, name:, official_name:, type:, subtype:, owners:, verification_status: SKIP, verification_name: SKIP, verification_insights: SKIP, persistent_account_id: SKIP, holder_category: SKIP, additional_properties: nil) ⇒ AccountIdentity
constructor
A new instance of AccountIdentity.
-
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
-
#to_s ⇒ Object
Provides a human-readable string representation of the object.
Methods inherited from BaseModel
#check_for_conflict, #process_additional_properties, #process_array, #process_basic_value, #process_hash, #to_hash, #to_json
Constructor Details
#initialize(account_id:, balances:, mask:, name:, official_name:, type:, subtype:, owners:, verification_status: SKIP, verification_name: SKIP, verification_insights: SKIP, persistent_account_id: SKIP, holder_category: SKIP, additional_properties: nil) ⇒ AccountIdentity
Returns a new instance of AccountIdentity.
207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 |
# File 'lib/the_plaid_api/models/account_identity.rb', line 207 def initialize(account_id:, balances:, mask:, name:, official_name:, type:, subtype:, owners:, verification_status: SKIP, verification_name: SKIP, verification_insights: SKIP, persistent_account_id: SKIP, holder_category: SKIP, additional_properties: nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @account_id = account_id @balances = balances @mask = mask @name = name @official_name = official_name @type = type @subtype = subtype @verification_status = verification_status unless verification_status == SKIP @verification_name = verification_name unless verification_name == SKIP @verification_insights = verification_insights unless verification_insights == SKIP @persistent_account_id = persistent_account_id unless persistent_account_id == SKIP @holder_category = holder_category unless holder_category == SKIP @owners = owners @additional_properties = additional_properties end |
Instance Attribute Details
#account_id ⇒ String
Plaid’s unique identifier for the account. This value will not change unless Plaid can’t reconcile the account with the data returned by the financial institution. This may occur, for example, when the name of the account changes. If this happens a new ‘account_id` will be assigned to the account. The `account_id` can also change if the `access_token` is deleted and the same credentials that were used to generate that `access_token` are used to generate a new `access_token` on a later date. In that case, the new `account_id` will be different from the old `account_id`. If an account with a specific `account_id` disappears instead of changing, the account is likely closed. Closed accounts are not returned by the Plaid API. When using a CRA endpoint (an endpoint associated with Plaid Check Consumer Report, i.e. any endpoint beginning with `/cra/`), the `account_id` returned will not match the `account_id` returned by a non-CRA endpoint. Like all Plaid identifiers, the `account_id` is case sensitive.
30 31 32 |
# File 'lib/the_plaid_api/models/account_identity.rb', line 30 def account_id @account_id end |
#balances ⇒ AccountBalance
A set of fields describing the balance for an account. Balance information may be cached unless the balance object was returned by ‘/accounts/balance/get` or `/signal/evaluate` (using a Balance-only ruleset).
37 38 39 |
# File 'lib/the_plaid_api/models/account_identity.rb', line 37 def balances @balances end |
#holder_category ⇒ HolderCategory
Indicates the account’s categorization as either a personal or a business account. This field is currently in beta; to request access, contact your account manager.
151 152 153 |
# File 'lib/the_plaid_api/models/account_identity.rb', line 151 def holder_category @holder_category end |
#mask ⇒ String
The last 2-4 alphanumeric characters of either the account’s displayed mask or the account’s official account number. Note that the mask may be non-unique between an Item’s accounts.
43 44 45 |
# File 'lib/the_plaid_api/models/account_identity.rb', line 43 def mask @mask end |
#name ⇒ String
The name of the account, either assigned by the user or by the financial institution itself
48 49 50 |
# File 'lib/the_plaid_api/models/account_identity.rb', line 48 def name @name end |
#official_name ⇒ String
The official name of the account as given by the financial institution
52 53 54 |
# File 'lib/the_plaid_api/models/account_identity.rb', line 52 def official_name @official_name end |
#owners ⇒ Array[Owner]
Data returned by the financial institution about the account owner or owners. Only returned by Identity or Assets endpoints. For business accounts, the name reported may be either the name of the individual or the name of the business, depending on the institution; detecting whether the linked account is a business account is not currently supported. Multiple owners on a single account will be represented in the same ‘owner` object, not in multiple owner objects within the array. In API versions 2018-05-22 and earlier, the `owners` object is not returned, and instead identity information is returned in the top level `identity` object. For more details, see [Plaid API versioning](plaid.com/docs/api/versioning/#version-2019-05-29)
165 166 167 |
# File 'lib/the_plaid_api/models/account_identity.rb', line 165 def owners @owners end |
#persistent_account_id ⇒ String
A unique and persistent identifier for accounts that can be used to trace multiple instances of the same account across different Items for depository accounts. This field is currently supported only for Items at institutions that use Tokenized Account Numbers (i.e., Chase and PNC, and in May 2025 US Bank). Because these accounts have a different account number each time they are linked, this field may be used instead of the account number to uniquely identify an account across multiple Items for payments use cases, helping to reduce duplicate Items or attempted fraud. In Sandbox, this field is populated for TAN-based institutions (‘ins_56`, `ins_13`) as well as the OAuth Sandbox institution (`ins_127287`); in Production, it will only be populated for accounts at applicable institutions.
145 146 147 |
# File 'lib/the_plaid_api/models/account_identity.rb', line 145 def persistent_account_id @persistent_account_id end |
#subtype ⇒ AccountSubtype
See the [Account type schema](plaid.com/docs/api/accounts/#account-type-schema) for a full listing of account types and corresponding subtypes.
70 71 72 |
# File 'lib/the_plaid_api/models/account_identity.rb', line 70 def subtype @subtype end |
#type ⇒ AccountType
‘investment:` Investment account. In API versions 2018-05-22 and earlier, this type is called `brokerage` instead. `credit:` Credit card `depository:` Depository account `loan:` Loan account `other:` Non-specified account type See the [Account type schema](plaid.com/docs/api/accounts#account-type-schema) for a full listing of account types and corresponding subtypes.
64 65 66 |
# File 'lib/the_plaid_api/models/account_identity.rb', line 64 def type @type end |
#verification_insights ⇒ VerificationInsights
Insights from performing database verification for the account. Only returned for Auth Items using Database Auth.
130 131 132 |
# File 'lib/the_plaid_api/models/account_identity.rb', line 130 def verification_insights @verification_insights end |
#verification_name ⇒ String
The account holder name that was used for micro-deposit and/or database verification. Only returned for Auth Items created via micro-deposit or database verification. This name was manually-entered by the user during Link, unless it was otherwise provided via the ‘user.legal_name` request field in `/link/token/create` for the Link session that created the Item.
125 126 127 |
# File 'lib/the_plaid_api/models/account_identity.rb', line 125 def verification_name @verification_name end |
#verification_status ⇒ VerificationStatus5
Indicates an Item’s micro-deposit-based verification or database verification status. This field is only populated when using Auth and falling back to micro-deposit or database verification. Possible values are: ‘pending_automatic_verification`: The Item is pending automatic verification. `pending_manual_verification`: The Item is pending manual micro-deposit verification. Items remain in this state until the user successfully verifies the code. `automatically_verified`: The Item has successfully been automatically verified. `manually_verified`: The Item has successfully been manually verified. `verification_expired`: Plaid was unable to automatically verify the deposit within 7 calendar days and will no longer attempt to validate the Item. Users may retry by submitting their information again through Link. `verification_failed`: The Item failed manual micro-deposit verification because the user exhausted all 3 verification attempts. Users may retry by submitting their information again through Link. `unsent`: The Item is pending micro-deposit verification, but Plaid has not yet sent the micro-deposit. `database_insights_pending`: The Database Auth result is pending and will be available upon Auth request. `database_insights_fail`: The Item’s numbers have been verified using Plaid’s data sources and have signal for being invalid and/or have no signal for being valid. Typically this indicates that the routing number is invalid, the account number does not match the account number format associated with the routing number, or the account has been reported as closed or frozen. Only returned for Auth Items created via Database Auth. ‘database_insights_pass`: The Item’s numbers have been verified using Plaid’s data sources: the routing and account number match a routing and account number of an account recognized on the Plaid network, and the account is not known by Plaid to be frozen or closed. Only returned for Auth Items created via Database Auth. ‘database_insights_pass_with_caution`: The Item’s numbers have been verified using Plaid’s data sources and have some signal for being valid: the routing and account number were not recognized on the Plaid network, but the routing number is valid and the account number is a potential valid account number for that routing number. Only returned for Auth Items created via Database Auth. ‘database_matched`: (deprecated) The Item has successfully been verified using Plaid’s data sources. Only returned for Auth Items created via Database Match. ‘null` or empty string: Neither micro-deposit-based verification nor database verification are being used for the Item.
117 118 119 |
# File 'lib/the_plaid_api/models/account_identity.rb', line 117 def verification_status @verification_status end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 |
# File 'lib/the_plaid_api/models/account_identity.rb', line 232 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. account_id = hash.key?('account_id') ? hash['account_id'] : nil balances = AccountBalance.from_hash(hash['balances']) if hash['balances'] mask = hash.key?('mask') ? hash['mask'] : nil name = hash.key?('name') ? hash['name'] : nil official_name = hash.key?('official_name') ? hash['official_name'] : nil type = hash.key?('type') ? hash['type'] : nil subtype = hash.key?('subtype') ? hash['subtype'] : nil # Parameter is an array, so we need to iterate through it owners = nil unless hash['owners'].nil? owners = [] hash['owners'].each do |structure| owners << (Owner.from_hash(structure) if structure) end end owners = nil unless hash.key?('owners') verification_status = hash.key?('verification_status') ? hash['verification_status'] : SKIP verification_name = hash.key?('verification_name') ? hash['verification_name'] : SKIP verification_insights = VerificationInsights.from_hash(hash['verification_insights']) if hash['verification_insights'] persistent_account_id = hash.key?('persistent_account_id') ? hash['persistent_account_id'] : SKIP holder_category = hash.key?('holder_category') ? hash['holder_category'] : SKIP # Create a new hash for additional properties, removing known properties. new_hash = hash.reject { |k, _| names.value?(k) } additional_properties = APIHelper.get_additional_properties( new_hash, proc { |value| value } ) # Create object from extracted values. AccountIdentity.new(account_id: account_id, balances: balances, mask: mask, name: name, official_name: official_name, type: type, subtype: subtype, owners: owners, verification_status: verification_status, verification_name: verification_name, verification_insights: verification_insights, persistent_account_id: persistent_account_id, holder_category: holder_category, additional_properties: additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 |
# File 'lib/the_plaid_api/models/account_identity.rb', line 168 def self.names @_hash = {} if @_hash.nil? @_hash['account_id'] = 'account_id' @_hash['balances'] = 'balances' @_hash['mask'] = 'mask' @_hash['name'] = 'name' @_hash['official_name'] = 'official_name' @_hash['type'] = 'type' @_hash['subtype'] = 'subtype' @_hash['verification_status'] = 'verification_status' @_hash['verification_name'] = 'verification_name' @_hash['verification_insights'] = 'verification_insights' @_hash['persistent_account_id'] = 'persistent_account_id' @_hash['holder_category'] = 'holder_category' @_hash['owners'] = 'owners' @_hash end |
.nullables ⇒ Object
An array for nullable fields
198 199 200 201 202 203 204 205 |
# File 'lib/the_plaid_api/models/account_identity.rb', line 198 def self.nullables %w[ mask official_name subtype holder_category ] end |
.optionals ⇒ Object
An array for optional fields
187 188 189 190 191 192 193 194 195 |
# File 'lib/the_plaid_api/models/account_identity.rb', line 187 def self.optionals %w[ verification_status verification_name verification_insights persistent_account_id holder_category ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
300 301 302 303 304 305 306 307 308 309 |
# File 'lib/the_plaid_api/models/account_identity.rb', line 300 def inspect class_name = self.class.name.split('::').last "<#{class_name} account_id: #{@account_id.inspect}, balances: #{@balances.inspect}, mask:"\ " #{@mask.inspect}, name: #{@name.inspect}, official_name: #{@official_name.inspect}, type:"\ " #{@type.inspect}, subtype: #{@subtype.inspect}, verification_status:"\ " #{@verification_status.inspect}, verification_name: #{@verification_name.inspect},"\ " verification_insights: #{@verification_insights.inspect}, persistent_account_id:"\ " #{@persistent_account_id.inspect}, holder_category: #{@holder_category.inspect}, owners:"\ " #{@owners.inspect}, additional_properties: #{@additional_properties}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
289 290 291 292 293 294 295 296 297 |
# File 'lib/the_plaid_api/models/account_identity.rb', line 289 def to_s class_name = self.class.name.split('::').last "<#{class_name} account_id: #{@account_id}, balances: #{@balances}, mask: #{@mask}, name:"\ " #{@name}, official_name: #{@official_name}, type: #{@type}, subtype: #{@subtype},"\ " verification_status: #{@verification_status}, verification_name: #{@verification_name},"\ " verification_insights: #{@verification_insights}, persistent_account_id:"\ " #{@persistent_account_id}, holder_category: #{@holder_category}, owners: #{@owners},"\ " additional_properties: #{@additional_properties}>" end |