v1

latestOpenAPI 3.1.02026-08-04103211436.0 KB
AccountingEntries

Create accounting entry

Creates a single accounting entry (one line of a general ledger journal). If customId is omitted, Embat auto-generates one; if the customId already exists, the entry is updated instead of duplicated (upsert). An entry always carries both an outflow side (assetAmount, stored with its sign inverted so negative means money out) and an inflow side (liabilityAmount, stored as sent); if you only send one, the other defaults to 0. If description is omitted, Embat generates one from the entry's identifier. Entries dated before the ledger account's configured start date are excluded from reconciliation matching.

post/accountingentries/{companyId}

Path parameters

companyIdstring required

Request body

accountingCodestring required

Ledger account code the entry is posted to.

counterpartAccountingCodestring nullable

Ledger account code of the counterpart side of the entry, when applicable.

accountingNamestring nullable

Display name of the ledger account (accountingCode).

assetAmountnumber required

Outflow side of the entry, in currency (money leaving the account). An entry always has both sides: if you only send liabilityAmount, assetAmount defaults to 0. The sign is inverted on storage (0 always stays 0): a positive value you send is stored and returned as negative, following the convention that negative amounts are outflows.

accountingAssetAmountnumber nullable

Outflow side expressed in the company accounting currency (accountingCurrency). Subject to the same sign convention as assetAmount.

balancenumber nullable

Running balance of the ledger account (accountingCode) after this entry, typically calculated by Embat rather than provided by you.

liabilityAmountnumber required

Inflow side of the entry, in currency (money entering the account), stored with the sign you send. An entry always has both sides: if you only send assetAmount, liabilityAmount defaults to 0.

accountingLiabilityAmountnumber nullable

Inflow side expressed in the company accounting currency (accountingCurrency).

currency'AED' | 'AFN' | 'ALL' | 'AMD' | 'ANG' | 'AOA' | 'ARS' | 'AUD' | 'AWG' | 'AZN' | 'BAM' | 'BBD' | 'BDT' | 'BGN' | 'BHD' | 'BIF' | 'BMD' | 'BND' | 'BOB' | 'BOV' | 'BRL' | 'BSD' | 'BTC' | 'BTN' | 'BWP' | 'BYN' | 'BZD' | 'CAD' | 'CDF' | 'CHE' | 'CHF' | 'CHW' | 'CLF' | 'CLP' | 'CNH' | 'CNY' | 'COP' | 'COU' | 'CRC' | 'CUP' | 'CVE' | 'CZK' | 'DJF' | 'DKK' | 'DOP' | 'DZD' | 'EEK' | 'EGP' | 'ERN' | 'ETB' | 'ETH' | 'EUR' | 'FJD' | 'FKP' | 'GBP' | 'GEL' | 'GHS' | 'GIP' | 'GMD' | 'GNF' | 'GTQ' | 'GYD' | 'HKD' | 'HNL' | 'HRK' | 'HTG' | 'HUF' | 'IDR' | 'ILS' | 'INR' | 'IQD' | 'IRR' | 'ISK' | 'JMD' | 'JOD' | 'JPY' | 'KES' | 'KGS' | 'KHR' | 'KMF' | 'KPW' | 'KRW' | 'KWD' | 'KYD' | 'KZT' | 'LAK' | 'LBP' | 'LKR' | 'LRD' | 'LSL' | 'LTC' | 'LTL' | 'LVL' | 'LYD' | 'MAD' | 'MDL' | 'MGA' | 'MKD' | 'MMK' | 'MNT' | 'MOP' | 'MRU' | 'MUR' | 'MVR' | 'MWK' | 'MXN' | 'MXV' | 'MYR' | 'MZN' | 'NAD' | 'NGN' | 'NIO' | 'NOK' | 'NPR' | 'NZD' | 'OMR' | 'PAB' | 'PEN' | 'PGK' | 'PHP' | 'PKR' | 'PLN' | 'PYG' | 'QAR' | 'RON' | 'RSD' | 'RUB' | 'RWF' | 'SAR' | 'SBD' | 'SCR' | 'SDG' | 'SEK' | 'SGD' | 'SHP' | 'SLE' | 'SOS' | 'SRD' | 'SSP' | 'STN' | 'SVC' | 'SYP' | 'SZL' | 'THB' | 'TJS' | 'TMT' | 'TND' | 'TOP' | 'TRY' | 'TTD' | 'TWD' | 'TZS' | 'UAH' | 'UGX' | 'USD' | 'USN' | 'UYI' | 'UYU' | 'UYW' | 'UZS' | 'VED' | 'VEF' | 'VES' | 'VND' | 'VUV' | 'WST' | 'XAF' | 'XAG' | 'XAU' | 'XBA' | 'XBB' | 'XBC' | 'XBD' | 'XCD' | 'XDR' | 'XOF' | 'XPD' | 'XPF' | 'XPT' | 'XSU' | 'XTS' | 'XUA' | 'XXX' | 'YER' | 'ZAR' | 'ZMK' | 'ZMW' | 'ZWG' | 'ZWL'
accountingCurrency'AED' | 'AFN' | 'ALL' | 'AMD' | 'ANG' | 'AOA' | 'ARS' | 'AUD' | 'AWG' | 'AZN' | 'BAM' | 'BBD' | 'BDT' | 'BGN' | 'BHD' | 'BIF' | 'BMD' | 'BND' | 'BOB' | 'BOV' | 'BRL' | 'BSD' | 'BTC' | 'BTN' | 'BWP' | 'BYN' | 'BZD' | 'CAD' | 'CDF' | 'CHE' | 'CHF' | 'CHW' | 'CLF' | 'CLP' | 'CNH' | 'CNY' | 'COP' | 'COU' | 'CRC' | 'CUP' | 'CVE' | 'CZK' | 'DJF' | 'DKK' | 'DOP' | 'DZD' | 'EEK' | 'EGP' | 'ERN' | 'ETB' | 'ETH' | 'EUR' | 'FJD' | 'FKP' | 'GBP' | 'GEL' | 'GHS' | 'GIP' | 'GMD' | 'GNF' | 'GTQ' | 'GYD' | 'HKD' | 'HNL' | 'HRK' | 'HTG' | 'HUF' | 'IDR' | 'ILS' | 'INR' | 'IQD' | 'IRR' | 'ISK' | 'JMD' | 'JOD' | 'JPY' | 'KES' | 'KGS' | 'KHR' | 'KMF' | 'KPW' | 'KRW' | 'KWD' | 'KYD' | 'KZT' | 'LAK' | 'LBP' | 'LKR' | 'LRD' | 'LSL' | 'LTC' | 'LTL' | 'LVL' | 'LYD' | 'MAD' | 'MDL' | 'MGA' | 'MKD' | 'MMK' | 'MNT' | 'MOP' | 'MRU' | 'MUR' | 'MVR' | 'MWK' | 'MXN' | 'MXV' | 'MYR' | 'MZN' | 'NAD' | 'NGN' | 'NIO' | 'NOK' | 'NPR' | 'NZD' | 'OMR' | 'PAB' | 'PEN' | 'PGK' | 'PHP' | 'PKR' | 'PLN' | 'PYG' | 'QAR' | 'RON' | 'RSD' | 'RUB' | 'RWF' | 'SAR' | 'SBD' | 'SCR' | 'SDG' | 'SEK' | 'SGD' | 'SHP' | 'SLE' | 'SOS' | 'SRD' | 'SSP' | 'STN' | 'SVC' | 'SYP' | 'SZL' | 'THB' | 'TJS' | 'TMT' | 'TND' | 'TOP' | 'TRY' | 'TTD' | 'TWD' | 'TZS' | 'UAH' | 'UGX' | 'USD' | 'USN' | 'UYI' | 'UYU' | 'UYW' | 'UZS' | 'VED' | 'VEF' | 'VES' | 'VND' | 'VUV' | 'WST' | 'XAF' | 'XAG' | 'XAU' | 'XBA' | 'XBB' | 'XBC' | 'XBD' | 'XCD' | 'XDR' | 'XOF' | 'XPD' | 'XPF' | 'XPT' | 'XSU' | 'XTS' | 'XUA' | 'XXX' | 'YER' | 'ZAR' | 'ZMK' | 'ZMW' | 'ZWG' | 'ZWL'
contactCustomIdstring nullable

