Skip to content

Referral and affiliate commission ​

Who: listener (referrer, referred); affiliate (ambassador); staff (programmes, review); system (attribution, commission posting).

Entry points ​

KindEntry
REST (referral)GET /me/referral, GET /me/referrals, POST /me/referral, GET/POST /me/attribution, POST /referrals/clicks, GET /referrals/:code/qr.svg
REST (affiliate)GET /affiliate-programmes, GET /affiliate-programmes/:slug, GET /affiliates/pages/:slug, GET /affiliates/codes/:code, GET /affiliates/links/:code/qr.svg, POST /affiliates/clicks, POST /affiliate-programmes/:slug/applications, GET /me/affiliate-applications, POST /me/affiliate-applications/:id/withdraw, /accept, /decline, GET /me/affiliates, PATCH /me/affiliates/:id/page, GET /me/affiliates/:id/dashboard, /commissions, GET/POST /me/affiliates/:id/links, PATCH …/links/:linkId
Staff/staff/affiliate-programmes… (create, status, invitations), /staff/affiliate-applications/:id/approve, /reject, /cancel, /staff/affiliates/:id/suspend, /reinstate, /terminate, GET /staff/affiliate-reports
Deep linkreferral (r/:code), referrals, affiliate (a/:slug), affiliateDashboard, affiliateInvitation, affiliateCommissions, affiliateApplications
Pushreferral.joined, referral.reward_earned, affiliate.invited, affiliate.approved, affiliate.application_rejected, affiliate.status_changed, affiliate.commission_earned, affiliate.commission_reversed

Flow: referral ​

  1. Referrer shares GET /me/referral (webUrl, deepLink, QR).
  2. The opener's page or app calls POST /referrals/clicks { code, channel } → clickToken; kept through sign-up.
  3. After sign-in POST /me/attribution { referralCode | clickToken } → one attribution per person forever (identity.user.attributed, identity.user.referred); referrer gets referral.joined. Fraud checks: inactive referrer, blocks, shared device.
  4. On the referred person's first paid (non-trial) subscription charge a reward is written, referral.reward_earned fires and both sides are credited subscription days.

Flow: affiliate ​

  1. Staff create a programme (commission %, duration) and may invite (affiliate.invited); people apply POST /affiliate-programmes/:slug/applications → staff approve (affiliate.approved) or reject.
  2. Affiliate creates links and a landing page; opens are POST /affiliates/clicks; attribution as above with affiliateCode or an a_ click token (an affiliate wins over a referral).
  3. Each paid subscription charge in the window accrues commission (affiliates.commission.accrued, affiliate.commission_earned); never on trials. affiliates.post-commissions posts matured commission to the affiliate's earnings (affiliates.commission.posted). A refund or chargeback reverses it (affiliates.commission.reversed).
  4. affiliates.expire-invitations closes old invitations.

Exit states ​

StateCodeActionsClient next
Attributed———
Already attributedREFERRAL_ALREADY_SET—Ignore silently
Window closed / invalidREFERRAL_WINDOW_CLOSED, REFERRAL_CODE_INVALID, REFERRAL_CLICK_INVALID—Drop the code
Fraud checkREFERRAL_NOT_ELIGIBLE—Drop the code
ProgrammeAFFILIATE_PROGRAMME_NOT_FOUND, AFFILIATE_PROGRAMME_CLOSED——
ApplicationAFFILIATE_APPLICATION_EXISTS, AFFILIATE_APPLICATION_DECIDED, AFFILIATE_ALREADY_MEMBER——
AffiliateAFFILIATE_SUSPENDED, AFFILIATE_LINK_LIMIT, AFFILIATE_CODE_TAKEN, AFFILIATE_SLUG_TAKEN——
One BVN per accountKYC_DOCUMENT_ALREADY_USED——

Known gaps ​

  • Referral rewards never happen: identity is built without its growth ports, so the reward consumer is never registered; referral.reward_earned never fires and no days are credited (B2).
  • The payment-fingerprint fraud check at reward time has no data (I18).

Plemuz API v2