ProductsCreate a Product Item Group

Create a Product Item Group

The request body is a single product item group object, not an array. identifier and name are required; description is optional and is stored as an empty string when omitted.

curl -X POST "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",
  "description": "Farmed Atlantic salmon"
}'
{
  "identifier": "ITEMGROUP-001",
  "name": "Atlantic Salmon",
  "description": "Farmed Atlantic salmon"
}
POST
/Integration/ItemGroup
POST
Base URLstring

Target server for requests. Edit to use your own host.

Content-Typestring
Required

The media type of the request body

Options: application/json
header
X-API-KEYstring
Required

Your Wholechain API key.

header
acceptstring

Response content type.

Options: */*
identifierstring
Required

Required. Your identifier for the product item group. Must not already be used by another product item group.

namestring
Required

Required. Name of the product item group.

descriptionstring

Optional. Description of the product item group. Stored as an empty string when omitted.

Request Preview
Response

Response will appear here after sending the request

Responses

Introduction

This API creates a 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

MethodURL
POSThttps://connect.wholechain.com/Integration/ItemGroup

Request Headers

HeaderDescriptionExample Value
X-API-KEYYour Wholechain API key.<YOUR_API_KEY>
Content-TypeContent type of the request. application/json and application/xml are accepted.application/json
acceptResponse content type.*/*

Request Body

The request body is a single product item group object.

Column NameData TypeDescriptionRequired
identifierSTRINGYour identifier for the product item group. Must not already be used by another product item group.Yes
nameSTRINGName of the product item group.Yes
descriptionSTRINGDescription of the product item group. If omitted, it is stored as an empty string.No

Example Request

{
  "identifier": "ITEMGROUP-001",
  "name": "Atlantic Salmon",
  "description": "Farmed Atlantic salmon"
}

cURL

curl -X 'POST' \
  '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",
    "description": "Farmed Atlantic salmon"
  }'

Responses

201 — Created

The product item group is created. The response body is a product item group object with the same fields as the request: identifier, name, and description.

{
  "identifier": "ITEMGROUP-001",
  "name": "Atlantic Salmon",
  "description": "Farmed Atlantic salmon"
}

409 — Conflict

A product item group with the same identifier already exists.

{
  "type": "https://tools.ietf.org/html/rfc9110#section-15.5.10",
  "title": "Product commodity external identifier already exists: ITEMGROUP-001",
  "status": 409,
  "traceId": "<trace-id>"
}

422 — Unprocessable Entity

identifier or name is missing. The title is Identifier is required. or Name is required.

{
  "type": "https://tools.ietf.org/html/rfc4918#section-11.2",
  "title": "Name is required.",
  "status": 422,
  "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. Create one product item group per request.
  • identifier and name are required. description is optional.
  • A product item group is also created automatically when a product references a new identifier in its productItemGroup object. See Create a Product.
  • To change an existing product item group, see Update a Product Item Group. To remove one, see Delete a Product Item Group.
  • In the Update a Product response, the item group assigned to a product is returned as productCommodity (with id, name, description, and externalIdentifier).