Skip to content

@mbanq/core-sdk-js v0.50.0


@mbanq/core-sdk-js / commands / AddChargeToLoanAccount

Function: AddChargeToLoanAccount()

AddChargeToLoanAccount(loanAccountId, data): Command<{ data: { amount: number; chargeId: number; dateFormat?: string; dueDate?: string; locale: string; }; loanAccountId: number; }, { clientId: number; id: number; loanId: number; officeId: number; resourceId: number; }>

Defined in: src/commands/rest/charge.ts:130

Add a charge to a loan account

This endpoint allows adding an existing charge to a specified loan account. It is typically used to apply fees, penalties, or other charges to a loan account.

Parameters

loanAccountId

number

The ID of the loan account

data

The charge parameters

amount

number = ...

chargeId

number = ...

dateFormat?

string = ...

dueDate?

string = ...

locale

string = ...

Returns

Command<{ data: { amount: number; chargeId: number; dateFormat?: string; dueDate?: string; locale: string; }; loanAccountId: number; }, { clientId: number; id: number; loanId: number; officeId: number; resourceId: number; }>

Command object for adding a charge to a loan account

Example

typescript
import { AddChargeToLoanAccount } from '@mbanq/core-sdk';

const command = AddChargeToLoanAccount(10003, {
  chargeId: 1,
  amount: 10.5,
  dueDate: '01 January 2024',
  dateFormat: 'dd MMMM yyyy',
  locale: 'en'
});

const result = await client.request(command);
console.log(result.resourceId); // 456

Released under the MIT License.