Your integration uses three levels:
-
Organization::ACCOUNT: your fiskaly account. -
Organization::GROUP: a required intermediate layer to organize your clients into logical clusters. -
Organization::UNIT: one for each taxpayer issuing records.
In most cases, one Group per country is enough. For example, if you support fiscalization in Italy and France, create one Group for Italy and one for France.
You may need one more level, for example to separate taxpayers by brand or region within a country. To do this, create a sub-group, which is a Group nested inside a top-level Group (a Group created directly under your Account). You can create sub-groups only under a top-level Group. Sub-groups cannot contain further sub-groups.
Account
|
+-- Group ("France")
| |
| +-- Unit ("taxpayer 1")
|
+-- Group ("Italy")
|
+-- Sub-group ("Brand A")
| |
| +-- Unit ("taxpayer 2")
| +-- Unit ("taxpayer 3")
|
+-- Sub-group ("Brand B")
|
+-- Unit ("taxpayer 4")
Step 1 – Create the sub-group in the fiskaly HUB
- Log in to the fiskaly HUB and make sure you are in the right mode (TEST or LIVE).
- On the top-level Group's row, click + Create group.
- Enter a name for the sub-group and confirm.
- Check that the new sub-group appears under its top-level Group in the organization selector.
- Copy the sub-group ID. You will need it if you choose Option A in Step 3.
Step 2 - Create an API key in the fiskaly HUB
Select the row of the Group for which you want to create an API key, and click Create API Key.
Where you create the API key determines what it can access:
| API key created on… | Can access |
|---|---|
| the sub-group | only that sub-group and the Units below it |
| the top-level Group | the top-level Group, all of its sub-groups, and the Units below them |
API keys are mode-specific: a key created in TEST can only create TEST resources, and a key created in LIVE can only create LIVE resources.
Step 3 - Create Units under the sub-group via API
Call createOrganization with type: UNIT. You have two options:
-
Option A: use the top-level Group's API key and set the sub-group's ID as the
X-Scope-Identifierheader. Without the header, the Unit is created directly under the top-level Group. - Option B: use the sub-group's API key. The Unit is created directly under the sub-group, and no extra header is needed.
createAsset instead of createOrganization. For details, see SIGN IT: New Resource Terminology