Snag Docs logo

Create Loyalty Rule Chain

Create a new loyalty rule chain

POSThttps://admin.snagsolutions.io/api/loyalty/rule_chains

Create a new loyalty rule chain

Loading code example
Loading code example

Authorizations

apiKeyAuthstringheaderrequired

API key passed in the header.

Query Parameters

organizationIdstring<uuid>required
websiteIdstring<uuid>required

Body

Body

namestringrequired
loyaltyRuleIdstring<uuid>required

Unique identifier for the loyalty rule

operatorType"AND" | "OR"

Type of the condition. AND if all conditions must be met, OR if any condition can be met.

Allowed values: "AND" | "OR"
Default: "AND"
loyaltyConditionsarray<object>required

Array of conditions for the rule chain

Required array length: >= 1 elements
loyaltyConditions.type"rule" | "rules" | "points" | "badge" | "badges"

The type of rule

Allowed values: "rule" | "rules" | "points" | "badge" | "badges"
loyaltyConditions.descriptionstring

The description of the rule

loyaltyConditions.amountnumber

The amount of the rule

loyaltyConditions.repeatCountnumber

The number of times the rule should be repeated to fulfill the condition

loyaltyConditions.requiredCountnumber

The number of rules that need to be fulfilled to satisfy the condition

loyaltyConditions.loyaltyRuleChainIdstring<uuid>

UUID of the loyalty rule chain (optional, converted to lowercase)

loyaltyConditions.loyaltyRuleIdsarray<string<uuid>>

Array of UUIDs of the rules (optional, converted to lowercase)

loyaltyConditions.loyaltyRuleGroupIdsarray<string<uuid>>

Array of UUIDs of the rule group (optional, converted to lowercase)

loyaltyConditions.loyaltyLeaderboardViewIdsarray<string<uuid>>

Array of UUIDs of the Loyalty Leaderboard (optional, converted to lowercase)

loyaltyConditions.loyaltyCurrencyIdsarray<string<uuid>>

Array of UUIDs of the currency (optional, converted to lowercase)

loyaltyConditions.loyaltyBadgeIdsarray<string<uuid>>

Array of UUIDs of the badge (optional, converted to lowercase)

loyaltyConditions.csvUrlstring<uri>

URL of the CSV file (optional)

Response

application/json

200

dataobjectrequired