# Employee Payment Applications _(Realtime-enabled)_

`GET` `POST` `PATCH` `DELETE` _(Table: EONE Transaction Line)_

```
eOne/core/v1.0/employeePaymentApplications
```

The distribution lines of an [employee payment](https://eonesolutions.github.io/eone-bc-integration/core-employeePayments.md). Each row carries part of the reimbursement, optionally with a comment that flows onto the journal line description. A **nested collection** addressed under its parent: `employeePayments({id})/employeePaymentApplications`.

Unlike the [customer](https://eonesolutions.github.io/eone-bc-integration/core-customerPaymentApplications.md) and [vendor](https://eonesolutions.github.io/eone-bc-integration/core-vendorPaymentApplications.md) sides, an employee reimbursement is not settled against a posted invoice. Each line splits the reimbursement `amount` and can carry a free-text `comment`. A line can also name the expense report it settles.

> **Note:** The parent supplies the payment key; `lineNumber` is stamped automatically on insert. Deep-insert the lines with the parent, or POST them under the payment's `employeePaymentApplications` collection.

## A line with no target is the on-account line

A line that names no expense report posts against the employee unapplied, and its `comment` becomes the journal line description. When the lines total less than the parent `amount`, the engine adds exactly that line for the shortfall, so a reimbursement can pay part of what is owed and leave the rest on the employee's account. Applications totalling more than the parent amount are rejected, naming both figures.

Lines that do name an expense report are settled together, as one employee ledger entry for their total. A `comment` therefore reaches the journal line description only on a line that settles nothing, or on a reimbursement settling a single report. Every comment is kept against the processed document in the eOne Processed Documents history.

## Settle an expense report by your own key

`appliesToExpenseIntegrationId` is a [resolver](https://eonesolutions.github.io/eone-bc-integration/resolvers.md) that finds the report's posted document by your own [Integration Id](https://eonesolutions.github.io/eone-bc-integration/integration-id.md), and fills in `appliesToDocumentNumber` for you. It resolves when you POST the line, so a wrong key, a report belonging to another employee, or an entry that is already settled is reported to SmartConnect straight away.

> **Note:** If the expense has not posted yet, the payment waits in staging and applies once it posts. Turn off **Allow Before Invoice Posts** on the endpoint and the unresolved key is rejected on POST instead. That setting had no effect on this endpoint before, because the key was only resolved when the document was processed.

## Application targets must be open

Where a line does name a target, by `appliesToDocumentNumber` or by the expense's `appliesToExpenseIntegrationId`, the same [open-entry rules](https://eonesolutions.github.io/eone-bc-integration/core-customerPaymentApplications.md) apply, read from the employee ledger: a reimbursement cannot be applied to an entry that is already settled, and an applied total above what remains on that entry is rejected naming the document, its remainder and your total. A key resolving to a closed entry reports that it is closed rather than waiting for an expense that has already posted. The *Payment Applications* page in Business Central now offers a lookup here too, listing the employee's open entries with the amount remaining on each.

## Employee Payment Applications fields

_API column → BC field._

**Legend**

- _(req)_ required on create
- _(res)_ resolver
- _(cur)_ currency-translated
- _(ro)_ read-only
- _(ext)_ added to this endpoint by another extension (BC field name shown; its API column name is not known here)

| API | BC field | Notes |
| --- | --- | --- |
| `id` | SystemId | BC record GUID. _(ro)_ |
| `bcCompanyId` | bcCompanyId | The company this row belongs to - the same GUID that appears in the request URL. Present on every endpoint so a store pooling several companies can keep them apart without relying on which URL it called. _(ro)_ |
| `bcCompanyName` | bcCompanyName | The name of the company this row belongs to. _(ro)_ |
| `lineNumber` | Line No. | Stamped automatically on insert. _(ro)_ |
| `paymentId` | Transaction Id | GUID of the parent payment. _(ro)_ |
| `appliesToDocumentNumber` | Applies-to Doc. No. | Posted document number of the expense this line settles. Alternative to appliesToExpenseIntegrationId, which fills this in for you when it resolves. Blank posts the line unapplied. |
| `appliesToExpenseIntegrationId` | Applies-to Inv. Integration Id | integrationId of the expense report this line settles - your own key, resolved to the expense's posted document, which must belong to this employee and still be open. Closes the report's employee ledger entry at posting, which marks it settled on postedEmployeePayments. If the expense has not posted yet, the payment waits in staging until it has - unless this endpoint has Allow Before Invoice Posts off, in which case it is rejected now. _(res)_ |
| `paymentIntegrationId` | EONE Txn Integration Id | The parent payment's Integration Id (your external key), for mapping back to the payment without a lookup. Filterable. _(ro)_ |
| `amount` | Amount | Portion of the reimbursement carried on this line. |
| `comment` | Comment | Free-text note carried onto the journal line description. Applications that settle an expense report share one journal line, so their notes stay in the processed-document history instead. |
| `integrationId` | EONE Integration Id | Your external key. |
| `lastModifiedDateTime` | SystemModifiedAt | _(ro)_ |

## Related pages

Nested under [Employee Payments](https://eonesolutions.github.io/eone-bc-integration/core-employeePayments.md).
