Import payments from command line/cron?

What I did so far is a little nightly script to export the open balance records after the recurring job into a tab separated file and transfer it to another system holding a GNUCash app working with mysql/mariadb uśing:

#!/bin/bash
# variable declarations
# do recurring call i.e. wget
cat << SQL | mysql --skip-column-names -r -h${DB_HOST} -u${DB_USER} -p${DB_PASS} ${DB} > open_balance.csv
CREATE OR REPLACE
 ALGORITHM = UNDEFINED
  VIEW ip_client_balance_combined
   (invoice_id, invoice_number, invoice_date_created, client_id, invoice_balance, client_custom_custno)
    AS 
    SELECT    i.invoice_id, i.invoice_number, i.invoice_date_created, c.client_id, ia.invoice_balance, cc.client_custom_custno
        FROM  ip_invoices AS i
        JOIN  ip_invoice_amounts AS ia ON ia.invoice_id = i.invoice_id
        JOIN  ip_clients AS c ON c.client_id = i.client_id
        JOIN  ip_client_custom AS cc ON cc.client_id = i.client_id
        WHERE i.invoice_status_id=2
        AND   ia.invoice_balance > 0
        AND   c.client_active = 1 
        ORDER BY i.invoice_date_created,i.invoice_number;
SELECT * FROM ip_client_balance_combined;
SQL

Next, on the other system, I receive the information from the bank account (AqBanking) holding payments within GNUCash. With another nightly script I check/match payments based on the bank description field, amount etc. resulting in a payment.csv. Remarks: Matching can be approved if you use a custom client_custom_custno field.

The missing part now is: Can I do an import in the same way like recurring invoices using a cron job. In other words I’d need a command line tool (i.e CLI) to solve the whole chain back and automate InvoicePlane a bit more.

Further thoughs: Exporting could be a CLI/cron function, too - like imports
German readers and GNUcash users may want to read the preseedings howto for InvoicePlane.

[size=10]Last Update: 09.07.2015[/size]