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"
]
}Suppliers
Assign supplier to company codes
Erforderliche Berechtigungen: suppliers:write
Ersetzt die vollständige Buchungskreis-Zuordnung eines Lieferanten. Der API-Schlüssel muss mit einem Kunden verknüpft sein, der Lieferant und alle Buchungskreise müssen zu diesem Kunden gehören.
Senden Sie legalEntityNumbers: [], um alle Zuordnungen zu entfernen.
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
| Scope | Tenant type |
|---|---|
suppliers:write | Customer API key |
Headers
| Header | Required | Description |
|---|---|---|
x-api-key | Yes | API key with scope suppliers:write |
Content-Type | Yes | application/json |
Path parameters
| Parameter | Description |
|---|---|
id | UUID of the supplier whose company-code assignments will be replaced |
Request body
| Field | Required | Description |
|---|---|---|
legalEntityNumbers | Yes | Complete 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
| Code | Description |
|---|---|
200 | Assignment list replaced successfully |
400 | Invalid request, duplicate numbers, or company code does not belong to the customer |
401 | Unauthorized — API key is not linked to a customer |
403 | Forbidden — missing suppliers:write scope |
404 | Supplier was not found in the current tenant |
500 | Internal server error |
Authorizations
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
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"]