Create a journal entry
Creates a double-entry journal entry with at least two lines, as a draft or posted straight away with the post flag. Idempotent on sourceSystem plus externalId: resending the same pair returns the existing entry, which makes retries and replays safe.
How to use it
- Take account IDs from List ledger accounts; use active, non-group accounts.
- Send effectiveAt, currency and at least two lines with positive amountMinor; debits must equal credits to post.
- Set sourceSystem and externalId so a retry returns the same entry instead of a duplicate.
- With post true the entry is posted at once and becomes read-only; its effectiveAt must fall in an open period (see List accounting periods). Otherwise it stays a DRAFT.
BearerAuthAuthorizationBearer <JWT>X-TenantID*stringYour merchant's tenant code — the value typed in the Domain field on the iotoms login screen. See Concepts.
application/json- body
externalId?|Optional reference from your system. With sourceSystem it makes the call idempotent: resending the same pair returns the existing entry.
sourceSystem?|Name of the system the entry comes from. Defaults to MANUAL when omitted.
eventType?|Optional business event label for the entry, for reporting and filtering.
effectiveAt*stringAccounting date of the entry (YYYY-MM-DD). To post, it must fall inside an open accounting period.
datecurrency*stringThree-letter currency code, for example USD. Every line must use the same currency.
memo?|Optional free-text description of the entry.
correlationId?|Optional reference for linking related entries together.
metadata?|Optional free-form text (for example a JSON string) stored with the entry and returned as sent.
post*booleanfalse saves the entry as a DRAFT; true validates it and posts it to the ledger in the same call.
lines*array<>At least two debit/credit lines. To post, total debits must equal total credits.
OK
*/*- response
status*stringOutcome of the call: SUCCESS when it worked, ERROR when it failed.
message*stringShort human-readable message describing the outcome, for example "Vendor created". Do not parse it.
data?The journal entry, including all of its lines.
curl -X POST 'https://beta.iotoms.com/api/v1/accounting/journal-entries' \ -H 'X-TenantID: your-tenant-code' \ -H 'Content-Type: application/json' \ -d '{ "effectiveAt": "2019-08-24", "currency": "string", "post": true, "lines": [ { "accountId": "3d07c219-0a88-45be-9cfc-91e9d095a1e9", "direction": "DEBIT", "amountMinor": 0 } ]}'{ "status": "string", "message": "string", "data": { "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", "externalId": "string", "sourceSystem": "string", "eventType": "string", "effectiveAt": "2019-08-24", "postedAt": "2019-08-24T14:15:22Z", "periodId": "7cc85576-6d6b-4609-a8e6-020187b27a09", "status": "DRAFT", "currency": "string", "memo": "string", "reversalOfId": "91205805-6131-4e22-87c1-99e3bbb30d9b", "correlationId": "string", "metadata": "string", "createdAt": "2019-08-24T14:15:22Z", "lines": [ { "id": 0, "accountId": "3d07c219-0a88-45be-9cfc-91e9d095a1e9", "accountCode": "string", "accountName": "string", "direction": "DEBIT", "amountMinor": 0, "currency": "string" } ] }}