WooCommerce
Running Code After an Order with woocommerce_thankyou
The hook fires when someone views the order received page, which is not the same as when an order is paid. Anything important hooked here runs twice for one customer and never for another.