Class: Lithic::Resources::FinancialAccounts::InterestTierSchedule

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

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ InterestTierSchedule

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

Parameters:



204
205
206
# File 'lib/lithic/resources/financial_accounts/interest_tier_schedule.rb', line 204

def initialize(client:)
  @client = client
end

Instance Method Details

#create(financial_account_token, credit_product_token:, effective_date:, penalty_rates: nil, tier_name: nil, tier_rates: nil, request_options: {}) ⇒ Lithic::Models::FinancialAccounts::FinancialAccountsInterestTierSchedule

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

Create a new interest tier schedule entry for a supported financial account

Parameters:

  • financial_account_token (String)

    Globally unique identifier for financial account

  • credit_product_token (String)

    Globally unique identifier for a credit product

  • effective_date (Date)

    Date the tier should be effective in YYYY-MM-DD format

  • penalty_rates (Object)

    Custom rates per category for penalties

  • tier_name (String)

    Name of a tier contained in the credit product. Mutually exclusive with tier_rat

  • tier_rates (Object)

    Custom rates per category. Mutually exclusive with tier_name

  • request_options (Lithic::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



32
33
34
35
36
37
38
39
40
41
# File 'lib/lithic/resources/financial_accounts/interest_tier_schedule.rb', line 32

def create(, params)
  parsed, options = Lithic::FinancialAccounts::InterestTierScheduleCreateParams.dump_request(params)
  @client.request(
    method: :post,
    path: ["v1/financial_accounts/%1$s/interest_tier_schedule", ],
    body: parsed,
    model: Lithic::FinancialAccounts::FinancialAccountsInterestTierSchedule,
    options: options
  )
end

#delete(effective_date, financial_account_token:, request_options: {}) ⇒ nil

Delete an interest tier schedule entry.

Returns:

  • 400 Bad Request: Invalid effective_date format OR attempting to delete the earliest tier schedule entry for a non-PENDING account

  • 404 Not Found: Tier schedule entry not found for the given effective_date OR ledger account not found

Note: PENDING accounts can delete the earliest tier schedule entry (account hasn’t opened yet). Active/non-PENDING accounts cannot delete the earliest entry to prevent orphaning the account.

If the deleted tier schedule has a past effective_date and the account is ACTIVE, the loan tape rebuild configuration will be updated to trigger rebuilds from that date.

Parameters:

  • effective_date (Date)

    Effective date in ISO format (YYYY-MM-DD)

  • financial_account_token (String)

    Globally unique identifier for financial account

  • request_options (Lithic::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

  • (nil)

See Also:



183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
# File 'lib/lithic/resources/financial_accounts/interest_tier_schedule.rb', line 183

def delete(effective_date, params)
  parsed, options = Lithic::FinancialAccounts::InterestTierScheduleDeleteParams.dump_request(params)
   =
    parsed.delete(:financial_account_token) do
      raise ArgumentError.new("missing required path argument #{_1}")
    end
  @client.request(
    method: :delete,
    path: [
      "v1/financial_accounts/%1$s/interest_tier_schedule/%2$s",
      ,
      effective_date
    ],
    model: NilClass,
    options: options
  )
end

#list(financial_account_token, after_date: nil, before_date: nil, for_date: nil, request_options: {}) ⇒ Lithic::Internal::SinglePage<Lithic::Models::FinancialAccounts::FinancialAccountsInterestTierSchedule>

List interest tier schedules for a financial account with optional date filtering.

If no date parameters are provided, returns all tier schedules. If date parameters are provided, uses filtering to return matching schedules (max 100).

  • for_date: Returns exact match (takes precedence over other dates)

  • before_date: Returns schedules with effective_date <= before_date

  • after_date: Returns schedules with effective_date >= after_date

  • Both before_date and after_date: Returns schedules in range

Parameters:

  • financial_account_token (String)

    Globally unique identifier for financial account

  • after_date (Date)

    Return schedules with effective_date >= after_date (ISO format YYYY-MM-DD)

  • before_date (Date)

    Return schedules with effective_date <= before_date (ISO format YYYY-MM-DD)

  • for_date (Date)

    Return schedule with effective_date == for_date (ISO format YYYY-MM-DD)

  • request_options (Lithic::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



142
143
144
145
146
147
148
149
150
151
152
153
# File 'lib/lithic/resources/financial_accounts/interest_tier_schedule.rb', line 142

def list(, params = {})
  parsed, options = Lithic::FinancialAccounts::InterestTierScheduleListParams.dump_request(params)
  query = Lithic::Internal::Util.encode_query_params(parsed)
  @client.request(
    method: :get,
    path: ["v1/financial_accounts/%1$s/interest_tier_schedule", ],
    query: query,
    page: Lithic::Internal::SinglePage,
    model: Lithic::FinancialAccounts::FinancialAccountsInterestTierSchedule,
    options: options
  )
end

#retrieve(effective_date, financial_account_token:, request_options: {}) ⇒ Lithic::Models::FinancialAccounts::FinancialAccountsInterestTierSchedule

Get a specific interest tier schedule by effective date

Parameters:

  • effective_date (Date)

    Effective date in ISO format (YYYY-MM-DD)

  • financial_account_token (String)

    Globally unique identifier for financial account

  • request_options (Lithic::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
# File 'lib/lithic/resources/financial_accounts/interest_tier_schedule.rb', line 56

def retrieve(effective_date, params)
  parsed, options = Lithic::FinancialAccounts::InterestTierScheduleRetrieveParams.dump_request(params)
   =
    parsed.delete(:financial_account_token) do
      raise ArgumentError.new("missing required path argument #{_1}")
    end
  @client.request(
    method: :get,
    path: [
      "v1/financial_accounts/%1$s/interest_tier_schedule/%2$s",
      ,
      effective_date
    ],
    model: Lithic::FinancialAccounts::FinancialAccountsInterestTierSchedule,
    options: options
  )
end

#update(effective_date, financial_account_token:, penalty_rates: nil, tier_name: nil, tier_rates: nil, request_options: {}) ⇒ Lithic::Models::FinancialAccounts::FinancialAccountsInterestTierSchedule

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

Update an existing interest tier schedule

Parameters:

  • effective_date (Date)

    Path param: Effective date in ISO format (YYYY-MM-DD)

  • financial_account_token (String)

    Path param: Globally unique identifier for financial account

  • penalty_rates (Object)

    Body param: Custom rates per category for penalties

  • tier_name (String)

    Body param: Name of a tier contained in the credit product. Mutually exclusive w

  • tier_rates (Object)

    Body param: Custom rates per category. Mutually exclusive with tier_name

  • request_options (Lithic::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
# File 'lib/lithic/resources/financial_accounts/interest_tier_schedule.rb', line 97

def update(effective_date, params)
  parsed, options = Lithic::FinancialAccounts::InterestTierScheduleUpdateParams.dump_request(params)
   =
    parsed.delete(:financial_account_token) do
      raise ArgumentError.new("missing required path argument #{_1}")
    end
  @client.request(
    method: :put,
    path: [
      "v1/financial_accounts/%1$s/interest_tier_schedule/%2$s",
      ,
      effective_date
    ],
    body: parsed,
    model: Lithic::FinancialAccounts::FinancialAccountsInterestTierSchedule,
    options: options
  )
end