Skip to content

@mbanq/core-sdk-js v0.50.0


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

Function: UndoChargeToAccount()

UndoChargeToAccount(params, data): Command<{ data: { dateFormat: string; locale: string; transactionAmount: number; transactionDate: string; }; params: { accountId: number; transactionId: number; }; }, { clientId: number; id: number; officeId: number; resourceId: number; savingsId: number; }>

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

Undo a charge to an account

This endpoint allows you to undo (reverse) an existing charge transaction on a specified account. It is typically used to correct errors or to provide refunds for charges that were applied to an account.

Parameters

params

The path parameters

accountId

number = ...

The ID of the savings account

transactionId

number = ...

The transaction ID of the charge to undo

data

The undo charge parameters

dateFormat

string = ...

The date format

locale

string = ...

The locale

transactionAmount

number = ...

The amount to undo

transactionDate

string = ...

The date of the transaction

Returns

Command<{ data: { dateFormat: string; locale: string; transactionAmount: number; transactionDate: string; }; params: { accountId: number; transactionId: number; }; }, { clientId: number; id: number; officeId: number; resourceId: number; savingsId: number; }>

Command object for undoing a charge

Example

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

const command = UndoChargeToAccount(
  { accountId: 101, transactionId: 10004 },
  {
    transactionAmount: 100,
    transactionDate: '20-09-2023',
    dateFormat: 'dd-MM-yyyy',
    locale: 'en'
  }
);
const result = await client.request(command);

Released under the MIT License.