Skip to content

@mbanq/core-sdk-js v0.50.0


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

Function: CreateCharge()

CreateCharge(data): Command<{ data: { active?: boolean; amount: number; applyToExistingAccount?: boolean; applyUpfrontCharge?: boolean; chargeAppliesTo: ChargeAppliesToEnum; chargeCalculationType: ChargeCalculationTypeEnum; chargeDueDateOnAccountActivation?: boolean; chargePaymentMode?: REGULAR | ACCOUNT_TRANSFER; chargeTimeType: ChargeTimeTypeEnum; clientClassificationId?: number; collectOnlyTotalDeferCharge?: boolean; currencyCode: string; exemptedFeeAmount?: string | number; feeFrequency?: number; feeInterval?: number; feeOnMonthDay?: string; ignoreChargesOnNegativeBalance?: boolean; incomeAccountId?: number; locale?: string; maxCap?: number; minCap?: number; monthDayFormat?: string; name: string; numberOfExemptedFee?: string | number; paymentDirection?: IN | OUT; paymentRail?: number; penalty?: boolean; productIDs?: number[]; reverseOnTransferFail?: boolean; taxGroupId?: number; transferType?: CREDIT | DEBIT; }; }, { id: string; resourceId: number; }>

Defined in: src/commands/rest/chargeSetup.ts:30

Create a new charge definition

This endpoint allows creating a new charge definition in the system. Charges can be applied to loans, savings accounts, or clients.

Parameters

data

The charge creation parameters

active?

boolean = ...

amount

number = ...

applyToExistingAccount?

boolean = ...

applyUpfrontCharge?

boolean = ...

chargeAppliesTo

ChargeAppliesToEnum = ...

chargeCalculationType

ChargeCalculationTypeEnum = ...

chargeDueDateOnAccountActivation?

boolean = ...

chargePaymentMode?

REGULAR | ACCOUNT_TRANSFER = ...

chargeTimeType

ChargeTimeTypeEnum = ...

clientClassificationId?

number = ...

collectOnlyTotalDeferCharge?

boolean = ...

currencyCode

string = ...

exemptedFeeAmount?

string | number = ...

feeFrequency?

number = ...

feeInterval?

number = ...

feeOnMonthDay?

string = ...

ignoreChargesOnNegativeBalance?

boolean = ...

incomeAccountId?

number = ...

locale?

string = ...

maxCap?

number = ...

minCap?

number = ...

monthDayFormat?

string = ...

name

string = ...

numberOfExemptedFee?

string | number = ...

paymentDirection?

IN | OUT = ...

paymentRail?

number = ...

penalty?

boolean = ...

productIDs?

number[] = ...

reverseOnTransferFail?

boolean = ...

taxGroupId?

number = ...

transferType?

CREDIT | DEBIT = ...

Returns

Command<{ data: { active?: boolean; amount: number; applyToExistingAccount?: boolean; applyUpfrontCharge?: boolean; chargeAppliesTo: ChargeAppliesToEnum; chargeCalculationType: ChargeCalculationTypeEnum; chargeDueDateOnAccountActivation?: boolean; chargePaymentMode?: REGULAR | ACCOUNT_TRANSFER; chargeTimeType: ChargeTimeTypeEnum; clientClassificationId?: number; collectOnlyTotalDeferCharge?: boolean; currencyCode: string; exemptedFeeAmount?: string | number; feeFrequency?: number; feeInterval?: number; feeOnMonthDay?: string; ignoreChargesOnNegativeBalance?: boolean; incomeAccountId?: number; locale?: string; maxCap?: number; minCap?: number; monthDayFormat?: string; name: string; numberOfExemptedFee?: string | number; paymentDirection?: IN | OUT; paymentRail?: number; penalty?: boolean; productIDs?: number[]; reverseOnTransferFail?: boolean; taxGroupId?: number; transferType?: CREDIT | DEBIT; }; }, { id: string; resourceId: number; }>

Command object for creating a charge

Example

typescript
const command = CreateCharge({
  name: "Loan service fee",
  currencyCode: "USD",
  amount: 230.56,
  chargeAppliesTo: 1,
  chargeTimeType: 3,
  chargeCalculationType: 1,
  locale: "en"
});
const result = await client.request(command);
console.log(result.resourceId);

Released under the MIT License.