zaepho.zohobooks.zohobooks_vendor module – Manage ZohoBooks vendors

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

New in zaepho.zohobooks 0.3.0

Synopsis

  • Create, update, or delete vendors in ZohoBooks

  • Manage vendor status (active/inactive)

  • Idempotent operations based on vendor name

Parameters

Parameter

Comments

access_token

string

ZohoBooks API access token

Can also be set via ZOHO_ACCESS_TOKEN environment variable

api_domain

string

ZohoBooks API domain

Can also be set via ZOHO_API_DOMAIN environment variable

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

billing_address

dictionary

Billing address details

address

string

Street address

attention

string

Attention line

city

string

City name

country

string

Country name

fax

string

Fax number

state

string

State or province

street2

string

Second line of address

zip

string

ZIP or postal code

company_name

string

Legal company name

contact_name

string / required

Display name for the vendor

Used for searching and displaying vendors

currency_code

string

Currency code for the vendor (e.g., USD, EUR)

custom_fields

dictionary

Custom field values as a dictionary

email

string

Email address of the vendor

mobile

string

Mobile phone number of the vendor

notes

string

Additional notes about the vendor

organization_id

string

ZohoBooks organization ID

Can also be set via ZOHO_ORGANIZATION_ID environment variable

payment_terms

integer

Default payment terms in days

payment_terms_label

string

Label for the payment terms

phone

string

Phone number of the vendor

state

string

Desired state of the vendor

Choices:

  • "present" ← (default)

  • "absent"

  • "active"

  • "inactive"

tax_id

string

Tax ID or VAT registration number

vendor_sub_type

string

Type of vendor

Choices:

  • "individual"

  • "business"

website

string

Website URL of the vendor

Examples

- name: Create a vendor (using explicit parameters)
  zohobooks_vendor:
    organization_id: "123456789"
    access_token: "{{ zoho_access_token }}"
    contact_name: "Acme Suppliers"
    company_name: "Acme Suppliers Inc."
    vendor_sub_type: "business"
    email: "contact@acmesuppliers.com"
    phone: "555-1234"
    payment_terms: 30
    payment_terms_label: "Net 30"
    state: present

- name: Create vendor using environment variables
  zohobooks_vendor:
    contact_name: "Office Depot"
    company_name: "Office Depot Inc."
    vendor_sub_type: "business"
    email: "vendor@officedepot.com"
    state: present
  environment:
    ZOHO_ORGANIZATION_ID: "123456789"
    ZOHO_ACCESS_TOKEN: "your_access_token"
    ZOHO_API_DOMAIN: "https://www.zohoapis.com"

- name: Create vendor with billing address
  zohobooks_vendor:
    organization_id: "123456789"
    access_token: "{{ zoho_access_token }}"
    contact_name: "Tech Solutions"
    company_name: "Tech Solutions LLC"
    vendor_sub_type: "business"
    email: "billing@techsolutions.com"
    billing_address:
      address: "123 Main Street"
      city: "New York"
      state: "NY"
      zip: "10001"
      country: "USA"
    state: present

- name: Update an existing vendor
  zohobooks_vendor:
    organization_id: "123456789"
    access_token: "{{ zoho_access_token }}"
    contact_name: "Acme Suppliers"
    email: "newemail@acmesuppliers.com"
    payment_terms: 45
    state: present

- name: Mark vendor as inactive
  zohobooks_vendor:
    organization_id: "123456789"
    access_token: "{{ zoho_access_token }}"
    contact_name: "Old Supplier"
    state: inactive

- name: Mark vendor as active
  zohobooks_vendor:
    organization_id: "123456789"
    access_token: "{{ zoho_access_token }}"
    contact_name: "Acme Suppliers"
    state: active

- name: Delete a vendor
  zohobooks_vendor:
    organization_id: "123456789"
    access_token: "{{ zoho_access_token }}"
    contact_name: "Obsolete Vendor"
    state: absent

Return Values

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

Key

Description

changed

boolean

Whether the vendor was changed

Returned: always

msg

string

Information about the operation

Returned: always

vendor

dictionary

Vendor details

Returned: when state is present, active, or inactive

Sample: {"company_name": "Acme Suppliers Inc.", "contact_id": "123456789", "contact_name": "Acme Suppliers", "contact_type": "vendor", "email": "contact@acmesuppliers.com", "payment_terms": 30, "payment_terms_label": "Net 30", "phone": "555-1234", "status": "active", "vendor_sub_type": "business"}

Authors

  • Kevin Colby (@zaepho)