Snag Docs logo

Get Loyalty Rules

Retrieve configured loyalty rules with optional pagination and filters

GEThttps://admin.snagsolutions.io/api/loyalty/rules

Retrieve configured loyalty rules with optional pagination and filters

Loading code example
Loading code example

Authorizations

apiKeyAuthstringheaderrequired

API key passed in the header.

Query Parameters

organizationIdstring<uuid>

Unique identifier for the organization to filter by

websiteIdstring<uuid>

Unique identifier for the website to filter by

collectionAddressstring

Address of the collection to filter by

loyaltyRuleGroupIdany

ID(s) of the loyalty rule group(s) to filter results. Single ID or array for multiple groups (shared cursor when multiple).

startingAfterstring

Pagination cursor to start after a specific resource ID

limitnumberdefault: 10

Maximum number of records to return (max 100)

Required range: x >= 1, x <= 100
Default: 10
loyaltyRuleIdany

The IDs of the loyalty rule

isActive"true" | "false"

If true this will only return active rules, the rules for which the startTime is in the past and the endTime is in the future

Allowed values: "true" | "false"
allotedToUserIdany

IDs of the users to filter results by

allotedUserGroupIdstring<uuid>

ID of the user group to filter results by

isSpecial"true" | "false"

If true this will only return special rules, special rules are the rules that are used for anti sybil as honey pot

Allowed values: "true" | "false"
includeDeletedbooleandefault: false

Whether to include deleted/archived records

Default: false

Response

application/json

200

dataarray<object>required
data.idstring<uuid>required

Unique identifier for the loyalty rule

data.namestringrequired

Name of the loyalty rule

data.descriptionstringrequired

Description of the loyalty rule

data.endTimestringrequired

End time of the loyalty rule

data.startTimestringrequired

Start time of the loyalty rule

data.rewardType"points" | "multiplier" | "badge" | "token"required

Type of the reward

Allowed values: "points" | "multiplier" | "badge" | "token"
data.organizationIdstring<uuid>required

Unique identifier for the organization

data.websiteIdstring<uuid>required

Unique identifier for the website

data.collectionAddressstring

Optional address of the collection

data.typestringrequired

Type of the loyalty rule

data.frequencystringrequired

Frequency of the loyalty rule

data.amountnumberrequired

Amount associated with the loyalty rule

data.createdAtstring<date-time>required

Timestamp when the loyalty rule was created

data.updatedAtstring<date-time>required

Timestamp when the loyalty rule was last updated

data.deletedAtstring<date-time>required

Timestamp when the loyalty rule was deleted (if applicable)

data.mediaUrlstring

URL of the media associated with the loyalty rule

data.metadataobject

Optional metadata for the loyalty rule

data.dappDeployedWithin"daily" | "weekly" | "monthly"

Filter dApps by deployment age before ranking.

Allowed values: "daily" | "weekly" | "monthly"
data.dappDataWindow"daily" | "weekly" | "monthly"

Reward based on data usage within the last day, week, or month. Leave it empty for all time usage.

Allowed values: "daily" | "weekly" | "monthly"
data.trackProgressboolean

Flag indicating if the progress is tracked. If enabled, the rule can only be completed once the progress is 100%.

data.progressType"counter" | "percentage"

How tracked progress is interpreted. "percentage" counts 0-100 and is shown as a percentage. "counter" counts up to the highest reward range end and is shown as a raw count.

Allowed values: "counter" | "percentage"
data.loyaltyRuleChainarray<object>required

Chains attached to the loyalty rule

hasNextPagebooleanrequired