Hi @pinhinha,
This is likely due to a known WooCommerce issue with a specific PayPal configuration, and it affects more than just invoice creation. PayPal has two different methods for confirming payment of an order (name “PDT” and “IPN”). If you have enabled both of them, PayPal sends?two?notifications to WooCommerce at the same time. This results in what is called a “race condition”: the processes start in parallel (not being able to see the other yet), doing the same tasks. The client receives two emails for their order (each with an invoice), stock gets reduced twice, and other processes might be duplicated as well. Because an order can only have one invoice, only one of them ‘survives’ after the processes have finished.
IPN and PDT serve the exact same purpose, so you only need one of them. Two options (choose one):
- To disable PDT, clear the “PayPal identity token” in the PayPal gateway settings in WooCommerce
- To disable IPN you will need to go to your PayPal merchant backend (where you can also disable PDT by the way).
Let us know if this indeed is your case, and if the instructions above solves your issue!