Skip to main content
PUT
/
balances
/
{balance_id}
/
identity
Update balance identity
curl --request PUT \
  --url http://localhost:5001/balances/{balance_id}/identity \
  --header 'X-blnk-key: <api-key>'
import requests

url = "http://localhost:5001/balances/{balance_id}/identity"

headers = {"X-blnk-key": "<api-key>"}

response = requests.put(url, headers=headers)

print(response.text)
const options = {method: 'PUT', headers: {'X-blnk-key': '<api-key>'}};

fetch('http://localhost:5001/balances/{balance_id}/identity', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_PORT => "5001",
CURLOPT_URL => "http://localhost:5001/balances/{balance_id}/identity",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_HTTPHEADER => [
"X-blnk-key: <api-key>"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main

import (
"fmt"
"net/http"
"io"
)

func main() {

url := "http://localhost:5001/balances/{balance_id}/identity"

req, _ := http.NewRequest("PUT", url, nil)

req.Header.Add("X-blnk-key", "<api-key>")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.put("http://localhost:5001/balances/{balance_id}/identity")
.header("X-blnk-key", "<api-key>")
.asString();
require 'uri'
require 'net/http'

url = URI("http://localhost:5001/balances/{balance_id}/identity")

http = Net::HTTP.new(url.host, url.port)

request = Net::HTTP::Put.new(url)
request["X-blnk-key"] = '<api-key>'

response = http.request(request)
puts response.read_body
Use blnk.LedgerBalances.updateIdentity to link a balance to an identity.
1

Call the method

blnk.LedgerBalances.updateIdentity
const response = await blnk.LedgerBalances.updateIdentity(
  'bln_5ce86029-3c2e-4e2a-aae2-7fb931ca4c4f',
  {
    identity_id: 'idt_3b63c8da-af29-4cc3-ad38-df17d87456e6',
  },
);
FieldTypeDescription
balanceIdstringBalance ID to update.
identity_idstringIdentity ID to link to the balance.
2

Confirm the link

On success, Core returns a confirmation message. Fetch the balance with get balance to verify identity_id is set.
3

Response

200 OK
{
  "message": "Balance identity updated successfully"
}
FieldTypeDescription
messagestringConfirmation from Core.

Link balances

Linking identities to balances.

Update balance identity

HTTP request and response schema.

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.