Available in version 0.6.0 and later.

Overview

To send money, the source is required to have enough funds to execute the transaction. If Blnk detects insufficent funds, the transaction is rejected. However, there are certain transaction workflows that do not fit this default requirement.

Overdrafts is a Blnk feature that lets you successfully record a transaction regardless of the source’s balance. When overdrafts is enabled, the transaction is processed and the balance (if insufficent) is allowed to go negative.

Learn more about how to work with negative balances

A very popular use-case for overdrafts is lending. You can also use it for internal balances that do not have a starting balance such as @World.

What we’ll cover …

  1. Enabling overdrafts
  2. Some real-life applications

Enabling overdrafts

Overdrafts are applied when recording a transacton. To enable overdraft, include the allow_overdraft parameter and set its value to true in your request body:

Request
{
    "amount": 112.30,
    "precision": 100,
    "reference": "ref-ghwe12009",
    "currency": "USD",
    "source": "@World",
    "destination": "bln_28edb3e5-c168-4127-a1c4-16274e7a28d3",
    "allow_overdraft": true,
    "meta_data": {
      "account_type": "savings"
    }
}

Setting overdraft limits

Available on version 0.10.1 or later.

By default, when the allow_overdraft parameter is set to true without additional settings, there is no limit to how negative an account balance can go.

However, in most cases, you’ll want to define a maximum overdraft limit using the overdraft_limit parameter.

Request
{
  "amount": 112.30,
  "precision": 100,
  "reference": "ref-ghwe12009",
  "currency": "USD",
  "source": "@World",
  "destination": "bln_2e8db3e5-c168-4127-a1c4-16274e7a28d3",
  "allow_overdraft": true,
  "overdraft_limit": 500.00,
  "meta_data": {
    "account_type": "savings"
  }
}
Overdraft fieldsTypeDescription
allow_overdraftBooleanEnables overdraft functionality, allowing the account balance to go negative.
overdraft_limitNumberSets the maximum overdraft amount.

How overdraft limits work

When processing a transaction with an overdraft limit:

  1. If the source account has sufficient funds, the transaction proceeds as normal.

  2. If the source account has insufficient funds but allow_overdraft is true:

    • If overdraft_limit is set to 0 or not provided, the transaction will succeed, and the balance can go negative without restriction.
    • If overdraft_limit is greater than 0, the transaction will only succeed if the resulting negative balance does not exceed the specified limit.

Error handling

If a transaction would cause the balance to exceed the overdraft limit, it will fail with the following error message:

{
  "error": "failed to apply transaction to balances: transaction exceeds overdraft_limit"
}

Some real-life applications

  1. Loans and credit facilities: You can easily implement lending features, track how much a customer has spent outside of their available balance, manage credit history, etc., and record it all in your Blnk Ledger.

    With overdraft limits, you can set credit limits for different customers based on their creditworthiness.

  2. Internal money movement: Your internal balances can often face fluctuations in cash flow, especially during unpredictable periods. Overdrafts allow you to efficiently manage this without disrupting your financial operation.

    Setting overdraft limits helps maintain control over internal spending.

  3. Prepaid cards with buffer: You can implement prepaid cards that allow a small overdraft buffer (e.g., $20) to handle scenarios like tips added after a restaurant charge.

  4. Tiered overdraft limits: You can implement different overdraft limits for different customer tiers or account types by storing these values in your system and applying the appropriate limit in each transaction.


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.

Love building with Blnk? We’d love to hear your feedback. Tell us here.