Update a Location Group
The request body is a single object, not an array. The endpoint has no path parameter. The location group to update is matched by the identifier in the request body. Only the fields you send are changed; a field you omit keeps its current value.
curl -X PUT "https://connect.wholechain.com/Integration/LocationGroup" \
-H "Content-Type: application/json" \
-H "X-API-KEY: example_string" \
-H "accept: */*" \
-d '{
"identifier": "GROUP-001",
"name": "Processing Plants (Updated)",
"description": "Updated primary processing plant group"
}'
import requests
import json
url = "https://connect.wholechain.com/Integration/LocationGroup"
headers = {
"Content-Type": "application/json",
"X-API-KEY": "example_string",
"accept": "*/*"
}
data = {
"identifier": "GROUP-001",
"name": "Processing Plants (Updated)",
"description": "Updated primary processing plant group"
}
response = requests.put(url, headers=headers, json=data)
print(response.json())
const response = await fetch("https://connect.wholechain.com/Integration/LocationGroup", {
method: "PUT",
headers: {
"Content-Type": "application/json",
"X-API-KEY": "example_string",
"accept": "*/*"
},
body: JSON.stringify({
"identifier": "GROUP-001",
"name": "Processing Plants (Updated)",
"description": "Updated primary processing plant group"
})
});
const data = await response.json();
console.log(data);
package main
import (
"fmt"
"net/http"
"bytes"
"encoding/json"
)
func main() {
data := []byte(`{
"identifier": "GROUP-001",
"name": "Processing Plants (Updated)",
"description": "Updated primary processing plant group"
}`)
req, err := http.NewRequest("PUT", "https://connect.wholechain.com/Integration/LocationGroup", 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/LocationGroup')
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": "GROUP-001",
"name": "Processing Plants (Updated)",
"description": "Updated primary processing plant group"
}'
response = http.request(request)
puts response.body
{
"identifier": "GROUP-001",
"name": "Processing Plants (Updated)",
"description": "Updated primary processing plant group"
}
{
"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": "Location group not found: GROUP-001",
"status": 404,
"traceId": "…"
}
{
"type": "https://tools.ietf.org/html/rfc4918#section-11.2",
"title": "Identifier is required.",
"status": 422,
"traceId": "…"
}
/Integration/LocationGroup
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 location group to update.
Optional. New name of the location group. If omitted, the current name is kept.
Optional. New description of the location group. If omitted, the current description is kept.
Request Preview
Response
Response will appear here after sending the request
Responses
Introduction
This API updates an existing location group in Wholechain.
A location group is a named set of locations that you manage together, for example every location in one region or run by one team.
A location references a group through the locationGroup object in the location Details. See Create a Location / Trade Partner and Update a Location / Trade Partner.
To manage location groups in the Wholechain app, see Location Groups.
Endpoint
| Method | URL |
|---|---|
PUT | https://connect.wholechain.com/Integration/LocationGroup |
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 location group object. It uses the same fields as Create a Location Group.
| Column Name | Data Type | Description | Required |
|---|---|---|---|
identifier | STRING | Identifies the location group to update. | Yes |
name | STRING | New name of the location group. If omitted, the current name is kept. | No |
description | STRING | New description of the location group. If omitted, the current description is kept. | No |
Example Request
{
"identifier": "GROUP-001",
"name": "Processing Plants (Updated)",
"description": "Updated primary processing plant group"
}
cURL
curl -X 'PUT' \
'https://connect.wholechain.com/Integration/LocationGroup' \
-H 'accept: */*' \
-H 'Content-Type: application/json' \
-H 'X-API-KEY: YOUR_API_KEY' \
-d '{
"identifier": "GROUP-001",
"name": "Processing Plants (Updated)",
"description": "Updated primary processing plant group"
}'
Responses
200 — OK
The location group is updated. The response body is a location group object with the fields identifier, name, and description.
{
"identifier": "GROUP-001",
"name": "Processing Plants (Updated)",
"description": "Updated primary processing plant group"
}
404 — Not Found
No location group with this identifier exists.
{
"type": "https://tools.ietf.org/html/rfc9110#section-15.5.5",
"title": "Location group not found: GROUP-001",
"status": 404,
"traceId": "<trace-id>"
}
422 — Unprocessable Entity
identifier is missing.
{
"type": "https://tools.ietf.org/html/rfc4918#section-11.2",
"title": "Identifier 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.
- The endpoint has no path parameter. The location group to update is matched by the
identifierin the request body. - Only the fields you send are changed. A field you omit keeps its current value.
identifieris required.nameanddescriptionare optional.- In the Update a Location / Trade Partner response, the group assigned to a location is returned as
locationGroup(withid,name,description, andexternalIdentifier) together withlocationGroupId.