Class: ThePlaidApi::IdentityVerificationCreateRequest

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

Overview

Request schema for ‘/identity_verification/create`

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(is_shareable:, template_id:, gave_consent: false, client_user_id: SKIP, user_id: SKIP, user: SKIP, client_id: SKIP, secret: SKIP, is_idempotent: SKIP, additional_properties: nil) ⇒ IdentityVerificationCreateRequest

Returns a new instance of IdentityVerificationCreateRequest.



135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
# File 'lib/the_plaid_api/models/identity_verification_create_request.rb', line 135

def initialize(is_shareable:, template_id:, gave_consent: false,
               client_user_id: SKIP, user_id: SKIP, user: SKIP,
               client_id: SKIP, secret: SKIP, is_idempotent: SKIP,
               additional_properties: nil)
  # Add additional model properties to the instance
  additional_properties = {} if additional_properties.nil?

  @client_user_id = client_user_id unless client_user_id == SKIP
  @user_id = user_id unless user_id == SKIP
  @is_shareable = is_shareable
  @template_id = template_id
  @gave_consent = gave_consent
  @user = user unless user == SKIP
  @client_id = client_id unless client_id == SKIP
  @secret = secret unless secret == SKIP
  @is_idempotent = is_idempotent unless is_idempotent == SKIP
  @additional_properties = additional_properties
end

Instance Attribute Details

#client_idString

Your Plaid API ‘client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body.

Returns:

  • (String)


83
84
85
# File 'lib/the_plaid_api/models/identity_verification_create_request.rb', line 83

def client_id
  @client_id
end

#client_user_idString

A unique ID that identifies the end user in your system. Either a ‘user_id` or the `client_user_id` must be provided. This ID can also be used to associate user-specific data from other Plaid products. Financial Account Matching requires this field and the `/link/token/create` `client_user_id` to be consistent. Personally identifiable information, such as an email address or phone number, should not be used in the `client_user_id`.

Returns:

  • (String)


20
21
22
# File 'lib/the_plaid_api/models/identity_verification_create_request.rb', line 20

def client_user_id
  @client_user_id
end

A flag specifying whether the end user has already agreed to a privacy policy specifying that their data will be shared with Plaid for verification purposes. If ‘gave_consent` is set to `true`, the `accept_tos` step will be marked as `skipped` and the end user’s session will start at the next step requirement.

Returns:

  • (TrueClass | FalseClass)


49
50
51
# File 'lib/the_plaid_api/models/identity_verification_create_request.rb', line 49

def gave_consent
  @gave_consent
end

#is_idempotentTrueClass | FalseClass

An optional flag specifying how you would like Plaid to handle attempts to create an Identity Verification when an Identity Verification already exists for the provided ‘client_user_id` and `template_id`. If idempotency is enabled, Plaid will return the existing Identity Verification. If idempotency is disabled, Plaid will reject the request with a `400 Bad Request` status code if an Identity Verification already exists for the supplied `client_user_id` and `template_id`.

Returns:

  • (TrueClass | FalseClass)


98
99
100
# File 'lib/the_plaid_api/models/identity_verification_create_request.rb', line 98

def is_idempotent
  @is_idempotent
end

#is_shareableTrueClass | FalseClass

A flag specifying whether you would like Plaid to expose a shareable URL for the verification being created.

Returns:

  • (TrueClass | FalseClass)


35
36
37
# File 'lib/the_plaid_api/models/identity_verification_create_request.rb', line 35

def is_shareable
  @is_shareable
end

#secretString

Your Plaid API ‘secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body.

Returns:

  • (String)


88
89
90
# File 'lib/the_plaid_api/models/identity_verification_create_request.rb', line 88

def secret
  @secret
end

#template_idString

ID of the associated Identity Verification template. Like all Plaid identifiers, this is case-sensitive.

Returns:

  • (String)


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

def template_id
  @template_id
end

#userIdentityVerificationCreateRequestUser

