# Bank / G/L Entries _(Realtime-enabled)_

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

```
eOne/core/v1.0/bankGLEntries
```

Book a **generic bank / G/L journal entry**, a party-less document for bank fees, interest, accruals and adjustments. The composable sibling of [Expenses](https://eonesolutions.github.io/eone-bc-integration/core-expenses.md): the header names the balancing account (`balancingAccountType` Bank or G/L + `balancingAccountNumber`), and each line under `bankGLEntries(<id>)/bankGLEntryLines` debits a G/L account (with its own dimensions); `process` writes one journal line per line plus a single balancing line for any remainder. A self-balancing entry whose lines already net to zero needs no balancing account at all. One of the [Journal Wrappers](https://eonesolutions.github.io/eone-bc-integration/journal-wrappers.md).

> **Note:** This endpoint **posts** new journal entries. To read back posted entries, use the read-only [G/L Entries](https://eonesolutions.github.io/eone-bc-integration/core-generalLedgerEntries.md) feed instead.

## Bound actions

Invoke with `POST /bankGLEntries(<id>)/Microsoft.NAV.<action>`:

- `validate`: runs the posting checks without processing; surfaces any problem into `status` / `errorMessage`.
- `process`: writes one G/L journal line per line, plus a single balancing line when the lines leave a remainder for the balancing account to take (unposted draft, or posted, per the Setup policy). An entry whose lines already net to zero gets no balancing line.
- `post`: processes the entry **and posts it**, whatever the Setup policy says. Use it when SmartConnect decides that this one entry goes to the ledger now, rather than an administrator putting the whole endpoint on Auto Post. Only the lines this entry just wrote are posted, so other drafts sitting in the same journal batch are left alone, and the approval gate applies exactly as it does to `process`.
- `reopen`: returns a failed entry to Open and clears its error, handing it back to the background job. A entry that hits `status` = Error is not collected again on its own, so on an Auto endpoint - where by definition nothing calls `process` - this is how a corrected entry gets moving. It refuses a entry that is pending approval, exactly as the Business Central action does.

`process` and `post` return no body. The staged entry deletes itself the moment its journal lines exist, so there is nothing to echo, and the outcome lives on the [Processed Documents](https://eonesolutions.github.io/eone-bc-integration/core-processedDocuments.md) row the same call wrote. Fetch it by the `integrationId` you sent the entry with - `processedDocuments?$filter=integrationId eq '<your id>'` - and read `postedDocumentNumber`, `postedPostingDate`, `glTransactionNumber` and `status`; after `post` they are already filled in. `validate` writes nothing and points back at the staged entry. A rejected call returns the error and leaves the entry in staging, with `errorMessage` describing the problem, ready to correct and retry. See [Journal Wrappers](https://eonesolutions.github.io/eone-bc-integration/journal-wrappers.md).

> **Note:** Approval is not done through the API. When an endpoint has **Requires Approval** set and a Business Central approval workflow is enabled for eOne documents, an entry must be **Approved** before it processes. A licensed user sends it for approval and approves it in Business Central, on the *eOne Ledger Documents* page (**Send Approval Request**, then the standard Approve/Reject/Delegate), backed by Approval User Setup. The read-only `status` (Open → Pending Approval → Approved) and `errorMessage` fields report where the document is; a failed automatic attempt lands `status` = Error with the reason in `errorMessage`.

## Self-balancing entries

A journal whose debits and credits already net to zero, the shape a payroll import arrives in, posts as-is: leave `balancingAccountType` and `balancingAccountNumber` blank, and `process` writes exactly one journal line per line and nothing else. The balancing account is only required when the lines leave a remainder for it to take. An entry whose only line is zero is still refused, since there is nothing to post.

> **Note:** Dimensions are **per line** here, since each G/L distribution can carry its own cost centre. See [Dimensions](https://eonesolutions.github.io/eone-bc-integration/dimensions.md).

### What a PATCH may do

Two rules apply to every write, on the header and on its lines and applications alike.

**A entry under approval cannot be changed.** Once `status` is Pending Approval or Approved, a PATCH, a line append or a delete is rejected. What the approver signed off on is what posts. Call `reopen` first if the entry genuinely has to change; that is an explicit act rather than a silent revocation, and it leaves no orphaned approval entry behind.

**Deleting is also a setup choice.** A DELETE of a staged entry is refused when the endpoint's **Allow Manual Delete** switch is off on the eOne Integration Setup page. It is on by default, so nothing changes until an administrator turns it off to mark the whole document family integration-owned. The approval rule above holds regardless of the switch.

**Correcting a failed entry clears its error.** Any successful write to a entry whose `status` is Error returns it to Open and empties `errorMessage`, so it becomes visible to the background job again - a line or application write counts, because the failure is usually in a line. The full text of every failed attempt is kept separately and is not lost when the live message is cleared. Awaiting Invoice is left alone: that one heals itself when the invoice posts.

## Its own feature switch

This endpoint answers to **Bank / G/L entries** on the Features tab of eOne Integration Setup, not to Ledger documents. Turn it on in the company you are posting to, or both the header and its lines return an error naming the feature.

The switch was carved out of Ledger documents, so a company already importing bank/G/L entries keeps doing so across the upgrade: the new switch starts at whatever Ledger documents held. See [Feature switches](https://eonesolutions.github.io/eone-bc-integration/home.md).

> **Note:** The child collection is `bankGLEntryLines`. It was published as `expenseLines` in earlier versions, because the endpoint reused the expense line page, which meant the collection was refused unless the unrelated Expenses feature also happened to be on. Update the nested route in any map that posts lines under an existing entry.

## Bank G/L Entries 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 | _(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)_ |
| `documentNumber` | Document No. |  |
| `postingDate` | Posting Date |  |
| `pricesIncludeTax` | Prices Include Tax | Whether line amounts already include tax. Off (default): a line's amount is the taxable base and its taxAmount is added on top, so the line costs the document amount + tax. On: the tax is already inside the line amount and is carved back out, so the line costs the document its amount. This says only what the numbers MEAN - the tax figure itself always comes from the line's taxAmount, never from Business Central's own rate. See Journal Wrappers. |
| `documentDate` | Document Date | The document's own date; defaults to the posting date when left blank. |
| `description` | Description |  |
| `balancingAccountType` | Bal. Account Type | The offsetting account: Bank Account or G/L Account. |
| `balancingAccountNumber` | Bal. Account No. |  |
| `currencyCode` | currencyCode | _(cur)_ |
| `externalDocumentNumber` | External Document No. |  |
| `yourReference` | Your Reference |  |
| `expectedLineCount` | Expected Line Count | How many lines or applications this document will have when it is complete. Set it on the header and the document is not processed until that many have arrived, instead of waiting out the five-minute idle window - so a document built over several calls is never processed half-built, and a complete one goes through on the next cycle. Leave it blank (the default) to keep the idle-window behaviour. |
| `declaredTotalAmount` | Declared Total Amount | Optional second check on top of expectedLineCount: the total you believe the lines add up to. When set and the arrived lines do not match it, the document fails with the difference stated rather than posting. Leave it zero to skip the check. This does not change the header amount, which stays a ceiling. |
| `integrationId` | EONE Integration Id |  |
| `journalTemplateName` | Journal Template Name |  |
| `journalBatchName` | Journal Batch Name |  |
| `totalAmount` | Total Amount | _(ro)_ |
| `status` | Status | _(ro)_ |
| `errorMessage` | Error Message | _(ro)_ |
| `createdDateTime` | SystemCreatedAt | When the integration imported this document into staging. _(ro)_ |
| `errorDateTime` | Error Date-Time | When the document last entered Error. Cleared when it is approved or reopened. _(ro)_ |
| `lastModifiedDateTime` | SystemModifiedAt | _(ro)_ |

## Related pages

Collections nested under this endpoint:

- [Bank / G/L Entry Lines](https://eonesolutions.github.io/eone-bc-integration/core-bankGLEntryLines.md)
