I have created a Cred commerce form.
This Cred is creating a postype (concours) that contains different custom fields and is linked to a WC product (inscription).
Now, I would like to retrieve the postype ID that have been created by the Cred, meaning, the relationship between the order ID and the postype ID.
I'm not sure when exactly in the process you need to connect the order ID and the post ID for the custom post created by the CRED form, or what you want to use it for exactly.
It may be that one of the other hooks could serve you. From the documentation it is not clear that another has both the order ID and post ID available, but if you dump the complete available parameters to your debug log to inspect them you may find another hook may also serve the purpose.
What I want to do, is to add custom fields to WC emails using hook or child mail template.
So, that's why I need to retrieve the post_id of the created postype. Then, with this ID, i will be able to retrieve all postmeta I need.
I will try your cred_commerce_after_order_completed hook and see if this is sufficient to get all needed data.
OK, it sounds like you will need to use one of the CRED Commerce hooks to identify the post ID that links to the order ID and you will need to store that post ID as a field of the order so that you can later access it and identify the matching post.
I hope you can find the hook that works for you to do that, but let me know.