@mbanq/core-sdk-js / commands / UpdateAccountProduct
Function: UpdateAccountProduct()
UpdateAccountProduct(
productId,params):Command<{params: {accountingRule?:number;allowOverdraft?:boolean;charges?:object[];currencyCode?:string;dateFormat?:string;defaultDifferentialRate?:string;description?:string;digitsAfterDecimal?:number;endDate?:string;enforceMinRequiredBalance?:boolean;feeToIncomeAccountMappings?:string;floatingRateId?:number;inMultiplesOf?:string;interestCalculationDaysInYearType?:number;interestCalculationType?:number;interestCompoundingPeriodType?:number;interestPostingPeriodType?:number;interestRateDifferential?:string;isDormancyTrackingActive?:boolean;isFloatingInterestRateCalculationAllowed?:boolean;isLinkedToFloatingInterestRates?:boolean;isLinkedWithFundSourceAccount?:boolean;isReservedProduct?:boolean;isUsedForSuspenseAccounting?:boolean;locale?:string;maxDifferentialRate?:string;minDifferentialRate?:string;minRequiredOpeningBalance?:string;name?:string;nominalAnnualInterestRate?:string;paymentChannelToFundSourceMappings?:string;penaltyToIncomeAccountMappings?:string;shortName?:string;skipCollectTransferCharge?:boolean;startDate?:string;withdrawalFeeForTransfers?:boolean;withHoldTax?:boolean; };productId:number; }, {changes?:Record<string,unknown>;id:string;resourceId:string; }>
Defined in: src/commands/rest/accountProduct.ts:139
Updates an existing savings account product.
Parameters
productId
number
The ID of the savings product to update
params
The account product update parameters (see UpdateAccountProductRequest)
accountingRule?
number = ...
allowOverdraft?
boolean = ...
charges?
object[] = ...
currencyCode?
string = ...
The currency code for the savings product
dateFormat?
string = ...
The date format string
defaultDifferentialRate?
string = ...
description?
string = ...
A brief description of the savings product
digitsAfterDecimal?
number = ...
The number of digits after the decimal point
endDate?
string = ...
enforceMinRequiredBalance?
boolean = ...
feeToIncomeAccountMappings?
string = ...
floatingRateId?
number = ...
inMultiplesOf?
string = ...
interestCalculationDaysInYearType?
number = ...
interestCalculationType?
number = ...
interestCompoundingPeriodType?
number = ...
interestPostingPeriodType?
number = ...
interestRateDifferential?
string = ...
isDormancyTrackingActive?
boolean = ...
isFloatingInterestRateCalculationAllowed?
boolean = ...
isLinkedToFloatingInterestRates?
boolean = ...
isLinkedWithFundSourceAccount?
boolean = ...
isReservedProduct?
boolean = ...
isUsedForSuspenseAccounting?
boolean = ...
locale?
string = ...
The locale for formatting date and number fields
maxDifferentialRate?
string = ...
minDifferentialRate?
string = ...
minRequiredOpeningBalance?
string = ...
The minimum balance required to open the savings account
name?
string = ...
The updated name of the savings product
nominalAnnualInterestRate?
string = ...
The nominal annual interest rate
paymentChannelToFundSourceMappings?
string = ...
penaltyToIncomeAccountMappings?
string = ...
shortName?
string = ...
The updated short name for the savings product
skipCollectTransferCharge?
boolean = ...
startDate?
string = ...
withdrawalFeeForTransfers?
boolean = ...
withHoldTax?
boolean = ...
Returns
Command<{ params: { accountingRule?: number; allowOverdraft?: boolean; charges?: object[]; currencyCode?: string; dateFormat?: string; defaultDifferentialRate?: string; description?: string; digitsAfterDecimal?: number; endDate?: string; enforceMinRequiredBalance?: boolean; feeToIncomeAccountMappings?: string; floatingRateId?: number; inMultiplesOf?: string; interestCalculationDaysInYearType?: number; interestCalculationType?: number; interestCompoundingPeriodType?: number; interestPostingPeriodType?: number; interestRateDifferential?: string; isDormancyTrackingActive?: boolean; isFloatingInterestRateCalculationAllowed?: boolean; isLinkedToFloatingInterestRates?: boolean; isLinkedWithFundSourceAccount?: boolean; isReservedProduct?: boolean; isUsedForSuspenseAccounting?: boolean; locale?: string; maxDifferentialRate?: string; minDifferentialRate?: string; minRequiredOpeningBalance?: string; name?: string; nominalAnnualInterestRate?: string; paymentChannelToFundSourceMappings?: string; penaltyToIncomeAccountMappings?: string; shortName?: string; skipCollectTransferCharge?: boolean; startDate?: string; withdrawalFeeForTransfers?: boolean; withHoldTax?: boolean; }; productId: number; }, { changes?: Record<string, unknown>; id: string; resourceId: string; }>
A Command that when executed returns the update response with changes
Example
const updateCmd = UpdateAccountProduct(
101,
{
name: "Saving Product test",
shortName: "savi",
description: "SAVING TEST",
currencyCode: "USD",
digitsAfterDecimal: 2,
inMultiplesOf: "1",
nominalAnnualInterestRate: "2",
minRequiredOpeningBalance: "1000",
withdrawalFeeForTransfers: false,
interestCompoundingPeriodType: 1,
interestPostingPeriodType: 4,
interestCalculationType: 1,
interestCalculationDaysInYearType: 365,
accountingRule: 1,
charges: [{ id: 132, isMandatory: false }],
startDate: "2023-07-01",
endDate: "2024-09-30",
paymentChannelToFundSourceMappings: "[]",
penaltyToIncomeAccountMappings: "[]",
feeToIncomeAccountMappings: "[]",
locale: "en",
dateFormat: "dd MMMM yyyy"
}
);
const result = await updateCmd.execute(config);
console.log(result.changes);