API Reference

CreateCustomer

Create a customer (if you are allowed to create customers)

Parameters

input - CustomerInput
Data of the customer

Example

mutation {
    CreateCustomer (
        input: {
            label: "Bob Dylan",
            first_name: "Bob",
            last_name: "Dylan",
            email: "[email protected]"
        }
    ){
        id
        active
    }
}

Returned data

{
  "data": {
    "CreateCustomer": {
      "id": 101122,
      "active": true
    }
  }
}

UpdateCustomer

Update a customer

Parameters

id - ID
Id of the customer to update
input - CustomerInput
Data of the customer

Example

mutation UpdateCustomer($id: ID!, $input: CustomerInput!) {
  UpdateCustomer(id: $id, input: $input) {
    id
    label
    first_name
    last_name
    email
  }
}
{
  "id": 100005,
  "input": {
    "id": 100005,
    "label": "Hoppe",
    "first_name": "Palma",
    "last_name": "Heaney",
    "email": "[email protected]"
  }
}

Returned data

{
  "data": {
    "UpdateCustomer": {
      "id": 100005,
      "label": "Hoppe",
      "first_name": "Palma",
      "last_name": "Heaney",
      "email": "[email protected]"
    }
  }
}

DeleteCustomer

Delete a customer

Parameters

id - ID
Id of the customer

Example

mutation DeleteCustomer($id: ID!) {
  DeleteCustomer(id: $id)
}
{
  "id": 100009
}

Returned data

{
  "data": {
    "DeleteCustomer": true
  }
}

DisableCustomer

Disable a customer

Parameters

id - ID
Id of the customer

Example

mutation DisableCustomer($id: ID!) {
  DisableCustomer(id: $id) {
    id
    active
  }
}
{
  "id": 100011
}

Returned data

{
  "data": {
    "DisableCustomer": {
      "id": 100011,
      "active": false
    }
  }
}

EnableCustomer

Enable a disabled customer

Parameters

id - ID
Id of the customer

Example

mutation EnableCustomer($id: ID!) {
  EnableCustomer(id: $id) {
    id
    active
  }
}
{
  "id": 100009
}

Returned data

{
  "data": {
    "EnableCustomer": {
      "id": 100011,
      "active": true
    }
  }
}

CustomerInput data type

label - String
Full name of the customer
first_name - String
First name of the customer
last_name - String
Last name of the customer
email - String
Email of the customer
Address - AddressInput
Address of the customer