API documentation refers to the description of classes and methods in frameworks and libraries. The REST API is another example that’s expected to have well-formulated documentation
Now, ask yourself how often do you write documentation for the cases mentioned above. Do you write in the comments what each class does? Do all your REST methods have a place where all possible responses defined?
need to know who the end-user of the product is.
Documenting the approach or flow helps you to design the final product. It enables sharing the understanding within the team of how the entire system works — for instance, how the whole payment system works. Otherwise, some important details, like why payment verification is mandatory, could be missing or wrongly interpreted.