What's the best way from the API to know if an ACH or CC payment failed?

If you would like to be notified in real time of a status update, you would use the updateExternalFundMoveStatus webhook for ACH and updateCCFundMoveStatus for credit card.

If you are looking in the TransactAPI admin panel, you would be able to view the "Payment Status" on the trades table. You could also navigate to the dashboard and click on "View Payments."
If you are looking up the status via API, you would use the getExternalFundMoveInfo method or getCCFundMoveInfo.
If you would like to be notified in real time of a status update, you would use the updateExternalFundMoveStatus webhook for ACH and updateCCFundMoveStatus for credit card.