Ledga
POST /transactions/{transactionId}/void

Void a posted transaction

Sets status to void and recalculates balances so the transaction's effect disappears; rows and entries are kept. Use it to remove an encumbrance-layer posting nothing has been actioned against; anything else moves by reverse and repost. Voiding a reversal's contra puts its original back to posted.

Parameters

NameInTypeDescription
transactionIdrequired path string
uuid
Transaction UUID to void

Request body

FieldTypeDescription
reason string
max length: 255 · nullable
Optional reason recorded on the transaction and in the activity log.

Responses

200Transaction voided
{
  "success": true,
  "data": {
    "ledger_id": "01997b90-1c2d-7e3f-8a4b-5c6d7e8f9a0b",
    "journal_id": null,
    "total_amount": "500.00",
    "entry_count": 2,
    "voided_by": {
      "type": "api_key",
      "id": "01997c20-5e3b-7d14-8c2a-6f1b9e0d7a42"
    },
    "voided_at": "2026-01-20T09:00:00+00:00",
    "void_reason": "rescheduled",
    "id": "019bc0fd-89c0-7a10-8b2c-3d4e5f6a7b8c",
    "reference": "PLAN-42-03",
    "description": "Instalment 3 of plan 42",
    "effective_date": "2026-03-01T00:00:00.000000Z",
    "date": "2026-03-01T00:00:00.000000Z",
    "layer": "encumbrance",
    "status": "void",
    "hash": "9f2c4e1a7b3d5f60c8e2a4b6d8f0e1c3a5b7d9f1e3c5a7b9d1f3e5c7a9b1d3f5",
    "previous_hash": "4b1a8c2e6f0d3a5c7e9b1d3f5a7c9e1b3d5f7a9c1e3b5d7f9a1c3e5b7d9f1a3c",
    "correlation_id": "019bc0fd-89c0-7a10-8b2c-3d4e5f6a7b8c",
    "correlation_source_id": null,
    "correlation_type": null,
    "metadata": null,
    "attributes": {
      "customer_id": "C-123"
    },
    "original_transaction_id": null,
    "reversal_reason": null,
    "entries": [
      {
        "id": "019bc0fd-89c0-7a11-8b2c-3d4e5f6a7b8c",
        "account_id": "01997b91-2a3b-7c4d-9e5f-6a7b8c9d0e2a",
        "account_code": "1200",
        "account_name": "Receivables",
        "amount": "500.00",
        "type": "debit",
        "description": null,
        "layer": "encumbrance",
        "metadata": null
      },
      {
        "id": "019bc0fd-89c0-7a12-8b2c-3d4e5f6a7b8c",
        "account_id": "01997b91-2a3b-7c4d-9e5f-6a7b8c9d0e20",
        "account_code": "4000",
        "account_name": "Sales",
        "amount": "500.00",
        "type": "credit",
        "description": null,
        "layer": "encumbrance",
        "metadata": null
      }
    ],
    "created_at": "2026-01-15T09:30:00+00:00",
    "updated_at": "2026-01-20T09:00:00+00:00"
  }
}
401Unauthenticated
{
  "success": false,
  "message": "Validation failed",
  "code": "VALIDATION_ERROR"
}
403Forbidden
{
  "success": false,
  "message": "Validation failed",
  "code": "VALIDATION_ERROR"
}
404Transaction not found
{
  "success": false,
  "message": "Validation failed",
  "code": "VALIDATION_ERROR"
}
409Not voidable (code TRANSACTION_NOT_VOIDABLE) or effective date in a closed period or one whose close is in progress (code PERIOD_LOCKED)
{
  "success": false,
  "message": "Validation failed",
  "code": "VALIDATION_ERROR"
}
422Validation error: a reason longer than 255 characters
{
  "success": false,
  "message": "Validation failed",
  "code": "VALIDATION_ERROR"
}

Examples

curl -X POST https://ledga.io/api/v1/transactions/{transactionId}/void \
  -H "Authorization: Bearer sk_xxxxxxxx_your_secret" \
  -H "Content-Type: application/json" \
  -d '{
  "reason": "rescheduled"
}'

← All endpoints