Yotpo: Loyalty

{
  campaigns: [
    {
      completed: false,
      description: "Follow us on Instagram for points",
      icon: "",
      id: "12345",
      name: "Follow_on_Instagram",
      rewardText: "Earn 100 points",
      title: "Follow Us",
      type: "CustomActionCampaign",
      url: "https://instagram.com/example",
    },
    {
      completed: true,
      description: "Refer a friend and both get rewards",
      icon: "referral-icon.svg",
      id: "67890",
      name: "Refer_a_Friend",
      rewardText: "Get $10 off",
      title: "Share the Love",
      type: "ReferralCampaign",
      url: "",
    },
    {
      completed: false,
      description: "Special reward on your birthday",
      icon: "birthday-icon.svg",
      id: "11223",
      name: "Birthday_Bonus",
      rewardText: "Get 2X points",
      title: "Birthday Rewards",
      type: "BirthdayCampaign",
      url: "",
    },
  ],
  couponCode: "XXXX",
  currentVipTier: {
    description: "Bronze tier",
    entryDate: "2024-01-01",
    expirationDate: "2024-12-31",
    name: "Bronze",
  },
  error: {
    couponCode: false,
  },
  loading: {
    loading: {
      referral: {
        receipts: false,
      },
    },
    redemptionOptions: false,
    referral: {
      receipts: false,
    },
  },
  nextVipTier: {
    description: "Silver tier",
    entryThreshold: {
      cents: 100,
      points: 500,
      purchases: 1,
      referrals: 0,
      requirements: "all_requirements",
    },
    id: "2",
    isCurrent: false,
    name: "Silver",
  },
  redemptionOptions: [
    {
      description: "Get $10 off your next purchase",
      discount: {
        amountCents: 1000,
        percentage: null,
        rateCents: 100,
        type: "fixed_amount",
        valueCents: null,
      },
      duration: "30",
      id: "reward-001",
      name: "$10 Off Your Purchase",
      points: 50,
      type: "discount_coupon",
    },
    {
      description: "Get 20% off your next purchase",
      discount: {
        amountCents: null,
        percentage: "20",
        rateCents: null,
        type: "percentage",
        valueCents: null,
      },
      duration: "60",
      id: "reward-002",
      name: "20% Off Your Purchase",
      points: 100,
      type: "discount_coupon",
    },
  ],
  referral: {
    email: "user@nyla.app",
    id: 2545885502,
    link: "rwrd.io/ref_XIT06R1",
    receipts: [
      {
        email: "referral1@nyla.app",
        id: "123",
        status: "completed",
      },
      {
        email: "referral2@nyla.app",
        id: "124",
        status: "pending",
      },
    ],
  },
  rewardHistory: [
    {
      action: "Create an account",
      action_name: null,
      completed_at: "2022-07-22T13:53:21.000Z",
      created_at: "2022-07-22T13:53:21.000Z",
      date: "2022-07-22",
      order_ids: [],
      points: 5,
      status: "Approved",
    },
    {
      action: "Share the Love",
      action_name: "Refer_a_Friend",
      completed_at: "2022-07-22T13:53:30.000Z",
      created_at: "2022-07-22T13:53:31.000Z",
      date: "2022-07-22",
      order_ids: [],
      points: 10,
      status: "Approved",
    },
    {
      action: "Points Expired",
      action_name: "manual_adjustment",
      completed_at: "2023-07-23T04:02:09.000Z",
      created_at: "2023-07-23T04:02:09.000Z",
      date: "2023-07-23",
      order_ids: [],
      points: -5,
      status: "Approved",
    },
    {
      action: "Birthday Rewards",
      action_name: "Birthday_Bonus",
      completed_at: "2023-07-24T04:02:09.000Z",
      created_at: "2023-07-24T04:02:09.000Z",
      date: "2023-07-24",
      order_ids: [],
      points: 5,
      status: "Approved",
    },
  ],
  totalCartPoints: 0,
  userBirthday: {},
  userPoints: 100,
  vipTierActionsCompleted: {
    cents: 0,
    points: 50,
    purchases: 0,
    referrals: 0,
  },
  vipTierRetainRequirements: {
    cents: 0,
    points: 150,
    purchases: 0,
    referrals: 0,
  },
  vipTiers: [
    {
      description: "Bronze tier",
      entryThreshold: {
        cents: 0,
        points: 200,
        purchases: 0,
        referrals: 0,
        requirements: "all_requirements",
      },
      id: "1",
      isCurrent: true,
      name: "Bronze",
    },
    {
      description: "Silver tier",
      entryThreshold: {
        cents: 100,
        points: 500,
        purchases: 1,
        referrals: 0,
        requirements: "all_requirements",
      },
      id: "2",
      isCurrent: false,
      name: "Silver",
    },
    {
      description: "Gold tier",
      entryThreshold: {
        cents: 300,
        points: 1000,
        purchases: 5,
        referrals: 2,
        requirements: "all_requirements",
      },
      id: "3",
      isCurrent: false,
      name: "Gold",
    },
  ],
  vipTierUpgradeRequirements: {
    cents: 100,
    points: 500,
    purchases: 1,
    referrals: 0,
  },
}

Properties

array

Available campaigns in the loyalty program

string

Coupon code for redemption

object

Current VIP tier information

object

Error states

object

Loading states for various components

object

Next VIP tier information

array

Available redemption options

object

Referral program information

array

History of reward activities

number

Total points available from current cart

date

User's birthday

number

Current points balance for the user

object

Progress towards VIP tier requirements

object

Requirements to retain current VIP tier

object

Requirements to upgrade to the next VIP tier

array

Available VIP tiers in the loyalty program