Sub-accounts management
The Peppol API allows you to manage sub-accounts for your legal entities. Sub-accounts are user accounts that can be associated with one or more legal entities, enabling fine-grained control over document visibility.
Features
- Sub-account Creation : When associating an email with a legal entity, the API automatically creates a sub-account if the user does not already exist in A-Cube.
- Document Visibility : Sub-accounts can only view documents (sent/received) related to the legal entities they are associated with.
- Multi-Entity Association : A sub-account can be associated with multiple legal entities, expanding its scope of visibility.
- Association Management : Owners can add or remove sub-account and legal entity associations at any time.
- Full Access Option : If you want a sub-account to access all your documents without legal entity whitelisting, please contact A-Cube support .
All endpoints are listed in the API reference.
Usage example
Assuming you already have a legal entity with ID 123e4567-e89b-12d3-a456-426614174000
and you want to associate the email foo@bar.com
with it, you can use the following endpoint:
POST /legal-entities/123e4567-e89b-12d3-a456-426614174000/sub-accounts
Content-Type: application/json
{
"email": "foo@bar.com",
"password": "your_secure_password"
}
After a successful request, the sub-account foo@bar.com
is now ready to access documents related to the specified legal entity.
You can obtain a JWT token for the sub-account using the standard authentication endpoint, as described in the authentication section.
Using the obtained token, the sub-account will now be able to view documents associated with the legal entity 123e4567-e89b-12d3-a456-426614174000
when calling any collection (or item) endpoint.
To remove the association between the sub-account and the legal entity, you can use the cancellation endpoint:
DELETE /legal-entities/123e4567-e89b-12d3-a456-426614174000/sub-accounts/foo@bar.com
After the successful response, the specified sub-account will no longer have access to documents related to the legal entity referenced by the operation.
Important notes
- Sub-accounts can only be created for existing legal entities.
-
If the email provided during sub-account creation already exists in A-Cube, the API will not create a new user and refuse the request with a
409 Conflict
error. - Sub-accounts cannot create or manage legal entities; this functionality is reserved for the main account holders.