Skip to main content

Group Companies

Read and replace the workspace's own group companies and their structure, so the platform never creates them as parties on a contract, through /v1/parties.

A contract names the workspace's own companies as well as its counterparties, and the app must not mistake the first for the second. The group companies list is the workspace's own companies and their structure. Entries on it are never created as parties, so a subsidiary named in a contract does not appear in the register as a counterparty.

GET /v1/parties/group-companies returns the list, ordered by name. Each entry has an id, a name, a parent_id (the id of the entry it belongs under, or null) and a relation (subsidiary, sister or parent, or null). The list is stored as the whole: there is no route that adds or removes a single entry.

GET/v1/parties/group-companies

PUT /v1/parties/group-companies replaces the whole list. Names are trimmed to 300 characters and duplicate names are dropped. parent names another entry of the same request, so the structure is described by names and the platform resolves them to ids; a parent that does not name an entry of the request is refused with 422. Send the complete list every time, because an entry you leave out is removed. The response is 200 with the stored companies.

PUT/v1/parties/group-companies

Body fields

companies*arrayUp to 1000 entries.
companies[].name*string1 to 300 characters.
companies[].parentstring | nullUp to 300 characters. The name of another entry in this list.
companies[].relationstring | nullsubsidiary, sister or parent.

cURL: Replace the group structure

curl -X PUT "https://api.talonic.com/v1/parties/group-companies" \
  -H "Authorization: Bearer $TALONIC_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "companies": [
      { "name": "Nord Energie Holding AG" },
      { "name": "Nord Energie Vertrieb GmbH", "parent": "Nord Energie Holding AG", "relation": "subsidiary" },
      { "name": "Nord Energie Netz GmbH", "parent": "Nord Energie Holding AG", "relation": "subsidiary" }
    ]
  }'

Response: Stored companies

{
  "data": [
    { "id": "a7c19e30-5d82-4b64-9f0a-2e8d6b4c1a73", "name": "Nord Energie Holding AG", "parent_id": null, "relation": null },
    { "id": "0e5b83d2-71f9-4a16-b4c8-6d2a9f7e3b15", "name": "Nord Energie Netz GmbH", "parent_id": "a7c19e30-5d82-4b64-9f0a-2e8d6b4c1a73", "relation": "subsidiary" },
    { "id": "b84d2f61-3a07-4e9c-85b1-c1f6a0d9e247", "name": "Nord Energie Vertrieb GmbH", "parent_id": "a7c19e30-5d82-4b64-9f0a-2e8d6b4c1a73", "relation": "subsidiary" }
  ]
}
Because PUT replaces the list, read it with GET first and send the full list back with your change. A request that lists only the new company removes every other entry.

Frequently asked questions

Why must I list my own companies?+
So the platform never creates them as parties. A contract names the workspace's own companies as well as its counterparties, and the group companies list tells the app which names are the workspace's own side.
How do I add one company without losing the others?+
Read the list with GET, add the entry, and send the complete list with PUT. PUT replaces the whole list, so an entry left out of the request is removed.
How is the hierarchy expressed?+
Each entry may name a parent, which must be the name of another entry in the same request, and a relation of subsidiary, sister or parent. The response returns the structure as parent_id values.