Skip to main content
PUT
/
suppliers
/
{id}
/
legal-entities
curl --request PUT \
  --url https://api.comstruct.com/v1/suppliers/{id}/legal-entities \
  --header 'Content-Type: application/json' \
  --header 'X-API-Key: <api-key>' \
  --data '
{
  "legalEntityNumbers": [
    "LE-001",
    "LE-002"
  ]
}
'
{
  "supplierId": "33333333-3333-4333-8333-333333333333",
  "legalEntityNumbers": [
    "LE-001",
    "LE-002"
  ]
}

Overview

Use this endpoint to assign a supplier to one or more company codes. The request always replaces the supplier’s full assignment list.
Send an empty array to remove all company-code assignments. The supplier then becomes tenant-wide again.

Permissions

ScopeTenant type
suppliers:writeCustomer API key
The API key must be linked to a customer.

Headers

HeaderRequiredDescription
x-api-keyYesAPI key with scope suppliers:write
Content-TypeYesapplication/json

Path parameters

ParameterDescription
idUUID of the supplier whose company-code assignments will be replaced

Request body

FieldRequiredDescription
legalEntityNumbersYesComplete list of company-code numbers for this supplier

Example

curl -X PUT "https://api.comstruct.com/v1/suppliers/33333333-3333-4333-8333-333333333333/legal-entities" \
  -H "x-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "legalEntityNumbers": [
      "LE-001",
      "LE-002"
    ]
  }'

Remove all assignments

curl -X PUT "https://api.comstruct.com/v1/suppliers/33333333-3333-4333-8333-333333333333/legal-entities" \
  -H "x-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "legalEntityNumbers": [] }'

Behavior

  • The submitted list replaces all existing company-code assignments for the supplier.
  • Duplicate numbers are not allowed.
  • The supplier must belong to the customer linked to the API key.
  • All company codes must belong to the same customer.

Response codes

CodeDescription
200Assignment list replaced successfully
400Invalid request, duplicate numbers, or company code does not belong to the customer
401Unauthorized — API key is not linked to a customer
403Forbidden — missing suppliers:write scope
404Supplier was not found in the current tenant
500Internal server error

Authorizations

X-API-Key
string
header
required

API-Schlüssel zur Authentifizierung. Kontaktieren Sie Ihren Customer Success Manager, um einen API-Schlüssel zu erhalten.

Jeder Endpunkt erfordert spezifische Berechtigungen (Scopes); die erforderlichen Scopes werden pro Endpunkt angezeigt.

Path Parameters

id
string<uuid>
required

UUID des Lieferanten

Body

application/json

Vollständige Liste der Buchungskreisnummern für diesen Lieferanten. Ein leeres Array entfernt alle Zuordnungen.

Example:
["LE-001", "LE-002"]

Response

Buchungskreis-Zuordnung erfolgreich ersetzt

supplierId
string<uuid>
required

UUID des Lieferanten

Example:

"33333333-3333-4333-8333-333333333333"

Buchungskreisnummern, die nach dem Replace gespeichert sind

Example:
["LE-001", "LE-002"]