Skip to main content
Accounts Mapping determines which ledger (GL) accounts are used when creating accounting entries. This step converts Export Item data into debit and credit postings in your Accounting System.

Prerequisites

Before you begin:

Relevant Export Item Fields

  {
      "companyId": "12abc3d4-e567-890e-1234-abc56e78fabc",
      "accountingEntryId": "59540ed2-0d68-4e36-9e31-58223975d9e9",
      "type": "card_purchase",
      "subType": null,
      "date": "2025-12-10T15:46:34Z",
      "amount": {
        "inSupplierCurrency": {
          "currency": "GBP",
          "value": 6366
        },
        "inWalletCurrency": {
          "currency": "GBP",
          "value": 6366
        }
      },
      "note": "Printer ink",
      "files": [
        {
          "url": "<string>",
          "type": "image/jpeg",
          "size": 13010
        }
      ],
      "supplier": {
        "code": "1340472473",
        "name": "Target",
        "categoryCode": "1000",
        "country": "GB",
        "account": null,
        "taxIdentifier": null
      },
      "user": {
        "id": "6b71f6bd-e83d-4d49-88ee-2b8cda2d57cf",
        "name": "Luke Richardson",
        "code": null
      },
      "team": {
        "id": "747aaf60-56c6-4b46-ad92-f8a0cb59cf8b",
        "code": "5678",
        "name": "Engineering"
      },
      "accountingEntryLines": [
        {
          "accountingEntryLineId": "0c76ea71-aaaa-4ece-bb68-e1166ccaea04",
          "lineAmount": {
            "inSupplierCurrency": {
              "currency": "GBP",
              "value": 6366
            },
            "inWalletCurrency": {
              "currency": "GBP",
              "value": 6366
            }
          },
          "netAmount": {
            "inSupplierCurrency": {
              "currency": "GBP",
              "value": 6366
            },
            "inWalletCurrency": {
              "currency": "GBP",
              "value": 6366
            }
          },
          "account": {
            "id": "7966c3ba-e4de-4574-8604-6cfa48d62cc8",
            "code": "6990000",
            "name": "Printing & Stationary",
            "identifier": "6990000"
          },
          "tax": {
            "id": "997d8526-5872-484d-ba07-c7a07e08e555",
            "code": "0001",
            "type": "inclusive",
            "amount": {
              "inSupplierCurrency": {
                "currency": "GBP",
                "value": 0
              },
              "inWalletCurrency": {
                "currency": "GBP",
                "value": 0
              }
            },
            "rate": 0.00
          },
          "tags": []
        }
      ],
      "additionalInformation": {
        "reconciliationId": "2500001",
        "reconciledEntries": null,
        "attendees": [],
        "invoiceInformation": null
      },
      "bookkeeping": {
        "method": "journal"
      },
      "vendor": {
        "id": "22e1f2c9-1360-4291-ab41-6b23dcea8888",
        "name": "TestVendor",
        "code": "acc1234",
        "externalId": "ext12345",
        "registrationNumber": "reg001234",
        "taxRegistrationNumber": "taxreg1234",
        "country": "UK",
        "defaultCurrency": "GBP"
      },
      "contraAccount": {
        "id": "993d664c-9b7c-4efc-a677-510e69200857",
        "code": "0876000",
        "name": "0876000_ChartAccounts",
        "identifier": "0876000"
      },
      "_links": {
        "web": {
          "exportItem": "https://app.staging.pleo.io/export/export-item/0c76ea71-aaaa-4ece-bb68-e1166ccaea04"
        }
      },
      "servicePeriod": null
    },
   # [other Export Items omitted for brevity]
   # [Pagination omitted for brevity]

Expense Account (line-level)

"accountingEntryLines": [
  {
    "account": {
      "id": "...",
      "code": "<string>",
      "name": "Meals and Entertainment"
    }
  }
]

Contra Account

"contraAccount": {
  "id": "...",
  "code": "<string>",
  "name": "Pleo Wallet Account"
}

Bookkeeping Method

"bookkeeping": {
  "method": "journal"
}

Vendor

"vendor": {
  "code": "<string>",
  "name": "ACME Ltd"
}

Steps

1. Determine Mapping Strategy

Mapping depends on:
  • bookkeeping.method
  • Export Item type / subType
  • availability of vendor
  • configured mapping rules

2. Apply Expense Account Mapping

For all cases:
  • The expense (debit) side comes from:
expenseAccount = mappingTable.get(accountingEntryLines[].account.code)
Each line is mapped individually.

3. Select Counter Account

Case A — Journal Entries

If:
"bookkeeping.method": "journal"
Then:
  • Counter account typically comes from:
contraAccount = mappingTable.get(contraAccount.code)
Used for:
  • wallet
  • bank
  • clearing accounts

Case B — Accounts Payable

If:
"bookkeeping.method": "accounts_payable"
Then:
  1. Attempt vendor match:
vendorAccount = resolveVendorAccount(vendor.code)
  1. Apply fallback:
if vendorAccount exists:
    counterAccount = vendorAccount
else:
    counterAccount = defaultAccountsPayableAccount

4. Apply Expense Type Rules (if applicable)

Depending on Export Item type:
  • card_purchase → contra account (wallet/bank)
  • invoice → AP account
  • wallet_topup → configured mapping accounts
Ensure your mapping logic supports these variations.

5. Validate Mapping

Before posting:
  • Account exists in Accounting System
  • Mapping is configured
  • Currency is compatible
If validation fails:
  • mark Export Item as failed
  • return clear failure reason

Results

After completing this step:
  • Each Export Item has:
    • a mapped expense (debit) account
    • a mapped counter (credit) account
  • Entries are balanced and ready for posting

What Comes Next?


this how-to is part of: