Buying Periods
Mutation
createBuyingPeriod — Returns BuyingPeriod
Scopes Required: stock_create_order stock_edit_order edit_products
| Arguments | Type | Description |
|---|---|---|
|
item |
The item the buying period applies to |
|
|
type |
The type of item the buying period applies to |
|
|
outlet |
The outlet the buying period applies to |
|
|
supplier |
The supplier the buying period is for |
|
|
start |
The start date for the buying period |
|
|
end |
The end date for the buying period |
|
|
quantity |
Float! |
The minimum quantity to purchase to receive the provided cost |
|
cost |
Float! |
The cost of the item for the quantity provided |
Example Mutation
mutation CreateBuyingPeriod($item: ID!, $type: HasPriceItemTypeEnum!, $outlet: ID!, $supplier: ID!, $start: DateTime!, $end: DateTime!, $quantity: Float!, $cost: Float!) {
createBuyingPeriod(item: $item, type: $type, outlet: $outlet, supplier: $supplier, start: $start, end: $end, quantity: $quantity, cost: $cost) {
id,
start,
end,
quantity,
cost
}
}
# Example variables
{
"item": "<ITEM>",
"type": "PRODUCT",
"outlet": "<OUTLET>",
"supplier": "<SUPPLIER>",
"start": "<START>",
"end": "<END>",
"quantity": "<QUANTITY>",
"cost": "<COST>"
}Mutation
deleteBuyingPeriod — Returns BuyingPeriod
Scopes Required: stock_create_order stock_edit_order edit_products
| Arguments | Type | Description |
|---|---|---|
|
id |
The ID of the buying period |
Example Mutation
mutation DeleteBuyingPeriod($id: ID!) {
deleteBuyingPeriod(id: $id) {
id,
start,
end,
quantity,
cost
}
}
# Example variables
{
"id": "<ID>"
}Mutation
updateBuyingPeriod — Returns BuyingPeriod
Scopes Required: stock_create_order stock_edit_order edit_products
| Arguments | Type | Description |
|---|---|---|
|
id |
The ID of the buying period |
|
|
item |
The item the buying period applies to |
|
|
type |
The type of item the buying period applies to |
|
|
outlet |
The outlet the buying period applies to |
|
|
supplier |
The supplier the buying period is for |
|
|
start |
The start date for the buying period |
|
|
end |
The end date for the buying period |
|
|
quantity |
Float |
The minimum quantity to purchase to receive the provided cost |
|
cost |
Float |
The cost of the item for the quantity provided |
Example Mutation
mutation UpdateBuyingPeriod($id: ID!) {
updateBuyingPeriod(id: $id) {
id,
start,
end,
quantity,
cost
}
}
# Example variables
{
"id": "<ID>"
}