/*** * * SaaSquatch Type Definitions * * This file was automatically generated. DO NOT edit it by hand, instead edit the related JSON Schema file. * * Generated on 2026-03-20T21:11:42.771Z * ***/ /*** * RewardCreatedData.schema.json * Generated on 2026-03-20T21:11:43.757Z * This file was automatically generated. DO NOT edit it by hand, instead edit the related JSON Schema file. ***/ /** * Sent whenever a reward is created (when it becomes available, e.g. not pending). */ export type RewardCreatedWebhookSchema = (({ type?: "PCT_DISCOUNT" discountPercent?: DiscountPercent unit?: RewardUnit name?: RewardName [k: string]: unknown } | { type?: "FUELTANK" fuelTankCode?: RewardCode unit?: RewardUnit1 amount?: RewardAmount fuelTankType?: RewardCodeType [k: string]: unknown } | { type?: "CREDIT" unit?: RewardUnit2 assignedCredit?: AssignedCredit redeemedCredit?: RedeemedCredit name?: RewardName1 redemptions?: RewardRedemptions [k: string]: unknown } | { type?: "INTEGRATION" name?: RewardName2 description?: RewardDescription unit?: RewardUnit3 valueInCents?: RewardValue integrationId?: IntegrationId rewardDetails?: RewardDetails [k: string]: unknown }) & { id: RewardId type: RewardType dateCreated: DateRewardCreated dateScheduledFor?: DateScheduledFor dateGiven?: DateGiven dateExpires?: DateExpires dateCancelled?: DateCancelled accountId: AccountId userId: UserId cancellable: IsCancellable programId?: ProgramId rewardSource: RewardSource [k: string]: unknown }) /** * The percent discount to be given (e.g. 1-100) */ export type DiscountPercent = number /** * The unit of this reward */ export type RewardUnit = "%" /** * The name given to this discount reward (e.g. Referrer Reward) */ export type RewardName = string /** * The code associated with this reward (e.g. used in fulfillment) */ export type RewardCode = string /** * The unit of this reward */ export type RewardUnit1 = string /** * The value associated with this reward (e.g. 10% or $100) */ export type RewardAmount = number /** * The type of the redeemable reward associated with the fuel tank code (e.g. is it a discount or credit) */ export type RewardCodeType = ("PCT_DISCOUNT" | "CREDIT") /** * The unit of this reward (e.g. USD) */ export type RewardUnit2 = string /** * The credit assigned to this reward (e.g. amount that can be redeemed) */ export type AssignedCredit = number /** * The amount of credit that has already been redeemed from this reward */ export type RedeemedCredit = number /** * The name given to this credit reward (e.g. Referrer Reward) */ export type RewardName1 = string /** * The unique identifier of this redemption */ export type RedemptionId = string /** * The date this redemption was made */ export type DateRedeemed = number /** * The amount that was withdrawn from this reward */ export type QuantityRedeemed = string /** * A record of how credit was redeemed from this reward */ export type RewardRedemptions = RewardRedemption[] /** * The name of this reward (e.g. Amazon Gift Card) */ export type RewardName2 = string /** * This describe the reward in more detail */ export type RewardDescription = string /** * The unit of this reward (e.g. USD) */ export type RewardUnit3 = string /** * The monetary value of this reward in its fractional unit (e.g. cents) */ export type RewardValue = number /** * The identifier for the integration that issued this reward */ export type IntegrationId = string /** * The unique identifier associated with this reward */ export type RewardId = string export type RewardType = ("PCT_DISCOUNT" | "FUELTANK" | "CREDIT" | "INTEGRATION") /** * The date this reward was created */ export type DateRewardCreated = number /** * The date this reward is scheduled to be given if it starts in a pending state */ export type DateScheduledFor = (number | null) /** * The date this reward was given (became available for use) */ export type DateGiven = (number | null) /** * The date this reward will expire */ export type DateExpires = (number | null) /** * The date this reward was cancelled */ export type DateCancelled = (number | null) /** * The account Id for the user who received this reward */ export type AccountId = string /** * The user Id for the user who received this reward */ export type UserId = string /** * Whether this reward can be cancelled (e.g. rewards that have already been fulfilled externally cannot be cancelled) */ export type IsCancellable = boolean /** * The program that issued this reward */ export type ProgramId = (string | null) /** * The source of this reward (e.g. insight into why this reward was created) */ export type RewardSource = ("FRIEND_SIGNUP" | "REFERRED" | "MANUAL" | "ACTIVATION" | "ACQUISITION" | "RETENTION" | "REACTIVATION" | "AUTOMATED") /** * An instance of credit being withdrawn from a reward * * This interface was referenced by `undefined`'s JSON-Schema * via the `definition` "rewardRedemption". */ export interface RewardRedemption { id: RedemptionId dateRedeemed: DateRedeemed quantityRedeemed: QuantityRedeemed } /** * A map of details about this reward provided by the underlying giftcard provider (e.g. Tango's utid) */ export interface RewardDetails { [k: string]: unknown }