Class: Increase::Resources::Entities

Inherits:
Object
  • Object
show all
Defined in:
lib/increase/resources/entities.rb,
sig/increase/resources/entities.rbs

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ Entities

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

Parameters:

API:

  • private



219
220
221
# File 'lib/increase/resources/entities.rb', line 219

def initialize(client:)
  @client = client
end

Instance Method Details

#archive(entity_id, request_options: {}) ⇒ Increase::Models::Entity

Archive an Entity

See Also:

Parameters:

  • The identifier of the Entity to archive. Any accounts associated with an entity must be closed before the entity can be archived.

Returns:



207
208
209
210
211
212
213
214
# File 'lib/increase/resources/entities.rb', line 207

def archive(entity_id, params = {})
  @client.request(
    method: :post,
    path: ["entities/%1$s/archive", entity_id],
    model: Increase::Entity,
    options: params[:request_options]
  )
end

#create(structure:, corporation: nil, description: nil, government_authority: nil, joint: nil, natural_person: nil, risk_rating: nil, sole_proprietorship: nil, supplemental_documents: nil, terms_agreements: nil, third_party_verification: nil, trust: nil, request_options: {}) ⇒ Increase::Models::Entity

Create an Entity

See Also:

Parameters:

  • The type of Entity to create.

  • Details of the corporation entity to create. Required if structure is equal to corporation.

  • The description you choose to give the entity.

  • Details of the Government Authority entity to create. Required if structure is equal to government_authority.

  • Details of the joint entity to create. Required if structure is equal to joint.

  • Details of the natural person entity to create. Required if structure is equal to natural_person. Natural people entities should be submitted with social_security_number or individual_taxpayer_identification_number identification methods.

  • An assessment of the entity's potential risk of involvement in financial crimes, such as money laundering.

  • Details of the sole proprietorship entity to create. Required if structure is equal to sole_proprietorship.

  • Additional documentation associated with the entity.

  • The terms that the Entity agreed to. Not all programs are required to submit this data.

  • If you are using a third-party service for identity verification, you can use this field to associate this Entity with the identifier that represents them in that service.

  • Details of the trust entity to create. Required if structure is equal to trust.

Returns:



61
62
63
64
65
66
67
68
69
70
# File 'lib/increase/resources/entities.rb', line 61

def create(params)
  parsed, options = Increase::EntityCreateParams.dump_request(params)
  @client.request(
    method: :post,
    path: "entities",
    body: parsed,
    model: Increase::Entity,
    options: options
  )
end

#list(created_at: nil, cursor: nil, idempotency_key: nil, limit: nil, status: nil, validation_status: nil, request_options: {}) ⇒ Increase::Internal::Page<Increase::Models::Entity>

List Entities

See Also:

Parameters:

  • Return the page of entries after this one.

  • Filter records to the one with the specified idempotency_key you chose for that object. This value is unique across Increase and is used to ensure that a request is only processed once. Learn more about idempotency.

  • Limit the size of the list that is returned. The default (and maximum) is 100 objects.

    Defaults to 100.

Returns:



181
182
183
184
185
186
187
188
189
190
191
192
# File 'lib/increase/resources/entities.rb', line 181

def list(params = {})
  parsed, options = Increase::EntityListParams.dump_request(params)
  query = Increase::Internal::Util.encode_query_params(parsed)
  @client.request(
    method: :get,
    path: "entities",
    query: query,
    page: Increase::Internal::Page,
    model: Increase::Entity,
    options: options
  )
end

#retrieve(entity_id, request_options: {}) ⇒ Increase::Models::Entity

Retrieve an Entity

See Also:

Parameters:

  • The identifier of the Entity to retrieve.

Returns:



83
84
85
86
87
88
89
90
# File 'lib/increase/resources/entities.rb', line 83

def retrieve(entity_id, params = {})
  @client.request(
    method: :get,
    path: ["entities/%1$s", entity_id],
    model: Increase::Entity,
    options: params[:request_options]
  )
end

#update(entity_id, corporation: nil, details_confirmed_at: nil, government_authority: nil, natural_person: nil, risk_rating: nil, sole_proprietorship: nil, terms_agreements: nil, third_party_verification: nil, trust: nil, request_options: {}) ⇒ Increase::Models::Entity

Update an Entity

See Also:

Parameters:

  • The entity identifier.

  • Details of the corporation entity to update. If you specify this parameter and the entity is not a corporation, the request will fail.

  • When your user last confirmed the Entity's details. Depending on your program, you may be required to affirmatively confirm details with your users on an annual basis.

  • Details of the government authority entity to update. If you specify this parameter and the entity is not a government authority, the request will fail.

  • Details of the natural person entity to update. If you specify this parameter and the entity is not a natural person, the request will fail.

  • An assessment of the entity’s potential risk of involvement in financial crimes, such as money laundering.

  • Details of the sole proprietorship entity to update. If you specify this parameter and the entity is not a sole proprietorship, the request will fail.

  • New terms that the Entity agreed to. Not all programs are required to submit this data. This will not archive previously submitted terms.

  • If you are using a third-party service for identity verification, you can use this field to associate this Entity with the identifier that represents them in that service.

  • Details of the trust entity to update. If you specify this parameter and the entity is not a trust, the request will fail.

Returns:



141
142
143
144
145
146
147
148
149
150
# File 'lib/increase/resources/entities.rb', line 141

def update(entity_id, params = {})
  parsed, options = Increase::EntityUpdateParams.dump_request(params)
  @client.request(
    method: :patch,
    path: ["entities/%1$s", entity_id],
    body: parsed,
    model: Increase::Entity,
    options: options
  )
end