Skip to main content

Month-end without double posting

On the last working day of October, the connection between the payroll platform and Finance and Operations drops in the middle of posting the payroll journals; every retry is answered from the first result, one interrupted request is settled by the hourly idempotency reconciliation, and the accountant finds each journal exactly once.

The situation​

Contoso Entertainment System USA (legal entity USMF) runs payroll on an external payroll platform. When a pay run closes, the platform posts one general journal per department through Lattice's postGeneralJournal operation: the department's payroll cost to expense account 601500 with its Department dimension, offset to main account 110110 (Bank Account - USD). The platform signs in with its own application, whose user holds the Integration operator role.

Four people are involved:

  • Noor, financial systems analyst, owns the payroll integration and its retry logic.
  • Tomas, general ledger accountant, closes October and must see each department's payroll once, and only once.
  • Priya, integration operator, watches the Integration operations workspace during the close.
  • Grace, integration administrator, settles anything Priya hands over.

On Friday 30 October at 18:00 the platform sends October's journals. Part way through, the network link between the platform's data center and Finance and Operations starts dropping connections.

Why it matters​

  • A dropped connection does not say whether the journal posted. Resending blindly could post a department's payroll twice; not resending could leave it out.
  • A double-posted payroll overstates expenses and understates the bank, and is found, if at all, in the bank reconciliation after the close.
  • The close has a deadline. Nobody wants to compare journal lines by hand on a Friday night.

What Noor does​

Before month-end: one request ID per journal​

  1. Noor designs each journal as one request with its own GUID RequestId, created when the pay run closes and stored with the department's totals before the first send. Every resend of that journal carries the same RequestId; a new one would be a new journal. See I want to make my calls safe to retry and Post a journal exactly once.

    {
    "_request": {
    "RequestId": "6f1c2d3e-4b5a-4c7d-8e9f-0a1b2c3d4e5f",
    "LegalEntityId": "USMF",
    "JournalNameId": "GenJrn",
    "Description": "October payroll, department 022",
    "PostingDate": "2026-10-30",
    "Lines": [ { "MainAccountId": "601500", "OffsetMainAccountId": "110110", "AmountCurDebit": 48250.00,
    "CurrencyCode": "USD",
    "Dimensions": [ { "DimensionName": "Department", "DimensionValue": "022" } ] } ]
    }
    }
  2. The platform reacts to each answer: a success, or a replay of one, stores the journal number from DocumentId; ErrorCode 8 (RequestInProgress) waits and resends; 9 (RequestNeedsReview) stops and alerts Noor; 7 (DuplicateRequest) means the ID was used for another operation, a defect to fix. A request that failed for any other reason released its ID, so it is corrected and resent with the same one. See I want to find out why my call was refused.

  3. On Thursday Noor sends every department's request with "PreviewMode": true. Each answers "Preview (ValidationOnly): general journal request for GenJrn is valid. No journal was created or posted." and the request IDs stay free for Friday. The preview does not check the main accounts, the dimensions or the balance; posting does. See I want to try a posting without posting anything.

Friday 18:00: the connection drops​

  1. Department 022's journal posts, but the answer is lost on the way back. The platform resends the same request and gets Success true, the same journal number in DocumentId and "Duplicate request detected. Original request processed at ...". Nothing posts again.
  2. Department 023's call times out on the platform's side while the posting is still running. The resend is answered with ErrorCode 8: "A request with the same RequestId is already being processed. Retry once it completes." A minute later the next resend gets the replay, with the journal number.
  3. One more department's call meets a restart of the server that is handling it. Lattice had created the journal, recorded its number on the request's idempotency claim and posted it, but the restart came before the result was recorded, so the claim stays Processing. For an hour the platform's resends get 8. Once the claim is older than 60 minutes they get 9: "A prior attempt for this RequestId is in an unresolved in-progress (stale) state. It was not re-executed, to avoid a possible double-post. ..." The platform stops and alerts Noor, as designed.

Friday evening: the claim settles itself​

  1. At 19:15 Priya's close check shows Stale idempotency claims at 1 on the Integration operations workspace. The tile opens Service idempotency log on the claim: Status Processing, claimed at 18:05, Document table LedgerJournalTable, Document ID the journal number and Legal Entity USMF. On General ledger > Journal entries > General journals, with posted journals shown, Priya finds the journal posted. See I want to close a claim that is stuck in processing.
  2. The claim names a posted journal, which the Lattice idempotency reconciliation background process settles without a person. At its next hourly run it looks the journal up in USMF, finds it posted and finalizes the claim: Status Succeeded, Reconciliation state Resolved - succeeded. Nobody had to schedule anything. See Lattice idempotency reconciliation.
  3. Priya tells Noor that the claim has succeeded, and Noor resends the request once more. The answer is the replay, with the journal number in DocumentId, and the platform records it like every other department.

If the journal had not posted. Had the restart come after the journal was created but before it posted, the process would have parked the claim with Reconciliation state Manual review required, counted by the Claims needing manual reconciliation tile. Priya would hand it to Grace, and Tomas would open the journal: either post it after checking its lines, after which Grace chooses Mark succeeded, or delete it, after which Grace chooses Release claim and the platform's next resend creates and posts a new journal. Had the restart come before the journal existed, the claim would name no journal, the process would leave it to a person, and Grace would release it once Priya confirmed there is no journal. See I want to act on an item an operator hands over and the Idempotency reconciliation runbook.

Monday: Tomas checks the close​

  1. On General journals, with posted journals shown, Tomas filters the description on "October payroll": one journal per department, each posted once, with the amounts of the platform's payroll report.
  2. On Service idempotency log, filtered on the platform's request IDs, each journal has a single Succeeded claim. Service call log shows the extra attempts as rows of their own, and none of them posted anything. See I want to check whether a request was a duplicate.
  3. Tomas signs off the payroll part of the close without opening a single journal line to look for duplicates.

What changed​

  • Retries became safe by design. Every resend was answered from the first result, so the platform could retry as often as the network forced it to.
  • The interrupted request did not need a person. The claim named its journal, and the hourly process settled it from what was really in the ledger, within two hours of the call.
  • Doubt became visible. The stale claim was on a tile the same evening, with the journal it concerned, instead of surfacing as a difference in the bank reconciliation.
  • The accountant checked outcomes, not lines. One posted journal and one succeeded claim per department was the whole proof.

For the business: October closed on time, payroll was posted exactly once, and a bad network evening cost nothing but a few log rows.

Try it yourself​

In a sandbox with the USMF demo data and a client whose user holds Integration operator:

  1. Send the request of step 1 to /api/services/MGCLatticeGeneralLedgerServiceGroup/MGCLatticeGeneralLedgerJournalService/postGeneralJournal with "PreviewMode": true, then without it. Keep the journal number. See General and intercompany journals.
  2. Send the same request again: the answer has the same DocumentId and "Duplicate request detected", and General journals shows one journal.
  3. Filter Service idempotency log on the request ID: one Succeeded claim, naming the journal in Document ID.
  4. A stuck claim cannot be made safely on purpose. To see the process side, choose Idempotency reconciliation sweep on Service idempotency log as an Integration administrator and run it: with nothing stale it reports "Lattice idempotency reconciliation completed. Resolved: 0, released for retry: 0, parked for review: 0 (of 0 stale self-describing claims)."