Your tiers and paid memberships, the customer's progress to the next tier, and tier rewards.
A tier is a membership level customers unlock by meeting its conditions, such as a points balance or a number of orders. Paid memberships, which customers buy, come back in the same lists with type: "paid". Your membership order ranks them from entry tier to highest, and each one can have rewards, such as a discount code or free shipping.
getTiersLists your active tiers and paid memberships with their unlock conditions and rewards.getCustomerTiersLists the tiers and paid memberships the customer is in, with the rewards they get from each.getNextTierReturns the customer's next tier and how far they are from it.getTierRewardsLists the rewards from the customer's tiers in one list.Lists your active tiers and paid memberships with their unlock conditions and rewards.
Works for guests. Tiers come in your membership order. Each customer sees the tiers you show to everyone, plus the ones you show only to some segments or only to their members when they qualify. For a signed-in customer, isOpened marks the tiers they're in.
idsstring[]Only these tiers.
tiersTier[]idstringnamestringAs you entered it.
type"tiers" | "paid""tiers" for a tier customers unlock, "paid" for a paid membership.
isOpenedbooleanThe signed-in customer is in this tier; false for guests.
isStackablebooleanWhether the tier's rewards add up with a higher tier's. A customer in several tiers that don't stack gets the highest one's rewards.
orderNumbernumber | nullIts place in your membership order.
membershipCardstring | nullImage URL of its membership card.
operator"AND" | "OR"Whether a customer meets the tier with all of its unlock conditions, or with any one of them.
unlockConditionMessagesstring[]The unlock conditions in words, in the storefront language, such as "> 1,000 Points", "Spend $500" or "Make 5+ orders".
rewardsTierReward[]In the order you set.
idstringtypestring"discount", "free-shipping", "gift", "custom", "membership_card" (a collectible), "asset" (points), "accelerator" (earn faster), "gating" (gated content), "multiplier-votes", "tremendous" or "shopify-store-credit".
messagestringThe reward in words, in the storefront language, such as "10% Discount", "Free shipping" or "2x for each activity". The reward's name when you gave it one.
descriptionstring | nullYour description; null when there's none.
metaRewardMetaDetails that depend on type.
isHiddenbooleanOptionaltrue when the reward isn't available to the customer right now, for example a one-time reward they've already used.
isRedeemedbooleanOptionalThe customer has redeemed the reward as many times as it allows.
redemptionProgress{ count: number; limit: number }OptionalFor rewards with a redemption limit: how many times the customer has redeemed it, out of limit.
isUseAutomaticPerksbooleanOptionalDiscounts and free shipping: true when the reward applies automatically at checkout.
discountType"percentage" | "fixed"OptionalDiscounts.
discountAmountnumberOptionalDiscounts: the percentage, such as 10, or the amount off in your store currency.
minimumPurchaseAmountnumber | stringOptionalDiscounts and free shipping: the subtotal the code needs, in your store currency.
giftType"manual" | "automated"OptionalGifts: customers redeem "manual" gifts in the wallet, and Toki sends "automated" gifts when the customer enters the tier.
shopifyProductVariants{ id: string; label: string }[]OptionalGifts: the products the customer can choose from. id is the Shopify variant ID.
acceleratorRatenumber | stringOptionalAccelerators: how many times the usual points the customer earns, such as "2".
multiplierVotesnumber | stringOptionalVote multipliers: how many times the customer's poll votes count.
activityIdsstring[]OptionalGated content: the activities the reward unlocks.
gatedPagesstring[]OptionalGated content: the pages the reward unlocks.
buttonSettings{ enabled: boolean; buttonText?: string; url?: string }A button you set up on the reward: its text and the link it opens.
Lists the tiers and paid memberships the customer is in, with the rewards they get from each.
Tiers come in your membership order, highest last. When the customer is in several tiers that don't stack, the highest of those carries the rewards and the others have an empty rewards list. Rewards the customer can't use right now are included, with meta.isHidden set.
The same fields as in getTiers().
idstringnamestringAs you entered it.
type"tiers" | "paid""tiers" for a tier customers unlock, "paid" for a paid membership.
isOpenedbooleanThe signed-in customer is in this tier; false for guests.
isStackablebooleanWhether the tier's rewards add up with a higher tier's. A customer in several tiers that don't stack gets the highest one's rewards.
orderNumbernumber | nullIts place in your membership order.
membershipCardstring | nullImage URL of its membership card.
operator"AND" | "OR"Whether a customer meets the tier with all of its unlock conditions, or with any one of them.
unlockConditionMessagesstring[]The unlock conditions in words, in the storefront language, such as "> 1,000 Points", "Spend $500" or "Make 5+ orders".
rewardsTierReward[]In the order you set.
idstringtypestring"discount", "free-shipping", "gift", "custom", "membership_card" (a collectible), "asset" (points), "accelerator" (earn faster), "gating" (gated content), "multiplier-votes", "tremendous" or "shopify-store-credit".
messagestringThe reward in words, in the storefront language, such as "10% Discount", "Free shipping" or "2x for each activity". The reward's name when you gave it one.
descriptionstring | nullYour description; null when there's none.
metaRewardMetaDetails that depend on type.
isHiddenbooleanOptionaltrue when the reward isn't available to the customer right now, for example a one-time reward they've already used.
isRedeemedbooleanOptionalThe customer has redeemed the reward as many times as it allows.
redemptionProgress{ count: number; limit: number }OptionalFor rewards with a redemption limit: how many times the customer has redeemed it, out of limit.
isUseAutomaticPerksbooleanOptionalDiscounts and free shipping: true when the reward applies automatically at checkout.
discountType"percentage" | "fixed"OptionalDiscounts.
discountAmountnumberOptionalDiscounts: the percentage, such as 10, or the amount off in your store currency.
minimumPurchaseAmountnumber | stringOptionalDiscounts and free shipping: the subtotal the code needs, in your store currency.
giftType"manual" | "automated"OptionalGifts: customers redeem "manual" gifts in the wallet, and Toki sends "automated" gifts when the customer enters the tier.
shopifyProductVariants{ id: string; label: string }[]OptionalGifts: the products the customer can choose from. id is the Shopify variant ID.
acceleratorRatenumber | stringOptionalAccelerators: how many times the usual points the customer earns, such as "2".
multiplierVotesnumber | stringOptionalVote multipliers: how many times the customer's poll votes count.
activityIdsstring[]OptionalGated content: the activities the reward unlocks.
gatedPagesstring[]OptionalGated content: the pages the reward unlocks.
buttonSettings{ enabled: boolean; buttonText?: string; url?: string }A button you set up on the reward: its text and the link it opens.
Returns the customer's next tier and how far they are from it.
The next tier is the first one in your membership order above the highest tier the customer is in, skipping tiers they can't see and tiers with no places left. Without tierIds, all your tiers and paid memberships count.
message and status are ready to show, in the storefront language. When the customer is in every tier, isMaxLevel is true, progress is 100 and tier is null.
tierIdsstring[]Only consider these tiers and paid memberships.
tier{ id: string; name: string; requiredPoints: number } | nullThe next tier; null when there's none. requiredPoints is what its unlock conditions ask for in points, or 0 when they don't involve points.
isMaxLevelbooleanThe customer is in every tier they can see.
progressnumberHow far the customer is toward the next tier, as a percentage from 0 to 100.
progressFor"points" | "activity" | nullThe kind of condition progress follows: points, or completing an activity. null for other conditions, such as a number of orders.
pointsnumberThe customer's points that count toward the next tier.
activity{ name: string; completed: number; required: number } | nullWhen progressFor is "activity": the activity, how many times the customer has completed it, and how many times the tier asks for. Otherwise null.
messagestringSuch as "You're 250 Points away from Gold", or "Congratulations! You have already reached max level" in the top tier.
statusstringWhere the customer stands, such as "750 Points", "Made 3 orders" or "Spent $120".
Lists the rewards from the customer's tiers in one list.
The same rewards as in getCustomerTiers(), without the tiers around them. Rewards the customer can't use right now are included, with meta.isHidden set.
tierRewardIdstringrewardMessagestringThe reward in words, in the storefront language, such as "10% Discount".
typestring"discount", "free-shipping", "gift", "custom", "membership_card" (a collectible), "asset" (points), "accelerator" (earn faster), "gating" (gated content), "multiplier-votes", "tremendous" or "shopify-store-credit".
metaRewardMetaDetails that depend on type.
isHiddenbooleanOptionaltrue when the reward isn't available to the customer right now, for example a one-time reward they've already used.
isRedeemedbooleanOptionalThe customer has redeemed the reward as many times as it allows.
redemptionProgress{ count: number; limit: number }OptionalFor rewards with a redemption limit: how many times the customer has redeemed it, out of limit.
isUseAutomaticPerksbooleanOptionalDiscounts and free shipping: true when the reward applies automatically at checkout.
discountType"percentage" | "fixed"OptionalDiscounts.
discountAmountnumberOptionalDiscounts: the percentage, such as 10, or the amount off in your store currency.
minimumPurchaseAmountnumber | stringOptionalDiscounts and free shipping: the subtotal the code needs, in your store currency.
giftType"manual" | "automated"OptionalGifts: customers redeem "manual" gifts in the wallet, and Toki sends "automated" gifts when the customer enters the tier.
shopifyProductVariants{ id: string; label: string }[]OptionalGifts: the products the customer can choose from. id is the Shopify variant ID.
acceleratorRatenumber | stringOptionalAccelerators: how many times the usual points the customer earns, such as "2".
multiplierVotesnumber | stringOptionalVote multipliers: how many times the customer's poll votes count.
activityIdsstring[]OptionalGated content: the activities the reward unlocks.
gatedPagesstring[]OptionalGated content: the pages the reward unlocks.
buttonSettings{ enabled: boolean; buttonText?: string; url?: string }A button you set up on the reward: its text and the link it opens.