# Document hub and receipts

> Every file in one place with folders, previews and links to the records they support; a bin that keeps deleted files until you restore them or their days pass; receipts captured by phone or email, read, drafted as expenses and matched to bank lines; names proposed and applied with undo; source documents on ledger lines; comment threads on records.

Source: /help/en/documents/document-hub-and-receipts

## The document hub

Documents → **Hub** lists every file the organisation keeps: the attachments of invoices and journal entries, the receipts of expenses, the originals of received bills, bank statements, and anything you upload. Nothing moves: a file that belongs to a record stays with that record and is shown here with its link.

- **Folders.** Each organisation starts with Bank statements, Bills, Receipts, Contracts, Licences, Tax returns and Reports. Add sub-folders with the folder button; an empty folder can be deleted. In a firm's workspace every client has its own tree.
- **Views.** All files, Unfiled (no folder yet), Unlinked (not attached to any record) and Proposed names (files with a name waiting to be applied). Search looks at the name, the counterparty and the reference read from the file; the type and record filters narrow the list.
- **Preview.** Click a row to open the preview beside the list. Images, PDFs and text show as they are; a HEIC photo from a phone is converted to JPEG, and an Office file to a first-page PDF when the deployment's PDF service can convert it, otherwise the panel shows the file's details and a download. The dock button turns the panel into a drawer and back; your choice is remembered.
- **Link and detach.** An uploaded file can be linked to an invoice, bill, expense, journal entry, bank line, statement, report, contact, purchase order, fixed asset, loan or project, and detached again. Files that belong to a record (an expense receipt, an invoice attachment, a received original) cannot be moved to another record; attach them to a ledger line instead.
- **Rename, move, delete.** Every rename or move keeps the previous name, so it can be undone. Deleting a file sends it to [the bin](#the-bin), where it can be restored; received originals and bank statements cannot be deleted from the hub.

## Share a folder with a role or a person

Every member reads every folder until you share one. Sharing gives a folder to the people you name and closes it to everyone else.

- **Who shares.** Owners and admins. Select a folder in the list on the left: **Share folder** appears under the folder list.
- **With whom.** **Share with** offers three kinds of grantee: **A role** (Accountants, Approvers or Viewers), **A member** (one person you choose) or **A portal party** (Client, Customer or Supplier: the people invited to your portal). **Add** saves the grant; add as many as the folder needs. Adding the same grantee again changes its access.
- **Read, or read and file.** **Access** is **Read** or **Read and file**. With *Read* the grantee sees and opens the folder's files. With *Read and file* they also upload into the folder and move files into it; a member without it who tries is refused. A portal party reads only.
- **The first grant closes the folder.** The dialog says so before you add it: *The first grant closes the folder to everyone else but owners and admins.* From then on a member who is not a grantee sees neither the folder nor its files, in the hub or over the API, and a link to one of its files answers that the document was not found. Owners and admins always read every folder.
- **Subfolders follow the nearest folder that has grants.** A subfolder with no grants of its own follows its closest parent that has some, so sharing *Contracts* with accountants closes *Contracts/2026* with it. To give one subfolder to someone else, share that subfolder: its own grants then decide for it and for everything under it.
- **The lock.** A folder that only its grantees read shows a small lock beside its name (*Restricted folder*).
- **Opening it again.** Open **Share folder** and **Remove** each grant. When the last one goes, the message reads *Grant removed; the folder is open to every member again*.
- **What a portal party sees.** A grant names the whole party: every person you invited as a customer's contact, whichever customer they speak for (and the same for suppliers and for a firm's client contacts). They see the folder's files on their portal home under **Files shared with you**, grouped by folder, and open each in a new tab. They cannot upload into the folder, rename or delete. A folder that is not shared with their party never reaches the portal, even when every member reads it. So share with a party only what all of its people may read, such as your terms or a price list.

Files that belong to a portal record (the attachment of a question, the document of a signature request, a published report) are shown with that record whatever their folder.

## The bin

A deleted file is not gone. It waits in the **Bin** tab of the hub, beside **Files**, and the tab shows how many files wait there.

