Class: ThePlaidApi::AccountIdentityDocumentUpload

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/the_plaid_api/models/account_identity_document_upload.rb

Overview

Identity information about an account

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

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, documents: SKIP, additional_properties: nil) ⇒ AccountIdentityDocumentUpload

Returns a new instance of AccountIdentityDocumentUpload.



214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
# File 'lib/the_plaid_api/models/account_identity_document_upload.rb', line 214

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,
               documents: SKIP, additional_properties: nil)
  # Add additional model properties to the instance
  additional_properties = {} if additional_properties.nil?

  @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 =  unless  == SKIP
  @holder_category = holder_category unless holder_category == SKIP
  @owners = owners
  @documents = documents unless documents == SKIP
  @additional_properties = additional_properties
end

Instance Attribute Details

#account_idString

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.

Returns:

  • (String)


30
31
32
# File 'lib/the_plaid_api/models/account_identity_document_upload.rb', line 30

def 
  @account_id
end

#balancesAccountBalance

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).

Returns:



37
38
39
# File 'lib/the_plaid_api/models/account_identity_document_upload.rb', line 37

def balances
  @balances
end

#documentsArray[IdentityDocumentUpload]

Data about the documents that were uploaded as proof of account ownership.

Returns:



169
170
171
# File 'lib/the_plaid_api/models/account_identity_document_upload.rb', line 169

def documents
  @documents
end

#holder_categoryHolderCategory

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.

Returns:



151
152
153
# File 'lib/the_plaid_api/models/account_identity_document_upload.rb', line 151

def holder_category
  @holder_category
end

#maskString

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.

Returns:

  • (String)


43
44
45
# File 'lib/the_plaid_api/models/account_identity_document_upload.rb', line 43

def mask
  @mask
end

#nameString

The name of the account, either assigned by the user or by the financial institution itself

Returns:

  • (String)


48
49
50
# File 'lib/the_plaid_api/models/account_identity_document_upload.rb', line 48

def name
  @name
end

#official_nameString

The official name of the account as given by the financial institution

Returns:

  • (String)


52
53
54
# File 'lib/the_plaid_api/models/account_identity_document_upload.rb', line 52

def official_name
  @official_name
end

#ownersArray[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)

Returns:



165
166
167
# File 'lib/the_plaid_api/models/account_identity_document_upload.rb', line 165

def owners
  @owners
end

#persistent_account_idString

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.

Returns:

  • (String)


145
146
147
# File 'lib/the_plaid_api/models/account_identity_document_upload.rb', line 145

def 
  @persistent_account_id
end

#subtypeAccountSubtype

See the [Account type schema](plaid.com/docs/api/accounts/#account-type-schema) for a full listing of account types and corresponding subtypes.

Returns:



70
71
72
# File 'lib/the_plaid_api/models/account_identity_document_upload.rb', line 70

def subtype
  @subtype
end

#typeAccountType

‘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.

Returns:



64
65
66
# File 'lib/the_plaid_api/models/account_identity_document_upload.rb', line 64

def type
  @type
end

#verification_insightsVerificationInsights

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_document_upload.rb', line 130

def verification_insights
  @verification_insights
end

#verification_nameString

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.

Returns:

  • (String)


125
126
127
# File 'lib/the_plaid_api/models/account_identity_document_upload.rb', line 125

def verification_name
  @verification_name
end

#verification_statusVerificationStatus5

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.

Returns:



117
118
119
# File 'lib/the_plaid_api/models/account_identity_document_upload.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.



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
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
# File 'lib/the_plaid_api/models/account_identity_document_upload.rb', line 240

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
   = 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']
   =
    hash.key?('persistent_account_id') ? hash['persistent_account_id'] : SKIP
  holder_category =
    hash.key?('holder_category') ? hash['holder_category'] : SKIP
  # Parameter is an array, so we need to iterate through it
  documents = nil
  unless hash['documents'].nil?
    documents = []
    hash['documents'].each do |structure|
      documents << (IdentityDocumentUpload.from_hash(structure) if structure)
    end
  end

  documents = SKIP unless hash.key?('documents')

  # 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.
  AccountIdentityDocumentUpload.new(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: ,
                                    holder_category: holder_category,
                                    documents: documents,
                                    additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
# File 'lib/the_plaid_api/models/account_identity_document_upload.rb', line 172

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['documents'] = 'documents'
  @_hash
end

.nullablesObject

An array for nullable fields



204
205
206
207
208
209
210
211
212
# File 'lib/the_plaid_api/models/account_identity_document_upload.rb', line 204

def self.nullables
  %w[
    mask
    official_name
    subtype
    holder_category
    documents
  ]
end

.optionalsObject

An array for optional fields



192
193
194
195
196
197
198
199
200
201
# File 'lib/the_plaid_api/models/account_identity_document_upload.rb', line 192

def self.optionals
  %w[
    verification_status
    verification_name
    verification_insights
    persistent_account_id
    holder_category
    documents
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



319
320
321
322
323
324
325
326
327
328
329
# File 'lib/the_plaid_api/models/account_identity_document_upload.rb', line 319

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}, documents: #{@documents.inspect}, additional_properties:"\
  " #{@additional_properties}>"
end

#to_sObject

Provides a human-readable string representation of the object.



308
309
310
311
312
313
314
315
316
# File 'lib/the_plaid_api/models/account_identity_document_upload.rb', line 308

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},"\
  " documents: #{@documents}, additional_properties: #{@additional_properties}>"
end