Ledgers
Create ledger
Create a new ledger with the Java SDK.
POST
/ledgersUse blnk.ledgers().create for this operation.
Call the method
ApiResponse<JsonNode> response = blnk.ledgers().create(
CreateLedger.create()
.name("Customer wallets")
.metaData(Map.of("environment", "production")));
| Java builder | Wire field | Type | Description |
|---|---|---|---|
name() | name | String | Display name for the ledger. |
metaData() | meta_data | Map<String, Object> | Optional metadata for extra context. |
Save the ledger ID
Use response.data().get("ledger_id").asText() when creating balances or transactions in this ledger.
Response
{
"ledger_id": "ldg_073f7ffe-9dfd-42ce-aa50-d1dca1788adc",
"name": "Customer wallets",
"created_at": "2024-02-20T05:28:03.558281542Z",
"meta_data": {
"environment": "production"
}
}
| Field | Type | Description |
|---|---|---|
ledger_id | String | Unique ID for the ledger. Use this when creating balances and transactions. |
name | String | Name you passed in the request. |
created_at | String | Date and time the ledger was created. |
meta_data | JsonNode | Metadata object, if you sent one. |