zaepho.zohobooks.zohobooks_vendor_info module – Retrieve ZohoBooks vendor 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_vendor_info.

New in zaepho.zohobooks 0.3.0

Synopsis

  • Retrieve information about vendors in ZohoBooks

  • Can retrieve a specific vendor by name or ID, or list all vendors

  • Optionally filter vendors by status (active, inactive, or all)

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"

contact_id

string

ID of the vendor to retrieve

Mutually exclusive with contact_name

contact_name

string

Name of the vendor to retrieve

Mutually exclusive with contact_id

filter_by

string

Filter vendors by status

Choices:

  • "Status.Active"

  • "Status.Inactive"

  • "Status.All"

organization_id

string

ZohoBooks organization ID

Can also be set via ZOHO_ORGANIZATION_ID environment variable

Examples

- name: Get all vendors
  zaepho.zohobooks.zohobooks_vendor_info:
    organization_id: "123456789"
    access_token: "{{ zoho_access_token }}"
  register: all_vendors

- name: Get vendor by name
  zaepho.zohobooks.zohobooks_vendor_info:
    organization_id: "123456789"
    access_token: "{{ zoho_access_token }}"
    contact_name: "Acme Suppliers"
  register: vendor

- name: Get vendor by ID
  zaepho.zohobooks.zohobooks_vendor_info:
    organization_id: "123456789"
    access_token: "{{ zoho_access_token }}"
    contact_id: "987654321"
  register: vendor

- name: Get all active vendors
  zaepho.zohobooks.zohobooks_vendor_info:
    organization_id: "123456789"
    access_token: "{{ zoho_access_token }}"
    filter_by: "Status.Active"
  register: active_vendors

- name: Get all inactive vendors
  zaepho.zohobooks.zohobooks_vendor_info:
    organization_id: "123456789"
    access_token: "{{ zoho_access_token }}"
    filter_by: "Status.Inactive"
  register: inactive_vendors

- name: Get vendors using environment variables
  zaepho.zohobooks.zohobooks_vendor_info:
    contact_name: "Office Depot"
  environment:
    ZOHO_ORGANIZATION_ID: "123456789"
    ZOHO_ACCESS_TOKEN: "your_access_token"
    ZOHO_API_DOMAIN: "https://www.zohoapis.com"
  register: vendor

- name: Display vendor information
  debug:
    var: vendor.vendors

Return Values

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

Key

Description

count

integer

Number of vendors returned

Returned: always

Sample: 1

vendors

list / elements=dictionary

List of vendors matching the criteria

Returned: always

Sample: [{"billing_address": {"address": "123 Main Street", "city": "New York", "country": "USA", "state": "NY", "zip": "10001"}, "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)