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

# Migrate to the Accounting Entries API

> How to migrate from the legacy Expenses API to the Accounting Entries API for custom workflows.

export const WhatComesNext = ({children, href}) => <div className="mt-4">
    <a href={href} className="btn-primary">
      {children} →
    </a>
  </div>;

export const NoteCallout = ({title, children}) => <div className="callout-box callout-note">
    <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="M208,104a79.86,79.86,0,0,1-30.59,62.92A24.29,24.29,0,0,0,168,186v6a8,8,0,0,1-8,8H96a8,8,0,0,1-8-8v-6a24.11,24.11,0,0,0-9.3-19A79.87,79.87,0,0,1,48,104.45C47.76,61.09,82.72,25,126.07,24A80,80,0,0,1,208,104Z" opacity="0.2" /><path d="M176,232a8,8,0,0,1-8,8H88a8,8,0,0,1,0-16h80A8,8,0,0,1,176,232Zm40-128a87.55,87.55,0,0,1-33.64,69.21A16.24,16.24,0,0,0,176,186v6a16,16,0,0,1-16,16H96a16,16,0,0,1-16-16v-6a16,16,0,0,0-6.23-12.66A87.59,87.59,0,0,1,40,104.49C39.74,56.83,78.26,17.14,125.88,16A88,88,0,0,1,216,104Zm-16,0a72,72,0,0,0-73.74-72c-39,.92-70.47,33.39-70.26,72.39a71.65,71.65,0,0,0,27.64,56.3A32,32,0,0,1,96,186v6h64v-6a32.15,32.15,0,0,1,12.47-25.35A71.65,71.65,0,0,0,200,104Zm-16.11-9.34a57.6,57.6,0,0,0-46.56-46.55,8,8,0,0,0-2.66,15.78c16.57,2.79,30.63,16.85,33.44,33.45A8,8,0,0,0,176,104a9,9,0,0,0,1.35-.11A8,8,0,0,0,183.89,94.66Z" /></svg>
      </span>
      <div>
        {title && <div className="callout-title">
            {title}
          </div>}
        <div className="callout-body">
          {children}
        </div>
      </div>
    </div>
  </div>;

This guide is for partners who used the [Expenses API](/reference/pleo-deprecated/expenses/get-an-expense-for-a-company) to build custom expense-related workflows — for example syncing expenses to project management software, building dashboards, or generating reports. If you were building an accounting export integration, see [Migrate to the Export API](/deprecation/legacy-expense-api/migration-guide-expenses-api-to-export-api) instead.

## New to the Accounting Entries API?

<CardGroup cols={3}>
  <Card title="API Overview" icon="https://mintcdn.com/pleo-61d4d38b/earhx-WV21nRUBYy/images/current/icons/pleo-mcp-overview.svg?fit=max&auto=format&n=earhx-WV21nRUBYy&q=85&s=f999d6d938e4ad0d24ae6f1882c437b5" href="/reference/accounting-entries/accounting-entry-overview" width="256" height="256" data-path="images/current/icons/pleo-mcp-overview.svg">
    <div className="text-sm mt-2">What an Accounting Entry is and how the API is structured.</div>
  </Card>

  <Card title="API Scopes" icon="https://mintcdn.com/pleo-61d4d38b/earhx-WV21nRUBYy/images/current/icons/access-permissions.svg?fit=max&auto=format&n=earhx-WV21nRUBYy&q=85&s=5fdc4d93616eb532eb1b1e921e7775d7" href="/reference/accounting-entries/scopes" width="256" height="256" data-path="images/current/icons/access-permissions.svg">
    <div className="text-sm mt-2">Required scope: `accounting-entries:read`.</div>
  </Card>

  <Card title="Generate API Keys" icon="https://mintcdn.com/pleo-61d4d38b/earhx-WV21nRUBYy/images/current/icons/permissions-access.svg?fit=max&auto=format&n=earhx-WV21nRUBYy&q=85&s=436e53e35075566c61df866d1fc39a68" href="/docs/current/how-tos/api-keys/how-to-generate-standalone-api-keys" width="256" height="256" data-path="images/current/icons/permissions-access.svg">
    <div className="text-sm mt-2">How to generate standalone API keys for authenticating your integration.</div>
  </Card>
</CardGroup>

