> ## Documentation Index
> Fetch the complete documentation index at: https://developers.pleo.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Accounting Periods

This page describes how integrations must implement accounting period assignment when exporting expenses from Pleo.

Accounting periods must be assigned after Export Items are validated and before entries are posted to the Accounting System.

## Implementation

See the corresponding how-to article for API usage and step-by-step instructions:

* [How to Assign Accounting Periods](/docs/current/how-tos/accounting-integrations/how-to-assign-accounting-periods-for-as-erp-processing)

## Implementation Requirements

### 1. Determine Expense Date (source date)

Use the expense transaction date provided in the Export Item as the source date:

* Expense date = `date` of the Export Item

This is the baseline date the expense relates to, as provided by Pleo via Export API.

### 2. Determine posting date (date sent to the Accounting System)

The posting date is the date your integration will send to the Accounting System when creating the corresponding entry:

* **Posting date** = the date you post with (often starts as `date`)

In most cases:

```pseudo theme={null}
postingDate = exportItem.date
```

### 3. Closed period handling (integration configuration)

The Export API does **not** provide a closed-period adjustment setting.

If your integration needs to support posting expenses that fall into closed periods, you must implement this as an **integration configuration**.

Behaviour:

1. Attempt to post using: `postingDate = exportItem.date`
2. If the Accounting System **rejects** the posting because the period is closed, apply the configured strategy.

#### Recommended configuration options

* If **Closed period date adjustment** is **enabled** in the integration:
  * When the Accounting System rejects the posting date due to a closed period, apply the configured adjustment strategy. Common strategies include:
    * Set `postingDate = exportDate` (i.e., “today”)
    * Move `postingDate` to the **next open period** (per Accounting System rules)

* If **Closed period date adjustment** is **disabled**:
  * Attempt to post using the original Export Item transaction date (`postingDate = exportItem.date`)
  * If the Accounting System rejects closed periods, mark the Export Item as failed with a clear error (e.g., “Closed accounting period”)

### 4. Assign accounting period (Accounting System responsibility)

The integration must:

* map the **posting date** to the correct Accounting System period
* rely on Accounting System logic when periods are custom or fiscal-based

```pseudo theme={null}
period = accountingSystem.resolvePeriod(postingDate)
```

### 5. Custom accounting periods (non-calendar fiscal structures)

If the Accounting System uses non-calendar periods:

* use Accounting System APIs and/or configuration to resolve the correct period for `postingDate`
* ensure exported entries align with the system’s fiscal structure (do not assume Jan–Dec)

### 6. Optional: Service period (for accrual/amortisation)

If `exportItem.servicePeriod` is present, it indicates the time range the cost relates to (common for invoices). It can be used by the Accounting System to allocate costs across periods (accruals), but it does **not** change closed-period handling by itself.

```json theme={null}
"servicePeriod": {
"from": "YYYY-MM-DD",
"to": "YYYY-MM-DD"
}
```

## Processing Order

Accounting period assignment occurs within the export workflow:

```mermaid theme={null}
%%{init: {"themeVariables": {"fontSize": "12px"}}}%%
flowchart TD
    A[Fetch Export Items] --> B[Validate data]
    B --> C[Resolve bookkeeping method]
    C --> D[Assign accounting period #40;this step#41;]
    D --> E[Create accounting entries]

   %% Styling for readability
   style A white-space:normal
   style B white-space:normal
   style C white-space:normal
   style D white-space:normal
```

## Upstream Dependencies

* Export Job has been started (status = in\_progress)
* Fetch Export Item Data (data layer)
* Bookkeeping method resolved
* **Accounts Mapping** – determines which GL accounts are debited and credited
* **Data Mapping** – ensures amounts, dates, dimensions, identifiers, and VAT/tax information are recorded correctly
* **Attachment Handling** – links receipts and supporting documentation

## Downstream Dependencies

* **Posting Behaviour** – determines whether entries are created as drafts or finalised
* **Export Item status update** – updates outcome of Export Item (`successful` or `failed`)
* **Export Job status update** – updates outcome of Export Job (`completed`, `completed_with_errors` or `failed`)

***

## What Comes Next?

* [Posting Behaviour](/docs/current/integration-design/exports/integration-design-exports-posting-behaviour)

***

## Related Reading

* [How to Assign Accounting Periods](/docs/current/how-tos/accounting-integrations/how-to-assign-accounting-periods-for-as-erp-processing)
* [Export Integration Workflow Guide](/docs/current/guides/export-integration-workflow-guide)
* [AS/ERP Processing Workflow Guide](/docs/current/guides/accounting-system-processing-workflow-guide)

***
