Skip to main content
Accounting period assignment ensures Export Items are posted into the correct financial period according to both Pleo configuration and Accounting System rules.

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 Date (source date)

This is the transaction date provided by Pleo and represents when the expense occurred.
"date": "2023-11-07T05:31:56Z"

Service Period (Optional)

Used for accrual or cost allocation purposes. It does not affect posting date or closed-period handling.
"servicePeriod": {
  "from": "...",
  "to": "..."
}

Steps

1. Determine Posting Date

The Export Item provides two dates:
  • Expense date (exportItem.date) — the transaction date from Pleo, representing when the expense occurred
  • Posting date — the date your integration sends to the Accounting System when creating the entry
By default these are the same:
postingDate = exportItem.date
The posting date may be adjusted later if the target period is closed (see Steps 3–4).

2. Attempt Posting

Submit the accounting entry to the Accounting System using the posting date:
postToAccountingSystem(exportItem, postingDate)
The Accounting System uses the posting date to determine which period the entry belongs to.
  • If the posting succeeds — the period is open and the entry is accepted. Proceed to Step 5.
  • If the posting is rejected due to a closed period — proceed to Step 3.

3. Handle Closed Period Rejection

A rejection at Step 2 signals that the posting date falls within a period the Accounting System has closed. This is the trigger to apply a closed period strategy.
if postingRejectedDueToClosedPeriod:
    applyClosedPeriodStrategy()

4. Apply Closed Period Strategy

The integration must define how to respond when a period is closed. Two options are supported:

Option A — Adjust posting date and retry

Adjust the posting date to an open period and return to Step 2:
postingDate = exportDate   # e.g. current date
or
postingDate = accountingSystem.findNextOpenPeriod(postingDate)
Then retry posting (return to Step 2).

Option B — Fail the Export Item

If adjustment is disabled or not permitted by the integration configuration:
markExportItemFailed("Closed accounting period")

5. Resolve Accounting Period

Once posting succeeds (either directly at Step 2 or after a date adjustment at Step 4), confirm which accounting period the entry has been assigned to using the final posting date:
period = accountingSystem.resolvePeriod(postingDate)
This is a confirmation step — the Accounting System resolves the period based on the final, possibly adjusted, posting date. If the Accounting System uses non-calendar or custom fiscal periods, use its APIs or configuration to resolve the correct period rather than assuming a standard January–December structure. This may involve:
  • calendar periods (monthly, quarterly)
  • fiscal periods
  • custom accounting calendars

Result

After completing this step:
  • A valid posting date has been determined
  • Closed period behaviour has been explicitly handled
  • The Accounting System assigns the correct accounting period

What Comes Next?


this how-to is part of: