Ledgers

Create ledger

Create a new ledger with the Python SDK.

POST/ledgers

Use 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",
  },
})
FieldTypeDescription
namestrDisplay name for the ledger.
meta_datadictOptional 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"
  }
}
FieldTypeDescription
ledger_idstrUnique ID for the ledger. Use this when creating balances and transactions.
namestrName you passed in the request.
created_atstrDate and time the ledger was created.
meta_datadictMetadata object, if you sent one.