The App42_Cocos2dx_SDK packages comes with sample which has test cases for all the APIs. You can find the same in our github repo. You open this link and search for createUserWithCustomData method which has the exactly your requirement.
In createUser API, user name and email address both are must. However, you can use the email address for the both the fields.
Let me know if you have any further queries.