Locations Mutations

CreateLocation

Create a location

Parameters

input - LocationInput
Data of the location
mutation CreateLocation($input: LocationInput!) {
  CreateLocation(input: $input) {
    id
    label
    active
    type
    shipping_cost
    phone
    replace_company_name
    address { id label country address_1 postal_code city }
  }
}
{
  "input": {
    "label": "New Warehouse",
    "type": "warehouse",
    "shipping_cost": 7.50,
    "phone": "+33 1 23 45 67 91",
    "replace_company_name": false,
    "address": {
      "label": "Warehouse Address",
      "country": "FR",
      "address_1": "15 Industrial Street",
      "postal_code": "75012",
      "city": "Paris"
    }
  }
}
{
  "data": {
    "CreateLocation": {
      "id": 100003,
      "label": "New Warehouse",
      "active": true,
      "type": "warehouse",
      "shipping_cost": 7.50,
      "phone": "+33 1 23 45 67 91",
      "replace_company_name": false,
      "address": {
        "id": 501,
        "label": "Warehouse Address",
        "country": "FR",
        "address_1": "15 Industrial Street",
        "postal_code": "75012",
        "city": "Paris"
      }
    }
  }
}

UpdateLocation

Update a location

Parameters

id - ID
Id of the location
input - LocationInput
Data of the location
mutation UpdateLocation($id: ID!, $input: LocationInput!) {
  UpdateLocation(id: $id, input: $input) {
    id
    label
    active
    type
    shipping_cost
    phone
    replace_company_name
    address { id label country address_1 postal_code city }
  }
}
{
  "id": 100003,
  "input": {
    "label": "Updated Warehouse",
    "shipping_cost": 8.00,
    "phone": "+33 1 23 45 67 92"
  }
}
{
  "data": {
    "UpdateLocation": {
      "id": 100003,
      "label": "Updated Warehouse",
      "active": true,
      "type": "warehouse",
      "shipping_cost": 8.00,
      "phone": "+33 1 23 45 67 92",
      "replace_company_name": false,
      "address": {
        "id": 501,
        "label": "Warehouse Address",
        "country": "FR",
        "address_1": "15 Industrial Street",
        "postal_code": "75012",
        "city": "Paris"
      }
    }
  }
}

DeleteLocation

Delete a location

Parameters

id - ID
Id of the location
input - DeleteLocationInput
Data for location deletion
mutation DeleteLocation($id: ID!, $input: DeleteLocationInput!) {
  DeleteLocation(id: $id, input: $input)
}
{
  "id": 100003,
  "input": {
    "backup_location_id": 100001,
    "stock_transferred": true
  }
}
{
  "data": { "DeleteLocation": true }
}

DeleteLocations

Delete multiple locations

Parameters

ids - [ID]
List of location identifiers
input - DeleteLocationInput
Data for locations deletion
mutation DeleteLocations($ids: [ID!]!, $input: DeleteLocationInput!) {
  DeleteLocations(ids: $ids, input: $input)
}
{
  "ids": [100003, 100004],
  "input": {
    "backup_location_id": 100001,
    "stock_transferred": true
  }
}
{
  "data": { "DeleteLocations": true }
}

DisableLocation

Disable a location

Parameters

id - ID
Id of the location
mutation DisableLocation($id: ID!) {
  DisableLocation(id: $id) {
    id
    label
    active
  }
}
{
  "id": 100003
}
{
  "data": {
    "DisableLocation": {
      "id": 100003,
      "label": "Updated Warehouse",
      "active": false
    }
  }
}

EnableLocation

Enable a location

Parameters

id - ID
Id of the location
mutation EnableLocation($id: ID!) {
  EnableLocation(id: $id) {
    id
    label
    active
  }
}
{
  "id": 100003
}
{
  "data": {
    "EnableLocation": {
      "id": 100003,
      "label": "Updated Warehouse",
      "active": true
    }
  }
}

LocationInput data type

id - ID
Identifier (optional)
label - String
Label of the location
supplier - SupplierIDInput
Linked supplier for the location
address - AddressInput
Address of the location
type - LocationType
Type of location (store, warehouse)
pdf_description - String
Description shown on PDFs for this location
shipping_cost - Float
Shipping cost for this location
phone - String
Phone number of the location
replace_company_name - Boolean
Whether to replace company name in documents

DeleteLocationInput data type

backup_location_id - ID
Id of the backup location for stock transfer
stock_transferred - Boolean
Whether stock has been transferred to backup location

Enums

LocationType

ValueDescription
storeRetail or storefront location.
warehouseStorage and fulfillment location.
subcontractorExternal manufacturing or processing location.