Company Registration
This chapter describes how a new Company entity is created in the DEUSS Core platform. Company registration stores the canonical company data in the Core relational database and schedules the asynchronous on-chain provisioning of the company's identity, wallet, and managers.
The action can be initiated by an integrated external Broker through the partner API or by a DEUSS Backoffice Administrator through the admin flow.
Business Rules
- Unique company identity: The platform must not already contain a company with the same
businessId,vatNumber, orlegalEntityIdas the submitted company. - Partner authorization: In the partner flow, the caller must be authenticated via mTLS and the API Gateway must provide the
X-Partner-IdandX-Partner-Roleheaders. - Broker-only partner creation: The partner flow is allowed only when
X-Partner-RoleequalsBROKER. - Admin authorization: In the admin flow, the acting Backoffice user must be logged in and their JWT token must contain the
REGISTRY_MANAGERrole. - Broker assignment: In the partner flow,
broker_idis derived fromX-Partner-Id; anybroker_idsubmitted in the request payload is ignored. In the admin flow,broker_idmust be provided explicitly in the payload. - Auditability: Every company creation attempt is recorded in audit logs with the identity of the caller.
- Asynchronous blockchain provisioning: The API returns after the off-chain entity and chain operation records are created. It does not wait for blockchain confirmation.
Business Flow
-
Registration Initiation:
- A company can be registered either by an integrated Broker Partner System or by a DEUSS Backoffice Administrator.
- In the partner flow, the broker calls the Registry Service through the partner-facing API after successful mTLS authentication. The API Gateway passes the authenticated partner context to the Registry Service through
X-Partner-IdandX-Partner-Role. - In the admin flow, a Backoffice user creates the company through an authenticated admin request. The user's JWT must prove that they are allowed to manage registry data.
-
Authorization and Broker Assignment:
- The partner flow is restricted to callers with the
BROKERrole. The Registry Service derives the company'sbroker_idfromX-Partner-Id, so the broker relationship is based on the authenticated integration context rather than on client-submitted data. - The admin flow is restricted to users with the
REGISTRY_MANAGERrole. In this case, the administrator explicitly selects or submits thebroker_idthat should be assigned to the new company. - This distinction prevents an external partner from creating companies under another broker while still allowing controlled administrative onboarding from the Backoffice.
- The partner flow is restricted to callers with the
-
Off-Chain Company Creation:
- The Registry Service validates the submitted company details before persisting the company. The company must not duplicate an existing legal identity, business identifier, or VAT number.
- After validation, the Company entity is stored in the Core relational database. The creation is recorded as an audit event, including the identity and context of the caller.
- The service also creates records in
chain_operationsfor the on-chain provisioning work that must happen after the relational entity exists. - The API response is returned immediately after the off-chain work is complete. It includes the created Company entity and the chain operation IDs, but it does not wait for blockchain finality.
-
Asynchronous On-Chain Provisioning:
- Because DEUSS uses DLT infrastructure, company creation continues in the background after the synchronous API call succeeds.
- JobRunnr picks up the pending operation from
chain_operationsand submits the relevant smart contract transaction to provision the company's on-chain identity, wallet, and manager configuration. - Once the transaction is submitted, the operation record is updated with the
tx_hash. A polling process then follows the transaction until the final on-chain result is known. - When the transaction is confirmed successfully, the operation is marked as
COMPLETED. At that point, the company has both an off-chain Core representation and the required on-chain infrastructure.
-
Failure Handling:
- If credentials are missing or invalid, the request is rejected as unauthorized. If the caller is authenticated but lacks the required role, the request is rejected as forbidden.
- In the admin flow, a missing
broker_idprevents the company from being created, because the system cannot determine which broker should own the relationship. - If the submitted legal identity already exists, the Registry Service rejects the request as a duplicate instead of creating a second company record.
- Blockchain failures are handled asynchronously. If the RPC endpoint is temporarily unavailable, JobRunnr retries the operation. If retries are exhausted or the transaction reverts on-chain, the chain operation is marked as
FAILEDand requires administrative attention.
Process Guarantees
The company registration process guarantees that the off-chain Company entity is created only after the caller is authorized and the submitted identifiers pass uniqueness validation. It also guarantees that the broker assignment is derived from the trusted source for the given flow: authenticated partner headers for broker integrations, or an explicit Backoffice payload for administrative onboarding.
Successful registration creates an auditable Core record and schedules the required blockchain provisioning without blocking the user-facing API on transaction confirmation. This keeps company creation responsive while preserving traceability of the later on-chain work through chain_operations.