Skip to content

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

  1. An organization applies to join the partner program (via portal or admin invitation).
  2. An admin reviews and approves the application.
  3. Upon approval, an AFL entitlement is created automatically (e.g., AFL-2026050001).
  4. The affiliate receives a unique referral code and link.
  5. When a referred customer makes a purchase, SolidAffiliate tracks the referral and calculates the commission.
  6. 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.

DataSource of truthMIDDAG Account role
Affiliate registrationSolidAffiliateListens to hook, logs for audit
Affiliate approvalSolidAffiliateCreates AFL entitlement
Referral trackingSolidAffiliateReads for portal display
Commission calculationSolidAffiliateReads for portal display
Payout processingSolidAffiliateReads for portal display

The only data MIDDAG Account persists is the AFL entitlement record.

Affiliate lifecycle

StatusWhat it meansAFL entitlement
PendingApplication submitted, awaiting review.Not yet created.
ActiveApproved and participating. Referral link is live.Active
SuspendedTemporarily paused by admin.Suspended
TerminatedPermanently 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:

HookWhen it firesMIDDAG Account action
solid_affiliate/affiliate/registeredNew affiliate registersAudit log
solid_affiliate/affiliate/approvedAffiliate approvedCreate AFL entitlement
solid_affiliate/referral/createdNew referral recordedCapture referral data
solid_affiliate/referral/status_changedReferral status changesUpdate local projection
solid_affiliate/payout/completedPayout processedUpdate 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.