Create a user profile
mutation CreateUserProfile($input: UserProfileInput!) {
CreateUserProfile(input: $input) {
id
user_id
company_id
active
label
prevent_negative_inventory
selling_price_level_id
tax_type
location_id
account_representative_id
}
}
{
"input": {
"user_id": 42,
"company_id": 2001,
"active": true,
"label": "Admin - Company A",
"prevent_negative_inventory": true,
"tax_type": "VAT",
"permissions": ["manage_orders", "view_reports"]
}
}
{
"data": {
"CreateUserProfile": {
"id": 100010,
"user_id": 42,
"company_id": 2001,
"active": true,
"label": "Admin - Company A",
"prevent_negative_inventory": true,
"tax_type": "VAT"
}
}
}
Create a user profile from a partner context
mutation CreateUserProfileFromPartner($input: UserProfileInput!) {
CreateUserProfileFromPartner(input: $input) {
id
user_id
company_id
active
label
}
}
{
"input": {
"user_id": 42,
"company_id": 2001,
"active": true,
"label": "Partner - Company A"
}
}
{
"data": {
"CreateUserProfileFromPartner": {
"id": 100011,
"user_id": 42,
"company_id": 2001,
"active": true,
"label": "Partner - Company A"
}
}
}
Update a user profile
| id - ID |
|---|
| Id of the user profile |
mutation UpdateUserProfile($id: ID!, $input: UserProfileInput!) {
UpdateUserProfile(id: $id, input: $input) {
id
user_id
company_id
active
label
prevent_negative_inventory
selling_price_level_id
tax_type
location_id
account_representative_id
}
}
{
"id": 100010,
"input": {
"active": false,
"label": "Admin - Company A (disabled)",
"prevent_negative_inventory": false,
"tax_type": "NONE"
}
}
{
"data": {
"UpdateUserProfile": {
"id": 100010,
"user_id": 42,
"company_id": 2001,
"active": false,
"label": "Admin - Company A (disabled)",
"prevent_negative_inventory": false,
"tax_type": "NONE"
}
}
}
Disable a user profile
| id - ID |
|---|
| Id of the user profile |
mutation DisableUserProfile($id: ID!) {
DisableUserProfile(id: $id) {
id
active
}
}
{
"data": {
"DisableUserProfile": {
"id": 100010,
"active": false
}
}
}
Enable a user profile
| id - ID |
|---|
| Id of the user profile |
mutation EnableUserProfile($id: ID!) {
EnableUserProfile(id: $id) {
id
active
}
}
{
"data": {
"EnableUserProfile": {
"id": 100010,
"active": true
}
}
}
Generate an API token for the current user profile
None
mutation {
GenerateApiToken
}
{
"data": {
"GenerateApiToken": "token-value-example"
}
}
Delete the current user profile API token
None
mutation {
DeleteApiToken
}
{
"data": {
"DeleteApiToken": true
}
}
Switch current context to another user profile
| nextId - ID |
|---|
| Target user profile identifier |
mutation SwitchUserProfile($nextId: ID!, $token: String!) {
SwitchUserProfile(nextId: $nextId, token: $token) {
id
user_id
company_id
active
label
}
}
{
"nextId": 100020,
"token": "SECURE-TOKEN-123"
}
{
"data": {
"SwitchUserProfile": {
"id": 100020,
"user_id": 43,
"company_id": 2002,
"active": true,
"label": "User - Company B"
}
}
}
Start impersonating a user profile
| id - ID |
|---|
| Id of the user profile to impersonate |
mutation ImpersonateUserProfile($id: ID!) {
ImpersonateUserProfile(id: $id)
}
{
"data": {
"ImpersonateUserProfile": true
}
}
Start impersonating a B2B store user profile
| id - ID |
|---|
| Id of the user profile to impersonate |
mutation ImpersonateB2bStoreUserProfile($id: ID!) {
ImpersonateB2bStoreUserProfile(id: $id)
}
{
"data": {
"ImpersonateB2bStoreUserProfile": "session-token-example"
}
}
Stop impersonation and return to the original profile
None
mutation {
StopImpersonateUserProfile
}
{
"data": {
"StopImpersonateUserProfile": true
}
}
| id - Int |
|---|
| Identifier (optional) |
| user_id - Int |
|---|
| Associated user identifier |
| company_id - Int |
|---|
| Associated company identifier |
| active - Boolean |
|---|
| If true, the user profile is active |
| permissions - [String] |
|---|
| Permissions granted to the profile |
| user - Object |
|---|
| User payload (UserInput) |
| prevent_negative_inventory - Boolean |
|---|
| Prevent negative inventory operations |
| tax_type - TaxType |
|---|
| Tax type (enum TaxType) |
| selling_price_level - Object |
|---|
| Selling price level payload (see Price Levels: Mutations) |
| account_representative - Object |
|---|
| Account representative payload (see Account Representatives: Mutations) |
| Value | Description |
|---|
exclusive | Tax calculated on top of the net price. |
inclusive | Tax included in the displayed price. |