Custom ID of the contact (client/supplier), used when accountingCode is a contacts ledger account.

exchangeRatenumber nullable

Exchange rate applied between currency and accountingCurrency.

additionalInfoobject nullable

Free-form key/value metadata to attach to the entry. Sending an empty object ({}) has no effect and does not clear previously stored metadata.

descriptionstring nullable

Free-text description of the entry. If omitted, Embat generates one: "Asiento " followed by accountingEntryCode if set, otherwise by customId.

documentIdstring nullable

Identifier of the source document (e.g. invoice) this entry relates to.

transactionsIdsstring[] nullable

Embat IDs of the bank transactions related to this entry.

paymentIdstring nullable

Embat ID of the payment related to this entry.

datestring date-time required

Accounting date of the entry. Send a plain date at midnight (e.g. 2024-01-15T00:00:00Z) — sending a different time of day can shift the stored calendar date and is not fully normalized to midnight.

customIdstring nullable

Your own unique ID for the entry, to use as your ERP accounting entry ID. If omitted, Embat auto-generates one.

accountingEntryCodestring nullable

Your own ID grouping the entries that form a single journal/document (e.g. all lines of one invoice posting). Several entries can share the same accountingEntryCode.

accountingEntryCodeIdstring nullable

Alternate grouping code for the entry. Bulk deletion by entry code (DELETE /accountingentries/accountingentrycode/{companyId}) matches entries by either accountingEntryCode or accountingEntryCodeId.

Example request

{
  "accountingCode": "4300001",
  "counterpartAccountingCode": "5720001",
  "accountingName": "Trade debtors",
  "assetAmount": 1250.5,
  "accountingAssetAmount": 1250.5,
  "contactCustomId": "contact-001",
  "exchangeRate": 1,
  "description": "Invoice #2024-001 posting",
  "date": "2024-01-15T00:00:00Z",
  "attributes": [
    {
      "customId": "cost-center",
      "value": "Marketing",
      "valueCustomId": "marketing"
    }
  ],
  "customId": "erp-entry-2024-001",
  "accountingEntryCode": "invoice-2024-001"
}

Response

Successful Response

idstring required

Embat resource ID

customIdstring required

Client-provided custom ID