Skip to main content

Buyer and Invoice Import Examples

This document provides practical examples and templates for importing buyer and invoice data into Afakto.

Updated today

Buyer and Invoice Import Examples

This document provides practical examples and templates for importing buyer and invoice data into Afakto.


Table of Contents


Overview

How Buyers and Invoices Relate

graph TD
    C1[Company ACME01] --> B1[Buyer B001]
    C1 --> B2[Buyer B002]
    C2[Company WIDGETS01] --> B3[Buyer W001]    B1 --> I1[INV-2023-001]
    B1 --> I2[INV-2023-002]
    B2 --> I3[INV-2023-003]
    B3 --> I4[W-INV-001]

Import Sequence

flowchart LR
    A[1. Prepare<br/>Buyer CSV] --> B[2. Import<br/>Buyers]
    B --> C[3. Prepare<br/>Invoice CSV]
    C --> D[4. Import<br/>Invoices]
    D --> E[5. Verify<br/>Data]    style A fill:#fff3e0
    style B fill:#fff3e0
    style C fill:#e8f5e9
    style D fill:#e8f5e9
    style E fill:#e1f5fe

⚠️ Important: Always import buyers FIRST, then invoices. Invoices reference buyers by BUYER_CODE.

Key Limitations

Rule

Description

🏒 Multi-company support

Files can contain records for multiple companies (processed separately by COMPANY_CODE)

πŸ’± One currency per buyer

Each buyer can only have invoices in a single currency. Create separate buyer records for multi-currency customers

πŸ“„ Complete invoice files

Each invoice import must contain ALL current invoices per company. Missing invoices will have balance set to 0

🚫 No duplicates in file

Each record must appear only once per file. Duplicates are rejected based on business keys


Quick Start Templates

Copy-paste these templates to get started quickly.

πŸ“‹ Buyer Import Template (Basic)

COMPANY_CODE,BUYER_CODE,BUYER_NAME,ID_TYPE,ID_NUMBER,PAYMENT_TERMS,CURRENCY
ACME01,B001,Customer Name,VAT,XX123456789,30,EUR

πŸ“‹ Buyer Import Template (Full)

COMPANY_CODE,BUYER_CODE,BUYER_NAME,ID_TYPE,ID_NUMBER,PAYMENT_TERMS,CURRENCY,ADDRESS_STREET_NAME,ADDRESS_STREET_NUMBER,ADDRESS_POSTAL_CODE,ADDRESS_CITY,ADDRESS_STATE,ADDRESS_COUNTRY,CONTACT_NAME,CONTACT_EMAIL,CONTACT_PHONE,EXCLUSION_REASON
ACME01,B001,Customer Name,VAT,XX123456789,30,EUR,"Main Street","123",75001,"Paris","Île-de-France","FR","John Doe","[email protected]","+33123456789",

πŸ“‹ Invoice Import Template

COMPANY_CODE,BUYER_CODE,INV_TYPE,INV_NUMBER,REFERENCE,INV_DATE,DUE_DATE,CURRENCY,AMOUNT,BALANCE,PAYMENT_METHOD,RECONCILIATION_JOURNAL
ACME01,B001,INVOICE,INV-2023-001,ORDER-001,2023-05-01,2023-06-01,EUR,1000.00,1000.00,BANK_TRANSFER,


File Naming Convention

We recommend using a naming format that helps you identify and organize your import files:

yyyymmdd_description_type.csv

For example:

  • 20230515_ACME01_buyers.csv - Buyer data for ACME01 company

  • 20230515_all_companies_invoices.csv - Invoice data for all companies

  • 20230515_weekly_update_buyers.csv - Weekly buyer updates

  • 20230515_consolidated_invoices.csv - Consolidated invoice data

Choose a naming pattern that works best for your organization's file management practices.


Buyer Import Examples

Basic Buyer Examples

Minimum Required Fields

What it demonstrates: The simplest possible buyer import with only mandatory fields.

# Required: COMPANY_CODE, BUYER_CODE, BUYER_NAME, ID_TYPE, ID_NUMBER
# Optional: PAYMENT_TERMS (days), CURRENCY (defaults based on company settings)
COMPANY_CODE,BUYER_CODE,BUYER_NAME,ID_TYPE,ID_NUMBER,PAYMENT_TERMS,CURRENCY
ACME01,B001,Widgets Inc.,VAT,FR12345678901,30,EUR
ACME01,B002,Gadgets Corp,SIREN,123456789,45,EUR
ACME01,B003,Tech Solutions Ltd,DUNS_BRADSTREET,987654321,60,GBP


Multiple Buyers for One Company

What it demonstrates: Importing several buyers that belong to the same company.

COMPANY_CODE,BUYER_CODE,BUYER_NAME,ID_TYPE,ID_NUMBER,PAYMENT_TERMS
ACME01,B001,Widgets Inc.,VAT,FR12345678901,30
ACME01,B002,Gadgets Corp,SIREN,123456789,45
ACME01,B003,Tech Solutions Ltd,DUNS_BRADSTREET,987654321,60
ACME01,B004,Digital Services SA,SIRET,12345678901234,30
ACME01,B005,Hardware Supplies GmbH,VAT,DE123456789,60


Optional Payment Terms

What it demonstrates: Payment terms can be left empty when not applicable.

COMPANY_CODE,BUYER_CODE,BUYER_NAME,ID_TYPE,ID_NUMBER,PAYMENT_TERMS
ACME01,B001,Complete Buyer,VAT,FR12345678901,30
ACME01,B002,No Terms Buyer,SIREN,123456789,

πŸ’‘ The second buyer has an empty PAYMENT_TERMS field β€” this is valid.


Advanced Buyer Examples

Full Contact and Address Details

What it demonstrates: Complete buyer records including physical address and contact information.

# Full buyer data with address and contact fields
COMPANY_CODE,BUYER_CODE,BUYER_NAME,ID_TYPE,ID_NUMBER,PAYMENT_TERMS,CURRENCY,ADDRESS_STREET_NAME,ADDRESS_STREET_NUMBER,ADDRESS_POSTAL_CODE,ADDRESS_CITY,ADDRESS_STATE,ADDRESS_COUNTRY,CONTACT_NAME,CONTACT_EMAIL,CONTACT_PHONE
ACME01,B001,Widgets Inc.,VAT,FR12345678901,30,EUR,"Main St","123",75001,"Paris","Île-de-France","FR","Jean Dupont","[email protected]","+33123456789"
ACME01,B002,Gadgets Corp,SIREN,123456789,45,EUR,"Tech Blvd","456",10115,"Berlin","Berlin","DE","Hans Schmidt","[email protected]","+49987654321"
ACME01,B003,Tech Solutions Ltd,DUNS_BRADSTREET,987654321,60,GBP,"Innovation Ave","789","EC1A 1BB","London","Greater London","GB","Sarah Johnson","[email protected]","+44123456789"


Different ID Types by Country

What it demonstrates: Various identification types supported for different countries and entity types.

ID_TYPE

Typical Use

SIREN

French companies (9 digits)

SIRET

French establishments (14 digits)

VAT

EU VAT numbers

DUNS_BRADSTREET

US/International companies

COMMERCIAL_REGISTER

Various countries

NATIONAL_REGISTRATION_NUMBER

Country-specific IDs

COMPANY_CODE,BUYER_CODE,BUYER_NAME,ID_TYPE,ID_NUMBER,PAYMENT_TERMS
ACME01,B001,French Company SAS,SIREN,123456789,30
ACME01,B002,German GmbH,VAT,DE123456789,45
ACME01,B003,UK Limited,VAT,GB123456789,30
ACME01,B004,US Corporation,DUNS_BRADSTREET,123456789,60
ACME01,B005,Spanish SL,COMMERCIAL_REGISTER,B12345678,45
ACME01,B006,Belgian SPRL,NATIONAL_REGISTRATION_NUMBER,BE0123456789,30


Multi-Company Import

What it demonstrates: A single file containing buyers for multiple companies.

# Buyers from different companies can be mixed in one file
# System processes each company separately based on COMPANY_CODE
COMPANY_CODE,BUYER_CODE,BUYER_NAME,ID_TYPE,ID_NUMBER,PAYMENT_TERMS,CURRENCY
ACME01,B001,Widgets Inc.,VAT,FR12345678901,30,EUR
ACME01,B002,Gadgets Corp,SIREN,123456789,45,EUR
WIDGETS01,W001,Tech Solutions Ltd,DUNS_BRADSTREET,987654321,60,GBP
GADGETS01,G001,Innovative Systems,SIREN,555666777,30,EUR
ACME01,B003,Simple Company,VAT,ES12345678B,30,EUR
WIDGETS01,W002,Advanced Tech,VAT,DE123456789,45,USD


Buyers with Exclusion Reasons

What it demonstrates: Marking certain buyers as excluded from factoring with documented reasons.

# EXCLUSION_REASON: Empty for normal buyers, text reason to exclude from factoring
COMPANY_CODE,BUYER_CODE,BUYER_NAME,ID_TYPE,ID_NUMBER,PAYMENT_TERMS,CURRENCY,EXCLUSION_REASON
ACME01,B001,Reliable Corp,VAT,FR12345678901,30,EUR,
ACME01,B002,US Customer Inc,DUNS_BRADSTREET,123456789,45,USD,
ACME01,B003,Risky Business Ltd,SIREN,987654321,30,EUR,"High credit risk - multiple defaults"
ACME01,B004,UK Partner Ltd,VAT,GB123456789,60,GBP,
ACME01,B005,Disputed Client SA,VAT,ES12345678B,30,EUR,"Ongoing legal dispute"
ACME01,B006,Swiss Company AG,VAT,CH123456789,30,CHF,

