Ledgers
Create ledger
Create a new ledger with the TypeScript SDK.
POST
/ledgersUse blnk.Ledgers.create to create a new ledger for your system.
Call the method
const response = await blnk.Ledgers.create({
name: 'Customer wallets',
meta_data: {
environment: 'production',
},
});
| Field | Type | Description |
|---|---|---|
name | string | Display name for the ledger. |
meta_data | object | Optional metadata for extra context. |
Save the ledger ID
Use response.data.ledger_id 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 | Record<string, unknown> | Metadata object, if you sent one. |