Create Loyalty Rule
Create a new Loyalty Rule
Documentation Index
Fetch the complete documentation index at: https://docs.snagsolutions.io/llms.txt
Use this file to discover all available pages before exploring further.
Authorizations
Body
Body
Schema for creating a new loyalty rule with detailed validations
Unique identifier for the organization creating the rule
"123e4567-e89b-12d3-a456-426614174001"
Unique identifier for the associated website
"123e4567-e89b-12d3-a456-426614174002"
Name of the loyalty rule
1"Referral Bonus Rule"
Type of loyalty rule being created
Bonus, BoughtOn, BoughtWithRoyalties, DiscordMessages, Listing, Lodging, MintOn, PoapClaim, SnagSocialsConnected, SnapshotFullset, SnapshotHold, SoldOn, SoldWithRoyalties, TokenHold, TwitterBio, TwitterHashTagPost, Retweet, check_in, code_entry, connect_wallet, connected_discord, connected_email, connected_epic, connected_github, connected_steam, connected_telegram, connected_twitter, create_partner_account, discord_member, drip_x_follow, drip_x_new_tweet, drip_x_text_in_bio, drip_x_text_in_comment, drip_x_text_in_name, drip_x_tweet, external_rule, link_click, manual_upload, profile_completed, referred_user, smart_contract_event, snapshot_governance, telegram_join, telegram_messages, text_input, token_hold_erc20, tweet_liked_by_project, twitter_comment, twitter_follow, twitter_followers, twitter_like, twitter_post_hashtag, quiz, poll, steam_wishlist, liquidity_uniswap_v2, liquidity_uniswap_v3, points_airdrop, youtube_subscribers, youtube_comment, shopify_spend, swap, tiktok_post, post_impressions, discord_join, connected_youtube, stratus_function, connected_tiktok, tiktok_follow, github_repo_star, github_repo_fork, github_repo_collaborator, github_merge_PR, discord_role_grant, connected_reddit, reddit_comment, robinhood_token_hold, connected_instagram, instagram_post, instagram_follow, connected_phone, dapps_by_gas_spent, dapps_by_active_users, dapps_by_new_users, dapps_by_transaction_count, dapps_by_user_retention "Bonus"
Execution frequency of the loyalty rule
none, once, hourly, daily, weekly, monthly, immediately "daily"
Interval between rule executions
hourly, daily, weekly, monthly, once, custom, every_message, unlimited "weekly"
When the rule becomes active
"2024-01-01T00:00:00Z"
When the rule becomes inactive
"2024-12-31T23:59:00Z"
The effective start time of the rule
"2024-01-01T00:00:00Z"
The effective end time of the rule
"2024-12-31T23:59:00Z"
Reward amount associated with the rule
"10.5"
Additional metadata for the loyalty rule
URL of the background asset to be displayed
"https://example.com/background.png"
Optional detailed description of the rule
"A loyalty rule rewarding users for referrals."
Blockchain network where the rule will apply
abstract, abstractTestnet, apechain, arbitrum, avalanche, avalancheFuji, base, baseSepolia, berachain, berachainArtio, berachainBepolia, binance, bscTestnet, campTestnet, fantom, fantomTestnet, flowMainnet, mainnet, nexus, nexusTestnet, optimism, polygon, polygon_mumbai, skaleNebula, skaleEuropa, skaleCalypso, solana, sophon, sophonTestnet, sui, superseed, superseedSepolia, vanar, xai, zksync, coti, cotiTestnet, dogeosTestnet, morph, morphTestnet, morphHolesky, ultra, ultraTestnet, nitrograph, sepolia, optimism_sepolia, arbitrumSepolia, goerli, optimism_goerli, arbitrumGoerli, basecamp, somnia, zkverify, polkadot, kusama, horizen, horizenTestnet, flow_cadence "mainnet"
URL for uploading custom rewards via CSV
"https://example.com/rewards.csv"
URL for fetching custom rewards
"https://api.example.com/rewards"
Optional stratus subscription id for the rule
"sub12345"
Optional stratus function id for the rule
"func12345"
Blockchain address of the associated collection
"0x1234567890abcdef1234567890abcdef12345678"
List of associated collections
Whether to hide this rule in the user interface
false
Whether to show this rule before the start time
false
Whether this rule is mandatory
true
OAuth credentials associated with the rule
"123e4567-e89b-12d3-a456-426614174003"
Unique identifier for the loyalty currency. Optional when rewardType is token and tokenReward is provided; backend will find or create the currency from the selected contract.
"456e1234-e89b-12d3-a456-426614174003"
When rewardType is token, provide relayer and either an ERC-20 contract or isNative=true to find or create loyalty currency and onchain token.
Unique identifier for the loyalty rule group
no-section "123e4567-e89b-12d3-a456-426614174004"
Type of reward issued by the rule
points, multiplier, badge, token "points"
Unique identifier for the loyalty badge
"123e4567-e89b-12d3-a456-426614174004"
URL of the media to be displayed
"https://example.com/media.png"
URL for uploading loyalty user allotment via CSV
"https://example.com/loyalty-user-allotment.csv"
The maximum amount of points a user can earn per interval. Available for the smart contract and external rules.
100
The interval for the max amount. Available for the smart contract and external rules.
daily, weekly, monthly, lifetime "daily"
URL of the Shopify store
"https://example.com"
ID of the external integration
"123e4567-e89b-12d3-a456-426614174005"
The lifetime of the reward
permanent, dynamic "permanent"
The type of claim for the reward
manual, auto "auto"
The IDs of the contracts
["123e4567-e89b-12d3-a456-426614174005"]Filter dApps by deployment age before ranking.
daily, weekly, monthly "daily"
Reward based on data usage within the last day, week, or month. Leave it empty for all time usage.
daily, weekly, monthly "daily"
Response
200
Schema for creating a new loyalty rule with detailed validations
Unique identifier for the organization creating the rule
"123e4567-e89b-12d3-a456-426614174001"
Unique identifier for the associated website
"123e4567-e89b-12d3-a456-426614174002"
Name of the loyalty rule
1"Referral Bonus Rule"
Type of loyalty rule being created
Bonus, BoughtOn, BoughtWithRoyalties, DiscordMessages, Listing, Lodging, MintOn, PoapClaim, SnagSocialsConnected, SnapshotFullset, SnapshotHold, SoldOn, SoldWithRoyalties, TokenHold, TwitterBio, TwitterHashTagPost, Retweet, check_in, code_entry, connect_wallet, connected_discord, connected_email, connected_epic, connected_github, connected_steam, connected_telegram, connected_twitter, create_partner_account, discord_member, drip_x_follow, drip_x_new_tweet, drip_x_text_in_bio, drip_x_text_in_comment, drip_x_text_in_name, drip_x_tweet, external_rule, link_click, manual_upload, profile_completed, referred_user, smart_contract_event, snapshot_governance, telegram_join, telegram_messages, text_input, token_hold_erc20, tweet_liked_by_project, twitter_comment, twitter_follow, twitter_followers, twitter_like, twitter_post_hashtag, quiz, poll, steam_wishlist, liquidity_uniswap_v2, liquidity_uniswap_v3, points_airdrop, youtube_subscribers, youtube_comment, shopify_spend, swap, tiktok_post, post_impressions, discord_join, connected_youtube, stratus_function, connected_tiktok, tiktok_follow, github_repo_star, github_repo_fork, github_repo_collaborator, github_merge_PR, discord_role_grant, connected_reddit, reddit_comment, robinhood_token_hold, connected_instagram, instagram_post, instagram_follow, connected_phone, dapps_by_gas_spent, dapps_by_active_users, dapps_by_new_users, dapps_by_transaction_count, dapps_by_user_retention "Bonus"
Execution frequency of the loyalty rule
none, once, hourly, daily, weekly, monthly, immediately "daily"
Interval between rule executions
hourly, daily, weekly, monthly, once, custom, every_message, unlimited "weekly"
When the rule becomes active
"2024-01-01T00:00:00Z"
When the rule becomes inactive
"2024-12-31T23:59:00Z"
The effective start time of the rule
"2024-01-01T00:00:00Z"
The effective end time of the rule
"2024-12-31T23:59:00Z"
Reward amount associated with the rule
"10.5"
Additional metadata for the loyalty rule
URL of the background asset to be displayed
"https://example.com/background.png"
Optional detailed description of the rule
"A loyalty rule rewarding users for referrals."
Blockchain network where the rule will apply
abstract, abstractTestnet, apechain, arbitrum, avalanche, avalancheFuji, base, baseSepolia, berachain, berachainArtio, berachainBepolia, binance, bscTestnet, campTestnet, fantom, fantomTestnet, flowMainnet, mainnet, nexus, nexusTestnet, optimism, polygon, polygon_mumbai, skaleNebula, skaleEuropa, skaleCalypso, solana, sophon, sophonTestnet, sui, superseed, superseedSepolia, vanar, xai, zksync, coti, cotiTestnet, dogeosTestnet, morph, morphTestnet, morphHolesky, ultra, ultraTestnet, nitrograph, sepolia, optimism_sepolia, arbitrumSepolia, goerli, optimism_goerli, arbitrumGoerli, basecamp, somnia, zkverify, polkadot, kusama, horizen, horizenTestnet, flow_cadence "mainnet"
URL for uploading custom rewards via CSV
"https://example.com/rewards.csv"
URL for fetching custom rewards
"https://api.example.com/rewards"
Optional stratus subscription id for the rule
"sub12345"
Optional stratus function id for the rule
"func12345"
Blockchain address of the associated collection
"0x1234567890abcdef1234567890abcdef12345678"
List of associated collections
Whether to hide this rule in the user interface
false
Whether to show this rule before the start time
false
Whether this rule is mandatory
true
OAuth credentials associated with the rule
"123e4567-e89b-12d3-a456-426614174003"
Unique identifier for the loyalty currency. Optional when rewardType is token and tokenReward is provided; backend will find or create the currency from the selected contract.
"456e1234-e89b-12d3-a456-426614174003"
When rewardType is token, provide relayer and either an ERC-20 contract or isNative=true to find or create loyalty currency and onchain token.
Unique identifier for the loyalty rule group
no-section "123e4567-e89b-12d3-a456-426614174004"
Type of reward issued by the rule
points, multiplier, badge, token "points"
Unique identifier for the loyalty badge
"123e4567-e89b-12d3-a456-426614174004"
URL of the media to be displayed
"https://example.com/media.png"
URL for uploading loyalty user allotment via CSV
"https://example.com/loyalty-user-allotment.csv"
The maximum amount of points a user can earn per interval. Available for the smart contract and external rules.
100
The interval for the max amount. Available for the smart contract and external rules.
daily, weekly, monthly, lifetime "daily"
URL of the Shopify store
"https://example.com"
ID of the external integration
"123e4567-e89b-12d3-a456-426614174005"
The lifetime of the reward
permanent, dynamic "permanent"
The type of claim for the reward
manual, auto "auto"
The IDs of the contracts
["123e4567-e89b-12d3-a456-426614174005"]Filter dApps by deployment age before ranking.
daily, weekly, monthly "daily"
Reward based on data usage within the last day, week, or month. Leave it empty for all time usage.
daily, weekly, monthly "daily"