Skip to main content
Transactions enable money movement between two or more balances. These can be payments, transfers, settlements, internal treasury management, etc. All transactions in Blnk are recorded with the double entry principle - every transaction has a source and a corresponding destination. Transactions happen between balances, and balances are created within ledgers. In this guide, you’ll learn about:
  1. Transaction properties
  2. Recording a transaction
  3. Verifying transactions

Transaction properties

  1. Immutability: Once recorded, transactions in Blnk cannot be modified or deleted. This fundamental property ensures the integrity and reliability of your transaction history, preventing any unauthorized alterations. See also: Transaction hashing
  2. Idempotency: Each transaction in Blnk produces the same result whether executed once or multiple times. This is crucial for maintaining data consistency, especially during network failures or system retries.
    Blnk implements idempotency by requiring a unique reference for every transaction. This reference serves as a transaction identifier, preventing duplicate processing and ensuring consistent outcomes.

Recording a transaction

To record a transaction, call the record-transaction endpoint:
Response
If this is your first transaction, the participating balances will start at 0. To ensure the transaction is successful, enable overdrafts as shown above, allowing the source balance to go negative.Learn more about Overdrafts and Negative Balances.
To preview the same request without writing a transaction, set dry_run to true. See Dry-run transactions.
Passing detailed data with the meta_data object is encouraged; it provides you with 360-degree insights about each transaction record. Examples of data you can pass include sender_name, account_number, bank_name, receiver_name, payment_id, ip_address, location, payment_method, etc.

Verifying transactions with queue enabled

When using the default queue system, every transaction starts as QUEUED. To verify your transaction status, you have two options:
  1. Webhooks: Blnk sends webhook notifications when transaction states change.
  2. Direct API calls: Query the transaction status using the reference or transaction ID. See below:
    Blnk appends a _q suffix to your original reference after processing a QUEUED transaction. To verify the updated status, retrieve the transaction using your original reference plus the _q suffix.
    Response

Verifying transactions without queue disabled

When using skip_queue: true, transactions are processed immediately and you can verify them from the direct response. Learn more about skip queue.
Response
With skip_queue: true, a successful request immediately returns an INFLIGHT or APPLIED transaction. If the source has insufficient funds, see Managing insufficient funds.
When using skip_queue: true, you may encounter lock errors if multiple transactions are processed simultaneously on the same balance. Learn how to handle these scenarios in our Handling Hot Balances guide.

Discarded transactions

Some requests are not recorded in the ledger. Common reasons include:
  1. Duplicate reference: Your new transaction reference matches an existing reference in your ledger. Blnk requires unique reference values per transaction. Options are timestamps (e.g. UNIX timestamp), random string or UUID (e.g. ref_e55c4f33-bff7-4c30-9b9f-5d2d10a29b7a), or a business identifier like an order_id.
  2. Zero amount: Your transaction amount is 0. Zero amounts are not recorded in the Blnk ledger.
  3. Insufficient funds with skip_queue: true: The rejected attempt is not recorded. See Managing insufficient funds.
Make sure your request body match the Blnk Ledger API specifications. For example, avoid passing apply_overdraft instead of allow_overdraft.

Managing insufficient funds

Available in version 0.11.0 and later. For versions 0.10.8 and older, see our insufficient funds guide.
Blnk performs comprehensive balance checks before processing any transaction to ensure you have sufficient funds available. The system computes an available balance by calculating balance - inflight_debit_balance on the source balance. Inflight debit balance is the amount waiting to be deducted from the source balance from inflight transactions. Learn more: Create inflight. If the transaction amount is more than the available balance, the outcome depends on how Blnk processes the request.

Default queue

The API first returns a QUEUED transaction. The worker then records a separate REJECTED transaction. That record uses parent_transaction to point back to the queued transaction, and stores the reason in meta_data.blnk_rejection_reason. Blnk sends a transaction.rejected webhook for the rejected record. With the default queue configuration, this happens on the first failure. If insufficient-fund retries are enabled, Blnk retries first and records REJECTED only after those retries are exhausted.

Skip queue

When skip_queue: true, Blnk processes the request immediately and returns 400 TXN_INSUFFICIENT_FUNDS. The rejected attempt is not recorded, so the reference is not used. You can retry the same reference after the source has enough funds.
If you want a transaction to proceed even when it exceeds the available balance, you can enable overdrafts by setting allow_overdraft: true in your transaction request. Learn more.

Dive deeper

Dry-run transactions

Preview balances without writing a transaction.

Transaction lifecycle

States from creation through completion.

Understanding precision

Decimal handling for accurate amounts.

Transaction statuses

What each status means and when it applies.

Need help?

We are very happy to help you make the most of Blnk, regardless of whether it is your first time or you are switching from another tool. To ask questions or discuss issues, please contact us or join our Discord community.