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

Hi there i want to achieve this functionality and i want ideas. I have one custom form in front end and a user can fill this form and upload a custom post type but i want this steps.

User select a specific product i change the buy button with a button to send it in my custom form when user fill the form i want to send it in the checkout to buy the product and submit my custom form?

is it possible to succeed in such an operation?