> ## 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="
        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 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>;

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="book-open" href="/reference/accounting-entries/accounting-entry-overview">
    <div className="text-sm mt-2">What an Accounting Entry is and how the API is structured.</div>
  </Card>

  <Card title="API Scopes" icon="lock" href="/reference/accounting-entries/scopes">
    <div className="text-sm mt-2">Required scope: `accounting-entries:read`.</div>
  </Card>

  <Card title="Generate API Keys" icon="key" href="/docs/current/how-tos/api-keys/how-to-generate-standalone-api-keys">
    <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="key" href="/docs/current/guides/standalone-api-keys-workflow-guide">
    <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="paper-plane" href="/docs/current/how-tos/api-keys/how-to-make-an-api-call-using-standalone-api-keys-postman">
    <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.
