Yes, what Bruno showed you is the minimal requirement, to be able to work with ROLES. For badges you will also find API in the VELO-DOCs (which are even much more expanded and upgraded than the API for ROLES).
However, after you have generated your CODE and also have generated some ROLES inside your Wix-Dashboard contact and member-management…
…and after you have set some roles to specific users, you will be able to achieve your aim.
If you search for some insperations … take a look here…
https://www.media-junkie.com/vnloginmgm
-Navigate to the SETUP-Section
-Go to ROLE-SETUP
There you will find exactly the ROLE-IDs which you have prepared inside your Wix-Role-Dashboard. You can do even more out of this IDEA. 
The same for BADGES—> BADGES are even much more flexible expandable and more efficient. Take a look onto the BADGE-API and you will understand what i mean.
You can create your own DATABSE, where you can store all the informations about a USER or you just try to use the Wix-CRM and Wix-PMD (like i did it)
What would be the ADVANTAGE ? → You would not need a third separated DATABASE → less coding work + more integrability (flexibility).
Wanna see the Contacs and BADGES in ACTION ??? → Click on …
-BADGES…and take a look whats possible…
…or click onto CONTACTS and see what can be done…
Want to get more INFO about this Login-Management-System?
Navigate to the SETUP-Section and click the ABOUT-BUTTON.
Let your IDEAS grow! Have fun! 