I need to add a custom function to post data to woocommerce’s checkout process

Solution:

I’ve done similiar implementations in the past. I add it to the woocommerce_thankyou hook.

add_action('woocommerce_thankyou', 'send_order');

function send_order($order_id){
    $order = wc_get_order( $order_id );

    /*** Your code ***/

}