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
- Add a step and choose the Fluent Commerce connector.
- Pick the searchVirtualInventory action (under Search).
- 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.
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.
{
"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}}.
Need more? See the Fluent Commerce guide for connection setup and behaviour shared by every action.
Was this page helpful?