# Mutations / Buying Periods

# Buying Periods

**Mutation**
## createBuyingPeriod — Returns [BuyingPeriod](/documentation/Objects/Buying-Periods#BuyingPeriod)

**Scopes required:** stock_create_order, stock_edit_order, edit_products

| Arguments | Type | Description |
| --- | --- | --- |
| item | [ID!](/documentation/Types/UUID#UUID) | The item the buying period applies to |
| type | [HasPriceItemTypeEnum!](/documentation/Enums/Has-Price-Item-Type-Enum#HasPriceItemTypeEnum) | The type of item the buying period applies to |
| outlet | [ID!](/documentation/Types/UUID#UUID) | The outlet the buying period applies to |
| supplier | [ID!](/documentation/Types/UUID#UUID) | The supplier the buying period is for |
| start | [DateTime!](/documentation/Types/Date-Time#DateTime) | The start date for the buying period |
| end | [DateTime!](/documentation/Types/Date-Time#DateTime) | 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**

```graphql
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](/documentation/Objects/Buying-Periods#BuyingPeriod)

**Scopes required:** stock_create_order, stock_edit_order, edit_products

| Arguments | Type | Description |
| --- | --- | --- |
| id | [ID!](/documentation/Types/UUID#UUID) | The ID of the buying period |

**Example Mutation**

```graphql
mutation DeleteBuyingPeriod($id: ID!) {
    deleteBuyingPeriod(id: $id) {
        id,
        start,
        end,
        quantity,
        cost
    }
}

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

**Mutation**
## updateBuyingPeriod — Returns [BuyingPeriod](/documentation/Objects/Buying-Periods#BuyingPeriod)

**Scopes required:** stock_create_order, stock_edit_order, edit_products

| Arguments | Type | Description |
| --- | --- | --- |
| id | [ID!](/documentation/Types/UUID#UUID) | The ID of the buying period |
| item | [ID](/documentation/Types/UUID#UUID) | The item the buying period applies to |
| type | [HasPriceItemTypeEnum](/documentation/Enums/Has-Price-Item-Type-Enum#HasPriceItemTypeEnum) | The type of item the buying period applies to |
| outlet | [ID](/documentation/Types/UUID#UUID) | The outlet the buying period applies to |
| supplier | [ID](/documentation/Types/UUID#UUID) | The supplier the buying period is for |
| start | [DateTime](/documentation/Types/Date-Time#DateTime) | The start date for the buying period |
| end | [DateTime](/documentation/Types/Date-Time#DateTime) | 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**

```graphql
mutation UpdateBuyingPeriod($id: ID!) {
    updateBuyingPeriod(id: $id) {
        id,
        start,
        end,
        quantity,
        cost
    }
}

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