I am working on a 'Sponsor An Orphan' project using the Woocommerce Subscriptions plugin. Monthly or yearly subscriptions are available.
When a new subscription is created, I am allocating an orphan to the subscription when payment completes like this..
add_action('woocommerce_subscription_payment_complete', 'allocate_orphans');
It correctly allocated the new orphan for a new subscription but it is also allocating an orphan on every renewal.
I think I am using wrong action hook. Which action hook should I use for new subscription for new orphan (that should not allocate the orphan on next payment)?
Any help will be appreciated.