Could be one of a few different things. If you are able to...net the fish, bring the net close to the surface and very gently feel his belly. Always use stress coat on your hands before handling fish. Is it soft or hard? You can put slight pressure and move your fingers from head to tail direction to see if poop comes out.
What food are you feeding the fish?
Try offering thawed out frozen peas, cracked out of it's shell. If the fish is blocked up, this will serve as a laxative to clear his intestines and bowels.
Refusing to eat is a serious sign and may not accept even the peas. If this is the case, isolate the fish in a hospital tank. Use a garlic additive as an appetite stimulator. Then try offering the peas again. Isolation is a preventative measure just in case he is sick with a disease instead of having a case of constipation.
Always check water quality whenever you suspect something wrong with the fish whether to confirm or deny a problem in that area.
Keep us updated, please.