Up until now, you could manage access of site members to restricted pages only through the Site Members UI in the Business Manager. Now, you can do this also programmatically!
We’ve exposed two new APIs — assignRole() and removeRole() — to achieve this. You can find these new APIs in the new Roles subnamespace in wix-users-backend. Learn more
Any insights on how to trigger this assign role API after an event ticket is purchased?
We are trying to accomplish this logic:
if event=VIP, after order is confirmed, assign role VIP,
else if event = GEN, after order is confirmed, assign role GA,
else do nothing.
We are trying to figure out how to insert the role assign API after the event order confirmation. Any insights will be greatly appreciated.