Sub-accounts
The Slovak Invoicing API allows you to manage sub-accounts for your legal entities. Sub-accounts are user accounts that can be granted access to documents belonging to your legal entities without sharing your main account credentials.
Creating a sub-account association automatically creates the user in A-Cube if it doesn't already exist, and the sub-account can only view documents (sent/received) related to the legal entities it is associated with.
Features
- Sub-account Creation: Associating an email with a legal entity automatically creates a sub-account if the user doesn't already exist in A-Cube.
- Document Visibility: A sub-account can only view documents related to the single legal entity it is associated with.
- Multiple Legal Entities: The same sub-account can be associated with more than one of your legal entities, by repeating the association with the same email.
- Association Management: Owners can add or remove the sub-account/legal entity association at any time.
All endpoints are listed in the LegalEntitySubAccount API reference.
Usage example
Assuming you already have a legal entity with ID 123e4567-e89b-12d3-a456-426614174000 and want to associate the email foo@bar.com with it:
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 can access documents related to the specified legal entity. You can obtain a JWT token for the sub-account using the standard authentication endpoint.
To remove the association, use the corresponding delete endpoint:
DELETE /legal-entities/123e4567-e89b-12d3-a456-426614174000/sub-accounts/{uuid}
Important notes
- Using LegalEntitySubAccount, sub-accounts can only be created for existing legal entities.
- If the email already belongs to one of your sub-accounts, it is simply associated with the new legal entity: its password does not change, and the one you send is ignored.
- If the email belongs to another A-Cube user, the API refuses the request with a validation error.
- Sub-accounts are read-only: they cannot create or manage legal entities, send documents, or manage webhooks and other sub-accounts. This is reserved for the main account holder.
- Documents outside the sub-account's legal entities are hidden: they do not appear in lists, and requesting them directly returns a
404 Not Founderror.