I am trying to do the same thing and ran into another challenge...
For me it says that the request is deprecated for version 21 or higher and when I run 20 it still says that...
curl 'https://graph.facebook.com/v22.0/XXXXXXXXXXXX/register' \
-H 'Authorization: Bearer EAAPr...' \
-H 'Content-Type: application/json' \
-d '{ "messaging_product": "whatsapp", "pin": "XXXXXX", "data_localization_region": "DE" }'
This then returns:
{"error":{"message":"Unknown path components: \/XXXXXXXXXXXX\/register","type":"OAuthException","code":2500,"fbtrace_id":"AC-kbm_XXXXXXXXXXXX"}}