Update a Trade Item
Updates an existing product. The request body is a single Product object, not a Products array; an array returns 422. Omitting productBrand or productItemGroup removes the product's current brand or item group, so send them in every update with at least their identifier.
curl -X PUT "https://connect.wholechain.com/Integration/Product" \
-H "Content-Type: application/json" \
-H "X-API-KEY: example_string" \
-d '{
"Product": {
"Id": "12345",
"Details": {
"Name": "Sample Product",
"SimpleUnitOfMeasurement": "Kgm",
"UnitQuantity": 2,
"UnitDescriptor": "Cases",
"SharingPolicy": "Open",
"ProductIdentifierType": "Lot",
"Gtin": "12345678912343",
"Plu": "4001",
"productBrand": {
"identifier": "BRAND-001",
"name": "Oceanic Brand",
"description": "Premium seafood brand"
},
"productItemGroup": {
"identifier": "ITEMGROUP-001",
"name": "Atlantic Salmon",
"description": "Farmed Atlantic salmon"
}
}
}
}'
import requests
import json
url = "https://connect.wholechain.com/Integration/Product"
headers = {
"Content-Type": "application/json",
"X-API-KEY": "example_string"
}
data = {
"Product": {
"Id": "12345",
"Details": {
"Name": "Sample Product",
"SimpleUnitOfMeasurement": "Kgm",
"UnitQuantity": 2,
"UnitDescriptor": "Cases",
"SharingPolicy": "Open",
"ProductIdentifierType": "Lot",
"Gtin": "12345678912343",
"Plu": "4001",
"productBrand": {
"identifier": "BRAND-001",
"name": "Oceanic Brand",
"description": "Premium seafood brand"
},
"productItemGroup": {
"identifier": "ITEMGROUP-001",
"name": "Atlantic Salmon",
"description": "Farmed Atlantic salmon"
}
}
}
}
response = requests.put(url, headers=headers, json=data)
print(response.json())
const response = await fetch("https://connect.wholechain.com/Integration/Product", {
method: "PUT",
headers: {
"Content-Type": "application/json",
"X-API-KEY": "example_string"
},
body: JSON.stringify({
"Product": {
"Id": "12345",
"Details": {
"Name": "Sample Product",
"SimpleUnitOfMeasurement": "Kgm",
"UnitQuantity": 2,
"UnitDescriptor": "Cases",
"SharingPolicy": "Open",
"ProductIdentifierType": "Lot",
"Gtin": "12345678912343",
"Plu": "4001",
"productBrand": {
"identifier": "BRAND-001",
"name": "Oceanic Brand",
"description": "Premium seafood brand"
},
"productItemGroup": {
"identifier": "ITEMGROUP-001",
"name": "Atlantic Salmon",
"description": "Farmed Atlantic salmon"
}
}
}
})
});
const data = await response.json();
console.log(data);
package main
import (
"fmt"
"net/http"
"bytes"
"encoding/json"
)
func main() {
data := []byte(`{
"Product": {
"Id": "12345",
"Details": {
"Name": "Sample Product",
"SimpleUnitOfMeasurement": "Kgm",
"UnitQuantity": 2,
"UnitDescriptor": "Cases",
"SharingPolicy": "Open",
"ProductIdentifierType": "Lot",
"Gtin": "12345678912343",
"Plu": "4001",
"productBrand": {
"identifier": "BRAND-001",
"name": "Oceanic Brand",
"description": "Premium seafood brand"
},
"productItemGroup": {
"identifier": "ITEMGROUP-001",
"name": "Atlantic Salmon",
"description": "Farmed Atlantic salmon"
}
}
}
}`)
req, err := http.NewRequest("PUT", "https://connect.wholechain.com/Integration/Product", bytes.NewBuffer(data))
if err != nil {
panic(err)
}
req.Header.Set("Content-Type", "application/json")
req.Header.Set("X-API-KEY", "example_string")
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/Product')
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.body = '{
"Product": {
"Id": "12345",
"Details": {
"Name": "Sample Product",
"SimpleUnitOfMeasurement": "Kgm",
"UnitQuantity": 2,
"UnitDescriptor": "Cases",
"SharingPolicy": "Open",
"ProductIdentifierType": "Lot",
"Gtin": "12345678912343",
"Plu": "4001",
"productBrand": {
"identifier": "BRAND-001",
"name": "Oceanic Brand",
"description": "Premium seafood brand"
},
"productItemGroup": {
"identifier": "ITEMGROUP-001",
"name": "Atlantic Salmon",
"description": "Farmed Atlantic salmon"
}
}
}
}'
response = http.request(request)
puts response.body
{
"message": "Success",
"result": {
"id": "01a0ce68-eec0-71e5-b705-f33774803fbf",
"urn": "urn:gdst:wholechain.com:product:class:oceanagroupltd.sampleproduct-1",
"sharingPolicy": "Open",
"productIdentifierType": "Lot",
"accountId": "5a6b41f6-5a48-4a54-b94c-4a89125b7c7d",
"name": "Sample Product",
"productBrand": {
"id": "00000000-0000-0000-0000-000000000000",
"name": "Oceanic Brand",
"description": "Premium seafood brand",
"externalIdentifier": "BRAND-001",
"profileImagePreSignedUrl": ""
},
"productCommodity": {
"id": "00000000-0000-0000-0000-000000000000",
"name": "Atlantic Salmon",
"description": "Farmed Atlantic salmon",
"externalIdentifier": "ITEMGROUP-001"
},
"productGoodKind": null,
"simpleUnitOfMeasurement": "Kgm",
"unitQuantity": 2,
"unitDescriptor": "Cases",
"blockchain": "Algorand",
"gtin": "12345678912343",
"plu": "4001",
"upc": null,
"externalIdentifier": null,
"currentInventory": 0,
"currentInventoryTotal": 0,
"shippedInventory": 0,
"productMasterData": [],
"subProducts": [],
"lastModifiedTime": "2026-09-28T16:07:08.7374984+00:00",
"createdTime": "2026-09-23T13:16:18.501948+00:00",
"accountName": "Oceana Group Ltd",
"pendingShipmentItems": 0,
"hasActiveInventory": false,
"description": null,
"defaultImageDocumentId": null,
"defaultImagePreSignedUrl": null,
"sharedWith": [],
"originalAccountId": "00000000-0000-0000-0000-000000000000",
"archived": false,
"dataPolicyElements": null,
"ownerInfo": null
},
"errors": [],
"validations": []
}
{
"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/rfc4918#section-11.2",
"title": "'Product' must not be empty.",
"status": 422,
"traceId": "…"
}
/Integration/Product
Target server for requests. Edit to use your own host.
The media type of the request body
API key used to authenticate the request.
Request Preview
Response
Response will appear here after sending the request
Responses
Introduction
The Product API allows users to edit detailed specifications of a product such as its name, unit of measurement, sharing policy, and custom product data.
Updated products can be referenced as usual across the supply chain in events such as Receive, Ship, Commission, and Transform.
The request body is a single Product object, not a Products array. A Products array returns 422 with the title 'Product' must not be empty.
Request Headers
| Header | Description | Example Value |
|---|---|---|
X-API-KEY | Your API key. | <YOUR_API_KEY> |
Content-Type | Content type of the request. | application/json |
accept | Response content type. | */* |
Product Object
| Column Name | Data Type | Description | Required |
|---|---|---|---|
Id | STRING | Unique identifier for the product being updated. | Yes |
Details | OBJECT | Contains the updated product information. | Yes |
Details Object
| Column Name | Data Type | Description | Required |
|---|---|---|---|
Name | STRING | Name of the product. | Yes |
SimpleUnitOfMeasurement | STRING | Unit in which the product is measured or represented. | Yes |
UnitQuantity | DECIMAL | Quantity of the simple unit of measurement contained in the packaging or commercial unit. | No |
UnitDescriptor | STRING | Describes the packaging or commercial unit. | No |
SharingPolicy | STRING | Sharing policy, e.g. Open or Restricted. | Yes |
ProductIdentifierType | STRING | Type of product identifier, e.g. Lot or Serial. | Yes |
Gtin | STRING | Global Trade Item Number, if applicable. | No (Remove variable if not using) |
Plu | STRING | Price Lookup Code, if applicable. | No (Remove variable if not using) |
productBrand | OBJECT | Brand associated with the product. Omitting it removes the product's current brand. | No |
productItemGroup | OBJECT | Item group associated with the product. Omitting it removes the product's current item group. | No |
MasterData | ARRAY | Additional custom data stored against the product. | No (Remove variable if not using) |
productBrand and productItemGroup are shown with the property names defined in the API schema.
Product Brand Object
| Column Name | Data Type | Description | Required |
|---|---|---|---|
identifier | STRING | Your identifier for the product brand. Used to link the product to an existing brand or to create a new one. | Yes |
name | STRING | Name of the product brand. Send it when the identifier is new, so the new brand gets a name. | No |
description | STRING | Description of the product brand. | No |
To manage brands themselves, see Update a Product Brand.
Product Item Group Object
Send the item group as productItemGroup. A productCommodity field in the request is ignored. In the update response, the item group is returned as productCommodity.
| Column Name | Data Type | Description | Required |
|---|---|---|---|
identifier | STRING | Your identifier for the product item group. Used to link the product to an existing item group or to create a new one. | Yes |
name | STRING | Name of the product item group. Send it when the identifier is new, so the new item group gets a name. | No |
description | STRING | Description of the product item group. | No |
To manage item groups themselves, see Update a Product Item Group.
Product Custom Data
Custom product information can be added using the MasterData array inside the product Details object.
This can be used to store additional product-specific information that is not represented by one of the standard product fields.
MasterData Object
| Column Name | Data Type | Description | Required |
|---|---|---|---|
name | STRING | Name of the custom product field. | Yes |
namespace | STRING | Namespace of the custom field. Use custom for custom product data. | Yes |
value | STRING | Value associated with the custom product field. | Yes |
Multiple custom data fields can be added by including multiple objects in the MasterData array.
Optional fields such as Gtin, Plu, UnitQuantity, UnitDescriptor, and MasterData should be omitted from the request when they are not being used rather than submitted as empty values.
Omitting productBrand or productItemGroup removes it from the product. An update without these objects clears the product's current brand and item group. To keep them, send them in every update, with at least their identifier.
Example Request
{
"Product": {
"Id": "12345",
"Details": {
"Name": "Sample Product",
"SimpleUnitOfMeasurement": "Kgm",
"UnitQuantity": 2,
"UnitDescriptor": "Cases",
"SharingPolicy": "Open",
"ProductIdentifierType": "Lot",
"Gtin": "12345678912343",
"Plu": "4001",
"productBrand": {
"identifier": "BRAND-001",
"name": "Oceanic Brand",
"description": "Premium seafood brand"
},
"productItemGroup": {
"identifier": "ITEMGROUP-001",
"name": "Atlantic Salmon",
"description": "Farmed Atlantic salmon"
}
}
}
}
Example Request With Product Custom Data
{
"Product": {
"Id": "12345",
"Details": {
"Name": "Sample Product",
"SimpleUnitOfMeasurement": "Kgm",
"UnitQuantity": 2,
"UnitDescriptor": "Cases",
"SharingPolicy": "Open",
"ProductIdentifierType": "Lot",
"Gtin": "12345678912343",
"Plu": "4001",
"MasterData": [
{
"name": "Gear Type",
"namespace": "custom",
"value": "GEAR TYPE_VALUE"
}
]
}
}
}
Example With Multiple Custom Data Fields
{
"Product": {
"Id": "12345",
"Details": {
"Name": "Sample Product",
"SimpleUnitOfMeasurement": "Kgm",
"SharingPolicy": "Open",
"ProductIdentifierType": "Lot",
"MasterData": [
{
"name": "Gear Type",
"namespace": "custom",
"value": "TRAWL"
},
{
"name": "Species",
"namespace": "custom",
"value": "Atlantic Salmon"
}
]
}
}
}
Optional fields such as
Gtin,Plu,UnitQuantity,UnitDescriptor, andMasterDatashould be removed from the request when they are not being used. KeepproductBrandandproductItemGroupin the request if the product should keep its brand and item group.
Response
200 — OK
The response contains message (Success) and result, the updated product. In result, the brand is returned as productBrand (with id, name, description, externalIdentifier, and profileImagePreSignedUrl) and the item group as productCommodity (with id, name, description, and externalIdentifier). Both are null when the product has no brand or item group.
Error Responses
Errors are returned as a problem details object with type, title, status, and traceId.
| Status | Cause |
|---|---|
400 | The X-API-KEY header is missing, or the request body can't be read. |
422 | The body uses a Products array instead of a Product object. |