Key points:

  • βœ… Multi-currency support: EUR, USD, GBP, CHF

  • βœ… Mix of normal and excluded buyers in same file

  • βœ… Exclusion reasons documented for audit trail


Invoice Import Examples

Basic Invoice Examples

Minimum Required Fields

What it demonstrates: Simple invoice import with essential fields only.

# Required: COMPANY_CODE, BUYER_CODE, INV_TYPE, INV_NUMBER, INV_DATE, DUE_DATE, CURRENCY, AMOUNT, BALANCE, PAYMENT_METHOD
# Optional: REFERENCE, RECONCILIATION_JOURNAL
COMPANY_CODE,BUYER_CODE,INV_TYPE,INV_NUMBER,REFERENCE,INV_DATE,DUE_DATE,CURRENCY,AMOUNT,BALANCE,PAYMENT_METHOD,RECONCILIATION_JOURNAL
ACME01,B001,INVOICE,INV-2023-001,ORDER-2023-001,2023-05-01,2023-06-01,USD,1000.00,1000.00,BANK_TRANSFER,
ACME01,B002,INVOICE,INV-2023-002,PO-456789,2023-05-15,2023-06-15,EUR,2500.00,2500.00,BANK_TRANSFER,
ACME01,B003,INVOICE,INV-2023-003,REF-UK-001,2023-05-10,2023-06-10,GBP,3000.00,3000.00,BANK_CHECK,


All Invoice Types

What it demonstrates: The different INV_TYPE values supported by the system.

INV_TYPE

Description

Amount Sign

INVOICE

Standard invoice

Positive

CREDIT_NOTE

Credit note / refund

Negative

PAYMENT

Unapplied or rejected payment

Either

OTHER

Other document types

Either

COMPANY_CODE,BUYER_CODE,INV_TYPE,INV_NUMBER,REFERENCE,INV_DATE,DUE_DATE,CURRENCY,AMOUNT,BALANCE,PAYMENT_METHOD,RECONCILIATION_JOURNAL
ACME01,B001,INVOICE,INV-2023-001,ORDER-2023-001,2023-05-01,2023-06-01,USD,1000.00,1000.00,BANK_TRANSFER,
ACME01,B001,CREDIT_NOTE,CN-2023-001,,2023-05-05,2023-05-05,USD,-200.00,-200.00,BANK_TRANSFER,
ACME01,B002,OTHER,OD-2023-001,MISC-REF-001,2023-05-15,2023-06-15,EUR,2500.00,2500.00,BANK_TRANSFER,
ACME01,B002,PAYMENT,UP-2023-001,,2023-05-20,2023-05-20,EUR,-500.00,-500.00,BANK_TRANSFER,
ACME01,B003,INVOICE,INV-2023-003,PO-UK-789,2023-05-10,2023-06-10,GBP,3000.00,3000.00,BANK_CHECK,


Partially Paid and Fully Paid Invoices

What it demonstrates: How to represent payment status using AMOUNT vs BALANCE.

# AMOUNT = Original invoice amount (never changes)
# BALANCE = Current outstanding amount (decreases as payments are received)
COMPANY_CODE,BUYER_CODE,INV_TYPE,INV_NUMBER,REFERENCE,INV_DATE,DUE_DATE,CURRENCY,AMOUNT,BALANCE,PAYMENT_METHOD,RECONCILIATION_JOURNAL
ACME01,B001,INVOICE,INV-2023-001,ORDER-2023-001,2023-05-01,2023-06-01,USD,1000.00,600.00,BANK_TRANSFER,
ACME01,B002,INVOICE,INV-2023-002,PO-456789,2023-05-15,2023-06-15,EUR,2500.00,1500.00,BANK_TRANSFER,
ACME01,B003,INVOICE,INV-2023-003,REF-PAID-001,2023-05-10,2023-06-10,GBP,3000.00,0.00,BANK_CHECK,RECON-123

πŸ’‘ For fully paid invoices (balance = 0), include the RECONCILIATION_JOURNAL reference.


Advanced Invoice Examples

Multi-Currency with Buyer Suffixes

What it demonstrates: Handling the same customer with invoices in different currencies.

⚠️ Remember: Each buyer can only have invoices in ONE currency. Use buyer code suffixes for multi-currency customers.

