Skip to content

@mbanq/core-sdk-js v0.50.0


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

Function: CreateAndActivateAccount() ​

CreateAndActivateAccount(params): Command<{ params: { allowOverdraft?: boolean; charges?: object[]; clientId: number; dateFormat: string; enforceMinRequiredBalance?: boolean; externalId?: string; interestCalculationDaysInYearType?: number; interestCalculationType?: number; interestCompoundingPeriodType?: number; interestPostingPeriodType?: number; locale: string; lockinPeriodFrequency?: number; lockinPeriodFrequencyType?: number; minOverdraftForInterestCalculation?: number; minRequiredBalance?: number; minRequiredOpeningBalance?: string; monthDayFormat: string; nickname?: string; nominalAnnualInterestRate?: number; nominalAnnualInterestRateOverdraft?: number; overdraftLimit?: number; productId: number; submittedOnDate: string; withdrawalFeeForTransfers?: boolean; withHoldTax?: boolean; }; }, { changes: { activatedOnDate: string; dateFormat: string; locale: string; status: string; }; clientId: number; officeId: number; resourceId: number; savingsId: number; }>

Defined in: src/commands/rest/account.ts:208

Creates a new savings account and immediately activates it in a single operation. This combines the submit, approve, and activate commands.

Parameters ​

params ​

The account creation parameters (see CreateAndActivateAccountRequest)

allowOverdraft? ​

boolean = ...

charges? ​

object[] = ...

clientId ​

number = ...

The ID of the client who will own the account

dateFormat ​

string = ...

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

enforceMinRequiredBalance? ​

boolean = ...

externalId? ​

string = ...

interestCalculationDaysInYearType? ​

number = ...

interestCalculationType? ​

number = ...

interestCompoundingPeriodType? ​

number = ...

interestPostingPeriodType? ​

number = ...

locale ​

string = ...

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

lockinPeriodFrequency? ​

number = ...

lockinPeriodFrequencyType? ​

number = ...

minOverdraftForInterestCalculation? ​

number = ...

minRequiredBalance? ​

number = ...

minRequiredOpeningBalance? ​

string = ...

monthDayFormat ​

string = ...

nickname? ​

string = ...

nominalAnnualInterestRate? ​

number = ...

nominalAnnualInterestRateOverdraft? ​

number = ...

overdraftLimit? ​

number = ...

productId ​

number = ...

The ID of the savings product to use

submittedOnDate ​

string = ...

The date the account is submitted (format: "dd MMMM yyyy")

withdrawalFeeForTransfers? ​

boolean = ...

withHoldTax? ​

boolean = ...

Returns ​

Command<{ params: { allowOverdraft?: boolean; charges?: object[]; clientId: number; dateFormat: string; enforceMinRequiredBalance?: boolean; externalId?: string; interestCalculationDaysInYearType?: number; interestCalculationType?: number; interestCompoundingPeriodType?: number; interestPostingPeriodType?: number; locale: string; lockinPeriodFrequency?: number; lockinPeriodFrequencyType?: number; minOverdraftForInterestCalculation?: number; minRequiredBalance?: number; minRequiredOpeningBalance?: string; monthDayFormat: string; nickname?: string; nominalAnnualInterestRate?: number; nominalAnnualInterestRateOverdraft?: number; overdraftLimit?: number; productId: number; submittedOnDate: string; withdrawalFeeForTransfers?: boolean; withHoldTax?: boolean; }; }, { changes: { activatedOnDate: string; dateFormat: string; locale: string; status: string; }; clientId: number; officeId: number; resourceId: number; savingsId: number; }>

A Command that when executed returns the created and activated account details

Example ​

typescript
const createCmd = CreateAndActivateAccount(
  {
    clientId: 1,
    productId: 2,
    locale: "en",
    dateFormat: "dd MMMM yyyy",
    submittedOnDate: "01 December 2025",
    monthDayFormat: "dd MMM",
    nominalAnnualInterestRate: 5.0
  }
);
const result = await createCmd.execute(config);
console.log(result.savingsId);

Released under the MIT License.