How to submit custom post type front end form when a user buy specific product

If you are you using WooCommerce, you can use the “woocommerce_before_thankyou” hook to achieve this.

In frontend you can create a custom AJAX action to upload all form data and append the WooCommerce product ID (use WC()->cart->add_to_cart()) and your own post type logic (maybe you can add this post as draft and store the post ID in SESSION or transient API to publish when user completes the order [using “woocommerce_before_thankyou” hook]).