Retrieve a Credit Balance
curl --request GET \
--url https://api.sandbox.lead.bank/v2/user_credit_balances/{user_credit_balance_id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.sandbox.lead.bank/v2/user_credit_balances/{user_credit_balance_id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.sandbox.lead.bank/v2/user_credit_balances/{user_credit_balance_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.sandbox.lead.bank/v2/user_credit_balances/{user_credit_balance_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$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 := "https://api.sandbox.lead.bank/v2/user_credit_balances/{user_credit_balance_id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.sandbox.lead.bank/v2/user_credit_balances/{user_credit_balance_id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sandbox.lead.bank/v2/user_credit_balances/{user_credit_balance_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"id": "<string>",
"user_account_id": "<string>",
"name": "Personal Loan - Jane Smith",
"status": "active",
"status_reason": "active",
"currency_code": "USD",
"amount": 123,
"amount_in_usd": 123,
"amount_breakdown": {
"principal": 123,
"interest": 123,
"fees": 123
},
"fees": {
"accrued": 123
},
"rewards": {
"amount": 123,
"unit": "USD"
},
"dispute": {
"amount": 123,
"amount_breakdown": {
"principal": 123,
"interest": 123,
"fees": 123
}
},
"charge_off": {
"amount": 123,
"amount_breakdown": {
"principal": 123,
"interest": 123,
"fees": 123
}
},
"past_due": {
"amount": 123,
"past_due_days": 123,
"amount_breakdown": {
"principal": 123,
"interest": 123,
"fees": 123
}
},
"interest": {
"rate": "<string>",
"effective_rate": "<string>",
"effective_apr": "<string>"
},
"autopay_method": "ach",
"details": {
"structure": "revolving",
"expected_maturity_date": "2023-12-25",
"repayment_details": {
"expected_payment_frequency": "business_daily",
"expected_payment_frequency_interval_days": 123,
"expected_number_of_payments": 123,
"expected_first_payment_date": "2023-12-25",
"expected_first_payment_amount": 123,
"expected_last_payment_date": "2023-12-25",
"expected_last_payment_amount": 123,
"expected_payment_amount": 123
},
"max_funding_amount": 123,
"term": {
"length": 123,
"unit": "days"
},
"expected_finance_charge_amount": 123
},
"metadata": {},
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"closed_at": "2023-11-07T05:31:56Z"
}{
"code": "request_malformed",
"message": "The request is invalid and cannot be parsed by the server.",
"errors": [
{
"code": "url_malformed",
"message": "The request URL could not be parsed."
}
]
}{
"code": "authentication_missing",
"message": "The request has no authentication credentials. Send your API token in the Authorization header.",
"errors": [
{
"code": "authentication_missing",
"message": "The Authorization header is missing. Send your API token as a bearer token.",
"parameters": [
"Authorization"
]
}
]
}{
"code": "object_not_found",
"message": "No object exists at the requested ID, or it is not visible to this caller."
}{
"code": "parameters_invalid",
"message": "One or more parameters are invalid.",
"errors": [
{
"code": "value_malformed",
"message": "user_credit_balance_id is not a valid ID.",
"parameters": [
"user_credit_balance_id"
]
}
]
}{
"code": "rate_limit_exceeded",
"message": "You have exceeded the rate limit for this endpoint. Retry with backoff."
}{
"code": "internal_server_error",
"message": "An unexpected error occurred. Contact support with the Request-Id header value."
}{
"code": "endpoint_disabled",
"message": "This endpoint is temporarily disabled. Retry after the interval given in the Retry-After header."
}{
"code": "gateway_timeout",
"message": "An upstream system timed out. Retry with backoff."
}User Credit Balances
Retrieve a User Credit Balance
Retrieve a User Credit Balance by its ID.
GET
/
v2
/
user_credit_balances
/
{user_credit_balance_id}
Retrieve a Credit Balance
curl --request GET \
--url https://api.sandbox.lead.bank/v2/user_credit_balances/{user_credit_balance_id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.sandbox.lead.bank/v2/user_credit_balances/{user_credit_balance_id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.sandbox.lead.bank/v2/user_credit_balances/{user_credit_balance_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.sandbox.lead.bank/v2/user_credit_balances/{user_credit_balance_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$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 := "https://api.sandbox.lead.bank/v2/user_credit_balances/{user_credit_balance_id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.sandbox.lead.bank/v2/user_credit_balances/{user_credit_balance_id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sandbox.lead.bank/v2/user_credit_balances/{user_credit_balance_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"id": "<string>",
"user_account_id": "<string>",
"name": "Personal Loan - Jane Smith",
"status": "active",
"status_reason": "active",
"currency_code": "USD",
"amount": 123,
"amount_in_usd": 123,
"amount_breakdown": {
"principal": 123,
"interest": 123,
"fees": 123
},
"fees": {
"accrued": 123
},
"rewards": {
"amount": 123,
"unit": "USD"
},
"dispute": {
"amount": 123,
"amount_breakdown": {
"principal": 123,
"interest": 123,
"fees": 123
}
},
"charge_off": {
"amount": 123,
"amount_breakdown": {
"principal": 123,
"interest": 123,
"fees": 123
}
},
"past_due": {
"amount": 123,
"past_due_days": 123,
"amount_breakdown": {
"principal": 123,
"interest": 123,
"fees": 123
}
},
"interest": {
"rate": "<string>",
"effective_rate": "<string>",
"effective_apr": "<string>"
},
"autopay_method": "ach",
"details": {
"structure": "revolving",
"expected_maturity_date": "2023-12-25",
"repayment_details": {
"expected_payment_frequency": "business_daily",
"expected_payment_frequency_interval_days": 123,
"expected_number_of_payments": 123,
"expected_first_payment_date": "2023-12-25",
"expected_first_payment_amount": 123,
"expected_last_payment_date": "2023-12-25",
"expected_last_payment_amount": 123,
"expected_payment_amount": 123
},
"max_funding_amount": 123,
"term": {
"length": 123,
"unit": "days"
},
"expected_finance_charge_amount": 123
},
"metadata": {},
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"closed_at": "2023-11-07T05:31:56Z"
}{
"code": "request_malformed",
"message": "The request is invalid and cannot be parsed by the server.",
"errors": [
{
"code": "url_malformed",
"message": "The request URL could not be parsed."
}
]
}{
"code": "authentication_missing",
"message": "The request has no authentication credentials. Send your API token in the Authorization header.",
"errors": [
{
"code": "authentication_missing",
"message": "The Authorization header is missing. Send your API token as a bearer token.",
"parameters": [
"Authorization"
]
}
]
}{
"code": "object_not_found",
"message": "No object exists at the requested ID, or it is not visible to this caller."
}{
"code": "parameters_invalid",
"message": "One or more parameters are invalid.",
"errors": [
{
"code": "value_malformed",
"message": "user_credit_balance_id is not a valid ID.",
"parameters": [
"user_credit_balance_id"
]
}
]
}{
"code": "rate_limit_exceeded",
"message": "You have exceeded the rate limit for this endpoint. Retry with backoff."
}{
"code": "internal_server_error",
"message": "An unexpected error occurred. Contact support with the Request-Id header value."
}{
"code": "endpoint_disabled",
"message": "This endpoint is temporarily disabled. Retry after the interval given in the Retry-After header."
}{
"code": "gateway_timeout",
"message": "An upstream system timed out. Retry with backoff."
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
The Credit Balance's ID
Pattern:
^user_credit_balance_\w+$Response
A single Credit Balance object
A user credit balance — a virtual end-customer credit position.
Pattern:
^user_credit_balance_\w+$The parent User Account's ID.
Human-readable name.
Example:
"Personal Loan - Jane Smith"
Available options:
active, inactive, closed, reporting_stopped Available options:
active, frozen, dormant, other, entity_closed, client_closed, paid_off, charged_off, canceled, receivables_sold_to_partner, data_not_available A three-letter currency code as defined in ISO 4217.
Available options:
USD Example:
"USD"
Signed, minor units.
Signed, minor units, in USD.
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Available options:
ach, debit_card, wire, virtual_wallet, credit_card, none Show child attributes
Show child attributes
A set of key-value pairs that can be used to store additional information related to this object.
Show child attributes
Show child attributes
Was this page helpful?

