API for payment errors before transaction?

Is there an API for the payment errors to see which errors prevent users from the transaction?