There are several biochemical pathways by which cells of heterotrophic organisms can synthesize ATP.
substrate level phosphorylation (glycolysis and from creatin phosphate)
chemi-osmosis