Skip to content

@mbanq/core-sdk-js v0.50.0


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

Function: CreateAccountProduct() ​

CreateAccountProduct(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; }; }, { id: string; resourceId: string; }>

Defined in: src/commands/rest/accountProduct.ts:64

Creates a new savings account product.

Parameters ​

params ​

The account product creation parameters (see CreateAccountProductRequest)

accountingRule ​

number

The accounting rule used for this savings product

allowOverdraft? ​

boolean

charges? ​

object[]

currencyCode ​

string

The currency code for the savings product (e.g., "USD")

dateFormat? ​

string

The date format string (e.g., "dd MMMM yyyy")

defaultDifferentialRate? ​

string

description ​

string

A brief description of the savings product

digitsAfterDecimal ​

number

The number of digits after the decimal point for amounts

endDate? ​

string

enforceMinRequiredBalance? ​

boolean

feeToIncomeAccountMappings? ​

string

floatingRateId? ​

number

inMultiplesOf? ​

string

interestCalculationDaysInYearType ​

number

The number of days used in interest calculations for the year

interestCalculationType ​

number

The method used to calculate interest

interestCompoundingPeriodType ​

number

The period type for interest compounding

interestPostingPeriodType ​

number

The period type for posting interest to the account

interestRateDifferential? ​

string

isDormancyTrackingActive? ​

boolean

isFloatingInterestRateCalculationAllowed? ​

boolean

isLinkedToFloatingInterestRates? ​

boolean

isLinkedWithFundSourceAccount? ​

boolean

isReservedProduct? ​

boolean

isUsedForSuspenseAccounting? ​

boolean

locale ​

string

The locale for formatting date and number fields (e.g., "en")

maxDifferentialRate? ​

string

minDifferentialRate? ​

string

minRequiredOpeningBalance? ​

string

name ​

string

The name of the saving product

nominalAnnualInterestRate? ​

string

paymentChannelToFundSourceMappings? ​

string

penaltyToIncomeAccountMappings? ​

string

shortName ​

string

A 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; }; }, { id: string; resourceId: string; }>

A Command that when executed returns the created account product details

Example ​

typescript
const createCmd = CreateAccountProduct(
  {
    currencyCode: "USD",
    digitsAfterDecimal: 2,
    interestCompoundingPeriodType: 1,
    interestPostingPeriodType: 4,
    interestCalculationType: 1,
    interestCalculationDaysInYearType: 365,
    accountingRule: 1,
    name: "savings product",
    shortName: "te21",
    description: "test",
    inMultiplesOf: "1",
    isLinkedToFloatingInterestRates: true,
    floatingRateId: 1,
    minDifferentialRate: "1",
    interestRateDifferential: "12",
    defaultDifferentialRate: "3",
    maxDifferentialRate: "14",
    isFloatingInterestRateCalculationAllowed: true,
    minRequiredOpeningBalance: "1000",
    locale: "en",
    dateFormat: "dd MMMM yyyy",
    startDate: "01 January 2024",
    endDate: "31 December 2024"
  }
);
const result = await createCmd.execute(config);
console.log(result.resourceId, result.id);

Released under the MIT License.