Update a Product Item Group
The request body is a single object, not an array. The endpoint has no path parameter. The product item group to update is matched by the identifier in the request body.
curl -X PUT "https://connect.wholechain.com/Integration/ItemGroup" \
-H "Content-Type: application/json" \
-H "X-API-KEY: example_string" \
-H "accept: */*" \
-d '{
"identifier": "ITEMGROUP-001",
"name": "Atlantic Salmon (Updated)",
"description": "Updated farmed Atlantic salmon"
}'
import requests
import json
url = "https://connect.wholechain.com/Integration/ItemGroup"
headers = {
"Content-Type": "application/json",
"X-API-KEY": "example_string",
"accept": "*/*"
}
data = {
"identifier": "ITEMGROUP-001",
"name": "Atlantic Salmon (Updated)",
"description": "Updated farmed Atlantic salmon"
}
response = requests.put(url, headers=headers, json=data)
print(response.json())
const response = await fetch("https://connect.wholechain.com/Integration/ItemGroup", {
method: "PUT",
headers: {
"Content-Type": "application/json",
"X-API-KEY": "example_string",
"accept": "*/*"
},
body: JSON.stringify({
"identifier": "ITEMGROUP-001",
"name": "Atlantic Salmon (Updated)",
"description": "Updated farmed Atlantic salmon"
})
});
const data = await response.json();
console.log(data);
package main
import (
"fmt"
"net/http"
"bytes"
"encoding/json"
)
func main() {
data := []byte(`{
"identifier": "ITEMGROUP-001",
"name": "Atlantic Salmon (Updated)",
"description": "Updated farmed Atlantic salmon"
}`)
req, err := http.NewRequest("PUT", "https://connect.wholechain.com/Integration/ItemGroup", bytes.NewBuffer(data))
if err != nil {
panic(err)
}
req.Header.Set("Content-Type", "application/json")
req.Header.Set("X-API-KEY", "example_string")
req.Header.Set("accept", "*/*")
client := &http.Client{}
resp, err := client.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
fmt.Println("Response Status:", resp.Status)
}
require 'net/http'
require 'json'
uri = URI('https://connect.wholechain.com/Integration/ItemGroup')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Put.new(uri)
request['Content-Type'] = 'application/json'
request['X-API-KEY'] = 'example_string'
request['accept'] = '*/*'
request.body = '{
"identifier": "ITEMGROUP-001",
"name": "Atlantic Salmon (Updated)",
"description": "Updated farmed Atlantic salmon"
}'
response = http.request(request)
puts response.body
{
"identifier": "ITEMGROUP-001",
"name": "Atlantic Salmon (Updated)",
"description": "Updated farmed Atlantic salmon"
}
{
"type": "https://tools.ietf.org/html/rfc9110#section-15.5.1",
"title": "One or more validation errors occurred.",
"status": 400,
"errors": {
"X-API-KEY": [
"The apiKey field is required."
]
},
"traceId": "…"
}
{
"type": "https://tools.ietf.org/html/rfc9110#section-15.5.5",
"title": "Product item group not found: ITEMGROUP-001",
"status": 404,
"traceId": "…"
}
/Integration/ItemGroup
Target server for requests. Edit to use your own host.
The media type of the request body
Your Wholechain API key.
Response content type.
Required. Identifies the product item group to update.
New name of the product item group.
New description of the product item group.
Request Preview
Response
Response will appear here after sending the request
Responses
Introduction
This API updates an existing product item group in Wholechain.
A product item group organizes products by a business category you choose, such as a commodity. In the Wholechain app, item groups are managed as Trade Item Groups, and a product's group is shown as Commodity.
A product references an item group through the productItemGroup object in the product Details. See Create a Product and Update a Product.
To manage item groups in the Wholechain app, see Trade Item Groups.
Endpoint
| Method | URL |
|---|---|
PUT | https://connect.wholechain.com/Integration/ItemGroup |
Request Headers
| Header | Description | Example Value |
|---|---|---|
X-API-KEY | Your Wholechain API key. | <YOUR_API_KEY> |
Content-Type | Content type of the request. application/json and application/xml are accepted. | application/json |
accept | Response content type. | */* |
Request Body
The request body is a single product item group object. It uses the same fields as Create a Product Item Group.
| Column Name | Data Type | Description | Required |
|---|---|---|---|
identifier | STRING | Identifies the product item group to update. | Yes |
name | STRING | New name of the product item group. | No |
description | STRING | New description of the product item group. | No |
Example Request
{
"identifier": "ITEMGROUP-001",
"name": "Atlantic Salmon (Updated)",
"description": "Updated farmed Atlantic salmon"
}
cURL
curl -X 'PUT' \
'https://connect.wholechain.com/Integration/ItemGroup' \
-H 'accept: */*' \
-H 'Content-Type: application/json' \
-H 'X-API-KEY: YOUR_API_KEY' \
-d '{
"identifier": "ITEMGROUP-001",
"name": "Atlantic Salmon (Updated)",
"description": "Updated farmed Atlantic salmon"
}'
Responses
200 — OK
The product item group is updated. The response body is a product item group object with the fields identifier, name, and description.
{
"identifier": "ITEMGROUP-001",
"name": "Atlantic Salmon (Updated)",
"description": "Updated farmed Atlantic salmon"
}
404 — Not Found
No product item group with this identifier exists.
{
"type": "https://tools.ietf.org/html/rfc9110#section-15.5.5",
"title": "Product item group not found: ITEMGROUP-001",
"status": 404,
"traceId": "<trace-id>"
}
400 — Bad Request
The X-API-KEY header is missing, or the request body is not valid JSON.
{
"type": "https://tools.ietf.org/html/rfc9110#section-15.5.1",
"title": "One or more validation errors occurred.",
"status": 400,
"errors": {
"X-API-KEY": [
"The apiKey field is required."
]
},
"traceId": "<trace-id>"
}
Important Notes
- The request body is a single object, not an array.
- The endpoint has no path parameter. The product item group to update is matched by the
identifierin the request body. identifieris required.- In the Update a Product response, the item group assigned to a product is returned as
productCommodity(withid,name,description, andexternalIdentifier).