> ## 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.

# Retrieve Export Job Items

export const RememberCallout = ({title, children}) => <div className="callout-box callout-remember">
    <div className="callout-row">
      <span className="callout-icon">
        <svg width="22" height="22" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M229.66,98.34,172.39,155.8c11.46,22.93-1.72,45.86-10.11,57a8,8,0,0,1-12,.83L42.34,105.76A8,8,0,0,1,43,93.85c29.65-23.92,57.4-10,57.4-10l57.27-57.46a8,8,0,0,1,11.31,0L229.66,87A8,8,0,0,1,229.66,98.34Z" opacity="0.2" /><path d="M235.32,81.37,174.63,20.69a16,16,0,0,0-22.63,0L98.37,74.49c-10.66-3.34-35-7.37-60.4,13.14a16,16,0,0,0-1.29,23.78L85,159.71,42.34,202.34a8,8,0,0,0,11.32,11.32L96.29,171l48.29,48.29A16,16,0,0,0,155.9,224c.38,0,.75,0,1.13,0a15.93,15.93,0,0,0,11.64-6.33c19.64-26.1,17.75-47.32,13.19-60L235.33,104A16,16,0,0,0,235.32,81.37ZM224,92.69h0l-57.27,57.46a8,8,0,0,0-1.49,9.22c9.46,18.93-1.8,38.59-9.34,48.62L48,100.08c12.08-9.74,23.64-12.31,32.48-12.31A40.13,40.13,0,0,1,96.81,91a8,8,0,0,0,9.25-1.51L163.32,32,224,92.68Z" /></svg>
      </span>
      <div>
        {title && <div className="callout-title">
            {title}
          </div>}
        <div className="callout-body">
          {children}
        </div>
      </div>
    </div>
  </div>;

This page describes how integrations retrieve **Export Job Items** after an Export Job has been started.

Export Job Items represent the **control layer** of the export workflow. They define **which items must be processed** and track **processing state**, but do not contain full accounting data.

## Implementation

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

* [How to Retrieve Export Job Items for Processing](/docs/current/how-tos/accounting-integrations/how-to-retrieve-export-job-items-for-as-erp-processing)

## Purpose

* Retrieve all Export Job Items associated with an in-progress Export Job
* Determine the scope of processing
* Track per-item processing state
* Enable resumable and idempotent workflows

## Control Layer vs Data Layer

Export processing is split into two distinct responsibilities:

| Layer                     | Responsibility                   |
| ------------------------- | -------------------------------- |
| Control Layer (this step) | Identify items and track status  |
| Data Layer                | Retrieve full accounting payload |

This step operates **only on control data**.

<callout icon="💡" color="gray_bg">
  Export Job Items do not contain full accounting data. Use the Export Items endpoint to retrieve processing payloads.
</callout>

## Retrieving Export Job Items

Use the **Get Export Job Items** endpoint with the `jobId` of the in-progress Export Job.

```http theme={null}
GET /v3/export-jobs/{jobId}/items
```

This endpoint returns control data for each item, including:

* accountingEntryId (unique identifier)
* status (e.g. pending, in\_progress, successful, failed)
* export tracking fields (externalId, failureReason, etc.)

## Processing Scope

Export Job Items define which entries require processing.

At the start of the workflow:

* All items are typically in `pending` state
* The Export Job is `in_progress`

The integration should determine which items require work.

### Recommended Filtering

Only process items with:

* status = `pending`
* status = `in_progress`

```pseudo theme={null}
itemsToProcess = filter items where status == "pending" or status == "in_progress"
```

## Pagination

Export Job Items may be returned across multiple pages.

Integrations must retrieve all pages before beginning processing.

### Example Pagination Response

```
{
  "pagination": {
    "hasNextPage": true,
    "endCursor": "<cursor>"
  }
}
```

### Example Pseudo

```pseudo theme={null}
items = []

do:
    response = fetchItems(cursor)
    items.append(response.data)
    cursor = response.pagination.endCursor
while response.pagination.hasNextPage
```

<RememberCallout title="Remember">
  Processing a partial dataset may result in incomplete exports and inconsistent state.
</RememberCallout>

## Resumability & Recovery

Export workflows must be resilient to interruptions (e.g. crashes, network failures).

If the integration restarts:

* The Export Job may already be `in_progress`
* Some Export Items may already be processed

### Recovery Strategy

1. Re-fetch all Export Job Items
2. Filter for items still requiring processing
3. Resume from the last known state

```pseudo theme={null}
itemsToProcess = filter items where status == "pending"
```

This ensures the workflow is:

* resumable
* idempotent
* consistent

## Deterministic Processing Order

Export Items should be processed in a stable and predictable order.

Recommended strategies:

* chronological ordering (e.g. oldest transaction date)
* consistent ordering across retries

Deterministic ordering improves:

* reconciliation
* debugging
* auditability

## Idempotency Considerations

The integration must ensure that processing is safe to retry.

Recommended practices:

* Treat `accountingEntryId` as the unique identifier
* Avoid reprocessing items that are already completed
* Maintain local tracking if necessary

## Expected Outcome

After completing this step:

* All Export Job Items have been retrieved
* Processing scope is clearly defined
* Pagination has been resolved
* The workflow is resumable and deterministic
* No accounting data has been processed yet

## Upstream Dependencies

* Export Job has been started (`status = in_progress`)
* Integration authentication is configured

## Downstream Dependencies

* Fetch Export Item Data (data layer)
* AS/ERP processing workflow
* Export Item & Job status updates

***

## What Comes Next?

* [Fetch Export Item Data](/docs/current/integration-design/exports/integration-design-exports-fetch-export-items-data-layer)

***

## Related Reading

* [How to Retrieve Export Job Items for Processing](/docs/current/how-tos/accounting-integrations/how-to-retrieve-export-job-items-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)

***
