Skip to main content

Overview

Blnk enables you to create and link multiple balances to a single identity within your Ledger. Any transaction record associated with a linked balance is also automatically mapped to the corresponding identity.
To create a balance connected to an identity, include the identity_id of the identity you want to associate with the balance in the request body of the create-balance endpoint as shown below:
cURL
curl -X POST "http://localhost:5001/balances" \
  -H "X-blnk-key: <api-key>" \
  -H "Content-Type: application/json" \
  -d '{
    "ledger_id": "ldg_073f7ffe-9dfd-42ce-aa50-d1dca1788adc",
    "identity_id": "idt_0501db5c-baf9-4be1-a931-f4bae7f3a41d",
    "currency": "USD"
  }'
Response
{
    "balance": 0,
    "version": 0,
    "inflight_balance": 0,
    "credit_balance": 0,
    "inflight_credit_balance": 0,
    "debit_balance": 0,
    "inflight_debit_balance": 0,
    "precision": 0,
    "ledger_id": "ldg_073f7ffe-9dfd-42ce-aa50-d1dca1788adc",
    "identity_id": "idt_0501db5c-baf9-4be1-a931-f4bae7f3a41d",
    "balance_id": "bln_e39a239a-a6ca-4509-b0d9-29dcc5630f8a",
    "indicator": "",
    "currency": "USD",
    "created_at": "2024-07-05T08:13:18.882616461Z",
    "meta_data": {
        "customer_internal_id": "1234",
        "customer_name": "Jerry"
    }
}

Update a balance’s identity

You can update the identity associated with an existing balance using the Update Balance Identity endpoint:
curl -X PUT "http://localhost:5001/balances/{id}/identity" \
  -H "X-blnk-key: <api-key>" \
  -H "Content-Type: application/json" \
  -d '{
    "identity_id": "idt_3b63c8da-af29-4cc3-ad38-df17d87456e6"
  }'
You can link a balance to a different identity. The identity must exist in your system before you can associate it with a balance. This provides flexibility in managing customer data relationships.

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.
Tip: Connect to Blnk Cloud to see your Core data.You can view your transactions, manage identities, create custom reports, invite other team members to collaborate, and perform operations on your Core — all in one dashboard.Check out Blnk Cloud →
I