Skip to main content

Earning Rules

Earning rules define how customers earn RSNC credits. The Shopify app matches incoming orders against your rules and awards credits automatically.

Creating an Earning Rule​

From the app dashboard, go to Earning Rules and click Create Rule.

Rule Settings​

SettingDescriptionDefault
NameDisplay name for the rule—
Rule TypeType of action that triggers the rulepurchase
Credits Per DollarBase RSNC credits earned per $1 spent—
Minimum Order AmountMinimum order value to qualify (optional)None
Maximum Credits Per OrderCap on credits per single order (optional)None
Applies Toall products, specific_products, or specific_collectionsall
Product FilterJSON array of product/collection IDs (when scoped)—
Start DateWhen the rule becomes active (optional)Immediately
End DateWhen the rule expires (optional)Never
PriorityMatching priority (lower = higher priority)0

How Matching Works​

When an order webhook arrives, the app:

  1. Fetches all active earning rules for the merchant
  2. Filters by rule type (purchase)
  3. Checks minimum order amount
  4. Checks time window (start/end dates)
  5. Applies product/collection filters
  6. Returns the first matching rule by priority

Only one rule fires per order. Use priority to control which rule takes precedence.

Reward Calculation​

base_reward = credits_per_dollar × order_total
capped_reward = min(base_reward, maximum_credits_per_order) // if cap set
final_reward = capped_reward × streak_multiplier

Streak Multipliers​

If the customer has an active daily streak, a multiplier is applied:

StreakMultiplier
3+ days1.25x
7+ days1.5x
14+ days1.75x
30+ days2.0x

Streak data is fetched from the Shared Services streak API at the time of order processing.

Examples​

Basic: 10 Credits Per Dollar​

Every purchase earns 10 RSNC per dollar spent.

  • Credits Per Dollar: 10
  • Applies To: All products

A $50 order earns 500 RSNC.

Minimum Order Threshold​

Only reward orders over $25.

  • Credits Per Dollar: 10
  • Minimum Order Amount: 25
  • Applies To: All products

A $20 order earns nothing. A $50 order earns 500 RSNC.

Capped Rewards​

Limit credits per order to prevent outsized rewards.

  • Credits Per Dollar: 10
  • Maximum Credits Per Order: 1000
  • Applies To: All products

A $200 order earns 1000 RSNC (capped), not 2000.

Time-Limited Promotion​

Double credits during a sale period.

  • Credits Per Dollar: 20
  • Start Date: 2026-03-01
  • End Date: 2026-03-07
  • Priority: 0 (higher than default rules)

During the promotion, this rule fires first. After the end date, regular rules take over.

Managing Rules​

Toggle a Rule​

Enable or disable a rule without deleting it. Disabled rules don't match any orders.

Edit a Rule​

Update any parameter. Changes take effect immediately for new orders.

Delete a Rule​

Permanently remove a rule. Historical rewards are not affected.

Test Orders​

The app automatically skips test orders placed via Shopify's Bogus Gateway. No credits are awarded for test transactions.

Metadata Sent to Resonance​

Each order event includes this metadata:

{
"order_id": "12345",
"order_total": 50.00,
"reward_amount": 500,
"base_reward": 500,
"streak_multiplier": 1.0,
"total_reward": 500,
"items": [...],
"platform": "shopify",
"source": "shopify_app"
}

Next Steps​