younifyd
Menu

searchVirtualInventory

Find locations that can supply the requested products and quantities from a Virtual Catalogue, optionally ordered by proximity.

Use it in a workflow

  1. Add a step and choose the Fluent Commerce connector.
  2. Pick the searchVirtualInventory action (under Search).
  3. Fill in the fields below, then reference the result from later steps as {{searchvirtualinventory.response.data}}.

Query

This is the query the action sends by default. Edit it in the step's Query field to change which fields come back.

graphql
query SearchVirtualInventory($excludedLocationRefs: [String!], $first: Int, $orderByProximity: GeoCoordinateInput, $productQuantities: [ProductQuantityInput!]!, $virtualCatalogue: VirtualCatalogueKey!, $virtualPosition: VirtualPositionInput) {
  searchVirtualInventory(
    excludedLocationRefs: $excludedLocationRefs
    first: $first
    orderByProximity: $orderByProximity
    productQuantities: $productQuantities
    virtualCatalogue: $virtualCatalogue
    virtualPosition: $virtualPosition
  ) {
    edges {
      cursor
      node {
        location
        virtualPositions
      }
    }
    pageInfo {
      hasNextPage
      hasPreviousPage
    }
  }
}

Variables

Pass these as a JSON object in the step's Variables field.

excludedLocationRefsarray<string>

An array of references of `Location` objects that will be excluded from this search should this parameter be passed

firstnumber

Returns the first n elements from the list

orderByProximityobject

GeoCoordinates to order results by. Closest locations are returned first. If this parameter is not passed, results will be in no specific order

latitudenumberrequired
longitudenumberrequired
productQuantitiesarray<object>required

An array of products with their requested quantities

productRefstringrequired
quantitynumberrequired
virtualCatalogueobjectrequired

Reference identifier for the `VirtualCatalogue` that will be searched

refstringrequired
virtualPositionobject

Identifier for the `VirtualPosition` that will be searched

statusstring
json
{
  "productQuantities": [
    {
      "productRef": "string",
      "quantity": 0
    }
  ],
  "virtualCatalogue": {
    "ref": "string"
  },
  "excludedLocationRefs": [
    "string"
  ],
  "first": 0,
  "orderByProximity": {
    "latitude": 0,
    "longitude": 0
  },
  "virtualPosition": {
    "status": "string"
  }
}

Response

Read the result with {{searchvirtualinventory.response.data.data.searchVirtualInventory}}. If the API returns errors, the step fails and they are at {{searchvirtualinventory.response.data.errors}}.

edgesarray<object>
cursorobject
nodeobject
pageInfoobject
hasNextPageboolean
hasPreviousPageboolean

Need more? See the Fluent Commerce guide for connection setup and behaviour shared by every action.

Was this page helpful?