Takealot Integration — Automation SOP

Version 3.0 | Effective: 26 July 2026 | Owner: Tsakane Sebone (Bookkeeper) | Approver: Chomba Chuma (GM)
System: ERPNext + Base44 Deno Backend Functions

⚡ THE GOLDEN RULE

TOTAL SALES INVOICES − TOTAL CASHFOCUS REMITTANCES = MONTHLY PURCHASE INVOICE

Daily consolidated invoices under Takealot B2C Customer
Weekly Friday deposits from CASHFOCUS 29830898 to FNB
Monthly PI from TAKEALOT MAIN for all fees deducted
If these don't balance → investigate the discrepancy

Why This Works

  1. Daily: We invoice Takealot B2C Customer for the FULL gross sales amount (VAT-inclusive)
  2. Weekly: Takealot pays us LESS — they deduct fees before remitting
  3. Monthly: Takealot issues a PI for ALL fees deducted = invoices minus what they paid us
GL Impact: DAILY (Sales Invoice — submitted): DR 300201 - Debtors (Takealot B2C Customer) [gross sales] CR 400000 - Cost of Goods [net] CR 200300 - VAT 15% [VAT] WEEKLY (Payment Entry — submitted): DR 300101 - FNB Current Account [remittance] CR 300201 - Debtors (Takealot B2C Customer) [remittance] MONTHLY (Purchase Invoice — DRAFT): DR 700600 - Commission on Sales [success + fulfillment fees] DR 500200 - Marketing [ad credits] DR 700900 - Sales & Distribution [storage fees] DR 700315 - Dues & Subscription [subscription] DR 200300 - VAT 15% [input VAT] CR 500100 - Trade Payables (TAKEALOT MAIN) [total fees] NET: Bank receives Sales - Fees (what Takealot actually pays)

1. Architecture — Three-Tier Automated Model

DAILY (00:01 SAST) WEEKLY (Sat 6am) MONTHLY (3rd of month) ───────────────── ────────────────── ────────────────────── Takealot API → CASHFOCUS 29830898 → Takealot Financial API → SUBMITTED Sales Invoice SUBMITTED Payment Entry DRAFT Purchase Invoice (one per day) (FIFO allocation) (fee breakdown from PDF)

Key Entities

EntityNameRole
CustomerTakealot B2C CustomerSingle B2B customer for all marketplace sales
SupplierTAKEALOT MAINSupplier for monthly platform fees
WarehouseTakealot - VStock sent to Takealot for fulfillment
Vendor ID29830898Takealot's bank remittance identifier
Bank RefCASHFOCUS 29830898How Takealot payments appear in FNB
IMPORTANT: SMTLC ≠ Takealot. SMTLC = New Clicks customer (completely separate). Bank rules only match CASHFOCUS 29830898 for Takealot.

2. Daily Sales Import (Automated — Creates & Submits)

  • Workflow: "Takealot Daily Sync (00:01 SAST)" — daily at 00:01 SAST
  • Function: takealotDailySync v2 (Deno backend function)
  • Fetches previous day's sales from Takealot Marketplace API
  • Creates ONE consolidated Sales Invoice per day (all orders as line items)
  • Auto-submits the invoice (docstatus=1) immediately
  • VAT-inclusive at 15%, source = "Takealot", warehouse = "Takealot - V"
  • PO Number: TA-DAILY-YYYY-MM-DD (used for dedup)
  • Bundle expansion: TA4L- and T4L- prefixes → 3 units of base SKU

3. Weekly Payment Reconciliation (Automated)

  • Workflow: "Takealot Weekly Reconciliation (Sat 6am)" — every Saturday 06:00 SAST
  • Function: takealotWeeklyRecon v2 (Deno backend function)
  • Takealot remits every Friday — bank narrative: CASHFOCUS 29830898
  • Payment is SHORT of invoice total — Takealot deducts fees before paying
  • Function: finds CASHFOCUS JEs → creates Payment Entry (full deposit) → allocates FIFO → submits
  • Excess deposit stays as credit on customer account for future invoices
Why Payment < Invoice Total: Week's Invoices: R100,000 (gross — what we invoiced) CASHFOCUS received: R75,000 (what Takealot actually paid us) Shortfall: R25,000 (fees Takealot deducted) → This R25,000 appears on the monthly Purchase Invoice from TAKEALOT MAIN → Golden Formula: R100,000 - R75,000 = R25,000 (the PI amount)

4. Monthly Fee Reconciliation (Automated)

  • Workflow: "Takealot Monthly PI (3rd of month)" — on the 3rd at 08:00 SAST
  • Agent downloads fee invoice PDF from Takealot API (/v2/financial/invoices)
  • Parses PDF and creates DRAFT Purchase Invoice from TAKEALOT MAIN
  • Verifies Golden Formula before creating PI — flags if discrepancy > R100
  • Status: DRAFT (needs Tsakane/Chomba approval per posting guardrails)

Fee Breakdown → GL Mapping

Fee TypeExpense AccountVAT
Success Fees700600 - Commission on Sales - V15%
Fulfilment Fees700600 - Commission on Sales - V15%
Stock Transfer / Removal700600 - Commission on Sales - V15%
Ad Credit Purchase500200 - Digital Marketing & Advertising - V15%
Storage Fees700900 - Sales And Distribution Expenses - V15%
Subscription Fee700315 - Dues And Subscription - V15%

Reconciliation Verification (when PI is created)

Step 1: Sum all daily Sales Invoices for the month Step 2: Sum all CASHFOCUS Payment Entries for the month Step 3: Calculate Invoices - CASHFOCUS = Expected PI Step 4: Compare with actual PI total from Takealot PDF Step 5: If difference > R100 → FLAG DISCREPANCY (do not create PI) Step 6: If balanced → create DRAFT PI for approval

5. Returns Processing

  1. Identify return in daily sync (negative qty or return_status)
  2. Create Credit Note against original daily Sales Invoice
  3. Write off damaged stock: Material Issue from "Takealot - V" warehouse
  4. If sellable: Transfer back to "Finished Goods - V" warehouse

6. Automation Status

ProcessTriggerStatus
Daily Sales Import + Submit00:01 SAST daily✅ Automated
Weekly Payment ReconciliationSat 06:00 SAST✅ Automated
Monthly Fee PI + Verification3rd of month 08:00 SAST✅ Automated
Bank Feed ClassificationMidnight SAST✅ Automated
Returns ProcessingEvent-driven🔧 Manual

7. Current Status (26 July 2026)

  • July invoices: 10 submitted (July 17-26) totaling R157,532.03
  • Payments: 3 Payment Entries totaling R162,307.46
  • Credit on account: R4,775.43 (excess deposit)
  • June PI: ACC-PINV-2026-00282 (R145,968.17) — DRAFT, needs approval
  • July PI: Will auto-generate on August 3 from Takealot API
  • June reconciliation: Manual (pre-automation period)