POST
/
balances
curl --request POST \
  --url http://localhost:5001/balances \
  --header 'X-blnk-key: <api-key>' \
  --header 'Content-Type: application/json' \
  --data '{
    "ledger_id": "ldg_049495c6-356e-4ebc-a45e-60d1e1e16afb",
    "currency": "USD"
  }'
{
    "balance": 0,
    "inflight_balance": 0,
    "credit_balance": 0,
    "inflight_credit_balance": 0,
    "debit_balance": 0,
    "inflight_debit_balance": 0,
    "ledger_id": "ldg_049495c6-356e-4ebc-a45e-60d1e1e16afb",
    "identity_id": "",
    "balance_id": "bln_5ce86029-3c2e-4e2a-aae2-7fb931ca4c4f",
    "currency": "USD",
    "created_at": "2024-11-26T08:36:36.238244338Z",
    "meta_data": null
}

Authorization

If set, the API uses an API key for authentication. Include the following header in your requests: X-blnk-key: <api-key>.

Replace <api-key> with your secret API key. Ensure the key is kept secure and not exposed in public repositories or client-side code.

See also: Secure your Blnk server

Body

ledger_id
string
required

Unique id of the ledger the balance is created in.

currency
string
required

The currency/asset class of this balance. See the following: Understanding asset classes and Currencies

identity_id
string

Unique id of identity (if any) to be linked to the balance. Can be left out from the request body if there’s no identity to be linked.

meta_data
object

Additional metadata for the request body.

Response

balance
integer
required

The net amount being stored in the balance.

inflight_balance
integer
required

The net amount waiting to be moved into or out of the balance.

credit_balance
integer
required

Total amount moved into the balance

inflight_credit_balance
integer
required

Total amount waiting to be moved into the balance.

debit_balance
integer
required

Total amount moved out of the balance.

inflight_debit_balance
integer
required

Total amount waiting to be moved out of the balance.

ledger_id
string
required

Unique id of the ledger the balance is created in.

identity_id
string

Unique id of the identity (if any) linked to this balance.

balance_id
string
required

Unique id of the created balance.

currency
string
required

The currency/asset class of the balance.

created_at
string
required

Indicates the date & time of creation.

meta_data
User Object

Additional metadata of the balance.

curl --request POST \
  --url http://localhost:5001/balances \
  --header 'X-blnk-key: <api-key>' \
  --header 'Content-Type: application/json' \
  --data '{
    "ledger_id": "ldg_049495c6-356e-4ebc-a45e-60d1e1e16afb",
    "currency": "USD"
  }'
{
    "balance": 0,
    "inflight_balance": 0,
    "credit_balance": 0,
    "inflight_credit_balance": 0,
    "debit_balance": 0,
    "inflight_debit_balance": 0,
    "ledger_id": "ldg_049495c6-356e-4ebc-a45e-60d1e1e16afb",
    "identity_id": "",
    "balance_id": "bln_5ce86029-3c2e-4e2a-aae2-7fb931ca4c4f",
    "currency": "USD",
    "created_at": "2024-11-26T08:36:36.238244338Z",
    "meta_data": null
}

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.