zaepho.zohobooks.zohobooks_account_info module – Retrieve ZohoBooks chart of accounts information

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_info.

New in zaepho.zohobooks 0.2.0

Synopsis

  • Retrieve information about accounts in ZohoBooks chart of accounts

  • Can retrieve a specific account by name or ID, or list all accounts

Parameters

Parameter

Comments

access_token

string

ZohoBooks API access token

Can also be set via ZOHO_ACCESS_TOKEN environment variable

account_id

string

ID of the account to retrieve

Mutually exclusive with account_name

account_name

string

Name of the account to retrieve

Mutually exclusive with account_id

api_domain

string

ZohoBooks API domain

Can also be set via ZOHO_API_DOMAIN environment variable

Default: "https://www.zohoapis.com"

organization_id

string

ZohoBooks organization ID

Can also be set via ZOHO_ORGANIZATION_ID environment variable

Examples

- name: Get all accounts
  zaepho.zohobooks.zohobooks_account_info:
    organization_id: "123456789"
    access_token: "{{ zoho_access_token }}"
  register: all_accounts

- name: Get account by name
  zaepho.zohobooks.zohobooks_account_info:
    organization_id: "123456789"
    access_token: "{{ zoho_access_token }}"
    account_name: "Business Checking"
  register: account

- name: Get account by ID
  zaepho.zohobooks.zohobooks_account_info:
    organization_id: "123456789"
    access_token: "{{ zoho_access_token }}"
    account_id: "987654321"
  register: account

- name: Get accounts using environment variables
  zaepho.zohobooks.zohobooks_account_info:
    account_name: "Business Savings"
  environment:
    ZOHO_ORGANIZATION_ID: "123456789"
    ZOHO_ACCESS_TOKEN: "your_access_token"
    ZOHO_API_DOMAIN: "https://www.zohoapis.com"
  register: account

- name: Display account information
  debug:
    var: account.accounts

Return Values

Common return values are documented here, the following are the fields unique to this module:

Key

Description

accounts

list / elements=dictionary

List of accounts matching the criteria

Returned: always

Sample: [{"account_code": "1001", "account_id": "123456789", "account_name": "Business Checking", "account_type": "bank", "can_show_in_ze": false, "description": "Primary business checking account", "is_active": true, "is_involved_in_transaction": false, "is_user_created": true}]

count

integer

Number of accounts returned

Returned: always

Sample: 1

Authors

  • Kevin Colby (@zaepho)