How to get stock balance with inventory dimension in server script?

i looked at get_stock_balance() in erpnext/erpnext/stock/utils.py at develop · frappe/erpnext · GitHub and saw that it has inventory dimension as input but the following two calls return the same value:

without inventory dimension

x = frappe.call('erpnext.stock.utils.get_stock_balance', 
 item_code='STO-ITEM-2025-00001',
 warehouse='Finished Goods - T'
)
print(x)

output: 1471.0

with inventory dimension:

x = frappe.call('erpnext.stock.utils.get_stock_balance', 
 item_code='STO-ITEM-2025-00001',
 warehouse='Finished Goods - T',
 inventory_dimensions_dict={'customer': 'test'}
)
print(x)

output: 1471.0

i think i know its because erpnext.stock.utils.get_stock_balance returns last_entry.qty_after_transaction but how else do i get the balance value of 20 that i see in the stock balance report ? maybe i call the function in a wrong way ? is there another function for this that is whitelisted or another way to get this ? I would appreciate any help :slight_smile: