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

This is a one-way flow from your integration into Pleo. Before you start, your integration needs to already have the receipt file, the card's last four digits, and any other matching information the endpoint supports. Pleo then attempts to match the submitted details to an existing accounting entry. The endpoint is a POST, not a GET: it enriches an existing accounting entry with what you send it, and it can't be used to retrieve a receipt file or the card's last four digits from Pleo.

## Prerequisites

Before starting this workflow, your integration must already have:

* Authentication with the `accounting-entries:write` scope. See [Accounting Enrichment API Scopes](/reference/enrichment-api/enrichment-api-scopes).
* The receipt file to upload, in a supported format (PDF, PNG, JPEG, HEIC).
* The last four digits of the Pleo card used for the transaction.
* The required transaction details for matching: `amount`, `currency`, `merchant_name`, and at least one of `performed_at` or `settled_at` (optionally `email`). See [Transaction Details](/reference/enrichment-api/enrichment-api-overview#request-parameters).

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

Using the receipt and transaction details already available from prerequisites, 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).

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.
