Skip to content

Database Schema ​

FluentAffiliate uses custom database tables (not WordPress post types). All tables are prefixed with fa_ in addition to the WordPress table prefix ($wpdb->prefix).

Table Inventory ​

TableDescription
fa_affiliatesRepresents a registered affiliate. Central model in FluentAffiliate.
fa_referralsRepresents a commission event generated when a referred visitor completes a qualifying action.
fa_payoutsA payout batch grouping multiple affiliate transactions.
fa_payout_transactionsAn individual payout transaction for a single affiliate within a payout batch.
fa_visitsTracks each click of an affiliate referral link.
fa_customersA customer who made a purchase through an affiliate link.
fa_metaGeneric key-value meta storage for affiliate and other objects.
fa_creativesA marketing creative asset (banner, image, or text) managed in FluentAffiliate Pro. PRO

Entity Relationships ​

fa_affiliates ​

Represents a registered affiliate. Central model in FluentAffiliate.

Model class: Affiliate

ColumnTypeNullableDefaultDescription
idBIGINT(20)NO—Primary key, auto-increment.
contact_idBIGINT(20)YES—Optional FluentCRM contact ID linked to this affiliate.
user_idBIGINT(20)YES—WordPress user ID of the affiliate.
group_idBIGINT(20)YES—Affiliate group ID (Pro feature).
rateDOUBLEYESNULLCommission rate. Interpretation depends on rate_type.
total_earningsDOUBLEYES0Cumulative lifetime earnings (denormalised).
unpaid_earningsDOUBLEYES0Earnings not yet included in a paid payout.
referralsBIGINT(20)YES0Total referral count (denormalised).
visitsBIGINT(20)YES0Total visit count (denormalised).
lead_countsBIGINT(20)YES0Total lead count (denormalised).
rate_typeVARCHAR(100)YESpercentageCommission type — percentage or flat.
custom_paramVARCHAR(100)YES—Custom URL parameter value used for tracking.
payment_emailVARCHAR(192)YES—Email address used for payout delivery.
statusVARCHAR(100)YESactiveRecord status.
settingsLONGTEXTYES—Serialized JSON settings blob.
custom_fieldsJSONYES—JSON map of custom registration field values, keyed by field key (Pro feature — added by the DB-version migration).
noteLONGTEXTYES—Internal admin notes about the affiliate.
created_atTIMESTAMPYES—Timestamp when the record was created.
updated_atTIMESTAMPYES—Timestamp when the record was last updated.

fa_referrals ​

Represents a commission event generated when a referred visitor completes a qualifying action.

Model class: Referral

ColumnTypeNullableDefaultDescription
idBIGINT(20)NO—Primary key, auto-increment.
affiliate_idBIGINT(20)YES—Affiliate who earned this referral.
parent_idBIGINT(20)YES—Parent referral ID (for multi-tier, reserved).
customer_idBIGINT(20)YES—Customer record associated with this purchase.
visit_idBIGINT(20)YES—Visit that initiated this referral (if known).
descriptionLONGTEXTYES—Free-text description.
statusVARCHAR(100)YESpendingRecord status.
amountDOUBLEYESNULLCommission amount earned by the affiliate.
order_totalDOUBLEYESNULLTotal order value that generated the referral.
currencyCHAR(3)YES—ISO 4217 currency code (e.g. USD).
utm_campaignVARCHAR(100)YES—UTM campaign parameter from the tracking URL.
providerVARCHAR(100)YES—Integration slug that created this referral (e.g. woo, fluentcart).
provider_idBIGINT(20)YES—Provider-specific order/payment numeric ID.
provider_sub_idVARCHAR(192)YES—Provider-specific sub-ID (e.g. subscription ID).
productsLONGTEXTYES—JSON list of product IDs in the order.
payout_transaction_idBIGINT(20)YES—Payout transaction that included this referral.
payout_idBIGINT(20)YES—Parent payout record.
typeVARCHAR(100)YESsaleReferral type — sale, opt_in, or recurring_sale.
settingsLONGTEXTYES—Serialized JSON settings blob.
created_atTIMESTAMPYES—Timestamp when the record was created.
updated_atTIMESTAMPYES—Timestamp when the record was last updated.

fa_payouts ​

A payout batch grouping multiple affiliate transactions.

Model class: Payout

ColumnTypeNullableDefaultDescription
idBIGINT(20)NO—Primary key, auto-increment.
created_byBIGINT(20)YES—WordPress user ID of the admin who created the payout.
total_amountDOUBLEYESNULLSum of all transactions in this payout.
payout_methodVARCHAR(100)YESmanualDelivery method — manual, paypal, etc.
statusVARCHAR(100)YESdraftRecord status.
currencyCHAR(3)YES—ISO 4217 currency code (e.g. USD).
titleVARCHAR(192)YES—Human-readable payout title.
descriptionLONGTEXTYES—Free-text description.
settingsLONGTEXTYES—Serialized JSON settings blob.
created_atTIMESTAMPYES—Timestamp when the record was created.
updated_atTIMESTAMPYES—Timestamp when the record was last updated.

