Campaigneur API Test Suite

Campaign Optimization Engine - Investor Demo

Test Purchase Against Campaigns

View Campaigns

Create New Campaign

Create a bank first in the Banks tab
Example: {"percentage": 15.0, "eligibleCategory": "RESTAURANT"}
Leave empty for no rules
Leave empty for no progress tracking

Bank Management

User Management

User Campaign Enrollment

User Guide

📋 Quick Start Workflow

  1. Create a Bank → Go to Banks tab, create a bank, copy its ID
  2. Create a Campaign → Use the Bank ID to create a campaign with rules
  3. Create a User → Create a test user (e.g., "demo-user")
  4. Enroll User → Enroll the user in all campaigns
  5. Test Purchase → Submit a purchase and see matching campaigns!

🎯 Calculator Types

PercentageCashback

Simple percentage-based cashback

{"percentage": 15.0, "eligibleCategory": "RESTAURANT"}

CappedPercentageCashback

Percentage cashback with monthly/annual caps

{"percentage": 10.0, "cap": 500.0, "eligibleCategory": "MARKET"}

FixedReward

Fixed amount reward per qualifying purchase

{"rewardAmount": 50.0, "eligibleCategory": "TRAVEL"}

Installments

Interest-free installment benefits

{"installmentCount": 6, "minAmount": 1000.0}

NonMonetary

Non-financial benefits (e.g., "Buy 1 Get 1")

{"benefitDescription": "Free coffee", "eligibleCategory": "RESTAURANT"}

📏 Campaign Rules

Rules determine if a purchase qualifies for campaign benefits.

MinAmount / MaxAmount

Purchase amount thresholds

[
  {"type": "MinAmount", "config": {"minAmount": 250.0}},
  {"type": "MaxAmount", "config": {"maxAmount": 5000.0}}
]

Category / CategoryExclusion

Include or exclude specific categories

[
  {"type": "Category", "config": {"categories": ["RESTAURANT", "TRAVEL"]}},
  {"type": "CategoryExclusion", "config": {"excludedCategories": ["FUEL"]}}
]

Merchant

Target specific merchants

[
  {"type": "Merchant", "config": {"merchants": ["Starbucks", "Costa Coffee"]}}
]

DayOfWeek

Specific days of the week (1=Monday, 7=Sunday)

[
  {"type": "DayOfWeek", "config": {"daysOfWeek": [6, 7]}}
]
This example: Saturdays and Sundays only

TimeOfDay

Time windows (24-hour format)

[
  {"type": "TimeOfDay", "config": {"startTime": "18:00", "endTime": "23:00"}}
]
This example: 6 PM to 11 PM only

ProgressCompleted

Requires exact progress count (for milestone rewards)

[
  {"type": "ProgressCompleted", "config": {"requiredCount": 4}}
]
This example: Reward triggers on exactly 4th qualifying purchase

📊 Progress Rules

Progress rules determine what activity counts toward campaign goals.

DifferentDay

Each purchase must be on a different day

[
  {"type": "DifferentDay", "config": {}}
]
Use for "Make 4 purchases on different days" campaigns

MinAmountProgress

Minimum amount for purchase to count

[
  {"type": "MinAmountProgress", "config": {"minAmount": 100.0}}
]

CategoryProgress

Only specific categories count toward progress

[
  {"type": "CategoryProgress", "config": {"categories": ["RESTAURANT"]}}
]

MerchantProgress

Only specific merchants count toward progress

[
  {"type": "MerchantProgress", "config": {"merchants": ["McDonald's"]}}
]

🎮 Example Campaigns

Example 1: Simple Restaurant Cashback

Calculator: PercentageCashback

{"percentage": 15.0, "eligibleCategory": "RESTAURANT"}

Rules:

[
  {"type": "MinAmount", "config": {"minAmount": 250.0}},
  {"type": "Category", "config": {"categories": ["RESTAURANT"]}}
]

Progress Rules: Empty (no progress tracking)

Example 2: Weekend Bonus

Calculator: FixedReward

{"rewardAmount": 50.0, "eligibleCategory": "GENERAL"}

Rules:

[
  {"type": "DayOfWeek", "config": {"daysOfWeek": [6, 7]}},
  {"type": "MinAmount", "config": {"minAmount": 500.0}}
]

Result: 50 TL reward for purchases over 500 TL on weekends

Example 3: 4 Purchases on Different Days

Calculator: FixedReward

{"rewardAmount": 100.0, "eligibleCategory": "GENERAL"}

Rules:

[
  {"type": "ProgressCompleted", "config": {"requiredCount": 4}}
]

Progress Rules:

[
  {"type": "DifferentDay", "config": {}}
]

Result: 100 TL reward after making 4 purchases on different days

Example 4: Capped Market Cashback

Calculator: CappedPercentageCashback

{"percentage": 20.0, "cap": 300.0, "eligibleCategory": "MARKET"}

Rules:

[
  {"type": "Category", "config": {"categories": ["MARKET"]}}
]

Result: 20% cashback on groceries, max 300 TL per month

📁 Available Categories

RESTAURANT MARKET TRAVEL FUEL ENTERTAINMENT FASHION ELECTRONICS HEALTH GENERAL

💡 Tips

  • ✅ Always create a Bank first before creating campaigns
  • ✅ Copy the Bank ID after creating it
  • ✅ Use empty arrays [] if you don't need rules
  • ✅ JSON must be valid - check brackets and commas!
  • ✅ Enroll users before testing purchases
  • ✅ Use progress rules for milestone-based campaigns
  • ✅ Test with different amounts and categories to see rule matching

❌ Common Errors

"User not found"

Create the user first in the Users tab

"Campaign not found"

Make sure the Bank ID is correct when creating campaigns

"Invalid JSON"

Check your JSON syntax - missing quotes, brackets, or commas

"No campaigns matched"

Check if the user is enrolled and if purchase meets campaign rules