/v1/invoices
And return fails first to simplify if..else and make the code more readable.
deletewallet