Ledgers
Create ledger
Create a new ledger with the Python SDK.
POST
/ledgersUse blnk.ledgers.create to create a new ledger for your system.
Call the method
response = blnk.ledgers.create({
"name": "Customer wallets",
"meta_data": {
"environment": "production",
},
})
| Field | Type | Description |
|---|---|---|
name | str | Display name for the ledger. |
meta_data | dict | 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 | str | Unique ID for the ledger. Use this when creating balances and transactions. |
name | str | Name you passed in the request. |
created_at | str | Date and time the ledger was created. |
meta_data | dict | Metadata object, if you sent one. |