@mbanq/core-sdk-js / commands / CloseAccount
Function: CloseAccount()
CloseAccount(
savingsAccountId,data):Command<{data: {closedOnDate?:string;closeReasonCodeId:number;dateFormat?:string;ignoreNegativeBalance?:boolean;locale?:string;paymentTypeId?:number;postInterestValidationOnClosure?:boolean;withdrawBalance?:boolean; };savingsAccountId:number; }, {changes: {closedOnDate:string;closeReason: {codeName:string;id:number;name:string; };dateFormat:string;locale:string;status:string; };clientId:number;officeId:number;resourceId:number;savingsId:number; }>
Defined in: src/commands/rest/account.ts:267
Closes a savings account permanently. This deactivates the account so no further transactions can be performed.
Parameters
savingsAccountId
number
The ID of the savings account to close
data
closedOnDate?
string = ...
closeReasonCodeId
number = ...
dateFormat?
string = ...
ignoreNegativeBalance?
boolean = ...
locale?
string = ...
paymentTypeId?
number = ...
postInterestValidationOnClosure?
boolean = ...
withdrawBalance?
boolean = ...
Returns
Command<{ data: { closedOnDate?: string; closeReasonCodeId: number; dateFormat?: string; ignoreNegativeBalance?: boolean; locale?: string; paymentTypeId?: number; postInterestValidationOnClosure?: boolean; withdrawBalance?: boolean; }; savingsAccountId: number; }, { changes: { closedOnDate: string; closeReason: { codeName: string; id: number; name: string; }; dateFormat: string; locale: string; status: string; }; clientId: number; officeId: number; resourceId: number; savingsId: number; }>
A Command that when executed returns the account closure confirmation
Example
const closeCmd = CloseAccount(
5100,
{
closedOnDate: "01 April 2025",
dateFormat: "dd MMMM yyyy",
locale: "en",
withdrawBalance: false,
postInterestValidationOnClosure: true,
ignoreNegativeBalance: false,
closeReasonCodeId: 5100
}
);
const result = await closeCmd.execute(config);
console.log(result.changes.status); // "ACCOUNT_CLOSE_REASON"