zaepho.zohobooks.zohobooks_item module – Manage ZohoBooks items
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_item.
New in zaepho.zohobooks 0.2.0
Synopsis
Create, update, or delete items in ZohoBooks
Idempotent operations based on item name, or on SKU when the sku option is provided
Parameters
Parameter |
Comments |
|---|---|
ZohoBooks API access token Can also be set via ZOHO_ACCESS_TOKEN environment variable |
|
Income/Sales account ID |
|
ZohoBooks API domain Can also be set via ZOHO_API_DOMAIN environment variable Default: |
|
Description of the item |
|
Initial stock quantity |
|
Rate of initial stock |
|
Inventory account ID |
|
Whether the item is taxable Choices:
|
|
Type of item (inventory or non-inventory) Choices:
|
|
Name of the item |
|
ZohoBooks organization ID Can also be set via ZOHO_ORGANIZATION_ID environment variable |
|
Type of product Choices:
|
|
Account ID for purchases |
|
Purchase rate of the item |
|
Rate/price of the item |
|
Reorder level for inventory |
|
Stock Keeping Unit (SKU) - must be unique When provided, this is also used to look up the existing item instead of name |
|
Desired state of the item Choices:
|
|
Tax exemption ID to apply when the item is not taxable |
|
Tax ID to apply to the item |
|
Tax percentage to apply |
|
Whether to track inventory for this item Choices:
|
|
Unit of measurement |
Examples
- name: Create a goods item (using explicit parameters)
zohobooks_item:
organization_id: "123456789"
access_token: "{{ zoho_access_token }}"
name: "Hard Drive"
rate: 120.00
description: "500GB Hard Drive"
sku: "HD-500GB-001"
product_type: "goods"
unit: "unit"
state: present
- name: Create item using environment variables
zohobooks_item:
name: "Software License"
rate: 99.99
description: "Annual software license"
product_type: "service"
state: present
environment:
ZOHO_ORGANIZATION_ID: "123456789"
ZOHO_ACCESS_TOKEN: "your_access_token"
ZOHO_API_DOMAIN: "https://www.zohoapis.com"
- name: Create inventory item with initial stock
zohobooks_item:
organization_id: "123456789"
access_token: "{{ zoho_access_token }}"
name: "Widget A"
rate: 25.00
sku: "WGT-A-001"
product_type: "goods"
item_type: "inventory"
track_inventory: true
initial_stock: 100
initial_stock_rate: 20.00
reorder_level: 25
state: present
- name: Update an existing item
zohobooks_item:
organization_id: "123456789"
access_token: "{{ zoho_access_token }}"
name: "Hard Drive"
description: "Updated description - 1TB Hard Drive"
rate: 150.00
state: present
- name: Create/update a non-taxable item, looked up and upserted by SKU
zohobooks_item:
organization_id: "123456789"
access_token: "{{ zoho_access_token }}"
name: "Widget A - Digital"
sku: "WGT-A-DIGITAL"
rate: 9.99
product_type: "digital_service"
is_taxable: false
tax_exemption_id: "123456789"
account_id: "{{ sales_account_id }}"
state: present
- name: Mark item as inactive
zohobooks_item:
organization_id: "123456789"
access_token: "{{ zoho_access_token }}"
name: "Old Product"
state: inactive
- name: Mark item as active
zohobooks_item:
organization_id: "123456789"
access_token: "{{ zoho_access_token }}"
name: "Seasonal Product"
state: active
- name: Delete an item
zohobooks_item:
organization_id: "123456789"
access_token: "{{ zoho_access_token }}"
name: "Discontinued Item"
state: absent
Return Values
Common return values are documented here, the following are the fields unique to this module:
Key |
Description |
|---|---|
Whether the item was changed Returned: always |
|
Item details Returned: when state is present, active, or inactive Sample: |
|
Information about the operation Returned: always |