added createInvoice method