Class: ThePlaidApi::ConsumerReportUserIdentity

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

Overview

This field is only used by integrations created before December 10, 2025. All other integrations must use the ‘identity` object instead. For more details, see [new user APIs](plaid.com/docs/api/users/user-apis). To create a Plaid Check Consumer Report for a user when using a `user_token`, this field must be present. If this field is not provided during user token creation, you can add it to the user later by calling `/user/update`. Once the field has been added to the user, you will be able to call `/link/token/create` with a non-empty `consumer_report_permissible_purpose` (which will automatically create a Plaid Check Consumer Report), or call `/cra/check_report/create` for that user.

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(first_name:, last_name:, phone_numbers:, emails:, date_of_birth:, primary_address:, ssn_full: SKIP, ssn_last_4: SKIP, additional_properties: nil) ⇒ ConsumerReportUserIdentity

Returns a new instance of ConsumerReportUserIdentity.



93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
# File 'lib/the_plaid_api/models/consumer_report_user_identity.rb', line 93

def initialize(first_name:, last_name:, phone_numbers:, emails:,
               date_of_birth:, primary_address:, ssn_full: SKIP,
               ssn_last_4: SKIP, additional_properties: nil)
  # Add additional model properties to the instance
  additional_properties = {} if additional_properties.nil?

  @first_name = first_name
  @last_name = last_name
  @phone_numbers = phone_numbers
  @emails = emails
  @ssn_full = ssn_full unless ssn_full == SKIP
  @ssn_last_4 = ssn_last_4 unless ssn_last_4 == SKIP
  @date_of_birth = date_of_birth
  @primary_address = primary_address
  @additional_properties = additional_properties
end

Instance Attribute Details

#date_of_birthDate

To be provided in the format “yyyy-mm-dd”. This field is required for all Plaid Check customers.

Returns:

  • (Date)


56
57
58
# File 'lib/the_plaid_api/models/consumer_report_user_identity.rb', line 56

def date_of_birth
  @date_of_birth
end

#emailsArray[String]

The user’s emails

Returns:

  • (Array[String])


40
41
42
# File 'lib/the_plaid_api/models/consumer_report_user_identity.rb', line 40

def emails
  @emails
end

#first_nameString

The user’s first name

Returns:

  • (String)


23
24
25
# File 'lib/the_plaid_api/models/consumer_report_user_identity.rb', line 23

def first_name
  @first_name
end

#last_nameString

The user’s last name

Returns:

  • (String)


27
28
29
# File 'lib/the_plaid_api/models/consumer_report_user_identity.rb', line 27

def last_name
  @last_name
end

#phone_numbersArray[String]

The user’s phone number, in E.164 format: {countrycode}{number}. For example: “14157452130”. Phone numbers provided in other formats will be parsed on a best-effort basis. Phone number input is validated against valid number ranges; number strings that do not match a real-world phone numbering scheme may cause the request to fail, even in the Sandbox test environment.

Returns:

  • (Array[String])


36
37
38
# File 'lib/the_plaid_api/models/consumer_report_user_identity.rb', line 36

def phone_numbers
  @phone_numbers
end

#primary_addressAddressData

Data about the components comprising an address.

Returns:



60
61
62
# File 'lib/the_plaid_api/models/consumer_report_user_identity.rb', line 60

def primary_address
  @primary_address
end

#ssn_fullString

The user’s full social security number. This field should only be provided by lenders intending to share the resulting consumer report with a Government-Sponsored Enterprise (GSE), such as Fannie Mae or Freddie Mac. Format: “ddd-dd-dddd”

Returns:

  • (String)


47
48
49
# File 'lib/the_plaid_api/models/consumer_report_user_identity.rb', line 47

def ssn_full
  @ssn_full
end

#ssn_last_4String

The last 4 digits of the user’s social security number.

Returns:

  • (String)


51
52
53
# File 'lib/the_plaid_api/models/consumer_report_user_identity.rb', line 51

def ssn_last_4
  @ssn_last_4
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
# File 'lib/the_plaid_api/models/consumer_report_user_identity.rb', line 111

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  first_name = hash.key?('first_name') ? hash['first_name'] : nil
  last_name = hash.key?('last_name') ? hash['last_name'] : nil
  phone_numbers = hash.key?('phone_numbers') ? hash['phone_numbers'] : nil
  emails = hash.key?('emails') ? hash['emails'] : nil
  date_of_birth = hash.key?('date_of_birth') ? hash['date_of_birth'] : nil
  primary_address = AddressData.from_hash(hash['primary_address']) if hash['primary_address']
  ssn_full = hash.key?('ssn_full') ? hash['ssn_full'] : SKIP
  ssn_last_4 = hash.key?('ssn_last_4') ? hash['ssn_last_4'] : 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.
  ConsumerReportUserIdentity.new(first_name: first_name,
                                 last_name: last_name,
                                 phone_numbers: phone_numbers,
                                 emails: emails,
                                 date_of_birth: date_of_birth,
                                 primary_address: primary_address,
                                 ssn_full: ssn_full,
                                 ssn_last_4: ssn_last_4,
                                 additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



63
64
65
66
67
68
69
70
71
72
73
74
# File 'lib/the_plaid_api/models/consumer_report_user_identity.rb', line 63

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['first_name'] = 'first_name'
  @_hash['last_name'] = 'last_name'
  @_hash['phone_numbers'] = 'phone_numbers'
  @_hash['emails'] = 'emails'
  @_hash['ssn_full'] = 'ssn_full'
  @_hash['ssn_last_4'] = 'ssn_last_4'
  @_hash['date_of_birth'] = 'date_of_birth'
  @_hash['primary_address'] = 'primary_address'
  @_hash
end

.nullablesObject

An array for nullable fields



85
86
87
88
89
90
91
# File 'lib/the_plaid_api/models/consumer_report_user_identity.rb', line 85

def self.nullables
  %w[
    ssn_full
    ssn_last_4
    date_of_birth
  ]
end

.optionalsObject

An array for optional fields



77
78
79
80
81
82
# File 'lib/the_plaid_api/models/consumer_report_user_identity.rb', line 77

def self.optionals
  %w[
    ssn_full
    ssn_last_4
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



153
154
155
156
157
158
159
160
# File 'lib/the_plaid_api/models/consumer_report_user_identity.rb', line 153

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} first_name: #{@first_name.inspect}, last_name: #{@last_name.inspect},"\
  " phone_numbers: #{@phone_numbers.inspect}, emails: #{@emails.inspect}, ssn_full:"\
  " #{@ssn_full.inspect}, ssn_last_4: #{@ssn_last_4.inspect}, date_of_birth:"\
  " #{@date_of_birth.inspect}, primary_address: #{@primary_address.inspect},"\
  " additional_properties: #{@additional_properties}>"
end

#to_sObject

Provides a human-readable string representation of the object.



144
145
146
147
148
149
150
# File 'lib/the_plaid_api/models/consumer_report_user_identity.rb', line 144

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} first_name: #{@first_name}, last_name: #{@last_name}, phone_numbers:"\
  " #{@phone_numbers}, emails: #{@emails}, ssn_full: #{@ssn_full}, ssn_last_4: #{@ssn_last_4},"\
  " date_of_birth: #{@date_of_birth}, primary_address: #{@primary_address},"\
  " additional_properties: #{@additional_properties}>"
end