APG PayAPG Paydocs

Ledgers and journals

Update ledger

PATCH/ledgers/{ledgerId}

Recount a ledger from a point in time, optionally from a stated opening balance.

Permissions

Required permission
systemLedgerEntries:create

Requires the `create` action on `systemLedgerEntries` for the supplied runtime context

Path parameters

ledgerIdstring
required

Request body

This body is a tagged shape: type is always "SldgUpdateRecount". Send it; more variants can be added, and a caller that switches on it keeps working when they are.

Discriminated by type
type = "SldgUpdateRecount"
recountFromstring (date-time)required

Recount from this instant, including every entry at or after it. Edge's ResetLedgerStartPoint.

Example 2026-08-19T04:21:07Z

initialBalanceMinorUnits

The balance to start the recount from. Omit to start from nothing.

Example 1250

curl -X PATCH https://api.tst.au.apgpay.dev/ledgers/{ledgerId} \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "type": "SldgUpdateRecount",
  "recountFrom": "2026-08-19T04:21:07Z",
  "initialBalance": 1250
}'

Responses

The response is a tagged shape: type is always "SldgUpdateRspAttributes". Switch on it; subtypes can be added, and a client that already reads it will not break.

Discriminated by type
type = "SldgUpdateRspAttributes"

The resource as it stands after the change.

Example
{
  "type": "SldgUpdateRspAttributes",
  "updated": {
    "type": "SldgViewAttributes",
    "ledgerId": "sldg_9f2Kd8QpLzXw",
    "businessKey": {
      "type": "SjnlBusinessKeyAttributes",
      "ownerType": "Merchant",
      "ownerIdentifier": "string",
      "category": "General",
      "clearanceSystem": "string",
      "currency": "AUD"
    },
    "ledgerName": "Ada Lovelace",
    "lastClearanceDate": "2026-08-19",
    "lastLedgerSequence": 1250,
    "lastClearanceAutomated": true,
    "latestEntry": {
      "type": "SldgEntryAttributes",
      "sequence": 1250,
      "currency": "AUD",
      "balance": 1250,
      "createdAt": "2026-08-19T04:21:07Z"
    },
    "createdAt": "2026-08-19T04:21:07Z",
    "updatedAt": "2026-08-19T04:21:07Z"
  }
}

Error responses