Skip to content
Docs
API 1.0.0 · 22 Nov 2026

Search the docs

    Română

    Event catalogue

    The events Accounting sends, when each one is sent and what its data holds.

    On this page

    Accounting sends an event when a posting request changes state, when an entry is reversed and when a period starts closing or is locked. Every event has the same envelope; the type and data say what happened. aggregateId is the postingRequestId, the entry or the period the event is about, and aggregateRevision is its revision after the change.

    TypeAggregateSent when
    com.rdcopilot.accounting.posting.accepted.v1posting-requestA posting request was accepted, once.
    com.rdcopilot.accounting.posting.posted.v1posting-requestThe request was posted: the entry exists and balances.
    com.rdcopilot.accounting.posting.rejected.v1posting-requestThe request was rejected after it was accepted: nothing was posted.
    com.rdcopilot.accounting.entry.reversed.v1journal-entryA reversal was posted for an entry.
    com.rdcopilot.accounting.period.closing.v1periodA period started closing.
    com.rdcopilot.accounting.period.locked.v1periodA period was locked: nothing is posted into it any more.

    An event says that something happened, not everything about it. Read the posting request or the entry for the rest. legalCompanyId is the company the event belongs to. Register an endpoint to receive these events: see Subscriptions.

    The data of each event

    posting.accepted

    Field of `data`Meaning
    sourceDocumentIdThe source document of the request.
    sourceDocumentTypeThe kind of the source document.
    statusAlways accepted.

    posting.posted

    Field of `data`Meaning
    statusAlways posted.
    journalEntryIdThe entry that was created.
    numberThe number of the entry.
    entryDateThe date of the entry.
    totalDebitDebit of the entry, equal to its credit.

    posting.rejected

    Field of `data`Meaning
    statusAlways rejected.
    codeThe reason, a stable code.
    messageThe reason as a sentence.

    entry.reversed

    Field of `data`Meaning
    reversalEntryIdThe entry that reverses it.
    numberThe number of the reversal.
    reasonThe reason that was given.

    period.closing

    Field of `data`Meaning
    periodThe month, as YYYY-MM.
    statusAlways closing.

    period.locked

    Field of `data`Meaning
    periodThe month, as YYYY-MM.
    statusAlways locked.

    Examples

    posting.posted

    {
      "specversion": "1.0",
      "id": "e2193e5c-aea8-48f3-8128-572f833b0383",
      "type": "com.rdcopilot.accounting.posting.posted.v1",
      "source": "urn:rdcopilot:service:accounting",
      "time": "2026-11-23T07:12:00Z",
      "datacontenttype": "application/json",
      "customerOrgId": "bdbc5b26-3f8a-4c1a-8c21-6c396293da32",
      "legalCompanyId": "8373a2b0-3239-4aee-b6c8-56d7829a746d",
      "aggregateType": "posting-request",
      "aggregateId": "b7007a22-a9ea-4fcb-b535-e0570cdd1f2e",
      "aggregateRevision": 2,
      "correlationId": "811cc88c-f3d0-41c4-a870-89e162b010f4",
      "causationId": "32a34b30-2203-436d-897c-707b3c3770bd",
      "actor": {
        "serviceId": "accounting"
      },
      "data": {
        "status": "posted",
        "journalEntryId": "d75fc649-ee06-4dfb-ab83-94b5f1209aa8",
        "number": "JE-2026-10-0008",
        "entryDate": "2026-10-21",
        "totalDebit": "4995.73"
      }
    }

    posting.rejected

    {
      "specversion": "1.0",
      "id": "ce4f9927-8556-4c14-8874-06178265bd21",
      "type": "com.rdcopilot.accounting.posting.rejected.v1",
      "source": "urn:rdcopilot:service:accounting",
      "time": "2026-11-23T07:12:00Z",
      "datacontenttype": "application/json",
      "customerOrgId": "bdbc5b26-3f8a-4c1a-8c21-6c396293da32",
      "legalCompanyId": "8373a2b0-3239-4aee-b6c8-56d7829a746d",
      "aggregateType": "posting-request",
      "aggregateId": "eefbc55a-4da9-42d9-8c56-9764421e1fff",
      "aggregateRevision": 2,
      "correlationId": "1b735906-a8e5-46e8-9418-0b2dc7621f92",
      "causationId": "1a68663c-a9b3-48ce-aba4-bd227fb9be5c",
      "actor": {
        "serviceId": "accounting"
      },
      "data": {
        "status": "rejected",
        "code": "unbalanced",
        "message": "Debit and credit of the facts differ by 0.01. Nothing was posted."
      }
    }

    entry.reversed

    {
      "specversion": "1.0",
      "id": "ec2ab4f6-918f-4d8c-9804-aa96c2adb0cb",
      "type": "com.rdcopilot.accounting.entry.reversed.v1",
      "source": "urn:rdcopilot:service:accounting",
      "time": "2026-11-23T07:12:00Z",
      "datacontenttype": "application/json",
      "customerOrgId": "bdbc5b26-3f8a-4c1a-8c21-6c396293da32",
      "legalCompanyId": "8373a2b0-3239-4aee-b6c8-56d7829a746d",
      "aggregateType": "journal-entry",
      "aggregateId": "c5a671de-e7b0-42b8-825d-d15c0612ff58",
      "aggregateRevision": 2,
      "correlationId": "1679072a-796c-43f3-8ddf-b330aef37034",
      "causationId": "7676e313-9d1f-42d0-a540-49efc794dfba",
      "actor": {
        "serviceId": "accounting"
      },
      "data": {
        "reversalEntryId": "d6d9657f-3d24-49f8-8912-1c004cba4101",
        "number": "JE-2026-11-0001",
        "reason": "Posted for the wrong supplier"
      }
    }

    Order

    Events about one record arrive in order of aggregateRevision, but deliveries can arrive out of order when one of them is retried. Keep the highest revision you handled for each aggregateId and skip a delivery that is older. A posting.posted can arrive before the posting.accepted of the same request has been delivered.