Generate Invoices from Contracts via API

I have been using the API to automate invoice generation from my ticketing system using SQL and API calls in PHP scripts for some time now, but now I have clients that now have subscriptions and i need to automate invoice generation.

The built in contracts invoice generation appears to not function. Maybe I need to add a cron job?

Either way, I figure there should be a method to create invoices from contracts using the API. What series of API calls would accomplish this goal?