Users
Mutation
createUser — Returns User
Scopes Required: create_users
| Arguments | Type | Description |
|---|---|---|
|
name |
String! |
The name of the user to create |
|
username |
String! |
The username of the user |
|
password |
String! |
The user's password to log into Shopfront with |
|
role |
The user's role |
|
|
reportingAccess |
The Outlet's this user has access to for reporting, if not specified all Outlets will be available for access |
|
|
pendingPasswordReset |
Boolean |
Whether the user should change their password at their next login |
Example Mutation
mutation CreateUser($name: String!, $username: String!, $password: String!) {
createUser(name: $name, username: $username, password: $password) {
id,
name,
parent,
deleted,
username
}
}
# Example variables
{
"name": "<NAME>",
"username": "<USERNAME>",
"password": "<PASSWORD>"
}Mutation
deleteUser — Returns User
Scopes Required: modify_users modify_integrations
| Arguments | Type | Description |
|---|---|---|
|
id |
The ID of the user to delete |
Example Mutation
mutation DeleteUser($id: ID!) {
deleteUser(id: $id) {
id,
name,
parent,
deleted,
username
}
}
# Example variables
{
"id": "<ID>"
}Mutation
updateUser — Returns User
No scope required
| Arguments | Type | Description |
|---|---|---|
|
id |
The ID of the user to update |
|
|
name |
String |
The user's name |
|
username |
String |
The username of the user |
|
password |
String |
The new password for the user |
|
role |
The role of the user |
|
|
|
The user's contact email address |
|
|
phone |
String |
The user's contact phone number |
|
image |
String |
The small image to use for the user |
|
quickMenu |
The items to display on the quick menu (like a list of favourites) |
|
|
darkMode |
The theme for the user that will override the register's "Dark Mode" setting |
|
|
reportingAccess |
The Outlet's this user has access to for reporting |
|
|
pendingPasswordReset |
Boolean |
Whether the user should change their password at their next login |
Example Mutation
mutation UpdateUser($id: ID!) {
updateUser(id: $id) {
id,
name,
parent,
deleted,
username
}
}
# Example variables
{
"id": "<ID>"
}Mutation
updateUserDashboard — Returns boolean
Scopes Required: edit_user_dashboard
This is currently an experimental mutation, please get in contact with us before using it.
Example Mutation
mutation UpdateUserDashboard($ids: [ID]!, $dashboard: JSON!) {
updateUserDashboard(ids: $ids, dashboard: $dashboard)
}
# Example variables
{
"ids": [
"<IDS>"
],
"dashboard": "<DASHBOARD>"
}Mutation
updateUserFormFavourites — Returns boolean
No scope required
This is currently an experimental mutation, please get in contact with us before using it.
| Arguments | Type | Description |
|---|---|---|
|
id |
The ID of the user |
|
|
page |
The page the favourite fields relate to |
|
|
fields |
[String]! |
A list of fields the user has favourited |
Example Mutation
mutation UpdateUserFormFavourites($id: ID!, $page: FavouriteFormPageTypeEnum!, $fields: [String]!) {
updateUserFormFavourites(id: $id, page: $page, fields: $fields)
}
# Example variables
{
"id": "<ID>",
"page": "product",
"fields": [
"<FIELDS>"
]
}