It's a complicated problem to ensure a perfect solution. Look for the "Byzantine Generals Problem."
One way to solve it quite satisfactorily is to use the two-phase commit technique. In the first phase, you invoke a pre-commit API. If all services return successfully in the pre-commit phase, a second API is invoked (in each of them) by committing the commit.
There could still be a crash in the caller, so that the final commit is invoked on only a portion of the remote services, but mitigating techniques can be used (eg to note all pending operations on a journal or disk record before If the caller breaks in the middle of the list of commits, it resets the commits when it is run again.)
Anyway, the fact is that the remote APIs need to provide the basic tool, which is the commit in 2 phases. Remote services need to be thought of as, once the pre-commit has been approved, the final commmit can never fail.