API Reference

CreateSupplier

Create a supplier

Parameters

input - supplierInput
Data of the supplier

Example

mutation {
  CreateSupplier(
    input: {
      label: "3M",
      email: "[email protected]",
      phone: "0612261267",
      address: {
        country: "GB",
        state: null,
        address_1: "",
        city: "London"
      },
      currency: "GBP"
    }
  ) {
    id
    label
    email
    phone
    active
    currency
    address {
      id
      label
      country
      address_1
      address_2
      postal_code
      city
      state
      phone
    }
  }
}

Returned data

{
  "data": {
    "CreateSupplier": {
      "id": 100012,
      "label": "3M",
      "email": "[email protected]",
      "phone": "0612261267",
      "active": true,
      "currency": "GBP",
      "address": {
        "id": 100075,
        "label": null,
        "country": "GB",
        "address_1": null,
        "address_2": null,
        "postal_code": null,
        "city": "London",
        "state": null,
        "phone": null
      }
    }
  }
}

UpdateSupplier

Update a supplier

Parameters

id - ID
Id of the supplier
input - supplierInput
Data of the supplier

Example

mutation UpdateSupplier($id: ID!, $input: SupplierInput!) {
  UpdateSupplier(id: $id, input: $input) {
    id
    active
  }
}
{
  "id": 100012,
  "input": {
    "id": 100012,
    "label": "3M",
    "email": "[email protected]",
    "phone": "0612261267",
    "currency": "GBP",
  }
}

Returned data

{
  "data": {
    "UpdateSupplier": {
      "id": 100012,
      "active": true,
    }
  }
}

DeleteSupplier

Delete a supplier

Parameters

id - ID
Id of the supplier

Example

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

Returned data

{
  "data": {
    "DeleteSupplier": true
  }
}

DisableSupplier

Disable a supplier

Parameters

id - ID
Id of the supplier

Example

mutation DisableSupplier($id: ID!) {
  DisableSupplier(id: $id) {
    id
    active
  }
}
{
  "id": 100012
}

Returned data

{
  "data": {
    "DisableSupplier": {
      "id": 100012,
      "active": false
    }
  }
}

EnableSupplier

Enable a disabled supplier

Parameters

id - ID
Id of the supplier

Example

mutation EnableSupplier($id: ID!) {
  EnableSupplier(id: $id) {
    id
    active
  }
}
{
  "id": 100012
}

Returned data

{
  "data": {
    "EnableSupplier": {
      "id": 100012,
      "active": true
    }
  }
}

SupplierInput data type

id - Int
Unique identifier of the supplier
label - String
Name of the supplier
email - String
Email of the supplier
phone - String
Phone number of the supplier
currency - String
Currency code (EUR, USD, ...)
address - AddressInput
Address of the supplier