API Reference

CreateLocation

Create a location

Parameters

input - LocationInput
Data of the location

Example

mutation {
  CreateLocation (
    input: {
      label: "Warehouse",
      address: {
        country: "RO",
        state: null,
        address_1: "Strada Ciochina 16",
        city: "București",
        postal_code: "041935"
      }
    }
  ) {
    id
    label
    active
    address {
      id
      label
      country
      address_1
      address_2
      postal_code
      city
    }
  }
}

Returned data

{
  "data": {
    "CreateLocation": {
      "id": 100023,
      "label": "Warehouse",
      "active": true,
      "address": {
        "id": 100074,
        "label": null,
        "country": "RO",
        "address_1": "Strada Ciochina 16",
        "address_2": null,
        "postal_code": "041935",
        "city": "București",
      }
    }
  }
}

UpdateLocation

Update an location

Parameters

id - ID
Id of the location
input - LocationInput
Data of the location

| Data of the location

Example

mutation UpdateLocation($id: ID!, $input: LocationInput!) {
  UpdateLocation(id: $id, input: $input) {
    id
    label
    active
    address {
      id
      label
      country
      address_1
      address_2
      postal_code
      city
      state
      phone
    }
  }
}
{
  "id": 100008,
  "input": {
    "label": "London shop",
    "address": {
      "id": 100010,
      "label": "reprehenderit",
      "country": "UK",
      "address_1": "744 Walter Way",
      "address_2": "",
      "postal_code": "48202",
      "city": "London",
      "state": null,
      "phone": "1-901-942-3845"
    }
  }
}

Returned data

{
  "data": {
    "UpdateLocation": {
      "id": 100008,
      "label": "London shop",
      "active": true,
      "address": {
        "id": 100010,
        "label": "reprehenderit",
        "country": "UK",
        "address_1": "744 Walter Way",
        "address_2": null,
        "postal_code": "48202",
        "city": "London",
        "state": null,
        "phone": "1-901-942-3845"
      }
    }
  }
}

DeleteLocation

Delete a location

Parameters

id - ID
Id of the location

Example

mutation DeleteLocation($id: ID!) {
  DeleteLocation(id: $id) {
    id
    active
  }
}
{
  "id": 100023
}

Returned data

{
  "data": {
    "DeleteLocation": {
      "id": 100023,
      "active": false
    }
  }
}

DisableLocation

Disable a location

Parameters

id - ID
Id of the location

Example

mutation DisableLocation($id: ID!) {
  DisableLocation(id: $id) {
    id
    active
  }
}
{
  "id": 100023
}

Returned data

{
  "data": {
    "DisableLocation": {
      "id": 100023,
      "active": false
    }
  }
}

EnableLocation

Enable a disabled location

Parameters

id - ID
Id of the location

Example

mutation EnableLocation($id: ID!) {
  EnableLocation(id: $id) {
    id
    active
  }
}
{
  "id": 100023
}

Returned data

{
  "data": {
    "EnableLocation": {
      "id": 100023,
      "active": true
    }
  }
}

LocationInput data type

label - String
Name of the location (ex: point of sales, warehouse, ...)
address - AddressInput
Address of the location