Skip to main content

Endpoint

POST /accounts
Creates a new account in your Blnk ledger. Accounts are used to track balances for users, entities, or any financial resource in your system.

Request Body

bank_name
string
The name of the bank or financial institution
number
string
The account number. This should be unique within your system
currency
string
required
The currency code for the account (e.g., USD, EUR, GBP)
identity_id
string
The ID of the identity (user/entity) that owns this account
ledger_id
string
The ID of the ledger this account belongs to. If not provided, the account will be created in the general ledger
balance_id
string
The ID of an existing balance to associate with this account. If not provided, a new balance will be created automatically
meta_data
object
Additional metadata to store with the account. Can contain any key-value pairs for custom data

Response

account_id
string
The unique identifier for the created account
name
string
The account name
number
string
The account number
bank_name
string
The bank or financial institution name
currency
string
The currency code for the account
balance_id
string
The ID of the associated balance
identity_id
string
The ID of the identity that owns this account
ledger_id
string
The ID of the ledger this account belongs to
created_at
string
The timestamp when the account was created (ISO 8601 format)
meta_data
object
Custom metadata associated with the account

Example Request

{
  "bank_name": "Blnk Bank",
  "number": "1234567890",
  "currency": "USD",
  "identity_id": "idt_123abc",
  "ledger_id": "ldg_456def",
  "meta_data": {
    "account_type": "savings",
    "branch": "main"
  }
}

Example Response

{
  "account_id": "acc_789ghi",
  "name": "",
  "number": "1234567890",
  "bank_name": "Blnk Bank",
  "currency": "USD",
  "balance_id": "bln_321xyz",
  "identity_id": "idt_123abc",
  "ledger_id": "ldg_456def",
  "created_at": "2024-03-04T12:00:00Z",
  "meta_data": {
    "account_type": "savings",
    "branch": "main"
  }
}

Error Responses

error
string
Error message describing what went wrong

Common Errors

  • 400 Bad Request: Invalid request body or validation error
  • 500 Internal Server Error: Server error during account creation

Build docs developers (and LLMs) love