# Same customer "B001" with different currencies requires separate buyer codes
COMPANY_CODE,BUYER_CODE,INV_TYPE,INV_NUMBER,INV_DATE,DUE_DATE,CURRENCY,AMOUNT,BALANCE,PAYMENT_METHOD,RECONCILIATION_JOURNAL
ACME01,B001-USD,INVOICE,INV-2023-001,2023-05-01,2023-06-01,USD,1000.00,1000.00,BANK_TRANSFER,
ACME01,B001-USD,INVOICE,INV-2023-002,2023-05-02,2023-06-02,USD,1500.00,1500.00,BANK_TRANSFER,
ACME01,B001-EUR,INVOICE,INV-2023-003,2023-05-03,2023-06-03,EUR,2000.00,2000.00,BANK_TRANSFER,
ACME01,B002-CHF,INVOICE,INV-2023-004,2023-05-04,2023-06-04,CHF,2500.00,2500.00,BANK_TRANSFER,
ACME01,B003-JPY,INVOICE,INV-2023-005,2023-05-05,2023-06-05,JPY,300000.00,300000.00,BANK_TRANSFER,


All Payment Methods

What it demonstrates: The different PAYMENT_METHOD values available.

PAYMENT_METHOD

Description

BANK_TRANSFER

Wire/bank transfer

BANK_CHECK

Check payment

DRAFT

Bank draft

POSTAL_TRANSFER

Postal money order

OTHERS

Other payment types

COMPANY_CODE,BUYER_CODE,INV_TYPE,INV_NUMBER,INV_DATE,DUE_DATE,CURRENCY,AMOUNT,BALANCE,PAYMENT_METHOD,RECONCILIATION_JOURNAL
ACME01,B001,INVOICE,INV-2023-001,2023-05-01,2023-06-01,USD,1000.00,1000.00,BANK_TRANSFER,
ACME01,B002,INVOICE,INV-2023-002,2023-05-02,2023-06-02,USD,1500.00,1500.00,BANK_CHECK,
ACME01,B003,INVOICE,INV-2023-003,2023-05-03,2023-06-03,USD,2000.00,2000.00,DRAFT,
ACME01,B004,INVOICE,INV-2023-004,2023-05-04,2023-06-04,USD,2500.00,2500.00,POSTAL_TRANSFER,
ACME01,B005,INVOICE,INV-2023-005,2023-05-05,2023-06-05,USD,3000.00,3000.00,OTHERS,


Multi-Company Invoice Import

What it demonstrates: Invoices for multiple companies in a single file.

# Invoices from different companies can be mixed in one file
# System processes each company separately based on COMPANY_CODE
COMPANY_CODE,BUYER_CODE,INV_TYPE,INV_NUMBER,INV_DATE,DUE_DATE,CURRENCY,AMOUNT,BALANCE,PAYMENT_METHOD,RECONCILIATION_JOURNAL
ACME01,B001,INVOICE,INV-2023-001,2023-05-01,2023-06-01,USD,1000.00,1000.00,BANK_TRANSFER,
WIDGETS01,W001,INVOICE,W-INV-2023-001,2023-05-02,2023-06-02,EUR,1500.00,1500.00,BANK_TRANSFER,
GADGETS01,G001,INVOICE,G-INV-2023-001,2023-05-03,2023-06-03,GBP,2000.00,2000.00,BANK_CHECK,


Common Scenarios and Solutions

Scenario 1: Initial Data Load

When first setting up Afakto:

flowchart TD
    A[Export buyer list from ERP] --> B[Format as CSV]
    B --> C[Import buyers to Afakto]
    C --> D[Export outstanding invoices from ERP]
    D --> E[Format as CSV]
    E --> F[Import invoices to Afakto]
    F --> G[Verify data in Afakto]

  1. βœ… Prepare and import your complete buyer list

  2. βœ… Prepare and import all your outstanding invoices

  3. βœ… Verify the data in the system


Scenario 2: Regular Updates

For accurate cession operations, we recommend daily updates:

  1. Import any new buyers or updates to existing buyers

  2. Import ALL current invoices for each company

    • ⚠️ Each invoice import file must contain the complete set of active invoices

    • ⚠️ Do not split invoice imports into multiple files for the same company

    • ⚠️ Missing invoices will have their balance set to 0

Best Practice: Perform a complete data update just before each cession operation.


Scenario 3: Correcting Errors

If you discover errors in your imported data:

  1. Correct the data in your CSV file

  2. Use a unique filename (e.g., add _corrected or timestamp)

  3. Re-import the corrected data

  4. Verify the corrections

⚠️ The system blocks reimports of files with the same name. Always use unique filenames.


Tips for Successful Imports

Tip

Description

πŸ§ͺ Start Small

Test with a small data subset before full import

βœ… Validate First

Check CSV files for errors before importing

πŸ“ Be Consistent

Maintain consistent formatting across all imports

πŸ“ Document Process

Keep records of your import procedures

πŸ”„ Buyers First

Always import buyers before their invoices

πŸ“ Unique Filenames

Use unique names for each import file


By following these examples and tips, you can ensure smooth and successful data imports into Afakto.

Did this answer your question?