---
title: Accounting Notes and Accounts
slug: devdocs/accounting-notes-and-accounts
docTags: 
createdAt: 2026-10-22T08:35:59.218Z
---

Expressoft can give you the accounting entries of a document, so your ERP can post it without recalculating the accounts.

## Accounting notes

Every document has `accountingNotes`. Each note is one entry:

| **Field**               | **Meaning**                            |
| ----------------------- | -------------------------------------- |
| `debit`, `credit`       | The accounts to debit and to credit.   |
| `amount`                | The amount of the entry.               |
| `note`                  | A description of the entry.            |
| `documentType`          | The type of the document.              |
| `accountingProductType` | The type of the products in the entry. |

**Query**

```graphql
query GetAccountingNotes($organization: Guid, $dateBegin: DateTime, $dateEnd: DateTime, $first: Int) {
  documents {
    purchaseInvoices(organization: $organization, dateBegin: $dateBegin, dateEnd: $dateEnd, first: $first) {
      items {
        key
        number
        accountingNotes(withProduction: false, inherit: true) {
          credit
          debit
          note
          amount
          documentType
          accountingProductType
        }
        products {
          stockAccount(inherit: true)
          accountingProductType(inherit: true)
          product { key name }
        }
      }
    }
  }
}
```

**Variables**

```json
{
  "organization": "<organization key>",
  "dateBegin": "2026-10-01T00:00:00",
  "dateEnd": "2026-10-31T23:59:59",
  "first": 10
}
```

**cURL**

```bash
curl --location 'https://sandbox.expressoft.eu/connect/api/interopgql' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer <token>' \
--data '{"query": "query GetAccountingNotes($organization: Guid, $dateBegin: DateTime, $dateEnd: DateTime, $first: Int) { documents { purchaseInvoices(organization: $organization, dateBegin: $dateBegin, dateEnd: $dateEnd, first: $first) { items { key number accountingNotes(withProduction: false, inherit: true) { credit debit note amount documentType accountingProductType } products { stockAccount(inherit: true) accountingProductType(inherit: true) product { key name } } } } } }", "variables": {"organization": "<organization key>", "dateBegin": "2026-10-01T00:00:00", "dateEnd": "2026-10-31T23:59:59", "first": 10}}'
```

**Response**

```json
{
  "data": {
    "documents": {
      "purchaseInvoices": {
        "items": [
          {
            "key": 1001,
            "number": "FA-1001",
            "accountingNotes": [
              {
                "credit": "401",
                "debit": "371",
                "note": "Goods received",
                "amount": 100.0,
                "documentType": "NIR",
                "accountingProductType": "Merchandise"
              }
            ],
            "products": [
              {
                "stockAccount": "371",
                "accountingProductType": "Merchandise",
                "product": {
                  "key": "00000000-0000-0000-0000-000000000003",
                  "name": "Flour 1 kg",
                  "code": "P001"
                }
              }
            ]
          }
        ]
      }
    }
  }
}
```

## Accounts on product lines

The product lines have account fields: `stockAccount`, `expenseAccount`, `saleAccount`, `discountAccount`. Each one takes `inherit`. `accountingProductType` takes it too.

`accountingProductType` is `RawMaterial`, `ConsumableMaterial`, `FinishedProduct`, `SemiFinishedProduct`, `Merchandise`, `Packaging`, `InventoryObject`, `Unknown`.

