Copy metafield values from draft orders to orders

Does anyone know whether it is possible to do what is mentioned in the following article using shopify API?

https://help.shopify.com/en/manual/custom-data/metafields/copy-to-order

We are building app and want to create draft order metafield definition which is linked to order metafield definition. We can do it easily using UI but want to automate this process so there is no manual actions are required.

Really appreciate any feedback.

We know how to create definitions but it is not clear how to link them via API. We tried to see what Shopify does but it seems they use orderannotation but it is not accessible in API. So if you can clarify how to create link i will really appreciate your help.