Locations & Trade PartnersCreate a Location Group

Create a Location Group

The request body is a single location 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/LocationGroup" \
  -H "Content-Type: application/json" \
  -H "X-API-KEY: example_string" \
  -H "accept: */*" \
  -d '{
  "identifier": "GROUP-001",
  "name": "Processing Plants",
  "description": "Primary processing plant group"
}'
{
  "identifier": "GROUP-001",
  "name": "Processing Plants",
  "description": "Primary processing plant group"
}
POST
/Integration/LocationGroup
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 location group. Must not already be used by another location group.

namestring
Required

Required. Name of the location group.

descriptionstring

Optional. Description of the location 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 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

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

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 location group object.

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

Example Request

{
  "identifier": "GROUP-001",
  "name": "Processing Plants",
  "description": "Primary processing plant group"
}

cURL

curl -X 'POST' \
  '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",
    "description": "Primary processing plant group"
  }'

Responses

201 — Created

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

{
  "identifier": "GROUP-001",
  "name": "Processing Plants",
  "description": "Primary processing plant group"
}

409 — Conflict

A location group with the same identifier already exists. The response body is a problem details object with type, title, status (409), and traceId.

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 location group per request.
  • identifier and name are required. description is optional.
  • A location group is also created automatically when a location references a new identifier in its locationGroup object. See Create a Location / Trade Partner.
  • To change an existing location group, see Update a Location Group. To remove one, see Delete a Location Group.
  • In the Update a Location / Trade Partner response, the group assigned to a location is returned as locationGroup (with id, name, description, and externalIdentifier) together with locationGroupId.