- **Deleting.** **Delete** in a file's preview asks first: *The file goes to the Bin and can be restored from there until the bin's days have passed.* The file then leaves every list and view of the hub, and a link to it answers that the document was not found. The message *… went to the Bin* carries an **Undo** that restores it at once.
- **What the Bin shows.** Each file with its **Name**, **Folder**, **Deleted by**, **Deleted on** and **Leaves on**, the day it is removed for good. Search looks at the name.
- **Restore.** **Restore** in the row's menu puts the file back with its name, its folder, what was read from it and its link to a record. Tick several rows to restore them together. Owners, admins and accountants restore. If the record the file was linked to no longer exists (a draft that an Undo removed, for example), the file comes back unlinked.
- **The bin's days.** A file waits 30 days unless your organisation chose another number. Owners and admins set **Days in the bin** above the list, from 7 to 365, and **Save**; an empty field goes back to the default of 30. After those days the daily run removes the file and its stored copy for good.
- **Files that are kept longer.** A file that supports a posted record (it is attached to a ledger line, or linked to a posted journal entry or to an invoice, bill or expense that was posted) stays stored at least 365 days after it was deleted, whatever number you chose. A signed copy stays for the years its signature rules ask for. **Leaves on** shows the later day.
- **Empty the bin.** Owners and admins can click **Empty the bin**. After you confirm, every file leaves the list at once and the next daily run removes it. The files that are kept longer stay stored, and stay listed in the Bin with the day they leave, so they can still be restored; the message says how many.
- **Attachments of a record.** A file that is the attachment of a journal entry, an expense or an invoice still shows on that record while it waits in the bin, and goes with the attachment when it is removed for good. Removing it from the record at once is done on the record itself.
- **What cannot be deleted.** The received original of a bill and the file of a bank statement are refused: archive the bill, or delete the statement on the Bank page.
- **Undo of a filing.** When you undo an agent's or your own filing of a [source item](/help/en/incoming-invoices/mailbox-and-file-sources), the draft is removed and its file lands in the Bin, so nothing is lost: restore it from there if you want to keep the file.

## Receipts

The **Receipts** page captures receipts three ways:

1. **Phone.** The capture button opens the camera on a phone; on a desktop it picks an image or PDF. The receipt is uploaded, read and listed at once.
2. **Email.** Forward a receipt to the organisation's inbox address. The inbox tells receipts from supplier invoices: a receipt is read and drafted as an expense, an invoice goes to Incoming as before.
3. **Upload.** Any file uploaded to the hub with the source Receipt.

A read receipt shows its counterparty, date, total and language (Arabic and bilingual receipts are read too). From the list:

