This pain can be related to the kidney stones. Kidney stones are of four types: calcium oxalate stones, struvite stones, uric acid stones or cystine stones. Potassium citrate is used for the treatment of stones. I would suggest you to get an evaluation done from a urologist to determine the type of stone. Treatment modes include Extracorporeal Shock Wave Lithrotripsy (ESWL), uteroscopic stone removal and percutaneoud nephrolithotomy.
I hope it helps. Take care and regards.