Class: Lithic::Resources::AccountHolders

Inherits:
Object
  • Object
show all
Defined in:
lib/lithic/resources/account_holders.rb

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ AccountHolders

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of AccountHolders.



388
389
390
# File 'lib/lithic/resources/account_holders.rb', line 388

def initialize(client:)
  @client = client
end

Instance Method Details

#create(business_entity:, tos_timestamp:, workflow:, individual:, address:, email:, first_name:, kyc_exemption_type:, last_name:, phone_number:, beneficial_owner_individuals: nil, control_person: nil, nature_of_business: nil, beneficial_owner_entities: nil, external_id: nil, kyb_passed_timestamp: nil, website_url: nil, kyc_passed_timestamp: nil, business_account_token: nil, request_options: {}) ⇒ Lithic::Models::AccountHolderCreateResponse

Some parameter documentations has been truncated, see Models::AccountHolderCreateParams for more details.

Create an account holder and initiate the appropriate onboarding workflow. Account holders and accounts have a 1:1 relationship. When an account holder is successfully created an associated account is also created. All calls to this endpoint will return a synchronous response. The response time will depend on the workflow. In some cases, the response may indicate the workflow is under review or further action will be needed to complete the account creation process. This endpoint can only be used on accounts that are part of the program that the calling API key manages.



63
64
65
66
67
68
69
70
71
72
# File 'lib/lithic/resources/account_holders.rb', line 63

def create(params)
  parsed, options = Lithic::AccountHolderCreateParams.dump_request(params)
  @client.request(
    method: :post,
    path: "v1/account_holders",
    body: parsed,
    model: Lithic::Models::AccountHolderCreateResponse,
    options: {timeout: 300, **options}
  )
end

#list(begin_: nil, email: nil, end_: nil, ending_before: nil, external_id: nil, first_name: nil, last_name: nil, legal_business_name: nil, limit: nil, phone_number: nil, starting_after: nil, request_options: {}) ⇒ Lithic::Internal::SinglePage<Lithic::Models::AccountHolder>

Some parameter documentations has been truncated, see Models::AccountHolderListParams for more details.

Get a list of individual or business account holders and their KYC or KYB evaluation status.



194
195
196
197
198
199
200
201
202
203
204
# File 'lib/lithic/resources/account_holders.rb', line 194

def list(params = {})
  parsed, options = Lithic::AccountHolderListParams.dump_request(params)
  @client.request(
    method: :get,
    path: "v1/account_holders",
    query: parsed.transform_keys(begin_: "begin", end_: "end"),
    page: Lithic::Internal::SinglePage,
    model: Lithic::AccountHolder,
    options: options
  )
end

#list_documents(account_holder_token, request_options: {}) ⇒ Lithic::Models::AccountHolderListDocumentsResponse

Retrieve the status of account holder document uploads, or retrieve the upload URLs to process your image uploads.

Note that this is not equivalent to checking the status of the KYC evaluation overall (a document may be successfully uploaded but not be sufficient for KYC to pass).

In the event your upload URLs have expired, calling this endpoint will refresh them. Similarly, in the event a previous account holder document upload has failed, you can use this endpoint to get a new upload URL for the failed image upload.

When a new document upload is generated for a failed attempt, the response will show an additional entry in the ‘required_document_uploads` list in a `PENDING` state for the corresponding `image_type`.



231
232
233
234
235
236
237
238
# File 'lib/lithic/resources/account_holders.rb', line 231

def list_documents(, params = {})
  @client.request(
    method: :get,
    path: ["v1/account_holders/%1$s/documents", ],
    model: Lithic::Models::AccountHolderListDocumentsResponse,
    options: params[:request_options]
  )
end

#retrieve(account_holder_token, request_options: {}) ⇒ Lithic::Models::AccountHolder

Get an Individual or Business Account Holder and/or their KYC or KYB evaluation status.



86
87
88
89
90
91
92
93
# File 'lib/lithic/resources/account_holders.rb', line 86

def retrieve(, params = {})
  @client.request(
    method: :get,
    path: ["v1/account_holders/%1$s", ],
    model: Lithic::AccountHolder,
    options: params[:request_options]
  )
end

#retrieve_document(document_token, account_holder_token:, request_options: {}) ⇒ Lithic::Models::Document

Check the status of an account holder document upload, or retrieve the upload URLs to process your image uploads.

Note that this is not equivalent to checking the status of the KYC evaluation overall (a document may be successfully uploaded but not be sufficient for KYC to pass).

In the event your upload URLs have expired, calling this endpoint will refresh them. Similarly, in the event a document upload has failed, you can use this endpoint to get a new upload URL for the failed image upload.

When a new account holder document upload is generated for a failed attempt, the response will show an additional entry in the ‘required_document_uploads` array in a `PENDING` state for the corresponding `image_type`.



266
267
268
269
270
271
272
273
274
275
276
277
278
# File 'lib/lithic/resources/account_holders.rb', line 266

def retrieve_document(document_token, params)
  parsed, options = Lithic::AccountHolderRetrieveDocumentParams.dump_request(params)
   =
    parsed.delete(:account_holder_token) do
      raise ArgumentError.new("missing required path argument #{_1}")
    end
  @client.request(
    method: :get,
    path: ["v1/account_holders/%1$s/documents/%2$s", , document_token],
    model: Lithic::Document,
    options: options
  )
end

#simulate_enrollment_document_review(document_upload_token:, status:, accepted_entity_status_reasons: nil, status_reason: nil, request_options: {}) ⇒ Lithic::Models::Document

Some parameter documentations has been truncated, see Models::AccountHolderSimulateEnrollmentDocumentReviewParams for more details.

Simulates a review for an account holder document upload.



301
302
303
304
305
306
307
308
309
310
# File 'lib/lithic/resources/account_holders.rb', line 301

def simulate_enrollment_document_review(params)
  parsed, options = Lithic::AccountHolderSimulateEnrollmentDocumentReviewParams.dump_request(params)
  @client.request(
    method: :post,
    path: "v1/simulate/account_holders/enrollment_document_review",
    body: parsed,
    model: Lithic::Document,
    options: options
  )
end

#simulate_enrollment_review(account_holder_token: nil, status: nil, status_reasons: nil, request_options: {}) ⇒ Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse

Some parameter documentations has been truncated, see Models::AccountHolderSimulateEnrollmentReviewParams for more details.

Simulates an enrollment review for an account holder. This endpoint is only applicable for workflows that may required intervention such as ‘KYB_BASIC`.



331
332
333
334
335
336
337
338
339
340
# File 'lib/lithic/resources/account_holders.rb', line 331

def simulate_enrollment_review(params = {})
  parsed, options = Lithic::AccountHolderSimulateEnrollmentReviewParams.dump_request(params)
  @client.request(
    method: :post,
    path: "v1/simulate/account_holders/enrollment_review",
    body: parsed,
    model: Lithic::Models::AccountHolderSimulateEnrollmentReviewResponse,
    options: options
  )
end

#update(account_holder_token, beneficial_owner_entities: nil, beneficial_owner_individuals: nil, business_entity: nil, control_person: nil, external_id: nil, nature_of_business: nil, website_url: nil, individual: nil, address: nil, business_account_token: nil, email: nil, first_name: nil, last_name: nil, legal_business_name: nil, phone_number: nil, request_options: {}) ⇒ Lithic::Models::AccountHolderUpdateResponse::KYBKYCPatchResponse, Lithic::Models::AccountHolderUpdateResponse::PatchResponse

Some parameter documentations has been truncated, see Models::AccountHolderUpdateParams for more details.

Update the information associated with a particular account holder (including business owners and control persons associated to a business account). If Lithic is performing KYB or KYC and additional verification is required we will run the individual’s or business’s updated information again and return whether the status is accepted or pending (i.e., further action required). All calls to this endpoint will return a synchronous response. The response time will depend on the workflow. In some cases, the response may indicate the workflow is under review or further action will be needed to complete the account creation process. This endpoint can only be used on existing accounts that are part of the program that the calling API key manages.



148
149
150
151
152
153
154
155
156
157
# File 'lib/lithic/resources/account_holders.rb', line 148

def update(, params = {})
  parsed, options = Lithic::AccountHolderUpdateParams.dump_request(params)
  @client.request(
    method: :patch,
    path: ["v1/account_holders/%1$s", ],
    body: parsed,
    model: Lithic::Models::AccountHolderUpdateResponse,
    options: options
  )
end

#upload_document(account_holder_token, document_type:, entity_token:, request_options: {}) ⇒ Lithic::Models::Document

Use this endpoint to identify which type of supported government-issued documentation you will upload for further verification. It will return two URLs to upload your document images to - one for the front image and one for the back image.

This endpoint is only valid for evaluations in a ‘PENDING_DOCUMENT` state.

Uploaded images must either be a ‘jpg` or `png` file, and each must be less than 15 MiB. Once both required uploads have been successfully completed, your document will be run through KYC verification.

If you have registered a webhook, you will receive evaluation updates for any document submission evaluations, as well as for any failed document uploads.

Two document submission attempts are permitted via this endpoint before a ‘REJECTED` status is returned and the account creation process is ended. Currently only one type of account holder document is supported per KYC verification.



374
375
376
377
378
379
380
381
382
383
# File 'lib/lithic/resources/account_holders.rb', line 374

def upload_document(, params)
  parsed, options = Lithic::AccountHolderUploadDocumentParams.dump_request(params)
  @client.request(
    method: :post,
    path: ["v1/account_holders/%1$s/documents", ],
    body: parsed,
    model: Lithic::Document,
    options: options
  )
end