Employees Mutations

GenerateEmployeeNumber

Generate the next employee number

mutation {
  GenerateEmployeeNumber
}
{
  "data": { "GenerateEmployeeNumber": "EMP-2025-00123" }
}

CreateEmployee

Create an employee

Parameters

input - EmployeeInput
Data of the employee
mutation CreateEmployee($input: EmployeeInput!) {
  CreateEmployee(input: $input) {
    id
    employee_number
    first_name
    last_name
    email
    active
  }
}
{
  "input": {
    "employee_number": "EMP-2025-001",
    "first_name": "John",
    "last_name": "Doe",
    "email": "[email protected]",
    "phone": "+1234567890",
    "position": "Sales Representative"
  }
}
{
  "data": {
    "CreateEmployee": {
      "id": 100120,
      "employee_number": "EMP-2025-001",
      "first_name": "John",
      "last_name": "Doe",
      "email": "[email protected]",
      "active": true
    }
  }
}

UpdateEmployee

Update an employee

Parameters

id - ID
Id of the employee
input - EmployeeInput
Data of the employee
mutation UpdateEmployee($id: ID!, $input: EmployeeInput!) {
  UpdateEmployee(id: $id, input: $input) {
    id
    first_name
    last_name
    email
    phone
    position
  }
}
{
  "id": 100120,
  "input": {
    "phone": "+1987654321",
    "position": "Senior Sales Representative"
  }
}
{
  "data": {
    "UpdateEmployee": {
      "id": 100120,
      "first_name": "John",
      "last_name": "Doe",
      "email": "[email protected]",
      "phone": "+1987654321",
      "position": "Senior Sales Representative"
    }
  }
}

DeleteEmployee

Delete an employee

Parameters

id - ID
Id of the employee
mutation DeleteEmployee($id: ID!) {
  DeleteEmployee(id: $id)
}
{
  "id": 100120
}
{
  "data": { "DeleteEmployee": true }
}

DeleteEmployees

Delete multiple employees

Parameters

ids - [ID]
List of employee identifiers
mutation DeleteEmployees($ids: [ID!]!) {
  DeleteEmployees(ids: $ids)
}
{
  "ids": [100120, 100121, 100122]
}
{
  "data": { "DeleteEmployees": true }
}

DisableEmployee

Disable an employee

Parameters

id - ID
Id of the employee
mutation DisableEmployee($id: ID!) {
  DisableEmployee(id: $id) {
    id
    active
  }
}
{
  "id": 100120
}
{
  "data": {
    "DisableEmployee": {
      "id": 100120,
      "active": false
    }
  }
}

DisableEmployees

Disable multiple employees

Parameters

ids - [ID]
List of employee identifiers
mutation DisableEmployees($ids: [ID!]!) {
  DisableEmployees(ids: $ids)
}
{
  "ids": [100120, 100121, 100122]
}
{
  "data": { "DisableEmployees": true }
}

EnableEmployee

Enable an employee

Parameters

id - ID
Id of the employee
mutation EnableEmployee($id: ID!) {
  EnableEmployee(id: $id) {
    id
    active
  }
}
{
  "id": 100120
}
{
  "data": {
    "EnableEmployee": {
      "id": 100120,
      "active": true
    }
  }
}

EnableEmployees

Enable multiple employees

Parameters

ids - [ID]
List of employee identifiers
mutation EnableEmployees($ids: [ID!]!) {
  EnableEmployees(ids: $ids)
}
{
  "ids": [100120, 100121, 100122]
}
{
  "data": { "EnableEmployees": true }
}

InviteEmployeeToB2bStore

Invite an employee to the B2B store

Parameters

id - ID
Id of the employee
input - EmployeeInput
Data of the employee
mutation InviteEmployeeToB2bStore($id: ID!, $input: EmployeeInput!) {
  InviteEmployeeToB2bStore(id: $id, input: $input) {
    id
    b2b_store_status
  }
}
{
  "id": 100120,
  "input": {
    "b2b_store_settings": {
      "permissions": ["view_catalog", "place_orders"]
    }
  }
}
{
  "data": {
    "InviteEmployeeToB2bStore": {
      "id": 100120,
      "b2b_store_status": "active"
    }
  }
}

InviteEmployeesToB2bStore

Invite multiple employees to the B2B store

Parameters

ids - [ID]
List of employee identifiers
input - EmployeeInput
Data applied to all employees
mutation InviteEmployeesToB2bStore($ids: [ID!]!, $input: EmployeeInput!) {
  InviteEmployeesToB2bStore(ids: $ids, input: $input) {
    id
    b2b_store_status
  }
}
{
  "ids": [100120, 100121],
  "input": {
    "b2b_store_settings": {
      "permissions": ["view_catalog", "place_orders"]
    }
  }
}
{
  "data": {
    "InviteEmployeesToB2bStore": [
      { "id": 100120, "b2b_store_status": "active" },
      { "id": 100121, "b2b_store_status": "active" }
    ]
  }
}

DenyAccessToB2bStore

Deny B2B store access to an employee

Parameters

id - ID
Id of the employee
mutation DenyAccessToB2bStore($id: ID!) {
  DenyAccessToB2bStore(id: $id) {
    id
    b2b_store_status
  }
}
{
  "id": 100120
}
{
  "data": {
    "DenyAccessToB2bStore": {
      "id": 100120,
      "b2b_store_status": "denied"
    }
  }
}

DisableAccessToB2bStore

Disable B2B store access for an employee

Parameters

id - ID
Id of the employee
mutation DisableAccessToB2bStore($id: ID!) {
  DisableAccessToB2bStore(id: $id) {
    id
    b2b_store_status
  }
}
{
  "id": 100120
}
{
  "data": {
    "DisableAccessToB2bStore": {
      "id": 100120,
      "b2b_store_status": "disabled"
    }
  }
}

EmployeeInput data type

id - ID
Identifier (optional)
employee_number - String
Employee reference number
phone - String
Phone number
email - String
Email address
first_name - String
First name
last_name - String
Last name
position - String
Position/Role
employable - Object
Employable entity (EmployableInput)
b2b_store_settings - JSON
B2B store settings
address - Object
Address (AddressInput)
b2b_store_status - B2bStoreStatus
B2B store status (pending/denied/active/disabled)
notes - String
Additional notes
custom_fields - [EntityCustomFieldInput]
Custom fields for this entity

Enums

B2bStoreStatus

ValueDescription
pendingAccess request pending approval.
deniedAccess request denied.
activeActive B2B store access.
disabledB2B store access disabled.