Products

Query

futureCosts — Returns [FutureCost]

Scopes Required: see_products

Arguments Type Description

products

[ID]

The products to get the future costs for (this will be in addition to any supplied families)

families

[ID!]

The families to get the future costs for (this will be in addition to any supplied products)

category

ID

The category to get the future costs for

startDate

DateTime

The start date time to get the future costs of

endDate

DateTime

The end date time to get the future costs of

outlet

ID

The outlet to get the future costs for (if null provided, global costs will be returned)

after

Cursor

The cursor to search after

first

Int

Maximum number of items to return

ordering

Ordering

The ordering to apply

Example Query
query GetFutureCosts($products: [ID]) {
    futureCosts(products: $products) {
        id,
        cost,
        effectiveTime
    }
}

# Example variables
{
    "products": [
        "<PRODUCTS>"
    ]
}

Query

futurePrices — Returns ConnectionType of FuturePrice

Scopes Required: see_products

Sortable Fields

Fields from FuturePrice that can be used to sort the connection items

  • quantity
  • effectiveTime
  • name
Arguments Type Description

priceSetId

ID

The price set to retrieve the future prices for

products

[ID]

The products to get the future prices for (this will be in addition to any supplied families)

families

[ID!]

The families to get the future costs for (this will be in addition to any supplied products)

category

ID

The category to get the future prices for

startDate

DateTime

The start date time to get the future prices of

endDate

DateTime

The end date time to get the future prices of

createdBy

[ID!]

The users who created the future prices

search

String

A string to search the items by name this will automatically split on spaces to find approximate matches

Example Query
query GetFuturePrices($priceSetId: ID) {
    futurePrices(priceSetId: $priceSetId) {
        edges {
            node {
                id,
                quantity,
                price,
                priceEx,
                effectiveTime
            }
        },
        pageInfo {
            hasNextPage,
            endCursor
        }
    }
}

# Example variables
{
    "priceSetId": "<PRICE_SET_ID>"
}

Query

inventoryLog — Returns ConnectionType of InventoryLog

Scopes Required: see_products

Sortable Fields

Fields from InventoryLog that can be used to sort the connection items

  • timestamp
Arguments Type Description

id

ID!

The ID of the product to get the inventory log of

type

[InventoryLogChangeTypeEnum]

The type of change that occurred to look for

users

[ID]

A list of users that made modifications to filter by

outlet

ID

An outlet to filter the results by

start

DateTime

Get any log that occurred after this parameter (inclusive)

end

DateTime

Get any log that occurred before this parameter (exclusive)

Example Query
query GetInventoryLog($id: ID!) {
    inventoryLog(id: $id) {
        edges {
            node {
                before,
                changed,
                after,
                caseQuantity,
                averageCost
            }
        },
        pageInfo {
            hasNextPage,
            endCursor
        }
    }
}

# Example variables
{
    "id": "<ID>"
}

Query

product — Returns Product

Scopes Required: see_products

Arguments Type Description

id

ID!

The ID of the product to retrieve

Example Query
query GetProduct($id: ID!) {
    product(id: $id) {
        id,
        name,
        mdbId,
        type,
        active
    }
}

# Example variables
{
    "id": "<ID>"
}

Query

productBackorders — Returns ConnectionType of ProductBackorder

Scopes Required: see_product_backorders

Arguments Type Description

outlet

ID

The ID of the Outlet to retrieve backorders for

products

[ID!]

The IDs of the products to retrieve backorders for

customers

[ID!]

The IDs of the customers to retrieve backorders for

dueBefore

DateTime

Get the backorders that are due before this date (inclusive)

dueAfter

DateTime

Get the backorders that are due after this date (inclusive)

Example Query
query GetProductBackorders($outlet: ID) {
    productBackorders(outlet: $outlet) {
        edges {
            node {
                id,
                quantity,
                recurringPeriod,
                nextDueDate,
                notes
            }
        },
        pageInfo {
            hasNextPage,
            endCursor
        }
    }
}

# Example variables
{
    "outlet": "<OUTLET>"
}

