---
title: "Update a list of product groups"
method: PUT
path: "/contracts/{contract_id}/product_groups"
tags: ["Contract - Products"]
---

# Update a list of product groups

`PUT /contracts/{contract_id}/product_groups`

Use this endpoint to update the products and configurations of a list of product groups in a contract. See [Product Group](https://developer.oneflow.com/docs/product-group) for more information.

## Path parameters

- `contract_id` integer, required

## Headers

- `x-oneflow-api-token` string, required
- `x-oneflow-user-email` string, email, required

## Request body

- object — An array of the product groups to update.
  - `product_groups` object[], required
    - `_private_ownerside` object — Contract product group attributes that are private to the ownerside.
      - `custom_id` string, nullable
    - `configuration` object — A contract product group configuration.
      - `columns` object[] — List of configuration of product group columns
        - `enabled` boolean — If true, the column is enabled.
        - `key` 'name' | 'description' | 'price_1' | 'price_2' | 'count', required — One of the product group column keys.
        - `label` string — The product group column label.
        - `tax_1` object — Product group tax display name.
          - `label` string, required — The product group tax display name label.
          - `incl_tax` boolean — If true, prices are entered including tax.
      - `counterpart_edit` boolean — If true, the counterpart can edit products in the contract.
      - `hide_price_summation` boolean — If true, the price summation will be hidden.
      - `name` object — Product group name data.
        - `enabled` boolean — If true, the product group name is enabled.
        - `label` string — The product group name label.
      - `price_affixes` object — Postfix and prefix of a contract product price.
        - `postfix` string — The product price postfix.
        - `prefix` string — The product price prefix.
      - `price_precision` integer — Define the number of decimal places for price amount. See [here](https://developer.oneflow.com/docs/decimal-prices-and-quantities) for more information.
      - `quantity_precision` integer — Define the number of decimal places for quantity amount. [here](https://developer.oneflow.com/docs/decimal-prices-and-quantities) for more information.
      - `tax_1` object — Product group tax display name.
        - `label` string, required — The product group tax display name label.
        - `incl_tax` boolean — If true, prices are entered including tax.
    - `id` integer
    - `products` object[] — The array of products in this group.
      - `_private_ownerside` object — Contract product attributes that are private to the ownerside.
        - `custom_id` string, nullable
      - `counterparty_lock` boolean — If true, the counterpart can edit products in the contract.
      - `description` string — The product description.
      - `id` integer — The product ID.
      - `name` string — The product name. When creating a new product, it is mandatory to provide a product name.
      - `price_1` object, nullable — The object holds all price-related information for an individual product. Note that base_amount must be larger than discount_amount, except if the base_amount is 0, which is an exception to allow negative prices. See [Products](https://developer.oneflow.com/docs/product-group#products).
        - `base_amount` object — The base price of one item of this kind of product without considering discounts.
          - `amount` string, amount_4_decimal, nullable — An amount specifying the base price.
        - `discount_amount` object — The discount on the base price.
          - `amount` string, amount_4_decimal, nullable — An amount specifying the discount.
        - `discount_percent` string, discount_percent, nullable — The discount percentage is a decimal string between "0" and "100".
        - `tax_1` object, nullable — Product tax details.
          - `key` 'percentage', required
          - `value` string, tax_percent, required — Represents the tax percentage as a decimal string greater than or equal to 0 and less than or equal to 100.
      - `price_2` object, nullable — The object holds all price-related information for an individual product. Note that base_amount must be larger than discount_amount, except if the base_amount is 0, which is an exception to allow negative prices. See [Products](https://developer.oneflow.com/docs/product-group#products).
        - `base_amount` object — The base price of one item of this kind of product without considering discounts.
          - `amount` string, amount_4_decimal, nullable — An amount specifying the base price.
        - `discount_amount` object — The discount on the base price.
          - `amount` string, amount_4_decimal, nullable — An amount specifying the discount.
        - `discount_percent` string, discount_percent, nullable — The discount percentage is a decimal string between "0" and "100".
        - `tax_1` object, nullable — Product tax details.
          - `key` 'percentage', required
          - `value` string, tax_percent, required — Represents the tax percentage as a decimal string greater than or equal to 0 and less than or equal to 100.
      - `quantity` object — The object holds information about the quantity of an individual product. The default quantity type is multiple_choice. If the quantity type is single_choice or multiple_choice, the amount must be set to 0 or 1. If the quantity type is set to single_choice, the amount must be set to 1 at least for one product, and 0 for the rest of the products in the same product group with the quantity type single_choice.
        - `amount` number, nullable — The number of individual products selected, or the quantity.
        - `type` 'single_choice' | 'multiple_choice' | 'quantity' — One of the product's [quantity types](product-group#quantity-type).

## Response `200`

Returns the updated list of product groups.

- object — A collection of product groups in a contract with count.
  - `count` integer, required
  - `data` object[], required
    - `_private_ownerside` object, nullable, required — Product group data that is private to the ownerside.
      - `created_time` string, datetime, required
      - `custom_id` string, nullable, required
      - `updated_time` string, datetime, nullable, required
    - `configuration` object, required — Updated product group configuration
      - `columns` object[]
        - `enabled` boolean
        - `key` 'name' | 'description' | 'price_1' | 'price_2' | 'count', required — One of the product group column keys.
        - `label` string
        - `tax_1` object — Product group tax display name.
          - `label` string — The product group tax display name label.
          - `incl_tax` boolean — If true, prices are entered including tax.
      - `counterpart_edit` boolean
      - `hide_price_summation` boolean
      - `name` object — Product group name data.
        - `enabled` boolean — If true, the product group name is enabled.
        - `label` string — The product group name label.
      - `price_affixes` object — Postfix and prefix of a contract product price.
        - `postfix` string
        - `prefix` string
      - `price_precision` integer, nullable
      - `quantity_precision` integer, nullable
      - `tax_1` object — Product group tax display name.
        - `label` string — The product group tax display name label.
        - `incl_tax` boolean — If true, prices are entered including tax.
    - `created_from` integer, nullable — This will be only available in the contract create response.
    - `enabled_columns` object[], required
      - `enabled` boolean, required
      - `key` string, required
    - `id` integer, required
    - `products` object[], required
      - `_private_ownerside` object, nullable, required — Product data that is private to the ownerside.
        - `created_time` string, datetime, required
        - `custom_id` string, nullable, required
        - `updated_time` string, datetime, nullable, required
      - `counterparty_lock` boolean
      - `created_from` integer, nullable — This will be only available in the contract create response.
      - `description` string
      - `id` integer, required
      - `name` string, required
      - `price_1` object, nullable, required — An object that holds all price related information for an individual product.
        - `amount` object, required — The price amount after discount.
          - `amount` string, signed_amount_4_decimal, nullable, required
        - `base_amount` object, required — The price amount before discount.
          - `amount` string, amount_4_decimal, nullable, required
        - `discount_amount` object, required — The absolute discount amount.
          - `amount` string, amount_4_decimal, nullable, required
        - `discount_percent` string, discount_percent, nullable, required — The discount percentage as a decimal string between "0" and "100".
        - `tax_1` object, nullable — Product tax details.
          - `key` 'percentage', required
          - `value` string, tax_percent, required — Represents the tax percentage as a decimal string greater than or equal to 0 and less than or equal to 100.
      - `price_2` object, nullable, required — An object that holds all price related information for an individual product.
        - `amount` object, required — The price amount after discount.
          - `amount` string, signed_amount_4_decimal, nullable, required
        - `base_amount` object, required — The price amount before discount.
          - `amount` string, amount_4_decimal, nullable, required
        - `discount_amount` object, required — The absolute discount amount.
          - `amount` string, amount_4_decimal, nullable, required
        - `discount_percent` string, discount_percent, nullable, required — The discount percentage as a decimal string between "0" and "100".
        - `tax_1` object, nullable — Product tax details.
          - `key` 'percentage', required
          - `value` string, tax_percent, required — Represents the tax percentage as a decimal string greater than or equal to 0 and less than or equal to 100.
      - `quantity` object, required — The object holds information about the quantity of an individual product. The default quantity type is multiple_choice. If the quantity type is single_choice or multiple_choice, the amount must be set to 0 or 1. If the quantity type is set to single_choice, the amount must be set to 1 at least for one product, and 0 for the rest of the products in the same product group with the quantity type single_choice.
        - `amount` number, nullable — The number of individual products selected, or the quantity.
        - `type` 'single_choice' | 'multiple_choice' | 'quantity' — One of the product's [quantity types](product-group#quantity-type).

## Other responses

- `400` — Invalid format or content of the request.
- `401` — The API token or the user email is invalid.
- `403` — The request is not authorized by the server.
- `404` — A required entity is missing.
- `409` — A conflict occurred with the current state of the target resource.

---

[API](https://skmtc.net/oneflow/apis/public-api-for-oneflow.md) · [All operations](https://skmtc.net/oneflow/apis/public-api-for-oneflow/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/oneflow/public-api-for-oneflow/versions/0e73a45dec15/schema)
