Features 6 min read

Scan Automations: Trigger Actions When QR Codes Hit Milestones

Set up automated actions that fire when QR codes reach scan milestones, visitors return, or scans come from specific locations.

What if your QR code could do things based on how it's being used? ScanStack's scan automations let you attach trigger-action pairs to any QR code.

Trigger Types

scan_milestone: Fires when a QR code reaches a specific total scan count.

{ "trigger_type": "scan_milestone", "trigger_config": { "scan_count": 1000 } }

visitor_milestone: Fires when a specific visitor reaches a scan count threshold. Great for loyalty programs.

{ "trigger_type": "visitor_milestone", "trigger_config": { "visitor_scan_count": 5 } }

geo_enter: Fires when a scan comes from one of the specified cities.

{ "trigger_type": "geo_enter", "trigger_config": { "cities": ["Austin", "Houston"] } }

time_window: Fires when a scan occurs during a specific time window.

{ "trigger_type": "time_window", "trigger_config": { "start": "09:00", "end": "17:00" } }

Action Types

webhook: POSTs a JSON payload to your URL. Connect to Slack, Zapier, your CRM, or any HTTP endpoint.

email_notify: Sends a notification via your configured webhook endpoint with email details included.

redirect_swap: Automatically changes the QR code's target URL. The 1000th scanner sees a different page than the 999th.

Full Example

curl -X POST https://api.scanstack.dev/v2/qr/:id/automations \
  -H "x-api-key: qr_your_key" \
  -d '{
  "name": "100-scan celebration",
  "trigger_type": "scan_milestone",
  "trigger_config": { "scan_count": 100 },
  "action_type": "redirect_swap",
  "action_config": { "target_url": "https://example.com/promo/100th-scanner" }
}'

Combine automations with webhooks and visitor detection for powerful workflows.