Locations Queries

Retrieve warehouse locations used for stock management.

Location — Returns a single location based on the id provided

query GetLocation($id: ID) {
  Location(id: $id) {
    id
    label
    active
    deleted_at
    backup_location { id label }
    stock_transferred
    address { id label country address_1 postal_code city }
    integrations { id }
    type
    shipping_cost
    phone
    replace_company_name
  }
}
{
  "id": 100012
}

Locations — Returns a list of locations with ordering and filters

query Locations(
  $where: QueryLocationsWhereWhereConditions,
  $orderBy: [QueryLocationsOrderByOrderByClause!],
  $search: String
) {
  Locations(
    where: $where
    orderBy: $orderBy
    search: $search
  ) {
    id
    label
    active
    deleted_at
    backup_location { id label }
    stock_transferred
    type
    shipping_cost
    phone
    replace_company_name
  }
}
{
  "where": {
    "AND": [
      { "column": "ACTIVE", "operator": "EQ", "value": true }
    ]
  },
  "orderBy": [
    { "column": "LABEL", "order": "ASC" }
  ]
}

Available fields

FieldTypeDescription
idIntUnique identifier of the location.
labelStringLabel of the location.
activeBooleanWhether the location is active.
deleted_atDateTimeDeletion date (soft delete).
backup_locationLocationBackup location for stock transfer.
stock_transferredBooleanWhether stock has been transferred to backup location.
addressAddressAddress of the location.
integrations[Integration]Linked integrations.
typeLocationTypeType of location (store, warehouse).
shipping_costFloatShipping cost for this location.
phoneStringPhone number of the location.
replace_company_nameBooleanWhether to replace company name in documents.

Filters

You can create filters based on following fields

id - Int
Example: { "column": "ID", "operator": "EQ", "value": 100012 }
label - String
Example: { "column": "LABEL", "operator": "LIKE", "value": "%warehouse%" }
active - Boolean
Example: { "column": "ACTIVE", "operator": "EQ", "value": true }
deleted_at - DateTime
Example: { "column": "DELETED_AT", "operator": "NULL", "value": true }
backup_location_id - ID
Example: { "column": "BACKUP_LOCATION_ID", "operator": "EQ", "value": 100001 }

Sorting

You can sort data based on following fields: id, label, active

query SortLocations(
  $where: QueryLocationsWhereWhereConditions
) {
  Locations(
    where: $where
    orderBy: [{ column: LABEL, order: ASC }]
  ) {
    id
    label
    active
    type
    shipping_cost
    phone
  }
}

Example of data returned

{
  "data": {
    "Locations": [
      {
        "id": 100001,
        "label": "Main Warehouse",
        "active": true,
        "deleted_at": null,
        "backup_location": null,
        "stock_transferred": false,
        "type": "warehouse",
        "shipping_cost": 5.50,
        "phone": "+33 1 23 45 67 89",
        "replace_company_name": false
      },
      {
        "id": 100002,
        "label": "Store Paris",
        "active": true,
        "deleted_at": null,
        "backup_location": { "id": 100001, "label": "Main Warehouse" },
        "stock_transferred": false,
        "type": "store",
        "shipping_cost": 0.00,
        "phone": "+33 1 23 45 67 90",
        "replace_company_name": true
      }
    ]
  }
}

Enums

LocationType

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