Connect external invoicing system

I would like to connect an external web based invoicing system to my self-hosted ERPNext system. The reason for that, is that I don’t want to deal with the Hungarian invoicing regulations, so I would connect one that is a certified already.

The external system has an RESTful XML API. Basically it accepts the invoice details in XML and replies with the complete invoice in PDF.

I am pretty new to ERPNext. How should I start to develop this connection?
Where could I inject this extra communication with the external system inside the invoice creation process of ERPNext?

You can use REST API