Swarm Rewards – WooCommerce Loyalty Plugin Integration

The Swarm Rewards WooCommerce Plugin was developed to integrate MAPLI’s Ares API (Swarm Loyalty System) into WooCommerce, allowing merchants to offer loyalty-based discounts and reward points directly within their online stores.

Technologies Used

WordPress
WooCommerce
PHP
MAPLI Ares
GitHub
Swarm Rewards – WooCommerce Loyalty Plugin Integration
Swarm Rewards – WooCommerce Loyalty Plugin Integration screenshot 1
Swarm Rewards – WooCommerce Loyalty Plugin Integration screenshot 2

Project Details

The plugin connects WooCommerce checkouts with the Swarm Loyalty platform in real-time, enabling customers to redeem points or apply rewards using a one-time transaction token generated in the Swarm mobile app. It also automates discount calculations, updates cart totals dynamically, and handles transaction confirmations or reversals securely through authenticated API calls.

This integration bridges the gap between physical and online shopping experiences by unifying the Swarm Rewards ecosystem across multiple sales channels.

Project Objective

To build a secure, real-time integration between WooCommerce and Swarm Loyalty using the MAPLI Ares API, allowing customers to seamlessly redeem and earn rewards during checkout while ensuring accurate synchronization of loyalty data across platforms.


Key Features Developed

1. Customer Checkout Integration

  • Added a “Swarm Loyalty Token” input field on the WooCommerce checkout page.
  • Integrated support for customizable labels and help text (e.g., “Use your Swarm-powered app to generate your token.”).
  • Linked to Play Store and App Store versions of the Swarm app for user convenience.

2. Real-Time Loyalty Processing

  • Implemented the following Ares API sequence:
    1. SubmitInputs: Sends the customer’s basket and transaction token to Swarm.
    2. ProcessTransaction: Processes discounts or wallet payments and returns updated line items.
    3. ConfirmTransaction / ReverseTransaction: Finalizes or rolls back transactions based on checkout success or cancellation.
  • Automatically updates cart totals and discount line items returned by Swarm in real time.

3. Admin Configuration Panel

  • Added an admin settings page for store owners to configure:
    • Ares API credentials (Terminal ID, Product ID, Auth Code, Endpoint URLs).
    • Custom token label and help text.
    • Swarm app links for both iOS and Android.
  • Used WooCommerce Settings API for persistence and validation.

4. Security and Reliability

  • Implemented HMAC-SHA256 authentication for all API requests using the terminal AuthCode.
  • Configured unique transaction IDs for each cart session to ensure transactional integrity.
  • Built a background queue system for Confirm/Reverse calls to handle network timeouts gracefully.

Results & Impact

  • Enabled WooCommerce stores to offer instant loyalty discounts and wallet redemptions through Swarm.
  • Streamlined reward processing — reducing manual voucher entries and errors.
  • Enhanced customer engagement and repeat purchase behavior through visible reward interactions.
  • Simplified the technical onboarding process for merchants via a fully self-managed admin panel.

Outcome

The Swarm Rewards WooCommerce Plugin successfully integrated MAPLI’s loyalty system with WooCommerce, providing a smooth, secure, and user-friendly rewards experience at checkout. It stands as a scalable, API-driven loyalty integration framework ready for deployment across multiple WordPress-based e-commerce sites.