Query

products — Returns ConnectionType of Product

Scopes Required: see_products

Sortable Fields

Fields from Product that can be used to sort the connection items

  • name
  • createdAt
  • updatedAt
Arguments Type Description

outletId

ID

The outlet ID to check if the product is stocked in, if empty all outlets will be checked

products

[ID]

A list of products to retrieve

brands

[ID]

A list of brands to filter the products by

categories

[ID]

A list of categories to filter the products by

families

[ID]

A list of families to filter the products by

tags

[ID]

A list of tags to filter the products by

supplier

ProductSupplierCodeInput

A supplier (and codes) to filter the products by

mdbIds

[Int]

A list of master database reference to filter the products by (contact Shopfront if you wish to use this field)

stocked

Boolean

Whether to retrieve only products that are stocked

inventoryAbove

Float

Retrieve only products with inventory levels at any outlet greater than (exclusively) the provided value

inventoryBelow

Float

Retrieve only products with inventory levels at any outlet lower than (exclusively) the provided value

inventoryEqual

Float

Retrieve only products with inventory levels at any outlet equal to the provided value

inventoryLocation

ProductInventoryLocationEnum

How inventory levels should be filtered to match items

taxRates

[ID]

A list of tax rates to filter the products by

costTaxRates

[ID]

A list of cost tax rates to filter the products by

temporary

Boolean

Whether to show temporary products or not (null shows all, true shows only temporary and false shows not temporary), defaults to false

statuses

[ProductStatusEnum]

The statuses of products you want returned (e.g. [ACTIVE] will only return the active products)

priceSets

[ID]

A list of price sets to filter the products by, any product which doesn't have a price set provided will be filtered out

barcodes

[String!]

A list of barcodes to filter the products by, these should be the exact barcodes

partialBarcodes

[String!]

A list of partial barcodes to filter the products by, any part of a barcode which matches one of these elements will be returned. NOTE: We would suggest matching using the barcodes field if possible as that is much quicker

hostDeletions

Boolean

Whether to retrieve products that have host deletions or not. When no value is supplied this filter is skipped "true" returns only products with host deletions, "false" returns products without host deletions

createdBefore

DateTime

Filters products that have been created before or on the provided date time

createdAfter

DateTime

Filters products that have been created after or on the provided date time

updatedBefore

DateTime

Filters products that have been updated before or on the provided date time

updatedAfter

DateTime

Filters products that have been updated after or on the provided date time

lastSoldBefore

DateTime

Filters products that last appeared in a sale before or on the provided date, or have never been in a sale

lastSoldAfter

DateTime

Filters products that last appeared in a sale after or on the provided date time

lastPurchasedBefore

DateTime

Filters products that last appeared on an order before or on the provided date time, or have never been on an order

lastPurchasedAfter

DateTime

Filters products that last appeared on an order after or on the provided date time

lastStocktakedBefore

DateTime

Filters products last were stocktaked before or on the provided timestamp, including creating the product, updating the product's inventory, applying advanced stocktakes and express stocktaking

lastStocktakedAfter

DateTime

Filters products last were stocktaked after or on the provided timestamp, including creating the product, updating the product's inventory, applying advanced stocktakes and express stocktaking

name

String

Filters product by their name

Example Query
query GetProducts($outletId: ID) {
    products(outletId: $outletId) {
        edges {
            node {
                id,
                name,
                mdbId,
                type,
                active
            }
        },
        pageInfo {
            hasNextPage,
            endCursor
        }
    }
}

# Example variables
{
    "outletId": "<OUTLET_ID>"
}

Query

searchProducts — Returns [Product]

Scopes Required: see_products

This route is deprecated, do not use in any new development.

This will be removed once an alternative has been added to the GetProducts route.

Arguments Type Description

search

String

The name of the product to search for

Example Query
query SearchProducts($search: String) {
    searchProducts(search: $search) {
        id,
        name,
        mdbId,
        type,
        active
    }
}

# Example variables
{
    "search": "<SEARCH>"
}