Pass hidden UUID from form to checkout form


I am trying to achieve the following: having a user submit a form that has a hidden UUID and then redirect the user straight to checkout where a field with that UUID is pre-filled.

I am still working on auto-adding an item to that checkout so the user actually something to checkout but I’m having a lot of trouble figuring out the UUID part.

The end goal is to be able to relate the submission to a payment. Is this the correct way to go about this?

Thanks for any help.