Hello,
Creating an invoice and generating a portal link is perfectly possible through the API. You first have to create the invoice, and line items, then call send to desktop, and finally generate a portal link.
I've attached a code sample which does this below for a simple invoice
var MAPIsvc = new MethodAPIService.Service();
string account = txtAccountName.Text;
string email = txtLoginEmail.Text;
string pwd = txtLoginPassword.Text;
string recordId = "";
string tablename = "Invoice";
string[ fields = "Customer,BillAddressAddr1,DueDate,TxnDate".Split(',');
string[ values = "Fake Company,123 Fake St,2015-03-16 12:00:00,2015-03-16 12:00:00".Split(',');
txtResponse.Text = MAPIsvc.MethodAPIInsert(account, email, pwd, tablename, fields, values, ref recordId);
tablename = "InvoiceLine";
fields = "InvoiceRecordID,Item,Quantity,Rate,RateInclusive,SalesTaxCode".Split(',');
values = (recordId+",Hours,10,25,25,Non").Split(',');
txtResponse.Text = MAPIsvc.MethodAPIInsert(account, email, pwd, tablename, fields, values, ref recordId);
txtResponse.Text = MAPIsvc.MethodAPIActionSendToDesktopV2(account, email, pwd, "", "Invoice", recordId);
txtResponse.Text = MAPIsvc.MethodAPIGetScreenURLV4(account, email, pwd, null, "MIurl", "Customers", "Recent Transactions", null, null, null, true, "Contacts_Portal","289");