- **Draft expense** creates the expense through the expense editor's own function with the receipt's fields (one line for the total, VAT when printed, the vendor's TRN when printed). Pick the bank or cash account that paid, or leave it paid by you for a reimbursement claim. The draft waits for review; nothing posts.
- **Part of a receipt, or several lines.** The **Amount to post** defaults to what is still open on the receipt; post less and the receipt stays *Partly posted* with the rest open for a later expense (the receipt's VAT follows the amount in proportion). **Split into several lines** writes one expense line per row, each with its own description and amount; the rows must add up to the amount. A receipt is fully posted when nothing is open (`already_linked` after that).
- **Match to bank line** scores the open bank lines on the amount (same, close, other currency), the date and the counterparty's words in the bank text, with the weights the bank matching uses. Choose a line and the receipt attaches to it; when the line was already categorised into an expense, the receipt shows on that expense as well. The **Amount to match** defaults to what is still open: match less (a receipt paid partly by card and partly in cash) and the rest stays open; the next candidates are scored on the rest and the line already taken is not offered again.

## Reading documents

**Read with AI** on a file classifies it into one of the document types and fills that type's fields: receipt, supplier invoice, bank statement, utility bill (DEWA, SEWA, telecom), rent contract (with the service period for a prepaid), trade licence (with the expiry date; owners and admins get a reminder 30 days before) and insurance policy. The types are data: each carries the fields it reads and a sample the tests run against, including an Arabic and a bilingual receipt. Without an AI key the deterministic reader classifies by the text and the file name.

A file that arrived while it could not be read (filed from a mailbox or a file source, or uploaded by a supplier in the portal) stays in the hub as *Not read yet*. It is tried again automatically: first at the next quarter of an hour, then at growing intervals, eight tries over about a day and a half. The preview shows where the file stands, for example *Waiting to be read. Tried 2 of 8 times; next try …*. When the file is read, the draft it belongs to takes the reading by itself: a file of a source becomes its draft bill inside the same filing, so the filing can still be undone as one, and the draft bill a supplier's upload made takes its header and its lines. **Read with AI** does not wait for the next try: click it at any time.

After the eighth try the file is not tried again. The notification *A file could not be read* says so, and the preview reads *Could not be read after 8 tries. It is not tried again: use Read with AI to try now, or enter it by hand.* Click **Read with AI**, or enter the bill or the expense by hand.

## Create a bill from a document

When **Read with AI** reads a file as a supplier invoice or a utility bill, the preview offers **Create a bill**. It makes a draft bill with the supplier, the dates, the totals and the lines that were read (one line with the amount before tax when no lines were read), and the file becomes the bill's document. The message *Draft bill created from the document* offers **Open the draft bill**. The bill is a draft: check it against the file and accept it as any bill. The button shows only on a file that is not linked to a record yet, and a second bill from the same file is refused.

When the file reads as a contract, a rent contract or an insurance policy, the preview offers **Create a contract**: a supplier contract in draft with that file as its first version (see [Contracts as documents](/help/en/documents/contracts-as-documents#supplier-contracts-from-a-file)). Every file's preview also offers **Request signature** and **Ask for approval**, which put the file to one or several signers (see [Signatures and approvals](/help/en/documents/signatures-and-approvals)).

## Proposed names and filing

After a read, the hub proposes a name of the form **date, counterparty, amount, type** (for example `2026-10-03 DEWA AED 840.53 utility bill.pdf`) and a folder (Bills, Receipts, Contracts, Licences, Bank statements). The proposal is shown under the file; **Apply** renames and files it, **Apply all** does every pending proposal in the view, and **Undo** restores the previous name and folder. Nothing is renamed until you apply.

**The account it supports.** A read also proposes the **account** the document supports and, when one exists, the posted **ledger line** it belongs to: the account comes from what you confirmed before for that counterparty (the client memory or a coding skill), else from the account its bills and expenses were booked to, else from the kind of document (a DEWA bill on utilities, a tenancy contract on prepaid rent, a policy on prepaid insurance, a licence on licence fees); the line is a posted line of the same amount within sixty days that carries no document yet. Both are shown under the file with the reason; **Apply** attaches the file to the line in the same step as the name (the paperclip on the general ledger counts it), and **Undo** detaches it with the name. A file already linked to a record gets an account but no line, because the record's own lines already show it.

## Source documents on ledger lines

The trial balance shows a paperclip with the number of documents behind each account in the period; the general ledger and the statement drill-down show the paperclip per line. Opening it lists the documents attached to the line, the entry's own attachments, the files of the invoice, bill or expense behind the entry and the receipt matched to the bank line that paid it, so a reviewer traces any figure through the account and the entry to its paper. **Attach from the hub** puts another document on a line; the file stays where it is.

## Comments

Invoices, bills, expenses, journal entries, bank lines, reports and documents carry a comment thread. A comment is **internal** unless you switch it to **client-visible** (the client portal reads those). Mention a colleague with the @ button and they get a notification in the bell; attach a document from the hub; reply, resolve a thread when it is settled, edit your own comment or delete it (owners and admins can delete any).

## API and assistants

- Files: `GET /documents/files` (filters `folderPath`, `search`, `source`, `linkedEntityType`, `linkedEntityId`, `unlinked`, `proposalPending`), `POST /documents/files` (multipart, base64 or a path already in storage), `GET`, `PATCH` (rename or move) and `DELETE /documents/files/{id}` (the file goes to the bin), `/link`, `/detach`, `/parse`, `/apply-name`, `/undo-name`, `POST /documents/apply-names`, `GET /documents/folders`, `GET /documents/parsers`.
- The bin: `GET /documents/files?bin=true` lists it (each file with `deletedAt`, `deletedByName` and `purgeOn`), `POST /documents/files/{id}/restore` takes a file out, `GET /documents/bin` answers the days and how many files wait, `PUT /documents/bin` with `{days}` sets them (`null` for the default) and `POST /documents/bin/empty` empties the bin; the last two need an owner or admin, also behind an API key. `POST /documents/files/{id}/bill` makes the draft bill from a file read as an invoice.
- Receipts: `POST /receipts` (upload from a phone; the file is read at once), `GET /receipts`, `POST /receipts/{id}/match` (without `transactionId` the candidates come back; with `amount` a partial match), `POST /receipts/{id}/expense` (with `amount` and `lines` for a partial or split posting).
- Ledger lines: `GET /ledger/lines/{id}/documents`, `POST` to attach, `DELETE /ledger/lines/{id}/documents/{linkId}`, `GET /ledger/document-counts?kind=account|entry|line`. A parsed file carries `proposedAccountId` and `proposedLineId` (with `lineProposalPending`); `/apply-name` attaches the line, `/undo-name` detaches it.
- Folder grants: `GET /documents/folders/{path}/grants` (who the folder is shared with; an empty list means every member reads it), `PUT` with `{granteeKind, role | userId | party, access}` and `DELETE …/grants?grantId=`, with the folder path URL-encoded (`Bills%2F2026`); all three need an owner or admin, also behind an API key. `GET /documents/folders` marks each folder `restricted`. A portal contact reads `GET /portal/files` and `GET /portal/files/{id}`.
- Comments: `GET /comments?entityType&entityId`, `POST /comments`, `PATCH /comments/{id}` (body, client visibility, resolved), `DELETE /comments/{id}`, `GET /comments/members`. A comment needs a signed-in person, so API keys list comments and the MCP user context writes them.
- AI assistants use `list_documents`, `upload_document`, `link_document`, `parse_document`, `apply_document_name`, `match_receipt`, `list_comments` and `add_comment`; `save_document_folder_grant` shares a folder and asks you to confirm first. `restore_document_file` takes a file out of the bin (`list_documents` with `bin` lists what waits there), and `bill_from_document_file` makes the draft bill after you confirm.

## Walkthrough

1. Open Documents → **Hub**. The default folders are listed on the left with their counts; the attachments of your invoices, bills, expenses and journal entries are already there, each linked to its record.
2. Upload a PDF and a phone photo in HEIC. Click the HEIC row: the preview panel converts it and shows the photo; dock and undock the panel.
3. Upload a Word file. If the PDF service is configured the first page shows; otherwise the panel shows the details and a download.
4. Open **Receipts**, use the capture button on a phone (or pick a receipt image). The row shows the counterparty, date and total read from it.
5. Click **Match to bank line**: the candidates are scored; choose the right one and the receipt is attached to it.
6. Click **Draft expense** on another receipt, keep "Paid by me", and open the expense: it is a draft with the receipt linked.
6a. On a third receipt, click **Draft expense**, lower the **Amount to post** to part of the total, tick **Split into several lines** and enter two rows that add up to it: the expense has two lines, the receipt reads *Partly posted*, and **Draft expense** is offered again for the rest. Then **Match to bank line** on a receipt paid in two ways: enter part of the total as the **Amount to match**, choose the first line, open the dialog again: the candidates are scored on the rest.
7. Back in the hub, open **Proposed names**: apply one proposal, undo it, then **Apply all**. Upload a DEWA bill after booking a journal of the same amount on 6110 Utilities: the row shows *Account it supports: 6110* and *Attach to line*; Apply, then open the general ledger's paperclip on that line: the bill is there; Undo in the hub takes it off again.
8. Open Reports → Trial balance for the period: the account of the matched expense shows a paperclip with a count. Click through to the general ledger and open the paperclip on the line: the receipt is listed. Attach another file from the hub.
9. Open the journal entry page of any entry and write a comment that mentions a colleague; they see it in the bell. Switch a reply to client-visible and resolve the thread.
10. Switch the language to Arabic: the hub, the receipts page, the preview panel and the comments read right to left.
11. As an owner or admin, select the folder **Contracts** and click **Share folder**: **Share with** A role, **Role** Accountants, **Access** Read, **Add**. The folder shows a lock. Sign in as a viewer: the folder and its files are gone from the hub. Sign in as an accountant: they are there. Back as the owner, **Remove** the grant: the message says the folder is open to every member again.
12. Upload any PDF, open it and click **Delete**: the file leaves the list and the **Bin** tab counts one. Open the **Bin**: the row shows who deleted it, when, and the day it leaves. **Restore** it: it is back in its folder under the same name. As an owner or admin, set **Days in the bin** to 60 and **Save**: the line above the list reads 60 days.
13. Upload a supplier invoice as a PDF and click **Read with AI**. When it reads *Read as Supplier invoice*, click **Create a bill**, then **Open the draft bill** in the message: the draft is under **Incoming Invoices** with the lines that were read and the file as its document.
