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

# Enrichment Workflow Quick Guide

> A quick reference to the key steps for implementing the Accounting Enrichment workflow: build the payload, submit the request, handle responses, and optionally apply tags.

This quick guide walks through the steps to implement Accounting Enrichment. For parameter definitions, status descriptions, and API versions, see the [Enrichment API Overview](/reference/enrichment-api/enrichment-api-overview).

## Prerequisites

Your integration must be authenticated with the `accounting-entries:write` scope. See [Accounting Enrichment API Scopes](/reference/enrichment-api/enrichment-api-scopes).

## Workflow Overview

| Step                             | What happens                                                |
| -------------------------------- | ----------------------------------------------------------- |
| 1. Build the enrichment payload  | Gather transaction details and encode the receipt as Base64 |
| 2. Submit the enrichment request | Call the v2 enrichment endpoint                             |
| 3. Handle the response           | Act on the receipt status returned by Pleo                  |

## Step 1: Build the Enrichment Payload

Gather the required transaction details and encode the receipt file as Base64.

For the full list of required and optional parameters, see [Request Parameters](/reference/enrichment-api/enrichment-api-overview#request-parameters).

Supported receipt formats: PDF, PNG, JPEG, HEIC. The encoded string is submitted in the `receipts` array in the request body.

## Step 2: Submit the Enrichment Request

**Endpoint:** POST [`/v2/accounting-entries:enrich`](/reference/enrichment-api/enrichment-api-v2/enrich-accounting-entry)

Submit transaction details as query parameters and the encoded receipt in the request body:

```json theme={null}
{
  "receipts": ["<base64-encoded-receipt>"]
}
```

## Step 3: Handle the Response

Pleo returns a `receiptStatus` with every response. For status definitions, see [Receipt Statuses](/reference/enrichment-api/enrichment-api-overview#receipt-statuses).

* **`UPLOADED`**: Enrichment is complete. Store the `accountingEntryId` for reference.
* **`ACCEPTED`**: Pleo is retrying asynchronously. No action required; retrying will create duplicate receipts.
* **`ADDED_TO_RECEIPT_INBOX`**: Pleo could not make a reliable match. The receipt is placed in the spender's Pleo Receipt Inbox, accessible on mobile, for manual matching. Retry if within your retry window, otherwise stop.
* **`UNRESOLVED`**: The request could not be processed. Investigate the transaction details and do not retry with the same payload.

## Applying Tags (Optional)

Tags apply Accounting Dimensions (Pleo Tags) to the matched accounting entry at enrichment time. For full details on how tags work, see [Tags Sync](/docs/current/integration-design/accounting-integrations/imports/tags/integration-design-tags-overview). Include validated Pleo Tag UUIDs in the request body alongside the receipt:

```json theme={null}
{
  "receipts": ["<base64-encoded-receipt>"],
  "tags": ["<tag-uuid>"]
}
```

Before submitting with tags:

1. Retrieve tag IDs from your Tags Sync implementation: do not use hardcoded IDs.
2. Confirm each tag ID is present and not archived in your most recent synced snapshot.
3. If any ID cannot be validated, re-fetch from the Pleo Tags API and remap where possible.
4. If valid IDs cannot be resolved, omit the `tags` field and submit the receipt only.

<Warning>
  Never submit with invalid tag IDs. Pleo validates all submitted tag IDs before processing: if any ID is invalid, the entire request is rejected with `UNRESOLVED` and the receipt will not be attached to any accounting entry.
</Warning>

If Pleo rejects a tag, re-fetch tags, remap where possible, and resubmit. If valid IDs cannot be resolved, resubmit without the `tags` field.
