Is it somehow possible to get the PDF invoice which has been created for an order from outside of Magento?

I want to be able to send a mail to the customer containing a link to the PDF. He clicks on that link and the invoice will be shown. That should work without any login, just the click and the invoice is shown.

Ideas on how to solve this?

Thanks for helping!

1 Answer 1


When the invoice is generated, it is normally not saved on the server, so you can't link to it.

To solve your problem, you should make an own module. You would then write a controller that generates the invoice for a given order, you could for example provide that ID with the request. So for http://myshop.com/mymodule/mycontroller/myaction/id/123, you could provide the customer with this link.

However, I would urge you to add some kind of validation to the link, as it could be a major data security issue if all one has to do is to change the number in the request. You could either generate a random token, store this in the order-table and dont show the order without that token, or you could ask the customer to provide the email address he used before he can see the invoice.

  • Thanks, I had something similar in mind. Thanks for pointing out the security issue ... no problem in my case though.
    – Arnie
    Apr 18, 2016 at 7:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.