Offer Hooks

Types

type IntelligemsOfferTier = {
  id: string;
  minimumUnits: number;
  maximumUnits: number;
  unitDiscount: number;
  discountTitle: string;
  giftWithPurchaseTitle: string;
  isFreeShipping: boolean;
  isGiftWithPurchase: boolean;
  giftWithPurchaseProductId: string;
  giftWithPurchaseVariantId: string;
  autoAddGiftWithPurchase: boolean;
  giftWithPurchaseHandle: string;
};


type DiscountApplicationType = 
  "tieredDiscount" | 
  "cartDiscount" |
  "freeGift" |
  "freeShipping"

type DiscountApplicationMethodType = "perItem" | "perOrder"
  
type IntelligemsOffer = {
  id: string;
  variationId: string;
  enabled: boolean;
  isTest: boolean;
  isArchived: boolean;
  name: string;
  unitType: string;
  discountType: string'
  tiers: IntelligemsOfferTier[];
  maximumDollarDiscount: number;
  discountApp: DiscountAppDtoSchema.nullable();
  discountApplicationType: DiscountApplicationType;
  discountApplicationMethod: DiscountApplicationMethodType;
  combinesWithIntelligems: boolean;
  combinesWithShopify: boolean;
  shouldRejectCodes: boolean;
}

useIgOffer()

const useIgOffer = (experienceId: string) => {
isReady: boolean;
offer: IntelligemsOffer
}

useIgOfferTier()

const useIgOfferTier = (experienceId: string, units: number) => {
isReady: boolean;
tier: IntelligemsOfferTier
}

useIgOffers()

const useIgOffers = (experienceId: string) => {
isReady: booolean;
offers: IntelligemsOffer[]
}

Last updated