Saltar al contenido principal

getBonusHistory

Getting bonus transaction history of the current user. 🔐 This method requires authorization.

Description

This method retrieves the bonus transaction history for the currently authenticated user with filtering by type, date range, discount, module and admin flag. It returns a Promise that resolves to an array of IBonusTransactionEntity objects.

Discounts.getBonusHistory(

type, dateFrom, dateTo, discountId, moduleId, isAdmin

);

Parameters schema

Schema

type: BonusTransactionType
Transaction type filter. Possible values: "ACCRUAL" | "USAGE" | "REDUCE" | "REVERSAL_ACCRUAL" | "REVERSAL_USAGE" | "EXPIRATION"
example: "ACCRUAL"

dateFrom: string
Start date filter
example: "2026-01-01T00:00:00.000Z"

dateTo: string
End date filter
example: "2026-12-31T23:59:59.000Z"

discountId: number
Discount id filter
example: 1

moduleId: number
Module id filter
example: 1

isAdmin: boolean
Admin filter
example: false

Examples

Minimal example

const response = await Discounts.getBonusHistory();

Example with attributes

const response = await Discounts.getBonusHistory(
'ACCRUAL',
'2026-01-01T00:00:00.000Z',
'2026-12-31T23:59:59.000Z'
);

Example response

[]

Response schema

Schema: IBonusTransactionEntity[]

balanceId: number
Balance id.

amount: number
Transaction amount.

type: BonusTransactionType
Transaction type. Possible values: "ACCRUAL" | "USAGE" | "REDUCE" | "REVERSAL_ACCRUAL" | "REVERSAL_USAGE" | "EXPIRATION".

discountId: number
Discount id.

moduleId: number
Module id.

entityIdentifier: string
Entity identifier.

comment: string
Comment.

isAdmin: boolean
Admin flag.

remainingAmount: number
Remaining amount.

triggerType: string
Trigger type. Possible values: "EVENT" | "SCHEDULED".

expiresAt: string
Expiration date.

createdAt: string
Creation date.