Skip to main content
POST
/
ledgers
curl -X POST https://YOUR_BLNK_INSTANCE_URL/ledgers \
  -H 'Content-Type: application/json' \
  -H 'X-Blnk-Key: YOUR_API_KEY' \
  -d '{
    "name": "Customer Wallets",
    "meta_data": {
      "region": "US",
      "project_id": "proj_123"
    }
  }'
{
  "ledger_id": "ldg_0a3b7c7e-e7a8-4f1e-9f6a-3d4c8b2e1a5f",
  "name": "Customer Wallets",
  "created_at": "2024-01-15T10:30:00Z",
  "meta_data": {
    "region": "US",
    "project_id": "proj_123"
  }
}
A ledger is a logical container for organizing balances and accounts. Each ledger represents a separate accounting entity with its own set of balances.

Request Body

name
string
required
The name of the ledger. This field is required and cannot be empty.
meta_data
object
Additional metadata to associate with the ledger. Can contain any key-value pairs for custom data storage.

Response

ledger_id
string
Unique identifier for the ledger
name
string
The name of the ledger
created_at
string
ISO 8601 timestamp of when the ledger was created
meta_data
object
Custom metadata associated with the ledger
curl -X POST https://YOUR_BLNK_INSTANCE_URL/ledgers \
  -H 'Content-Type: application/json' \
  -H 'X-Blnk-Key: YOUR_API_KEY' \
  -d '{
    "name": "Customer Wallets",
    "meta_data": {
      "region": "US",
      "project_id": "proj_123"
    }
  }'
{
  "ledger_id": "ldg_0a3b7c7e-e7a8-4f1e-9f6a-3d4c8b2e1a5f",
  "name": "Customer Wallets",
  "created_at": "2024-01-15T10:30:00Z",
  "meta_data": {
    "region": "US",
    "project_id": "proj_123"
  }
}

Usage Notes

  • The name field is required and must not be empty
  • Ledger IDs are automatically generated and guaranteed to be unique
  • The meta_data field is optional and can store any JSON-serializable data
  • Once created, ledgers cannot be deleted, only updated
  • Use descriptive names that clearly identify the purpose of the ledger (e.g., “USD Operations”, “Customer Wallets”, “Merchant Accounts”)

Build docs developers (and LLMs) love