-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
how to additional fields to register user #3
Comments
Hi @MichaelSowah, the API supports registration with an email, username and password. WPUserRegisterResponse wpUserRegisterResponse = await WPJsonAPI.instance
.api((request) => request.wpRegister(
email: email,
password: password,
username: username
)); Once they are logged in, you could then call the API to update the user's phone number. WCCustomerUpdatedResponse wcCustomerUpdatedResponse = await WPJsonAPI.instance
.api((request) => request.wcUpdateCustomerInfo(
userToken,
billingPhone: billingPhone
)); Re. the role, the API currently doesn't support that. |
Thanks, I would really appreciate that especially the ability to pass the role of the user eg: customer, admin, etc. |
Hi @MichaelSowah, v3.1.2 supports the ability to add/remove roles. Add a new role to a userWPUserAddRoleResponse wpUserAddRoleResponse = await WPJsonAPI.instance
.api((request) => request.wpUserAddRole(
userToken,
role: "customer" // e.g. customer, subscriber
)); Remove role from a userWPUserRemoveRoleResponse wpUserRemoveRoleResponse = await WPJsonAPI.instance
.api((request) => request.wpUserRemoveRole(
userToken,
role: "customer" // e.g. customer, subscriber
)); You'll need to update your WordPress plugin WP JSON API to |
great, I updated my plugin |
How do I add additional fields such as user role, phone number, etc to register a user?
The text was updated successfully, but these errors were encountered: