Buying Periods

Query

buyingPeriod — Returns BuyingPeriod

Scopes Required: stock_create_order stock_edit_order edit_products

Arguments Type Description

id

ID!

The ID of the buying period

Example Query
query GetBuyingPeriod($id: ID!) {
    buyingPeriod(id: $id) {
        id,
        start,
        end,
        quantity,
        cost
    }
}

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

Query

buyingPeriods — Returns ConnectionType of BuyingPeriod

Scopes Required: stock_create_order stock_edit_order edit_products

Arguments Type Description

outlet

ID

The outlet to view buying periods for

supplier

ID

The supplier to view buying periods for

current

Boolean

Whether to include the buying periods that are current (defaults to true)

future

Boolean

Whether to include the buying periods that start in the future (defaults to true)

expired

Boolean

Whether to include the buying periods that have expired (defaults to false)

Example Query
query GetBuyingPeriods($outlet: ID) {
    buyingPeriods(outlet: $outlet) {
        edges {
            node {
                id,
                start,
                end,
                quantity,
                cost
            }
        },
        pageInfo {
            hasNextPage,
            endCursor
        }
    }
}

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