We're working on setting up a customer account login area on our website where copies of final invoices may be downloaded directly. I've created a REST API on the website side that allows us to update order status from (example) Processing to Complete, once an invoice is generated from a sales order... or "Partially Shipped" if all items are not invoiced.
What I would like to do as well, is offer our users the ability to download a copy of an invoice directly from our web admin area. I'm thinking the most secure method of doing this will be to make a custom PHP function on our end that interfaces with the Method API to deliver the file securely "on call", rather than storing the invoices on our server.
Problem is, I have no idea how to do this. I can write the PHP but at a loss as to what functions would accomplish this... we can store the RecordID of the invoice itself in our web database and use it in making the call, but would like to know how we would go about this most intelligently as (to be honest) I'm completely new to working with the MethodAPI (though I have read all of the documentation).
My second thought, if there is no API call to download a specific record with a specific print template as a PDF would be to generate the file & save it as an action result with the intention of sending the file to our web server somehow. Again, my problem is I have zero idea as to how this would be accomplished using the Method API as it interfaces with our API.
Thoughts? Ideas?
Best,
The Wombat