<CardGroup cols={2}>
  <Card title="Standalone API Key Guide" icon="https://mintcdn.com/pleo-61d4d38b/earhx-WV21nRUBYy/images/current/icons/permissions-access.svg?fit=max&auto=format&n=earhx-WV21nRUBYy&q=85&s=436e53e35075566c61df866d1fc39a68" href="/docs/current/guides/standalone-api-keys-workflow-guide" width="256" height="256" data-path="images/current/icons/permissions-access.svg">
    <div className="text-sm mt-2">End-to-end guide for authenticating with standalone API keys.</div>
  </Card>

  <Card title="Standalone API Keys with Postman" icon="https://mintcdn.com/pleo-61d4d38b/earhx-WV21nRUBYy/images/current/icons/oauth-with-postman.svg?fit=max&auto=format&n=earhx-WV21nRUBYy&q=85&s=4007b8f53e4ed869b339e65c60681a28" href="/docs/current/how-tos/api-keys/how-to-make-an-api-call-using-standalone-api-keys-postman" width="256" height="256" data-path="images/current/icons/oauth-with-postman.svg">
    <div className="text-sm mt-2">How to make API calls using standalone API keys in Postman.</div>
  </Card>
</CardGroup>

## Getting Started

You'll need API credentials with at least the [`accounting-entries:read`](/reference/accounting-entries/scopes) scope. Once authenticated, the two main endpoints you'll use are:

<WhatComesNext href="/reference/accounting-entries/v1/search-accounting-entries">
  Search Accounting Entries
</WhatComesNext>

<WhatComesNext href="/reference/accounting-entries/v1/get-accounting-entry-by-id">
  Get an Accounting Entry by ID
</WhatComesNext>

## Key Differences

* Field names and structure have changed. See [Field Mapping](#field-mapping) below.
* The Accounting Entries API uses cursor-based pagination.

## Field Mapping

The table below maps fields from the `Expense` model to their equivalents in the `AccountingEntry` model.

* `—` : field is not available in the AccountingEntry model
* `*` : data is the same but represented differently. See the [Accounting Entries API reference](/reference/accounting-entries) for details.

| `Expense` field               | `AccountingEntry` equivalent        |
| :---------------------------- | :---------------------------------- |
| id                            | id                                  |
| employeeId                    | employeeId                          |
| employeeCode                  | —                                   |
| departmentId                  | teamId                              |
| performedAt                   | performedAt                         |
| amountOriginal                | transactionValue                    |
| amountSettled                 | totalBillValue **\***               |
| note                          | note                                |
| type                          | family **\***                       |
| accountId                     | accountId                           |
| taxCodeId                     | taxCodeId                           |
| createdAt                     | createdAt                           |
| updatedAt                     | updatedAt                           |
| deletedAt                     | deletedAt                           |
| tagIds\[].id                  | tags\[].tagId                       |
| tagIds\[].tagGroupId          | tags\[].tagGroupId                  |
| receiptIds\[]                 | receiptIds\[]                       |
| settledExpenseIds\[]          | —                                   |
| status                        | status **\***                       |
| supplier.CIF                  | supplier.cif                        |
| supplier.documentNumber       | supplier.documentNumber             |
| cardTransaction.state         | —                                   |
| cardTransaction.authorizedAt  | —                                   |
| cardTransaction.settledAt     | settledAt                           |
| cardTransaction.reversedAt    | —                                   |
| cardTransaction.merchant.id   | —                                   |
| cardTransaction.merchant.name | —                                   |
| lines\[].amountSettled        | splitItems\[].totalBillValue **\*** |
| lines\[].accountId            | splitItems\[].accountId             |
| lines\[].taxCodeId            | splitItems\[].taxCodeId             |
| lines\[].tagIds\[]            | splitItems\[].tags\[].tagId         |
| lines\[].accountCode          | splitItems\[].accountCode           |

<WhatComesNext href="/reference/accounting-entries/accounting-entry-overview">
  Accounting Entries API Overview
</WhatComesNext>

## New Fields in AccountingEntryV1

The following fields are available in `AccountingEntryV1` with no equivalent in the Expense API.

| Field              | Description                                                          |
| :----------------- | :------------------------------------------------------------------- |
| companyId          | Company the entry belongs to                                         |
| accountCode        | Account code for the entry                                           |
| bookkeepingDate    | Date used for accounting records                                     |
| subFamily          | Finer-grained classification within `family`                         |
| exportStatus       | Export state of the entry (separate from `status`)                   |
| reviewStatus       | Review state of the entry                                            |
| attendees          | People associated with the entry (e.g. attendees of a business meal) |
| foreignExtensionId | Auto-generated ID used when this API interacts with other Pleo APIs  |

## Other Use Cases

For use cases beyond what's described in this guide, please fill in [this form](https://forms.gle/5CHPcM15qH9umGoTA) to let us know.
