EDI (Electronic Data Interchange) is a set of standards for structuring information that is to be electronically exchanged between businesses.
API (Application Programming Interface) is an interface that defines interactions between multiple software applications. In short, it allows two applications can talk to each other.