Affiliates
An Affiliate is an organization that participates in MIDDAG's partner program. Affiliates refer new customers and earn commissions on resulting sales. The affiliate program is powered by SolidAffiliate (a WordPress plugin) as the source of truth, with MIDDAG Account providing the entitlement integration and portal visibility.
How the affiliate program works
- An organization applies to join the partner program (via portal or admin invitation).
- An admin reviews and approves the application.
- Upon approval, an AFL entitlement is created automatically (e.g.,
AFL-2026050001). - The affiliate receives a unique referral code and link.
- When a referred customer makes a purchase, SolidAffiliate tracks the referral and calculates the commission.
- MIDDAG Account reads the referral and commission data and displays it in the portal.
SolidAffiliate as source of truth
SolidAffiliate manages all affiliate data: registrations, referral tracking, commission calculations, and payout processing. MIDDAG Account never writes to SolidAffiliate's tables. Instead, it reads data through an adapter and reacts to SolidAffiliate's WordPress hooks.
| Data | Source of truth | MIDDAG Account role |
|---|---|---|
| Affiliate registration | SolidAffiliate | Listens to hook, logs for audit |
| Affiliate approval | SolidAffiliate | Creates AFL entitlement |
| Referral tracking | SolidAffiliate | Reads for portal display |
| Commission calculation | SolidAffiliate | Reads for portal display |
| Payout processing | SolidAffiliate | Reads for portal display |
The only data MIDDAG Account persists is the AFL entitlement record.
Affiliate lifecycle
| Status | What it means | AFL entitlement |
|---|---|---|
| Pending | Application submitted, awaiting review. | Not yet created. |
| Active | Approved and participating. Referral link is live. | Active |
| Suspended | Temporarily paused by admin. | Suspended |
| Terminated | Permanently ended. No further referrals. | Cancelled |
The AFL entitlement status mirrors the affiliate status: when the affiliate is suspended, the entitlement is suspended; when terminated, the entitlement is cancelled.
Referral tracking
When a referred customer completes a purchase, SolidAffiliate records the referral with:
- The referring affiliate
- The order that generated the commission
- The commission amount
- The referral status (pending, approved, paid)
MIDDAG Account reads this data through the AffiliateAdapter and displays it in the affiliate's portal view.
Commission and payouts
Commission rates are configurable per affiliate (stored in SolidAffiliate). The affiliate's portal view shows:
- Total earned -- lifetime commissions accumulated
- Pending -- commissions awaiting approval or payout
- Paid -- commissions already disbursed
- Payout history -- individual payout records with dates and amounts
Hooks consumed
MIDDAG Account listens to these SolidAffiliate hooks:
| Hook | When it fires | MIDDAG Account action |
|---|---|---|
solid_affiliate/affiliate/registered | New affiliate registers | Audit log |
solid_affiliate/affiliate/approved | Affiliate approved | Create AFL entitlement |
solid_affiliate/referral/created | New referral recorded | Capture referral data |
solid_affiliate/referral/status_changed | Referral status changes | Update local projection |
solid_affiliate/payout/completed | Payout processed | Update payout history |
Portal visibility
In the customer portal, affiliates see:
- Referral code and link
- Commission rate
- Referral list (with status and amounts)
- Commission summary (earned, pending, paid)
- Payout history
This data is read-only in the portal -- all changes flow through SolidAffiliate's admin interface or through the hooks.
What admins see
In the WordPress admin, the affiliate management view shows:
- Organization name
- Affiliate status (pending, active, suspended, terminated)
- AFL entitlement code
- Referral code
- Commission rate
- Total earned and pending amounts
Admins approve, suspend, or terminate affiliates through the SolidAffiliate admin. The AFL entitlement is updated automatically via hooks.
Dependency
The Affiliate domain requires the SolidAffiliate plugin to be installed and active. If SolidAffiliate is not present, the entire Affiliate domain is disabled -- no affiliate pages appear in the admin or portal, and no AFL entitlements are created.
Related pages
- Entitlements -- the AFL entitlement created for each active affiliate
- Entitlement Classes -- AFL class details
- Organizations -- the entity that participates in the program
- Orders -- the purchases that generate referral commissions