zaepho.zohobooks.zohobooks_account module – Manage ZohoBooks chart of accounts
Note
This module is part of the zaepho.zohobooks collection (version 0.3.0).
It is not included in ansible-core.
To check whether it is installed, run ansible-galaxy collection list.
To install it, use: ansible-galaxy collection install zaepho.zohobooks.
To use it in a playbook, specify: zaepho.zohobooks.zohobooks_account.
New in zaepho.zohobooks 0.1.0
Synopsis
Create, update, or delete accounts in ZohoBooks chart of accounts
Idempotent operations based on account name
Parameters
Parameter |
Comments |
|---|---|
ZohoBooks API access token Can also be set via ZOHO_ACCESS_TOKEN environment variable |
|
Account code/number |
|
Name of the account |
|
Type of account Zoho Books does not publicly document a complete, closed list of account types (their own API docs trail off with “…and more”), so this list reflects known-good values rather than a guaranteed-exhaustive set. If the API adds/accepts a new type this list doesn’t cover yet, it will need to be extended here. Choices:
|
|
ZohoBooks API domain Can also be set via ZOHO_API_DOMAIN environment variable Default: |
|
Description of the account |
|
Whether this is a sub-account Choices:
|
|
ZohoBooks organization ID Can also be set via ZOHO_ORGANIZATION_ID environment variable |
|
Parent account ID for sub-accounts |
|
Desired state of the account Choices:
|
Examples
- name: Create a bank account (using explicit parameters)
zohobooks_account:
organization_id: "123456789"
access_token: "{{ zoho_access_token }}"
account_name: "Business Checking"
account_type: "bank"
account_code: "1001"
description: "Primary business checking account"
state: present
- name: Create account using environment variables
zohobooks_account:
account_name: "Business Savings"
account_type: "bank"
account_code: "1002"
description: "Business savings account"
state: present
environment:
ZOHO_ORGANIZATION_ID: "123456789"
ZOHO_ACCESS_TOKEN: "your_access_token"
ZOHO_API_DOMAIN: "https://www.zohoapis.com"
- name: Create a sub-account
zohobooks_account:
organization_id: "123456789"
access_token: "{{ zoho_access_token }}"
account_name: "Office Supplies"
account_type: "expense"
parent_account_id: "987654321"
is_sub_account: true
state: present
- name: Update an existing account
zohobooks_account:
organization_id: "123456789"
access_token: "{{ zoho_access_token }}"
account_name: "Business Checking"
description: "Updated description"
state: present
- name: Delete an account
zohobooks_account:
organization_id: "123456789"
access_token: "{{ zoho_access_token }}"
account_name: "Old Account"
state: absent
Return Values
Common return values are documented here, the following are the fields unique to this module:
Key |
Description |
|---|---|
Account details Returned: when state is present Sample: |
|
Whether the account was changed Returned: always |
|
Information about the operation Returned: always |