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

# How to Update Export Items

export const WhatComesNext = ({children, href}) => <div className="mt-4">
    <a href={href} className="
        inline-flex items-center justify-center
        rounded-full
        bg-black text-white dark:bg-[#1f262b]
        px-5 py-2.5 text-sm font-medium
        no-underline border-0
        hover:bg-[#ffe6ea] dark:hover:bg-[#2b1f23]
        hover:text-black
        transition-colors
      ">
      {children} →
    </a>
  </div>;

export const UpdateExportItemsDiagram = () => {
  const diagram = `
%%{init: {"themeVariables": {"fontSize": "22px"}}}%%
flowchart LR
    S1["1. Collect Results<br><br>"] --> S2["2. Build Update Payload"] --> S3["3. Batch Items<br><br>"] --> S4["4. Send Request<br><br>"] --> S5["5. Handle Response"]

click S1 "#1-collect-results"
click S2 "#2-build-update-payload"
click S3 "#3-batch-items"
click S4 "#4-send-request"
click S5 "#5-handle-response"

style S1 white-space:normal
style S2 white-space:normal
style S3 white-space:normal
style S4 white-space:normal
style S5 white-space:normal
`;
  return <Mermaid chart={diagram} />;
};

export const WorkflowDiagramTopNav = ({highlight}) => {
  const highlightStyle = highlight ? `style ${highlight} stroke:#f63b92,stroke-width:5px` : "";
  const diagram = `
%%{init: {"themeVariables": {"fontSize": "28px"}}}%%
flowchart LR

  WEBAPP["Queue Export Items in Pleo's Web App"]

subgraph Pleo["Pleo API's"]
    START1[" "]
    A["1.Detect & Start Export Jobs"] --> B["2.Perform Pre-Export Validation"]
    B --> C["3.Retrieve Export Job Items for Processing"]
    C --> D["4.Fetch Export Item Data for Processing"]
end

subgraph ERP["AS/ERP"]
    START2[" "]
    E["5.Process & Record Export Items"]
end

subgraph Pleo2["Pleo API's"]
    START3[" "]
    F["6.Update Export Items"] --> G["7.Update & Complete Export Job"]
end
WEBAPP --> A
D --> E
E --> F

click WEBAPP "/docs/current/how-tos/accounting-integrations/how-to-queue-export-items-in-ui"
click A "/docs/current/how-tos/accounting-integrations/how-to-detect-and-start-export-jobs-for-as-erp-processing"
click B "/docs/current/how-tos/accounting-integrations/how-to-perform-pre-export-validation-for-as-erp-processing"
click C "/docs/current/how-tos/accounting-integrations/how-to-retrieve-export-job-items-for-as-erp-processing"
click D "/docs/current/how-tos/accounting-integrations/how-to-fetch-export-item-data-for-as-erp-processing"
click E "/docs/current/how-tos/accounting-integrations/how-to-determine-the-bookkeeping-method-for-as-erp-processing"
click F "/docs/current/how-tos/accounting-integrations/how-to-update-export-items-for-as-erp-processing"
click G "/docs/current/how-tos/accounting-integrations/how-to-update-and-complete-export-job-for-as-erp-processing"

style WEBAPP white-space:normal
style Pleo white-space:normal
style ERP white-space:normal
style Pleo2 white-space:normal
style A white-space:normal
style B white-space:normal
style C white-space:normal
style D white-space:normal
style E white-space:normal
style F white-space:normal
style G white-space:normal

style START1 fill:transparent,stroke:transparent,color:transparent
style START2 fill:transparent,stroke:transparent,color:transparent
style START3 fill:transparent,stroke:transparent,color:transparent
style Pleo fill:none,stroke:#000000
style ERP fill:none,stroke:#000000
style Pleo2 fill:none,stroke:#000000

${highlightStyle}
`;
  return <Mermaid chart={diagram} />;
};

export const NoteCallout = ({title, children, icon = "💡"}) => <div style={{
  backgroundColor: 'var(--recommended-bg)',
  borderLeft: '4px solid #3beaf6',
  borderRadius: '10px',
  padding: '18px 22px',
  marginBottom: '20px',
  boxShadow: '1px 1px 3px rgba(0,0,0,0.06)'
}}>
    <div style={{
  display: 'flex',
  alignItems: 'flex-start',
  gap: '14px'
}}>
      <span style={{
  fontSize: '22px',
  lineHeight: '1',
  flexShrink: 0
}}>
        {icon}
      </span>
      <div>
        {title && <div style={{
  fontSize: '16px',
  fontWeight: 600,
  color: 'var(--recommended-title)',
  marginBottom: '6px'
}}>
            {title}
          </div>}
        <div style={{
  fontSize: '14px',
  lineHeight: 1.65
}}>
          {children}
        </div>
      </div>
    </div>
  </div>;

export const RememberCallout = ({title, children, icon = "🪢"}) => <div style={{
  backgroundColor: 'var(--recommended-bg)',
  borderLeft: '4px solid #f63b92',
  borderRadius: '10px',
  padding: '18px 22px',
  marginBottom: '20px',
  boxShadow: '1px 1px 3px rgba(0,0,0,0.06)'
}}>
    <div style={{
  display: 'flex',
  alignItems: 'flex-start',
  gap: '14px'
}}>
      <span style={{
  fontSize: '22px',
  lineHeight: '1',
  flexShrink: 0
}}>
        {icon}
      </span>
      <div>
        {title && <div style={{
  fontSize: '16px',
  fontWeight: 600,
  color: 'var(--recommended-title)',
  marginBottom: '6px'
}}>
            {title}
          </div>}
        <div style={{
  fontSize: '14px',
  lineHeight: 1.65
}}>
          {children}
        </div>
      </div>
    </div>
  </div>;

<WorkflowDiagramTopNav highlight="F" />

<div style={{ border: "2px solid #f63b92", borderRadius: "8px", padding: "16px", backgroundColor: "transparent" }}>
  <UpdateExportItemsDiagram />
</div>

## Prerequisites

Before you begin:

* You've [processed Export Items in your AS/ERP](/docs/current/how-tos/accounting-integrations/how-to-apply-posting-behaviour-for-as-erp-processing#5-create-entry-and-capture-result)
* You've captured a success or failure result for each item

## Constraints

* Maximum 100 items per API request
* Each item must include its accountingEntryId
* Supports both successful and failed updates

<RememberCallout title="Remember">
  Export Item updates must be sent in batches of up to 100 items per request.
</RememberCallout>

## Steps

### 1. Collect Results

For each processed Export Item, ensure you have:

* `accountingEntryId` (get this from [`/v3/export-items`](/docs/current/how-tos/accounting-integrations/how-to-fetch-export-item-data-for-as-erp-processing))
* result: **successful** or **failed** (get this from your [AS/ERP](/docs/current/how-tos/accounting-integrations/how-to-apply-posting-behaviour-for-as-erp-processing#5-create-entry-and-capture-result) system)

### 2. Build Update Payload

<RememberCallout title="Remember">
  Use one of the supported [`status`](/reference/export-api/export-api-v3/update-export-job-items#body-items-status) parameters.
</RememberCallout>

For field definitions (`externalId`, `externalUrl`, `exportedAt`), supported `failureReasonType` values, and common error mappings, see the [Integration Design: Update Export Items](/docs/current/integration-design/exports/integration-design-exports-update-export-items).

**Successful item**

```json theme={null}
{
  "accountingEntryId": "ENTRY_ID",
  "status": "successful",
  "externalId": "JE-10452",
  "externalUrl": "https://erp.example.com/journal/JE-10452"
}
```

**Failed item**

```json theme={null}
{
  "accountingEntryId": "ENTRY_ID",
  "status": "failed",
  "failureReason": "Vendor not found in ERP",
  "failureReasonType": "accounting_system_validation_failure"
}
```

<RememberCallout title="Remember">
  Use one of the supported [`failureReasonTypes`](/reference/export-api/export-api-v3/update-export-job-items#body-items-failure-reason-type)
</RememberCallout>

### 3. Batch Items

Group items into batches of up to 100:

```pseudo theme={null}
batches = chunk(items, 100)
```

### 4. Send Request

**API Endpoint**: PUT [v3/export-jobs/`{jobId}`/items](/reference/export-api/export-api-v3/update-export-job-items)

**Example parameters:**

* jobId: `8eb648ab-464b-42a0-ba17-eda703657e33`
* accountingEntryId: `59540ed2-0d68-4e36-9e31-58223975d9e9`
* accountingEntryId: `6678bcee-c6a4-4b49-bb1e-8f9fd653d16c`
* accountingEntryId: `9ea2ef81-4d73-460d-bbb4-ccf3da6f6f61`
* accountingEntryId: `0c76ea71-aaaa-4ece-bb68-e1166ccaea04`

<Tabs>
  <Tab title="OAuth 2.0">
    ```bash theme={null}
    curl -X PUT https://api.pleo.io/v3/export-jobs/8eb648ab-464b-42a0-ba17-eda703657e33/items \
      -H "Authorization: Bearer <token>" \
      -H "Content-Type: application/json" \
      -d '
      [
        {
          "accountingEntryId": "59540ed2-0d68-4e36-9e31-58223975d9e9",
          "status": "successful",
          "exportedAt": "2026-04-22T10:08:56Z",
          "externalId": "ext-1234",
          "externalUrl": "ext-url"
        },
        {
          "accountingEntryId": "6678bcee-c6a4-4b49-bb1e-8f9fd653d16c",
          "status": "successful",
          "exportedAt": "2026-04-22T10:08:56Z",
          "externalId": "ext-5678",
          "externalUrl": "ext-url"
        },
        {
          "accountingEntryId": "9ea2ef81-4d73-460d-bbb4-ccf3da6f6f61",
          "status": "successful",
          "exportedAt": "2026-04-22T10:08:56Z",
          "externalId": "ext-9012",
          "externalUrl": "ext-url"
        },
        {
        "accountingEntryId": "0c76ea71-aaaa-4ece-bb68-e1166ccaea04",
        "status": "failed",
        "exportedAt": "2026-04-22T10:08:56Z",
        "failureReason": "Receipt corrupt",
        "failureReasonType": "receipt_conversion_failure",
        }
      ]'
    ```
  </Tab>

  <Tab title="API Key">
    ```bash theme={null}
    curl --request PUT \
      -u "pls_cb0b832ea4ae4e3da96bc1188d60be24_41d579:" \
      -H "Accept: application/json;charset=UTF-8" \
      -H "Content-Type: application/json" \
      "https://external.staging.pleo.io/v3/export-jobs/8eb648ab-464b-42a0-ba17-eda703657e33/items" \
      -d '
    [
      {
        "accountingEntryId": "59540ed2-0d68-4e36-9e31-58223975d9e9",
        "status": "successful",
        "exportedAt": "2026-04-22T10:08:56Z",
        "externalId": "ext-1234",
        "externalUrl": "ext-url"
      },
      {
        "accountingEntryId": "6678bcee-c6a4-4b49-bb1e-8f9fd653d16c",
        "status": "successful",
        "exportedAt": "2026-04-22T10:08:56Z",
        "externalId": "ext-5678",
        "externalUrl": "ext-url"
      },
      {
        "accountingEntryId": "9ea2ef81-4d73-460d-bbb4-ccf3da6f6f61",
        "status": "successful",
        "exportedAt": "2026-04-22T10:08:56Z",
        "externalId": "ext-9012",
        "externalUrl": "ext-url"
      },
      {
      "accountingEntryId": "0c76ea71-aaaa-4ece-bb68-e1166ccaea04",
      "status": "failed",
      "exportedAt": "2026-04-22T10:08:56Z",
      "failureReason": "Receipt corrupt",
      "failureReasonType": "receipt_conversion_failure",
      }
    ]
    ' | jq
    ```
  </Tab>
</Tabs>

### 5. Handle Response

```pseudo theme={null}
if response.success:
    markBatchAsCompleted()
else:
    retryOrLogError()
```

* Retry on transient failures
* Do not duplicate already successful updates

#### Example Response

```bash theme={null}
{
  "data": [
    {
      "exportJobId": "f588b4db-a5cf-457c-b736-8b05dc6a2fdf",
      "accountingEntryId": "59540ed2-0d68-4e36-9e31-58223975d9e9",
      "status": "successful",
      "externalId": "ext-1234",
      "externalUrl": "ext-url",
      "failureReasonType": null,
      "failureReason": null,
      "exportedAt": "2026-04-22T10:15:54Z"
    },
    {
      "exportJobId": "f588b4db-a5cf-457c-b736-8b05dc6a2fdf",
      "accountingEntryId": "6678bcee-c6a4-4b49-bb1e-8f9fd653d16c",
      "status": "successful",
      "externalId": "ext-5678",
      "externalUrl": "ext-url",
      "failureReasonType": null,
      "failureReason": null,
      "exportedAt": "2026-04-22T10:15:54Z"
    },
    {
      "exportJobId": "f588b4db-a5cf-457c-b736-8b05dc6a2fdf",
      "accountingEntryId": "9ea2ef81-4d73-460d-bbb4-ccf3da6f6f61",
      "status": "successful",
      "externalId": "ext-9012",
      "externalUrl": "ext-url",
      "failureReasonType": null,
      "failureReason": null,
      "exportedAt": "2026-04-22T10:15:54Z"
    },
    {
      "exportJobId": "f588b4db-a5cf-457c-b736-8b05dc6a2fdf",
      "accountingEntryId": "0c76ea71-aaaa-4ece-bb68-e1166ccaea04",
      "status": "failed",
      "externalId": null,
      "externalUrl": null,
      "failureReasonType": "receipt_conversion_failure",
      "failureReason": "Receipt corrupt",
      "exportedAt": null
    }
  ],
  "errors": []
}
```

#### Pleo Web App

Export Item results are recorded in Pleo but are **not fully surfaced to users until the Export Job is completed**.

Once the Export Job is finalised:

* Export status becomes visible in the **Export queue**
* Failed items and error details are available for review

## Result

After completing this step:

* The job remains in the queue for auditing and compliance purposes
* In Pleo's Web App:
  * Export progress is accurately reflected in the **Export queue** tab
  * Errors are visible to users for review and correction

<RememberCallout title="Remember">
  Each time you click **Export**, a new job is created in the export queue with a unique `jobId`.
</RememberCallout>

***

## What Comes Next?

<WhatComesNext href="/docs/current/how-tos/accounting-integrations/how-to-update-and-complete-export-job-for-as-erp-processing">
  How to Update and Complete an Export Job
</WhatComesNext>

***

<div className="text-xs uppercase" style={{ fontVariant: 'small-caps' }}>
  this how-to is part of:
</div>

<div className="mt-4 flex flex-wrap gap-2">
  <a
    href="/docs/current/guides/export-integration-workflow-guide"
    className="inline-flex items-center rounded-full border border-gray-300 dark:border-gray-600
px-3 py-1 text-xs font-medium
bg-white dark:bg-[#1f262b] text-black dark:text-white
hover:bg-gray-100 dark:hover:bg-[#2b2f33]
transition-colors"
  >
    Export Integration Workflow Guide
  </a>
</div>

***

## Related Reading

* [Export Lifecycle](/docs/current/platform/exports/lifecycle)
* [Connection and Authorisation Overview](/docs/current/integration-design/auth/integration-design-auth-overview)

***
