See the Queries page for a presentation of this resource.
Create a user profile
GraphQL
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
}
}
Variables (JSON)
{
"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"]
}
}
JSON
{
"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
GraphQL
mutation CreateUserProfileFromPartner($input: UserProfileInput!) {
CreateUserProfileFromPartner(input: $input) {
id
user_id
company_id
active
label
}
}
Variables (JSON)
{
"input": {
"user_id": 42,
"company_id": 2001,
"active": true,
"label": "Partner - Company A"
}
}
JSON
{
"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
GraphQL
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
}
}
Variables (JSON)
{
"id": 100010,
"input": {
"active": false,
"label": "Admin - Company A (disabled)",
"prevent_negative_inventory": false,
"tax_type": "NONE"
}
}
JSON
{
"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
GraphQL
mutation DisableUserProfile($id: ID!) {
DisableUserProfile(id: $id) {
id
active
}
}
JSON
{
"data": {
"DisableUserProfile": {
"id": 100010,
"active": false
}
}
}
Enable a user profile
id - ID Id of the user profile
GraphQL
mutation EnableUserProfile($id: ID!) {
EnableUserProfile(id: $id) {
id
active
}
}
JSON
{
"data": {
"EnableUserProfile": {
"id": 100010,
"active": true
}
}
}
Generate an API token for the current user profile
None
GraphQL
mutation {
GenerateApiToken
}
JSON
{
"data": {
"GenerateApiToken": "token-value-example"
}
}
Delete the current user profile API token
None
GraphQL
mutation {
DeleteApiToken
}
JSON
{
"data": {
"DeleteApiToken": true
}
}
Switch current context to another user profile
nextId - ID Target user profile identifier
GraphQL
mutation SwitchUserProfile($nextId: ID!, $token: String!) {
SwitchUserProfile(nextId: $nextId, token: $token) {
id
user_id
company_id
active
label
}
}
Variables (JSON)
{
"nextId": 100020,
"token": "SECURE-TOKEN-123"
}
JSON
{
"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
GraphQL
mutation ImpersonateUserProfile($id: ID!) {
ImpersonateUserProfile(id: $id)
}
JSON
{
"data": {
"ImpersonateUserProfile": true
}
}
Start impersonating a B2B store user profile
id - ID Id of the user profile to impersonate
GraphQL
mutation ImpersonateB2bStoreUserProfile($id: ID!) {
ImpersonateB2bStoreUserProfile(id: $id)
}
JSON
{
"data": {
"ImpersonateB2bStoreUserProfile": "session-token-example"
}
}
Stop impersonation and return to the original profile
None
GraphQL
mutation {
StopImpersonateUserProfile
}
JSON
{
"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 exclusiveTax calculated on top of the net price. inclusiveTax included in the displayed price.