Ledgers

Update ledger name

Update the name of an existing ledger with the Java SDK.

PUT/ledgers/{ledger_id}

Use blnk.ledgers().update for this operation.

Call the method

String ledgerId = "ldg_073f7ffe-9dfd-42ce-aa50-d1dca1788adc";

ApiResponse<JsonNode> response = blnk.ledgers().update(
    ledgerId,
    UpdateLedger.create()
        .name("Renamed ledger")
        .metaData(Map.of("tier", "gold")));
FieldTypeDescription
idStringLedger ID to update.
nameStringNew display name for the ledger.

Confirm the update

The ledger_id in the response stays the same. Verify response.data().get("name").asText() matches the name you passed in the request.

Response

{
  "ledger_id": "ldg_073f7ffe-9dfd-42ce-aa50-d1dca1788adc",
  "name": "Updated Customer Savings Ledger",
  "created_at": "2024-02-20T05:28:03.558281542Z",
  "meta_data": {
    "project_owner": "Acme LLC",
    "description": "For all savings account created & managed by Acme."
  }
}
FieldTypeDescription
ledger_idStringUnique ID for the ledger. Unchanged after the update.
nameStringUpdated name you passed in the request.
created_atStringDate and time the ledger was created.
meta_dataJsonNodeExisting metadata on the ledger. Not modified by this method.