fa_payout_transactions ​

An individual payout transaction for a single affiliate within a payout batch.

Model class: Transaction

ColumnTypeNullableDefaultDescription
idBIGINT(20)NO—Primary key, auto-increment.
created_byBIGINT(20)YES—WordPress user ID of the admin who created the payout.
affiliate_idBIGINT(20)YES—Affiliate who earned this referral.
payout_idBIGINT(20)YES—Parent payout record.
total_amountDOUBLEYES0Sum of all transactions in this payout.
payout_methodVARCHAR(100)YESmanualDelivery method — manual, paypal, etc.
statusVARCHAR(100)YESpaidRecord status.
currencyCHAR(3)YES—ISO 4217 currency code (e.g. USD).
settingsLONGTEXTYES—Serialized JSON settings blob.
created_atTIMESTAMPYES—Timestamp when the record was created.
updated_atTIMESTAMPYES—Timestamp when the record was last updated.

fa_visits ​

Tracks each click of an affiliate referral link.

Model class: Visit

ColumnTypeNullableDefaultDescription
idBIGINT(20)NO—Primary key, auto-increment.
affiliate_idBIGINT(20)YES—Affiliate who earned this referral.
user_idBIGINT(20)YES—WordPress user ID of the affiliate.
referral_idBIGINT(20)YES—Referral created from this visit (if any).
urlMEDIUMTEXTYES—Destination URL linked from the creative.
referrerMEDIUMTEXTYES—HTTP referer of the visit.
utm_campaignVARCHAR(100)YES—UTM campaign parameter from the tracking URL.
utm_mediumVARCHAR(100)YES—UTM medium parameter.
utm_sourceVARCHAR(100)YES—UTM source parameter.
ipVARCHAR(100)YES—Hashed or raw visitor IP address.
created_atTIMESTAMPYES—Timestamp when the record was created.
updated_atTIMESTAMPYES—Timestamp when the record was last updated.

fa_customers ​

A customer who made a purchase through an affiliate link.

Model class: Customer

ColumnTypeNullableDefaultDescription
idBIGINT(20)NO—Primary key, auto-increment.
user_idBIGINT(20)YES—WordPress user ID of the affiliate.
by_affiliate_idBIGINT(20)YES—Affiliate who referred this customer.
emailVARCHAR(192)YES—Customer email address.
first_nameVARCHAR(192)YES—Customer first name.
last_nameVARCHAR(192)YES—Customer last name.
ipVARCHAR(100)YES—Hashed or raw visitor IP address.
settingsLONGTEXTYES—Serialized JSON settings blob.
created_atTIMESTAMPYES—Timestamp when the record was created.
updated_atTIMESTAMPYES—Timestamp when the record was last updated.

fa_meta ​

Generic key-value meta storage for affiliate and other objects.

Model class: Meta

ColumnTypeNullableDefaultDescription
idBIGINTNO—Primary key, auto-increment.
object_typeVARCHAR(50)NO—Type of object this meta belongs to (e.g. affiliate).
object_idBIGINTYES—ID of the associated object.
meta_keyVARCHAR(192)NO—Meta key.
valueLONGTEXTYES—Meta value (serialized if complex).
created_atTIMESTAMPYES—Timestamp when the record was created.
updated_atTIMESTAMPYES—Timestamp when the record was last updated.

fa_creatives PRO ​

A marketing creative asset (banner, image, or text) managed in FluentAffiliate Pro.

Model class: Creative

ColumnTypeNullableDefaultDescription
idBIGINT(20)NO—Primary key, auto-increment.
nameVARCHAR(255)NO—Creative asset name.
descriptionTEXTYES—Free-text description.
typeVARCHAR(100)NO—Creative type — image, text, html, banner.
imageTEXTYES—URL of the creative image asset.
textTEXTYES—Text content for text-type creatives.
urlTEXTYES—Destination URL linked from the creative.
privacyVARCHAR(100)YESpublicVisibility — public or private.
statusVARCHAR(100)YESactiveRecord status.
affiliate_idsJSONYES—JSON array of affiliate IDs this creative is restricted to.
group_idsJSONYES—JSON array of group IDs this creative is restricted to.
metaLONGTEXTYES—Additional metadata for the creative.
created_atTIMESTAMPYES—Timestamp when the record was created.
updated_atTIMESTAMPYES—Timestamp when the record was last updated.

FluentAffiliate developer documentation