Create an accounting account
accounting:chart-of-accounts.writehttps://api.holded.com/api/v2/accounting-accountsCreates a new accounting account in your chart of accounts. Accounting accounts categorize financial transactions for reporting and comply with your country's accounting plan. The response returns the new account `id`. Provide `number` to assign a specific account number. Provide `prefix` alone to auto-assign the next available number within that group. **AI assistant note:** `prefix` is the chart-of-accounts GROUP code (1–4 digits), NOT the full account number. To create an account with a specific number, use the `number` field and set `prefix` to the group it belongs to (the leading digits of the number, e.g. for number 70000013 use prefix 7000).
Request body
Chart-of-accounts group code (1–4 digits). The full account number is auto-assigned within this group when `number` is absent. Must be 1–4 digits.
Exact account number to assign (e.g. 70000013). Must start with `prefix`. When provided the number is used as-is and must be unique; otherwise the next available number in the group is assigned.
Display name for the accounting account
Optional description of the account purpose
Hex color code for UI display
Request
import requests
url = "https://api.holded.com/api/v2/accounting-accounts"
headers = {
"Authorization": "Bearer YOUR_API_KEY",
"Accept": "application/json",
}
payload = {
"prefix": 0,
"number": 0,
"name": "string",
"description": "string",
"color": "string"
}
response = requests.post(url, headers=headers, json=payload)
print(response.json())Responses
Response
{
"id": "507f1f77bcf86cd799439011"
}Success responses
201Accounting account createdapplication/jsonError responses
400Bad requestapplication/json401Invalid or missing API keyapplication/json403Insufficient permissionsapplication/json422Validation errorapplication/json429Rate limit exceededapplication/json