User information collected outside of Link, most likely via your own onboarding process. Each of the following identity fields are optional: ‘email_address` `phone_number` `date_of_birth` `name` `address` `id_number` Specifically, these fields are optional in that they can either be fully provided (satisfying every required field in their subschema) or omitted from the request entirely by not providing the key or value. Providing these fields via the API will result in Link skipping the data collection process for the associated user. All verification steps enabled in the associated Identity Verification Template will still be run. Verification steps will either be run immediately, or once the user completes the `accept_tos` step, depending on the value provided to the `gave_consent` field. If you are not using the shareable URL feature, you can optionally provide these fields via `/link/token/create` instead; both `/identity_verification/create` and `/link/token/create` are valid ways to provide this information. Note that if you provide a non-`null` user data object via `/identity_verification/create`, any user data fields entered via `/link/token/create` for the same `client_user_id` will be ignored when prefilling Link.



77
78
79
# File 'lib/the_plaid_api/models/identity_verification_create_request.rb', line 77

def user
  @user
end

#user_idString

Unique user identifier, created by calling ‘/user/create`. Either a `user_id` or the `client_user_id` must be provided. The `user_id` may only be used instead of the `client_user_id` if you were not a pre-existing user of `/user/create` as of December 10, 2025; for more details, see [New User APIs](plaid.com/docs/api/users/user-apis). If both this field and a `client_user_id` are present in a request, the `user_id` must have been created from the provided `client_user_id`.

Returns:

  • (String)


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

def user_id
  @user_id
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
# File 'lib/the_plaid_api/models/identity_verification_create_request.rb', line 155

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  is_shareable = hash.key?('is_shareable') ? hash['is_shareable'] : nil
  template_id = hash.key?('template_id') ? hash['template_id'] : nil
  gave_consent = hash['gave_consent'] ||= false
  client_user_id =
    hash.key?('client_user_id') ? hash['client_user_id'] : SKIP
  user_id = hash.key?('user_id') ? hash['user_id'] : SKIP
  user = IdentityVerificationCreateRequestUser.from_hash(hash['user']) if hash['user']
  client_id = hash.key?('client_id') ? hash['client_id'] : SKIP
  secret = hash.key?('secret') ? hash['secret'] : SKIP
  is_idempotent = hash.key?('is_idempotent') ? hash['is_idempotent'] : 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.
  IdentityVerificationCreateRequest.new(is_shareable: is_shareable,
                                        template_id: template_id,
                                        gave_consent: gave_consent,
                                        client_user_id: client_user_id,
                                        user_id: user_id,
                                        user: user,
                                        client_id: client_id,
                                        secret: secret,
                                        is_idempotent: is_idempotent,
                                        additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



101
102
103
104
105
106
107
108
109
110
111
112
113
# File 'lib/the_plaid_api/models/identity_verification_create_request.rb', line 101

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['client_user_id'] = 'client_user_id'
  @_hash['user_id'] = 'user_id'
  @_hash['is_shareable'] = 'is_shareable'
  @_hash['template_id'] = 'template_id'
  @_hash['gave_consent'] = 'gave_consent'
  @_hash['user'] = 'user'
  @_hash['client_id'] = 'client_id'
  @_hash['secret'] = 'secret'
  @_hash['is_idempotent'] = 'is_idempotent'
  @_hash
end

.nullablesObject

An array for nullable fields



128
129
130
131
132
133
# File 'lib/the_plaid_api/models/identity_verification_create_request.rb', line 128

def self.nullables
  %w[
    user
    is_idempotent
  ]
end

.optionalsObject

An array for optional fields



116
117
118
119
120
121
122
123
124
125
# File 'lib/the_plaid_api/models/identity_verification_create_request.rb', line 116

def self.optionals
  %w[
    client_user_id
    user_id
    user
    client_id
    secret
    is_idempotent
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



200
201
202
203
204
205
206
207
# File 'lib/the_plaid_api/models/identity_verification_create_request.rb', line 200

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} client_user_id: #{@client_user_id.inspect}, user_id: #{@user_id.inspect},"\
  " is_shareable: #{@is_shareable.inspect}, template_id: #{@template_id.inspect},"\
  " gave_consent: #{@gave_consent.inspect}, user: #{@user.inspect}, client_id:"\
  " #{@client_id.inspect}, secret: #{@secret.inspect}, is_idempotent:"\
  " #{@is_idempotent.inspect}, additional_properties: #{@additional_properties}>"
end

#to_sObject

Provides a human-readable string representation of the object.



191
192
193
194
195
196
197
# File 'lib/the_plaid_api/models/identity_verification_create_request.rb', line 191

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} client_user_id: #{@client_user_id}, user_id: #{@user_id}, is_shareable:"\
  " #{@is_shareable}, template_id: #{@template_id}, gave_consent: #{@gave_consent}, user:"\
  " #{@user}, client_id: #{@client_id}, secret: #{@secret}, is_idempotent: #{@is_idempotent},"\
  " additional_properties: #{@additional_properties}>"
end