Skip to content

AI Agents & MCPs & AI Workflow Automation • (~400 MCP servers for AI agents) • AI Automation / AI Agent with MCPs • AI Workflows & AI Agents • MCPs for AI Agents

feat(zoho-invoice): add AI actions and output schemas (#16815)

Kishan Parmar1aca36ae0549
diff --git a/packages/pieces/community/zoho-invoice/package.json b/packages/pieces/community/zoho-invoice/package.json
index efdb1bb39a5..7bc3b846725 100644
--- a/packages/pieces/community/zoho-invoice/package.json
+++ b/packages/pieces/community/zoho-invoice/package.json
@@ -1,6 +1,6 @@
{
"name": "@activepieces/piece-zoho-invoice",
- "version": "0.2.3",
+ "version": "0.3.0",
"main": "./dist/src/index.js",
"types": "./dist/src/index.d.ts",
"scripts": {
diff --git a/packages/pieces/community/zoho-invoice/src/index.ts b/packages/pieces/community/zoho-invoice/src/index.ts
index cf7d26ebc08..01e2288a069 100644
--- a/packages/pieces/community/zoho-invoice/src/index.ts
+++ b/packages/pieces/community/zoho-invoice/src/index.ts
@@ -1,69 +1,26 @@
import { createCustomApiCallAction } from '@activepieces/pieces-common';
-import {
- createPiece,
- OAuth2PropertyValue,
- PieceAuth,
- Property,
-} from '@activepieces/pieces-framework';
-import { PieceCategory } from '@activepieces/pieces-framework';
-import { common } from './lib/common';
-import { newInvoice } from './lib/triggers/new-invoice';
-
-export const zohoAuth = PieceAuth.OAuth2({
- required: true,
- authUrl: 'https://accounts.zoho.{region}/oauth/v2/auth',
- tokenUrl: 'https://accounts.zoho.{region}/oauth/v2/token',
- scope: ['ZohoInvoice.invoices.READ'],
- props: {
- region: Property.StaticDropdown({
- displayName: 'Region',
- description: 'Select your account region',
- required: true,
- options: {
- options: [
- {
- label: 'US (.com)',
- value: 'com',
- },
- {
- label: 'Europe (.eu)',
- value: 'eu',
- },
- {
- label: 'India (.in)',
- value: 'in',
- },
- {
- label: 'Australia (.com.au)',
- value: 'com.au',
- },
- {
- label: 'Japan (.jp)',
- value: 'jp',
- },
- ],
- },
- }),
- },
-});
+import { createPiece, PieceCategory } from '@activepieces/pieces-framework';
+import { zohoInvoiceAiActions } from './lib/actions/ai';
+import { zohoInvoiceAuth } from './lib/auth';
+import { zohoInvoiceClient } from './lib/common/client';
+import { newInvoiceTrigger } from './lib/triggers/new-invoice';
export const zohoInvoice = createPiece({
displayName: 'Zoho Invoice',
description: 'Online invoicing software for businesses',
- auth: zohoAuth,
- minimumSupportedRelease: '0.30.0',
+ auth: zohoInvoiceAuth,
+ minimumSupportedRelease: '0.88.2',
logoUrl: 'https://cdn.activepieces.com/pieces/zoho-invoice.png',
categories: [PieceCategory.ACCOUNTING],
authors: ["kishanprmr","MoShizzle","abuaboud"],
actions: [
+ ...zohoInvoiceAiActions,
createCustomApiCallAction({
- baseUrl: (auth) =>
- common.baseUrl((auth as OAuth2PropertyValue).props!['region']),
- auth: zohoAuth,
- authMapping: async (auth) =>
- common.authHeaders((auth as OAuth2PropertyValue).access_token),
+ baseUrl: (auth) => (auth ? zohoInvoiceClient.baseUrl({ auth }) : ''),
+ auth: zohoInvoiceAuth,
+ authMapping: async (auth) => zohoInvoiceClient.authHeaders({ auth }),
}),
],
- triggers: [newInvoice],
+ triggers: [newInvoiceTrigger],
});
diff --git a/packages/pieces/community/zoho-invoice/src/lib/actions/ai/contacts/add-contact-address.ts b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/contacts/add-contact-address.ts
new file mode 100644
index 00000000000..64b96e68cd0
--- /dev/null
+++ b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/contacts/add-contact-address.ts
@@ -0,0 +1,81 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoInvoiceAuth } from '../../../auth';
+import { zohoInvoiceAiProps } from '../../../common/ai-props';
+import { zohoInvoiceApi } from '../../../common/api';
+import { zohoInvoiceUtils } from '../../../common/utils';
+import { zohoInvoiceAddressInfoOutputSchema } from '../../../output-schemas';
+
+export const addContactAddressAction = createAction({
+ auth: zohoInvoiceAuth,
+ name: 'zoho_invoice_add_contact_address',
+ outputSchema: zohoInvoiceAddressInfoOutputSchema,
+ displayName: 'Add Contact Address',
+ description: 'Adds an additional address to a customer contact.',
+ audience: 'ai',
+ classification: 'WRITE',
+ aiMetadata: {
+ description:
+ 'Adds an extra address to a contact, beside its billing and shipping addresses (change those with Update Contact). Use List Contacts to find the contact ID. Not idempotent: each call adds a new address.',
+ idempotent: false,
+ },
+ props: {
+ organizationId: zohoInvoiceAiProps.organizationId({ required: true }),
+ contactId: zohoInvoiceAiProps.contactId({ required: true }),
+ attention: Property.ShortText({
+ displayName: 'Attention',
+ description: 'Name of the person the address is for.',
+ required: false,
+ }),
+ address: Property.ShortText({
+ displayName: 'Street',
+ description: 'Street address, first line.',
+ required: false,
+ }),
+ street2: Property.ShortText({
+ displayName: 'Street 2',
+ description: 'Street address, second line.',
+ required: false,
+ }),
+ city: Property.ShortText({ displayName: 'City', description: 'City.', required: false }),
+ state: Property.ShortText({
+ displayName: 'State',
+ description: 'State or region.',
+ required: false,
+ }),
+ zip: Property.ShortText({
+ displayName: 'ZIP Code',
+ description: 'Postal code.',
+ required: false,
+ }),
+ country: Property.ShortText({
+ displayName: 'Country',
+ description: 'Country name.',
+ required: false,
+ }),
+ phone: Property.ShortText({
+ displayName: 'Phone',
+ description: 'Phone number.',
+ required: false,
+ }),
+ fax: Property.ShortText({ displayName: 'Fax', description: 'Fax number.', required: false }),
+ },
+ async run({ auth, propsValue }) {
+ return await zohoInvoiceApi.addContactAddress({
+ auth,
+ organizationId: propsValue.organizationId,
+ contactId: propsValue.contactId,
+ body: zohoInvoiceUtils.compact({
+ attention: propsValue.attention,
+ address: propsValue.address,
+ street2: propsValue.street2,
+ city: propsValue.city,
+ state: propsValue.state,
+ zip: propsValue.zip,
+ country: propsValue.country,
+ phone: propsValue.phone,
+ fax: propsValue.fax,
+ }),
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-invoice/src/lib/actions/ai/contacts/create-contact-person.ts b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/contacts/create-contact-person.ts
new file mode 100644
index 00000000000..0810ba00319
--- /dev/null
+++ b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/contacts/create-contact-person.ts
@@ -0,0 +1,99 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoInvoiceAuth } from '../../../auth';
+import { zohoInvoiceAiProps } from '../../../common/ai-props';
+import { zohoInvoiceApi } from '../../../common/api';
+import { zohoInvoiceUtils } from '../../../common/utils';
+import { zohoInvoiceContactPersonOutputSchema } from '../../../output-schemas';
+
+export const createContactPersonAction = createAction({
+ auth: zohoInvoiceAuth,
+ name: 'zoho_invoice_create_contact_person',
+ outputSchema: zohoInvoiceContactPersonOutputSchema,
+ displayName: 'Create Contact Person',
+ description: 'Adds a person to a customer contact.',
+ audience: 'ai',
+ classification: 'WRITE',
+ aiMetadata: {
+ description:
+ 'Adds a contact person (name, email, phones, job) to a contact. Use List Contacts to find the contact ID. Enabling portal access sends the person a real invitation email. Not idempotent: each call adds a new person.',
+ idempotent: false,
+ },
+ props: {
+ organizationId: zohoInvoiceAiProps.organizationId({ required: true }),
+ contactId: zohoInvoiceAiProps.contactId({ required: true }),
+ firstName: Property.ShortText({
+ displayName: 'First Name',
+ description: 'First name.',
+ required: true,
+ }),
+ salutation: Property.ShortText({
+ displayName: 'Salutation',
+ description: 'Salutation, e.g. Mr. or Ms.',
+ required: false,
+ }),
+ lastName: Property.ShortText({
+ displayName: 'Last Name',
+ description: 'Last name.',
+ required: false,
+ }),
+ email: Property.ShortText({
+ displayName: 'Email',
+ description: 'Email address.',
+ required: false,
+ }),
+ phone: Property.ShortText({
+ displayName: 'Phone',
+ description: 'Work phone number.',
+ required: false,
+ }),
+ mobile: Property.ShortText({
+ displayName: 'Mobile',
+ description: 'Mobile phone number.',
+ required: false,
+ }),
+ skype: Property.ShortText({
+ displayName: 'Skype',
+ description: 'Skype ID.',
+ required: false,
+ }),
+ designation: Property.ShortText({
+ displayName: 'Designation',
+ description: 'Job title.',
+ required: false,
+ }),
+ department: Property.ShortText({
+ displayName: 'Department',
+ description: 'Department.',
+ required: false,
+ }),
+ enablePortal: zohoInvoiceAiProps.yesNo({
+ required: false,
+ displayName: 'Enable Portal',
+ description: 'Give the person client portal access and email them an invitation. Empty = no.',
+ }),
+ additionalFields: zohoInvoiceAiProps.additionalFields({ required: false }),
+ },
+ async run({ auth, propsValue }) {
+ return await zohoInvoiceApi.createContactPerson({
+ auth,
+ organizationId: propsValue.organizationId,
+ body: {
+ ...(propsValue.additionalFields ?? {}),
+ ...zohoInvoiceUtils.compact({
+ contact_id: propsValue.contactId,
+ first_name: propsValue.firstName,
+ salutation: propsValue.salutation,
+ last_name: propsValue.lastName,
+ email: propsValue.email,
+ phone: propsValue.phone,
+ mobile: propsValue.mobile,
+ skype: propsValue.skype,
+ designation: propsValue.designation,
+ department: propsValue.department,
+ enable_portal: zohoInvoiceUtils.toOptionalBoolean({ value: propsValue.enablePortal }),
+ }),
+ },
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-invoice/src/lib/actions/ai/contacts/create-contact.ts b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/contacts/create-contact.ts
new file mode 100644
index 00000000000..877822fef3f
--- /dev/null
+++ b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/contacts/create-contact.ts
@@ -0,0 +1,114 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoInvoiceAuth } from '../../../auth';
+import { zohoInvoiceAiProps } from '../../../common/ai-props';
+import { zohoInvoiceApi } from '../../../common/api';
+import { zohoInvoiceUtils } from '../../../common/utils';
+import { zohoInvoiceContactOutputSchema } from '../../../output-schemas';
+
+export const createContactAction = createAction({
+ auth: zohoInvoiceAuth,
+ name: 'zoho_invoice_create_contact',
+ outputSchema: zohoInvoiceContactOutputSchema,
+ displayName: 'Create Contact',
+ description: 'Creates a customer contact in Zoho Invoice.',
+ audience: 'ai',
+ classification: 'WRITE',
+ aiMetadata: {
+ description:
+ 'Creates a customer contact, optionally with contact persons and billing/shipping addresses. Not idempotent: each call creates a new contact, so use List Contacts first to avoid duplicates.',
+ idempotent: false,
+ },
+ props: {
+ organizationId: zohoInvoiceAiProps.organizationId({ required: true }),
+ contactName: Property.ShortText({
+ displayName: 'Contact Name',
+ description: 'Display name of the contact.',
+ required: true,
+ }),
+ companyName: Property.ShortText({
+ displayName: 'Company Name',
+ description: 'Company name of the contact.',
+ required: false,
+ }),
+ currencyId: zohoInvoiceAiProps.currencyId({
+ required: false,
+ description:
+ 'Currency ID for the contact. Use List Currencies to find it. Empty = base currency.',
+ }),
+ paymentTerms: Property.Number({
+ displayName: 'Payment Terms',
+ description: 'Net payment terms in days, e.g. 15.',
+ required: false,
+ }),
+ website: Property.ShortText({
+ displayName: 'Website',
+ description: 'Website of the contact.',
+ required: false,
+ }),
+ notes: Property.LongText({
+ displayName: 'Notes',
+ description: 'Internal notes about the contact.',
+ required: false,
+ }),
+ contactPersons: Property.Array({
+ displayName: 'Contact Persons',
+ description: 'People at this contact. The first one becomes the primary contact person.',
+ required: false,
+ properties: {
+ salutation: Property.ShortText({ displayName: 'Salutation', required: false }),
+ firstName: Property.ShortText({ displayName: 'First Name', required: false }),
+ lastName: Property.ShortText({ displayName: 'Last Name', required: false }),
+ email: Property.ShortText({ displayName: 'Email', required: false }),
+ phone: Property.ShortText({ displayName: 'Phone', required: false }),
+ mobile: Property.ShortText({ displayName: 'Mobile', required: false }),
+ },
+ }),
+ billingAddress: Property.Json({
+ displayName: 'Billing Address',
+ description:
+ 'Billing address as a JSON object with keys attention, address, street2, city, state, zip, country, fax, phone.',
+ required: false,
+ }),
+ shippingAddress: Property.Json({
+ displayName: 'Shipping Address',
+ description:
+ 'Shipping address as a JSON object with keys attention, address, street2, city, state, zip, country, fax, phone.',
+ required: false,
+ }),
+ additionalFields: zohoInvoiceAiProps.additionalFields({ required: false }),
+ },
+ async run({ auth, propsValue }) {
+ return await zohoInvoiceApi.createContact({
+ auth,
+ organizationId: propsValue.organizationId,
+ body: {
+ ...(propsValue.additionalFields ?? {}),
+ ...zohoInvoiceUtils.compact({
+ contact_name: propsValue.contactName,
+ company_name: propsValue.companyName,
+ currency_id: propsValue.currencyId,
+ payment_terms: propsValue.paymentTerms,
+ website: propsValue.website,
+ notes: propsValue.notes,
+ contact_persons: propsValue.contactPersons?.map((person) => toContactPerson({ person })),
+ billing_address: propsValue.billingAddress,
+ shipping_address: propsValue.shippingAddress,
+ }),
+ },
+ });
+ },
+});
+
+function toContactPerson({ person }: { person: unknown }): Record<string, unknown> {
+ const fields: Record<string, unknown> =
+ typeof person === 'object' && person !== null ? Object.fromEntries(Object.entries(person)) : {};
+ return zohoInvoiceUtils.compact({
+ salutation: fields['salutation'],
+ first_name: fields['firstName'],
+ last_name: fields['lastName'],
+ email: fields['email'],
+ phone: fields['phone'],
+ mobile: fields['mobile'],
+ });
+}
diff --git a/packages/pieces/community/zoho-invoice/src/lib/actions/ai/contacts/delete-contact-address.ts b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/contacts/delete-contact-address.ts
new file mode 100644
index 00000000000..e5361b2303e
--- /dev/null
+++ b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/contacts/delete-contact-address.ts
@@ -0,0 +1,38 @@
+import { createAction } from '@activepieces/pieces-framework';
+
+import { zohoInvoiceAuth } from '../../../auth';
+import { zohoInvoiceAiProps } from '../../../common/ai-props';
+import { zohoInvoiceApi } from '../../../common/api';
+import { zohoInvoiceMessageOutputSchema } from '../../../output-schemas';
+
+export const deleteContactAddressAction = createAction({
+ auth: zohoInvoiceAuth,
+ name: 'zoho_invoice_delete_contact_address',
+ outputSchema: zohoInvoiceMessageOutputSchema,
+ displayName: 'Delete Contact Address',
+ description: 'Deletes an additional address of a customer contact.',
+ audience: 'ai',
+ classification: 'DESTRUCTIVE',
+ aiMetadata: {
+ description:
+ 'Permanently deletes one additional address of a contact. Use List Contact Addresses to find the address ID. Cannot be undone.',
+ idempotent: false,
+ },
+ props: {
+ organizationId: zohoInvoiceAiProps.organizationId({ required: true }),
+ contactId: zohoInvoiceAiProps.contactId({ required: true }),
+ addressId: zohoInvoiceAiProps.idProp({
+ required: true,
+ displayName: 'Address ID',
+ description: 'Additional address ID. Use List Contact Addresses to find it.',
+ }),
+ },
+ async run({ auth, propsValue }) {
+ return await zohoInvoiceApi.deleteContactAddress({
+ auth,
+ organizationId: propsValue.organizationId,
+ contactId: propsValue.contactId,
+ addressId: propsValue.addressId,
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-invoice/src/lib/actions/ai/contacts/delete-contact-person.ts b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/contacts/delete-contact-person.ts
new file mode 100644
index 00000000000..68a5c1bbe4f
--- /dev/null
+++ b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/contacts/delete-contact-person.ts
@@ -0,0 +1,32 @@
+import { createAction } from '@activepieces/pieces-framework';
+
+import { zohoInvoiceAuth } from '../../../auth';
+import { zohoInvoiceAiProps } from '../../../common/ai-props';
+import { zohoInvoiceApi } from '../../../common/api';
+import { zohoInvoiceMessageOutputSchema } from '../../../output-schemas';
+
+export const deleteContactPersonAction = createAction({
+ auth: zohoInvoiceAuth,
+ name: 'zoho_invoice_delete_contact_person',
+ outputSchema: zohoInvoiceMessageOutputSchema,
+ displayName: 'Delete Contact Person',
+ description: 'Deletes a contact person from a customer contact.',
+ audience: 'ai',
+ classification: 'DESTRUCTIVE',
+ aiMetadata: {
+ description:
+ 'Permanently deletes one contact person. Use List Contact Persons to find the ID. Cannot be undone.',
+ idempotent: false,
+ },
+ props: {
+ organizationId: zohoInvoiceAiProps.organizationId({ required: true }),
+ contactPersonId: zohoInvoiceAiProps.contactPersonId({ required: true }),
+ },
+ async run({ auth, propsValue }) {
+ return await zohoInvoiceApi.deleteContactPerson({
+ auth,
+ organizationId: propsValue.organizationId,
+ contactPersonId: propsValue.contactPersonId,
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-invoice/src/lib/actions/ai/contacts/delete-contact.ts b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/contacts/delete-contact.ts
new file mode 100644
index 00000000000..ccff174f1ba
--- /dev/null
+++ b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/contacts/delete-contact.ts
@@ -0,0 +1,32 @@
+import { createAction } from '@activepieces/pieces-framework';
+
+import { zohoInvoiceAuth } from '../../../auth';
+import { zohoInvoiceAiProps } from '../../../common/ai-props';
+import { zohoInvoiceApi } from '../../../common/api';
+import { zohoInvoiceMessageOutputSchema } from '../../../output-schemas';
+
+export const deleteContactAction = createAction({
+ auth: zohoInvoiceAuth,
+ name: 'zoho_invoice_delete_contact',
+ outputSchema: zohoInvoiceMessageOutputSchema,
+ displayName: 'Delete Contact',
+ description: 'Deletes a customer contact.',
+ audience: 'ai',
+ classification: 'DESTRUCTIVE',
+ aiMetadata: {
+ description:
+ 'Permanently deletes a contact. Use List Contacts to find the ID. To hide a contact but keep it, use Mark Contact Inactive instead. Cannot be undone.',
+ idempotent: false,
+ },
+ props: {
+ organizationId: zohoInvoiceAiProps.organizationId({ required: true }),
+ contactId: zohoInvoiceAiProps.contactId({ required: true }),
+ },
+ async run({ auth, propsValue }) {
+ return await zohoInvoiceApi.deleteContact({
+ auth,
+ organizationId: propsValue.organizationId,
+ contactId: propsValue.contactId,
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-invoice/src/lib/actions/ai/contacts/disable-contact-payment-reminders.ts b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/contacts/disable-contact-payment-reminders.ts
new file mode 100644
index 00000000000..e5b453165c6
--- /dev/null
+++ b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/contacts/disable-contact-payment-reminders.ts
@@ -0,0 +1,32 @@
+import { createAction } from '@activepieces/pieces-framework';
+
+import { zohoInvoiceAuth } from '../../../auth';
+import { zohoInvoiceAiProps } from '../../../common/ai-props';
+import { zohoInvoiceApi } from '../../../common/api';
+import { zohoInvoiceMessageOutputSchema } from '../../../output-schemas';
+
+export const disableContactPaymentRemindersAction = createAction({
+ auth: zohoInvoiceAuth,
+ name: 'zoho_invoice_disable_contact_payment_reminders',
+ outputSchema: zohoInvoiceMessageOutputSchema,
+ displayName: 'Disable Contact Payment Reminders',
+ description: 'Stops automated payment reminders for a customer contact.',
+ audience: 'ai',
+ classification: 'WRITE',
+ aiMetadata: {
+ description:
+ 'Turns off automated payment reminder emails for one contact; re-enable with Enable Contact Payment Reminders. Use List Contacts to find the ID.',
+ idempotent: true,
+ },
+ props: {
+ organizationId: zohoInvoiceAiProps.organizationId({ required: true }),
+ contactId: zohoInvoiceAiProps.contactId({ required: true }),
+ },
+ async run({ auth, propsValue }) {
+ return await zohoInvoiceApi.disableContactPaymentReminders({
+ auth,
+ organizationId: propsValue.organizationId,
+ contactId: propsValue.contactId,
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-invoice/src/lib/actions/ai/contacts/email-contact-statement.ts b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/contacts/email-contact-statement.ts
new file mode 100644
index 00000000000..56806d8caa8
--- /dev/null
+++ b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/contacts/email-contact-statement.ts
@@ -0,0 +1,99 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoInvoiceAuth } from '../../../auth';
+import { zohoInvoiceAiProps } from '../../../common/ai-props';
+import { zohoInvoiceApi } from '../../../common/api';
+import { zohoInvoiceUtils } from '../../../common/utils';
+import { zohoInvoiceMessageOutputSchema } from '../../../output-schemas';
+
+export const emailContactStatementAction = createAction({
+ auth: zohoInvoiceAuth,
+ name: 'zoho_invoice_email_contact_statement',
+ outputSchema: zohoInvoiceMessageOutputSchema,
+ displayName: 'Email Contact Statement',
+ description: 'Emails a customer contact their account statement.',
+ audience: 'ai',
+ classification: 'WRITE',
+ aiMetadata: {
+ description:
+ "Sends a real email with the contact's account statement PDF for a date range (default: the current month). Use List Contacts to find the contact ID, and Get Contact Statement Email Content for the default subject, body and recipients. Not idempotent: each call sends another email.",
+ idempotent: false,
+ },
+ props: {
+ organizationId: zohoInvoiceAiProps.organizationId({ required: true }),
+ contactId: zohoInvoiceAiProps.contactId({ required: true }),
+ startDate: Property.ShortText({
+ displayName: 'Start Date',
+ description:
+ 'Statement start date, yyyy-mm-dd. Empty with End Date empty = the current month.',
+ required: false,
+ }),
+ endDate: Property.ShortText({
+ displayName: 'End Date',
+ description: 'Statement end date, yyyy-mm-dd.',
+ required: false,
+ }),
+ toMailIds: Property.Array({
+ displayName: 'To',
+ description: 'Recipient email addresses.',
+ required: true,
+ }),
+ ccMailIds: Property.Array({
+ displayName: 'CC',
+ description: 'Email addresses to copy.',
+ required: false,
+ }),
+ subject: Property.ShortText({
+ displayName: 'Subject',
+ description: 'Email subject.',
+ required: true,
+ }),
+ body: Property.LongText({
+ displayName: 'Body',
+ description: 'Email body. HTML is allowed.',
+ required: true,
+ }),
+ sendFromOrgEmailId: zohoInvoiceAiProps.yesNo({
+ required: false,
+ displayName: 'Send From Organization Email',
+ description:
+ "Send from the organization's email address instead of the user's. Empty = the vendor default.",
+ }),
+ },
+ async run({ auth, propsValue }) {
+ const toMailIds = toEmailList({ value: propsValue.toMailIds, propName: 'To' });
+ const ccMailIds = toEmailList({ value: propsValue.ccMailIds, propName: 'CC' });
+ return await zohoInvoiceApi.emailContactStatement({
+ auth,
+ organizationId: propsValue.organizationId,
+ contactId: propsValue.contactId,
+ startDate: propsValue.startDate,
+ endDate: propsValue.endDate,
+ body: zohoInvoiceUtils.compact({
+ to_mail_ids: toMailIds,
+ cc_mail_ids: ccMailIds,
+ subject: propsValue.subject,
+ body: propsValue.body,
+ send_from_org_email_id: zohoInvoiceUtils.toOptionalBoolean({
+ value: propsValue.sendFromOrgEmailId,
+ }),
+ }),
+ });
+ },
+});
+
+function toEmailList({
+ value,
+ propName,
+}: {
+ value: unknown[] | undefined;
+ propName: string;
+}): string[] | undefined {
+ if (value === undefined) {
+ return undefined;
+ }
+ if (!value.every((email): email is string => typeof email === 'string' && email !== '')) {
+ throw new Error(`${propName} must be a list of email addresses.`);
+ }
+ return value;
+}
diff --git a/packages/pieces/community/zoho-invoice/src/lib/actions/ai/contacts/email-contact.ts b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/contacts/email-contact.ts
new file mode 100644
index 00000000000..930b69f9bbd
--- /dev/null
+++ b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/contacts/email-contact.ts
@@ -0,0 +1,65 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoInvoiceAuth } from '../../../auth';
+import { zohoInvoiceAiProps } from '../../../common/ai-props';
+import { zohoInvoiceApi } from '../../../common/api';
+import { zohoInvoiceUtils } from '../../../common/utils';
+import { zohoInvoiceMessageOutputSchema } from '../../../output-schemas';
+
+export const emailContactAction = createAction({
+ auth: zohoInvoiceAuth,
+ name: 'zoho_invoice_email_contact',
+ outputSchema: zohoInvoiceMessageOutputSchema,
+ displayName: 'Email Contact',
+ description: 'Sends an email to a customer contact.',
+ audience: 'ai',
+ classification: 'WRITE',
+ aiMetadata: {
+ description:
+ 'Sends a real email to a contact from Zoho Invoice, optionally with their statement PDF attached. Use List Contacts to find the contact ID. To send only a statement for a date range use Email Contact Statement. Not idempotent: each call sends another email.',
+ idempotent: false,
+ },
+ props: {
+ organizationId: zohoInvoiceAiProps.organizationId({ required: true }),
+ contactId: zohoInvoiceAiProps.contactId({ required: true }),
+ toMailIds: Property.Array({
+ displayName: 'To',
+ description: 'Recipient email addresses.',
+ required: true,
+ }),
+ subject: Property.ShortText({
+ displayName: 'Subject',
+ description: 'Email subject.',
+ required: true,
+ }),
+ body: Property.LongText({
+ displayName: 'Body',
+ description: 'Email body. HTML is allowed.',
+ required: true,
+ }),
+ sendCustomerStatement: zohoInvoiceAiProps.yesNo({
+ required: false,
+ displayName: 'Attach Statement',
+ description: "Attach the contact's statement PDF. Empty = no.",
+ }),
+ },
+ async run({ auth, propsValue }) {
+ const { toMailIds } = propsValue;
+ if (!toMailIds.every((email): email is string => typeof email === 'string' && email !== '')) {
+ throw new Error('To must be a list of email addresses.');
+ }
+ return await zohoInvoiceApi.emailContact({
+ auth,
+ organizationId: propsValue.organizationId,
+ contactId: propsValue.contactId,
+ sendCustomerStatement: zohoInvoiceUtils.toOptionalBoolean({
+ value: propsValue.sendCustomerStatement,
+ }),
+ body: {
+ to_mail_ids: toMailIds,
+ subject: propsValue.subject,
+ body: propsValue.body,
+ },
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-invoice/src/lib/actions/ai/contacts/enable-contact-payment-reminders.ts b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/contacts/enable-contact-payment-reminders.ts
new file mode 100644
index 00000000000..19b86e643ab
--- /dev/null
+++ b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/contacts/enable-contact-payment-reminders.ts
@@ -0,0 +1,32 @@
+import { createAction } from '@activepieces/pieces-framework';
+
+import { zohoInvoiceAuth } from '../../../auth';
+import { zohoInvoiceAiProps } from '../../../common/ai-props';
+import { zohoInvoiceApi } from '../../../common/api';
+import { zohoInvoiceMessageOutputSchema } from '../../../output-schemas';
+
+export const enableContactPaymentRemindersAction = createAction({
+ auth: zohoInvoiceAuth,
+ name: 'zoho_invoice_enable_contact_payment_reminders',
+ outputSchema: zohoInvoiceMessageOutputSchema,
+ displayName: 'Enable Contact Payment Reminders',
+ description: 'Turns on automated payment reminders for a customer contact.',
+ audience: 'ai',
+ classification: 'WRITE',
+ aiMetadata: {
+ description:
+ 'Turns on automated payment reminder emails for one contact, using the reminders configured in the organization. Use List Contacts to find the ID.',
+ idempotent: true,
+ },
+ props: {
+ organizationId: zohoInvoiceAiProps.organizationId({ required: true }),
+ contactId: zohoInvoiceAiProps.contactId({ required: true }),
+ },
+ async run({ auth, propsValue }) {
+ return await zohoInvoiceApi.enableContactPaymentReminders({
+ auth,
+ organizationId: propsValue.organizationId,
+ contactId: propsValue.contactId,
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-invoice/src/lib/actions/ai/contacts/enable-contact-portal-access.ts b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/contacts/enable-contact-portal-access.ts
new file mode 100644
index 00000000000..04634b25707
--- /dev/null
+++ b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/contacts/enable-contact-portal-access.ts
@@ -0,0 +1,45 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoInvoiceAuth } from '../../../auth';
+import { zohoInvoiceAiProps } from '../../../common/ai-props';
+import { zohoInvoiceApi } from '../../../common/api';
+import { zohoInvoiceMessageOutputSchema } from '../../../output-schemas';
+
+export const enableContactPortalAccessAction = createAction({
+ auth: zohoInvoiceAuth,
+ name: 'zoho_invoice_enable_contact_portal_access',
+ outputSchema: zohoInvoiceMessageOutputSchema,
+ displayName: 'Enable Contact Portal Access',
+ description: 'Gives contact persons access to the client portal.',
+ audience: 'ai',
+ classification: 'WRITE',
+ aiMetadata: {
+ description:
+ 'Enables client portal access for the given contact persons of a contact and sends each of them a real portal invitation email. Use List Contacts for the contact ID and List Contact Persons for the person IDs; each person needs an email address.',
+ idempotent: true,
+ },
+ props: {
+ organizationId: zohoInvoiceAiProps.organizationId({ required: true }),
+ contactId: zohoInvoiceAiProps.contactId({ required: true }),
+ contactPersonIds: Property.Array({
+ displayName: 'Contact Person IDs',
+ description: 'IDs of the contact persons to invite. Use List Contact Persons to find them.',
+ required: true,
+ }),
+ },
+ async run({ auth, propsValue }) {
+ const { contactPersonIds } = propsValue;
+ if (
+ contactPersonIds.length === 0 ||
+ !contactPersonIds.every((id): id is string => typeof id === 'string' && id !== '')
+ ) {
+ throw new Error('Contact Person IDs must be a non-empty list of contact person IDs.');
+ }
+ return await zohoInvoiceApi.enableContactPortalAccess({
+ auth,
+ organizationId: propsValue.organizationId,
+ contactId: propsValue.contactId,
+ contactPersonIds,
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-invoice/src/lib/actions/ai/contacts/get-contact-person.ts b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/contacts/get-contact-person.ts
new file mode 100644
index 00000000000..828d7236c93
--- /dev/null
+++ b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/contacts/get-contact-person.ts
@@ -0,0 +1,34 @@
+import { createAction } from '@activepieces/pieces-framework';
+
+import { zohoInvoiceAuth } from '../../../auth';
+import { zohoInvoiceAiProps } from '../../../common/ai-props';
+import { zohoInvoiceApi } from '../../../common/api';
+import { zohoInvoiceContactPersonOutputSchema } from '../../../output-schemas';
+
+export const getContactPersonAction = createAction({
+ auth: zohoInvoiceAuth,
+ name: 'zoho_invoice_get_contact_person',
+ outputSchema: zohoInvoiceContactPersonOutputSchema,
+ displayName: 'Get Contact Person',
+ description: 'Gets one contact person of a customer contact.',
+ audience: 'ai',
+ classification: 'READ',
+ aiMetadata: {
+ description:
+ 'Returns one contact person by ID: name, email, phones, job and portal status. Use List Contacts for the contact ID and List Contact Persons for the person ID.',
+ idempotent: true,
+ },
+ props: {
+ organizationId: zohoInvoiceAiProps.organizationId({ required: true }),
+ contactId: zohoInvoiceAiProps.contactId({ required: true }),
+ contactPersonId: zohoInvoiceAiProps.contactPersonId({ required: true }),
+ },
+ async run({ auth, propsValue }) {
+ return await zohoInvoiceApi.getContactPerson({
+ auth,
+ organizationId: propsValue.organizationId,
+ contactId: propsValue.contactId,
+ contactPersonId: propsValue.contactPersonId,
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-invoice/src/lib/actions/ai/contacts/get-contact-statement-email-content.ts b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/contacts/get-contact-statement-email-content.ts
new file mode 100644
index 00000000000..72d2bd87930
--- /dev/null
+++ b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/contacts/get-contact-statement-email-content.ts
@@ -0,0 +1,45 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoInvoiceAuth } from '../../../auth';
+import { zohoInvoiceAiProps } from '../../../common/ai-props';
+import { zohoInvoiceApi } from '../../../common/api';
+import { zohoInvoiceGetContactStatementEmailContentOutputSchema } from '../../../output-schemas';
+
+export const getContactStatementEmailContentAction = createAction({
+ auth: zohoInvoiceAuth,
+ name: 'zoho_invoice_get_contact_statement_email_content',
+ outputSchema: zohoInvoiceGetContactStatementEmailContentOutputSchema,
+ displayName: 'Get Contact Statement Email Content',
+ description: 'Gets the default email content for a customer statement.',
+ audience: 'ai',
+ classification: 'READ',
+ aiMetadata: {
+ description:
+ "Returns the default subject, body, sender options and recipients Zoho would use to email a contact's statement for a date range, without sending anything. Use it before Email Contact Statement. Use List Contacts to find the contact ID.",
+ idempotent: true,
+ },
+ props: {
+ organizationId: zohoInvoiceAiProps.organizationId({ required: true }),
+ contactId: zohoInvoiceAiProps.contactId({ required: true }),
+ startDate: Property.ShortText({
+ displayName: 'Start Date',
+ description:
+ 'Statement start date, yyyy-mm-dd. Empty with End Date empty = the current month.',
+ required: false,
+ }),
+ endDate: Property.ShortText({
+ displayName: 'End Date',
+ description: 'Statement end date, yyyy-mm-dd.',
+ required: false,
+ }),
+ },
+ async run({ auth, propsValue }) {
+ return await zohoInvoiceApi.getContactStatementEmailContent({
+ auth,
+ organizationId: propsValue.organizationId,
+ contactId: propsValue.contactId,
+ startDate: propsValue.startDate,
+ endDate: propsValue.endDate,
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-invoice/src/lib/actions/ai/contacts/get-contact.ts b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/contacts/get-contact.ts
new file mode 100644
index 00000000000..09b19db67c4
--- /dev/null
+++ b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/contacts/get-contact.ts
@@ -0,0 +1,32 @@
+import { createAction } from '@activepieces/pieces-framework';
+
+import { zohoInvoiceAuth } from '../../../auth';
+import { zohoInvoiceAiProps } from '../../../common/ai-props';
+import { zohoInvoiceApi } from '../../../common/api';
+import { zohoInvoiceContactOutputSchema } from '../../../output-schemas';
+
+export const getContactAction = createAction({
+ auth: zohoInvoiceAuth,
+ name: 'zoho_invoice_get_contact',
+ outputSchema: zohoInvoiceContactOutputSchema,
+ displayName: 'Get Contact',
+ description: 'Gets one customer contact by ID.',
+ audience: 'ai',
+ classification: 'READ',
+ aiMetadata: {
+ description:
+ 'Returns one contact by ID with its addresses, contact persons, currency, payment terms and balances. Use List Contacts to find the ID.',
+ idempotent: true,
+ },
+ props: {
+ organizationId: zohoInvoiceAiProps.organizationId({ required: true }),
+ contactId: zohoInvoiceAiProps.contactId({ required: true }),
+ },
+ async run({ auth, propsValue }) {
+ return await zohoInvoiceApi.getContact({
+ auth,
+ organizationId: propsValue.organizationId,
+ contactId: propsValue.contactId,
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-invoice/src/lib/actions/ai/contacts/list-contact-addresses.ts b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/contacts/list-contact-addresses.ts
new file mode 100644
index 00000000000..7950e35bb5b
--- /dev/null
+++ b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/contacts/list-contact-addresses.ts
@@ -0,0 +1,32 @@
+import { createAction } from '@activepieces/pieces-framework';
+
+import { zohoInvoiceAuth } from '../../../auth';
+import { zohoInvoiceAiProps } from '../../../common/ai-props';
+import { zohoInvoiceApi } from '../../../common/api';
+import { zohoInvoiceListContactAddressesOutputSchema } from '../../../output-schemas';
+
+export const listContactAddressesAction = createAction({
+ auth: zohoInvoiceAuth,
+ name: 'zoho_invoice_list_contact_addresses',
+ outputSchema: zohoInvoiceListContactAddressesOutputSchema,
+ displayName: 'List Contact Addresses',
+ description: 'Lists the additional addresses of a customer contact.',
+ audience: 'ai',
+ classification: 'SEARCH',
+ aiMetadata: {
+ description:
+ 'Lists the additional addresses of a contact with their address_id, needed by Update Contact Address and Delete Contact Address. Use List Contacts to find the contact ID.',
+ idempotent: true,
+ },
+ props: {
+ organizationId: zohoInvoiceAiProps.organizationId({ required: true }),
+ contactId: zohoInvoiceAiProps.contactId({ required: true }),
+ },
+ async run({ auth, propsValue }) {
+ return await zohoInvoiceApi.listContactAddresses({
+ auth,
+ organizationId: propsValue.organizationId,
+ contactId: propsValue.contactId,
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-invoice/src/lib/actions/ai/contacts/list-contact-comments.ts b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/contacts/list-contact-comments.ts
new file mode 100644
index 00000000000..b7d7cd1cad8
--- /dev/null
+++ b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/contacts/list-contact-comments.ts
@@ -0,0 +1,36 @@
+import { createAction } from '@activepieces/pieces-framework';
+
+import { zohoInvoiceAuth } from '../../../auth';
+import { zohoInvoiceAiProps } from '../../../common/ai-props';
+import { zohoInvoiceApi } from '../../../common/api';
+import { zohoInvoiceListContactCommentsOutputSchema } from '../../../output-schemas';
+
+export const listContactCommentsAction = createAction({
+ auth: zohoInvoiceAuth,
+ name: 'zoho_invoice_list_contact_comments',
+ outputSchema: zohoInvoiceListContactCommentsOutputSchema,
+ displayName: 'List Contact Comments',
+ description: 'Lists the comments and history of a customer contact.',
+ audience: 'ai',
+ classification: 'SEARCH',
+ aiMetadata: {
+ description:
+ 'Lists the comments and activity history recorded on a contact, one page at a time. Use List Contacts to find the contact ID.',
+ idempotent: true,
+ },
+ props: {
+ organizationId: zohoInvoiceAiProps.organizationId({ required: true }),
+ contactId: zohoInvoiceAiProps.contactId({ required: true }),
+ page: zohoInvoiceAiProps.page({ required: false }),
+ perPage: zohoInvoiceAiProps.perPage({ required: false }),
+ },
+ async run({ auth, propsValue }) {
+ return await zohoInvoiceApi.listContactComments({
+ auth,
+ organizationId: propsValue.organizationId,
+ contactId: propsValue.contactId,
+ page: propsValue.page,
+ perPage: propsValue.perPage,
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-invoice/src/lib/actions/ai/contacts/list-contact-persons.ts b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/contacts/list-contact-persons.ts
new file mode 100644
index 00000000000..d21a40670aa
--- /dev/null
+++ b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/contacts/list-contact-persons.ts
@@ -0,0 +1,36 @@
+import { createAction } from '@activepieces/pieces-framework';
+
+import { zohoInvoiceAuth } from '../../../auth';
+import { zohoInvoiceAiProps } from '../../../common/ai-props';
+import { zohoInvoiceApi } from '../../../common/api';
+import { zohoInvoiceListContactPersonsOutputSchema } from '../../../output-schemas';
+
+export const listContactPersonsAction = createAction({
+ auth: zohoInvoiceAuth,
+ name: 'zoho_invoice_list_contact_persons',
+ outputSchema: zohoInvoiceListContactPersonsOutputSchema,
+ displayName: 'List Contact Persons',
+ description: 'Lists the contact persons of a customer contact.',
+ audience: 'ai',
+ classification: 'SEARCH',
+ aiMetadata: {
+ description:
+ 'Lists the people of one contact with their contact_person_id, name, email, phone and primary flag, one page at a time. Use List Contacts to find the contact ID.',
+ idempotent: true,
+ },
+ props: {
+ organizationId: zohoInvoiceAiProps.organizationId({ required: true }),
+ contactId: zohoInvoiceAiProps.contactId({ required: true }),
+ page: zohoInvoiceAiProps.page({ required: false }),
+ perPage: zohoInvoiceAiProps.perPage({ required: false }),
+ },
+ async run({ auth, propsValue }) {
+ return await zohoInvoiceApi.listContactPersons({
+ auth,
+ organizationId: propsValue.organizationId,
+ contactId: propsValue.contactId,
+ page: propsValue.page,
+ perPage: propsValue.perPage,
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-invoice/src/lib/actions/ai/contacts/list-contact-refunds.ts b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/contacts/list-contact-refunds.ts
new file mode 100644
index 00000000000..3f0010e17fd
--- /dev/null
+++ b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/contacts/list-contact-refunds.ts
@@ -0,0 +1,36 @@
+import { createAction } from '@activepieces/pieces-framework';
+
+import { zohoInvoiceAuth } from '../../../auth';
+import { zohoInvoiceAiProps } from '../../../common/ai-props';
+import { zohoInvoiceApi } from '../../../common/api';
+import { zohoInvoiceListContactRefundsOutputSchema } from '../../../output-schemas';
+
+export const listContactRefundsAction = createAction({
+ auth: zohoInvoiceAuth,
+ name: 'zoho_invoice_list_contact_refunds',
+ outputSchema: zohoInvoiceListContactRefundsOutputSchema,
+ displayName: 'List Contact Refunds',
+ description: 'Lists the credit note refunds of a customer contact.',
+ audience: 'ai',
+ classification: 'SEARCH',
+ aiMetadata: {
+ description:
+ 'Lists the credit note refunds made to one contact, one page at a time. Use List Contacts to find the contact ID; for refunds of one credit note use List Credit Note Refunds.',
+ idempotent: true,
+ },
+ props: {
+ organizationId: zohoInvoiceAiProps.organizationId({ required: true }),
+ contactId: zohoInvoiceAiProps.contactId({ required: true }),
+ page: zohoInvoiceAiProps.page({ required: false }),
+ perPage: zohoInvoiceAiProps.perPage({ required: false }),
+ },
+ async run({ auth, propsValue }) {
+ return await zohoInvoiceApi.listContactRefunds({
+ auth,
+ organizationId: propsValue.organizationId,
+ contactId: propsValue.contactId,
+ page: propsValue.page,
+ perPage: propsValue.perPage,
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-invoice/src/lib/actions/ai/contacts/list-contacts.ts b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/contacts/list-contacts.ts
new file mode 100644
index 00000000000..aa6a728bb48
--- /dev/null
+++ b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/contacts/list-contacts.ts
@@ -0,0 +1,85 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoInvoiceAuth } from '../../../auth';
+import { zohoInvoiceAiProps } from '../../../common/ai-props';
+import { zohoInvoiceApi } from '../../../common/api';
+import { zohoInvoiceListContactsOutputSchema } from '../../../output-schemas';
+
+export const listContactsAction = createAction({
+ auth: zohoInvoiceAuth,
+ name: 'zoho_invoice_list_contacts',
+ outputSchema: zohoInvoiceListContactsOutputSchema,
+ displayName: 'List Contacts',
+ description: 'Lists or searches the customer contacts of a Zoho Invoice organization.',
+ audience: 'ai',
+ classification: 'SEARCH',
+ aiMetadata: {
+ description:
+ 'Lists customer contacts with contact_id, name, company, email and outstanding amounts, one page at a time. Filter by status, name, company, email or phone, or search by name and notes. Use it to find the contact_id other actions need.',
+ idempotent: true,
+ },
+ props: {
+ organizationId: zohoInvoiceAiProps.organizationId({ required: true }),
+ filterBy: Property.StaticDropdown({
+ displayName: 'Status',
+ description: 'Only contacts with this status. Empty = all contacts.',
+ required: false,
+ options: {
+ disabled: false,
+ options: [
+ { label: 'All', value: 'Status.All' },
+ { label: 'Active', value: 'Status.Active' },
+ { label: 'Inactive', value: 'Status.Inactive' },
+ { label: 'Duplicate', value: 'Status.Duplicate' },
+ { label: 'CRM', value: 'Status.Crm' },
+ ],
+ },
+ }),
+ searchText: zohoInvoiceAiProps.searchText({
+ required: false,
+ description: 'Free-text search across contact name and notes.',
+ }),
+ contactName: Property.ShortText({
+ displayName: 'Contact Name',
+ description: 'Only contacts with this name.',
+ required: false,
+ }),
+ companyName: Property.ShortText({
+ displayName: 'Company Name',
+ description: 'Only contacts with this company name.',
+ required: false,
+ }),
+ email: Property.ShortText({
+ displayName: 'Email',
+ description: 'Only contacts with a contact person with this email.',
+ required: false,
+ }),
+ phone: Property.ShortText({
+ displayName: 'Phone',
+ description: 'Only contacts with a contact person with this phone number.',
+ required: false,
+ }),
+ sortColumn: zohoInvoiceAiProps.sortColumn({
+ required: false,
+ description:
+ 'Field to sort by: contact_name, first_name, last_name, email, outstanding_receivable_amount, created_time or last_modified_time.',
+ }),
+ page: zohoInvoiceAiProps.page({ required: false }),
+ perPage: zohoInvoiceAiProps.perPage({ required: false }),
+ },
+ async run({ auth, propsValue }) {
+ return await zohoInvoiceApi.listContacts({
+ auth,
+ organizationId: propsValue.organizationId,
+ contactName: propsValue.contactName,
+ companyName: propsValue.companyName,
+ email: propsValue.email,
+ phone: propsValue.phone,
+ filterBy: propsValue.filterBy,
+ searchText: propsValue.searchText,
+ sortColumn: propsValue.sortColumn,
+ page: propsValue.page,
+ perPage: propsValue.perPage,
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-invoice/src/lib/actions/ai/contacts/mark-contact-active.ts b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/contacts/mark-contact-active.ts
new file mode 100644
index 00000000000..9e725c0df55
--- /dev/null
+++ b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/contacts/mark-contact-active.ts
@@ -0,0 +1,32 @@
+import { createAction } from '@activepieces/pieces-framework';
+
+import { zohoInvoiceAuth } from '../../../auth';
+import { zohoInvoiceAiProps } from '../../../common/ai-props';
+import { zohoInvoiceApi } from '../../../common/api';
+import { zohoInvoiceMessageOutputSchema } from '../../../output-schemas';
+
+export const markContactActiveAction = createAction({
+ auth: zohoInvoiceAuth,
+ name: 'zoho_invoice_mark_contact_active',
+ outputSchema: zohoInvoiceMessageOutputSchema,
+ displayName: 'Mark Contact Active',
+ description: 'Marks a customer contact as active.',
+ audience: 'ai',
+ classification: 'WRITE',
+ aiMetadata: {
+ description:
+ 'Reactivates an inactive contact so it can be used on new transactions again. Use List Contacts to find the ID.',
+ idempotent: true,
+ },
+ props: {
+ organizationId: zohoInvoiceAiProps.organizationId({ required: true }),
+ contactId: zohoInvoiceAiProps.contactId({ required: true }),
+ },
+ async run({ auth, propsValue }) {
+ return await zohoInvoiceApi.markContactActive({
+ auth,
+ organizationId: propsValue.organizationId,
+ contactId: propsValue.contactId,
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-invoice/src/lib/actions/ai/contacts/mark-contact-inactive.ts b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/contacts/mark-contact-inactive.ts
new file mode 100644
index 00000000000..3cdf2c0c01d
--- /dev/null
+++ b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/contacts/mark-contact-inactive.ts
@@ -0,0 +1,32 @@
+import { createAction } from '@activepieces/pieces-framework';
+
+import { zohoInvoiceAuth } from '../../../auth';
+import { zohoInvoiceAiProps } from '../../../common/ai-props';
+import { zohoInvoiceApi } from '../../../common/api';
+import { zohoInvoiceMessageOutputSchema } from '../../../output-schemas';
+
+export const markContactInactiveAction = createAction({
+ auth: zohoInvoiceAuth,
+ name: 'zoho_invoice_mark_contact_inactive',
+ outputSchema: zohoInvoiceMessageOutputSchema,
+ displayName: 'Mark Contact Inactive',
+ description: 'Marks a customer contact as inactive.',
+ audience: 'ai',
+ classification: 'WRITE',
+ aiMetadata: {
+ description:
+ 'Deactivates a contact so it is hidden from new transactions while keeping its history; reversible with Mark Contact Active. Use List Contacts to find the ID.',
+ idempotent: true,
+ },
+ props: {
+ organizationId: zohoInvoiceAiProps.organizationId({ required: true }),
+ contactId: zohoInvoiceAiProps.contactId({ required: true }),
+ },
+ async run({ auth, propsValue }) {
+ return await zohoInvoiceApi.markContactInactive({
+ auth,
+ organizationId: propsValue.organizationId,
+ contactId: propsValue.contactId,
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-invoice/src/lib/actions/ai/contacts/mark-contact-person-primary.ts b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/contacts/mark-contact-person-primary.ts
new file mode 100644
index 00000000000..76949830b50
--- /dev/null
+++ b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/contacts/mark-contact-person-primary.ts
@@ -0,0 +1,32 @@
+import { createAction } from '@activepieces/pieces-framework';
+
+import { zohoInvoiceAuth } from '../../../auth';
+import { zohoInvoiceAiProps } from '../../../common/ai-props';
+import { zohoInvoiceApi } from '../../../common/api';
+import { zohoInvoiceMessageOutputSchema } from '../../../output-schemas';
+
+export const markContactPersonPrimaryAction = createAction({
+ auth: zohoInvoiceAuth,
+ name: 'zoho_invoice_mark_contact_person_primary',
+ outputSchema: zohoInvoiceMessageOutputSchema,
+ displayName: 'Mark Contact Person Primary',
+ description: 'Makes a contact person the primary person of their contact.',
+ audience: 'ai',
+ classification: 'WRITE',
+ aiMetadata: {
+ description:
+ 'Makes one contact person the primary person of their contact; the previous primary person stays as a regular contact person. Use List Contact Persons to find the ID.',
+ idempotent: true,
+ },
+ props: {
+ organizationId: zohoInvoiceAiProps.organizationId({ required: true }),
+ contactPersonId: zohoInvoiceAiProps.contactPersonId({ required: true }),
+ },
+ async run({ auth, propsValue }) {
+ return await zohoInvoiceApi.markContactPersonPrimary({
+ auth,
+ organizationId: propsValue.organizationId,
+ contactPersonId: propsValue.contactPersonId,
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-invoice/src/lib/actions/ai/contacts/update-contact-address.ts b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/contacts/update-contact-address.ts
new file mode 100644
index 00000000000..343a03aa506
--- /dev/null
+++ b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/contacts/update-contact-address.ts
@@ -0,0 +1,95 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoInvoiceAuth } from '../../../auth';
+import { zohoInvoiceAiProps } from '../../../common/ai-props';
+import { zohoInvoiceApi } from '../../../common/api';
+import { zohoInvoiceUtils } from '../../../common/utils';
+import { zohoInvoiceAddressInfoOutputSchema } from '../../../output-schemas';
+
+export const updateContactAddressAction = createAction({
+ auth: zohoInvoiceAuth,
+ name: 'zoho_invoice_update_contact_address',
+ outputSchema: zohoInvoiceAddressInfoOutputSchema,
+ displayName: 'Update Contact Address',
+ description: 'Changes an additional address of a customer contact.',
+ audience: 'ai',
+ classification: 'WRITE',
+ aiMetadata: {
+ description:
+ 'Changes the fields you set on one additional address of a contact; fields left empty keep their current value. Use List Contact Addresses to find the address ID. For the billing or shipping address use Update Contact.',
+ idempotent: true,
+ },
+ props: {
+ organizationId: zohoInvoiceAiProps.organizationId({ required: true }),
+ contactId: zohoInvoiceAiProps.contactId({ required: true }),
+ addressId: zohoInvoiceAiProps.idProp({
+ required: true,
+ displayName: 'Address ID',
+ description: 'Additional address ID. Use List Contact Addresses to find it.',
+ }),
+ attention: Property.ShortText({
+ displayName: 'Attention',
+ description: 'Name of the person the address is for. Empty = unchanged.',
+ required: false,
+ }),
+ address: Property.ShortText({
+ displayName: 'Street',
+ description: 'Street address, first line. Empty = unchanged.',
+ required: false,
+ }),
+ street2: Property.ShortText({
+ displayName: 'Street 2',
+ description: 'Street address, second line. Empty = unchanged.',
+ required: false,
+ }),
+ city: Property.ShortText({
+ displayName: 'City',
+ description: 'City. Empty = unchanged.',
+ required: false,
+ }),
+ state: Property.ShortText({
+ displayName: 'State',
+ description: 'State or region. Empty = unchanged.',
+ required: false,
+ }),
+ zip: Property.ShortText({
+ displayName: 'ZIP Code',
+ description: 'Postal code. Empty = unchanged.',
+ required: false,
+ }),
+ country: Property.ShortText({
+ displayName: 'Country',
+ description: 'Country name. Empty = unchanged.',
+ required: false,
+ }),
+ phone: Property.ShortText({
+ displayName: 'Phone',
+ description: 'Phone number. Empty = unchanged.',
+ required: false,
+ }),
+ fax: Property.ShortText({
+ displayName: 'Fax',
+ description: 'Fax number. Empty = unchanged.',
+ required: false,
+ }),
+ },
+ async run({ auth, propsValue }) {
+ return await zohoInvoiceApi.updateContactAddress({
+ auth,
+ organizationId: propsValue.organizationId,
+ contactId: propsValue.contactId,
+ addressId: propsValue.addressId,
+ body: zohoInvoiceUtils.compact({
+ attention: propsValue.attention,
+ address: propsValue.address,
+ street2: propsValue.street2,
+ city: propsValue.city,
+ state: propsValue.state,
+ zip: propsValue.zip,
+ country: propsValue.country,
+ phone: propsValue.phone,
+ fax: propsValue.fax,
+ }),
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-invoice/src/lib/actions/ai/contacts/update-contact-person.ts b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/contacts/update-contact-person.ts
new file mode 100644
index 00000000000..ffb8b9f0594
--- /dev/null
+++ b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/contacts/update-contact-person.ts
@@ -0,0 +1,106 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoInvoiceAuth } from '../../../auth';
+import { zohoInvoiceAiProps } from '../../../common/ai-props';
+import { zohoInvoiceApi } from '../../../common/api';
+import { zohoInvoiceUtils } from '../../../common/utils';
+import { zohoInvoiceContactPersonOutputSchema } from '../../../output-schemas';
+
+export const updateContactPersonAction = createAction({
+ auth: zohoInvoiceAuth,
+ name: 'zoho_invoice_update_contact_person',
+ outputSchema: zohoInvoiceContactPersonOutputSchema,
+ displayName: 'Update Contact Person',
+ description: "Changes a contact person's details.",
+ audience: 'ai',
+ classification: 'WRITE',
+ aiMetadata: {
+ description:
+ 'Changes the fields you set on a contact person; fields left empty keep their current value. Use List Contacts for the contact ID and List Contact Persons for the person ID. Enabling portal access sends a real invitation email.',
+ idempotent: true,
+ },
+ props: {
+ organizationId: zohoInvoiceAiProps.organizationId({ required: true }),
+ contactId: zohoInvoiceAiProps.contactId({ required: true }),
+ contactPersonId: zohoInvoiceAiProps.contactPersonId({ required: true }),
+ firstName: Property.ShortText({
+ displayName: 'First Name',
+ description: 'First name. Empty = unchanged.',
+ required: false,
+ }),
+ salutation: Property.ShortText({
+ displayName: 'Salutation',
+ description: 'Salutation, e.g. Mr. or Ms. Empty = unchanged.',
+ required: false,
+ }),
+ lastName: Property.ShortText({
+ displayName: 'Last Name',
+ description: 'Last name. Empty = unchanged.',
+ required: false,
+ }),
+ email: Property.ShortText({
+ displayName: 'Email',
+ description: 'Email address. Empty = unchanged.',
+ required: false,
+ }),
+ phone: Property.ShortText({
+ displayName: 'Phone',
+ description: 'Work phone number. Empty = unchanged.',
+ required: false,
+ }),
+ mobile: Property.ShortText({
+ displayName: 'Mobile',
+ description: 'Mobile phone number. Empty = unchanged.',
+ required: false,
+ }),
+ skype: Property.ShortText({
+ displayName: 'Skype',
+ description: 'Skype ID. Empty = unchanged.',
+ required: false,
+ }),
+ designation: Property.ShortText({
+ displayName: 'Designation',
+ description: 'Job title. Empty = unchanged.',
+ required: false,
+ }),
+ department: Property.ShortText({
+ displayName: 'Department',
+ description: 'Department. Empty = unchanged.',
+ required: false,
+ }),
+ enablePortal: zohoInvoiceAiProps.yesNo({
+ required: false,
+ displayName: 'Enable Portal',
+ description:
+ 'Turn client portal access on or off. Yes emails an invitation. Empty = unchanged.',
+ }),
+ },
+ async run({ auth, propsValue }) {
+ const { organizationId, contactId, contactPersonId } = propsValue;
+ const current = await zohoInvoiceApi.getContactPerson({
+ auth,
+ organizationId,
+ contactId,
+ contactPersonId,
+ });
+ const person = current.contact_person;
+ return await zohoInvoiceApi.updateContactPerson({
+ auth,
+ organizationId,
+ contactPersonId,
+ body: zohoInvoiceUtils.compact({
+ contact_id: contactId,
+ first_name: propsValue.firstName ?? person?.first_name,
+ salutation: propsValue.salutation ?? person?.salutation,
+ last_name: propsValue.lastName ?? person?.last_name,
+ email: propsValue.email ?? person?.email,
+ phone: propsValue.phone ?? person?.phone,
+ mobile: propsValue.mobile ?? person?.mobile,
+ skype: propsValue.skype ?? person?.skype,
+ designation: propsValue.designation ?? person?.designation,
+ department: propsValue.department ?? person?.department,
+ enable_portal: zohoInvoiceUtils.toOptionalBoolean({ value: propsValue.enablePortal }),
+ }),
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-invoice/src/lib/actions/ai/contacts/update-contact.ts b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/contacts/update-contact.ts
new file mode 100644
index 00000000000..be9a02ef54e
--- /dev/null
+++ b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/contacts/update-contact.ts
@@ -0,0 +1,91 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoInvoiceAuth } from '../../../auth';
+import { zohoInvoiceAiProps } from '../../../common/ai-props';
+import { zohoInvoiceApi } from '../../../common/api';
+import { zohoInvoiceUtils } from '../../../common/utils';
+import { zohoInvoiceContactOutputSchema } from '../../../output-schemas';
+
+export const updateContactAction = createAction({
+ auth: zohoInvoiceAuth,
+ name: 'zoho_invoice_update_contact',
+ outputSchema: zohoInvoiceContactOutputSchema,
+ displayName: 'Update Contact',
+ description: "Changes a customer contact's details.",
+ audience: 'ai',
+ classification: 'WRITE',
+ aiMetadata: {
+ description:
+ 'Changes the fields you set on a contact; fields left empty keep their current value. Use List Contacts to find the ID. To change contact persons use Update Contact Person, and for extra addresses use Update Contact Address.',
+ idempotent: true,
+ },
+ props: {
+ organizationId: zohoInvoiceAiProps.organizationId({ required: true }),
+ contactId: zohoInvoiceAiProps.contactId({ required: true }),
+ contactName: Property.ShortText({
+ displayName: 'Contact Name',
+ description: 'New display name. Empty = unchanged.',
+ required: false,
+ }),
+ companyName: Property.ShortText({
+ displayName: 'Company Name',
+ description: 'New company name. Empty = unchanged.',
+ required: false,
+ }),
+ currencyId: zohoInvoiceAiProps.currencyId({
+ required: false,
+ description: 'New currency ID. Use List Currencies to find it. Empty = unchanged.',
+ }),
+ paymentTerms: Property.Number({
+ displayName: 'Payment Terms',
+ description: 'New net payment terms in days. Empty = unchanged.',
+ required: false,
+ }),
+ website: Property.ShortText({
+ displayName: 'Website',
+ description: 'New website. Empty = unchanged.',
+ required: false,
+ }),
+ notes: Property.LongText({
+ displayName: 'Notes',
+ description: 'New internal notes. Empty = unchanged.',
+ required: false,
+ }),
+ billingAddress: Property.Json({
+ displayName: 'Billing Address',
+ description:
+ 'New billing address as a JSON object with keys attention, address, street2, city, state, zip, country, fax, phone. Empty = unchanged.',
+ required: false,
+ }),
+ shippingAddress: Property.Json({
+ displayName: 'Shipping Address',
+ description:
+ 'New shipping address as a JSON object with keys attention, address, street2, city, state, zip, country, fax, phone. Empty = unchanged.',
+ required: false,
+ }),
+ additionalFields: zohoInvoiceAiProps.additionalFields({ required: false }),
+ },
+ async run({ auth, propsValue }) {
+ const { organizationId, contactId } = propsValue;
+ const current = await zohoInvoiceApi.getContact({ auth, organizationId, contactId });
+ return await zohoInvoiceApi.updateContact({
+ auth,
+ organizationId,
+ contactId,
+ body: {
+ ...zohoInvoiceUtils.compact({ contact_name: current.contact?.contact_name }),
+ ...(propsValue.additionalFields ?? {}),
+ ...zohoInvoiceUtils.compact({
+ contact_name: propsValue.contactName,
+ company_name: propsValue.companyName,
+ currency_id: propsValue.currencyId,
+ payment_terms: propsValue.paymentTerms,
+ website: propsValue.website,
+ notes: propsValue.notes,
+ billing_address: propsValue.billingAddress,
+ shipping_address: propsValue.shippingAddress,
+ }),
+ },
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-invoice/src/lib/actions/ai/credit-notes/add-credit-note-comment.ts b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/credit-notes/add-credit-note-comment.ts
new file mode 100644
index 00000000000..11356eee8e0
--- /dev/null
+++ b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/credit-notes/add-credit-note-comment.ts
@@ -0,0 +1,38 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoInvoiceAuth } from '../../../auth';
+import { zohoInvoiceAiProps } from '../../../common/ai-props';
+import { zohoInvoiceApi } from '../../../common/api';
+import { zohoInvoiceAddCreditNoteCommentOutputSchema } from '../../../output-schemas';
+
+export const addCreditNoteCommentAction = createAction({
+ auth: zohoInvoiceAuth,
+ name: 'zoho_invoice_add_credit_note_comment',
+ outputSchema: zohoInvoiceAddCreditNoteCommentOutputSchema,
+ displayName: 'Add Credit Note Comment',
+ description: 'Adds a comment to a credit note.',
+ audience: 'ai',
+ classification: 'WRITE',
+ aiMetadata: {
+ description:
+ "Adds an internal comment to a credit note's history. Use List Credit Notes to find the ID. Not idempotent: repeating the call adds the comment again.",
+ idempotent: false,
+ },
+ props: {
+ organizationId: zohoInvoiceAiProps.organizationId({ required: true }),
+ creditNoteId: zohoInvoiceAiProps.creditNoteId({ required: true }),
+ description: Property.LongText({
+ displayName: 'Comment',
+ description: 'Comment text.',
+ required: true,
+ }),
+ },
+ async run({ auth, propsValue }) {
+ return await zohoInvoiceApi.addCreditNoteComment({
+ auth,
+ organizationId: propsValue.organizationId,
+ creditNoteId: propsValue.creditNoteId,
+ description: propsValue.description,
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-invoice/src/lib/actions/ai/credit-notes/apply-credit-note-to-invoices.ts b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/credit-notes/apply-credit-note-to-invoices.ts
new file mode 100644
index 00000000000..3b325be06c9
--- /dev/null
+++ b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/credit-notes/apply-credit-note-to-invoices.ts
@@ -0,0 +1,56 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoInvoiceAuth } from '../../../auth';
+import { zohoInvoiceAiProps } from '../../../common/ai-props';
+import { zohoInvoiceApi } from '../../../common/api';
+import { zohoInvoiceUtils } from '../../../common/utils';
+import { zohoInvoiceApplyCreditNoteToInvoicesOutputSchema } from '../../../output-schemas';
+
+export const applyCreditNoteToInvoicesAction = createAction({
+ auth: zohoInvoiceAuth,
+ name: 'zoho_invoice_apply_credit_note_to_invoices',
+ outputSchema: zohoInvoiceApplyCreditNoteToInvoicesOutputSchema,
+ displayName: 'Apply Credit Note to Invoices',
+ description: "Applies a credit note's credit to one or more invoices.",
+ audience: 'ai',
+ classification: 'WRITE',
+ aiMetadata: {
+ description:
+ "Applies part or all of a credit note's open balance to unpaid invoices of the same customer. Use List Credit Notes for the credit note ID and List Invoices for the invoice IDs. Not idempotent: repeating the call applies the credit again.",
+ idempotent: false,
+ },
+ props: {
+ organizationId: zohoInvoiceAiProps.organizationId({ required: true }),
+ creditNoteId: zohoInvoiceAiProps.creditNoteId({ required: true }),
+ invoices: Property.Array({
+ displayName: 'Invoices',
+ description: 'Invoices to credit and the amount to apply to each.',
+ required: true,
+ properties: {
+ invoiceId: zohoInvoiceAiProps.invoiceId({ required: true }),
+ amountApplied: Property.Number({
+ displayName: 'Amount Applied',
+ description: 'Credit amount to apply to this invoice.',
+ required: true,
+ }),
+ },
+ }),
+ },
+ async run({ auth, propsValue }) {
+ return await zohoInvoiceApi.applyCreditNoteToInvoices({
+ auth,
+ organizationId: propsValue.organizationId,
+ creditNoteId: propsValue.creditNoteId,
+ body: {
+ invoices: zohoInvoiceUtils
+ .toRecords({ rows: propsValue.invoices, propName: 'Invoices' })
+ .map((invoice) =>
+ zohoInvoiceUtils.compact({
+ invoice_id: invoice['invoiceId'],
+ amount_applied: invoice['amountApplied'],
+ }),
+ ),
+ },
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-invoice/src/lib/actions/ai/credit-notes/create-credit-note.ts b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/credit-notes/create-credit-note.ts
new file mode 100644
index 00000000000..10b206a4b00
--- /dev/null
+++ b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/credit-notes/create-credit-note.ts
@@ -0,0 +1,113 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoInvoiceAuth } from '../../../auth';
+import { zohoInvoiceAiProps } from '../../../common/ai-props';
+import { zohoInvoiceApi } from '../../../common/api';
+import { zohoInvoiceUtils } from '../../../common/utils';
+import { zohoInvoiceCreditNoteOutputSchema } from '../../../output-schemas';
+
+export const createCreditNoteAction = createAction({
+ auth: zohoInvoiceAuth,
+ name: 'zoho_invoice_create_credit_note',
+ outputSchema: zohoInvoiceCreditNoteOutputSchema,
+ displayName: 'Create Credit Note',
+ description: 'Creates a credit note for a customer.',
+ audience: 'ai',
+ classification: 'WRITE',
+ aiMetadata: {
+ description:
+ 'Creates a credit note for a customer with one or more line items, optionally raised against an invoice. Use List Contacts for the customer ID and List Invoices for the invoice ID. Not idempotent: each call creates a new credit note.',
+ idempotent: false,
+ },
+ props: {
+ organizationId: zohoInvoiceAiProps.organizationId({ required: true }),
+ customerId: zohoInvoiceAiProps.contactId({ required: true, displayName: 'Customer ID' }),
+ date: Property.ShortText({
+ displayName: 'Date',
+ description: 'Credit note date, yyyy-mm-dd.',
+ required: true,
+ }),
+ lineItems: Property.Array({
+ displayName: 'Line Items',
+ description: 'Items being credited.',
+ required: true,
+ properties: {
+ itemId: zohoInvoiceAiProps.itemId({ required: false }),
+ name: Property.ShortText({
+ displayName: 'Name',
+ description: 'Line name. Empty = the item name.',
+ required: false,
+ }),
+ description: Property.ShortText({
+ displayName: 'Description',
+ description: 'Line description.',
+ required: false,
+ }),
+ rate: Property.Number({
+ displayName: 'Rate',
+ description: 'Unit price. Empty = the item rate.',
+ required: false,
+ }),
+ quantity: Property.Number({
+ displayName: 'Quantity',
+ description: 'Quantity. Empty = 1.',
+ required: false,
+ }),
+ taxId: zohoInvoiceAiProps.taxId({ required: false }),
+ },
+ }),
+ creditNoteNumber: Property.ShortText({
+ displayName: 'Credit Note Number',
+ description:
+ 'Credit note number. Needed only when auto-numbering is off or Ignore Auto Number Generation is Yes.',
+ required: false,
+ }),
+ ignoreAutoNumberGeneration: zohoInvoiceAiProps.yesNo({
+ required: false,
+ displayName: 'Ignore Auto Number Generation',
+ description: 'Yes = use Credit Note Number instead of the next auto-generated number.',
+ }),
+ invoiceId: zohoInvoiceAiProps.invoiceId({
+ required: false,
+ description: 'Invoice the credit note is raised against. Use List Invoices to find it.',
+ }),
+ referenceNumber: Property.ShortText({
+ displayName: 'Reference Number',
+ description: 'Your own reference for the credit note.',
+ required: false,
+ }),
+ notes: Property.LongText({
+ displayName: 'Notes',
+ description: 'Notes shown on the credit note.',
+ required: false,
+ }),
+ terms: Property.LongText({
+ displayName: 'Terms',
+ description: 'Terms and conditions shown on the credit note.',
+ required: false,
+ }),
+ additionalFields: zohoInvoiceAiProps.additionalFields({ required: false }),
+ },
+ async run({ auth, propsValue }) {
+ return await zohoInvoiceApi.createCreditNote({
+ auth,
+ organizationId: propsValue.organizationId,
+ invoiceId: propsValue.invoiceId,
+ ignoreAutoNumberGeneration: zohoInvoiceUtils.toOptionalBoolean({
+ value: propsValue.ignoreAutoNumberGeneration,
+ }),
+ body: {
+ ...(propsValue.additionalFields ?? {}),
+ ...zohoInvoiceUtils.compact({
+ customer_id: propsValue.customerId,
+ date: propsValue.date,
+ line_items: zohoInvoiceUtils.toLineItems({ rows: propsValue.lineItems }),
+ creditnote_number: propsValue.creditNoteNumber,
+ reference_number: propsValue.referenceNumber,
+ notes: propsValue.notes,
+ terms: propsValue.terms,
+ }),
+ },
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-invoice/src/lib/actions/ai/credit-notes/delete-credit-note-comment.ts b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/credit-notes/delete-credit-note-comment.ts
new file mode 100644
index 00000000000..986f7de9f89
--- /dev/null
+++ b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/credit-notes/delete-credit-note-comment.ts
@@ -0,0 +1,37 @@
+import { createAction } from '@activepieces/pieces-framework';
+
+import { zohoInvoiceAuth } from '../../../auth';
+import { zohoInvoiceAiProps } from '../../../common/ai-props';
+import { zohoInvoiceApi } from '../../../common/api';
+import { zohoInvoiceMessageOutputSchema } from '../../../output-schemas';
+
+export const deleteCreditNoteCommentAction = createAction({
+ auth: zohoInvoiceAuth,
+ name: 'zoho_invoice_delete_credit_note_comment',
+ outputSchema: zohoInvoiceMessageOutputSchema,
+ displayName: 'Delete Credit Note Comment',
+ description: 'Deletes a comment from a credit note.',
+ audience: 'ai',
+ classification: 'DESTRUCTIVE',
+ aiMetadata: {
+ description:
+ 'Deletes one comment from a credit note. Use List Credit Notes for the credit note ID and List Credit Note Comments for the comment ID. Cannot be undone.',
+ idempotent: false,
+ },
+ props: {
+ organizationId: zohoInvoiceAiProps.organizationId({ required: true }),
+ creditNoteId: zohoInvoiceAiProps.creditNoteId({ required: true }),
+ commentId: zohoInvoiceAiProps.commentId({
+ required: true,
+ description: 'Comment ID. Use List Credit Note Comments to find it.',
+ }),
+ },
+ async run({ auth, propsValue }) {
+ return await zohoInvoiceApi.deleteCreditNoteComment({
+ auth,
+ organizationId: propsValue.organizationId,
+ creditNoteId: propsValue.creditNoteId,
+ commentId: propsValue.commentId,
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-invoice/src/lib/actions/ai/credit-notes/delete-credit-note-refund.ts b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/credit-notes/delete-credit-note-refund.ts
new file mode 100644
index 00000000000..2b4c528f176
--- /dev/null
+++ b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/credit-notes/delete-credit-note-refund.ts
@@ -0,0 +1,38 @@
+import { createAction } from '@activepieces/pieces-framework';
+
+import { zohoInvoiceAuth } from '../../../auth';
+import { zohoInvoiceAiProps } from '../../../common/ai-props';
+import { zohoInvoiceApi } from '../../../common/api';
+import { zohoInvoiceMessageOutputSchema } from '../../../output-schemas';
+
+export const deleteCreditNoteRefundAction = createAction({
+ auth: zohoInvoiceAuth,
+ name: 'zoho_invoice_delete_credit_note_refund',
+ outputSchema: zohoInvoiceMessageOutputSchema,
+ displayName: 'Delete Credit Note Refund',
+ description: 'Deletes a refund of a credit note.',
+ audience: 'ai',
+ classification: 'DESTRUCTIVE',
+ aiMetadata: {
+ description:
+ "Deletes a credit note refund, returning its amount to the credit note's balance. Use List Credit Notes for the credit note ID and List Credit Note Refunds for the refund ID. Cannot be undone.",
+ idempotent: false,
+ },
+ props: {
+ organizationId: zohoInvoiceAiProps.organizationId({ required: true }),
+ creditNoteId: zohoInvoiceAiProps.creditNoteId({ required: true }),
+ refundId: zohoInvoiceAiProps.idProp({
+ required: true,
+ displayName: 'Refund ID',
+ description: 'Credit note refund ID. Use List Credit Note Refunds to find it.',
+ }),
+ },
+ async run({ auth, propsValue }) {
+ return await zohoInvoiceApi.deleteCreditNoteRefund({
+ auth,
+ organizationId: propsValue.organizationId,
+ creditNoteId: propsValue.creditNoteId,
+ refundId: propsValue.refundId,
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-invoice/src/lib/actions/ai/credit-notes/delete-credit-note.ts b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/credit-notes/delete-credit-note.ts
new file mode 100644
index 00000000000..c699f1e0dca
--- /dev/null
+++ b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/credit-notes/delete-credit-note.ts
@@ -0,0 +1,32 @@
+import { createAction } from '@activepieces/pieces-framework';
+
+import { zohoInvoiceAuth } from '../../../auth';
+import { zohoInvoiceAiProps } from '../../../common/ai-props';
+import { zohoInvoiceApi } from '../../../common/api';
+import { zohoInvoiceMessageOutputSchema } from '../../../output-schemas';
+
+export const deleteCreditNoteAction = createAction({
+ auth: zohoInvoiceAuth,
+ name: 'zoho_invoice_delete_credit_note',
+ outputSchema: zohoInvoiceMessageOutputSchema,
+ displayName: 'Delete Credit Note',
+ description: 'Deletes a credit note.',
+ audience: 'ai',
+ classification: 'DESTRUCTIVE',
+ aiMetadata: {
+ description:
+ 'Permanently deletes a credit note. Use List Credit Notes to find the ID. Prefer Void Credit Note to keep a record. Cannot be undone.',
+ idempotent: false,
+ },
+ props: {
+ organizationId: zohoInvoiceAiProps.organizationId({ required: true }),
+ creditNoteId: zohoInvoiceAiProps.creditNoteId({ required: true }),
+ },
+ async run({ auth, propsValue }) {
+ return await zohoInvoiceApi.deleteCreditNote({
+ auth,
+ organizationId: propsValue.organizationId,
+ creditNoteId: propsValue.creditNoteId,
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-invoice/src/lib/actions/ai/credit-notes/email-credit-note.ts b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/credit-notes/email-credit-note.ts
new file mode 100644
index 00000000000..a3fde2da41b
--- /dev/null
+++ b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/credit-notes/email-credit-note.ts
@@ -0,0 +1,59 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoInvoiceAuth } from '../../../auth';
+import { zohoInvoiceAiProps } from '../../../common/ai-props';
+import { zohoInvoiceApi } from '../../../common/api';
+import { zohoInvoiceUtils } from '../../../common/utils';
+import { zohoInvoiceMessageOutputSchema } from '../../../output-schemas';
+
+export const emailCreditNoteAction = createAction({
+ auth: zohoInvoiceAuth,
+ name: 'zoho_invoice_email_credit_note',
+ outputSchema: zohoInvoiceMessageOutputSchema,
+ displayName: 'Email Credit Note',
+ description: 'Emails a credit note to the customer.',
+ audience: 'ai',
+ classification: 'WRITE',
+ aiMetadata: {
+ description:
+ 'Sends a real email with the credit note to the given recipients. Use List Credit Notes to find the ID. Not idempotent: every call sends another email.',
+ idempotent: false,
+ },
+ props: {
+ organizationId: zohoInvoiceAiProps.organizationId({ required: true }),
+ creditNoteId: zohoInvoiceAiProps.creditNoteId({ required: true }),
+ toMailIds: Property.Array({
+ displayName: 'To',
+ description: 'Recipient email addresses.',
+ required: true,
+ }),
+ ccMailIds: Property.Array({
+ displayName: 'CC',
+ description: 'CC email addresses.',
+ required: false,
+ }),
+ subject: Property.ShortText({
+ displayName: 'Subject',
+ description: 'Email subject.',
+ required: true,
+ }),
+ body: Property.LongText({
+ displayName: 'Body',
+ description: 'Email body (HTML allowed).',
+ required: true,
+ }),
+ },
+ async run({ auth, propsValue }) {
+ return await zohoInvoiceApi.emailCreditNote({
+ auth,
+ organizationId: propsValue.organizationId,
+ creditNoteId: propsValue.creditNoteId,
+ body: zohoInvoiceUtils.compact({
+ to_mail_ids: propsValue.toMailIds,
+ cc_mail_ids: propsValue.ccMailIds,
+ subject: propsValue.subject,
+ body: propsValue.body,
+ }),
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-invoice/src/lib/actions/ai/credit-notes/get-credit-note-email-history.ts b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/credit-notes/get-credit-note-email-history.ts
new file mode 100644
index 00000000000..3f0c8ff2383
--- /dev/null
+++ b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/credit-notes/get-credit-note-email-history.ts
@@ -0,0 +1,32 @@
+import { createAction } from '@activepieces/pieces-framework';
+
+import { zohoInvoiceAuth } from '../../../auth';
+import { zohoInvoiceAiProps } from '../../../common/ai-props';
+import { zohoInvoiceApi } from '../../../common/api';
+import { zohoInvoiceGetCreditNoteEmailHistoryOutputSchema } from '../../../output-schemas';
+
+export const getCreditNoteEmailHistoryAction = createAction({
+ auth: zohoInvoiceAuth,
+ name: 'zoho_invoice_get_credit_note_email_history',
+ outputSchema: zohoInvoiceGetCreditNoteEmailHistoryOutputSchema,
+ displayName: 'Get Credit Note Email History',
+ description: 'Lists the emails sent for a credit note.',
+ audience: 'ai',
+ classification: 'SEARCH',
+ aiMetadata: {
+ description:
+ 'Lists every email sent for a credit note with recipients, subject and send time. Use List Credit Notes to find the ID.',
+ idempotent: true,
+ },
+ props: {
+ organizationId: zohoInvoiceAiProps.organizationId({ required: true }),
+ creditNoteId: zohoInvoiceAiProps.creditNoteId({ required: true }),
+ },
+ async run({ auth, propsValue }) {
+ return await zohoInvoiceApi.getCreditNoteEmailHistory({
+ auth,
+ organizationId: propsValue.organizationId,
+ creditNoteId: propsValue.creditNoteId,
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-invoice/src/lib/actions/ai/credit-notes/get-credit-note-refund.ts b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/credit-notes/get-credit-note-refund.ts
new file mode 100644
index 00000000000..7f621c4ef50
--- /dev/null
+++ b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/credit-notes/get-credit-note-refund.ts
@@ -0,0 +1,38 @@
+import { createAction } from '@activepieces/pieces-framework';
+
+import { zohoInvoiceAuth } from '../../../auth';
+import { zohoInvoiceAiProps } from '../../../common/ai-props';
+import { zohoInvoiceApi } from '../../../common/api';
+import { zohoInvoiceCreditNoteRefundOutputSchema } from '../../../output-schemas';
+
+export const getCreditNoteRefundAction = createAction({
+ auth: zohoInvoiceAuth,
+ name: 'zoho_invoice_get_credit_note_refund',
+ outputSchema: zohoInvoiceCreditNoteRefundOutputSchema,
+ displayName: 'Get Credit Note Refund',
+ description: 'Gets one refund of a credit note.',
+ audience: 'ai',
+ classification: 'READ',
+ aiMetadata: {
+ description:
+ 'Returns one credit note refund: date, refund mode, reference and amount. Use List Credit Notes for the credit note ID and List Credit Note Refunds for the refund ID.',
+ idempotent: true,
+ },
+ props: {
+ organizationId: zohoInvoiceAiProps.organizationId({ required: true }),
+ creditNoteId: zohoInvoiceAiProps.creditNoteId({ required: true }),
+ refundId: zohoInvoiceAiProps.idProp({
+ required: true,
+ displayName: 'Refund ID',
+ description: 'Credit note refund ID. Use List Credit Note Refunds to find it.',
+ }),
+ },
+ async run({ auth, propsValue }) {
+ return await zohoInvoiceApi.getCreditNoteRefund({
+ auth,
+ organizationId: propsValue.organizationId,
+ creditNoteId: propsValue.creditNoteId,
+ refundId: propsValue.refundId,
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-invoice/src/lib/actions/ai/credit-notes/get-credit-note.ts b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/credit-notes/get-credit-note.ts
new file mode 100644
index 00000000000..c6232aaf167
--- /dev/null
+++ b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/credit-notes/get-credit-note.ts
@@ -0,0 +1,32 @@
+import { createAction } from '@activepieces/pieces-framework';
+
+import { zohoInvoiceAuth } from '../../../auth';
+import { zohoInvoiceAiProps } from '../../../common/ai-props';
+import { zohoInvoiceApi } from '../../../common/api';
+import { zohoInvoiceGetCreditNoteOutputSchema } from '../../../output-schemas';
+
+export const getCreditNoteAction = createAction({
+ auth: zohoInvoiceAuth,
+ name: 'zoho_invoice_get_credit_note',
+ outputSchema: zohoInvoiceGetCreditNoteOutputSchema,
+ displayName: 'Get Credit Note',
+ description: 'Gets one credit note by ID.',
+ audience: 'ai',
+ classification: 'READ',
+ aiMetadata: {
+ description:
+ 'Returns one credit note by ID with its customer, line items (with line_item_id), totals, balance and status. Use List Credit Notes to find the ID.',
+ idempotent: true,
+ },
+ props: {
+ organizationId: zohoInvoiceAiProps.organizationId({ required: true }),
+ creditNoteId: zohoInvoiceAiProps.creditNoteId({ required: true }),
+ },
+ async run({ auth, propsValue }) {
+ return await zohoInvoiceApi.getCreditNote({
+ auth,
+ organizationId: propsValue.organizationId,
+ creditNoteId: propsValue.creditNoteId,
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-invoice/src/lib/actions/ai/credit-notes/list-all-credit-note-refunds.ts b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/credit-notes/list-all-credit-note-refunds.ts
new file mode 100644
index 00000000000..915a3684507
--- /dev/null
+++ b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/credit-notes/list-all-credit-note-refunds.ts
@@ -0,0 +1,42 @@
+import { createAction } from '@activepieces/pieces-framework';
+
+import { zohoInvoiceAuth } from '../../../auth';
+import { zohoInvoiceAiProps } from '../../../common/ai-props';
+import { zohoInvoiceApi } from '../../../common/api';
+import { zohoInvoiceCreditNoteRefundsOutputSchema } from '../../../output-schemas';
+
+export const listAllCreditNoteRefundsAction = createAction({
+ auth: zohoInvoiceAuth,
+ name: 'zoho_invoice_list_all_credit_note_refunds',
+ outputSchema: zohoInvoiceCreditNoteRefundsOutputSchema,
+ displayName: 'List All Credit Note Refunds',
+ description: 'Lists credit note refunds across all credit notes.',
+ audience: 'ai',
+ classification: 'SEARCH',
+ aiMetadata: {
+ description:
+ 'Lists refunds across every credit note with creditnote_id and creditnote_refund_id, one page at a time. Filter by customer. Use List Credit Note Refunds for a single credit note.',
+ idempotent: true,
+ },
+ props: {
+ organizationId: zohoInvoiceAiProps.organizationId({ required: true }),
+ customerId: zohoInvoiceAiProps.contactId({ required: false, displayName: 'Customer ID' }),
+ sortColumn: zohoInvoiceAiProps.sortColumn({
+ required: false,
+ description:
+ 'Field to sort by: refund_mode, reference_number, date, creditnote_number, customer_name, amount_bcy or amount_fcy.',
+ }),
+ page: zohoInvoiceAiProps.page({ required: false }),
+ perPage: zohoInvoiceAiProps.perPage({ required: false }),
+ },
+ async run({ auth, propsValue }) {
+ return await zohoInvoiceApi.listAllCreditNoteRefunds({
+ auth,
+ organizationId: propsValue.organizationId,
+ customerId: propsValue.customerId,
+ sortColumn: propsValue.sortColumn,
+ page: propsValue.page,
+ perPage: propsValue.perPage,
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-invoice/src/lib/actions/ai/credit-notes/list-credit-note-comments.ts b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/credit-notes/list-credit-note-comments.ts
new file mode 100644
index 00000000000..16a58d0b282
--- /dev/null
+++ b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/credit-notes/list-credit-note-comments.ts
@@ -0,0 +1,32 @@
+import { createAction } from '@activepieces/pieces-framework';
+
+import { zohoInvoiceAuth } from '../../../auth';
+import { zohoInvoiceAiProps } from '../../../common/ai-props';
+import { zohoInvoiceApi } from '../../../common/api';
+import { zohoInvoiceListCreditNoteCommentsOutputSchema } from '../../../output-schemas';
+
+export const listCreditNoteCommentsAction = createAction({
+ auth: zohoInvoiceAuth,
+ name: 'zoho_invoice_list_credit_note_comments',
+ outputSchema: zohoInvoiceListCreditNoteCommentsOutputSchema,
+ displayName: 'List Credit Note Comments',
+ description: 'Lists the comments and history of a credit note.',
+ audience: 'ai',
+ classification: 'SEARCH',
+ aiMetadata: {
+ description:
+ "Lists a credit note's comments and activity history with comment_id, text, author and time. Use List Credit Notes to find the ID.",
+ idempotent: true,
+ },
+ props: {
+ organizationId: zohoInvoiceAiProps.organizationId({ required: true }),
+ creditNoteId: zohoInvoiceAiProps.creditNoteId({ required: true }),
+ },
+ async run({ auth, propsValue }) {
+ return await zohoInvoiceApi.listCreditNoteComments({
+ auth,
+ organizationId: propsValue.organizationId,
+ creditNoteId: propsValue.creditNoteId,
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-invoice/src/lib/actions/ai/credit-notes/list-credit-note-invoices.ts b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/credit-notes/list-credit-note-invoices.ts
new file mode 100644
index 00000000000..5f3fbb31a87
--- /dev/null
+++ b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/credit-notes/list-credit-note-invoices.ts
@@ -0,0 +1,32 @@
+import { createAction } from '@activepieces/pieces-framework';
+
+import { zohoInvoiceAuth } from '../../../auth';
+import { zohoInvoiceAiProps } from '../../../common/ai-props';
+import { zohoInvoiceApi } from '../../../common/api';
+import { zohoInvoiceListCreditNoteInvoicesOutputSchema } from '../../../output-schemas';
+
+export const listCreditNoteInvoicesAction = createAction({
+ auth: zohoInvoiceAuth,
+ name: 'zoho_invoice_list_credit_note_invoices',
+ outputSchema: zohoInvoiceListCreditNoteInvoicesOutputSchema,
+ displayName: 'List Credit Note Invoices',
+ description: 'Lists the invoices a credit note was applied to.',
+ audience: 'ai',
+ classification: 'SEARCH',
+ aiMetadata: {
+ description:
+ "Lists the invoices a credit note's credit was applied to, with the amount applied and the creditnote_invoice_id that Remove Credit Note From Invoice needs. Use List Credit Notes to find the ID.",
+ idempotent: true,
+ },
+ props: {
+ organizationId: zohoInvoiceAiProps.organizationId({ required: true }),
+ creditNoteId: zohoInvoiceAiProps.creditNoteId({ required: true }),
+ },
+ async run({ auth, propsValue }) {
+ return await zohoInvoiceApi.listCreditNoteInvoices({
+ auth,
+ organizationId: propsValue.organizationId,
+ creditNoteId: propsValue.creditNoteId,
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-invoice/src/lib/actions/ai/credit-notes/list-credit-note-refunds.ts b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/credit-notes/list-credit-note-refunds.ts
new file mode 100644
index 00000000000..1d01a3a34a6
--- /dev/null
+++ b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/credit-notes/list-credit-note-refunds.ts
@@ -0,0 +1,36 @@
+import { createAction } from '@activepieces/pieces-framework';
+
+import { zohoInvoiceAuth } from '../../../auth';
+import { zohoInvoiceAiProps } from '../../../common/ai-props';
+import { zohoInvoiceApi } from '../../../common/api';
+import { zohoInvoiceCreditNoteRefundsOutputSchema } from '../../../output-schemas';
+
+export const listCreditNoteRefundsAction = createAction({
+ auth: zohoInvoiceAuth,
+ name: 'zoho_invoice_list_credit_note_refunds',
+ outputSchema: zohoInvoiceCreditNoteRefundsOutputSchema,
+ displayName: 'List Credit Note Refunds',
+ description: 'Lists the refunds of one credit note.',
+ audience: 'ai',
+ classification: 'SEARCH',
+ aiMetadata: {
+ description:
+ 'Lists the refunds made from one credit note with creditnote_refund_id, date, mode and amount, one page at a time. Use List Credit Notes to find the ID; use List All Credit Note Refunds to search across credit notes.',
+ idempotent: true,
+ },
+ props: {
+ organizationId: zohoInvoiceAiProps.organizationId({ required: true }),
+ creditNoteId: zohoInvoiceAiProps.creditNoteId({ required: true }),
+ page: zohoInvoiceAiProps.page({ required: false }),
+ perPage: zohoInvoiceAiProps.perPage({ required: false }),
+ },
+ async run({ auth, propsValue }) {
+ return await zohoInvoiceApi.listCreditNoteRefunds({
+ auth,
+ organizationId: propsValue.organizationId,
+ creditNoteId: propsValue.creditNoteId,
+ page: propsValue.page,
+ perPage: propsValue.perPage,
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-invoice/src/lib/actions/ai/credit-notes/list-credit-note-templates.ts b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/credit-notes/list-credit-note-templates.ts
new file mode 100644
index 00000000000..3cf3822830e
--- /dev/null
+++ b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/credit-notes/list-credit-note-templates.ts
@@ -0,0 +1,30 @@
+import { createAction } from '@activepieces/pieces-framework';
+
+import { zohoInvoiceAuth } from '../../../auth';
+import { zohoInvoiceAiProps } from '../../../common/ai-props';
+import { zohoInvoiceApi } from '../../../common/api';
+import { zohoInvoiceTemplatesOutputSchema } from '../../../output-schemas';
+
+export const listCreditNoteTemplatesAction = createAction({
+ auth: zohoInvoiceAuth,
+ name: 'zoho_invoice_list_credit_note_templates',
+ outputSchema: zohoInvoiceTemplatesOutputSchema,
+ displayName: 'List Credit Note Templates',
+ description: 'Lists the PDF templates available for credit notes.',
+ audience: 'ai',
+ classification: 'SEARCH',
+ aiMetadata: {
+ description:
+ 'Lists the credit note PDF templates with template_id and name, for Set Credit Note Template or the template_id of Create Credit Note.',
+ idempotent: true,
+ },
+ props: {
+ organizationId: zohoInvoiceAiProps.organizationId({ required: true }),
+ },
+ async run({ auth, propsValue }) {
+ return await zohoInvoiceApi.listCreditNoteTemplates({
+ auth,
+ organizationId: propsValue.organizationId,
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-invoice/src/lib/actions/ai/credit-notes/list-credit-notes.ts b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/credit-notes/list-credit-notes.ts
new file mode 100644
index 00000000000..f22572ec0d5
--- /dev/null
+++ b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/credit-notes/list-credit-notes.ts
@@ -0,0 +1,69 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoInvoiceAuth } from '../../../auth';
+import { zohoInvoiceAiProps } from '../../../common/ai-props';
+import { zohoInvoiceApi } from '../../../common/api';
+import { zohoInvoiceListCreditNotesOutputSchema } from '../../../output-schemas';
+
+export const listCreditNotesAction = createAction({
+ auth: zohoInvoiceAuth,
+ name: 'zoho_invoice_list_credit_notes',
+ outputSchema: zohoInvoiceListCreditNotesOutputSchema,
+ displayName: 'List Credit Notes',
+ description: 'Lists credit notes, one page at a time.',
+ audience: 'ai',
+ classification: 'SEARCH',
+ aiMetadata: {
+ description:
+ 'Lists credit notes with creditnote_id, number, customer, status, total and balance, one page at a time. Filter by status, customer or date, or search by number, customer name or reference.',
+ idempotent: true,
+ },
+ props: {
+ organizationId: zohoInvoiceAiProps.organizationId({ required: true }),
+ filterBy: Property.StaticDropdown({
+ displayName: 'Status',
+ description: 'Only credit notes with this status. Empty = all.',
+ required: false,
+ options: {
+ disabled: false,
+ options: [
+ { label: 'All', value: 'Status.All' },
+ { label: 'Open', value: 'Status.Open' },
+ { label: 'Draft', value: 'Status.Draft' },
+ { label: 'Closed', value: 'Status.Closed' },
+ { label: 'Void', value: 'Status.Void' },
+ ],
+ },
+ }),
+ customerId: zohoInvoiceAiProps.contactId({ required: false, displayName: 'Customer ID' }),
+ date: Property.ShortText({
+ displayName: 'Date',
+ description: 'Only credit notes dated this day, yyyy-mm-dd.',
+ required: false,
+ }),
+ searchText: zohoInvoiceAiProps.searchText({
+ required: false,
+ description: 'Search by credit note number, customer name or reference number.',
+ }),
+ sortColumn: zohoInvoiceAiProps.sortColumn({
+ required: false,
+ description:
+ 'Field to sort by: customer_name, creditnote_number, balance, total, date or created_time.',
+ }),
+ page: zohoInvoiceAiProps.page({ required: false }),
+ perPage: zohoInvoiceAiProps.perPage({ required: false }),
+ },
+ async run({ auth, propsValue }) {
+ return await zohoInvoiceApi.listCreditNotes({
+ auth,
+ organizationId: propsValue.organizationId,
+ filterBy: propsValue.filterBy,
+ customerId: propsValue.customerId,
+ date: propsValue.date,
+ searchText: propsValue.searchText,
+ sortColumn: propsValue.sortColumn,
+ page: propsValue.page,
+ perPage: propsValue.perPage,
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-invoice/src/lib/actions/ai/credit-notes/refund-credit-note.ts b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/credit-notes/refund-credit-note.ts
new file mode 100644
index 00000000000..2bd0aebb10d
--- /dev/null
+++ b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/credit-notes/refund-credit-note.ts
@@ -0,0 +1,69 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoInvoiceAuth } from '../../../auth';
+import { zohoInvoiceAiProps } from '../../../common/ai-props';
+import { zohoInvoiceApi } from '../../../common/api';
+import { zohoInvoiceUtils } from '../../../common/utils';
+import { zohoInvoiceCreditNoteRefundOutputSchema } from '../../../output-schemas';
+
+export const refundCreditNoteAction = createAction({
+ auth: zohoInvoiceAuth,
+ name: 'zoho_invoice_refund_credit_note',
+ outputSchema: zohoInvoiceCreditNoteRefundOutputSchema,
+ displayName: 'Refund Credit Note',
+ description: "Records a refund from a credit note's balance.",
+ audience: 'ai',
+ classification: 'WRITE',
+ aiMetadata: {
+ description:
+ "Records a refund paid to the customer out of a credit note's open balance; it does not move money itself. Use List Credit Notes to find the ID. Not idempotent: each call records another refund.",
+ idempotent: false,
+ },
+ props: {
+ organizationId: zohoInvoiceAiProps.organizationId({ required: true }),
+ creditNoteId: zohoInvoiceAiProps.creditNoteId({ required: true }),
+ date: Property.ShortText({
+ displayName: 'Date',
+ description: 'Refund date, yyyy-mm-dd.',
+ required: true,
+ }),
+ amount: Property.Number({
+ displayName: 'Amount',
+ description: "Amount refunded, at most the credit note's balance.",
+ required: true,
+ }),
+ refundMode: Property.ShortText({
+ displayName: 'Refund Mode',
+ description: 'How the refund was paid, e.g. "cash", "check" or "banktransfer".',
+ required: false,
+ }),
+ referenceNumber: Property.ShortText({
+ displayName: 'Reference Number',
+ description: 'Your own reference for the refund.',
+ required: false,
+ }),
+ description: Property.ShortText({
+ displayName: 'Description',
+ description: 'Note about the refund.',
+ required: false,
+ }),
+ additionalFields: zohoInvoiceAiProps.additionalFields({ required: false }),
+ },
+ async run({ auth, propsValue }) {
+ return await zohoInvoiceApi.refundCreditNote({
+ auth,
+ organizationId: propsValue.organizationId,
+ creditNoteId: propsValue.creditNoteId,
+ body: {
+ ...(propsValue.additionalFields ?? {}),
+ ...zohoInvoiceUtils.compact({
+ date: propsValue.date,
+ amount: propsValue.amount,
+ refund_mode: propsValue.refundMode,
+ reference_number: propsValue.referenceNumber,
+ description: propsValue.description,
+ }),
+ },
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-invoice/src/lib/actions/ai/credit-notes/remove-credit-note-from-invoice.ts b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/credit-notes/remove-credit-note-from-invoice.ts
new file mode 100644
index 00000000000..a42b11bb28c
--- /dev/null
+++ b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/credit-notes/remove-credit-note-from-invoice.ts
@@ -0,0 +1,39 @@
+import { createAction } from '@activepieces/pieces-framework';
+
+import { zohoInvoiceAuth } from '../../../auth';
+import { zohoInvoiceAiProps } from '../../../common/ai-props';
+import { zohoInvoiceApi } from '../../../common/api';
+import { zohoInvoiceMessageOutputSchema } from '../../../output-schemas';
+
+export const removeCreditNoteFromInvoiceAction = createAction({
+ auth: zohoInvoiceAuth,
+ name: 'zoho_invoice_remove_credit_note_from_invoice',
+ outputSchema: zohoInvoiceMessageOutputSchema,
+ displayName: 'Remove Credit Note From Invoice',
+ description: 'Removes credit applied from a credit note to an invoice.',
+ audience: 'ai',
+ classification: 'DESTRUCTIVE',
+ aiMetadata: {
+ description:
+ "Undoes one credit application, returning the amount to the credit note's balance and reopening it on the invoice; the invoice itself is not deleted. Use List Credit Notes for the credit note ID and List Credit Note Invoices for the credited invoice ID.",
+ idempotent: false,
+ },
+ props: {
+ organizationId: zohoInvoiceAiProps.organizationId({ required: true }),
+ creditNoteId: zohoInvoiceAiProps.creditNoteId({ required: true }),
+ creditNoteInvoiceId: zohoInvoiceAiProps.idProp({
+ required: true,
+ displayName: 'Credited Invoice ID',
+ description:
+ 'ID of the credit application (creditnote_invoice_id), not the invoice ID. Use List Credit Note Invoices to find it.',
+ }),
+ },
+ async run({ auth, propsValue }) {
+ return await zohoInvoiceApi.removeCreditNoteFromInvoice({
+ auth,
+ organizationId: propsValue.organizationId,
+ creditNoteId: propsValue.creditNoteId,
+ creditNoteInvoiceId: propsValue.creditNoteInvoiceId,
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-invoice/src/lib/actions/ai/credit-notes/reopen-credit-note.ts b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/credit-notes/reopen-credit-note.ts
new file mode 100644
index 00000000000..65775fdeb57
--- /dev/null
+++ b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/credit-notes/reopen-credit-note.ts
@@ -0,0 +1,32 @@
+import { createAction } from '@activepieces/pieces-framework';
+
+import { zohoInvoiceAuth } from '../../../auth';
+import { zohoInvoiceAiProps } from '../../../common/ai-props';
+import { zohoInvoiceApi } from '../../../common/api';
+import { zohoInvoiceMessageOutputSchema } from '../../../output-schemas';
+
+export const reopenCreditNoteAction = createAction({
+ auth: zohoInvoiceAuth,
+ name: 'zoho_invoice_reopen_credit_note',
+ outputSchema: zohoInvoiceMessageOutputSchema,
+ displayName: 'Reopen Credit Note',
+ description: 'Converts a voided credit note back to open.',
+ audience: 'ai',
+ classification: 'WRITE',
+ aiMetadata: {
+ description:
+ 'Turns a voided credit note back to Open so its credit can be applied or refunded again. Use List Credit Notes to find the ID. Only works on void credit notes.',
+ idempotent: true,
+ },
+ props: {
+ organizationId: zohoInvoiceAiProps.organizationId({ required: true }),
+ creditNoteId: zohoInvoiceAiProps.creditNoteId({ required: true }),
+ },
+ async run({ auth, propsValue }) {
+ return await zohoInvoiceApi.reopenCreditNote({
+ auth,
+ organizationId: propsValue.organizationId,
+ creditNoteId: propsValue.creditNoteId,
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-invoice/src/lib/actions/ai/credit-notes/set-credit-note-template.ts b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/credit-notes/set-credit-note-template.ts
new file mode 100644
index 00000000000..f70145deb23
--- /dev/null
+++ b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/credit-notes/set-credit-note-template.ts
@@ -0,0 +1,37 @@
+import { createAction } from '@activepieces/pieces-framework';
+
+import { zohoInvoiceAuth } from '../../../auth';
+import { zohoInvoiceAiProps } from '../../../common/ai-props';
+import { zohoInvoiceApi } from '../../../common/api';
+import { zohoInvoiceMessageOutputSchema } from '../../../output-schemas';
+
+export const setCreditNoteTemplateAction = createAction({
+ auth: zohoInvoiceAuth,
+ name: 'zoho_invoice_set_credit_note_template',
+ outputSchema: zohoInvoiceMessageOutputSchema,
+ displayName: 'Set Credit Note Template',
+ description: 'Changes the PDF template of a credit note.',
+ audience: 'ai',
+ classification: 'WRITE',
+ aiMetadata: {
+ description:
+ 'Sets which PDF template a credit note uses. Use List Credit Notes for the credit note ID and List Credit Note Templates for the template ID.',
+ idempotent: true,
+ },
+ props: {
+ organizationId: zohoInvoiceAiProps.organizationId({ required: true }),
+ creditNoteId: zohoInvoiceAiProps.creditNoteId({ required: true }),
+ templateId: zohoInvoiceAiProps.templateId({
+ required: true,
+ description: 'Credit note PDF template ID. Use List Credit Note Templates to find it.',
+ }),
+ },
+ async run({ auth, propsValue }) {
+ return await zohoInvoiceApi.setCreditNoteTemplate({
+ auth,
+ organizationId: propsValue.organizationId,
+ creditNoteId: propsValue.creditNoteId,
+ templateId: propsValue.templateId,
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-invoice/src/lib/actions/ai/credit-notes/update-credit-note-refund.ts b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/credit-notes/update-credit-note-refund.ts
new file mode 100644
index 00000000000..af83572256e
--- /dev/null
+++ b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/credit-notes/update-credit-note-refund.ts
@@ -0,0 +1,71 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoInvoiceAuth } from '../../../auth';
+import { zohoInvoiceAiProps } from '../../../common/ai-props';
+import { zohoInvoiceApi } from '../../../common/api';
+import { zohoInvoiceUtils } from '../../../common/utils';
+import { zohoInvoiceCreditNoteRefundOutputSchema } from '../../../output-schemas';
+
+export const updateCreditNoteRefundAction = createAction({
+ auth: zohoInvoiceAuth,
+ name: 'zoho_invoice_update_credit_note_refund',
+ outputSchema: zohoInvoiceCreditNoteRefundOutputSchema,
+ displayName: 'Update Credit Note Refund',
+ description: 'Changes a refund recorded against a credit note.',
+ audience: 'ai',
+ classification: 'WRITE',
+ aiMetadata: {
+ description:
+ 'Changes the date, amount, mode, reference or description of a credit note refund. Fields left empty keep their current value. Use List Credit Notes for the credit note ID and List Credit Note Refunds for the refund ID.',
+ idempotent: true,
+ },
+ props: {
+ organizationId: zohoInvoiceAiProps.organizationId({ required: true }),
+ creditNoteId: zohoInvoiceAiProps.creditNoteId({ required: true }),
+ refundId: zohoInvoiceAiProps.idProp({
+ required: true,
+ displayName: 'Refund ID',
+ description: 'Credit note refund ID. Use List Credit Note Refunds to find it.',
+ }),
+ date: Property.ShortText({
+ displayName: 'Date',
+ description: 'New refund date, yyyy-mm-dd. Empty = unchanged.',
+ required: false,
+ }),
+ amount: Property.Number({
+ displayName: 'Amount',
+ description: 'New refund amount. Empty = unchanged.',
+ required: false,
+ }),
+ refundMode: Property.ShortText({
+ displayName: 'Refund Mode',
+ description: 'New refund mode, e.g. "cash" or "banktransfer". Empty = unchanged.',
+ required: false,
+ }),
+ referenceNumber: Property.ShortText({
+ displayName: 'Reference Number',
+ description: 'New reference number. Empty = unchanged.',
+ required: false,
+ }),
+ description: Property.ShortText({
+ displayName: 'Description',
+ description: 'New description. Empty = unchanged.',
+ required: false,
+ }),
+ },
+ async run({ auth, propsValue }) {
+ return await zohoInvoiceApi.updateCreditNoteRefund({
+ auth,
+ organizationId: propsValue.organizationId,
+ creditNoteId: propsValue.creditNoteId,
+ refundId: propsValue.refundId,
+ body: zohoInvoiceUtils.compact({
+ date: propsValue.date,
+ amount: propsValue.amount,
+ refund_mode: propsValue.refundMode,
+ reference_number: propsValue.referenceNumber,
+ description: propsValue.description,
+ }),
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-invoice/src/lib/actions/ai/credit-notes/update-credit-note.ts b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/credit-notes/update-credit-note.ts
new file mode 100644
index 00000000000..a1f55a60951
--- /dev/null
+++ b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/credit-notes/update-credit-note.ts
@@ -0,0 +1,134 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoInvoiceAuth } from '../../../auth';
+import { zohoInvoiceAiProps } from '../../../common/ai-props';
+import { zohoInvoiceApi } from '../../../common/api';
+import { zohoInvoiceUtils } from '../../../common/utils';
+import { zohoInvoiceCreditNoteOutputSchema } from '../../../output-schemas';
+
+export const updateCreditNoteAction = createAction({
+ auth: zohoInvoiceAuth,
+ name: 'zoho_invoice_update_credit_note',
+ outputSchema: zohoInvoiceCreditNoteOutputSchema,
+ displayName: 'Update Credit Note',
+ description: 'Changes the details or line items of a credit note.',
+ audience: 'ai',
+ classification: 'WRITE',
+ aiMetadata: {
+ description:
+ 'Changes a credit note. Fields left empty keep their current value; Line Items, when given, replace all current lines (pass Line Item ID to keep an existing line). Use List Credit Notes to find the ID.',
+ idempotent: true,
+ },
+ props: {
+ organizationId: zohoInvoiceAiProps.organizationId({ required: true }),
+ creditNoteId: zohoInvoiceAiProps.creditNoteId({ required: true }),
+ customerId: zohoInvoiceAiProps.contactId({
+ required: false,
+ displayName: 'Customer ID',
+ description: 'New customer ID. Use List Contacts to find it. Empty = unchanged.',
+ }),
+ date: Property.ShortText({
+ displayName: 'Date',
+ description: 'New credit note date, yyyy-mm-dd. Empty = unchanged.',
+ required: false,
+ }),
+ creditNoteNumber: Property.ShortText({
+ displayName: 'Credit Note Number',
+ description: 'New credit note number. Empty = unchanged.',
+ required: false,
+ }),
+ lineItems: Property.Array({
+ displayName: 'Line Items',
+ description:
+ 'Full new list of lines. Lines without a Line Item ID are added; current lines left out are removed. Empty = lines unchanged.',
+ required: false,
+ properties: {
+ lineItemId: zohoInvoiceAiProps.idProp({
+ required: false,
+ displayName: 'Line Item ID',
+ description: 'ID of an existing line to keep. Use Get Credit Note to find it.',
+ }),
+ itemId: zohoInvoiceAiProps.itemId({ required: false }),
+ name: Property.ShortText({
+ displayName: 'Name',
+ description: 'Line name.',
+ required: false,
+ }),
+ description: Property.ShortText({
+ displayName: 'Description',
+ description: 'Line description.',
+ required: false,
+ }),
+ rate: Property.Number({
+ displayName: 'Rate',
+ description: 'Unit price.',
+ required: false,
+ }),
+ quantity: Property.Number({
+ displayName: 'Quantity',
+ description: 'Quantity.',
+ required: false,
+ }),
+ taxId: zohoInvoiceAiProps.taxId({ required: false }),
+ },
+ }),
+ referenceNumber: Property.ShortText({
+ displayName: 'Reference Number',
+ description: 'New reference number. Empty = unchanged.',
+ required: false,
+ }),
+ notes: Property.LongText({
+ displayName: 'Notes',
+ description: 'New notes. Empty = unchanged.',
+ required: false,
+ }),
+ terms: Property.LongText({
+ displayName: 'Terms',
+ description: 'New terms and conditions. Empty = unchanged.',
+ required: false,
+ }),
+ additionalFields: zohoInvoiceAiProps.additionalFields({ required: false }),
+ },
+ async run({ auth, propsValue }) {
+ const { organizationId, creditNoteId } = propsValue;
+ const current = await zohoInvoiceApi.getCreditNote({ auth, organizationId, creditNoteId });
+ return await zohoInvoiceApi.updateCreditNote({
+ auth,
+ organizationId,
+ creditNoteId,
+ ignoreAutoNumberGeneration: propsValue.creditNoteNumber ? true : undefined,
+ body: {
+ ...zohoInvoiceUtils.compact({
+ customer_id: current.creditnote?.customer_id,
+ date: current.creditnote?.date,
+ creditnote_number: current.creditnote?.creditnote_number,
+ line_items: current.creditnote?.line_items?.map((line) =>
+ zohoInvoiceUtils.compact({
+ line_item_id: line.line_item_id,
+ item_id: line.item_id,
+ name: line.name,
+ description: line.description,
+ rate: line.rate,
+ quantity: line.quantity,
+ discount: line.discount,
+ tax_id: line.tax_id,
+ }),
+ ),
+ }),
+ ...(propsValue.additionalFields ?? {}),
+ ...zohoInvoiceUtils.compact({
+ customer_id: propsValue.customerId,
+ date: propsValue.date,
+ creditnote_number: propsValue.creditNoteNumber,
+ line_items:
+ propsValue.lineItems === undefined
+ ? undefined
+ : zohoInvoiceUtils.toLineItems({ rows: propsValue.lineItems }),
+ reference_number: propsValue.referenceNumber,
+ notes: propsValue.notes,
+ terms: propsValue.terms,
+ }),
+ },
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-invoice/src/lib/actions/ai/credit-notes/void-credit-note.ts b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/credit-notes/void-credit-note.ts
new file mode 100644
index 00000000000..fc0e40f3644
--- /dev/null
+++ b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/credit-notes/void-credit-note.ts
@@ -0,0 +1,32 @@
+import { createAction } from '@activepieces/pieces-framework';
+
+import { zohoInvoiceAuth } from '../../../auth';
+import { zohoInvoiceAiProps } from '../../../common/ai-props';
+import { zohoInvoiceApi } from '../../../common/api';
+import { zohoInvoiceMessageOutputSchema } from '../../../output-schemas';
+
+export const voidCreditNoteAction = createAction({
+ auth: zohoInvoiceAuth,
+ name: 'zoho_invoice_void_credit_note',
+ outputSchema: zohoInvoiceMessageOutputSchema,
+ displayName: 'Void Credit Note',
+ description: 'Marks a credit note as void.',
+ audience: 'ai',
+ classification: 'DESTRUCTIVE',
+ aiMetadata: {
+ description:
+ 'Voids a credit note so its credit can no longer be used, keeping it on record. Use List Credit Notes to find the ID. Reverse it with Reopen Credit Note.',
+ idempotent: true,
+ },
+ props: {
+ organizationId: zohoInvoiceAiProps.organizationId({ required: true }),
+ creditNoteId: zohoInvoiceAiProps.creditNoteId({ required: true }),
+ },
+ async run({ auth, propsValue }) {
+ return await zohoInvoiceApi.voidCreditNote({
+ auth,
+ organizationId: propsValue.organizationId,
+ creditNoteId: propsValue.creditNoteId,
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-invoice/src/lib/actions/ai/customer-payments/create-customer-payment.ts b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/customer-payments/create-customer-payment.ts
new file mode 100644
index 00000000000..610958cff25
--- /dev/null
+++ b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/customer-payments/create-customer-payment.ts
@@ -0,0 +1,97 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoInvoiceAuth } from '../../../auth';
+import { zohoInvoiceAiProps } from '../../../common/ai-props';
+import { zohoInvoiceApi } from '../../../common/api';
+import { zohoInvoiceUtils } from '../../../common/utils';
+import { zohoInvoicePaymentOutputSchema } from '../../../output-schemas';
+
+export const createCustomerPaymentAction = createAction({
+ auth: zohoInvoiceAuth,
+ name: 'zoho_invoice_create_customer_payment',
+ outputSchema: zohoInvoicePaymentOutputSchema,
+ displayName: 'Create Customer Payment',
+ description: 'Records a payment received from a customer.',
+ audience: 'ai',
+ classification: 'WRITE',
+ aiMetadata: {
+ description:
+ "Records a payment received from a customer and applies it to that customer's invoices; any amount not applied stays as excess credit. Use List Contacts for the customer ID and List Invoices for the invoice IDs. Not idempotent: each call records another payment.",
+ idempotent: false,
+ },
+ props: {
+ organizationId: zohoInvoiceAiProps.organizationId({ required: true }),
+ customerId: zohoInvoiceAiProps.contactId({ required: true, displayName: 'Customer ID' }),
+ paymentMode: Property.ShortText({
+ displayName: 'Payment Mode',
+ description:
+ 'How the customer paid: check, cash, creditcard, banktransfer, bankremittance, autotransaction or others.',
+ required: true,
+ }),
+ amount: Property.Number({
+ displayName: 'Amount',
+ description: 'Total amount received.',
+ required: true,
+ }),
+ date: Property.ShortText({
+ displayName: 'Date',
+ description: 'Payment date, yyyy-mm-dd.',
+ required: true,
+ }),
+ invoices: Property.Array({
+ displayName: 'Invoices',
+ description: 'Invoices this payment pays and the amount applied to each.',
+ required: true,
+ properties: {
+ invoiceId: zohoInvoiceAiProps.invoiceId({ required: true }),
+ amountApplied: Property.Number({
+ displayName: 'Amount Applied',
+ description: 'Amount of the payment applied to this invoice.',
+ required: true,
+ }),
+ },
+ }),
+ referenceNumber: Property.ShortText({
+ displayName: 'Reference Number',
+ description: 'Your own reference, e.g. a check or transaction number.',
+ required: false,
+ }),
+ description: Property.ShortText({
+ displayName: 'Description',
+ description: 'Note about the payment.',
+ required: false,
+ }),
+ bankCharges: Property.Number({
+ displayName: 'Bank Charges',
+ description: 'Bank fees deducted from the payment.',
+ required: false,
+ }),
+ additionalFields: zohoInvoiceAiProps.additionalFields({ required: false }),
+ },
+ async run({ auth, propsValue }) {
+ return await zohoInvoiceApi.createCustomerPayment({
+ auth,
+ organizationId: propsValue.organizationId,
+ body: {
+ ...(propsValue.additionalFields ?? {}),
+ ...zohoInvoiceUtils.compact({
+ customer_id: propsValue.customerId,
+ payment_mode: propsValue.paymentMode,
+ amount: propsValue.amount,
+ date: propsValue.date,
+ invoices: zohoInvoiceUtils
+ .toRecords({ rows: propsValue.invoices, propName: 'Invoices' })
+ .map((invoice) =>
+ zohoInvoiceUtils.compact({
+ invoice_id: invoice['invoiceId'],
+ amount_applied: invoice['amountApplied'],
+ }),
+ ),
+ reference_number: propsValue.referenceNumber,
+ description: propsValue.description,
+ bank_charges: propsValue.bankCharges,
+ }),
+ },
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-invoice/src/lib/actions/ai/customer-payments/delete-customer-payment-refund.ts b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/customer-payments/delete-customer-payment-refund.ts
new file mode 100644
index 00000000000..72b1722166d
--- /dev/null
+++ b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/customer-payments/delete-customer-payment-refund.ts
@@ -0,0 +1,38 @@
+import { createAction } from '@activepieces/pieces-framework';
+
+import { zohoInvoiceAuth } from '../../../auth';
+import { zohoInvoiceAiProps } from '../../../common/ai-props';
+import { zohoInvoiceApi } from '../../../common/api';
+import { zohoInvoiceMessageOutputSchema } from '../../../output-schemas';
+
+export const deleteCustomerPaymentRefundAction = createAction({
+ auth: zohoInvoiceAuth,
+ name: 'zoho_invoice_delete_customer_payment_refund',
+ outputSchema: zohoInvoiceMessageOutputSchema,
+ displayName: 'Delete Customer Payment Refund',
+ description: 'Deletes a refund of a customer payment.',
+ audience: 'ai',
+ classification: 'DESTRUCTIVE',
+ aiMetadata: {
+ description:
+ "Deletes a customer payment refund, returning its amount to the payment's unused balance. Use List Customer Payments for the payment ID and List Customer Payment Refunds for the refund ID. Cannot be undone.",
+ idempotent: false,
+ },
+ props: {
+ organizationId: zohoInvoiceAiProps.organizationId({ required: true }),
+ paymentId: zohoInvoiceAiProps.paymentId({ required: true }),
+ refundId: zohoInvoiceAiProps.idProp({
+ required: true,
+ displayName: 'Refund ID',
+ description: 'Customer payment refund ID. Use List Customer Payment Refunds to find it.',
+ }),
+ },
+ async run({ auth, propsValue }) {
+ return await zohoInvoiceApi.deleteCustomerPaymentRefund({
+ auth,
+ organizationId: propsValue.organizationId,
+ paymentId: propsValue.paymentId,
+ refundId: propsValue.refundId,
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-invoice/src/lib/actions/ai/customer-payments/delete-customer-payment.ts b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/customer-payments/delete-customer-payment.ts
new file mode 100644
index 00000000000..49c4d82ffa8
--- /dev/null
+++ b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/customer-payments/delete-customer-payment.ts
@@ -0,0 +1,32 @@
+import { createAction } from '@activepieces/pieces-framework';
+
+import { zohoInvoiceAuth } from '../../../auth';
+import { zohoInvoiceAiProps } from '../../../common/ai-props';
+import { zohoInvoiceApi } from '../../../common/api';
+import { zohoInvoiceMessageOutputSchema } from '../../../output-schemas';
+
+export const deleteCustomerPaymentAction = createAction({
+ auth: zohoInvoiceAuth,
+ name: 'zoho_invoice_delete_customer_payment',
+ outputSchema: zohoInvoiceMessageOutputSchema,
+ displayName: 'Delete Customer Payment',
+ description: 'Deletes a customer payment.',
+ audience: 'ai',
+ classification: 'DESTRUCTIVE',
+ aiMetadata: {
+ description:
+ 'Permanently deletes a customer payment; the invoices it paid become unpaid again. Use List Customer Payments to find the ID. Cannot be undone.',
+ idempotent: false,
+ },
+ props: {
+ organizationId: zohoInvoiceAiProps.organizationId({ required: true }),
+ paymentId: zohoInvoiceAiProps.paymentId({ required: true }),
+ },
+ async run({ auth, propsValue }) {
+ return await zohoInvoiceApi.deleteCustomerPayment({
+ auth,
+ organizationId: propsValue.organizationId,
+ paymentId: propsValue.paymentId,
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-invoice/src/lib/actions/ai/customer-payments/get-customer-payment-refund.ts b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/customer-payments/get-customer-payment-refund.ts
new file mode 100644
index 00000000000..691525c3d1d
--- /dev/null
+++ b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/customer-payments/get-customer-payment-refund.ts
@@ -0,0 +1,38 @@
+import { createAction } from '@activepieces/pieces-framework';
+
+import { zohoInvoiceAuth } from '../../../auth';
+import { zohoInvoiceAiProps } from '../../../common/ai-props';
+import { zohoInvoiceApi } from '../../../common/api';
+import { zohoInvoicePaymentRefundOutputSchema } from '../../../output-schemas';
+
+export const getCustomerPaymentRefundAction = createAction({
+ auth: zohoInvoiceAuth,
+ name: 'zoho_invoice_get_customer_payment_refund',
+ outputSchema: zohoInvoicePaymentRefundOutputSchema,
+ displayName: 'Get Customer Payment Refund',
+ description: 'Gets one refund of a customer payment.',
+ audience: 'ai',
+ classification: 'READ',
+ aiMetadata: {
+ description:
+ 'Returns one customer payment refund: date, refund mode, reference and amount. Use List Customer Payments for the payment ID and List Customer Payment Refunds for the refund ID.',
+ idempotent: true,
+ },
+ props: {
+ organizationId: zohoInvoiceAiProps.organizationId({ required: true }),
+ paymentId: zohoInvoiceAiProps.paymentId({ required: true }),
+ refundId: zohoInvoiceAiProps.idProp({
+ required: true,
+ displayName: 'Refund ID',
+ description: 'Customer payment refund ID. Use List Customer Payment Refunds to find it.',
+ }),
+ },
+ async run({ auth, propsValue }) {
+ return await zohoInvoiceApi.getCustomerPaymentRefund({
+ auth,
+ organizationId: propsValue.organizationId,
+ paymentId: propsValue.paymentId,
+ refundId: propsValue.refundId,
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-invoice/src/lib/actions/ai/customer-payments/get-customer-payment.ts b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/customer-payments/get-customer-payment.ts
new file mode 100644
index 00000000000..ec065470a9c
--- /dev/null
+++ b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/customer-payments/get-customer-payment.ts
@@ -0,0 +1,32 @@
+import { createAction } from '@activepieces/pieces-framework';
+
+import { zohoInvoiceAuth } from '../../../auth';
+import { zohoInvoiceAiProps } from '../../../common/ai-props';
+import { zohoInvoiceApi } from '../../../common/api';
+import { zohoInvoiceGetCustomerPaymentOutputSchema } from '../../../output-schemas';
+
+export const getCustomerPaymentAction = createAction({
+ auth: zohoInvoiceAuth,
+ name: 'zoho_invoice_get_customer_payment',
+ outputSchema: zohoInvoiceGetCustomerPaymentOutputSchema,
+ displayName: 'Get Customer Payment',
+ description: 'Gets one customer payment by ID.',
+ audience: 'ai',
+ classification: 'READ',
+ aiMetadata: {
+ description:
+ 'Returns one customer payment by ID with amount, mode, date, customer and the invoices it was applied to. Use List Customer Payments to find the ID.',
+ idempotent: true,
+ },
+ props: {
+ organizationId: zohoInvoiceAiProps.organizationId({ required: true }),
+ paymentId: zohoInvoiceAiProps.paymentId({ required: true }),
+ },
+ async run({ auth, propsValue }) {
+ return await zohoInvoiceApi.getCustomerPayment({
+ auth,
+ organizationId: propsValue.organizationId,
+ paymentId: propsValue.paymentId,
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-invoice/src/lib/actions/ai/customer-payments/list-customer-payment-refunds.ts b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/customer-payments/list-customer-payment-refunds.ts
new file mode 100644
index 00000000000..47e189f4182
--- /dev/null
+++ b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/customer-payments/list-customer-payment-refunds.ts
@@ -0,0 +1,36 @@
+import { createAction } from '@activepieces/pieces-framework';
+
+import { zohoInvoiceAuth } from '../../../auth';
+import { zohoInvoiceAiProps } from '../../../common/ai-props';
+import { zohoInvoiceApi } from '../../../common/api';
+import { zohoInvoiceListCustomerPaymentRefundsOutputSchema } from '../../../output-schemas';
+
+export const listCustomerPaymentRefundsAction = createAction({
+ auth: zohoInvoiceAuth,
+ name: 'zoho_invoice_list_customer_payment_refunds',
+ outputSchema: zohoInvoiceListCustomerPaymentRefundsOutputSchema,
+ displayName: 'List Customer Payment Refunds',
+ description: 'Lists the refunds of a customer payment.',
+ audience: 'ai',
+ classification: 'SEARCH',
+ aiMetadata: {
+ description:
+ 'Lists the refunds of one customer payment with payment_refund_id, date, mode and amount, one page at a time. Use List Customer Payments to find the ID.',
+ idempotent: true,
+ },
+ props: {
+ organizationId: zohoInvoiceAiProps.organizationId({ required: true }),
+ paymentId: zohoInvoiceAiProps.paymentId({ required: true }),
+ page: zohoInvoiceAiProps.page({ required: false }),
+ perPage: zohoInvoiceAiProps.perPage({ required: false }),
+ },
+ async run({ auth, propsValue }) {
+ return await zohoInvoiceApi.listCustomerPaymentRefunds({
+ auth,
+ organizationId: propsValue.organizationId,
+ paymentId: propsValue.paymentId,
+ page: propsValue.page,
+ perPage: propsValue.perPage,
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-invoice/src/lib/actions/ai/customer-payments/list-customer-payments.ts b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/customer-payments/list-customer-payments.ts
new file mode 100644
index 00000000000..03b8812256e
--- /dev/null
+++ b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/customer-payments/list-customer-payments.ts
@@ -0,0 +1,76 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoInvoiceAuth } from '../../../auth';
+import { zohoInvoiceAiProps } from '../../../common/ai-props';
+import { zohoInvoiceApi } from '../../../common/api';
+import { zohoInvoiceListCustomerPaymentsOutputSchema } from '../../../output-schemas';
+
+export const listCustomerPaymentsAction = createAction({
+ auth: zohoInvoiceAuth,
+ name: 'zoho_invoice_list_customer_payments',
+ outputSchema: zohoInvoiceListCustomerPaymentsOutputSchema,
+ displayName: 'List Customer Payments',
+ description: 'Lists payments received from customers, one page at a time.',
+ audience: 'ai',
+ classification: 'SEARCH',
+ aiMetadata: {
+ description:
+ 'Lists customer payments with payment_id, customer, amount, mode, date and the invoices paid, one page at a time. Filter by payment mode or date, or search by reference, customer name or description.',
+ idempotent: true,
+ },
+ props: {
+ organizationId: zohoInvoiceAiProps.organizationId({ required: true }),
+ filterBy: Property.StaticDropdown({
+ displayName: 'Payment Mode',
+ description: 'Only payments made this way. Empty = all.',
+ required: false,
+ options: {
+ disabled: false,
+ options: [
+ { label: 'All', value: 'PaymentMode.All' },
+ { label: 'Check', value: 'PaymentMode.Check' },
+ { label: 'Cash', value: 'PaymentMode.Cash' },
+ { label: 'Bank Transfer', value: 'PaymentMode.BankTransfer' },
+ { label: 'PayPal', value: 'PaymentMode.Paypal' },
+ { label: 'Credit Card', value: 'PaymentMode.CreditCard' },
+ { label: 'Google Checkout', value: 'PaymentMode.GoogleCheckout' },
+ { label: 'Credit', value: 'PaymentMode.Credit' },
+ { label: 'Authorize.Net', value: 'PaymentMode.Authorizenet' },
+ { label: 'Bank Remittance', value: 'PaymentMode.BankRemittance' },
+ { label: 'Payflow Pro', value: 'PaymentMode.Payflowpro' },
+ { label: 'Stripe', value: 'PaymentMode.Stripe' },
+ { label: '2Checkout', value: 'PaymentMode.TwoCheckout' },
+ { label: 'Braintree', value: 'PaymentMode.Braintree' },
+ { label: 'Others', value: 'PaymentMode.Others' },
+ ],
+ },
+ }),
+ date: Property.ShortText({
+ displayName: 'Date',
+ description: 'Only payments made on this day, yyyy-mm-dd.',
+ required: false,
+ }),
+ searchText: zohoInvoiceAiProps.searchText({
+ required: false,
+ description: 'Search by reference number, customer name or payment description.',
+ }),
+ sortColumn: zohoInvoiceAiProps.sortColumn({
+ required: false,
+ description: 'Field to sort by, e.g. date, customer_name, amount or reference_number.',
+ }),
+ page: zohoInvoiceAiProps.page({ required: false }),
+ perPage: zohoInvoiceAiProps.perPage({ required: false }),
+ },
+ async run({ auth, propsValue }) {
+ return await zohoInvoiceApi.listCustomerPayments({
+ auth,
+ organizationId: propsValue.organizationId,
+ filterBy: propsValue.filterBy,
+ date: propsValue.date,
+ searchText: propsValue.searchText,
+ sortColumn: propsValue.sortColumn,
+ page: propsValue.page,
+ perPage: propsValue.perPage,
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-invoice/src/lib/actions/ai/customer-payments/refund-customer-payment.ts b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/customer-payments/refund-customer-payment.ts
new file mode 100644
index 00000000000..5f3b09c11b0
--- /dev/null
+++ b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/customer-payments/refund-customer-payment.ts
@@ -0,0 +1,69 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoInvoiceAuth } from '../../../auth';
+import { zohoInvoiceAiProps } from '../../../common/ai-props';
+import { zohoInvoiceApi } from '../../../common/api';
+import { zohoInvoiceUtils } from '../../../common/utils';
+import { zohoInvoicePaymentRefundOutputSchema } from '../../../output-schemas';
+
+export const refundCustomerPaymentAction = createAction({
+ auth: zohoInvoiceAuth,
+ name: 'zoho_invoice_refund_customer_payment',
+ outputSchema: zohoInvoicePaymentRefundOutputSchema,
+ displayName: 'Refund Customer Payment',
+ description: 'Records a refund of the excess part of a customer payment.',
+ audience: 'ai',
+ classification: 'WRITE',
+ aiMetadata: {
+ description:
+ 'Records a refund of the unapplied (excess) amount of a customer payment; it does not move money itself and fails when the payment has no excess. Use List Customer Payments to find the ID. Not idempotent: each call records another refund.',
+ idempotent: false,
+ },
+ props: {
+ organizationId: zohoInvoiceAiProps.organizationId({ required: true }),
+ paymentId: zohoInvoiceAiProps.paymentId({ required: true }),
+ date: Property.ShortText({
+ displayName: 'Date',
+ description: 'Refund date, yyyy-mm-dd.',
+ required: true,
+ }),
+ amount: Property.Number({
+ displayName: 'Amount',
+ description: "Amount refunded, at most the payment's unapplied amount.",
+ required: true,
+ }),
+ refundMode: Property.ShortText({
+ displayName: 'Refund Mode',
+ description: 'How the refund was paid, e.g. "cash", "check" or "banktransfer".',
+ required: false,
+ }),
+ referenceNumber: Property.ShortText({
+ displayName: 'Reference Number',
+ description: 'Your own reference for the refund.',
+ required: false,
+ }),
+ description: Property.ShortText({
+ displayName: 'Description',
+ description: 'Note about the refund.',
+ required: false,
+ }),
+ additionalFields: zohoInvoiceAiProps.additionalFields({ required: false }),
+ },
+ async run({ auth, propsValue }) {
+ return await zohoInvoiceApi.refundCustomerPayment({
+ auth,
+ organizationId: propsValue.organizationId,
+ paymentId: propsValue.paymentId,
+ body: {
+ ...(propsValue.additionalFields ?? {}),
+ ...zohoInvoiceUtils.compact({
+ date: propsValue.date,
+ amount: propsValue.amount,
+ refund_mode: propsValue.refundMode,
+ reference_number: propsValue.referenceNumber,
+ description: propsValue.description,
+ }),
+ },
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-invoice/src/lib/actions/ai/customer-payments/update-customer-payment-custom-fields.ts b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/customer-payments/update-customer-payment-custom-fields.ts
new file mode 100644
index 00000000000..d9284c3a283
--- /dev/null
+++ b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/customer-payments/update-customer-payment-custom-fields.ts
@@ -0,0 +1,58 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoInvoiceAuth } from '../../../auth';
+import { zohoInvoiceAiProps } from '../../../common/ai-props';
+import { zohoInvoiceApi } from '../../../common/api';
+import { zohoInvoiceUtils } from '../../../common/utils';
+import { zohoInvoiceMessageOutputSchema } from '../../../output-schemas';
+
+export const updateCustomerPaymentCustomFieldsAction = createAction({
+ auth: zohoInvoiceAuth,
+ name: 'zoho_invoice_update_customer_payment_custom_fields',
+ outputSchema: zohoInvoiceMessageOutputSchema,
+ displayName: 'Update Customer Payment Custom Fields',
+ description: 'Changes custom field values on a customer payment.',
+ audience: 'ai',
+ classification: 'WRITE',
+ aiMetadata: {
+ description:
+ "Sets custom field values on a customer payment without touching its amount or invoice allocation; prefer it over Update Customer Payment for custom fields. Use List Customer Payments to find the ID. Get Customer Payment lists a custom field's customfield_id only once that field has a value on the payment; otherwise ask the user for the ID.",
+ idempotent: true,
+ },
+ props: {
+ organizationId: zohoInvoiceAiProps.organizationId({ required: true }),
+ paymentId: zohoInvoiceAiProps.paymentId({ required: true }),
+ customFields: Property.Array({
+ displayName: 'Custom Fields',
+ description: 'Custom fields to set.',
+ required: true,
+ properties: {
+ customfieldId: zohoInvoiceAiProps.idProp({
+ required: true,
+ displayName: 'Custom Field ID',
+ description: 'Custom field ID. Use Get Customer Payment to find it.',
+ }),
+ value: Property.ShortText({
+ displayName: 'Value',
+ description: 'New value of the custom field.',
+ required: true,
+ }),
+ },
+ }),
+ },
+ async run({ auth, propsValue }) {
+ return await zohoInvoiceApi.updateCustomerPaymentCustomFields({
+ auth,
+ organizationId: propsValue.organizationId,
+ paymentId: propsValue.paymentId,
+ customFields: zohoInvoiceUtils
+ .toRecords({ rows: propsValue.customFields, propName: 'Custom Fields' })
+ .map((field) =>
+ zohoInvoiceUtils.compact({
+ customfield_id: field['customfieldId'],
+ value: field['value'],
+ }),
+ ),
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-invoice/src/lib/actions/ai/customer-payments/update-customer-payment-refund.ts b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/customer-payments/update-customer-payment-refund.ts
new file mode 100644
index 00000000000..00392688cb8
--- /dev/null
+++ b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/customer-payments/update-customer-payment-refund.ts
@@ -0,0 +1,78 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoInvoiceAuth } from '../../../auth';
+import { zohoInvoiceAiProps } from '../../../common/ai-props';
+import { zohoInvoiceApi } from '../../../common/api';
+import { zohoInvoiceUtils } from '../../../common/utils';
+import { zohoInvoicePaymentRefundOutputSchema } from '../../../output-schemas';
+
+export const updateCustomerPaymentRefundAction = createAction({
+ auth: zohoInvoiceAuth,
+ name: 'zoho_invoice_update_customer_payment_refund',
+ outputSchema: zohoInvoicePaymentRefundOutputSchema,
+ displayName: 'Update Customer Payment Refund',
+ description: 'Changes a refund recorded against a customer payment.',
+ audience: 'ai',
+ classification: 'WRITE',
+ aiMetadata: {
+ description:
+ 'Changes the date, amount, mode, reference or description of a customer payment refund. Fields left empty keep their current value. Use List Customer Payments for the payment ID and List Customer Payment Refunds for the refund ID.',
+ idempotent: true,
+ },
+ props: {
+ organizationId: zohoInvoiceAiProps.organizationId({ required: true }),
+ paymentId: zohoInvoiceAiProps.paymentId({ required: true }),
+ refundId: zohoInvoiceAiProps.idProp({
+ required: true,
+ displayName: 'Refund ID',
+ description: 'Customer payment refund ID. Use List Customer Payment Refunds to find it.',
+ }),
+ date: Property.ShortText({
+ displayName: 'Date',
+ description: 'New refund date, yyyy-mm-dd. Empty = unchanged.',
+ required: false,
+ }),
+ amount: Property.Number({
+ displayName: 'Amount',
+ description: 'New refund amount. Empty = unchanged.',
+ required: false,
+ }),
+ refundMode: Property.ShortText({
+ displayName: 'Refund Mode',
+ description: 'New refund mode, e.g. "cash" or "banktransfer". Empty = unchanged.',
+ required: false,
+ }),
+ referenceNumber: Property.ShortText({
+ displayName: 'Reference Number',
+ description: 'New reference number. Empty = unchanged.',
+ required: false,
+ }),
+ description: Property.ShortText({
+ displayName: 'Description',
+ description: 'New description. Empty = unchanged.',
+ required: false,
+ }),
+ },
+ async run({ auth, propsValue }) {
+ const { organizationId, paymentId, refundId } = propsValue;
+ const current = await zohoInvoiceApi.getCustomerPaymentRefund({
+ auth,
+ organizationId,
+ paymentId,
+ refundId,
+ });
+ return await zohoInvoiceApi.updateCustomerPaymentRefund({
+ auth,
+ organizationId,
+ paymentId,
+ refundId,
+ body: zohoInvoiceUtils.compact({
+ date: propsValue.date ?? current.payment_refunds?.date,
+ amount: propsValue.amount ?? current.payment_refunds?.amount,
+ refund_mode: propsValue.refundMode,
+ reference_number: propsValue.referenceNumber,
+ description: propsValue.description,
+ }),
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-invoice/src/lib/actions/ai/customer-payments/update-customer-payment.ts b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/customer-payments/update-customer-payment.ts
new file mode 100644
index 00000000000..ba7f46ee678
--- /dev/null
+++ b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/customer-payments/update-customer-payment.ts
@@ -0,0 +1,128 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoInvoiceAuth } from '../../../auth';
+import { zohoInvoiceAiProps } from '../../../common/ai-props';
+import { zohoInvoiceApi } from '../../../common/api';
+import { zohoInvoiceUtils } from '../../../common/utils';
+import { zohoInvoicePaymentOutputSchema } from '../../../output-schemas';
+
+export const updateCustomerPaymentAction = createAction({
+ auth: zohoInvoiceAuth,
+ name: 'zoho_invoice_update_customer_payment',
+ outputSchema: zohoInvoicePaymentOutputSchema,
+ displayName: 'Update Customer Payment',
+ description: 'Changes a customer payment or how it is applied to invoices.',
+ audience: 'ai',
+ classification: 'WRITE',
+ aiMetadata: {
+ description:
+ 'Changes a customer payment. Fields left empty keep their current value; when Invoices is empty the current invoice allocation is resent and re-applied as-is. Use List Customer Payments to find the ID; use Update Customer Payment Custom Fields to change only custom fields.',
+ idempotent: true,
+ },
+ props: {
+ organizationId: zohoInvoiceAiProps.organizationId({ required: true }),
+ paymentId: zohoInvoiceAiProps.paymentId({ required: true }),
+ customerId: zohoInvoiceAiProps.contactId({
+ required: false,
+ displayName: 'Customer ID',
+ description: 'New customer ID. Use List Contacts to find it. Empty = unchanged.',
+ }),
+ paymentMode: Property.ShortText({
+ displayName: 'Payment Mode',
+ description:
+ 'New payment mode: check, cash, creditcard, banktransfer, bankremittance, autotransaction or others. Empty = unchanged.',
+ required: false,
+ }),
+ amount: Property.Number({
+ displayName: 'Amount',
+ description: 'New total amount received. Empty = unchanged.',
+ required: false,
+ }),
+ date: Property.ShortText({
+ displayName: 'Date',
+ description: 'New payment date, yyyy-mm-dd. Empty = unchanged.',
+ required: false,
+ }),
+ invoices: Property.Array({
+ displayName: 'Invoices',
+ description:
+ 'Full new allocation of the payment to invoices. Empty = current allocation unchanged.',
+ required: false,
+ properties: {
+ invoiceId: zohoInvoiceAiProps.invoiceId({ required: true }),
+ invoicePaymentId: zohoInvoiceAiProps.idProp({
+ required: false,
+ displayName: 'Invoice Payment ID',
+ description:
+ 'ID of an existing allocation to change. Use Get Customer Payment to find it. Empty = a new allocation.',
+ }),
+ amountApplied: Property.Number({
+ displayName: 'Amount Applied',
+ description: 'Amount of the payment applied to this invoice.',
+ required: true,
+ }),
+ },
+ }),
+ referenceNumber: Property.ShortText({
+ displayName: 'Reference Number',
+ description: 'New reference number. Empty = unchanged.',
+ required: false,
+ }),
+ description: Property.ShortText({
+ displayName: 'Description',
+ description: 'New description. Empty = unchanged.',
+ required: false,
+ }),
+ bankCharges: Property.Number({
+ displayName: 'Bank Charges',
+ description: 'New bank charges. Empty = unchanged.',
+ required: false,
+ }),
+ additionalFields: zohoInvoiceAiProps.additionalFields({ required: false }),
+ },
+ async run({ auth, propsValue }) {
+ const { organizationId, paymentId } = propsValue;
+ const current = await zohoInvoiceApi.getCustomerPayment({ auth, organizationId, paymentId });
+ return await zohoInvoiceApi.updateCustomerPayment({
+ auth,
+ organizationId,
+ paymentId,
+ body: {
+ ...zohoInvoiceUtils.compact({
+ customer_id: current.payment?.customer_id,
+ payment_mode: current.payment?.payment_mode,
+ amount: current.payment?.amount,
+ date: current.payment?.date,
+ invoices: current.payment?.invoices?.map((invoice) =>
+ zohoInvoiceUtils.compact({
+ invoice_id: invoice.invoice_id,
+ invoice_payment_id: invoice.invoice_payment_id,
+ amount_applied: invoice.amount_applied,
+ }),
+ ),
+ }),
+ ...(propsValue.additionalFields ?? {}),
+ ...zohoInvoiceUtils.compact({
+ customer_id: propsValue.customerId,
+ payment_mode: propsValue.paymentMode,
+ amount: propsValue.amount,
+ date: propsValue.date,
+ invoices: propsValue.invoices?.length
+ ? zohoInvoiceUtils
+ .toRecords({ rows: propsValue.invoices, propName: 'Invoices' })
+ .map((invoice) =>
+ zohoInvoiceUtils.compact({
+ invoice_id: invoice['invoiceId'],
+ invoice_payment_id: invoice['invoicePaymentId'],
+ amount_applied: invoice['amountApplied'],
+ }),
+ )
+ : undefined,
+ reference_number: propsValue.referenceNumber,
+ description: propsValue.description,
+ bank_charges: propsValue.bankCharges,
+ }),
+ },
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-invoice/src/lib/actions/ai/estimates/add-estimate-comment.ts b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/estimates/add-estimate-comment.ts
new file mode 100644
index 00000000000..551b82f1224
--- /dev/null
+++ b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/estimates/add-estimate-comment.ts
@@ -0,0 +1,50 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoInvoiceAuth } from '../../../auth';
+import { zohoInvoiceAiProps } from '../../../common/ai-props';
+import { zohoInvoiceApi } from '../../../common/api';
+import { zohoInvoiceUtils } from '../../../common/utils';
+import { zohoInvoiceAddEstimateCommentOutputSchema } from '../../../output-schemas';
+
+export const addEstimateCommentAction = createAction({
+ auth: zohoInvoiceAuth,
+ name: 'zoho_invoice_add_estimate_comment',
+ outputSchema: zohoInvoiceAddEstimateCommentOutputSchema,
+ displayName: 'Add Estimate Comment',
+ description: 'Adds a comment to an estimate.',
+ audience: 'ai',
+ classification: 'WRITE',
+ aiMetadata: {
+ description:
+ 'Adds a comment to an estimate, optionally visible to the customer. Use List Estimates to find the ID. Not idempotent: each call adds another comment.',
+ idempotent: false,
+ },
+ props: {
+ organizationId: zohoInvoiceAiProps.organizationId({ required: true }),
+ estimateId: zohoInvoiceAiProps.estimateId({ required: true }),
+ description: Property.LongText({
+ displayName: 'Comment',
+ description: 'Text of the comment.',
+ required: true,
+ }),
+ showCommentToClients: zohoInvoiceAiProps.yesNo({
+ required: false,
+ displayName: 'Show to Customer',
+ description:
+ 'Yes to show the comment in the customer portal. Empty = the vendor default (hidden).',
+ }),
+ },
+ async run({ auth, propsValue }) {
+ return await zohoInvoiceApi.addEstimateComment({
+ auth,
+ organizationId: propsValue.organizationId,
+ estimateId: propsValue.estimateId,
+ body: zohoInvoiceUtils.compact({
+ description: propsValue.description,
+ show_comment_to_clients: zohoInvoiceUtils.toOptionalBoolean({
+ value: propsValue.showCommentToClients,
+ }),
+ }),
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-invoice/src/lib/actions/ai/estimates/create-estimate.ts b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/estimates/create-estimate.ts
new file mode 100644
index 00000000000..19cf8735aa3
--- /dev/null
+++ b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/estimates/create-estimate.ts
@@ -0,0 +1,113 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoInvoiceAuth } from '../../../auth';
+import { zohoInvoiceAiProps } from '../../../common/ai-props';
+import { zohoInvoiceApi } from '../../../common/api';
+import { zohoInvoiceUtils } from '../../../common/utils';
+import { zohoInvoiceEstimateOutputSchema } from '../../../output-schemas';
+
+export const createEstimateAction = createAction({
+ auth: zohoInvoiceAuth,
+ name: 'zoho_invoice_create_estimate',
+ outputSchema: zohoInvoiceEstimateOutputSchema,
+ displayName: 'Create Estimate',
+ description: 'Creates a draft estimate (quote) for a customer.',
+ audience: 'ai',
+ classification: 'WRITE',
+ aiMetadata: {
+ description:
+ 'Creates a draft estimate for a customer; it is not emailed (use Email Estimate for that). Use List Contacts for the customer ID and List Items for item IDs. Not idempotent: each call creates another estimate.',
+ idempotent: false,
+ },
+ props: {
+ organizationId: zohoInvoiceAiProps.organizationId({ required: true }),
+ customerId: zohoInvoiceAiProps.contactId({
+ required: true,
+ displayName: 'Customer ID',
+ description: 'Customer contact ID. Use List Contacts to find it.',
+ }),
+ lineItems: Property.Array({
+ displayName: 'Line Items',
+ description: 'Lines of the estimate.',
+ required: true,
+ properties: {
+ itemId: Property.ShortText({
+ displayName: 'Item ID',
+ description: 'Item ID. Use List Items to find it.',
+ required: true,
+ }),
+ name: Property.ShortText({ displayName: 'Name', required: false }),
+ description: Property.LongText({ displayName: 'Description', required: false }),
+ rate: Property.Number({ displayName: 'Rate', required: true }),
+ quantity: Property.Number({ displayName: 'Quantity', required: true }),
+ discount: Property.ShortText({
+ displayName: 'Discount',
+ description: 'Flat amount, or a percentage such as "10%".',
+ required: false,
+ }),
+ taxId: Property.ShortText({
+ displayName: 'Tax ID',
+ description: 'Tax ID. Use List Taxes to find it.',
+ required: false,
+ }),
+ },
+ }),
+ estimateNumber: Property.ShortText({
+ displayName: 'Estimate Number',
+ description: 'Custom estimate number. Empty = the next auto-generated number.',
+ required: false,
+ }),
+ referenceNumber: Property.ShortText({
+ displayName: 'Reference Number',
+ description: 'Reference number such as a purchase order number.',
+ required: false,
+ }),
+ date: Property.ShortText({
+ displayName: 'Date',
+ description: 'Estimate date, as yyyy-mm-dd. Empty = today.',
+ required: false,
+ }),
+ expiryDate: Property.ShortText({
+ displayName: 'Expiry Date',
+ description: 'Date the estimate expires, as yyyy-mm-dd.',
+ required: false,
+ }),
+ notes: Property.LongText({
+ displayName: 'Notes',
+ description: 'Notes shown to the customer.',
+ required: false,
+ }),
+ terms: Property.LongText({
+ displayName: 'Terms',
+ description: 'Terms and conditions shown on the estimate.',
+ required: false,
+ }),
+ templateId: zohoInvoiceAiProps.templateId({
+ required: false,
+ description:
+ 'PDF template ID. Use List Estimate Templates to find it. Empty = the default template.',
+ }),
+ additionalFields: zohoInvoiceAiProps.additionalFields({ required: false }),
+ },
+ async run({ auth, propsValue }) {
+ return await zohoInvoiceApi.createEstimate({
+ auth,
+ organizationId: propsValue.organizationId,
+ ignoreAutoNumberGeneration: propsValue.estimateNumber === undefined ? undefined : true,
+ body: {
+ ...(propsValue.additionalFields ?? {}),
+ ...zohoInvoiceUtils.compact({
+ customer_id: propsValue.customerId,
+ line_items: zohoInvoiceUtils.toLineItems({ rows: propsValue.lineItems }),
+ estimate_number: propsValue.estimateNumber,
+ reference_number: propsValue.referenceNumber,
+ date: propsValue.date,
+ expiry_date: propsValue.expiryDate,
+ notes: propsValue.notes,
+ terms: propsValue.terms,
+ template_id: propsValue.templateId,
+ }),
+ },
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-invoice/src/lib/actions/ai/estimates/delete-estimate-comment.ts b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/estimates/delete-estimate-comment.ts
new file mode 100644
index 00000000000..94c17b9a2ba
--- /dev/null
+++ b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/estimates/delete-estimate-comment.ts
@@ -0,0 +1,37 @@
+import { createAction } from '@activepieces/pieces-framework';
+
+import { zohoInvoiceAuth } from '../../../auth';
+import { zohoInvoiceAiProps } from '../../../common/ai-props';
+import { zohoInvoiceApi } from '../../../common/api';
+import { zohoInvoiceMessageOutputSchema } from '../../../output-schemas';
+
+export const deleteEstimateCommentAction = createAction({
+ auth: zohoInvoiceAuth,
+ name: 'zoho_invoice_delete_estimate_comment',
+ outputSchema: zohoInvoiceMessageOutputSchema,
+ displayName: 'Delete Estimate Comment',
+ description: 'Deletes a comment from an estimate.',
+ audience: 'ai',
+ classification: 'DESTRUCTIVE',
+ aiMetadata: {
+ description:
+ 'Permanently deletes one comment from an estimate. Use List Estimates for the estimate ID and List Estimate Comments for the comment ID. Cannot be undone.',
+ idempotent: false,
+ },
+ props: {
+ organizationId: zohoInvoiceAiProps.organizationId({ required: true }),
+ estimateId: zohoInvoiceAiProps.estimateId({ required: true }),
+ commentId: zohoInvoiceAiProps.commentId({
+ required: true,
+ description: 'Comment ID. Use List Estimate Comments to find it.',
+ }),
+ },
+ async run({ auth, propsValue }) {
+ return await zohoInvoiceApi.deleteEstimateComment({
+ auth,
+ organizationId: propsValue.organizationId,
+ estimateId: propsValue.estimateId,
+ commentId: propsValue.commentId,
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-invoice/src/lib/actions/ai/estimates/delete-estimate.ts b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/estimates/delete-estimate.ts
new file mode 100644
index 00000000000..325287a1e8e
--- /dev/null
+++ b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/estimates/delete-estimate.ts
@@ -0,0 +1,32 @@
+import { createAction } from '@activepieces/pieces-framework';
+
+import { zohoInvoiceAuth } from '../../../auth';
+import { zohoInvoiceAiProps } from '../../../common/ai-props';
+import { zohoInvoiceApi } from '../../../common/api';
+import { zohoInvoiceMessageOutputSchema } from '../../../output-schemas';
+
+export const deleteEstimateAction = createAction({
+ auth: zohoInvoiceAuth,
+ name: 'zoho_invoice_delete_estimate',
+ outputSchema: zohoInvoiceMessageOutputSchema,
+ displayName: 'Delete Estimate',
+ description: 'Deletes an estimate.',
+ audience: 'ai',
+ classification: 'DESTRUCTIVE',
+ aiMetadata: {
+ description:
+ 'Permanently deletes an estimate. Use List Estimates to find the ID. Cannot be undone.',
+ idempotent: false,
+ },
+ props: {
+ organizationId: zohoInvoiceAiProps.organizationId({ required: true }),
+ estimateId: zohoInvoiceAiProps.estimateId({ required: true }),
+ },
+ async run({ auth, propsValue }) {
+ return await zohoInvoiceApi.deleteEstimate({
+ auth,
+ organizationId: propsValue.organizationId,
+ estimateId: propsValue.estimateId,
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-invoice/src/lib/actions/ai/estimates/email-estimate.ts b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/estimates/email-estimate.ts
new file mode 100644
index 00000000000..91f03f3a0ef
--- /dev/null
+++ b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/estimates/email-estimate.ts
@@ -0,0 +1,68 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoInvoiceAuth } from '../../../auth';
+import { zohoInvoiceAiProps } from '../../../common/ai-props';
+import { zohoInvoiceApi } from '../../../common/api';
+import { zohoInvoiceUtils } from '../../../common/utils';
+import { zohoInvoiceMessageOutputSchema } from '../../../output-schemas';
+
+export const emailEstimateAction = createAction({
+ auth: zohoInvoiceAuth,
+ name: 'zoho_invoice_email_estimate',
+ outputSchema: zohoInvoiceMessageOutputSchema,
+ displayName: 'Email Estimate',
+ description: 'Emails an estimate to the customer.',
+ audience: 'ai',
+ classification: 'WRITE',
+ aiMetadata: {
+ description:
+ 'Sends a real email with the estimate to the given recipients and marks it as sent. Use Get Estimate Email Content to preview the default subject and body, Mark Estimate as Sent to change the status without emailing, and Email Multiple Estimates for several at once. Not idempotent: each call sends another email.',
+ idempotent: false,
+ },
+ props: {
+ organizationId: zohoInvoiceAiProps.organizationId({ required: true }),
+ estimateId: zohoInvoiceAiProps.estimateId({ required: true }),
+ toMailIds: Property.Array({
+ displayName: 'To',
+ description: 'Recipient email addresses.',
+ required: true,
+ }),
+ ccMailIds: Property.Array({
+ displayName: 'CC',
+ description: 'Email addresses to copy.',
+ required: false,
+ }),
+ subject: Property.ShortText({
+ displayName: 'Subject',
+ description: 'Email subject. Empty = the default template subject.',
+ required: false,
+ }),
+ body: Property.LongText({
+ displayName: 'Body',
+ description: 'Email body; HTML is allowed. Empty = the default template body.',
+ required: false,
+ }),
+ sendFromOrgEmailId: zohoInvoiceAiProps.yesNo({
+ required: false,
+ displayName: 'Send From Organization Email',
+ description:
+ "Yes to send from the organization's email address instead of the user's. Empty = the vendor default.",
+ }),
+ },
+ async run({ auth, propsValue }) {
+ return await zohoInvoiceApi.emailEstimate({
+ auth,
+ organizationId: propsValue.organizationId,
+ estimateId: propsValue.estimateId,
+ body: zohoInvoiceUtils.compact({
+ to_mail_ids: propsValue.toMailIds,
+ cc_mail_ids: propsValue.ccMailIds,
+ subject: propsValue.subject,
+ body: propsValue.body,
+ send_from_org_email_id: zohoInvoiceUtils.toOptionalBoolean({
+ value: propsValue.sendFromOrgEmailId,
+ }),
+ }),
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-invoice/src/lib/actions/ai/estimates/email-multiple-estimates.ts b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/estimates/email-multiple-estimates.ts
new file mode 100644
index 00000000000..ddd31d13712
--- /dev/null
+++ b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/estimates/email-multiple-estimates.ts
@@ -0,0 +1,43 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoInvoiceAuth } from '../../../auth';
+import { zohoInvoiceAiProps } from '../../../common/ai-props';
+import { zohoInvoiceApi } from '../../../common/api';
+import { zohoInvoiceMessageOutputSchema } from '../../../output-schemas';
+
+export const emailMultipleEstimatesAction = createAction({
+ auth: zohoInvoiceAuth,
+ name: 'zoho_invoice_email_multiple_estimates',
+ outputSchema: zohoInvoiceMessageOutputSchema,
+ displayName: 'Email Multiple Estimates',
+ description: 'Emails several estimates to their customers in one call.',
+ audience: 'ai',
+ classification: 'WRITE',
+ aiMetadata: {
+ description:
+ "Sends real emails for several estimates at once, each to its customer's contacts with the default template. Use Email Estimate to choose recipients or text for one estimate. Use List Estimates to find the IDs. Not idempotent: each call sends the emails again.",
+ idempotent: false,
+ },
+ props: {
+ organizationId: zohoInvoiceAiProps.organizationId({ required: true }),
+ estimateIds: Property.Array({
+ displayName: 'Estimate IDs',
+ description: 'IDs of the estimates to email. Use List Estimates to find them.',
+ required: true,
+ }),
+ },
+ async run({ auth, propsValue }) {
+ const estimateIds = propsValue.estimateIds;
+ if (
+ estimateIds.length === 0 ||
+ !estimateIds.every((id): id is string => typeof id === 'string' && id !== '')
+ ) {
+ throw new Error('Estimate IDs must be a non-empty list of estimate ID strings.');
+ }
+ return await zohoInvoiceApi.emailMultipleEstimates({
+ auth,
+ organizationId: propsValue.organizationId,
+ estimateIds,
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-invoice/src/lib/actions/ai/estimates/export-estimates-pdf.ts b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/estimates/export-estimates-pdf.ts
new file mode 100644
index 00000000000..6eb9d57e187
--- /dev/null
+++ b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/estimates/export-estimates-pdf.ts
@@ -0,0 +1,47 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoInvoiceAuth } from '../../../auth';
+import { zohoInvoiceAiProps } from '../../../common/ai-props';
+import { zohoInvoiceApi } from '../../../common/api';
+import { zohoInvoiceGetInvoiceAttachmentOutputSchema } from '../../../output-schemas';
+
+export const exportEstimatesPdfAction = createAction({
+ auth: zohoInvoiceAuth,
+ name: 'zoho_invoice_export_estimates_pdf',
+ outputSchema: zohoInvoiceGetInvoiceAttachmentOutputSchema,
+ displayName: 'Export Estimates as PDF',
+ description: 'Exports one or more estimates as a single PDF file.',
+ audience: 'ai',
+ classification: 'READ',
+ aiMetadata: {
+ description:
+ 'Renders the given estimates into one PDF file and returns it as a file reference that later steps can attach or upload. Use List Estimates to find the IDs.',
+ idempotent: true,
+ },
+ props: {
+ organizationId: zohoInvoiceAiProps.organizationId({ required: true }),
+ estimateIds: Property.Array({
+ displayName: 'Estimate IDs',
+ description: 'IDs of the estimates to export. Use List Estimates to find them.',
+ required: true,
+ }),
+ },
+ async run(context) {
+ const { auth, propsValue } = context;
+ const estimateIds = propsValue.estimateIds;
+ if (
+ estimateIds.length === 0 ||
+ !estimateIds.every((id): id is string => typeof id === 'string' && id !== '')
+ ) {
+ throw new Error('Estimate IDs must be a non-empty list of estimate ID strings.');
+ }
+ const content = await zohoInvoiceApi.exportEstimatesPdf({
+ auth,
+ organizationId: propsValue.organizationId,
+ estimateIds,
+ });
+ const fileName = 'estimates.pdf';
+ const file = await context.files.write({ fileName, data: Buffer.from(content) });
+ return { file, fileName };
+ },
+});
diff --git a/packages/pieces/community/zoho-invoice/src/lib/actions/ai/estimates/get-estimate-email-content.ts b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/estimates/get-estimate-email-content.ts
new file mode 100644
index 00000000000..8f5fb02f6f3
--- /dev/null
+++ b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/estimates/get-estimate-email-content.ts
@@ -0,0 +1,39 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoInvoiceAuth } from '../../../auth';
+import { zohoInvoiceAiProps } from '../../../common/ai-props';
+import { zohoInvoiceApi } from '../../../common/api';
+import { zohoInvoiceGetEstimateEmailContentOutputSchema } from '../../../output-schemas';
+
+export const getEstimateEmailContentAction = createAction({
+ auth: zohoInvoiceAuth,
+ name: 'zoho_invoice_get_estimate_email_content',
+ outputSchema: zohoInvoiceGetEstimateEmailContentOutputSchema,
+ displayName: 'Get Estimate Email Content',
+ description: 'Gets the default email subject, body and recipients for an estimate.',
+ audience: 'ai',
+ classification: 'READ',
+ aiMetadata: {
+ description:
+ 'Returns the subject, body, recipients and available email templates Zoho would use to email an estimate, without sending anything. Use it before Email Estimate to reuse or adjust the text. Use List Estimates to find the ID.',
+ idempotent: true,
+ },
+ props: {
+ organizationId: zohoInvoiceAiProps.organizationId({ required: true }),
+ estimateId: zohoInvoiceAiProps.estimateId({ required: true }),
+ emailTemplateId: Property.ShortText({
+ displayName: 'Email Template ID',
+ description:
+ 'Email template ID, from the emailtemplates list returned by Get Estimate Email Content. Empty = the default email template.',
+ required: false,
+ }),
+ },
+ async run({ auth, propsValue }) {
+ return await zohoInvoiceApi.getEstimateEmailContent({
+ auth,
+ organizationId: propsValue.organizationId,
+ estimateId: propsValue.estimateId,
+ emailTemplateId: propsValue.emailTemplateId,
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-invoice/src/lib/actions/ai/estimates/get-estimate.ts b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/estimates/get-estimate.ts
new file mode 100644
index 00000000000..92805e81dc1
--- /dev/null
+++ b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/estimates/get-estimate.ts
@@ -0,0 +1,32 @@
+import { createAction } from '@activepieces/pieces-framework';
+
+import { zohoInvoiceAuth } from '../../../auth';
+import { zohoInvoiceAiProps } from '../../../common/ai-props';
+import { zohoInvoiceApi } from '../../../common/api';
+import { zohoInvoiceEstimateOutputSchema } from '../../../output-schemas';
+
+export const getEstimateAction = createAction({
+ auth: zohoInvoiceAuth,
+ name: 'zoho_invoice_get_estimate',
+ outputSchema: zohoInvoiceEstimateOutputSchema,
+ displayName: 'Get Estimate',
+ description: 'Gets one estimate.',
+ audience: 'ai',
+ classification: 'READ',
+ aiMetadata: {
+ description:
+ 'Returns one estimate by ID: customer, status, dates, line items, addresses and totals. Use List Estimates to find the ID.',
+ idempotent: true,
+ },
+ props: {
+ organizationId: zohoInvoiceAiProps.organizationId({ required: true }),
+ estimateId: zohoInvoiceAiProps.estimateId({ required: true }),
+ },
+ async run({ auth, propsValue }) {
+ return await zohoInvoiceApi.getEstimate({
+ auth,
+ organizationId: propsValue.organizationId,
+ estimateId: propsValue.estimateId,
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-invoice/src/lib/actions/ai/estimates/list-estimate-comments.ts b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/estimates/list-estimate-comments.ts
new file mode 100644
index 00000000000..613a2ae38c2
--- /dev/null
+++ b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/estimates/list-estimate-comments.ts
@@ -0,0 +1,32 @@
+import { createAction } from '@activepieces/pieces-framework';
+
+import { zohoInvoiceAuth } from '../../../auth';
+import { zohoInvoiceAiProps } from '../../../common/ai-props';
+import { zohoInvoiceApi } from '../../../common/api';
+import { zohoInvoiceListEstimateCommentsOutputSchema } from '../../../output-schemas';
+
+export const listEstimateCommentsAction = createAction({
+ auth: zohoInvoiceAuth,
+ name: 'zoho_invoice_list_estimate_comments',
+ outputSchema: zohoInvoiceListEstimateCommentsOutputSchema,
+ displayName: 'List Estimate Comments',
+ description: 'Lists the comments and history of an estimate.',
+ audience: 'ai',
+ classification: 'SEARCH',
+ aiMetadata: {
+ description:
+ 'Lists the comments and activity history of one estimate, with the comment_id that Update Estimate Comment and Delete Estimate Comment need. Use List Estimates to find the estimate ID.',
+ idempotent: true,
+ },
+ props: {
+ organizationId: zohoInvoiceAiProps.organizationId({ required: true }),
+ estimateId: zohoInvoiceAiProps.estimateId({ required: true }),
+ },
+ async run({ auth, propsValue }) {
+ return await zohoInvoiceApi.listEstimateComments({
+ auth,
+ organizationId: propsValue.organizationId,
+ estimateId: propsValue.estimateId,
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-invoice/src/lib/actions/ai/estimates/list-estimate-templates.ts b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/estimates/list-estimate-templates.ts
new file mode 100644
index 00000000000..6c63598b449
--- /dev/null
+++ b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/estimates/list-estimate-templates.ts
@@ -0,0 +1,30 @@
+import { createAction } from '@activepieces/pieces-framework';
+
+import { zohoInvoiceAuth } from '../../../auth';
+import { zohoInvoiceAiProps } from '../../../common/ai-props';
+import { zohoInvoiceApi } from '../../../common/api';
+import { zohoInvoiceTemplatesOutputSchema } from '../../../output-schemas';
+
+export const listEstimateTemplatesAction = createAction({
+ auth: zohoInvoiceAuth,
+ name: 'zoho_invoice_list_estimate_templates',
+ outputSchema: zohoInvoiceTemplatesOutputSchema,
+ displayName: 'List Estimate Templates',
+ description: 'Lists the PDF templates available for estimates.',
+ audience: 'ai',
+ classification: 'SEARCH',
+ aiMetadata: {
+ description:
+ 'Lists the PDF templates available for estimates with their template_id, for Set Estimate Template and the Template ID of Create Estimate.',
+ idempotent: true,
+ },
+ props: {
+ organizationId: zohoInvoiceAiProps.organizationId({ required: true }),
+ },
+ async run({ auth, propsValue }) {
+ return await zohoInvoiceApi.listEstimateTemplates({
+ auth,
+ organizationId: propsValue.organizationId,
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-invoice/src/lib/actions/ai/estimates/list-estimates.ts b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/estimates/list-estimates.ts
new file mode 100644
index 00000000000..32690eb25c8
--- /dev/null
+++ b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/estimates/list-estimates.ts
@@ -0,0 +1,81 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoInvoiceAuth } from '../../../auth';
+import { zohoInvoiceAiProps } from '../../../common/ai-props';
+import { zohoInvoiceApi } from '../../../common/api';
+import { zohoInvoiceListEstimatesOutputSchema } from '../../../output-schemas';
+
+export const listEstimatesAction = createAction({
+ auth: zohoInvoiceAuth,
+ name: 'zoho_invoice_list_estimates',
+ outputSchema: zohoInvoiceListEstimatesOutputSchema,
+ displayName: 'List Estimates',
+ description: 'Lists estimates (quotes).',
+ audience: 'ai',
+ classification: 'SEARCH',
+ aiMetadata: {
+ description:
+ 'Lists estimates with estimate_id, number, customer, status, date and total, one page at a time. Filter by status or customer, or search by number, reference or customer name.',
+ idempotent: true,
+ },
+ props: {
+ organizationId: zohoInvoiceAiProps.organizationId({ required: true }),
+ filterBy: Property.StaticDropdown({
+ displayName: 'Status',
+ description: 'Only estimates with this status. Empty = all estimates.',
+ required: false,
+ options: {
+ disabled: false,
+ options: [
+ { label: 'All', value: 'Status.All' },
+ { label: 'Draft', value: 'Status.Draft' },
+ { label: 'Sent', value: 'Status.Sent' },
+ { label: 'Accepted', value: 'Status.Accepted' },
+ { label: 'Declined', value: 'Status.Declined' },
+ { label: 'Invoiced', value: 'Status.Invoiced' },
+ { label: 'Expired', value: 'Status.Expired' },
+ ],
+ },
+ }),
+ searchText: zohoInvoiceAiProps.searchText({
+ required: false,
+ description: 'Search by estimate number, reference number or customer name.',
+ }),
+ customerId: zohoInvoiceAiProps.contactId({
+ required: false,
+ displayName: 'Customer ID',
+ description: 'Only estimates of this customer. Use List Contacts to find it.',
+ }),
+ sortColumn: Property.StaticDropdown({
+ displayName: 'Sort Column',
+ description: 'Field to sort by. Empty = the vendor default.',
+ required: false,
+ options: {
+ disabled: false,
+ options: [
+ { label: 'Customer Name', value: 'customer_name' },
+ { label: 'Estimate Number', value: 'estimate_number' },
+ { label: 'Date', value: 'date' },
+ { label: 'Total', value: 'total' },
+ { label: 'Created Time', value: 'created_time' },
+ ],
+ },
+ }),
+ sortOrder: zohoInvoiceAiProps.sortOrder({ required: false }),
+ page: zohoInvoiceAiProps.page({ required: false }),
+ perPage: zohoInvoiceAiProps.perPage({ required: false }),
+ },
+ async run({ auth, propsValue }) {
+ return await zohoInvoiceApi.listEstimates({
+ auth,
+ organizationId: propsValue.organizationId,
+ filterBy: propsValue.filterBy,
+ searchText: propsValue.searchText,
+ customerId: propsValue.customerId,
+ sortColumn: propsValue.sortColumn,
+ sortOrder: propsValue.sortOrder,
+ page: propsValue.page,
+ perPage: propsValue.perPage,
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-invoice/src/lib/actions/ai/estimates/mark-estimate-accepted.ts b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/estimates/mark-estimate-accepted.ts
new file mode 100644
index 00000000000..2d45dca0fe4
--- /dev/null
+++ b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/estimates/mark-estimate-accepted.ts
@@ -0,0 +1,32 @@
+import { createAction } from '@activepieces/pieces-framework';
+
+import { zohoInvoiceAuth } from '../../../auth';
+import { zohoInvoiceAiProps } from '../../../common/ai-props';
+import { zohoInvoiceApi } from '../../../common/api';
+import { zohoInvoiceMessageOutputSchema } from '../../../output-schemas';
+
+export const markEstimateAcceptedAction = createAction({
+ auth: zohoInvoiceAuth,
+ name: 'zoho_invoice_mark_estimate_accepted',
+ outputSchema: zohoInvoiceMessageOutputSchema,
+ displayName: 'Mark Estimate as Accepted',
+ description: 'Marks a sent estimate as accepted by the customer.',
+ audience: 'ai',
+ classification: 'WRITE',
+ aiMetadata: {
+ description:
+ 'Records that the customer accepted a sent estimate. Use List Estimates to find the ID.',
+ idempotent: true,
+ },
+ props: {
+ organizationId: zohoInvoiceAiProps.organizationId({ required: true }),
+ estimateId: zohoInvoiceAiProps.estimateId({ required: true }),
+ },
+ async run({ auth, propsValue }) {
+ return await zohoInvoiceApi.markEstimateAccepted({
+ auth,
+ organizationId: propsValue.organizationId,
+ estimateId: propsValue.estimateId,
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-invoice/src/lib/actions/ai/estimates/mark-estimate-declined.ts b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/estimates/mark-estimate-declined.ts
new file mode 100644
index 00000000000..ab53e9b4b10
--- /dev/null
+++ b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/estimates/mark-estimate-declined.ts
@@ -0,0 +1,32 @@
+import { createAction } from '@activepieces/pieces-framework';
+
+import { zohoInvoiceAuth } from '../../../auth';
+import { zohoInvoiceAiProps } from '../../../common/ai-props';
+import { zohoInvoiceApi } from '../../../common/api';
+import { zohoInvoiceMessageOutputSchema } from '../../../output-schemas';
+
+export const markEstimateDeclinedAction = createAction({
+ auth: zohoInvoiceAuth,
+ name: 'zoho_invoice_mark_estimate_declined',
+ outputSchema: zohoInvoiceMessageOutputSchema,
+ displayName: 'Mark Estimate as Declined',
+ description: 'Marks a sent estimate as declined by the customer.',
+ audience: 'ai',
+ classification: 'WRITE',
+ aiMetadata: {
+ description:
+ 'Records that the customer declined a sent estimate. Use List Estimates to find the ID.',
+ idempotent: true,
+ },
+ props: {
+ organizationId: zohoInvoiceAiProps.organizationId({ required: true }),
+ estimateId: zohoInvoiceAiProps.estimateId({ required: true }),
+ },
+ async run({ auth, propsValue }) {
+ return await zohoInvoiceApi.markEstimateDeclined({
+ auth,
+ organizationId: propsValue.organizationId,
+ estimateId: propsValue.estimateId,
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-invoice/src/lib/actions/ai/estimates/mark-estimate-sent.ts b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/estimates/mark-estimate-sent.ts
new file mode 100644
index 00000000000..94888ba4bf8
--- /dev/null
+++ b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/estimates/mark-estimate-sent.ts
@@ -0,0 +1,32 @@
+import { createAction } from '@activepieces/pieces-framework';
+
+import { zohoInvoiceAuth } from '../../../auth';
+import { zohoInvoiceAiProps } from '../../../common/ai-props';
+import { zohoInvoiceApi } from '../../../common/api';
+import { zohoInvoiceMessageOutputSchema } from '../../../output-schemas';
+
+export const markEstimateSentAction = createAction({
+ auth: zohoInvoiceAuth,
+ name: 'zoho_invoice_mark_estimate_sent',
+ outputSchema: zohoInvoiceMessageOutputSchema,
+ displayName: 'Mark Estimate as Sent',
+ description: 'Marks a draft estimate as sent.',
+ audience: 'ai',
+ classification: 'WRITE',
+ aiMetadata: {
+ description:
+ 'Marks a draft estimate as sent without emailing it; use Email Estimate to actually send it. Use List Estimates to find the ID.',
+ idempotent: true,
+ },
+ props: {
+ organizationId: zohoInvoiceAiProps.organizationId({ required: true }),
+ estimateId: zohoInvoiceAiProps.estimateId({ required: true }),
+ },
+ async run({ auth, propsValue }) {
+ return await zohoInvoiceApi.markEstimateSent({
+ auth,
+ organizationId: propsValue.organizationId,
+ estimateId: propsValue.estimateId,
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-invoice/src/lib/actions/ai/estimates/set-estimate-template.ts b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/estimates/set-estimate-template.ts
new file mode 100644
index 00000000000..b29a356ffe3
--- /dev/null
+++ b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/estimates/set-estimate-template.ts
@@ -0,0 +1,37 @@
+import { createAction } from '@activepieces/pieces-framework';
+
+import { zohoInvoiceAuth } from '../../../auth';
+import { zohoInvoiceAiProps } from '../../../common/ai-props';
+import { zohoInvoiceApi } from '../../../common/api';
+import { zohoInvoiceMessageOutputSchema } from '../../../output-schemas';
+
+export const setEstimateTemplateAction = createAction({
+ auth: zohoInvoiceAuth,
+ name: 'zoho_invoice_set_estimate_template',
+ outputSchema: zohoInvoiceMessageOutputSchema,
+ displayName: 'Set Estimate Template',
+ description: 'Changes the PDF template of an estimate.',
+ audience: 'ai',
+ classification: 'WRITE',
+ aiMetadata: {
+ description:
+ 'Switches the PDF template used to render an estimate. Use List Estimates for the estimate ID and List Estimate Templates for the template ID.',
+ idempotent: true,
+ },
+ props: {
+ organizationId: zohoInvoiceAiProps.organizationId({ required: true }),
+ estimateId: zohoInvoiceAiProps.estimateId({ required: true }),
+ templateId: zohoInvoiceAiProps.templateId({
+ required: true,
+ description: 'Estimate PDF template ID. Use List Estimate Templates to find it.',
+ }),
+ },
+ async run({ auth, propsValue }) {
+ return await zohoInvoiceApi.setEstimateTemplate({
+ auth,
+ organizationId: propsValue.organizationId,
+ estimateId: propsValue.estimateId,
+ templateId: propsValue.templateId,
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-invoice/src/lib/actions/ai/estimates/update-estimate-billing-address.ts b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/estimates/update-estimate-billing-address.ts
new file mode 100644
index 00000000000..e90db793c55
--- /dev/null
+++ b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/estimates/update-estimate-billing-address.ts
@@ -0,0 +1,74 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoInvoiceAuth } from '../../../auth';
+import { zohoInvoiceAiProps } from '../../../common/ai-props';
+import { zohoInvoiceApi } from '../../../common/api';
+import { zohoInvoiceUtils } from '../../../common/utils';
+import { zohoInvoiceBillingAddressOutputSchema } from '../../../output-schemas';
+
+export const updateEstimateBillingAddressAction = createAction({
+ auth: zohoInvoiceAuth,
+ name: 'zoho_invoice_update_estimate_billing_address',
+ outputSchema: zohoInvoiceBillingAddressOutputSchema,
+ displayName: 'Update Estimate Billing Address',
+ description: 'Changes the billing address printed on one estimate.',
+ audience: 'ai',
+ classification: 'WRITE',
+ aiMetadata: {
+ description:
+ "Changes the billing address on one estimate only, not on the customer's contact. Fields left empty keep their current value. Use List Estimates to find the ID.",
+ idempotent: true,
+ },
+ props: {
+ organizationId: zohoInvoiceAiProps.organizationId({ required: true }),
+ estimateId: zohoInvoiceAiProps.estimateId({ required: true }),
+ address: Property.ShortText({
+ displayName: 'Street',
+ description: 'Street address. Empty = unchanged.',
+ required: false,
+ }),
+ city: Property.ShortText({
+ displayName: 'City',
+ description: 'City. Empty = unchanged.',
+ required: false,
+ }),
+ state: Property.ShortText({
+ displayName: 'State',
+ description: 'State or region. Empty = unchanged.',
+ required: false,
+ }),
+ zip: Property.ShortText({
+ displayName: 'ZIP Code',
+ description: 'ZIP or postal code. Empty = unchanged.',
+ required: false,
+ }),
+ country: Property.ShortText({
+ displayName: 'Country',
+ description: 'Country. Empty = unchanged.',
+ required: false,
+ }),
+ fax: Property.ShortText({
+ displayName: 'Fax',
+ description: 'Fax number. Empty = unchanged.',
+ required: false,
+ }),
+ },
+ async run({ auth, propsValue }) {
+ const { organizationId, estimateId } = propsValue;
+ const current = await zohoInvoiceApi.getEstimate({ auth, organizationId, estimateId });
+ const address = current.estimate?.billing_address;
+ return await zohoInvoiceApi.updateEstimateBillingAddress({
+ auth,
+ organizationId,
+ estimateId,
+ body: zohoInvoiceUtils.compact({
+ address: propsValue.address ?? address?.address,
+ city: propsValue.city ?? address?.city,
+ state: propsValue.state ?? address?.state,
+ zip: propsValue.zip ?? address?.zip,
+ country: propsValue.country ?? address?.country,
+ fax: propsValue.fax ?? address?.fax,
+ }),
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-invoice/src/lib/actions/ai/estimates/update-estimate-comment.ts b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/estimates/update-estimate-comment.ts
new file mode 100644
index 00000000000..f21007735aa
--- /dev/null
+++ b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/estimates/update-estimate-comment.ts
@@ -0,0 +1,55 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoInvoiceAuth } from '../../../auth';
+import { zohoInvoiceAiProps } from '../../../common/ai-props';
+import { zohoInvoiceApi } from '../../../common/api';
+import { zohoInvoiceUtils } from '../../../common/utils';
+import { zohoInvoiceAddEstimateCommentOutputSchema } from '../../../output-schemas';
+
+export const updateEstimateCommentAction = createAction({
+ auth: zohoInvoiceAuth,
+ name: 'zoho_invoice_update_estimate_comment',
+ outputSchema: zohoInvoiceAddEstimateCommentOutputSchema,
+ displayName: 'Update Estimate Comment',
+ description: 'Changes a comment on an estimate.',
+ audience: 'ai',
+ classification: 'WRITE',
+ aiMetadata: {
+ description:
+ 'Changes the text or customer visibility of a comment on an estimate. Fields left empty are not sent. Use List Estimates for the estimate ID and List Estimate Comments for the comment ID.',
+ idempotent: true,
+ },
+ props: {
+ organizationId: zohoInvoiceAiProps.organizationId({ required: true }),
+ estimateId: zohoInvoiceAiProps.estimateId({ required: true }),
+ commentId: zohoInvoiceAiProps.commentId({
+ required: true,
+ description: 'Comment ID. Use List Estimate Comments to find it.',
+ }),
+ description: Property.LongText({
+ displayName: 'Comment',
+ description: 'New text of the comment. Empty = unchanged.',
+ required: false,
+ }),
+ showCommentToClients: zohoInvoiceAiProps.yesNo({
+ required: false,
+ displayName: 'Show to Customer',
+ description:
+ 'Yes to show the comment in the customer portal, No to hide it. Empty = unchanged.',
+ }),
+ },
+ async run({ auth, propsValue }) {
+ return await zohoInvoiceApi.updateEstimateComment({
+ auth,
+ organizationId: propsValue.organizationId,
+ estimateId: propsValue.estimateId,
+ commentId: propsValue.commentId,
+ body: zohoInvoiceUtils.compact({
+ description: propsValue.description,
+ show_comment_to_clients: zohoInvoiceUtils.toOptionalBoolean({
+ value: propsValue.showCommentToClients,
+ }),
+ }),
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-invoice/src/lib/actions/ai/estimates/update-estimate-shipping-address.ts b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/estimates/update-estimate-shipping-address.ts
new file mode 100644
index 00000000000..d480897556a
--- /dev/null
+++ b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/estimates/update-estimate-shipping-address.ts
@@ -0,0 +1,74 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoInvoiceAuth } from '../../../auth';
+import { zohoInvoiceAiProps } from '../../../common/ai-props';
+import { zohoInvoiceApi } from '../../../common/api';
+import { zohoInvoiceUtils } from '../../../common/utils';
+import { zohoInvoiceShippingAddressOutputSchema } from '../../../output-schemas';
+
+export const updateEstimateShippingAddressAction = createAction({
+ auth: zohoInvoiceAuth,
+ name: 'zoho_invoice_update_estimate_shipping_address',
+ outputSchema: zohoInvoiceShippingAddressOutputSchema,
+ displayName: 'Update Estimate Shipping Address',
+ description: 'Changes the shipping address printed on one estimate.',
+ audience: 'ai',
+ classification: 'WRITE',
+ aiMetadata: {
+ description:
+ "Changes the shipping address on one estimate only, not on the customer's contact. Fields left empty keep their current value. Use List Estimates to find the ID.",
+ idempotent: true,
+ },
+ props: {
+ organizationId: zohoInvoiceAiProps.organizationId({ required: true }),
+ estimateId: zohoInvoiceAiProps.estimateId({ required: true }),
+ address: Property.ShortText({
+ displayName: 'Street',
+ description: 'Street address. Empty = unchanged.',
+ required: false,
+ }),
+ city: Property.ShortText({
+ displayName: 'City',
+ description: 'City. Empty = unchanged.',
+ required: false,
+ }),
+ state: Property.ShortText({
+ displayName: 'State',
+ description: 'State or region. Empty = unchanged.',
+ required: false,
+ }),
+ zip: Property.ShortText({
+ displayName: 'ZIP Code',
+ description: 'ZIP or postal code. Empty = unchanged.',
+ required: false,
+ }),
+ country: Property.ShortText({
+ displayName: 'Country',
+ description: 'Country. Empty = unchanged.',
+ required: false,
+ }),
+ fax: Property.ShortText({
+ displayName: 'Fax',
+ description: 'Fax number. Empty = unchanged.',
+ required: false,
+ }),
+ },
+ async run({ auth, propsValue }) {
+ const { organizationId, estimateId } = propsValue;
+ const current = await zohoInvoiceApi.getEstimate({ auth, organizationId, estimateId });
+ const address = current.estimate?.shipping_address;
+ return await zohoInvoiceApi.updateEstimateShippingAddress({
+ auth,
+ organizationId,
+ estimateId,
+ body: zohoInvoiceUtils.compact({
+ address: propsValue.address ?? address?.address,
+ city: propsValue.city ?? address?.city,
+ state: propsValue.state ?? address?.state,
+ zip: propsValue.zip ?? address?.zip,
+ country: propsValue.country ?? address?.country,
+ fax: propsValue.fax ?? address?.fax,
+ }),
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-invoice/src/lib/actions/ai/estimates/update-estimate.ts b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/estimates/update-estimate.ts
new file mode 100644
index 00000000000..ffc0e914674
--- /dev/null
+++ b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/estimates/update-estimate.ts
@@ -0,0 +1,144 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoInvoiceAuth } from '../../../auth';
+import { zohoInvoiceAiProps } from '../../../common/ai-props';
+import { zohoInvoiceApi } from '../../../common/api';
+import { zohoInvoiceUtils } from '../../../common/utils';
+import { zohoInvoiceEstimateOutputSchema } from '../../../output-schemas';
+
+import type { ZohoInvoiceDocumentLineItem } from '../../../common/api/recurring-invoices';
+
+export const updateEstimateAction = createAction({
+ auth: zohoInvoiceAuth,
+ name: 'zoho_invoice_update_estimate',
+ outputSchema: zohoInvoiceEstimateOutputSchema,
+ displayName: 'Update Estimate',
+ description: 'Changes an estimate.',
+ audience: 'ai',
+ classification: 'WRITE',
+ aiMetadata: {
+ description:
+ 'Changes an estimate: customer, lines, number, reference, dates, notes, terms or custom fields (via Additional Fields). Fields left empty keep their current value; Line Items, when given, replace all current lines (pass Line Item ID to keep an existing line). Use List Estimates to find the ID.',
+ idempotent: true,
+ },
+ props: {
+ organizationId: zohoInvoiceAiProps.organizationId({ required: true }),
+ estimateId: zohoInvoiceAiProps.estimateId({ required: true }),
+ customerId: zohoInvoiceAiProps.contactId({
+ required: false,
+ displayName: 'Customer ID',
+ description: 'New customer contact ID. Use List Contacts to find it. Empty = unchanged.',
+ }),
+ lineItems: Property.Array({
+ displayName: 'Line Items',
+ description:
+ 'Full new list of lines; replaces the current ones. Include Line Item ID (from Get Estimate) to update an existing line. Empty = lines unchanged.',
+ required: false,
+ properties: {
+ lineItemId: Property.ShortText({
+ displayName: 'Line Item ID',
+ description:
+ 'ID of an existing line to update. Use Get Estimate to find it. Empty = new line.',
+ required: false,
+ }),
+ itemId: Property.ShortText({
+ displayName: 'Item ID',
+ description: 'Item ID. Use List Items to find it.',
+ required: false,
+ }),
+ name: Property.ShortText({ displayName: 'Name', required: false }),
+ description: Property.LongText({ displayName: 'Description', required: false }),
+ rate: Property.Number({ displayName: 'Rate', required: false }),
+ quantity: Property.Number({ displayName: 'Quantity', required: false }),
+ discount: Property.ShortText({
+ displayName: 'Discount',
+ description: 'Flat amount, or a percentage such as "10%".',
+ required: false,
+ }),
+ taxId: Property.ShortText({
+ displayName: 'Tax ID',
+ description: 'Tax ID. Use List Taxes to find it.',
+ required: false,
+ }),
+ },
+ }),
+ estimateNumber: Property.ShortText({
+ displayName: 'Estimate Number',
+ description: 'New estimate number. Empty = unchanged.',
+ required: false,
+ }),
+ referenceNumber: Property.ShortText({
+ displayName: 'Reference Number',
+ description: 'New reference number. Empty = unchanged.',
+ required: false,
+ }),
+ date: Property.ShortText({
+ displayName: 'Date',
+ description: 'New estimate date, as yyyy-mm-dd. Empty = unchanged.',
+ required: false,
+ }),
+ expiryDate: Property.ShortText({
+ displayName: 'Expiry Date',
+ description: 'New expiry date, as yyyy-mm-dd. Empty = unchanged.',
+ required: false,
+ }),
+ notes: Property.LongText({
+ displayName: 'Notes',
+ description: 'New notes shown to the customer. Empty = unchanged.',
+ required: false,
+ }),
+ terms: Property.LongText({
+ displayName: 'Terms',
+ description: 'New terms and conditions. Empty = unchanged.',
+ required: false,
+ }),
+ additionalFields: zohoInvoiceAiProps.additionalFields({ required: false }),
+ },
+ async run({ auth, propsValue }) {
+ const { organizationId, estimateId } = propsValue;
+ const current = await zohoInvoiceApi.getEstimate({ auth, organizationId, estimateId });
+ const estimate = current.estimate;
+ return await zohoInvoiceApi.updateEstimate({
+ auth,
+ organizationId,
+ estimateId,
+ ignoreAutoNumberGeneration: propsValue.estimateNumber === undefined ? undefined : true,
+ body: {
+ ...zohoInvoiceUtils.compact({
+ customer_id: estimate?.customer_id,
+ line_items: toCurrentLineItems({ lines: estimate?.line_items }),
+ }),
+ ...(propsValue.additionalFields ?? {}),
+ ...zohoInvoiceUtils.compact({
+ customer_id: propsValue.customerId,
+ line_items: zohoInvoiceUtils.toLineItems({ rows: propsValue.lineItems }),
+ estimate_number: propsValue.estimateNumber,
+ reference_number: propsValue.referenceNumber,
+ date: propsValue.date,
+ expiry_date: propsValue.expiryDate,
+ notes: propsValue.notes,
+ terms: propsValue.terms,
+ }),
+ },
+ });
+ },
+});
+
+function toCurrentLineItems({
+ lines,
+}: {
+ lines: ZohoInvoiceDocumentLineItem[] | undefined;
+}): Record<string, unknown>[] | undefined {
+ return lines?.map((line) =>
+ zohoInvoiceUtils.compact({
+ line_item_id: line.line_item_id,
+ item_id: line.item_id,
+ name: line.name,
+ description: line.description,
+ rate: line.rate,
+ quantity: line.quantity,
+ discount: line.discount,
+ tax_id: line.tax_id,
+ }),
+ );
+}
diff --git a/packages/pieces/community/zoho-invoice/src/lib/actions/ai/expenses/create-expense-category.ts b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/expenses/create-expense-category.ts
new file mode 100644
index 00000000000..39105b79ad0
--- /dev/null
+++ b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/expenses/create-expense-category.ts
@@ -0,0 +1,45 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoInvoiceAuth } from '../../../auth';
+import { zohoInvoiceAiProps } from '../../../common/ai-props';
+import { zohoInvoiceApi } from '../../../common/api';
+import { zohoInvoiceUtils } from '../../../common/utils';
+import { zohoInvoiceExpenseCategoryOutputSchema } from '../../../output-schemas';
+
+export const createExpenseCategoryAction = createAction({
+ auth: zohoInvoiceAuth,
+ name: 'zoho_invoice_create_expense_category',
+ outputSchema: zohoInvoiceExpenseCategoryOutputSchema,
+ displayName: 'Create Expense Category',
+ description: 'Creates an expense category.',
+ audience: 'ai',
+ classification: 'WRITE',
+ aiMetadata: {
+ description:
+ 'Creates an expense category that expenses are recorded under. Not idempotent: use List Expense Categories first to avoid duplicates.',
+ idempotent: false,
+ },
+ props: {
+ organizationId: zohoInvoiceAiProps.organizationId({ required: true }),
+ accountName: Property.ShortText({
+ displayName: 'Name',
+ description: 'Name of the expense category, e.g. "Travel".',
+ required: true,
+ }),
+ description: Property.LongText({
+ displayName: 'Description',
+ description: 'Description of the category.',
+ required: false,
+ }),
+ },
+ async run({ auth, propsValue }) {
+ return await zohoInvoiceApi.createExpenseCategory({
+ auth,
+ organizationId: propsValue.organizationId,
+ body: zohoInvoiceUtils.compact({
+ account_name: propsValue.accountName,
+ description: propsValue.description,
+ }),
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-invoice/src/lib/actions/ai/expenses/create-expense.ts b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/expenses/create-expense.ts
new file mode 100644
index 00000000000..18013ab5e0c
--- /dev/null
+++ b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/expenses/create-expense.ts
@@ -0,0 +1,96 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoInvoiceAuth } from '../../../auth';
+import { zohoInvoiceAiProps } from '../../../common/ai-props';
+import { zohoInvoiceApi } from '../../../common/api';
+import { zohoInvoiceUtils } from '../../../common/utils';
+import { zohoInvoiceExpenseOutputSchema } from '../../../output-schemas';
+
+export const createExpenseAction = createAction({
+ auth: zohoInvoiceAuth,
+ name: 'zoho_invoice_create_expense',
+ outputSchema: zohoInvoiceExpenseOutputSchema,
+ displayName: 'Create Expense',
+ description: 'Records an expense.',
+ audience: 'ai',
+ classification: 'WRITE',
+ aiMetadata: {
+ description:
+ 'Records an expense under an expense category, optionally billable to a customer or project. Use List Expense Categories for the category ID. Not idempotent: each call records a new expense, so use List Expenses first to avoid duplicates.',
+ idempotent: false,
+ },
+ props: {
+ organizationId: zohoInvoiceAiProps.organizationId({ required: true }),
+ accountId: zohoInvoiceAiProps.expenseCategoryId({
+ required: true,
+ description:
+ 'Expense category ID the expense is recorded under. Use List Expense Categories to find it.',
+ }),
+ amount: Property.Number({
+ displayName: 'Amount',
+ description: 'Total amount of the expense.',
+ required: true,
+ }),
+ referenceNumber: Property.ShortText({
+ displayName: 'Reference Number',
+ description: 'Reference number of the expense, e.g. a receipt number (max 100 characters).',
+ required: true,
+ }),
+ date: Property.ShortText({
+ displayName: 'Date',
+ description: 'Expense date, yyyy-mm-dd. Empty = today.',
+ required: false,
+ }),
+ description: Property.LongText({
+ displayName: 'Description',
+ description: 'Description of the expense.',
+ required: false,
+ }),
+ customerId: zohoInvoiceAiProps.contactId({
+ required: false,
+ description: 'Customer the expense relates to. Use List Contacts to find it.',
+ }),
+ projectId: zohoInvoiceAiProps.projectId({ required: false }),
+ isBillable: zohoInvoiceAiProps.yesNo({
+ required: false,
+ displayName: 'Billable',
+ description: 'Whether the expense can be billed to the customer. Empty = the vendor default.',
+ }),
+ currencyId: zohoInvoiceAiProps.currencyId({
+ required: false,
+ description:
+ 'Currency of the expense. Use List Currencies to find it. Empty = base currency.',
+ }),
+ taxId: zohoInvoiceAiProps.taxId({ required: false }),
+ isInclusiveTax: zohoInvoiceAiProps.yesNo({
+ required: false,
+ displayName: 'Tax Inclusive',
+ description: 'Whether the amount includes tax. Empty = the vendor default.',
+ }),
+ additionalFields: zohoInvoiceAiProps.additionalFields({ required: false }),
+ },
+ async run({ auth, propsValue }) {
+ return await zohoInvoiceApi.createExpense({
+ auth,
+ organizationId: propsValue.organizationId,
+ body: {
+ ...(propsValue.additionalFields ?? {}),
+ ...zohoInvoiceUtils.compact({
+ account_id: propsValue.accountId,
+ amount: propsValue.amount,
+ reference_number: propsValue.referenceNumber,
+ date: propsValue.date,
+ description: propsValue.description,
+ customer_id: propsValue.customerId,
+ project_id: propsValue.projectId,
+ is_billable: zohoInvoiceUtils.toOptionalBoolean({ value: propsValue.isBillable }),
+ currency_id: propsValue.currencyId,
+ tax_id: propsValue.taxId,
+ is_inclusive_tax: zohoInvoiceUtils.toOptionalBoolean({
+ value: propsValue.isInclusiveTax,
+ }),
+ }),
+ },
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-invoice/src/lib/actions/ai/expenses/delete-expense-category.ts b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/expenses/delete-expense-category.ts
new file mode 100644
index 00000000000..ad8b4d5d6e6
--- /dev/null
+++ b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/expenses/delete-expense-category.ts
@@ -0,0 +1,32 @@
+import { createAction } from '@activepieces/pieces-framework';
+
+import { zohoInvoiceAuth } from '../../../auth';
+import { zohoInvoiceAiProps } from '../../../common/ai-props';
+import { zohoInvoiceApi } from '../../../common/api';
+import { zohoInvoiceMessageOutputSchema } from '../../../output-schemas';
+
+export const deleteExpenseCategoryAction = createAction({
+ auth: zohoInvoiceAuth,
+ name: 'zoho_invoice_delete_expense_category',
+ outputSchema: zohoInvoiceMessageOutputSchema,
+ displayName: 'Delete Expense Category',
+ description: 'Deletes an expense category.',
+ audience: 'ai',
+ classification: 'DESTRUCTIVE',
+ aiMetadata: {
+ description:
+ 'Permanently deletes an expense category. Use List Expense Categories to find the ID. Categories used by expenses cannot be deleted; use Mark Expense Category Inactive instead. Cannot be undone.',
+ idempotent: false,
+ },
+ props: {
+ organizationId: zohoInvoiceAiProps.organizationId({ required: true }),
+ expenseCategoryId: zohoInvoiceAiProps.expenseCategoryId({ required: true }),
+ },
+ async run({ auth, propsValue }) {
+ return await zohoInvoiceApi.deleteExpenseCategory({
+ auth,
+ organizationId: propsValue.organizationId,
+ expenseCategoryId: propsValue.expenseCategoryId,
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-invoice/src/lib/actions/ai/expenses/delete-expense.ts b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/expenses/delete-expense.ts
new file mode 100644
index 00000000000..24f641fa01b
--- /dev/null
+++ b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/expenses/delete-expense.ts
@@ -0,0 +1,32 @@
+import { createAction } from '@activepieces/pieces-framework';
+
+import { zohoInvoiceAuth } from '../../../auth';
+import { zohoInvoiceAiProps } from '../../../common/ai-props';
+import { zohoInvoiceApi } from '../../../common/api';
+import { zohoInvoiceMessageOutputSchema } from '../../../output-schemas';
+
+export const deleteExpenseAction = createAction({
+ auth: zohoInvoiceAuth,
+ name: 'zoho_invoice_delete_expense',
+ outputSchema: zohoInvoiceMessageOutputSchema,
+ displayName: 'Delete Expense',
+ description: 'Deletes an expense.',
+ audience: 'ai',
+ classification: 'DESTRUCTIVE',
+ aiMetadata: {
+ description:
+ 'Permanently deletes an expense. Use List Expenses to find the ID. Cannot be undone.',
+ idempotent: false,
+ },
+ props: {
+ organizationId: zohoInvoiceAiProps.organizationId({ required: true }),
+ expenseId: zohoInvoiceAiProps.expenseId({ required: true }),
+ },
+ async run({ auth, propsValue }) {
+ return await zohoInvoiceApi.deleteExpense({
+ auth,
+ organizationId: propsValue.organizationId,
+ expenseId: propsValue.expenseId,
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-invoice/src/lib/actions/ai/expenses/get-expense-category.ts b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/expenses/get-expense-category.ts
new file mode 100644
index 00000000000..21b59b7863d
--- /dev/null
+++ b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/expenses/get-expense-category.ts
@@ -0,0 +1,32 @@
+import { createAction } from '@activepieces/pieces-framework';
+
+import { zohoInvoiceAuth } from '../../../auth';
+import { zohoInvoiceAiProps } from '../../../common/ai-props';
+import { zohoInvoiceApi } from '../../../common/api';
+import { zohoInvoiceExpenseCategoryOutputSchema } from '../../../output-schemas';
+
+export const getExpenseCategoryAction = createAction({
+ auth: zohoInvoiceAuth,
+ name: 'zoho_invoice_get_expense_category',
+ outputSchema: zohoInvoiceExpenseCategoryOutputSchema,
+ displayName: 'Get Expense Category',
+ description: 'Gets one expense category by ID.',
+ audience: 'ai',
+ classification: 'READ',
+ aiMetadata: {
+ description:
+ 'Returns one expense category by ID: name, description and status. Use List Expense Categories to find the ID.',
+ idempotent: true,
+ },
+ props: {
+ organizationId: zohoInvoiceAiProps.organizationId({ required: true }),
+ expenseCategoryId: zohoInvoiceAiProps.expenseCategoryId({ required: true }),
+ },
+ async run({ auth, propsValue }) {
+ return await zohoInvoiceApi.getExpenseCategory({
+ auth,
+ organizationId: propsValue.organizationId,
+ expenseCategoryId: propsValue.expenseCategoryId,
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-invoice/src/lib/actions/ai/expenses/get-expense.ts b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/expenses/get-expense.ts
new file mode 100644
index 00000000000..e96e2e1a7df
--- /dev/null
+++ b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/expenses/get-expense.ts
@@ -0,0 +1,32 @@
+import { createAction } from '@activepieces/pieces-framework';
+
+import { zohoInvoiceAuth } from '../../../auth';
+import { zohoInvoiceAiProps } from '../../../common/ai-props';
+import { zohoInvoiceApi } from '../../../common/api';
+import { zohoInvoiceExpenseOutputSchema } from '../../../output-schemas';
+
+export const getExpenseAction = createAction({
+ auth: zohoInvoiceAuth,
+ name: 'zoho_invoice_get_expense',
+ outputSchema: zohoInvoiceExpenseOutputSchema,
+ displayName: 'Get Expense',
+ description: 'Gets one expense by ID.',
+ audience: 'ai',
+ classification: 'READ',
+ aiMetadata: {
+ description:
+ 'Returns one expense by ID: date, amount, category, customer, project, tax, billable status and receipt. Use List Expenses to find the ID.',
+ idempotent: true,
+ },
+ props: {
+ organizationId: zohoInvoiceAiProps.organizationId({ required: true }),
+ expenseId: zohoInvoiceAiProps.expenseId({ required: true }),
+ },
+ async run({ auth, propsValue }) {
+ return await zohoInvoiceApi.getExpense({
+ auth,
+ organizationId: propsValue.organizationId,
+ expenseId: propsValue.expenseId,
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-invoice/src/lib/actions/ai/expenses/list-expense-categories.ts b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/expenses/list-expense-categories.ts
new file mode 100644
index 00000000000..a19628894f1
--- /dev/null
+++ b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/expenses/list-expense-categories.ts
@@ -0,0 +1,48 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoInvoiceAuth } from '../../../auth';
+import { zohoInvoiceAiProps } from '../../../common/ai-props';
+import { zohoInvoiceApi } from '../../../common/api';
+import { zohoInvoiceListExpenseCategoriesOutputSchema } from '../../../output-schemas';
+
+export const listExpenseCategoriesAction = createAction({
+ auth: zohoInvoiceAuth,
+ name: 'zoho_invoice_list_expense_categories',
+ outputSchema: zohoInvoiceListExpenseCategoriesOutputSchema,
+ displayName: 'List Expense Categories',
+ description: 'Lists the expense categories of an organization.',
+ audience: 'ai',
+ classification: 'SEARCH',
+ aiMetadata: {
+ description:
+ 'Lists expense categories with their account_id, name and status, one page at a time. The account_id is the category ID that expense actions take.',
+ idempotent: true,
+ },
+ props: {
+ organizationId: zohoInvoiceAiProps.organizationId({ required: true }),
+ filterBy: Property.StaticDropdown({
+ displayName: 'Status',
+ description: 'Only categories with this status. Empty = the vendor default.',
+ required: false,
+ options: {
+ disabled: false,
+ options: [
+ { label: 'All', value: 'ExpenseCategories.All' },
+ { label: 'Active', value: 'ExpenseCategories.Active' },
+ { label: 'Inactive', value: 'ExpenseCategories.Inactive' },
+ ],
+ },
+ }),
+ page: zohoInvoiceAiProps.page({ required: false }),
+ perPage: zohoInvoiceAiProps.perPage({ required: false }),
+ },
+ async run({ auth, propsValue }) {
+ return await zohoInvoiceApi.listExpenseCategories({
+ auth,
+ organizationId: propsValue.organizationId,
+ filterBy: propsValue.filterBy,
+ page: propsValue.page,
+ perPage: propsValue.perPage,
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-invoice/src/lib/actions/ai/expenses/list-expense-history.ts b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/expenses/list-expense-history.ts
new file mode 100644
index 00000000000..d86dba317ef
--- /dev/null
+++ b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/expenses/list-expense-history.ts
@@ -0,0 +1,32 @@
+import { createAction } from '@activepieces/pieces-framework';
+
+import { zohoInvoiceAuth } from '../../../auth';
+import { zohoInvoiceAiProps } from '../../../common/ai-props';
+import { zohoInvoiceApi } from '../../../common/api';
+import { zohoInvoiceListExpenseHistoryOutputSchema } from '../../../output-schemas';
+
+export const listExpenseHistoryAction = createAction({
+ auth: zohoInvoiceAuth,
+ name: 'zoho_invoice_list_expense_history',
+ outputSchema: zohoInvoiceListExpenseHistoryOutputSchema,
+ displayName: 'List Expense History',
+ description: 'Lists the history and comments of an expense.',
+ audience: 'ai',
+ classification: 'SEARCH',
+ aiMetadata: {
+ description:
+ 'Lists the history entries and comments recorded on one expense. Use List Expenses to find the ID.',
+ idempotent: true,
+ },
+ props: {
+ organizationId: zohoInvoiceAiProps.organizationId({ required: true }),
+ expenseId: zohoInvoiceAiProps.expenseId({ required: true }),
+ },
+ async run({ auth, propsValue }) {
+ return await zohoInvoiceApi.listExpenseHistory({
+ auth,
+ organizationId: propsValue.organizationId,
+ expenseId: propsValue.expenseId,
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-invoice/src/lib/actions/ai/expenses/list-expenses.ts b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/expenses/list-expenses.ts
new file mode 100644
index 00000000000..f86343b0613
--- /dev/null
+++ b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/expenses/list-expenses.ts
@@ -0,0 +1,74 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoInvoiceAuth } from '../../../auth';
+import { zohoInvoiceAiProps } from '../../../common/ai-props';
+import { zohoInvoiceApi } from '../../../common/api';
+import { zohoInvoiceListExpensesOutputSchema } from '../../../output-schemas';
+
+export const listExpensesAction = createAction({
+ auth: zohoInvoiceAuth,
+ name: 'zoho_invoice_list_expenses',
+ outputSchema: zohoInvoiceListExpensesOutputSchema,
+ displayName: 'List Expenses',
+ description: 'Lists the expenses of an organization.',
+ audience: 'ai',
+ classification: 'SEARCH',
+ aiMetadata: {
+ description:
+ 'Lists expenses with expense_id, date, category, amount, customer and status, one page at a time. Filter by status, date range or search text. Use it to find the expense IDs other actions need.',
+ idempotent: true,
+ },
+ props: {
+ organizationId: zohoInvoiceAiProps.organizationId({ required: true }),
+ filterBy: Property.StaticDropdown({
+ displayName: 'Status',
+ description: 'Only expenses with this status. Empty = all expenses.',
+ required: false,
+ options: {
+ disabled: false,
+ options: [
+ { label: 'All', value: 'Status.All' },
+ { label: 'Billable', value: 'Status.Billable' },
+ { label: 'Non-billable', value: 'Status.Nonbillable' },
+ { label: 'Reimbursed', value: 'Status.Reimbursed' },
+ { label: 'Invoiced', value: 'Status.Invoiced' },
+ { label: 'Unbilled', value: 'Status.Unbilled' },
+ ],
+ },
+ }),
+ searchText: zohoInvoiceAiProps.searchText({
+ required: false,
+ description: 'Search by category name, description, customer name or vendor name.',
+ }),
+ dateStart: Property.ShortText({
+ displayName: 'Date From',
+ description: 'Only expenses dated on or after this date, yyyy-mm-dd.',
+ required: false,
+ }),
+ dateEnd: Property.ShortText({
+ displayName: 'Date To',
+ description: 'Only expenses dated on or before this date, yyyy-mm-dd.',
+ required: false,
+ }),
+ sortColumn: zohoInvoiceAiProps.sortColumn({
+ required: false,
+ description:
+ 'Field to sort by: date, account_name, total, bcy_total, reference_number, customer_name or created_time.',
+ }),
+ page: zohoInvoiceAiProps.page({ required: false }),
+ perPage: zohoInvoiceAiProps.perPage({ required: false }),
+ },
+ async run({ auth, propsValue }) {
+ return await zohoInvoiceApi.listExpenses({
+ auth,
+ organizationId: propsValue.organizationId,
+ filterBy: propsValue.filterBy,
+ searchText: propsValue.searchText,
+ dateStart: propsValue.dateStart,
+ dateEnd: propsValue.dateEnd,
+ sortColumn: propsValue.sortColumn,
+ page: propsValue.page,
+ perPage: propsValue.perPage,
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-invoice/src/lib/actions/ai/expenses/mark-expense-category-active.ts b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/expenses/mark-expense-category-active.ts
new file mode 100644
index 00000000000..0830c3464d8
--- /dev/null
+++ b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/expenses/mark-expense-category-active.ts
@@ -0,0 +1,32 @@
+import { createAction } from '@activepieces/pieces-framework';
+
+import { zohoInvoiceAuth } from '../../../auth';
+import { zohoInvoiceAiProps } from '../../../common/ai-props';
+import { zohoInvoiceApi } from '../../../common/api';
+import { zohoInvoiceMessageOutputSchema } from '../../../output-schemas';
+
+export const markExpenseCategoryActiveAction = createAction({
+ auth: zohoInvoiceAuth,
+ name: 'zoho_invoice_mark_expense_category_active',
+ outputSchema: zohoInvoiceMessageOutputSchema,
+ displayName: 'Mark Expense Category Active',
+ description: 'Marks an inactive expense category as active.',
+ audience: 'ai',
+ classification: 'WRITE',
+ aiMetadata: {
+ description:
+ 'Reactivates an expense category so new expenses can use it. Use List Expense Categories to find the ID.',
+ idempotent: true,
+ },
+ props: {
+ organizationId: zohoInvoiceAiProps.organizationId({ required: true }),
+ expenseCategoryId: zohoInvoiceAiProps.expenseCategoryId({ required: true }),
+ },
+ async run({ auth, propsValue }) {
+ return await zohoInvoiceApi.markExpenseCategoryActive({
+ auth,
+ organizationId: propsValue.organizationId,
+ expenseCategoryId: propsValue.expenseCategoryId,
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-invoice/src/lib/actions/ai/expenses/mark-expense-category-inactive.ts b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/expenses/mark-expense-category-inactive.ts
new file mode 100644
index 00000000000..1b029b25fe9
--- /dev/null
+++ b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/expenses/mark-expense-category-inactive.ts
@@ -0,0 +1,32 @@
+import { createAction } from '@activepieces/pieces-framework';
+
+import { zohoInvoiceAuth } from '../../../auth';
+import { zohoInvoiceAiProps } from '../../../common/ai-props';
+import { zohoInvoiceApi } from '../../../common/api';
+import { zohoInvoiceMessageOutputSchema } from '../../../output-schemas';
+
+export const markExpenseCategoryInactiveAction = createAction({
+ auth: zohoInvoiceAuth,
+ name: 'zoho_invoice_mark_expense_category_inactive',
+ outputSchema: zohoInvoiceMessageOutputSchema,
+ displayName: 'Mark Expense Category Inactive',
+ description: 'Marks an expense category as inactive.',
+ audience: 'ai',
+ classification: 'WRITE',
+ aiMetadata: {
+ description:
+ 'Deactivates an expense category so new expenses cannot use it, keeping existing expenses. Use List Expense Categories to find the ID.',
+ idempotent: true,
+ },
+ props: {
+ organizationId: zohoInvoiceAiProps.organizationId({ required: true }),
+ expenseCategoryId: zohoInvoiceAiProps.expenseCategoryId({ required: true }),
+ },
+ async run({ auth, propsValue }) {
+ return await zohoInvoiceApi.markExpenseCategoryInactive({
+ auth,
+ organizationId: propsValue.organizationId,
+ expenseCategoryId: propsValue.expenseCategoryId,
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-invoice/src/lib/actions/ai/expenses/update-expense-category.ts b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/expenses/update-expense-category.ts
new file mode 100644
index 00000000000..442d37e3246
--- /dev/null
+++ b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/expenses/update-expense-category.ts
@@ -0,0 +1,47 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoInvoiceAuth } from '../../../auth';
+import { zohoInvoiceAiProps } from '../../../common/ai-props';
+import { zohoInvoiceApi } from '../../../common/api';
+import { zohoInvoiceUtils } from '../../../common/utils';
+import { zohoInvoiceExpenseCategoryOutputSchema } from '../../../output-schemas';
+
+export const updateExpenseCategoryAction = createAction({
+ auth: zohoInvoiceAuth,
+ name: 'zoho_invoice_update_expense_category',
+ outputSchema: zohoInvoiceExpenseCategoryOutputSchema,
+ displayName: 'Update Expense Category',
+ description: "Changes an expense category's name or description.",
+ audience: 'ai',
+ classification: 'WRITE',
+ aiMetadata: {
+ description:
+ "Changes an expense category's name or description. Fields left empty keep their current value. Use List Expense Categories to find the ID.",
+ idempotent: true,
+ },
+ props: {
+ organizationId: zohoInvoiceAiProps.organizationId({ required: true }),
+ expenseCategoryId: zohoInvoiceAiProps.expenseCategoryId({ required: true }),
+ accountName: Property.ShortText({
+ displayName: 'Name',
+ description: 'New name. Empty = unchanged.',
+ required: false,
+ }),
+ description: Property.LongText({
+ displayName: 'Description',
+ description: 'New description. Empty = unchanged.',
+ required: false,
+ }),
+ },
+ async run({ auth, propsValue }) {
+ return await zohoInvoiceApi.updateExpenseCategory({
+ auth,
+ organizationId: propsValue.organizationId,
+ expenseCategoryId: propsValue.expenseCategoryId,
+ body: zohoInvoiceUtils.compact({
+ account_name: propsValue.accountName,
+ description: propsValue.description,
+ }),
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-invoice/src/lib/actions/ai/expenses/update-expense.ts b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/expenses/update-expense.ts
new file mode 100644
index 00000000000..cbf8f651790
--- /dev/null
+++ b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/expenses/update-expense.ts
@@ -0,0 +1,102 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoInvoiceAuth } from '../../../auth';
+import { zohoInvoiceAiProps } from '../../../common/ai-props';
+import { zohoInvoiceApi } from '../../../common/api';
+import { zohoInvoiceUtils } from '../../../common/utils';
+import { zohoInvoiceExpenseOutputSchema } from '../../../output-schemas';
+
+export const updateExpenseAction = createAction({
+ auth: zohoInvoiceAuth,
+ name: 'zoho_invoice_update_expense',
+ outputSchema: zohoInvoiceExpenseOutputSchema,
+ displayName: 'Update Expense',
+ description: 'Changes the details of an expense.',
+ audience: 'ai',
+ classification: 'WRITE',
+ aiMetadata: {
+ description:
+ "Changes an expense's category, amount, reference, date, description, customer, project or billable flag, and can remove its receipt. Fields left empty keep their current value. Use List Expenses for the expense ID and List Expense Categories for the category ID.",
+ idempotent: true,
+ },
+ props: {
+ organizationId: zohoInvoiceAiProps.organizationId({ required: true }),
+ expenseId: zohoInvoiceAiProps.expenseId({ required: true }),
+ accountId: zohoInvoiceAiProps.expenseCategoryId({
+ required: false,
+ description:
+ 'New expense category ID. Use List Expense Categories to find it. Empty = unchanged.',
+ }),
+ amount: Property.Number({
+ displayName: 'Amount',
+ description: 'New total amount. Empty = unchanged.',
+ required: false,
+ }),
+ referenceNumber: Property.ShortText({
+ displayName: 'Reference Number',
+ description: 'New reference number. Empty = unchanged.',
+ required: false,
+ }),
+ date: Property.ShortText({
+ displayName: 'Date',
+ description: 'New expense date, yyyy-mm-dd. Empty = unchanged.',
+ required: false,
+ }),
+ description: Property.LongText({
+ displayName: 'Description',
+ description: 'New description. Empty = unchanged.',
+ required: false,
+ }),
+ customerId: zohoInvoiceAiProps.contactId({
+ required: false,
+ description: 'New customer ID. Use List Contacts to find it. Empty = unchanged.',
+ }),
+ projectId: zohoInvoiceAiProps.projectId({
+ required: false,
+ description: 'New project ID. Use List Projects to find it. Empty = unchanged.',
+ }),
+ isBillable: zohoInvoiceAiProps.yesNo({
+ required: false,
+ displayName: 'Billable',
+ description: 'Whether the expense can be billed to the customer. Empty = unchanged.',
+ }),
+ taxId: zohoInvoiceAiProps.taxId({
+ required: false,
+ description: 'New tax ID. Use List Taxes to find it. Empty = unchanged.',
+ }),
+ deleteReceipt: zohoInvoiceAiProps.yesNo({
+ required: false,
+ displayName: 'Delete Receipt',
+ description: 'Yes = remove the receipt attached to the expense. Empty = keep it.',
+ }),
+ additionalFields: zohoInvoiceAiProps.additionalFields({ required: false }),
+ },
+ async run({ auth, propsValue }) {
+ const { organizationId, expenseId } = propsValue;
+ const current = await zohoInvoiceApi.getExpense({ auth, organizationId, expenseId });
+ return await zohoInvoiceApi.updateExpense({
+ auth,
+ organizationId,
+ expenseId,
+ deleteReceipt: zohoInvoiceUtils.toOptionalBoolean({ value: propsValue.deleteReceipt }),
+ body: {
+ ...zohoInvoiceUtils.compact({
+ amount: current.expense?.amount,
+ reference_number: current.expense?.reference_number,
+ }),
+ ...(propsValue.additionalFields ?? {}),
+ ...zohoInvoiceUtils.compact({
+ account_id: propsValue.accountId,
+ amount: propsValue.amount,
+ reference_number: propsValue.referenceNumber,
+ date: propsValue.date,
+ description: propsValue.description,
+ customer_id: propsValue.customerId,
+ project_id: propsValue.projectId,
+ is_billable: zohoInvoiceUtils.toOptionalBoolean({ value: propsValue.isBillable }),
+ tax_id: propsValue.taxId,
+ }),
+ },
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-invoice/src/lib/actions/ai/index.ts b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/index.ts
new file mode 100644
index 00000000000..1a132372d03
--- /dev/null
+++ b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/index.ts
@@ -0,0 +1,395 @@
+import { addContactAddressAction } from './contacts/add-contact-address';
+import { createContactAction } from './contacts/create-contact';
+import { createContactPersonAction } from './contacts/create-contact-person';
+import { deleteContactAction } from './contacts/delete-contact';
+import { deleteContactAddressAction } from './contacts/delete-contact-address';
+import { deleteContactPersonAction } from './contacts/delete-contact-person';
+import { disableContactPaymentRemindersAction } from './contacts/disable-contact-payment-reminders';
+import { emailContactAction } from './contacts/email-contact';
+import { emailContactStatementAction } from './contacts/email-contact-statement';
+import { enableContactPaymentRemindersAction } from './contacts/enable-contact-payment-reminders';
+import { enableContactPortalAccessAction } from './contacts/enable-contact-portal-access';
+import { getContactAction } from './contacts/get-contact';
+import { getContactPersonAction } from './contacts/get-contact-person';
+import { getContactStatementEmailContentAction } from './contacts/get-contact-statement-email-content';
+import { listContactAddressesAction } from './contacts/list-contact-addresses';
+import { listContactCommentsAction } from './contacts/list-contact-comments';
+import { listContactPersonsAction } from './contacts/list-contact-persons';
+import { listContactRefundsAction } from './contacts/list-contact-refunds';
+import { listContactsAction } from './contacts/list-contacts';
+import { markContactActiveAction } from './contacts/mark-contact-active';
+import { markContactInactiveAction } from './contacts/mark-contact-inactive';
+import { markContactPersonPrimaryAction } from './contacts/mark-contact-person-primary';
+import { updateContactAction } from './contacts/update-contact';
+import { updateContactAddressAction } from './contacts/update-contact-address';
+import { updateContactPersonAction } from './contacts/update-contact-person';
+import { addCreditNoteCommentAction } from './credit-notes/add-credit-note-comment';
+import { applyCreditNoteToInvoicesAction } from './credit-notes/apply-credit-note-to-invoices';
+import { createCreditNoteAction } from './credit-notes/create-credit-note';
+import { deleteCreditNoteAction } from './credit-notes/delete-credit-note';
+import { deleteCreditNoteCommentAction } from './credit-notes/delete-credit-note-comment';
+import { deleteCreditNoteRefundAction } from './credit-notes/delete-credit-note-refund';
+import { emailCreditNoteAction } from './credit-notes/email-credit-note';
+import { getCreditNoteAction } from './credit-notes/get-credit-note';
+import { getCreditNoteEmailHistoryAction } from './credit-notes/get-credit-note-email-history';
+import { getCreditNoteRefundAction } from './credit-notes/get-credit-note-refund';
+import { listAllCreditNoteRefundsAction } from './credit-notes/list-all-credit-note-refunds';
+import { listCreditNoteCommentsAction } from './credit-notes/list-credit-note-comments';
+import { listCreditNoteInvoicesAction } from './credit-notes/list-credit-note-invoices';
+import { listCreditNoteRefundsAction } from './credit-notes/list-credit-note-refunds';
+import { listCreditNoteTemplatesAction } from './credit-notes/list-credit-note-templates';
+import { listCreditNotesAction } from './credit-notes/list-credit-notes';
+import { refundCreditNoteAction } from './credit-notes/refund-credit-note';
+import { removeCreditNoteFromInvoiceAction } from './credit-notes/remove-credit-note-from-invoice';
+import { reopenCreditNoteAction } from './credit-notes/reopen-credit-note';
+import { setCreditNoteTemplateAction } from './credit-notes/set-credit-note-template';
+import { updateCreditNoteAction } from './credit-notes/update-credit-note';
+import { updateCreditNoteRefundAction } from './credit-notes/update-credit-note-refund';
+import { voidCreditNoteAction } from './credit-notes/void-credit-note';
+import { createCustomerPaymentAction } from './customer-payments/create-customer-payment';
+import { deleteCustomerPaymentAction } from './customer-payments/delete-customer-payment';
+import { deleteCustomerPaymentRefundAction } from './customer-payments/delete-customer-payment-refund';
+import { getCustomerPaymentAction } from './customer-payments/get-customer-payment';
+import { getCustomerPaymentRefundAction } from './customer-payments/get-customer-payment-refund';
+import { listCustomerPaymentRefundsAction } from './customer-payments/list-customer-payment-refunds';
+import { listCustomerPaymentsAction } from './customer-payments/list-customer-payments';
+import { refundCustomerPaymentAction } from './customer-payments/refund-customer-payment';
+import { updateCustomerPaymentAction } from './customer-payments/update-customer-payment';
+import { updateCustomerPaymentCustomFieldsAction } from './customer-payments/update-customer-payment-custom-fields';
+import { updateCustomerPaymentRefundAction } from './customer-payments/update-customer-payment-refund';
+import { addEstimateCommentAction } from './estimates/add-estimate-comment';
+import { createEstimateAction } from './estimates/create-estimate';
+import { deleteEstimateAction } from './estimates/delete-estimate';
+import { deleteEstimateCommentAction } from './estimates/delete-estimate-comment';
+import { emailEstimateAction } from './estimates/email-estimate';
+import { emailMultipleEstimatesAction } from './estimates/email-multiple-estimates';
+import { exportEstimatesPdfAction } from './estimates/export-estimates-pdf';
+import { getEstimateAction } from './estimates/get-estimate';
+import { getEstimateEmailContentAction } from './estimates/get-estimate-email-content';
+import { listEstimateCommentsAction } from './estimates/list-estimate-comments';
+import { listEstimateTemplatesAction } from './estimates/list-estimate-templates';
+import { listEstimatesAction } from './estimates/list-estimates';
+import { markEstimateAcceptedAction } from './estimates/mark-estimate-accepted';
+import { markEstimateDeclinedAction } from './estimates/mark-estimate-declined';
+import { markEstimateSentAction } from './estimates/mark-estimate-sent';
+import { setEstimateTemplateAction } from './estimates/set-estimate-template';
+import { updateEstimateAction } from './estimates/update-estimate';
+import { updateEstimateBillingAddressAction } from './estimates/update-estimate-billing-address';
+import { updateEstimateCommentAction } from './estimates/update-estimate-comment';
+import { updateEstimateShippingAddressAction } from './estimates/update-estimate-shipping-address';
+import { createExpenseAction } from './expenses/create-expense';
+import { createExpenseCategoryAction } from './expenses/create-expense-category';
+import { deleteExpenseAction } from './expenses/delete-expense';
+import { deleteExpenseCategoryAction } from './expenses/delete-expense-category';
+import { getExpenseAction } from './expenses/get-expense';
+import { getExpenseCategoryAction } from './expenses/get-expense-category';
+import { listExpenseCategoriesAction } from './expenses/list-expense-categories';
+import { listExpenseHistoryAction } from './expenses/list-expense-history';
+import { listExpensesAction } from './expenses/list-expenses';
+import { markExpenseCategoryActiveAction } from './expenses/mark-expense-category-active';
+import { markExpenseCategoryInactiveAction } from './expenses/mark-expense-category-inactive';
+import { updateExpenseAction } from './expenses/update-expense';
+import { updateExpenseCategoryAction } from './expenses/update-expense-category';
+import { addInvoiceAttachmentAction } from './invoices/add-invoice-attachment';
+import { addInvoiceCommentAction } from './invoices/add-invoice-comment';
+import { applyCreditsToInvoiceAction } from './invoices/apply-credits-to-invoice';
+import { cancelInvoiceWriteOffAction } from './invoices/cancel-invoice-write-off';
+import { createInvoiceAction } from './invoices/create-invoice';
+import { deleteInvoiceAction } from './invoices/delete-invoice';
+import { deleteInvoiceAttachmentAction } from './invoices/delete-invoice-attachment';
+import { deleteInvoiceCommentAction } from './invoices/delete-invoice-comment';
+import { deleteInvoicePaymentAction } from './invoices/delete-invoice-payment';
+import { disableInvoicePaymentReminderAction } from './invoices/disable-invoice-payment-reminder';
+import { emailInvoiceAction } from './invoices/email-invoice';
+import { enableInvoicePaymentReminderAction } from './invoices/enable-invoice-payment-reminder';
+import { exportInvoicesPdfAction } from './invoices/export-invoices-pdf';
+import { getInvoiceAction } from './invoices/get-invoice';
+import { getInvoiceAttachmentAction } from './invoices/get-invoice-attachment';
+import { getInvoiceEmailContentAction } from './invoices/get-invoice-email-content';
+import { getInvoicePaymentReminderContentAction } from './invoices/get-invoice-payment-reminder-content';
+import { listInvoiceCommentsAction } from './invoices/list-invoice-comments';
+import { listInvoiceCreditsAppliedAction } from './invoices/list-invoice-credits-applied';
+import { listInvoicePaymentsAction } from './invoices/list-invoice-payments';
+import { listInvoiceTemplatesAction } from './invoices/list-invoice-templates';
+import { listInvoicesAction } from './invoices/list-invoices';
+import { markInvoiceDraftAction } from './invoices/mark-invoice-draft';
+import { markInvoiceSentAction } from './invoices/mark-invoice-sent';
+import { sendBulkInvoiceReminderAction } from './invoices/send-bulk-invoice-reminder';
+import { sendInvoicePaymentReminderAction } from './invoices/send-invoice-payment-reminder';
+import { setInvoiceTemplateAction } from './invoices/set-invoice-template';
+import { updateInvoiceAction } from './invoices/update-invoice';
+import { updateInvoiceBillingAddressAction } from './invoices/update-invoice-billing-address';
+import { updateInvoiceCommentAction } from './invoices/update-invoice-comment';
+import { updateInvoiceShippingAddressAction } from './invoices/update-invoice-shipping-address';
+import { voidInvoiceAction } from './invoices/void-invoice';
+import { writeOffInvoiceAction } from './invoices/write-off-invoice';
+import { createItemAction } from './items/create-item';
+import { deleteItemAction } from './items/delete-item';
+import { getItemAction } from './items/get-item';
+import { listItemsAction } from './items/list-items';
+import { markItemActiveAction } from './items/mark-item-active';
+import { markItemInactiveAction } from './items/mark-item-inactive';
+import { updateItemAction } from './items/update-item';
+import { getCurrentUserAction } from './organizations/get-current-user';
+import { getOrganizationAction } from './organizations/get-organization';
+import { getUserAction } from './organizations/get-user';
+import { listOrganizationsAction } from './organizations/list-organizations';
+import { listUsersAction } from './organizations/list-users';
+import { updateUserAction } from './organizations/update-user';
+import { activateProjectAction } from './projects/activate-project';
+import { addProjectCommentAction } from './projects/add-project-comment';
+import { cloneProjectAction } from './projects/clone-project';
+import { createEmployeeAction } from './projects/create-employee';
+import { createProjectAction } from './projects/create-project';
+import { createTaskAction } from './projects/create-task';
+import { createTimeEntryAction } from './projects/create-time-entry';
+import { deactivateProjectAction } from './projects/deactivate-project';
+import { deleteEmployeeAction } from './projects/delete-employee';
+import { deleteProjectAction } from './projects/delete-project';
+import { deleteProjectCommentAction } from './projects/delete-project-comment';
+import { deleteTaskAction } from './projects/delete-task';
+import { deleteTimeEntryAction } from './projects/delete-time-entry';
+import { getProjectAction } from './projects/get-project';
+import { getProjectUserAction } from './projects/get-project-user';
+import { getRunningTimerAction } from './projects/get-running-timer';
+import { getTaskAction } from './projects/get-task';
+import { getTimeEntryAction } from './projects/get-time-entry';
+import { listEmployeesAction } from './projects/list-employees';
+import { listProjectCommentsAction } from './projects/list-project-comments';
+import { listProjectInvoicesAction } from './projects/list-project-invoices';
+import { listProjectUsersAction } from './projects/list-project-users';
+import { listProjectsAction } from './projects/list-projects';
+import { listTasksAction } from './projects/list-tasks';
+import { listTimeEntriesAction } from './projects/list-time-entries';
+import { startTimerAction } from './projects/start-timer';
+import { stopTimerAction } from './projects/stop-timer';
+import { updateProjectAction } from './projects/update-project';
+import { updateProjectUserAction } from './projects/update-project-user';
+import { updateTaskAction } from './projects/update-task';
+import { updateTimeEntryAction } from './projects/update-time-entry';
+import { createRecurringInvoiceAction } from './recurring-invoices/create-recurring-invoice';
+import { deleteRecurringInvoiceAction } from './recurring-invoices/delete-recurring-invoice';
+import { getRecurringInvoiceAction } from './recurring-invoices/get-recurring-invoice';
+import { listRecurringInvoiceHistoryAction } from './recurring-invoices/list-recurring-invoice-history';
+import { listRecurringInvoicesAction } from './recurring-invoices/list-recurring-invoices';
+import { resumeRecurringInvoiceAction } from './recurring-invoices/resume-recurring-invoice';
+import { stopRecurringInvoiceAction } from './recurring-invoices/stop-recurring-invoice';
+import { updateRecurringInvoiceAction } from './recurring-invoices/update-recurring-invoice';
+import { createCurrencyAction } from './settings/create-currency';
+import { createExchangeRateAction } from './settings/create-exchange-rate';
+import { createTaxAction } from './settings/create-tax';
+import { createTaxGroupAction } from './settings/create-tax-group';
+import { deleteCurrencyAction } from './settings/delete-currency';
+import { deleteExchangeRateAction } from './settings/delete-exchange-rate';
+import { deleteTaxAction } from './settings/delete-tax';
+import { deleteTaxGroupAction } from './settings/delete-tax-group';
+import { getCurrencyAction } from './settings/get-currency';
+import { getExchangeRateAction } from './settings/get-exchange-rate';
+import { getTaxAction } from './settings/get-tax';
+import { getTaxGroupAction } from './settings/get-tax-group';
+import { listCurrenciesAction } from './settings/list-currencies';
+import { listExchangeRatesAction } from './settings/list-exchange-rates';
+import { listTaxesAction } from './settings/list-taxes';
+import { updateCurrencyAction } from './settings/update-currency';
+import { updateExchangeRateAction } from './settings/update-exchange-rate';
+import { updateTaxAction } from './settings/update-tax';
+import { updateTaxGroupAction } from './settings/update-tax-group';
+
+export const zohoInvoiceAiActions = [
+ activateProjectAction,
+ addContactAddressAction,
+ addCreditNoteCommentAction,
+ addEstimateCommentAction,
+ addInvoiceAttachmentAction,
+ addInvoiceCommentAction,
+ addProjectCommentAction,
+ applyCreditNoteToInvoicesAction,
+ applyCreditsToInvoiceAction,
+ cancelInvoiceWriteOffAction,
+ cloneProjectAction,
+ createContactPersonAction,
+ createContactAction,
+ createCreditNoteAction,
+ createCurrencyAction,
+ createCustomerPaymentAction,
+ createEmployeeAction,
+ createEstimateAction,
+ createExchangeRateAction,
+ createExpenseCategoryAction,
+ createExpenseAction,
+ createInvoiceAction,
+ createItemAction,
+ createProjectAction,
+ createRecurringInvoiceAction,
+ createTaskAction,
+ createTaxGroupAction,
+ createTaxAction,
+ createTimeEntryAction,
+ deactivateProjectAction,
+ deleteContactAddressAction,
+ deleteContactPersonAction,
+ deleteContactAction,
+ deleteCreditNoteCommentAction,
+ deleteCreditNoteRefundAction,
+ deleteCreditNoteAction,
+ deleteCurrencyAction,
+ deleteCustomerPaymentRefundAction,
+ deleteCustomerPaymentAction,
+ deleteEmployeeAction,
+ deleteEstimateCommentAction,
+ deleteEstimateAction,
+ deleteExchangeRateAction,
+ deleteExpenseCategoryAction,
+ deleteExpenseAction,
+ deleteInvoiceAttachmentAction,
+ deleteInvoiceCommentAction,
+ deleteInvoicePaymentAction,
+ deleteInvoiceAction,
+ deleteItemAction,
+ deleteProjectCommentAction,
+ deleteProjectAction,
+ deleteRecurringInvoiceAction,
+ deleteTaskAction,
+ deleteTaxGroupAction,
+ deleteTaxAction,
+ deleteTimeEntryAction,
+ disableContactPaymentRemindersAction,
+ disableInvoicePaymentReminderAction,
+ emailContactStatementAction,
+ emailContactAction,
+ emailCreditNoteAction,
+ emailEstimateAction,
+ emailInvoiceAction,
+ emailMultipleEstimatesAction,
+ enableContactPaymentRemindersAction,
+ enableContactPortalAccessAction,
+ enableInvoicePaymentReminderAction,
+ exportEstimatesPdfAction,
+ exportInvoicesPdfAction,
+ getContactPersonAction,
+ getContactStatementEmailContentAction,
+ getContactAction,
+ getCreditNoteEmailHistoryAction,
+ getCreditNoteRefundAction,
+ getCreditNoteAction,
+ getCurrencyAction,
+ getCurrentUserAction,
+ getCustomerPaymentRefundAction,
+ getCustomerPaymentAction,
+ getEstimateEmailContentAction,
+ getEstimateAction,
+ getExchangeRateAction,
+ getExpenseCategoryAction,
+ getExpenseAction,
+ getInvoiceAttachmentAction,
+ getInvoiceEmailContentAction,
+ getInvoicePaymentReminderContentAction,
+ getInvoiceAction,
+ getItemAction,
+ getOrganizationAction,
+ getProjectUserAction,
+ getProjectAction,
+ getRecurringInvoiceAction,
+ getRunningTimerAction,
+ getTaskAction,
+ getTaxGroupAction,
+ getTaxAction,
+ getTimeEntryAction,
+ getUserAction,
+ listAllCreditNoteRefundsAction,
+ listContactAddressesAction,
+ listContactCommentsAction,
+ listContactPersonsAction,
+ listContactRefundsAction,
+ listContactsAction,
+ listCreditNoteCommentsAction,
+ listCreditNoteInvoicesAction,
+ listCreditNoteRefundsAction,
+ listCreditNoteTemplatesAction,
+ listCreditNotesAction,
+ listCurrenciesAction,
+ listCustomerPaymentRefundsAction,
+ listCustomerPaymentsAction,
+ listEmployeesAction,
+ listEstimateCommentsAction,
+ listEstimateTemplatesAction,
+ listEstimatesAction,
+ listExchangeRatesAction,
+ listExpenseCategoriesAction,
+ listExpenseHistoryAction,
+ listExpensesAction,
+ listInvoiceCommentsAction,
+ listInvoiceCreditsAppliedAction,
+ listInvoicePaymentsAction,
+ listInvoiceTemplatesAction,
+ listInvoicesAction,
+ listItemsAction,
+ listOrganizationsAction,
+ listProjectCommentsAction,
+ listProjectInvoicesAction,
+ listProjectUsersAction,
+ listProjectsAction,
+ listRecurringInvoiceHistoryAction,
+ listRecurringInvoicesAction,
+ listTasksAction,
+ listTaxesAction,
+ listTimeEntriesAction,
+ listUsersAction,
+ markContactActiveAction,
+ markContactInactiveAction,
+ markContactPersonPrimaryAction,
+ markEstimateAcceptedAction,
+ markEstimateDeclinedAction,
+ markEstimateSentAction,
+ markExpenseCategoryActiveAction,
+ markExpenseCategoryInactiveAction,
+ markInvoiceDraftAction,
+ markInvoiceSentAction,
+ markItemActiveAction,
+ markItemInactiveAction,
+ refundCreditNoteAction,
+ refundCustomerPaymentAction,
+ removeCreditNoteFromInvoiceAction,
+ reopenCreditNoteAction,
+ resumeRecurringInvoiceAction,
+ sendBulkInvoiceReminderAction,
+ sendInvoicePaymentReminderAction,
+ setCreditNoteTemplateAction,
+ setEstimateTemplateAction,
+ setInvoiceTemplateAction,
+ startTimerAction,
+ stopRecurringInvoiceAction,
+ stopTimerAction,
+ updateContactAddressAction,
+ updateContactPersonAction,
+ updateContactAction,
+ updateCreditNoteRefundAction,
+ updateCreditNoteAction,
+ updateCurrencyAction,
+ updateCustomerPaymentCustomFieldsAction,
+ updateCustomerPaymentRefundAction,
+ updateCustomerPaymentAction,
+ updateEstimateBillingAddressAction,
+ updateEstimateCommentAction,
+ updateEstimateShippingAddressAction,
+ updateEstimateAction,
+ updateExchangeRateAction,
+ updateExpenseCategoryAction,
+ updateExpenseAction,
+ updateInvoiceBillingAddressAction,
+ updateInvoiceCommentAction,
+ updateInvoiceShippingAddressAction,
+ updateInvoiceAction,
+ updateItemAction,
+ updateProjectUserAction,
+ updateProjectAction,
+ updateRecurringInvoiceAction,
+ updateTaskAction,
+ updateTaxGroupAction,
+ updateTaxAction,
+ updateTimeEntryAction,
+ updateUserAction,
+ voidCreditNoteAction,
+ voidInvoiceAction,
+ writeOffInvoiceAction,
+];
diff --git a/packages/pieces/community/zoho-invoice/src/lib/actions/ai/invoices/add-invoice-attachment.ts b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/invoices/add-invoice-attachment.ts
new file mode 100644
index 00000000000..b3399c8f55a
--- /dev/null
+++ b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/invoices/add-invoice-attachment.ts
@@ -0,0 +1,45 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoInvoiceAuth } from '../../../auth';
+import { zohoInvoiceAiProps } from '../../../common/ai-props';
+import { zohoInvoiceApi } from '../../../common/api';
+import { zohoInvoiceUtils } from '../../../common/utils';
+import { zohoInvoiceAddInvoiceAttachmentOutputSchema } from '../../../output-schemas';
+
+export const addInvoiceAttachmentAction = createAction({
+ auth: zohoInvoiceAuth,
+ name: 'zoho_invoice_add_invoice_attachment',
+ outputSchema: zohoInvoiceAddInvoiceAttachmentOutputSchema,
+ displayName: 'Add Invoice Attachment',
+ description: 'Attaches a file to an invoice.',
+ audience: 'ai',
+ classification: 'WRITE',
+ aiMetadata: {
+ description:
+ 'Uploads a file and attaches it to an invoice. Use Get Invoice Attachment to download it and Delete Invoice Attachment to remove it. Use List Invoices to find the ID. Not idempotent.',
+ idempotent: false,
+ },
+ props: {
+ organizationId: zohoInvoiceAiProps.organizationId({ required: true }),
+ invoiceId: zohoInvoiceAiProps.invoiceId({ required: true }),
+ file: Property.File({
+ displayName: 'File',
+ description: 'File to attach.',
+ required: true,
+ }),
+ canSendInMail: zohoInvoiceAiProps.yesNo({
+ required: false,
+ displayName: 'Send With Email',
+ description: 'Yes to include this file when the invoice is emailed.',
+ }),
+ },
+ async run({ auth, propsValue }) {
+ return await zohoInvoiceApi.addInvoiceAttachment({
+ auth,
+ organizationId: propsValue.organizationId,
+ invoiceId: propsValue.invoiceId,
+ file: propsValue.file,
+ canSendInMail: zohoInvoiceUtils.toOptionalBoolean({ value: propsValue.canSendInMail }),
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-invoice/src/lib/actions/ai/invoices/add-invoice-comment.ts b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/invoices/add-invoice-comment.ts
new file mode 100644
index 00000000000..d530e68fff7
--- /dev/null
+++ b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/invoices/add-invoice-comment.ts
@@ -0,0 +1,55 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoInvoiceAuth } from '../../../auth';
+import { zohoInvoiceAiProps } from '../../../common/ai-props';
+import { zohoInvoiceApi } from '../../../common/api';
+import { zohoInvoiceUtils } from '../../../common/utils';
+import { zohoInvoiceCommentOutputSchema } from '../../../output-schemas';
+
+export const addInvoiceCommentAction = createAction({
+ auth: zohoInvoiceAuth,
+ name: 'zoho_invoice_add_invoice_comment',
+ outputSchema: zohoInvoiceCommentOutputSchema,
+ displayName: 'Add Invoice Comment',
+ description: 'Adds a comment to an invoice.',
+ audience: 'ai',
+ classification: 'WRITE',
+ aiMetadata: {
+ description:
+ 'Adds a comment to an invoice, optionally visible to the customer and with an expected payment date. Use List Invoices to find the ID. Not idempotent: each call adds another comment.',
+ idempotent: false,
+ },
+ props: {
+ organizationId: zohoInvoiceAiProps.organizationId({ required: true }),
+ invoiceId: zohoInvoiceAiProps.invoiceId({ required: true }),
+ description: Property.LongText({
+ displayName: 'Comment',
+ description: 'Comment text.',
+ required: true,
+ }),
+ paymentExpectedDate: Property.ShortText({
+ displayName: 'Payment Expected Date',
+ description: 'Date the customer is expected to pay (yyyy-mm-dd).',
+ required: false,
+ }),
+ showCommentToClients: zohoInvoiceAiProps.yesNo({
+ required: false,
+ displayName: 'Show to Customer',
+ description: 'Yes to show the comment to the customer in the portal.',
+ }),
+ },
+ async run({ auth, propsValue }) {
+ return await zohoInvoiceApi.addInvoiceComment({
+ auth,
+ organizationId: propsValue.organizationId,
+ invoiceId: propsValue.invoiceId,
+ body: zohoInvoiceUtils.compact({
+ description: propsValue.description,
+ payment_expected_date: propsValue.paymentExpectedDate,
+ show_comment_to_clients: zohoInvoiceUtils.toOptionalBoolean({
+ value: propsValue.showCommentToClients,
+ }),
+ }),
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-invoice/src/lib/actions/ai/invoices/apply-credits-to-invoice.ts b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/invoices/apply-credits-to-invoice.ts
new file mode 100644
index 00000000000..42cd2034065
--- /dev/null
+++ b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/invoices/apply-credits-to-invoice.ts
@@ -0,0 +1,86 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoInvoiceAuth } from '../../../auth';
+import { zohoInvoiceAiProps } from '../../../common/ai-props';
+import { zohoInvoiceApi } from '../../../common/api';
+import { zohoInvoiceUtils } from '../../../common/utils';
+import { zohoInvoiceApplyCreditsToInvoiceOutputSchema } from '../../../output-schemas';
+
+export const applyCreditsToInvoiceAction = createAction({
+ auth: zohoInvoiceAuth,
+ name: 'zoho_invoice_apply_credits_to_invoice',
+ outputSchema: zohoInvoiceApplyCreditsToInvoiceOutputSchema,
+ displayName: 'Apply Credits to Invoice',
+ description: 'Applies customer credit notes or excess payments to an invoice.',
+ audience: 'ai',
+ classification: 'WRITE',
+ aiMetadata: {
+ description:
+ 'Reduces the invoice balance with open credit notes and/or unused customer payments of the same customer. Use List Credit Notes for credit note IDs, List Customer Payments for payment IDs and List Invoices for the invoice ID. Not idempotent: each call applies the amounts again.',
+ idempotent: false,
+ },
+ props: {
+ organizationId: zohoInvoiceAiProps.organizationId({ required: true }),
+ invoiceId: zohoInvoiceAiProps.invoiceId({ required: true }),
+ creditNotes: Property.Array({
+ displayName: 'Credit Notes',
+ description: 'Credit notes to apply and the amount from each.',
+ required: false,
+ properties: {
+ creditNoteId: Property.ShortText({
+ displayName: 'Credit Note ID',
+ description: 'Credit note ID. Use List Credit Notes to find it.',
+ required: true,
+ }),
+ amountApplied: Property.Number({
+ displayName: 'Amount',
+ description: 'Amount to apply from this credit note.',
+ required: true,
+ }),
+ },
+ }),
+ payments: Property.Array({
+ displayName: 'Payments',
+ description: 'Unused customer payments to apply and the amount from each.',
+ required: false,
+ properties: {
+ paymentId: Property.ShortText({
+ displayName: 'Payment ID',
+ description: 'Customer payment ID. Use List Customer Payments to find it.',
+ required: true,
+ }),
+ amountApplied: Property.Number({
+ displayName: 'Amount',
+ description: 'Amount to apply from this payment.',
+ required: true,
+ }),
+ },
+ }),
+ },
+ async run({ auth, propsValue }) {
+ const { creditNotes, payments } = propsValue;
+ if ((creditNotes ?? []).length === 0 && (payments ?? []).length === 0) {
+ throw new Error('Give at least one entry in Credit Notes or Payments.');
+ }
+ return await zohoInvoiceApi.applyCreditsToInvoice({
+ auth,
+ organizationId: propsValue.organizationId,
+ invoiceId: propsValue.invoiceId,
+ body: zohoInvoiceUtils.compact({
+ apply_creditnotes:
+ creditNotes &&
+ zohoInvoiceUtils
+ .toRecords({ rows: creditNotes, propName: 'Credit Notes' })
+ .map((row) => ({
+ creditnote_id: row['creditNoteId'],
+ amount_applied: row['amountApplied'],
+ })),
+ invoice_payments:
+ payments &&
+ zohoInvoiceUtils
+ .toRecords({ rows: payments, propName: 'Payments' })
+ .map((row) => ({ payment_id: row['paymentId'], amount_applied: row['amountApplied'] })),
+ }),
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-invoice/src/lib/actions/ai/invoices/cancel-invoice-write-off.ts b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/invoices/cancel-invoice-write-off.ts
new file mode 100644
index 00000000000..8e03768c98d
--- /dev/null
+++ b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/invoices/cancel-invoice-write-off.ts
@@ -0,0 +1,32 @@
+import { createAction } from '@activepieces/pieces-framework';
+
+import { zohoInvoiceAuth } from '../../../auth';
+import { zohoInvoiceAiProps } from '../../../common/ai-props';
+import { zohoInvoiceApi } from '../../../common/api';
+import { zohoInvoiceMessageOutputSchema } from '../../../output-schemas';
+
+export const cancelInvoiceWriteOffAction = createAction({
+ auth: zohoInvoiceAuth,
+ name: 'zoho_invoice_cancel_invoice_write_off',
+ outputSchema: zohoInvoiceMessageOutputSchema,
+ displayName: 'Cancel Invoice Write Off',
+ description: 'Cancels the write off of an invoice.',
+ audience: 'ai',
+ classification: 'WRITE',
+ aiMetadata: {
+ description:
+ 'Reverses Write Off Invoice so the balance is due again. Use List Invoices to find the ID.',
+ idempotent: true,
+ },
+ props: {
+ organizationId: zohoInvoiceAiProps.organizationId({ required: true }),
+ invoiceId: zohoInvoiceAiProps.invoiceId({ required: true }),
+ },
+ async run({ auth, propsValue }) {
+ return await zohoInvoiceApi.cancelInvoiceWriteOff({
+ auth,
+ organizationId: propsValue.organizationId,
+ invoiceId: propsValue.invoiceId,
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-invoice/src/lib/actions/ai/invoices/create-invoice.ts b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/invoices/create-invoice.ts
new file mode 100644
index 00000000000..c460eeed107
--- /dev/null
+++ b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/invoices/create-invoice.ts
@@ -0,0 +1,145 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoInvoiceAuth } from '../../../auth';
+import { zohoInvoiceAiProps } from '../../../common/ai-props';
+import { zohoInvoiceApi } from '../../../common/api';
+import { zohoInvoiceUtils } from '../../../common/utils';
+import { zohoInvoiceInvoiceOutputSchema } from '../../../output-schemas';
+
+export const createInvoiceAction = createAction({
+ auth: zohoInvoiceAuth,
+ name: 'zoho_invoice_create_invoice',
+ outputSchema: zohoInvoiceInvoiceOutputSchema,
+ displayName: 'Create Invoice',
+ description: 'Creates an invoice for a customer.',
+ audience: 'ai',
+ classification: 'WRITE',
+ aiMetadata: {
+ description:
+ 'Creates an invoice for a customer with one or more line items; it is saved as a draft unless Send is Yes, which emails it to the customer. Use List Contacts for the customer ID and List Items for item IDs. Not idempotent: each call creates a new invoice.',
+ idempotent: false,
+ },
+ props: {
+ organizationId: zohoInvoiceAiProps.organizationId({ required: true }),
+ customerId: zohoInvoiceAiProps.contactId({
+ required: true,
+ displayName: 'Customer ID',
+ description: 'Customer the invoice is for. Use List Contacts to find it.',
+ }),
+ date: Property.ShortText({
+ displayName: 'Invoice Date',
+ description: 'Invoice date (yyyy-mm-dd).',
+ required: true,
+ }),
+ lineItems: Property.Array({
+ displayName: 'Line Items',
+ description: 'Products or services billed on the invoice. At least one.',
+ required: true,
+ properties: {
+ itemId: Property.ShortText({
+ displayName: 'Item ID',
+ description: 'Item ID. Use List Items to find it.',
+ required: false,
+ }),
+ name: Property.ShortText({
+ displayName: 'Name',
+ description: 'Line item name. Empty = the item name.',
+ required: false,
+ }),
+ description: Property.LongText({
+ displayName: 'Description',
+ description: 'Line item description.',
+ required: false,
+ }),
+ rate: Property.Number({
+ displayName: 'Rate',
+ description: 'Unit price. Empty = the item rate.',
+ required: false,
+ }),
+ quantity: Property.Number({
+ displayName: 'Quantity',
+ description: 'Quantity. Empty = 1.',
+ required: false,
+ }),
+ taxId: Property.ShortText({
+ displayName: 'Tax ID',
+ description: 'Tax applied to this line. Use List Taxes to find it.',
+ required: false,
+ }),
+ },
+ }),
+ dueDate: Property.ShortText({
+ displayName: 'Due Date',
+ description: 'Payment due date (yyyy-mm-dd). Empty = derived from the payment terms.',
+ required: false,
+ }),
+ paymentTerms: Property.Number({
+ displayName: 'Payment Terms (Days)',
+ description: 'Number of days until payment is due.',
+ required: false,
+ }),
+ invoiceNumber: Property.ShortText({
+ displayName: 'Invoice Number',
+ description:
+ 'Custom invoice number. Needs Ignore Auto Number Generation = Yes when auto numbering is on.',
+ required: false,
+ }),
+ ignoreAutoNumberGeneration: zohoInvoiceAiProps.yesNo({
+ required: false,
+ displayName: 'Ignore Auto Number Generation',
+ description: 'Yes to use the Invoice Number given above instead of the next auto number.',
+ }),
+ referenceNumber: Property.ShortText({
+ displayName: 'Reference Number',
+ description: 'Reference or purchase order number.',
+ required: false,
+ }),
+ discount: Property.Number({
+ displayName: 'Discount',
+ description: 'Discount applied to the invoice.',
+ required: false,
+ }),
+ notes: Property.LongText({
+ displayName: 'Notes',
+ description: 'Notes shown to the customer on the invoice.',
+ required: false,
+ }),
+ terms: Property.LongText({
+ displayName: 'Terms & Conditions',
+ description: 'Terms and conditions shown on the invoice.',
+ required: false,
+ }),
+ send: zohoInvoiceAiProps.yesNo({
+ required: false,
+ displayName: 'Send',
+ description:
+ 'Yes to email the invoice to the customer right after creating it (sends a real email). Empty = save as draft.',
+ }),
+ additionalFields: zohoInvoiceAiProps.additionalFields({ required: false }),
+ },
+ async run({ auth, propsValue }) {
+ return await zohoInvoiceApi.createInvoice({
+ auth,
+ organizationId: propsValue.organizationId,
+ send: zohoInvoiceUtils.toOptionalBoolean({ value: propsValue.send }),
+ ignoreAutoNumberGeneration: zohoInvoiceUtils.toOptionalBoolean({
+ value: propsValue.ignoreAutoNumberGeneration,
+ }),
+ body: {
+ ...(propsValue.additionalFields ?? {}),
+ ...zohoInvoiceUtils.compact({
+ customer_id: propsValue.customerId,
+ date: propsValue.date,
+ line_items: zohoInvoiceUtils.toLineItems({ rows: propsValue.lineItems }),
+ due_date: propsValue.dueDate,
+ payment_terms: propsValue.paymentTerms,
+ invoice_number: propsValue.invoiceNumber,
+ reference_number: propsValue.referenceNumber,
+ discount: propsValue.discount,
+ notes: propsValue.notes,
+ terms: propsValue.terms,
+ }),
+ },
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-invoice/src/lib/actions/ai/invoices/delete-invoice-attachment.ts b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/invoices/delete-invoice-attachment.ts
new file mode 100644
index 00000000000..473b1a88ca7
--- /dev/null
+++ b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/invoices/delete-invoice-attachment.ts
@@ -0,0 +1,32 @@
+import { createAction } from '@activepieces/pieces-framework';
+
+import { zohoInvoiceAuth } from '../../../auth';
+import { zohoInvoiceAiProps } from '../../../common/ai-props';
+import { zohoInvoiceApi } from '../../../common/api';
+import { zohoInvoiceMessageOutputSchema } from '../../../output-schemas';
+
+export const deleteInvoiceAttachmentAction = createAction({
+ auth: zohoInvoiceAuth,
+ name: 'zoho_invoice_delete_invoice_attachment',
+ outputSchema: zohoInvoiceMessageOutputSchema,
+ displayName: 'Delete Invoice Attachment',
+ description: 'Removes the file attached to an invoice.',
+ audience: 'ai',
+ classification: 'DESTRUCTIVE',
+ aiMetadata: {
+ description:
+ 'Permanently removes the file attached to an invoice. Use List Invoices to find the ID. Cannot be undone.',
+ idempotent: false,
+ },
+ props: {
+ organizationId: zohoInvoiceAiProps.organizationId({ required: true }),
+ invoiceId: zohoInvoiceAiProps.invoiceId({ required: true }),
+ },
+ async run({ auth, propsValue }) {
+ return await zohoInvoiceApi.deleteInvoiceAttachment({
+ auth,
+ organizationId: propsValue.organizationId,
+ invoiceId: propsValue.invoiceId,
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-invoice/src/lib/actions/ai/invoices/delete-invoice-comment.ts b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/invoices/delete-invoice-comment.ts
new file mode 100644
index 00000000000..fdada9efa8d
--- /dev/null
+++ b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/invoices/delete-invoice-comment.ts
@@ -0,0 +1,37 @@
+import { createAction } from '@activepieces/pieces-framework';
+
+import { zohoInvoiceAuth } from '../../../auth';
+import { zohoInvoiceAiProps } from '../../../common/ai-props';
+import { zohoInvoiceApi } from '../../../common/api';
+import { zohoInvoiceMessageOutputSchema } from '../../../output-schemas';
+
+export const deleteInvoiceCommentAction = createAction({
+ auth: zohoInvoiceAuth,
+ name: 'zoho_invoice_delete_invoice_comment',
+ outputSchema: zohoInvoiceMessageOutputSchema,
+ displayName: 'Delete Invoice Comment',
+ description: 'Deletes a comment from an invoice.',
+ audience: 'ai',
+ classification: 'DESTRUCTIVE',
+ aiMetadata: {
+ description:
+ 'Permanently deletes a comment from an invoice. Use List Invoices for the invoice ID and List Invoice Comments for the comment ID. Cannot be undone.',
+ idempotent: false,
+ },
+ props: {
+ organizationId: zohoInvoiceAiProps.organizationId({ required: true }),
+ invoiceId: zohoInvoiceAiProps.invoiceId({ required: true }),
+ commentId: zohoInvoiceAiProps.commentId({
+ required: true,
+ description: 'Comment ID. Use List Invoice Comments to find it.',
+ }),
+ },
+ async run({ auth, propsValue }) {
+ return await zohoInvoiceApi.deleteInvoiceComment({
+ auth,
+ organizationId: propsValue.organizationId,
+ invoiceId: propsValue.invoiceId,
+ commentId: propsValue.commentId,
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-invoice/src/lib/actions/ai/invoices/delete-invoice-payment.ts b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/invoices/delete-invoice-payment.ts
new file mode 100644
index 00000000000..24f9395ba34
--- /dev/null
+++ b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/invoices/delete-invoice-payment.ts
@@ -0,0 +1,39 @@
+import { createAction } from '@activepieces/pieces-framework';
+
+import { zohoInvoiceAuth } from '../../../auth';
+import { zohoInvoiceAiProps } from '../../../common/ai-props';
+import { zohoInvoiceApi } from '../../../common/api';
+import { zohoInvoiceMessageOutputSchema } from '../../../output-schemas';
+
+export const deleteInvoicePaymentAction = createAction({
+ auth: zohoInvoiceAuth,
+ name: 'zoho_invoice_delete_invoice_payment',
+ outputSchema: zohoInvoiceMessageOutputSchema,
+ displayName: 'Delete Invoice Payment',
+ description: 'Removes a payment applied to an invoice.',
+ audience: 'ai',
+ classification: 'DESTRUCTIVE',
+ aiMetadata: {
+ description:
+ 'Removes a payment applied to an invoice so the amount is due again; the customer payment itself is not deleted. Use List Invoices for the invoice ID and List Invoice Payments for the invoice_payment_id. Cannot be undone.',
+ idempotent: false,
+ },
+ props: {
+ organizationId: zohoInvoiceAiProps.organizationId({ required: true }),
+ invoiceId: zohoInvoiceAiProps.invoiceId({ required: true }),
+ invoicePaymentId: zohoInvoiceAiProps.idProp({
+ required: true,
+ displayName: 'Invoice Payment ID',
+ description:
+ 'invoice_payment_id of the applied payment. Use List Invoice Payments to find it.',
+ }),
+ },
+ async run({ auth, propsValue }) {
+ return await zohoInvoiceApi.deleteInvoicePayment({
+ auth,
+ organizationId: propsValue.organizationId,
+ invoiceId: propsValue.invoiceId,
+ invoicePaymentId: propsValue.invoicePaymentId,
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-invoice/src/lib/actions/ai/invoices/delete-invoice.ts b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/invoices/delete-invoice.ts
new file mode 100644
index 00000000000..f4095495e7b
--- /dev/null
+++ b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/invoices/delete-invoice.ts
@@ -0,0 +1,32 @@
+import { createAction } from '@activepieces/pieces-framework';
+
+import { zohoInvoiceAuth } from '../../../auth';
+import { zohoInvoiceAiProps } from '../../../common/ai-props';
+import { zohoInvoiceApi } from '../../../common/api';
+import { zohoInvoiceMessageOutputSchema } from '../../../output-schemas';
+
+export const deleteInvoiceAction = createAction({
+ auth: zohoInvoiceAuth,
+ name: 'zoho_invoice_delete_invoice',
+ outputSchema: zohoInvoiceMessageOutputSchema,
+ displayName: 'Delete Invoice',
+ description: 'Deletes an invoice.',
+ audience: 'ai',
+ classification: 'DESTRUCTIVE',
+ aiMetadata: {
+ description:
+ 'Permanently deletes an invoice. Use List Invoices to find the ID. Prefer Void Invoice to keep a record. Cannot be undone.',
+ idempotent: false,
+ },
+ props: {
+ organizationId: zohoInvoiceAiProps.organizationId({ required: true }),
+ invoiceId: zohoInvoiceAiProps.invoiceId({ required: true }),
+ },
+ async run({ auth, propsValue }) {
+ return await zohoInvoiceApi.deleteInvoice({
+ auth,
+ organizationId: propsValue.organizationId,
+ invoiceId: propsValue.invoiceId,
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-invoice/src/lib/actions/ai/invoices/disable-invoice-payment-reminder.ts b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/invoices/disable-invoice-payment-reminder.ts
new file mode 100644
index 00000000000..1eda88ea73f
--- /dev/null
+++ b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/invoices/disable-invoice-payment-reminder.ts
@@ -0,0 +1,32 @@
+import { createAction } from '@activepieces/pieces-framework';
+
+import { zohoInvoiceAuth } from '../../../auth';
+import { zohoInvoiceAiProps } from '../../../common/ai-props';
+import { zohoInvoiceApi } from '../../../common/api';
+import { zohoInvoiceMessageOutputSchema } from '../../../output-schemas';
+
+export const disableInvoicePaymentReminderAction = createAction({
+ auth: zohoInvoiceAuth,
+ name: 'zoho_invoice_disable_invoice_payment_reminder',
+ outputSchema: zohoInvoiceMessageOutputSchema,
+ displayName: 'Disable Invoice Payment Reminder',
+ description: 'Turns off automated payment reminders for an invoice.',
+ audience: 'ai',
+ classification: 'WRITE',
+ aiMetadata: {
+ description:
+ 'Stops automated payment reminders for one invoice; manual reminders can still be sent with Send Invoice Payment Reminder. Use List Invoices to find the ID.',
+ idempotent: true,
+ },
+ props: {
+ organizationId: zohoInvoiceAiProps.organizationId({ required: true }),
+ invoiceId: zohoInvoiceAiProps.invoiceId({ required: true }),
+ },
+ async run({ auth, propsValue }) {
+ return await zohoInvoiceApi.disableInvoicePaymentReminder({
+ auth,
+ organizationId: propsValue.organizationId,
+ invoiceId: propsValue.invoiceId,
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-invoice/src/lib/actions/ai/invoices/email-invoice.ts b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/invoices/email-invoice.ts
new file mode 100644
index 00000000000..42232b5a09b
--- /dev/null
+++ b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/invoices/email-invoice.ts
@@ -0,0 +1,81 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoInvoiceAuth } from '../../../auth';
+import { zohoInvoiceAiProps } from '../../../common/ai-props';
+import { zohoInvoiceApi } from '../../../common/api';
+import { zohoInvoiceUtils } from '../../../common/utils';
+import { zohoInvoiceEmailInvoiceOutputSchema } from '../../../output-schemas';
+
+export const emailInvoiceAction = createAction({
+ auth: zohoInvoiceAuth,
+ name: 'zoho_invoice_email_invoice',
+ outputSchema: zohoInvoiceEmailInvoiceOutputSchema,
+ displayName: 'Email Invoice',
+ description: 'Emails an invoice to the given recipients.',
+ audience: 'ai',
+ classification: 'WRITE',
+ aiMetadata: {
+ description:
+ 'Sends a real email with the invoice to the given addresses and marks a draft invoice as sent. Use Get Invoice Email Content for the default subject and body,. Not idempotent: each call sends another email.',
+ idempotent: false,
+ },
+ props: {
+ organizationId: zohoInvoiceAiProps.organizationId({ required: true }),
+ invoiceId: zohoInvoiceAiProps.invoiceId({ required: true }),
+ toMailIds: Property.Array({
+ displayName: 'To',
+ description: 'Email addresses to send the invoice to.',
+ required: true,
+ }),
+ ccMailIds: Property.Array({
+ displayName: 'CC',
+ description: 'Email addresses to copy.',
+ required: false,
+ }),
+ subject: Property.ShortText({
+ displayName: 'Subject',
+ description: 'Email subject. Empty = the default invoice email subject.',
+ required: false,
+ }),
+ body: Property.LongText({
+ displayName: 'Body',
+ description: 'Email body (HTML allowed). Empty = the default invoice email body.',
+ required: false,
+ }),
+ sendFromOrgEmailId: zohoInvoiceAiProps.yesNo({
+ required: false,
+ displayName: 'Send From Organization Email',
+ description: 'Yes to send from the organization email address instead of the user email.',
+ }),
+ sendAttachment: zohoInvoiceAiProps.yesNo({
+ required: false,
+ displayName: 'Attach Invoice File',
+ description: 'Yes to include the file attached to the invoice.',
+ }),
+ sendCustomerStatement: zohoInvoiceAiProps.yesNo({
+ required: false,
+ displayName: 'Attach Customer Statement',
+ description: 'Yes to include the customer statement PDF.',
+ }),
+ },
+ async run({ auth, propsValue }) {
+ return await zohoInvoiceApi.emailInvoice({
+ auth,
+ organizationId: propsValue.organizationId,
+ invoiceId: propsValue.invoiceId,
+ sendAttachment: zohoInvoiceUtils.toOptionalBoolean({ value: propsValue.sendAttachment }),
+ sendCustomerStatement: zohoInvoiceUtils.toOptionalBoolean({
+ value: propsValue.sendCustomerStatement,
+ }),
+ body: zohoInvoiceUtils.compact({
+ to_mail_ids: propsValue.toMailIds,
+ cc_mail_ids: propsValue.ccMailIds,
+ subject: propsValue.subject,
+ body: propsValue.body,
+ send_from_org_email_id: zohoInvoiceUtils.toOptionalBoolean({
+ value: propsValue.sendFromOrgEmailId,
+ }),
+ }),
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-invoice/src/lib/actions/ai/invoices/enable-invoice-payment-reminder.ts b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/invoices/enable-invoice-payment-reminder.ts
new file mode 100644
index 00000000000..6b99c9a5504
--- /dev/null
+++ b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/invoices/enable-invoice-payment-reminder.ts
@@ -0,0 +1,32 @@
+import { createAction } from '@activepieces/pieces-framework';
+
+import { zohoInvoiceAuth } from '../../../auth';
+import { zohoInvoiceAiProps } from '../../../common/ai-props';
+import { zohoInvoiceApi } from '../../../common/api';
+import { zohoInvoiceMessageOutputSchema } from '../../../output-schemas';
+
+export const enableInvoicePaymentReminderAction = createAction({
+ auth: zohoInvoiceAuth,
+ name: 'zoho_invoice_enable_invoice_payment_reminder',
+ outputSchema: zohoInvoiceMessageOutputSchema,
+ displayName: 'Enable Invoice Payment Reminder',
+ description: 'Turns on automated payment reminders for an invoice.',
+ audience: 'ai',
+ classification: 'WRITE',
+ aiMetadata: {
+ description:
+ 'Turns on the organization automated payment reminders for one invoice. Reminders only go out if they are configured in the organization settings. Use List Invoices to find the ID.',
+ idempotent: true,
+ },
+ props: {
+ organizationId: zohoInvoiceAiProps.organizationId({ required: true }),
+ invoiceId: zohoInvoiceAiProps.invoiceId({ required: true }),
+ },
+ async run({ auth, propsValue }) {
+ return await zohoInvoiceApi.enableInvoicePaymentReminder({
+ auth,
+ organizationId: propsValue.organizationId,
+ invoiceId: propsValue.invoiceId,
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-invoice/src/lib/actions/ai/invoices/export-invoices-pdf.ts b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/invoices/export-invoices-pdf.ts
new file mode 100644
index 00000000000..e8abaccf9ce
--- /dev/null
+++ b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/invoices/export-invoices-pdf.ts
@@ -0,0 +1,49 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoInvoiceAuth } from '../../../auth';
+import { zohoInvoiceAiProps } from '../../../common/ai-props';
+import { zohoInvoiceApi } from '../../../common/api';
+import { zohoInvoiceGetInvoiceAttachmentOutputSchema } from '../../../output-schemas';
+
+export const exportInvoicesPdfAction = createAction({
+ auth: zohoInvoiceAuth,
+ name: 'zoho_invoice_export_invoices_pdf',
+ outputSchema: zohoInvoiceGetInvoiceAttachmentOutputSchema,
+ displayName: 'Export Invoices as PDF',
+ description: 'Exports up to 25 invoices into one PDF file.',
+ audience: 'ai',
+ classification: 'READ',
+ aiMetadata: {
+ description:
+ 'Exports up to 25 invoices into a single PDF file and returns the stored file. Use it for one invoice too. Use List Invoices to find the IDs.',
+ idempotent: true,
+ },
+ props: {
+ organizationId: zohoInvoiceAiProps.organizationId({ required: true }),
+ invoiceIds: Property.Array({
+ displayName: 'Invoice IDs',
+ description: 'IDs of the invoices to export (1-25). Use List Invoices to find them.',
+ required: true,
+ }),
+ },
+ async run(context) {
+ const { invoiceIds, organizationId } = context.propsValue;
+ if (
+ invoiceIds.length === 0 ||
+ invoiceIds.length > MAX_INVOICES ||
+ !invoiceIds.every((id): id is string => typeof id === 'string' && id !== '')
+ ) {
+ throw new Error(`Invoice IDs must be a list of 1 to ${MAX_INVOICES} invoice ID strings.`);
+ }
+ const content = await zohoInvoiceApi.exportInvoicesPdf({
+ auth: context.auth,
+ organizationId,
+ invoiceIds,
+ });
+ const fileName = 'invoices.pdf';
+ const file = await context.files.write({ fileName, data: Buffer.from(content) });
+ return { file, fileName };
+ },
+});
+
+const MAX_INVOICES = 25;
diff --git a/packages/pieces/community/zoho-invoice/src/lib/actions/ai/invoices/get-invoice-attachment.ts b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/invoices/get-invoice-attachment.ts
new file mode 100644
index 00000000000..86be8516f79
--- /dev/null
+++ b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/invoices/get-invoice-attachment.ts
@@ -0,0 +1,36 @@
+import { createAction } from '@activepieces/pieces-framework';
+
+import { zohoInvoiceAuth } from '../../../auth';
+import { zohoInvoiceAiProps } from '../../../common/ai-props';
+import { zohoInvoiceApi } from '../../../common/api';
+import { zohoInvoiceGetInvoiceAttachmentOutputSchema } from '../../../output-schemas';
+
+export const getInvoiceAttachmentAction = createAction({
+ auth: zohoInvoiceAuth,
+ name: 'zoho_invoice_get_invoice_attachment',
+ outputSchema: zohoInvoiceGetInvoiceAttachmentOutputSchema,
+ displayName: 'Get Invoice Attachment',
+ description: 'Downloads the file attached to an invoice.',
+ audience: 'ai',
+ classification: 'READ',
+ aiMetadata: {
+ description:
+ 'Downloads the file attached to an invoice and returns the stored file. Use Add Invoice Attachment to attach one and List Invoices to find the ID.',
+ idempotent: true,
+ },
+ props: {
+ organizationId: zohoInvoiceAiProps.organizationId({ required: true }),
+ invoiceId: zohoInvoiceAiProps.invoiceId({ required: true }),
+ },
+ async run(context) {
+ const { organizationId, invoiceId } = context.propsValue;
+ const content = await zohoInvoiceApi.getInvoiceAttachment({
+ auth: context.auth,
+ organizationId,
+ invoiceId,
+ });
+ const fileName = `invoice-${invoiceId}-attachment`;
+ const file = await context.files.write({ fileName, data: Buffer.from(content) });
+ return { file, fileName };
+ },
+});
diff --git a/packages/pieces/community/zoho-invoice/src/lib/actions/ai/invoices/get-invoice-email-content.ts b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/invoices/get-invoice-email-content.ts
new file mode 100644
index 00000000000..91c5b7285e7
--- /dev/null
+++ b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/invoices/get-invoice-email-content.ts
@@ -0,0 +1,32 @@
+import { createAction } from '@activepieces/pieces-framework';
+
+import { zohoInvoiceAuth } from '../../../auth';
+import { zohoInvoiceAiProps } from '../../../common/ai-props';
+import { zohoInvoiceApi } from '../../../common/api';
+import { zohoInvoiceGetInvoiceEmailContentOutputSchema } from '../../../output-schemas';
+
+export const getInvoiceEmailContentAction = createAction({
+ auth: zohoInvoiceAuth,
+ name: 'zoho_invoice_get_invoice_email_content',
+ outputSchema: zohoInvoiceGetInvoiceEmailContentOutputSchema,
+ displayName: 'Get Invoice Email Content',
+ description: 'Gets the default email Zoho would send for an invoice.',
+ audience: 'ai',
+ classification: 'READ',
+ aiMetadata: {
+ description:
+ 'Returns the default subject, body, recipients and sender Zoho Invoice would use to email this invoice, without sending anything. Use it to prepare Email Invoice. Use List Invoices to find the ID.',
+ idempotent: true,
+ },
+ props: {
+ organizationId: zohoInvoiceAiProps.organizationId({ required: true }),
+ invoiceId: zohoInvoiceAiProps.invoiceId({ required: true }),
+ },
+ async run({ auth, propsValue }) {
+ return await zohoInvoiceApi.getInvoiceEmailContent({
+ auth,
+ organizationId: propsValue.organizationId,
+ invoiceId: propsValue.invoiceId,
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-invoice/src/lib/actions/ai/invoices/get-invoice-payment-reminder-content.ts b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/invoices/get-invoice-payment-reminder-content.ts
new file mode 100644
index 00000000000..e56639d024b
--- /dev/null
+++ b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/invoices/get-invoice-payment-reminder-content.ts
@@ -0,0 +1,32 @@
+import { createAction } from '@activepieces/pieces-framework';
+
+import { zohoInvoiceAuth } from '../../../auth';
+import { zohoInvoiceAiProps } from '../../../common/ai-props';
+import { zohoInvoiceApi } from '../../../common/api';
+import { zohoInvoiceGetInvoicePaymentReminderContentOutputSchema } from '../../../output-schemas';
+
+export const getInvoicePaymentReminderContentAction = createAction({
+ auth: zohoInvoiceAuth,
+ name: 'zoho_invoice_get_invoice_payment_reminder_content',
+ outputSchema: zohoInvoiceGetInvoicePaymentReminderContentOutputSchema,
+ displayName: 'Get Invoice Payment Reminder Content',
+ description: 'Gets the default payment reminder email for an invoice.',
+ audience: 'ai',
+ classification: 'READ',
+ aiMetadata: {
+ description:
+ 'Returns the default subject, body and recipients Zoho Invoice would use for a payment reminder on this invoice, without sending anything. Use it to prepare Send Invoice Payment Reminder. Use List Invoices to find the ID.',
+ idempotent: true,
+ },
+ props: {
+ organizationId: zohoInvoiceAiProps.organizationId({ required: true }),
+ invoiceId: zohoInvoiceAiProps.invoiceId({ required: true }),
+ },
+ async run({ auth, propsValue }) {
+ return await zohoInvoiceApi.getInvoicePaymentReminderContent({
+ auth,
+ organizationId: propsValue.organizationId,
+ invoiceId: propsValue.invoiceId,
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-invoice/src/lib/actions/ai/invoices/get-invoice.ts b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/invoices/get-invoice.ts
new file mode 100644
index 00000000000..7074e656d85
--- /dev/null
+++ b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/invoices/get-invoice.ts
@@ -0,0 +1,32 @@
+import { createAction } from '@activepieces/pieces-framework';
+
+import { zohoInvoiceAuth } from '../../../auth';
+import { zohoInvoiceAiProps } from '../../../common/ai-props';
+import { zohoInvoiceApi } from '../../../common/api';
+import { zohoInvoiceInvoiceOutputSchema } from '../../../output-schemas';
+
+export const getInvoiceAction = createAction({
+ auth: zohoInvoiceAuth,
+ name: 'zoho_invoice_get_invoice',
+ outputSchema: zohoInvoiceInvoiceOutputSchema,
+ displayName: 'Get Invoice',
+ description: 'Gets one invoice by ID.',
+ audience: 'ai',
+ classification: 'READ',
+ aiMetadata: {
+ description:
+ 'Returns one invoice by ID with its customer, dates, status, totals, balance and line items. Use List Invoices to find the ID.',
+ idempotent: true,
+ },
+ props: {
+ organizationId: zohoInvoiceAiProps.organizationId({ required: true }),
+ invoiceId: zohoInvoiceAiProps.invoiceId({ required: true }),
+ },
+ async run({ auth, propsValue }) {
+ return await zohoInvoiceApi.getInvoice({
+ auth,
+ organizationId: propsValue.organizationId,
+ invoiceId: propsValue.invoiceId,
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-invoice/src/lib/actions/ai/invoices/list-invoice-comments.ts b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/invoices/list-invoice-comments.ts
new file mode 100644
index 00000000000..f2a2832f2da
--- /dev/null
+++ b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/invoices/list-invoice-comments.ts
@@ -0,0 +1,32 @@
+import { createAction } from '@activepieces/pieces-framework';
+
+import { zohoInvoiceAuth } from '../../../auth';
+import { zohoInvoiceAiProps } from '../../../common/ai-props';
+import { zohoInvoiceApi } from '../../../common/api';
+import { zohoInvoiceListInvoiceCommentsOutputSchema } from '../../../output-schemas';
+
+export const listInvoiceCommentsAction = createAction({
+ auth: zohoInvoiceAuth,
+ name: 'zoho_invoice_list_invoice_comments',
+ outputSchema: zohoInvoiceListInvoiceCommentsOutputSchema,
+ displayName: 'List Invoice Comments',
+ description: 'Lists the comments and history of an invoice.',
+ audience: 'ai',
+ classification: 'SEARCH',
+ aiMetadata: {
+ description:
+ 'Lists the comments and activity history of an invoice with comment_id, author, date and text. Use List Invoices to find the ID.',
+ idempotent: true,
+ },
+ props: {
+ organizationId: zohoInvoiceAiProps.organizationId({ required: true }),
+ invoiceId: zohoInvoiceAiProps.invoiceId({ required: true }),
+ },
+ async run({ auth, propsValue }) {
+ return await zohoInvoiceApi.listInvoiceComments({
+ auth,
+ organizationId: propsValue.organizationId,
+ invoiceId: propsValue.invoiceId,
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-invoice/src/lib/actions/ai/invoices/list-invoice-credits-applied.ts b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/invoices/list-invoice-credits-applied.ts
new file mode 100644
index 00000000000..c2d4ce9b40d
--- /dev/null
+++ b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/invoices/list-invoice-credits-applied.ts
@@ -0,0 +1,32 @@
+import { createAction } from '@activepieces/pieces-framework';
+
+import { zohoInvoiceAuth } from '../../../auth';
+import { zohoInvoiceAiProps } from '../../../common/ai-props';
+import { zohoInvoiceApi } from '../../../common/api';
+import { zohoInvoiceListInvoiceCreditsAppliedOutputSchema } from '../../../output-schemas';
+
+export const listInvoiceCreditsAppliedAction = createAction({
+ auth: zohoInvoiceAuth,
+ name: 'zoho_invoice_list_invoice_credits_applied',
+ outputSchema: zohoInvoiceListInvoiceCreditsAppliedOutputSchema,
+ displayName: 'List Invoice Credits Applied',
+ description: 'Lists the credit notes applied to an invoice.',
+ audience: 'ai',
+ classification: 'SEARCH',
+ aiMetadata: {
+ description:
+ 'Lists the credit notes applied to an invoice with the credit note and amount applied. Use Apply Credits to Invoice to add more. Use List Invoices to find the ID.',
+ idempotent: true,
+ },
+ props: {
+ organizationId: zohoInvoiceAiProps.organizationId({ required: true }),
+ invoiceId: zohoInvoiceAiProps.invoiceId({ required: true }),
+ },
+ async run({ auth, propsValue }) {
+ return await zohoInvoiceApi.listInvoiceCreditsApplied({
+ auth,
+ organizationId: propsValue.organizationId,
+ invoiceId: propsValue.invoiceId,
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-invoice/src/lib/actions/ai/invoices/list-invoice-payments.ts b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/invoices/list-invoice-payments.ts
new file mode 100644
index 00000000000..6fa4bddd688
--- /dev/null
+++ b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/invoices/list-invoice-payments.ts
@@ -0,0 +1,32 @@
+import { createAction } from '@activepieces/pieces-framework';
+
+import { zohoInvoiceAuth } from '../../../auth';
+import { zohoInvoiceAiProps } from '../../../common/ai-props';
+import { zohoInvoiceApi } from '../../../common/api';
+import { zohoInvoiceListInvoicePaymentsOutputSchema } from '../../../output-schemas';
+
+export const listInvoicePaymentsAction = createAction({
+ auth: zohoInvoiceAuth,
+ name: 'zoho_invoice_list_invoice_payments',
+ outputSchema: zohoInvoiceListInvoicePaymentsOutputSchema,
+ displayName: 'List Invoice Payments',
+ description: 'Lists the payments recorded against an invoice.',
+ audience: 'ai',
+ classification: 'SEARCH',
+ aiMetadata: {
+ description:
+ 'Lists the payments applied to an invoice with payment_id, invoice_payment_id, date and amount. The invoice_payment_id is what Delete Invoice Payment needs. Use List Invoices to find the ID.',
+ idempotent: true,
+ },
+ props: {
+ organizationId: zohoInvoiceAiProps.organizationId({ required: true }),
+ invoiceId: zohoInvoiceAiProps.invoiceId({ required: true }),
+ },
+ async run({ auth, propsValue }) {
+ return await zohoInvoiceApi.listInvoicePayments({
+ auth,
+ organizationId: propsValue.organizationId,
+ invoiceId: propsValue.invoiceId,
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-invoice/src/lib/actions/ai/invoices/list-invoice-templates.ts b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/invoices/list-invoice-templates.ts
new file mode 100644
index 00000000000..160ad88bdfe
--- /dev/null
+++ b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/invoices/list-invoice-templates.ts
@@ -0,0 +1,30 @@
+import { createAction } from '@activepieces/pieces-framework';
+
+import { zohoInvoiceAuth } from '../../../auth';
+import { zohoInvoiceAiProps } from '../../../common/ai-props';
+import { zohoInvoiceApi } from '../../../common/api';
+import { zohoInvoiceTemplatesOutputSchema } from '../../../output-schemas';
+
+export const listInvoiceTemplatesAction = createAction({
+ auth: zohoInvoiceAuth,
+ name: 'zoho_invoice_list_invoice_templates',
+ outputSchema: zohoInvoiceTemplatesOutputSchema,
+ displayName: 'List Invoice Templates',
+ description: 'Lists the PDF templates available for invoices.',
+ audience: 'ai',
+ classification: 'SEARCH',
+ aiMetadata: {
+ description:
+ 'Lists the invoice PDF templates of the organization with template_id and name. The template_id is what Set Invoice Template needs.',
+ idempotent: true,
+ },
+ props: {
+ organizationId: zohoInvoiceAiProps.organizationId({ required: true }),
+ },
+ async run({ auth, propsValue }) {
+ return await zohoInvoiceApi.listInvoiceTemplates({
+ auth,
+ organizationId: propsValue.organizationId,
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-invoice/src/lib/actions/ai/invoices/list-invoices.ts b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/invoices/list-invoices.ts
new file mode 100644
index 00000000000..aff2f3f31c3
--- /dev/null
+++ b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/invoices/list-invoices.ts
@@ -0,0 +1,100 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoInvoiceAuth } from '../../../auth';
+import { zohoInvoiceAiProps } from '../../../common/ai-props';
+import { zohoInvoiceApi } from '../../../common/api';
+import { zohoInvoiceListInvoicesOutputSchema } from '../../../output-schemas';
+
+export const listInvoicesAction = createAction({
+ auth: zohoInvoiceAuth,
+ name: 'zoho_invoice_list_invoices',
+ outputSchema: zohoInvoiceListInvoicesOutputSchema,
+ displayName: 'List Invoices',
+ description: 'Lists and searches the invoices of an organization.',
+ audience: 'ai',
+ classification: 'SEARCH',
+ aiMetadata: {
+ description:
+ 'Lists invoices with invoice_id, number, customer, status, dates, total and balance, one page at a time. Filter by status, customer, invoice number, date range or free text. Use List Contacts to find the customer ID.',
+ idempotent: true,
+ },
+ props: {
+ organizationId: zohoInvoiceAiProps.organizationId({ required: true }),
+ status: Property.StaticDropdown({
+ displayName: 'Status',
+ description: 'Only invoices with this status. Empty = all statuses.',
+ required: false,
+ options: {
+ disabled: false,
+ options: [
+ { label: 'Sent', value: 'sent' },
+ { label: 'Draft', value: 'draft' },
+ { label: 'Overdue', value: 'overdue' },
+ { label: 'Paid', value: 'paid' },
+ { label: 'Void', value: 'void' },
+ { label: 'Unpaid', value: 'unpaid' },
+ { label: 'Partially Paid', value: 'partially_paid' },
+ { label: 'Viewed', value: 'viewed' },
+ ],
+ },
+ }),
+ customerId: zohoInvoiceAiProps.contactId({
+ required: false,
+ displayName: 'Customer ID',
+ description: 'Only invoices of this customer. Use List Contacts to find it.',
+ }),
+ searchText: zohoInvoiceAiProps.searchText({
+ required: false,
+ description: 'Matches invoice number, purchase order or customer name (max 100 characters).',
+ }),
+ invoiceNumber: Property.ShortText({
+ displayName: 'Invoice Number',
+ description: 'Exact invoice number, e.g. "INV-00003".',
+ required: false,
+ }),
+ dateStart: Property.ShortText({
+ displayName: 'Date From',
+ description: 'Only invoices dated on or after this day (yyyy-mm-dd).',
+ required: false,
+ }),
+ dateEnd: Property.ShortText({
+ displayName: 'Date To',
+ description: 'Only invoices dated on or before this day (yyyy-mm-dd).',
+ required: false,
+ }),
+ sortColumn: Property.StaticDropdown({
+ displayName: 'Sort Column',
+ description: 'Field to sort by. Empty = the vendor default.',
+ required: false,
+ options: {
+ disabled: false,
+ options: [
+ { label: 'Customer Name', value: 'customer_name' },
+ { label: 'Invoice Number', value: 'invoice_number' },
+ { label: 'Date', value: 'date' },
+ { label: 'Due Date', value: 'due_date' },
+ { label: 'Total', value: 'total' },
+ { label: 'Balance', value: 'balance' },
+ { label: 'Created Time', value: 'created_time' },
+ ],
+ },
+ }),
+ page: zohoInvoiceAiProps.page({ required: false }),
+ perPage: zohoInvoiceAiProps.perPage({ required: false }),
+ },
+ async run({ auth, propsValue }) {
+ return await zohoInvoiceApi.searchInvoices({
+ auth,
+ organizationId: propsValue.organizationId,
+ status: propsValue.status,
+ customerId: propsValue.customerId,
+ searchText: propsValue.searchText,
+ invoiceNumber: propsValue.invoiceNumber,
+ dateStart: propsValue.dateStart,
+ dateEnd: propsValue.dateEnd,
+ sortColumn: propsValue.sortColumn,
+ page: propsValue.page,
+ perPage: propsValue.perPage,
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-invoice/src/lib/actions/ai/invoices/mark-invoice-draft.ts b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/invoices/mark-invoice-draft.ts
new file mode 100644
index 00000000000..4718fd4a4dc
--- /dev/null
+++ b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/invoices/mark-invoice-draft.ts
@@ -0,0 +1,32 @@
+import { createAction } from '@activepieces/pieces-framework';
+
+import { zohoInvoiceAuth } from '../../../auth';
+import { zohoInvoiceAiProps } from '../../../common/ai-props';
+import { zohoInvoiceApi } from '../../../common/api';
+import { zohoInvoiceMessageOutputSchema } from '../../../output-schemas';
+
+export const markInvoiceDraftAction = createAction({
+ auth: zohoInvoiceAuth,
+ name: 'zoho_invoice_mark_invoice_draft',
+ outputSchema: zohoInvoiceMessageOutputSchema,
+ displayName: 'Mark Invoice as Draft',
+ description: 'Reverts a sent or void invoice to draft.',
+ audience: 'ai',
+ classification: 'WRITE',
+ aiMetadata: {
+ description:
+ 'Changes a sent or voided invoice back to Draft status. Use List Invoices to find the ID.',
+ idempotent: true,
+ },
+ props: {
+ organizationId: zohoInvoiceAiProps.organizationId({ required: true }),
+ invoiceId: zohoInvoiceAiProps.invoiceId({ required: true }),
+ },
+ async run({ auth, propsValue }) {
+ return await zohoInvoiceApi.markInvoiceDraft({
+ auth,
+ organizationId: propsValue.organizationId,
+ invoiceId: propsValue.invoiceId,
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-invoice/src/lib/actions/ai/invoices/mark-invoice-sent.ts b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/invoices/mark-invoice-sent.ts
new file mode 100644
index 00000000000..7c871afaea7
--- /dev/null
+++ b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/invoices/mark-invoice-sent.ts
@@ -0,0 +1,32 @@
+import { createAction } from '@activepieces/pieces-framework';
+
+import { zohoInvoiceAuth } from '../../../auth';
+import { zohoInvoiceAiProps } from '../../../common/ai-props';
+import { zohoInvoiceApi } from '../../../common/api';
+import { zohoInvoiceMessageWithDataOutputSchema } from '../../../output-schemas';
+
+export const markInvoiceSentAction = createAction({
+ auth: zohoInvoiceAuth,
+ name: 'zoho_invoice_mark_invoice_sent',
+ outputSchema: zohoInvoiceMessageWithDataOutputSchema,
+ displayName: 'Mark Invoice as Sent',
+ description: 'Marks a draft invoice as sent without emailing it.',
+ audience: 'ai',
+ classification: 'WRITE',
+ aiMetadata: {
+ description:
+ 'Changes a draft invoice to Sent without emailing the customer; use Email Invoice to actually send it. Use List Invoices to find the ID.',
+ idempotent: true,
+ },
+ props: {
+ organizationId: zohoInvoiceAiProps.organizationId({ required: true }),
+ invoiceId: zohoInvoiceAiProps.invoiceId({ required: true }),
+ },
+ async run({ auth, propsValue }) {
+ return await zohoInvoiceApi.markInvoiceSent({
+ auth,
+ organizationId: propsValue.organizationId,
+ invoiceId: propsValue.invoiceId,
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-invoice/src/lib/actions/ai/invoices/send-bulk-invoice-reminder.ts b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/invoices/send-bulk-invoice-reminder.ts
new file mode 100644
index 00000000000..e3c7dd3e02c
--- /dev/null
+++ b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/invoices/send-bulk-invoice-reminder.ts
@@ -0,0 +1,46 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoInvoiceAuth } from '../../../auth';
+import { zohoInvoiceAiProps } from '../../../common/ai-props';
+import { zohoInvoiceApi } from '../../../common/api';
+import { zohoInvoiceSendBulkInvoiceReminderOutputSchema } from '../../../output-schemas';
+
+export const sendBulkInvoiceReminderAction = createAction({
+ auth: zohoInvoiceAuth,
+ name: 'zoho_invoice_send_bulk_invoice_reminder',
+ outputSchema: zohoInvoiceSendBulkInvoiceReminderOutputSchema,
+ displayName: 'Send Bulk Invoice Reminder',
+ description: 'Emails payment reminders for up to 10 invoices at once.',
+ audience: 'ai',
+ classification: 'WRITE',
+ aiMetadata: {
+ description:
+ 'Sends real payment reminder emails for up to 10 invoices using the default reminder text; only open or overdue invoices get one. Use Send Invoice Payment Reminder to customise recipients or text for one invoice. Use List Invoices to find the IDs. Not idempotent: each call sends more emails.',
+ idempotent: false,
+ },
+ props: {
+ organizationId: zohoInvoiceAiProps.organizationId({ required: true }),
+ invoiceIds: Property.Array({
+ displayName: 'Invoice IDs',
+ description: 'IDs of the invoices to remind about (1-10). Use List Invoices to find them.',
+ required: true,
+ }),
+ },
+ async run({ auth, propsValue }) {
+ const { invoiceIds } = propsValue;
+ if (
+ invoiceIds.length === 0 ||
+ invoiceIds.length > MAX_INVOICES ||
+ !invoiceIds.every((id): id is string => typeof id === 'string' && id !== '')
+ ) {
+ throw new Error(`Invoice IDs must be a list of 1 to ${MAX_INVOICES} invoice ID strings.`);
+ }
+ return await zohoInvoiceApi.sendBulkInvoiceReminder({
+ auth,
+ organizationId: propsValue.organizationId,
+ invoiceIds,
+ });
+ },
+});
+
+const MAX_INVOICES = 10;
diff --git a/packages/pieces/community/zoho-invoice/src/lib/actions/ai/invoices/send-invoice-payment-reminder.ts b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/invoices/send-invoice-payment-reminder.ts
new file mode 100644
index 00000000000..66c795d9786
--- /dev/null
+++ b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/invoices/send-invoice-payment-reminder.ts
@@ -0,0 +1,75 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoInvoiceAuth } from '../../../auth';
+import { zohoInvoiceAiProps } from '../../../common/ai-props';
+import { zohoInvoiceApi } from '../../../common/api';
+import { zohoInvoiceUtils } from '../../../common/utils';
+import { zohoInvoiceSendInvoicePaymentReminderOutputSchema } from '../../../output-schemas';
+
+export const sendInvoicePaymentReminderAction = createAction({
+ auth: zohoInvoiceAuth,
+ name: 'zoho_invoice_send_invoice_payment_reminder',
+ outputSchema: zohoInvoiceSendInvoicePaymentReminderOutputSchema,
+ displayName: 'Send Invoice Payment Reminder',
+ description: 'Emails a payment reminder for an unpaid invoice.',
+ audience: 'ai',
+ classification: 'WRITE',
+ aiMetadata: {
+ description:
+ 'Sends a real payment reminder email for one open or overdue invoice. Use Get Invoice Payment Reminder Content for the default text, and Send Bulk Invoice Reminder for several invoices. Use List Invoices to find the ID. Not idempotent: each call sends another email.',
+ idempotent: false,
+ },
+ props: {
+ organizationId: zohoInvoiceAiProps.organizationId({ required: true }),
+ invoiceId: zohoInvoiceAiProps.invoiceId({ required: true }),
+ toMailIds: Property.Array({
+ displayName: 'To',
+ description: 'Email addresses to send the reminder to. Empty = the invoice contacts.',
+ required: false,
+ }),
+ ccMailIds: Property.Array({
+ displayName: 'CC',
+ description: 'Email addresses to copy.',
+ required: false,
+ }),
+ subject: Property.ShortText({
+ displayName: 'Subject',
+ description: 'Email subject. Empty = the default reminder subject.',
+ required: false,
+ }),
+ body: Property.LongText({
+ displayName: 'Body',
+ description: 'Email body (HTML allowed). Empty = the default reminder body.',
+ required: false,
+ }),
+ sendFromOrgEmailId: zohoInvoiceAiProps.yesNo({
+ required: false,
+ displayName: 'Send From Organization Email',
+ description: 'Yes to send from the organization email address instead of the user email.',
+ }),
+ sendCustomerStatement: zohoInvoiceAiProps.yesNo({
+ required: false,
+ displayName: 'Attach Customer Statement',
+ description: 'Yes to include the customer statement PDF.',
+ }),
+ },
+ async run({ auth, propsValue }) {
+ return await zohoInvoiceApi.sendInvoicePaymentReminder({
+ auth,
+ organizationId: propsValue.organizationId,
+ invoiceId: propsValue.invoiceId,
+ sendCustomerStatement: zohoInvoiceUtils.toOptionalBoolean({
+ value: propsValue.sendCustomerStatement,
+ }),
+ body: zohoInvoiceUtils.compact({
+ to_mail_ids: propsValue.toMailIds,
+ cc_mail_ids: propsValue.ccMailIds,
+ subject: propsValue.subject,
+ body: propsValue.body,
+ send_from_org_email_id: zohoInvoiceUtils.toOptionalBoolean({
+ value: propsValue.sendFromOrgEmailId,
+ }),
+ }),
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-invoice/src/lib/actions/ai/invoices/set-invoice-template.ts b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/invoices/set-invoice-template.ts
new file mode 100644
index 00000000000..4adf49debf8
--- /dev/null
+++ b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/invoices/set-invoice-template.ts
@@ -0,0 +1,37 @@
+import { createAction } from '@activepieces/pieces-framework';
+
+import { zohoInvoiceAuth } from '../../../auth';
+import { zohoInvoiceAiProps } from '../../../common/ai-props';
+import { zohoInvoiceApi } from '../../../common/api';
+import { zohoInvoiceMessageOutputSchema } from '../../../output-schemas';
+
+export const setInvoiceTemplateAction = createAction({
+ auth: zohoInvoiceAuth,
+ name: 'zoho_invoice_set_invoice_template',
+ outputSchema: zohoInvoiceMessageOutputSchema,
+ displayName: 'Set Invoice Template',
+ description: 'Changes the PDF template of an invoice.',
+ audience: 'ai',
+ classification: 'WRITE',
+ aiMetadata: {
+ description:
+ 'Changes which PDF template an invoice is rendered with. Use List Invoices for the invoice ID and List Invoice Templates for the template ID.',
+ idempotent: true,
+ },
+ props: {
+ organizationId: zohoInvoiceAiProps.organizationId({ required: true }),
+ invoiceId: zohoInvoiceAiProps.invoiceId({ required: true }),
+ templateId: zohoInvoiceAiProps.templateId({
+ required: true,
+ description: 'Invoice PDF template ID. Use List Invoice Templates to find it.',
+ }),
+ },
+ async run({ auth, propsValue }) {
+ return await zohoInvoiceApi.setInvoiceTemplate({
+ auth,
+ organizationId: propsValue.organizationId,
+ invoiceId: propsValue.invoiceId,
+ templateId: propsValue.templateId,
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-invoice/src/lib/actions/ai/invoices/update-invoice-billing-address.ts b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/invoices/update-invoice-billing-address.ts
new file mode 100644
index 00000000000..96ae1bd27f5
--- /dev/null
+++ b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/invoices/update-invoice-billing-address.ts
@@ -0,0 +1,63 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoInvoiceAuth } from '../../../auth';
+import { zohoInvoiceAiProps } from '../../../common/ai-props';
+import { zohoInvoiceApi } from '../../../common/api';
+import { zohoInvoiceUtils } from '../../../common/utils';
+import { zohoInvoiceBillingAddressOutputSchema } from '../../../output-schemas';
+
+export const updateInvoiceBillingAddressAction = createAction({
+ auth: zohoInvoiceAuth,
+ name: 'zoho_invoice_update_invoice_billing_address',
+ outputSchema: zohoInvoiceBillingAddressOutputSchema,
+ displayName: 'Update Invoice Billing Address',
+ description: 'Changes the billing address shown on one invoice.',
+ audience: 'ai',
+ classification: 'WRITE',
+ aiMetadata: {
+ description:
+ 'Changes the billing address on one invoice only; the customer record is not changed. Fields left empty are not sent. Use List Invoices to find the ID.',
+ idempotent: true,
+ },
+ props: {
+ organizationId: zohoInvoiceAiProps.organizationId({ required: true }),
+ invoiceId: zohoInvoiceAiProps.invoiceId({ required: true }),
+ address: Property.LongText({
+ displayName: 'Street Address',
+ description: 'Street address.',
+ required: false,
+ }),
+ city: Property.ShortText({ displayName: 'City', description: 'City.', required: false }),
+ state: Property.ShortText({
+ displayName: 'State',
+ description: 'State or region.',
+ required: false,
+ }),
+ zip: Property.ShortText({
+ displayName: 'ZIP Code',
+ description: 'ZIP or postal code.',
+ required: false,
+ }),
+ country: Property.ShortText({
+ displayName: 'Country',
+ description: 'Country.',
+ required: false,
+ }),
+ fax: Property.ShortText({ displayName: 'Fax', description: 'Fax number.', required: false }),
+ },
+ async run({ auth, propsValue }) {
+ return await zohoInvoiceApi.updateInvoiceBillingAddress({
+ auth,
+ organizationId: propsValue.organizationId,
+ invoiceId: propsValue.invoiceId,
+ body: zohoInvoiceUtils.compact({
+ address: propsValue.address,
+ city: propsValue.city,
+ state: propsValue.state,
+ zip: propsValue.zip,
+ country: propsValue.country,
+ fax: propsValue.fax,
+ }),
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-invoice/src/lib/actions/ai/invoices/update-invoice-comment.ts b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/invoices/update-invoice-comment.ts
new file mode 100644
index 00000000000..daa33aebc44
--- /dev/null
+++ b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/invoices/update-invoice-comment.ts
@@ -0,0 +1,54 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoInvoiceAuth } from '../../../auth';
+import { zohoInvoiceAiProps } from '../../../common/ai-props';
+import { zohoInvoiceApi } from '../../../common/api';
+import { zohoInvoiceUtils } from '../../../common/utils';
+import { zohoInvoiceCommentOutputSchema } from '../../../output-schemas';
+
+export const updateInvoiceCommentAction = createAction({
+ auth: zohoInvoiceAuth,
+ name: 'zoho_invoice_update_invoice_comment',
+ outputSchema: zohoInvoiceCommentOutputSchema,
+ displayName: 'Update Invoice Comment',
+ description: 'Changes the text or visibility of an invoice comment.',
+ audience: 'ai',
+ classification: 'WRITE',
+ aiMetadata: {
+ description:
+ 'Changes the text or customer visibility of a comment on an invoice; fields left empty are not sent. Use List Invoices for the invoice ID and List Invoice Comments for the comment ID.',
+ idempotent: true,
+ },
+ props: {
+ organizationId: zohoInvoiceAiProps.organizationId({ required: true }),
+ invoiceId: zohoInvoiceAiProps.invoiceId({ required: true }),
+ commentId: zohoInvoiceAiProps.commentId({
+ required: true,
+ description: 'Comment ID. Use List Invoice Comments to find it.',
+ }),
+ description: Property.LongText({
+ displayName: 'Comment',
+ description: 'New comment text. Empty = unchanged.',
+ required: false,
+ }),
+ showCommentToClients: zohoInvoiceAiProps.yesNo({
+ required: false,
+ displayName: 'Show to Customer',
+ description: 'Yes to show the comment to the customer, No to hide it. Empty = unchanged.',
+ }),
+ },
+ async run({ auth, propsValue }) {
+ return await zohoInvoiceApi.updateInvoiceComment({
+ auth,
+ organizationId: propsValue.organizationId,
+ invoiceId: propsValue.invoiceId,
+ commentId: propsValue.commentId,
+ body: zohoInvoiceUtils.compact({
+ description: propsValue.description,
+ show_comment_to_clients: zohoInvoiceUtils.toOptionalBoolean({
+ value: propsValue.showCommentToClients,
+ }),
+ }),
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-invoice/src/lib/actions/ai/invoices/update-invoice-shipping-address.ts b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/invoices/update-invoice-shipping-address.ts
new file mode 100644
index 00000000000..7832514b405
--- /dev/null
+++ b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/invoices/update-invoice-shipping-address.ts
@@ -0,0 +1,63 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoInvoiceAuth } from '../../../auth';
+import { zohoInvoiceAiProps } from '../../../common/ai-props';
+import { zohoInvoiceApi } from '../../../common/api';
+import { zohoInvoiceUtils } from '../../../common/utils';
+import { zohoInvoiceShippingAddressOutputSchema } from '../../../output-schemas';
+
+export const updateInvoiceShippingAddressAction = createAction({
+ auth: zohoInvoiceAuth,
+ name: 'zoho_invoice_update_invoice_shipping_address',
+ outputSchema: zohoInvoiceShippingAddressOutputSchema,
+ displayName: 'Update Invoice Shipping Address',
+ description: 'Changes the shipping address shown on one invoice.',
+ audience: 'ai',
+ classification: 'WRITE',
+ aiMetadata: {
+ description:
+ 'Changes the shipping address on one invoice only; the customer record is not changed. Fields left empty are not sent. Use List Invoices to find the ID.',
+ idempotent: true,
+ },
+ props: {
+ organizationId: zohoInvoiceAiProps.organizationId({ required: true }),
+ invoiceId: zohoInvoiceAiProps.invoiceId({ required: true }),
+ address: Property.LongText({
+ displayName: 'Street Address',
+ description: 'Street address.',
+ required: false,
+ }),
+ city: Property.ShortText({ displayName: 'City', description: 'City.', required: false }),
+ state: Property.ShortText({
+ displayName: 'State',
+ description: 'State or region.',
+ required: false,
+ }),
+ zip: Property.ShortText({
+ displayName: 'ZIP Code',
+ description: 'ZIP or postal code.',
+ required: false,
+ }),
+ country: Property.ShortText({
+ displayName: 'Country',
+ description: 'Country.',
+ required: false,
+ }),
+ fax: Property.ShortText({ displayName: 'Fax', description: 'Fax number.', required: false }),
+ },
+ async run({ auth, propsValue }) {
+ return await zohoInvoiceApi.updateInvoiceShippingAddress({
+ auth,
+ organizationId: propsValue.organizationId,
+ invoiceId: propsValue.invoiceId,
+ body: zohoInvoiceUtils.compact({
+ address: propsValue.address,
+ city: propsValue.city,
+ state: propsValue.state,
+ zip: propsValue.zip,
+ country: propsValue.country,
+ fax: propsValue.fax,
+ }),
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-invoice/src/lib/actions/ai/invoices/update-invoice.ts b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/invoices/update-invoice.ts
new file mode 100644
index 00000000000..ccb8d2e0a5b
--- /dev/null
+++ b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/invoices/update-invoice.ts
@@ -0,0 +1,152 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoInvoiceAuth } from '../../../auth';
+import { zohoInvoiceAiProps } from '../../../common/ai-props';
+import { zohoInvoiceApi } from '../../../common/api';
+import { zohoInvoiceUtils } from '../../../common/utils';
+import { zohoInvoiceInvoiceOutputSchema } from '../../../output-schemas';
+
+export const updateInvoiceAction = createAction({
+ auth: zohoInvoiceAuth,
+ name: 'zoho_invoice_update_invoice',
+ outputSchema: zohoInvoiceInvoiceOutputSchema,
+ displayName: 'Update Invoice',
+ description: 'Changes the details or line items of an invoice.',
+ audience: 'ai',
+ classification: 'WRITE',
+ aiMetadata: {
+ description:
+ 'Changes an invoice; fields left empty keep their current value. Line Items, when given, replace the whole list: include line_item_id (from Get Invoice) to keep or edit an existing line, omit it to add a new one, and leave a line out to remove it. Use List Invoices to find the ID.',
+ idempotent: true,
+ },
+ props: {
+ organizationId: zohoInvoiceAiProps.organizationId({ required: true }),
+ invoiceId: zohoInvoiceAiProps.invoiceId({ required: true }),
+ customerId: zohoInvoiceAiProps.contactId({
+ required: false,
+ displayName: 'Customer ID',
+ description: 'New customer. Use List Contacts to find it. Empty = unchanged.',
+ }),
+ lineItems: Property.Array({
+ displayName: 'Line Items',
+ description:
+ 'Full new list of line items. Empty = the current line items are kept as they are.',
+ required: false,
+ properties: {
+ lineItemId: Property.ShortText({
+ displayName: 'Line Item ID',
+ description:
+ 'ID of the existing line to keep or edit, from Get Invoice. Empty = a new line.',
+ required: false,
+ }),
+ itemId: Property.ShortText({
+ displayName: 'Item ID',
+ description: 'Item ID. Use List Items to find it.',
+ required: false,
+ }),
+ name: Property.ShortText({
+ displayName: 'Name',
+ description: 'Line item name.',
+ required: false,
+ }),
+ description: Property.LongText({
+ displayName: 'Description',
+ description: 'Line item description.',
+ required: false,
+ }),
+ rate: Property.Number({
+ displayName: 'Rate',
+ description: 'Unit price.',
+ required: false,
+ }),
+ quantity: Property.Number({
+ displayName: 'Quantity',
+ description: 'Quantity.',
+ required: false,
+ }),
+ taxId: Property.ShortText({
+ displayName: 'Tax ID',
+ description: 'Tax applied to this line. Use List Taxes to find it.',
+ required: false,
+ }),
+ },
+ }),
+ date: Property.ShortText({
+ displayName: 'Invoice Date',
+ description: 'New invoice date (yyyy-mm-dd). Empty = unchanged.',
+ required: false,
+ }),
+ dueDate: Property.ShortText({
+ displayName: 'Due Date',
+ description: 'New due date (yyyy-mm-dd). Empty = unchanged.',
+ required: false,
+ }),
+ paymentTerms: Property.Number({
+ displayName: 'Payment Terms (Days)',
+ description: 'New number of days until payment is due. Empty = unchanged.',
+ required: false,
+ }),
+ invoiceNumber: Property.ShortText({
+ displayName: 'Invoice Number',
+ description:
+ 'New invoice number. Needs Ignore Auto Number Generation = Yes when auto numbering is on. Empty = unchanged.',
+ required: false,
+ }),
+ ignoreAutoNumberGeneration: zohoInvoiceAiProps.yesNo({
+ required: false,
+ displayName: 'Ignore Auto Number Generation',
+ description: 'Yes to keep the Invoice Number given above instead of an auto number.',
+ }),
+ referenceNumber: Property.ShortText({
+ displayName: 'Reference Number',
+ description: 'New reference or purchase order number. Empty = unchanged.',
+ required: false,
+ }),
+ discount: Property.Number({
+ displayName: 'Discount',
+ description: 'New invoice discount. Empty = unchanged.',
+ required: false,
+ }),
+ notes: Property.LongText({
+ displayName: 'Notes',
+ description: 'New customer notes. Empty = unchanged.',
+ required: false,
+ }),
+ terms: Property.LongText({
+ displayName: 'Terms & Conditions',
+ description: 'New terms and conditions. Empty = unchanged.',
+ required: false,
+ }),
+ additionalFields: zohoInvoiceAiProps.additionalFields({ required: false }),
+ },
+ async run({ auth, propsValue }) {
+ const { organizationId, invoiceId } = propsValue;
+ const current = await zohoInvoiceApi.getInvoice({ auth, organizationId, invoiceId });
+ return await zohoInvoiceApi.updateInvoice({
+ auth,
+ organizationId,
+ invoiceId,
+ ignoreAutoNumberGeneration: zohoInvoiceUtils.toOptionalBoolean({
+ value: propsValue.ignoreAutoNumberGeneration,
+ }),
+ body: {
+ ...(propsValue.additionalFields ?? {}),
+ ...zohoInvoiceUtils.compact({
+ customer_id: propsValue.customerId ?? current.invoice?.customer_id,
+ line_items:
+ propsValue.lineItems === undefined
+ ? current.invoice?.line_items
+ : zohoInvoiceUtils.toLineItems({ rows: propsValue.lineItems }),
+ date: propsValue.date,
+ due_date: propsValue.dueDate,
+ payment_terms: propsValue.paymentTerms,
+ invoice_number: propsValue.invoiceNumber,
+ reference_number: propsValue.referenceNumber,
+ discount: propsValue.discount,
+ notes: propsValue.notes,
+ terms: propsValue.terms,
+ }),
+ },
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-invoice/src/lib/actions/ai/invoices/void-invoice.ts b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/invoices/void-invoice.ts
new file mode 100644
index 00000000000..d825e60757e
--- /dev/null
+++ b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/invoices/void-invoice.ts
@@ -0,0 +1,32 @@
+import { createAction } from '@activepieces/pieces-framework';
+
+import { zohoInvoiceAuth } from '../../../auth';
+import { zohoInvoiceAiProps } from '../../../common/ai-props';
+import { zohoInvoiceApi } from '../../../common/api';
+import { zohoInvoiceMessageOutputSchema } from '../../../output-schemas';
+
+export const voidInvoiceAction = createAction({
+ auth: zohoInvoiceAuth,
+ name: 'zoho_invoice_void_invoice',
+ outputSchema: zohoInvoiceMessageOutputSchema,
+ displayName: 'Void Invoice',
+ description: 'Marks an invoice as void.',
+ audience: 'ai',
+ classification: 'DESTRUCTIVE',
+ aiMetadata: {
+ description:
+ 'Voids an invoice so it no longer counts towards receivables; the record is kept and can be returned to draft with Mark Invoice as Draft. Use List Invoices to find the ID.',
+ idempotent: true,
+ },
+ props: {
+ organizationId: zohoInvoiceAiProps.organizationId({ required: true }),
+ invoiceId: zohoInvoiceAiProps.invoiceId({ required: true }),
+ },
+ async run({ auth, propsValue }) {
+ return await zohoInvoiceApi.voidInvoice({
+ auth,
+ organizationId: propsValue.organizationId,
+ invoiceId: propsValue.invoiceId,
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-invoice/src/lib/actions/ai/invoices/write-off-invoice.ts b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/invoices/write-off-invoice.ts
new file mode 100644
index 00000000000..88aec688f95
--- /dev/null
+++ b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/invoices/write-off-invoice.ts
@@ -0,0 +1,32 @@
+import { createAction } from '@activepieces/pieces-framework';
+
+import { zohoInvoiceAuth } from '../../../auth';
+import { zohoInvoiceAiProps } from '../../../common/ai-props';
+import { zohoInvoiceApi } from '../../../common/api';
+import { zohoInvoiceMessageOutputSchema } from '../../../output-schemas';
+
+export const writeOffInvoiceAction = createAction({
+ auth: zohoInvoiceAuth,
+ name: 'zoho_invoice_write_off_invoice',
+ outputSchema: zohoInvoiceMessageOutputSchema,
+ displayName: 'Write Off Invoice',
+ description: 'Writes off the unpaid balance of an invoice.',
+ audience: 'ai',
+ classification: 'DESTRUCTIVE',
+ aiMetadata: {
+ description:
+ 'Writes off the remaining balance of an unpaid invoice as uncollectible. Reverse it with Cancel Invoice Write Off. Use List Invoices to find the ID.',
+ idempotent: true,
+ },
+ props: {
+ organizationId: zohoInvoiceAiProps.organizationId({ required: true }),
+ invoiceId: zohoInvoiceAiProps.invoiceId({ required: true }),
+ },
+ async run({ auth, propsValue }) {
+ return await zohoInvoiceApi.writeOffInvoice({
+ auth,
+ organizationId: propsValue.organizationId,
+ invoiceId: propsValue.invoiceId,
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-invoice/src/lib/actions/ai/items/create-item.ts b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/items/create-item.ts
new file mode 100644
index 00000000000..08ad68f6561
--- /dev/null
+++ b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/items/create-item.ts
@@ -0,0 +1,82 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoInvoiceAuth } from '../../../auth';
+import { zohoInvoiceAiProps } from '../../../common/ai-props';
+import { zohoInvoiceApi } from '../../../common/api';
+import { zohoInvoiceUtils } from '../../../common/utils';
+import { zohoInvoiceCreateItemOutputSchema } from '../../../output-schemas';
+
+export const createItemAction = createAction({
+ auth: zohoInvoiceAuth,
+ name: 'zoho_invoice_create_item',
+ outputSchema: zohoInvoiceCreateItemOutputSchema,
+ displayName: 'Create Item',
+ description: 'Creates a product or service item.',
+ audience: 'ai',
+ classification: 'WRITE',
+ aiMetadata: {
+ description:
+ 'Creates an item (product or service) that can be added to invoices and estimates. Not idempotent: each call creates a new item, so use List Items first to avoid duplicates.',
+ idempotent: false,
+ },
+ props: {
+ organizationId: zohoInvoiceAiProps.organizationId({ required: true }),
+ name: Property.ShortText({
+ displayName: 'Name',
+ description: 'Name of the item.',
+ required: true,
+ }),
+ rate: Property.Number({
+ displayName: 'Rate',
+ description: 'Selling price per unit.',
+ required: true,
+ }),
+ description: Property.LongText({
+ displayName: 'Description',
+ description: 'Description shown on transactions.',
+ required: false,
+ }),
+ sku: Property.ShortText({
+ displayName: 'SKU',
+ description: 'Stock keeping unit, unique across items.',
+ required: false,
+ }),
+ productType: Property.StaticDropdown({
+ displayName: 'Product Type',
+ description: 'Whether the item is goods or a service. Empty = the vendor default.',
+ required: false,
+ options: {
+ disabled: false,
+ options: [
+ { label: 'Goods', value: 'goods' },
+ { label: 'Service', value: 'service' },
+ ],
+ },
+ }),
+ taxId: zohoInvoiceAiProps.taxId({ required: false }),
+ isTaxable: zohoInvoiceAiProps.yesNo({
+ required: false,
+ displayName: 'Taxable',
+ description: 'Whether the item is taxable. Empty = the vendor default.',
+ }),
+ additionalFields: zohoInvoiceAiProps.additionalFields({ required: false }),
+ },
+ async run({ auth, propsValue }) {
+ return await zohoInvoiceApi.createItem({
+ auth,
+ organizationId: propsValue.organizationId,
+ body: {
+ ...(propsValue.additionalFields ?? {}),
+ ...zohoInvoiceUtils.compact({
+ name: propsValue.name,
+ rate: propsValue.rate,
+ description: propsValue.description,
+ sku: propsValue.sku,
+ product_type: propsValue.productType,
+ tax_id: propsValue.taxId,
+ is_taxable: zohoInvoiceUtils.toOptionalBoolean({ value: propsValue.isTaxable }),
+ }),
+ },
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-invoice/src/lib/actions/ai/items/delete-item.ts b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/items/delete-item.ts
new file mode 100644
index 00000000000..d47e5bfe673
--- /dev/null
+++ b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/items/delete-item.ts
@@ -0,0 +1,32 @@
+import { createAction } from '@activepieces/pieces-framework';
+
+import { zohoInvoiceAuth } from '../../../auth';
+import { zohoInvoiceAiProps } from '../../../common/ai-props';
+import { zohoInvoiceApi } from '../../../common/api';
+import { zohoInvoiceMessageOutputSchema } from '../../../output-schemas';
+
+export const deleteItemAction = createAction({
+ auth: zohoInvoiceAuth,
+ name: 'zoho_invoice_delete_item',
+ outputSchema: zohoInvoiceMessageOutputSchema,
+ displayName: 'Delete Item',
+ description: 'Deletes an item.',
+ audience: 'ai',
+ classification: 'DESTRUCTIVE',
+ aiMetadata: {
+ description:
+ 'Permanently deletes an item. Use List Items to find the ID. Items used in transactions cannot be deleted; use Mark Item Inactive instead. Cannot be undone.',
+ idempotent: false,
+ },
+ props: {
+ organizationId: zohoInvoiceAiProps.organizationId({ required: true }),
+ itemId: zohoInvoiceAiProps.itemId({ required: true }),
+ },
+ async run({ auth, propsValue }) {
+ return await zohoInvoiceApi.deleteItem({
+ auth,
+ organizationId: propsValue.organizationId,
+ itemId: propsValue.itemId,
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-invoice/src/lib/actions/ai/items/get-item.ts b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/items/get-item.ts
new file mode 100644
index 00000000000..d6519aeeb64
--- /dev/null
+++ b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/items/get-item.ts
@@ -0,0 +1,32 @@
+import { createAction } from '@activepieces/pieces-framework';
+
+import { zohoInvoiceAuth } from '../../../auth';
+import { zohoInvoiceAiProps } from '../../../common/ai-props';
+import { zohoInvoiceApi } from '../../../common/api';
+import { zohoInvoiceItemOutputSchema } from '../../../output-schemas';
+
+export const getItemAction = createAction({
+ auth: zohoInvoiceAuth,
+ name: 'zoho_invoice_get_item',
+ outputSchema: zohoInvoiceItemOutputSchema,
+ displayName: 'Get Item',
+ description: 'Gets one item (product or service) by ID.',
+ audience: 'ai',
+ classification: 'READ',
+ aiMetadata: {
+ description:
+ 'Returns one item by ID: name, rate, description, SKU, tax, product type and status. Use List Items to find the ID.',
+ idempotent: true,
+ },
+ props: {
+ organizationId: zohoInvoiceAiProps.organizationId({ required: true }),
+ itemId: zohoInvoiceAiProps.itemId({ required: true }),
+ },
+ async run({ auth, propsValue }) {
+ return await zohoInvoiceApi.getItem({
+ auth,
+ organizationId: propsValue.organizationId,
+ itemId: propsValue.itemId,
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-invoice/src/lib/actions/ai/items/list-items.ts b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/items/list-items.ts
new file mode 100644
index 00000000000..6ed85987e7e
--- /dev/null
+++ b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/items/list-items.ts
@@ -0,0 +1,58 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoInvoiceAuth } from '../../../auth';
+import { zohoInvoiceAiProps } from '../../../common/ai-props';
+import { zohoInvoiceApi } from '../../../common/api';
+import { zohoInvoiceListItemsOutputSchema } from '../../../output-schemas';
+
+export const listItemsAction = createAction({
+ auth: zohoInvoiceAuth,
+ name: 'zoho_invoice_list_items',
+ outputSchema: zohoInvoiceListItemsOutputSchema,
+ displayName: 'List Items',
+ description: 'Lists the products and services of an organization.',
+ audience: 'ai',
+ classification: 'SEARCH',
+ aiMetadata: {
+ description:
+ 'Lists items (products and services) with item_id, name, rate, tax and status, one page at a time. Filter by status or search text. Use it to find the item IDs other actions need.',
+ idempotent: true,
+ },
+ props: {
+ organizationId: zohoInvoiceAiProps.organizationId({ required: true }),
+ filterBy: Property.StaticDropdown({
+ displayName: 'Status',
+ description: 'Only items with this status. Empty = all items.',
+ required: false,
+ options: {
+ disabled: false,
+ options: [
+ { label: 'All', value: 'Status.All' },
+ { label: 'Active', value: 'Status.Active' },
+ { label: 'Inactive', value: 'Status.Inactive' },
+ ],
+ },
+ }),
+ searchText: zohoInvoiceAiProps.searchText({
+ required: false,
+ description: 'Search items by name or description.',
+ }),
+ sortColumn: zohoInvoiceAiProps.sortColumn({
+ required: false,
+ description: 'Field to sort by: name, rate or tax_name.',
+ }),
+ page: zohoInvoiceAiProps.page({ required: false }),
+ perPage: zohoInvoiceAiProps.perPage({ required: false }),
+ },
+ async run({ auth, propsValue }) {
+ return await zohoInvoiceApi.listItems({
+ auth,
+ organizationId: propsValue.organizationId,
+ filterBy: propsValue.filterBy,
+ searchText: propsValue.searchText,
+ sortColumn: propsValue.sortColumn,
+ page: propsValue.page,
+ perPage: propsValue.perPage,
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-invoice/src/lib/actions/ai/items/mark-item-active.ts b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/items/mark-item-active.ts
new file mode 100644
index 00000000000..5f107a08611
--- /dev/null
+++ b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/items/mark-item-active.ts
@@ -0,0 +1,32 @@
+import { createAction } from '@activepieces/pieces-framework';
+
+import { zohoInvoiceAuth } from '../../../auth';
+import { zohoInvoiceAiProps } from '../../../common/ai-props';
+import { zohoInvoiceApi } from '../../../common/api';
+import { zohoInvoiceMessageOutputSchema } from '../../../output-schemas';
+
+export const markItemActiveAction = createAction({
+ auth: zohoInvoiceAuth,
+ name: 'zoho_invoice_mark_item_active',
+ outputSchema: zohoInvoiceMessageOutputSchema,
+ displayName: 'Mark Item Active',
+ description: 'Marks an inactive item as active.',
+ audience: 'ai',
+ classification: 'WRITE',
+ aiMetadata: {
+ description:
+ 'Reactivates an item so it can be used on invoices and estimates again. Use List Items to find the ID.',
+ idempotent: true,
+ },
+ props: {
+ organizationId: zohoInvoiceAiProps.organizationId({ required: true }),
+ itemId: zohoInvoiceAiProps.itemId({ required: true }),
+ },
+ async run({ auth, propsValue }) {
+ return await zohoInvoiceApi.markItemActive({
+ auth,
+ organizationId: propsValue.organizationId,
+ itemId: propsValue.itemId,
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-invoice/src/lib/actions/ai/items/mark-item-inactive.ts b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/items/mark-item-inactive.ts
new file mode 100644
index 00000000000..e401703b4b8
--- /dev/null
+++ b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/items/mark-item-inactive.ts
@@ -0,0 +1,32 @@
+import { createAction } from '@activepieces/pieces-framework';
+
+import { zohoInvoiceAuth } from '../../../auth';
+import { zohoInvoiceAiProps } from '../../../common/ai-props';
+import { zohoInvoiceApi } from '../../../common/api';
+import { zohoInvoiceMessageOutputSchema } from '../../../output-schemas';
+
+export const markItemInactiveAction = createAction({
+ auth: zohoInvoiceAuth,
+ name: 'zoho_invoice_mark_item_inactive',
+ outputSchema: zohoInvoiceMessageOutputSchema,
+ displayName: 'Mark Item Inactive',
+ description: 'Marks an item as inactive.',
+ audience: 'ai',
+ classification: 'WRITE',
+ aiMetadata: {
+ description:
+ 'Deactivates an item so it no longer appears for new transactions, keeping its history. Prefer it over Delete Item for items already used. Use List Items to find the ID.',
+ idempotent: true,
+ },
+ props: {
+ organizationId: zohoInvoiceAiProps.organizationId({ required: true }),
+ itemId: zohoInvoiceAiProps.itemId({ required: true }),
+ },
+ async run({ auth, propsValue }) {
+ return await zohoInvoiceApi.markItemInactive({
+ auth,
+ organizationId: propsValue.organizationId,
+ itemId: propsValue.itemId,
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-invoice/src/lib/actions/ai/items/update-item.ts b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/items/update-item.ts
new file mode 100644
index 00000000000..9004e31af6c
--- /dev/null
+++ b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/items/update-item.ts
@@ -0,0 +1,93 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoInvoiceAuth } from '../../../auth';
+import { zohoInvoiceAiProps } from '../../../common/ai-props';
+import { zohoInvoiceApi } from '../../../common/api';
+import { zohoInvoiceUtils } from '../../../common/utils';
+import { zohoInvoiceItemOutputSchema } from '../../../output-schemas';
+
+export const updateItemAction = createAction({
+ auth: zohoInvoiceAuth,
+ name: 'zoho_invoice_update_item',
+ outputSchema: zohoInvoiceItemOutputSchema,
+ displayName: 'Update Item',
+ description: 'Changes the details of an item.',
+ audience: 'ai',
+ classification: 'WRITE',
+ aiMetadata: {
+ description:
+ "Changes an item's name, rate, description, SKU, type or tax. Fields left empty keep their current value. Use List Items to find the ID.",
+ idempotent: true,
+ },
+ props: {
+ organizationId: zohoInvoiceAiProps.organizationId({ required: true }),
+ itemId: zohoInvoiceAiProps.itemId({ required: true }),
+ name: Property.ShortText({
+ displayName: 'Name',
+ description: 'New name. Empty = unchanged.',
+ required: false,
+ }),
+ rate: Property.Number({
+ displayName: 'Rate',
+ description: 'New selling price per unit. Empty = unchanged.',
+ required: false,
+ }),
+ description: Property.LongText({
+ displayName: 'Description',
+ description: 'New description. Empty = unchanged.',
+ required: false,
+ }),
+ sku: Property.ShortText({
+ displayName: 'SKU',
+ description: 'New stock keeping unit. Empty = unchanged.',
+ required: false,
+ }),
+ productType: Property.StaticDropdown({
+ displayName: 'Product Type',
+ description: 'Goods or service. Empty = unchanged.',
+ required: false,
+ options: {
+ disabled: false,
+ options: [
+ { label: 'Goods', value: 'goods' },
+ { label: 'Service', value: 'service' },
+ ],
+ },
+ }),
+ taxId: zohoInvoiceAiProps.taxId({
+ required: false,
+ description: 'New tax ID. Use List Taxes to find it. Empty = unchanged.',
+ }),
+ isTaxable: zohoInvoiceAiProps.yesNo({
+ required: false,
+ displayName: 'Taxable',
+ description: 'Whether the item is taxable. Empty = unchanged.',
+ }),
+ additionalFields: zohoInvoiceAiProps.additionalFields({ required: false }),
+ },
+ async run({ auth, propsValue }) {
+ const { organizationId, itemId } = propsValue;
+ const current = await zohoInvoiceApi.getItem({ auth, organizationId, itemId });
+ return await zohoInvoiceApi.updateItem({
+ auth,
+ organizationId,
+ itemId,
+ body: {
+ ...zohoInvoiceUtils.compact({
+ name: current.item?.name,
+ rate: current.item?.rate,
+ }),
+ ...(propsValue.additionalFields ?? {}),
+ ...zohoInvoiceUtils.compact({
+ name: propsValue.name,
+ rate: propsValue.rate,
+ description: propsValue.description,
+ sku: propsValue.sku,
+ product_type: propsValue.productType,
+ tax_id: propsValue.taxId,
+ is_taxable: zohoInvoiceUtils.toOptionalBoolean({ value: propsValue.isTaxable }),
+ }),
+ },
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-invoice/src/lib/actions/ai/organizations/get-current-user.ts b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/organizations/get-current-user.ts
new file mode 100644
index 00000000000..cb57af4bf4a
--- /dev/null
+++ b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/organizations/get-current-user.ts
@@ -0,0 +1,27 @@
+import { createAction } from '@activepieces/pieces-framework';
+
+import { zohoInvoiceAuth } from '../../../auth';
+import { zohoInvoiceAiProps } from '../../../common/ai-props';
+import { zohoInvoiceApi } from '../../../common/api';
+import { zohoInvoiceUserOutputSchema } from '../../../output-schemas';
+
+export const getCurrentUserAction = createAction({
+ auth: zohoInvoiceAuth,
+ name: 'zoho_invoice_get_current_user',
+ outputSchema: zohoInvoiceUserOutputSchema,
+ displayName: 'Get Current User',
+ description: 'Gets the user the connection is signed in as.',
+ audience: 'ai',
+ classification: 'READ',
+ aiMetadata: {
+ description:
+ 'Returns the connected user in the given organization: user_id, name, email, role and status. Use it to find your own user ID for time entries and project assignments.',
+ idempotent: true,
+ },
+ props: {
+ organizationId: zohoInvoiceAiProps.organizationId({ required: true }),
+ },
+ async run({ auth, propsValue }) {
+ return await zohoInvoiceApi.getCurrentUser({ auth, organizationId: propsValue.organizationId });
+ },
+});
diff --git a/packages/pieces/community/zoho-invoice/src/lib/actions/ai/organizations/get-organization.ts b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/organizations/get-organization.ts
new file mode 100644
index 00000000000..3357ef7f3b4
--- /dev/null
+++ b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/organizations/get-organization.ts
@@ -0,0 +1,30 @@
+import { createAction } from '@activepieces/pieces-framework';
+
+import { zohoInvoiceAuth } from '../../../auth';
+import { zohoInvoiceAiProps } from '../../../common/ai-props';
+import { zohoInvoiceApi } from '../../../common/api';
+import { zohoInvoiceGetOrganizationOutputSchema } from '../../../output-schemas';
+
+export const getOrganizationAction = createAction({
+ auth: zohoInvoiceAuth,
+ name: 'zoho_invoice_get_organization',
+ outputSchema: zohoInvoiceGetOrganizationOutputSchema,
+ displayName: 'Get Organization',
+ description: 'Gets the details of one Zoho Invoice organization.',
+ audience: 'ai',
+ classification: 'READ',
+ aiMetadata: {
+ description:
+ 'Returns one organization by ID: name, contact details, address, base currency, time zone, fiscal year and date format. Use List Organizations to find the ID.',
+ idempotent: true,
+ },
+ props: {
+ organizationId: zohoInvoiceAiProps.organizationId({ required: true }),
+ },
+ async run({ auth, propsValue }) {
+ return await zohoInvoiceApi.getOrganization({
+ auth,
+ organizationId: propsValue.organizationId,
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-invoice/src/lib/actions/ai/organizations/get-user.ts b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/organizations/get-user.ts
new file mode 100644
index 00000000000..2b98e3a5e24
--- /dev/null
+++ b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/organizations/get-user.ts
@@ -0,0 +1,32 @@
+import { createAction } from '@activepieces/pieces-framework';
+
+import { zohoInvoiceAuth } from '../../../auth';
+import { zohoInvoiceAiProps } from '../../../common/ai-props';
+import { zohoInvoiceApi } from '../../../common/api';
+import { zohoInvoiceUserOutputSchema } from '../../../output-schemas';
+
+export const getUserAction = createAction({
+ auth: zohoInvoiceAuth,
+ name: 'zoho_invoice_get_user',
+ outputSchema: zohoInvoiceUserOutputSchema,
+ displayName: 'Get User',
+ description: 'Gets one user of a Zoho Invoice organization.',
+ audience: 'ai',
+ classification: 'READ',
+ aiMetadata: {
+ description:
+ 'Returns one user by ID: name, email, role and status. Use List Users to find the ID. Needs the Admin role.',
+ idempotent: true,
+ },
+ props: {
+ organizationId: zohoInvoiceAiProps.organizationId({ required: true }),
+ userId: zohoInvoiceAiProps.userId({ required: true }),
+ },
+ async run({ auth, propsValue }) {
+ return await zohoInvoiceApi.getUser({
+ auth,
+ organizationId: propsValue.organizationId,
+ userId: propsValue.userId,
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-invoice/src/lib/actions/ai/organizations/list-organizations.ts b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/organizations/list-organizations.ts
new file mode 100644
index 00000000000..e54e885534c
--- /dev/null
+++ b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/organizations/list-organizations.ts
@@ -0,0 +1,24 @@
+import { createAction } from '@activepieces/pieces-framework';
+
+import { zohoInvoiceAuth } from '../../../auth';
+import { zohoInvoiceApi } from '../../../common/api';
+import { zohoInvoiceListOrganizationsOutputSchema } from '../../../output-schemas';
+
+export const listOrganizationsAction = createAction({
+ auth: zohoInvoiceAuth,
+ name: 'zoho_invoice_list_organizations',
+ outputSchema: zohoInvoiceListOrganizationsOutputSchema,
+ displayName: 'List Organizations',
+ description: 'Lists the Zoho Invoice organizations the connected user belongs to.',
+ audience: 'ai',
+ classification: 'SEARCH',
+ aiMetadata: {
+ description:
+ 'Lists every Zoho Invoice organization the connected user can access, with organization_id, name, currency and is_default_org. Call this first: every other Zoho Invoice action needs an Organization ID.',
+ idempotent: true,
+ },
+ props: {},
+ async run({ auth }) {
+ return await zohoInvoiceApi.listOrganizations({ auth });
+ },
+});
diff --git a/packages/pieces/community/zoho-invoice/src/lib/actions/ai/organizations/list-users.ts b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/organizations/list-users.ts
new file mode 100644
index 00000000000..dc47abfaecb
--- /dev/null
+++ b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/organizations/list-users.ts
@@ -0,0 +1,55 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoInvoiceAuth } from '../../../auth';
+import { zohoInvoiceAiProps } from '../../../common/ai-props';
+import { zohoInvoiceApi } from '../../../common/api';
+import { zohoInvoiceListUsersOutputSchema } from '../../../output-schemas';
+
+export const listUsersAction = createAction({
+ auth: zohoInvoiceAuth,
+ name: 'zoho_invoice_list_users',
+ outputSchema: zohoInvoiceListUsersOutputSchema,
+ displayName: 'List Users',
+ description: 'Lists the users of a Zoho Invoice organization.',
+ audience: 'ai',
+ classification: 'SEARCH',
+ aiMetadata: {
+ description:
+ 'Lists the users of an organization with user_id, name, email, role and status, one page at a time. Filter by status. Needs the Admin role.',
+ idempotent: true,
+ },
+ props: {
+ organizationId: zohoInvoiceAiProps.organizationId({ required: true }),
+ filterBy: Property.StaticDropdown({
+ displayName: 'Status',
+ description: 'Only users with this status. Empty = all users.',
+ required: false,
+ options: {
+ disabled: false,
+ options: [
+ { label: 'All', value: 'Status.All' },
+ { label: 'Active', value: 'Status.Active' },
+ { label: 'Inactive', value: 'Status.Inactive' },
+ { label: 'Invited', value: 'Status.Invited' },
+ { label: 'Deleted', value: 'Status.Deleted' },
+ ],
+ },
+ }),
+ sortColumn: zohoInvoiceAiProps.sortColumn({
+ required: false,
+ description: 'Field to sort by: name, email, user_role or status.',
+ }),
+ page: zohoInvoiceAiProps.page({ required: false }),
+ perPage: zohoInvoiceAiProps.perPage({ required: false }),
+ },
+ async run({ auth, propsValue }) {
+ return await zohoInvoiceApi.listUsers({
+ auth,
+ organizationId: propsValue.organizationId,
+ filterBy: propsValue.filterBy,
+ sortColumn: propsValue.sortColumn,
+ page: propsValue.page,
+ perPage: propsValue.perPage,
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-invoice/src/lib/actions/ai/organizations/update-user.ts b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/organizations/update-user.ts
new file mode 100644
index 00000000000..4a26cf15dca
--- /dev/null
+++ b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/organizations/update-user.ts
@@ -0,0 +1,55 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoInvoiceAuth } from '../../../auth';
+import { zohoInvoiceAiProps } from '../../../common/ai-props';
+import { zohoInvoiceApi } from '../../../common/api';
+import { zohoInvoiceUtils } from '../../../common/utils';
+import { zohoInvoiceUserOutputSchema } from '../../../output-schemas';
+
+export const updateUserAction = createAction({
+ auth: zohoInvoiceAuth,
+ name: 'zoho_invoice_update_user',
+ outputSchema: zohoInvoiceUserOutputSchema,
+ displayName: 'Update User',
+ description: "Changes a user's name, email or role.",
+ audience: 'ai',
+ classification: 'WRITE',
+ aiMetadata: {
+ description:
+ "Changes a user's name, email or role. Fields left empty keep their current value. Use List Users to find the ID. Needs the Admin role.",
+ idempotent: true,
+ },
+ props: {
+ organizationId: zohoInvoiceAiProps.organizationId({ required: true }),
+ userId: zohoInvoiceAiProps.userId({ required: true }),
+ name: Property.ShortText({
+ displayName: 'Name',
+ description: 'New full name. Empty = unchanged.',
+ required: false,
+ }),
+ email: Property.ShortText({
+ displayName: 'Email',
+ description: 'New email address. Empty = unchanged.',
+ required: false,
+ }),
+ userRole: Property.ShortText({
+ displayName: 'Role',
+ description: 'New role name, e.g. "admin", "staff" or "timesheetstaff". Empty = unchanged.',
+ required: false,
+ }),
+ },
+ async run({ auth, propsValue }) {
+ const { organizationId, userId } = propsValue;
+ const current = await zohoInvoiceApi.getUser({ auth, organizationId, userId });
+ return await zohoInvoiceApi.updateUser({
+ auth,
+ organizationId,
+ userId,
+ body: zohoInvoiceUtils.compact({
+ name: propsValue.name ?? current.user?.name,
+ email: propsValue.email ?? current.user?.email,
+ user_role: propsValue.userRole,
+ }),
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-invoice/src/lib/actions/ai/projects/activate-project.ts b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/projects/activate-project.ts
new file mode 100644
index 00000000000..5e83408751f
--- /dev/null
+++ b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/projects/activate-project.ts
@@ -0,0 +1,32 @@
+import { createAction } from '@activepieces/pieces-framework';
+
+import { zohoInvoiceAuth } from '../../../auth';
+import { zohoInvoiceAiProps } from '../../../common/ai-props';
+import { zohoInvoiceApi } from '../../../common/api';
+import { zohoInvoiceMessageOutputSchema } from '../../../output-schemas';
+
+export const activateProjectAction = createAction({
+ auth: zohoInvoiceAuth,
+ name: 'zoho_invoice_activate_project',
+ outputSchema: zohoInvoiceMessageOutputSchema,
+ displayName: 'Activate Project',
+ description: 'Marks a project as active.',
+ audience: 'ai',
+ classification: 'WRITE',
+ aiMetadata: {
+ description:
+ 'Marks a project as active so time can be logged against it again. Use List Projects to find the ID. Repeating it leaves the project active.',
+ idempotent: true,
+ },
+ props: {
+ organizationId: zohoInvoiceAiProps.organizationId({ required: true }),
+ projectId: zohoInvoiceAiProps.projectId({ required: true }),
+ },
+ async run({ auth, propsValue }) {
+ return await zohoInvoiceApi.activateProject({
+ auth,
+ organizationId: propsValue.organizationId,
+ projectId: propsValue.projectId,
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-invoice/src/lib/actions/ai/projects/add-project-comment.ts b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/projects/add-project-comment.ts
new file mode 100644
index 00000000000..376703b43e4
--- /dev/null
+++ b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/projects/add-project-comment.ts
@@ -0,0 +1,38 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoInvoiceAuth } from '../../../auth';
+import { zohoInvoiceAiProps } from '../../../common/ai-props';
+import { zohoInvoiceApi } from '../../../common/api';
+import { zohoInvoiceAddProjectCommentOutputSchema } from '../../../output-schemas';
+
+export const addProjectCommentAction = createAction({
+ auth: zohoInvoiceAuth,
+ name: 'zoho_invoice_add_project_comment',
+ outputSchema: zohoInvoiceAddProjectCommentOutputSchema,
+ displayName: 'Add Project Comment',
+ description: 'Adds a comment to a project.',
+ audience: 'ai',
+ classification: 'WRITE',
+ aiMetadata: {
+ description:
+ 'Adds a comment to a project. Use List Projects to find the project ID. Not idempotent: each call adds another comment.',
+ idempotent: false,
+ },
+ props: {
+ organizationId: zohoInvoiceAiProps.organizationId({ required: true }),
+ projectId: zohoInvoiceAiProps.projectId({ required: true }),
+ comment: Property.LongText({
+ displayName: 'Comment',
+ description: 'Text of the comment.',
+ required: true,
+ }),
+ },
+ async run({ auth, propsValue }) {
+ return await zohoInvoiceApi.addProjectComment({
+ auth,
+ organizationId: propsValue.organizationId,
+ projectId: propsValue.projectId,
+ body: { description: propsValue.comment },
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-invoice/src/lib/actions/ai/projects/clone-project.ts b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/projects/clone-project.ts
new file mode 100644
index 00000000000..739feddb97d
--- /dev/null
+++ b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/projects/clone-project.ts
@@ -0,0 +1,50 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoInvoiceAuth } from '../../../auth';
+import { zohoInvoiceAiProps } from '../../../common/ai-props';
+import { zohoInvoiceApi } from '../../../common/api';
+import { zohoInvoiceUtils } from '../../../common/utils';
+import { zohoInvoiceCloneProjectOutputSchema } from '../../../output-schemas';
+
+export const cloneProjectAction = createAction({
+ auth: zohoInvoiceAuth,
+ name: 'zoho_invoice_clone_project',
+ outputSchema: zohoInvoiceCloneProjectOutputSchema,
+ displayName: 'Clone Project',
+ description: 'Creates a copy of a project under a new name.',
+ audience: 'ai',
+ classification: 'WRITE',
+ aiMetadata: {
+ description:
+ 'Creates a new project copied from an existing one (customer, billing, tasks and users) under a new name. Use List Projects to find the ID. Not idempotent: each call creates another project.',
+ idempotent: false,
+ },
+ props: {
+ organizationId: zohoInvoiceAiProps.organizationId({ required: true }),
+ projectId: zohoInvoiceAiProps.projectId({
+ required: true,
+ description: 'ID of the project to copy. Use List Projects to find it.',
+ }),
+ projectName: Property.ShortText({
+ displayName: 'Project Name',
+ description: 'Name of the new project (max 100 characters).',
+ required: true,
+ }),
+ description: Property.LongText({
+ displayName: 'Description',
+ description: 'Description of the new project.',
+ required: false,
+ }),
+ },
+ async run({ auth, propsValue }) {
+ return await zohoInvoiceApi.cloneProject({
+ auth,
+ organizationId: propsValue.organizationId,
+ projectId: propsValue.projectId,
+ body: zohoInvoiceUtils.compact({
+ project_name: propsValue.projectName,
+ description: propsValue.description,
+ }),
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-invoice/src/lib/actions/ai/projects/create-employee.ts b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/projects/create-employee.ts
new file mode 100644
index 00000000000..edb29e56a1f
--- /dev/null
+++ b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/projects/create-employee.ts
@@ -0,0 +1,41 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoInvoiceAuth } from '../../../auth';
+import { zohoInvoiceAiProps } from '../../../common/ai-props';
+import { zohoInvoiceApi } from '../../../common/api';
+import { zohoInvoiceCreateEmployeeOutputSchema } from '../../../output-schemas';
+
+export const createEmployeeAction = createAction({
+ auth: zohoInvoiceAuth,
+ name: 'zoho_invoice_create_employee',
+ outputSchema: zohoInvoiceCreateEmployeeOutputSchema,
+ displayName: 'Create Employee',
+ description: 'Adds an employee to a Zoho Invoice organization.',
+ audience: 'ai',
+ classification: 'WRITE',
+ aiMetadata: {
+ description:
+ 'Adds an employee record, used to track who paid an expense; it sends no invitation and gives no login. Needs the Admin role. Not idempotent: each call creates another employee.',
+ idempotent: false,
+ },
+ props: {
+ organizationId: zohoInvoiceAiProps.organizationId({ required: true }),
+ name: Property.ShortText({
+ displayName: 'Name',
+ description: 'Full name of the employee.',
+ required: true,
+ }),
+ email: Property.ShortText({
+ displayName: 'Email',
+ description: 'Email address of the employee.',
+ required: true,
+ }),
+ },
+ async run({ auth, propsValue }) {
+ return await zohoInvoiceApi.createEmployee({
+ auth,
+ organizationId: propsValue.organizationId,
+ body: { name: propsValue.name, email: propsValue.email },
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-invoice/src/lib/actions/ai/projects/create-project.ts b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/projects/create-project.ts
new file mode 100644
index 00000000000..f22538e83f0
--- /dev/null
+++ b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/projects/create-project.ts
@@ -0,0 +1,147 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoInvoiceAuth } from '../../../auth';
+import { zohoInvoiceAiProps } from '../../../common/ai-props';
+import { zohoInvoiceApi } from '../../../common/api';
+import { zohoInvoiceUtils } from '../../../common/utils';
+import { zohoInvoiceProjectOutputSchema } from '../../../output-schemas';
+
+export const createProjectAction = createAction({
+ auth: zohoInvoiceAuth,
+ name: 'zoho_invoice_create_project',
+ outputSchema: zohoInvoiceProjectOutputSchema,
+ displayName: 'Create Project',
+ description: 'Creates a project for a customer in Zoho Invoice.',
+ audience: 'ai',
+ classification: 'WRITE',
+ aiMetadata: {
+ description:
+ 'Creates a project for a customer, with its billing method, budget, tasks and the first assigned user. Use List Contacts for the customer ID and List Users for the user ID. Not idempotent: each call creates a new project. May need the Projects module enabled in Preferences.',
+ idempotent: false,
+ },
+ props: {
+ organizationId: zohoInvoiceAiProps.organizationId({ required: true }),
+ projectName: Property.ShortText({
+ displayName: 'Project Name',
+ description: 'Name of the project (max 100 characters).',
+ required: true,
+ }),
+ customerId: zohoInvoiceAiProps.contactId({ required: true }),
+ billingType: Property.StaticDropdown({
+ displayName: 'Billing Method',
+ description: 'How the customer is billed for this project.',
+ required: true,
+ options: {
+ disabled: false,
+ options: [
+ { label: 'Fixed cost for project', value: 'fixed_cost_for_project' },
+ { label: 'Based on project hours', value: 'based_on_project_hours' },
+ { label: 'Based on staff hours', value: 'based_on_staff_hours' },
+ { label: 'Based on task hours', value: 'based_on_task_hours' },
+ ],
+ },
+ }),
+ userId: zohoInvoiceAiProps.userId({
+ required: true,
+ description: 'ID of the user to add to the project. Use List Users to find it.',
+ }),
+ description: Property.LongText({
+ displayName: 'Description',
+ description: 'Project description.',
+ required: false,
+ }),
+ rate: Property.Number({
+ displayName: 'Rate',
+ description:
+ 'Total project cost for "Fixed cost for project", or the hourly rate for "Based on project hours".',
+ required: false,
+ }),
+ budgetType: Property.StaticDropdown({
+ displayName: 'Budget Type',
+ description: 'How the project is budgeted. Empty = no budget.',
+ required: false,
+ options: {
+ disabled: false,
+ options: [
+ { label: 'Total project cost', value: 'total_project_cost' },
+ { label: 'Total project hours', value: 'total_project_hours' },
+ { label: 'Hours per task', value: 'hours_per_task' },
+ { label: 'Hours per staff', value: 'hours_per_staff' },
+ ],
+ },
+ }),
+ budgetHours: Property.Number({
+ displayName: 'Budget Hours',
+ description: 'Planned hours, for the "Total project hours" budget type.',
+ required: false,
+ }),
+ budgetAmount: Property.Number({
+ displayName: 'Budget Amount',
+ description: 'Planned budget amount, for the "Total project cost" budget type.',
+ required: false,
+ }),
+ tasks: Property.Array({
+ displayName: 'Tasks',
+ description: 'Tasks to create in the project.',
+ required: false,
+ properties: {
+ taskName: Property.ShortText({
+ displayName: 'Task Name',
+ description: 'Name of the task.',
+ required: true,
+ }),
+ description: Property.ShortText({
+ displayName: 'Description',
+ description: 'Task description.',
+ required: false,
+ }),
+ rate: Property.Number({
+ displayName: 'Rate',
+ description: 'Hourly rate, for "Based on task hours" billing.',
+ required: false,
+ }),
+ budgetHours: Property.Number({
+ displayName: 'Budget Hours',
+ description: 'Planned hours for the task.',
+ required: false,
+ }),
+ },
+ }),
+ additionalFields: zohoInvoiceAiProps.additionalFields({ required: false }),
+ },
+ async run({ auth, propsValue }) {
+ return await zohoInvoiceApi.createProject({
+ auth,
+ organizationId: propsValue.organizationId,
+ body: {
+ ...(propsValue.additionalFields ?? {}),
+ ...zohoInvoiceUtils.compact({
+ project_name: propsValue.projectName,
+ customer_id: propsValue.customerId,
+ billing_type: propsValue.billingType,
+ user_id: propsValue.userId,
+ users: [{ user_id: propsValue.userId }],
+ description: propsValue.description,
+ rate: propsValue.rate,
+ budget_type: propsValue.budgetType,
+ budget_hours: propsValue.budgetHours,
+ budget_amount: propsValue.budgetAmount,
+ tasks:
+ propsValue.tasks &&
+ zohoInvoiceUtils
+ .toRecords({ rows: propsValue.tasks, propName: 'Tasks' })
+ .map((value) => toTaskBody({ value })),
+ }),
+ },
+ });
+ },
+});
+
+function toTaskBody({ value }: { value: Record<string, unknown> }): Record<string, unknown> {
+ return zohoInvoiceUtils.compact({
+ task_name: value['taskName'],
+ description: value['description'],
+ rate: value['rate'],
+ budget_hours: value['budgetHours'],
+ });
+}
diff --git a/packages/pieces/community/zoho-invoice/src/lib/actions/ai/projects/create-task.ts b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/projects/create-task.ts
new file mode 100644
index 00000000000..52ebf87555e
--- /dev/null
+++ b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/projects/create-task.ts
@@ -0,0 +1,59 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoInvoiceAuth } from '../../../auth';
+import { zohoInvoiceAiProps } from '../../../common/ai-props';
+import { zohoInvoiceApi } from '../../../common/api';
+import { zohoInvoiceUtils } from '../../../common/utils';
+import { zohoInvoiceTaskOutputSchema } from '../../../output-schemas';
+
+export const createTaskAction = createAction({
+ auth: zohoInvoiceAuth,
+ name: 'zoho_invoice_create_task',
+ outputSchema: zohoInvoiceTaskOutputSchema,
+ displayName: 'Create Task',
+ description: 'Adds a task to a project.',
+ audience: 'ai',
+ classification: 'WRITE',
+ aiMetadata: {
+ description:
+ 'Adds a task to a project; time entries are logged against tasks. Use List Projects to find the project ID. Not idempotent: each call creates another task.',
+ idempotent: false,
+ },
+ props: {
+ organizationId: zohoInvoiceAiProps.organizationId({ required: true }),
+ projectId: zohoInvoiceAiProps.projectId({ required: true }),
+ taskName: Property.ShortText({
+ displayName: 'Task Name',
+ description: 'Name of the task.',
+ required: true,
+ }),
+ description: Property.LongText({
+ displayName: 'Description',
+ description: 'Task description.',
+ required: false,
+ }),
+ rate: Property.Number({
+ displayName: 'Rate',
+ description: 'Hourly rate, used when the project bills based on task hours.',
+ required: false,
+ }),
+ budgetHours: Property.Number({
+ displayName: 'Budget Hours',
+ description: 'Planned hours for the task.',
+ required: false,
+ }),
+ },
+ async run({ auth, propsValue }) {
+ return await zohoInvoiceApi.createProjectTask({
+ auth,
+ organizationId: propsValue.organizationId,
+ projectId: propsValue.projectId,
+ body: zohoInvoiceUtils.compact({
+ task_name: propsValue.taskName,
+ description: propsValue.description,
+ rate: propsValue.rate,
+ budget_hours: propsValue.budgetHours,
+ }),
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-invoice/src/lib/actions/ai/projects/create-time-entry.ts b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/projects/create-time-entry.ts
new file mode 100644
index 00000000000..d1c8f6e25a8
--- /dev/null
+++ b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/projects/create-time-entry.ts
@@ -0,0 +1,89 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoInvoiceAuth } from '../../../auth';
+import { zohoInvoiceAiProps } from '../../../common/ai-props';
+import { zohoInvoiceApi } from '../../../common/api';
+import { zohoInvoiceUtils } from '../../../common/utils';
+import { zohoInvoiceTimeEntryOutputSchema } from '../../../output-schemas';
+
+export const createTimeEntryAction = createAction({
+ auth: zohoInvoiceAuth,
+ name: 'zoho_invoice_create_time_entry',
+ outputSchema: zohoInvoiceTimeEntryOutputSchema,
+ displayName: 'Create Time Entry',
+ description: 'Logs time spent on a project task.',
+ audience: 'ai',
+ classification: 'WRITE',
+ aiMetadata: {
+ description:
+ 'Logs time a user spent on a project task, as a duration or a begin and end time, or starts a timer. Use List Projects for the project ID, List Tasks for the task ID and List Project Users for the user ID. Not idempotent: each call logs another entry.',
+ idempotent: false,
+ },
+ props: {
+ organizationId: zohoInvoiceAiProps.organizationId({ required: true }),
+ projectId: zohoInvoiceAiProps.projectId({ required: true }),
+ taskId: zohoInvoiceAiProps.taskId({ required: true }),
+ userId: zohoInvoiceAiProps.userId({
+ required: true,
+ description: 'ID of a user on the project. Use List Project Users to find it.',
+ }),
+ logDate: Property.ShortText({
+ displayName: 'Date',
+ description: 'Day the time was spent, as yyyy-mm-dd.',
+ required: true,
+ }),
+ logTime: Property.ShortText({
+ displayName: 'Duration',
+ description: 'Time spent, as HH:mm. Send this or Begin Time and End Time.',
+ required: false,
+ }),
+ beginTime: Property.ShortText({
+ displayName: 'Begin Time',
+ description: 'Time the work started, as HH:mm.',
+ required: false,
+ }),
+ endTime: Property.ShortText({
+ displayName: 'End Time',
+ description: 'Time the work ended, as HH:mm.',
+ required: false,
+ }),
+ isBillable: zohoInvoiceAiProps.yesNo({
+ required: false,
+ displayName: 'Billable',
+ description: 'Whether the time can be billed to the customer. Empty = the vendor default.',
+ }),
+ notes: Property.LongText({
+ displayName: 'Notes',
+ description: 'Notes about the work done.',
+ required: false,
+ }),
+ startTimer: zohoInvoiceAiProps.yesNo({
+ required: false,
+ displayName: 'Start Timer',
+ description:
+ 'Yes to start a running timer on this entry instead of logging a fixed duration.',
+ }),
+ additionalFields: zohoInvoiceAiProps.additionalFields({ required: false }),
+ },
+ async run({ auth, propsValue }) {
+ return await zohoInvoiceApi.createTimeEntry({
+ auth,
+ organizationId: propsValue.organizationId,
+ body: {
+ ...(propsValue.additionalFields ?? {}),
+ ...zohoInvoiceUtils.compact({
+ project_id: propsValue.projectId,
+ task_id: propsValue.taskId,
+ user_id: propsValue.userId,
+ log_date: propsValue.logDate,
+ log_time: propsValue.logTime,
+ begin_time: propsValue.beginTime,
+ end_time: propsValue.endTime,
+ is_billable: zohoInvoiceUtils.toOptionalBoolean({ value: propsValue.isBillable }),
+ notes: propsValue.notes,
+ start_timer: zohoInvoiceUtils.toOptionalBoolean({ value: propsValue.startTimer }),
+ }),
+ },
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-invoice/src/lib/actions/ai/projects/deactivate-project.ts b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/projects/deactivate-project.ts
new file mode 100644
index 00000000000..c0bd9cadc2d
--- /dev/null
+++ b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/projects/deactivate-project.ts
@@ -0,0 +1,32 @@
+import { createAction } from '@activepieces/pieces-framework';
+
+import { zohoInvoiceAuth } from '../../../auth';
+import { zohoInvoiceAiProps } from '../../../common/ai-props';
+import { zohoInvoiceApi } from '../../../common/api';
+import { zohoInvoiceMessageOutputSchema } from '../../../output-schemas';
+
+export const deactivateProjectAction = createAction({
+ auth: zohoInvoiceAuth,
+ name: 'zoho_invoice_deactivate_project',
+ outputSchema: zohoInvoiceMessageOutputSchema,
+ displayName: 'Deactivate Project',
+ description: 'Marks a project as inactive.',
+ audience: 'ai',
+ classification: 'WRITE',
+ aiMetadata: {
+ description:
+ 'Marks a project as inactive so no new time is logged against it, keeping its history; undo with Activate Project. Use List Projects to find the ID. Repeating it leaves the project inactive.',
+ idempotent: true,
+ },
+ props: {
+ organizationId: zohoInvoiceAiProps.organizationId({ required: true }),
+ projectId: zohoInvoiceAiProps.projectId({ required: true }),
+ },
+ async run({ auth, propsValue }) {
+ return await zohoInvoiceApi.deactivateProject({
+ auth,
+ organizationId: propsValue.organizationId,
+ projectId: propsValue.projectId,
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-invoice/src/lib/actions/ai/projects/delete-employee.ts b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/projects/delete-employee.ts
new file mode 100644
index 00000000000..16ee6e9dee7
--- /dev/null
+++ b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/projects/delete-employee.ts
@@ -0,0 +1,36 @@
+import { createAction } from '@activepieces/pieces-framework';
+
+import { zohoInvoiceAuth } from '../../../auth';
+import { zohoInvoiceAiProps } from '../../../common/ai-props';
+import { zohoInvoiceApi } from '../../../common/api';
+import { zohoInvoiceMessageOutputSchema } from '../../../output-schemas';
+
+export const deleteEmployeeAction = createAction({
+ auth: zohoInvoiceAuth,
+ name: 'zoho_invoice_delete_employee',
+ outputSchema: zohoInvoiceMessageOutputSchema,
+ displayName: 'Delete Employee',
+ description: 'Deletes an employee from a Zoho Invoice organization.',
+ audience: 'ai',
+ classification: 'DESTRUCTIVE',
+ aiMetadata: {
+ description:
+ 'Permanently deletes an employee record. Use List Employees to find the ID. Needs the Admin role. Cannot be undone.',
+ idempotent: false,
+ },
+ props: {
+ organizationId: zohoInvoiceAiProps.organizationId({ required: true }),
+ employeeId: zohoInvoiceAiProps.idProp({
+ required: true,
+ displayName: 'Employee ID',
+ description: 'Employee ID. Use List Employees to find it.',
+ }),
+ },
+ async run({ auth, propsValue }) {
+ return await zohoInvoiceApi.deleteEmployee({
+ auth,
+ organizationId: propsValue.organizationId,
+ employeeId: propsValue.employeeId,
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-invoice/src/lib/actions/ai/projects/delete-project-comment.ts b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/projects/delete-project-comment.ts
new file mode 100644
index 00000000000..7477761d6ae
--- /dev/null
+++ b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/projects/delete-project-comment.ts
@@ -0,0 +1,37 @@
+import { createAction } from '@activepieces/pieces-framework';
+
+import { zohoInvoiceAuth } from '../../../auth';
+import { zohoInvoiceAiProps } from '../../../common/ai-props';
+import { zohoInvoiceApi } from '../../../common/api';
+import { zohoInvoiceMessageOutputSchema } from '../../../output-schemas';
+
+export const deleteProjectCommentAction = createAction({
+ auth: zohoInvoiceAuth,
+ name: 'zoho_invoice_delete_project_comment',
+ outputSchema: zohoInvoiceMessageOutputSchema,
+ displayName: 'Delete Project Comment',
+ description: 'Deletes a comment from a project.',
+ audience: 'ai',
+ classification: 'DESTRUCTIVE',
+ aiMetadata: {
+ description:
+ 'Permanently deletes one comment from a project. Use List Projects for the project ID and List Project Comments for the comment ID. Cannot be undone.',
+ idempotent: false,
+ },
+ props: {
+ organizationId: zohoInvoiceAiProps.organizationId({ required: true }),
+ projectId: zohoInvoiceAiProps.projectId({ required: true }),
+ commentId: zohoInvoiceAiProps.commentId({
+ required: true,
+ description: 'Comment ID. Use List Project Comments to find it.',
+ }),
+ },
+ async run({ auth, propsValue }) {
+ return await zohoInvoiceApi.deleteProjectComment({
+ auth,
+ organizationId: propsValue.organizationId,
+ projectId: propsValue.projectId,
+ commentId: propsValue.commentId,
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-invoice/src/lib/actions/ai/projects/delete-project.ts b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/projects/delete-project.ts
new file mode 100644
index 00000000000..c06591691cf
--- /dev/null
+++ b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/projects/delete-project.ts
@@ -0,0 +1,32 @@
+import { createAction } from '@activepieces/pieces-framework';
+
+import { zohoInvoiceAuth } from '../../../auth';
+import { zohoInvoiceAiProps } from '../../../common/ai-props';
+import { zohoInvoiceApi } from '../../../common/api';
+import { zohoInvoiceMessageOutputSchema } from '../../../output-schemas';
+
+export const deleteProjectAction = createAction({
+ auth: zohoInvoiceAuth,
+ name: 'zoho_invoice_delete_project',
+ outputSchema: zohoInvoiceMessageOutputSchema,
+ displayName: 'Delete Project',
+ description: 'Deletes a project from Zoho Invoice.',
+ audience: 'ai',
+ classification: 'DESTRUCTIVE',
+ aiMetadata: {
+ description:
+ 'Permanently deletes a project with its tasks. Use List Projects to find the ID. Prefer Deactivate Project to keep the history. Cannot be undone.',
+ idempotent: false,
+ },
+ props: {
+ organizationId: zohoInvoiceAiProps.organizationId({ required: true }),
+ projectId: zohoInvoiceAiProps.projectId({ required: true }),
+ },
+ async run({ auth, propsValue }) {
+ return await zohoInvoiceApi.deleteProject({
+ auth,
+ organizationId: propsValue.organizationId,
+ projectId: propsValue.projectId,
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-invoice/src/lib/actions/ai/projects/delete-task.ts b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/projects/delete-task.ts
new file mode 100644
index 00000000000..6b6f8a0d6e9
--- /dev/null
+++ b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/projects/delete-task.ts
@@ -0,0 +1,34 @@
+import { createAction } from '@activepieces/pieces-framework';
+
+import { zohoInvoiceAuth } from '../../../auth';
+import { zohoInvoiceAiProps } from '../../../common/ai-props';
+import { zohoInvoiceApi } from '../../../common/api';
+import { zohoInvoiceMessageOutputSchema } from '../../../output-schemas';
+
+export const deleteTaskAction = createAction({
+ auth: zohoInvoiceAuth,
+ name: 'zoho_invoice_delete_task',
+ outputSchema: zohoInvoiceMessageOutputSchema,
+ displayName: 'Delete Task',
+ description: 'Deletes a task from a project.',
+ audience: 'ai',
+ classification: 'DESTRUCTIVE',
+ aiMetadata: {
+ description:
+ 'Permanently deletes one task from a project. Use List Projects for the project ID and List Tasks for the task ID. Cannot be undone.',
+ idempotent: false,
+ },
+ props: {
+ organizationId: zohoInvoiceAiProps.organizationId({ required: true }),
+ projectId: zohoInvoiceAiProps.projectId({ required: true }),
+ taskId: zohoInvoiceAiProps.taskId({ required: true }),
+ },
+ async run({ auth, propsValue }) {
+ return await zohoInvoiceApi.deleteProjectTask({
+ auth,
+ organizationId: propsValue.organizationId,
+ projectId: propsValue.projectId,
+ taskId: propsValue.taskId,
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-invoice/src/lib/actions/ai/projects/delete-time-entry.ts b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/projects/delete-time-entry.ts
new file mode 100644
index 00000000000..bd9c4c1f73f
--- /dev/null
+++ b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/projects/delete-time-entry.ts
@@ -0,0 +1,32 @@
+import { createAction } from '@activepieces/pieces-framework';
+
+import { zohoInvoiceAuth } from '../../../auth';
+import { zohoInvoiceAiProps } from '../../../common/ai-props';
+import { zohoInvoiceApi } from '../../../common/api';
+import { zohoInvoiceMessageWithDataOutputSchema } from '../../../output-schemas';
+
+export const deleteTimeEntryAction = createAction({
+ auth: zohoInvoiceAuth,
+ name: 'zoho_invoice_delete_time_entry',
+ outputSchema: zohoInvoiceMessageWithDataOutputSchema,
+ displayName: 'Delete Time Entry',
+ description: 'Deletes a time entry from Zoho Invoice.',
+ audience: 'ai',
+ classification: 'DESTRUCTIVE',
+ aiMetadata: {
+ description:
+ 'Permanently deletes one time entry. Use List Time Entries to find the ID. Cannot be undone.',
+ idempotent: false,
+ },
+ props: {
+ organizationId: zohoInvoiceAiProps.organizationId({ required: true }),
+ timeEntryId: zohoInvoiceAiProps.timeEntryId({ required: true }),
+ },
+ async run({ auth, propsValue }) {
+ return await zohoInvoiceApi.deleteTimeEntry({
+ auth,
+ organizationId: propsValue.organizationId,
+ timeEntryId: propsValue.timeEntryId,
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-invoice/src/lib/actions/ai/projects/get-project-user.ts b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/projects/get-project-user.ts
new file mode 100644
index 00000000000..f3e4ae139b1
--- /dev/null
+++ b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/projects/get-project-user.ts
@@ -0,0 +1,37 @@
+import { createAction } from '@activepieces/pieces-framework';
+
+import { zohoInvoiceAuth } from '../../../auth';
+import { zohoInvoiceAiProps } from '../../../common/ai-props';
+import { zohoInvoiceApi } from '../../../common/api';
+import { zohoInvoiceGetProjectUserOutputSchema } from '../../../output-schemas';
+
+export const getProjectUserAction = createAction({
+ auth: zohoInvoiceAuth,
+ name: 'zoho_invoice_get_project_user',
+ outputSchema: zohoInvoiceGetProjectUserOutputSchema,
+ displayName: 'Get Project User',
+ description: 'Gets one user assigned to a project.',
+ audience: 'ai',
+ classification: 'READ',
+ aiMetadata: {
+ description:
+ 'Returns one project user by ID with their role, rate, budget and logged hours on that project. Use List Projects for the project ID and List Project Users for the user ID.',
+ idempotent: true,
+ },
+ props: {
+ organizationId: zohoInvoiceAiProps.organizationId({ required: true }),
+ projectId: zohoInvoiceAiProps.projectId({ required: true }),
+ userId: zohoInvoiceAiProps.userId({
+ required: true,
+ description: 'User ID. Use List Project Users to find it.',
+ }),
+ },
+ async run({ auth, propsValue }) {
+ return await zohoInvoiceApi.getProjectUser({
+ auth,
+ organizationId: propsValue.organizationId,
+ projectId: propsValue.projectId,
+ userId: propsValue.userId,
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-invoice/src/lib/actions/ai/projects/get-project.ts b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/projects/get-project.ts
new file mode 100644
index 00000000000..41f492dd9e6
--- /dev/null
+++ b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/projects/get-project.ts
@@ -0,0 +1,32 @@
+import { createAction } from '@activepieces/pieces-framework';
+
+import { zohoInvoiceAuth } from '../../../auth';
+import { zohoInvoiceAiProps } from '../../../common/ai-props';
+import { zohoInvoiceApi } from '../../../common/api';
+import { zohoInvoiceGetProjectOutputSchema } from '../../../output-schemas';
+
+export const getProjectAction = createAction({
+ auth: zohoInvoiceAuth,
+ name: 'zoho_invoice_get_project',
+ outputSchema: zohoInvoiceGetProjectOutputSchema,
+ displayName: 'Get Project',
+ description: 'Gets one project from Zoho Invoice.',
+ audience: 'ai',
+ classification: 'READ',
+ aiMetadata: {
+ description:
+ 'Returns one project by ID with its customer, billing method, budget, tasks and logged hours and amounts. Use List Projects to find the ID.',
+ idempotent: true,
+ },
+ props: {
+ organizationId: zohoInvoiceAiProps.organizationId({ required: true }),
+ projectId: zohoInvoiceAiProps.projectId({ required: true }),
+ },
+ async run({ auth, propsValue }) {
+ return await zohoInvoiceApi.getProject({
+ auth,
+ organizationId: propsValue.organizationId,
+ projectId: propsValue.projectId,
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-invoice/src/lib/actions/ai/projects/get-running-timer.ts b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/projects/get-running-timer.ts
new file mode 100644
index 00000000000..6c66d11197d
--- /dev/null
+++ b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/projects/get-running-timer.ts
@@ -0,0 +1,30 @@
+import { createAction } from '@activepieces/pieces-framework';
+
+import { zohoInvoiceAuth } from '../../../auth';
+import { zohoInvoiceAiProps } from '../../../common/ai-props';
+import { zohoInvoiceApi } from '../../../common/api';
+import { zohoInvoiceTimeEntryOutputSchema } from '../../../output-schemas';
+
+export const getRunningTimerAction = createAction({
+ auth: zohoInvoiceAuth,
+ name: 'zoho_invoice_get_running_timer',
+ outputSchema: zohoInvoiceTimeEntryOutputSchema,
+ displayName: 'Get Running Timer',
+ description: "Gets the current user's running timer.",
+ audience: 'ai',
+ classification: 'READ',
+ aiMetadata: {
+ description:
+ 'Returns the time entry whose timer is running for the connected user, with its project, task and elapsed time. Use it before Stop Timer or Start Timer to check what is running.',
+ idempotent: true,
+ },
+ props: {
+ organizationId: zohoInvoiceAiProps.organizationId({ required: true }),
+ },
+ async run({ auth, propsValue }) {
+ return await zohoInvoiceApi.getRunningTimeEntryTimer({
+ auth,
+ organizationId: propsValue.organizationId,
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-invoice/src/lib/actions/ai/projects/get-task.ts b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/projects/get-task.ts
new file mode 100644
index 00000000000..e44de8b5887
--- /dev/null
+++ b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/projects/get-task.ts
@@ -0,0 +1,34 @@
+import { createAction } from '@activepieces/pieces-framework';
+
+import { zohoInvoiceAuth } from '../../../auth';
+import { zohoInvoiceAiProps } from '../../../common/ai-props';
+import { zohoInvoiceApi } from '../../../common/api';
+import { zohoInvoiceTaskOutputSchema } from '../../../output-schemas';
+
+export const getTaskAction = createAction({
+ auth: zohoInvoiceAuth,
+ name: 'zoho_invoice_get_task',
+ outputSchema: zohoInvoiceTaskOutputSchema,
+ displayName: 'Get Task',
+ description: 'Gets one task of a project.',
+ audience: 'ai',
+ classification: 'READ',
+ aiMetadata: {
+ description:
+ 'Returns one project task by ID with its name, description, rate and status. Use List Projects for the project ID and List Tasks for the task ID.',
+ idempotent: true,
+ },
+ props: {
+ organizationId: zohoInvoiceAiProps.organizationId({ required: true }),
+ projectId: zohoInvoiceAiProps.projectId({ required: true }),
+ taskId: zohoInvoiceAiProps.taskId({ required: true }),
+ },
+ async run({ auth, propsValue }) {
+ return await zohoInvoiceApi.getProjectTask({
+ auth,
+ organizationId: propsValue.organizationId,
+ projectId: propsValue.projectId,
+ taskId: propsValue.taskId,
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-invoice/src/lib/actions/ai/projects/get-time-entry.ts b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/projects/get-time-entry.ts
new file mode 100644
index 00000000000..37dd3688032
--- /dev/null
+++ b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/projects/get-time-entry.ts
@@ -0,0 +1,32 @@
+import { createAction } from '@activepieces/pieces-framework';
+
+import { zohoInvoiceAuth } from '../../../auth';
+import { zohoInvoiceAiProps } from '../../../common/ai-props';
+import { zohoInvoiceApi } from '../../../common/api';
+import { zohoInvoiceTimeEntryOutputSchema } from '../../../output-schemas';
+
+export const getTimeEntryAction = createAction({
+ auth: zohoInvoiceAuth,
+ name: 'zoho_invoice_get_time_entry',
+ outputSchema: zohoInvoiceTimeEntryOutputSchema,
+ displayName: 'Get Time Entry',
+ description: 'Gets one time entry from Zoho Invoice.',
+ audience: 'ai',
+ classification: 'READ',
+ aiMetadata: {
+ description:
+ 'Returns one time entry by ID with its project, task, user, date, duration, timer state and billed status. Use List Time Entries to find the ID.',
+ idempotent: true,
+ },
+ props: {
+ organizationId: zohoInvoiceAiProps.organizationId({ required: true }),
+ timeEntryId: zohoInvoiceAiProps.timeEntryId({ required: true }),
+ },
+ async run({ auth, propsValue }) {
+ return await zohoInvoiceApi.getTimeEntry({
+ auth,
+ organizationId: propsValue.organizationId,
+ timeEntryId: propsValue.timeEntryId,
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-invoice/src/lib/actions/ai/projects/list-employees.ts b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/projects/list-employees.ts
new file mode 100644
index 00000000000..85c3b7f6cbd
--- /dev/null
+++ b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/projects/list-employees.ts
@@ -0,0 +1,34 @@
+import { createAction } from '@activepieces/pieces-framework';
+
+import { zohoInvoiceAuth } from '../../../auth';
+import { zohoInvoiceAiProps } from '../../../common/ai-props';
+import { zohoInvoiceApi } from '../../../common/api';
+import { zohoInvoiceListEmployeesOutputSchema } from '../../../output-schemas';
+
+export const listEmployeesAction = createAction({
+ auth: zohoInvoiceAuth,
+ name: 'zoho_invoice_list_employees',
+ outputSchema: zohoInvoiceListEmployeesOutputSchema,
+ displayName: 'List Employees',
+ description: 'Lists the employees of a Zoho Invoice organization.',
+ audience: 'ai',
+ classification: 'SEARCH',
+ aiMetadata: {
+ description:
+ 'Lists the employees of an organization with employee_id, name and email, one page at a time. Employees are expense payers, not login users; use List Users for those.',
+ idempotent: true,
+ },
+ props: {
+ organizationId: zohoInvoiceAiProps.organizationId({ required: true }),
+ page: zohoInvoiceAiProps.page({ required: false }),
+ perPage: zohoInvoiceAiProps.perPage({ required: false }),
+ },
+ async run({ auth, propsValue }) {
+ return await zohoInvoiceApi.listEmployees({
+ auth,
+ organizationId: propsValue.organizationId,
+ page: propsValue.page,
+ perPage: propsValue.perPage,
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-invoice/src/lib/actions/ai/projects/list-project-comments.ts b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/projects/list-project-comments.ts
new file mode 100644
index 00000000000..d62c747f27b
--- /dev/null
+++ b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/projects/list-project-comments.ts
@@ -0,0 +1,32 @@
+import { createAction } from '@activepieces/pieces-framework';
+
+import { zohoInvoiceAuth } from '../../../auth';
+import { zohoInvoiceAiProps } from '../../../common/ai-props';
+import { zohoInvoiceApi } from '../../../common/api';
+import { zohoInvoiceListProjectCommentsOutputSchema } from '../../../output-schemas';
+
+export const listProjectCommentsAction = createAction({
+ auth: zohoInvoiceAuth,
+ name: 'zoho_invoice_list_project_comments',
+ outputSchema: zohoInvoiceListProjectCommentsOutputSchema,
+ displayName: 'List Project Comments',
+ description: 'Lists the comments on a project.',
+ audience: 'ai',
+ classification: 'SEARCH',
+ aiMetadata: {
+ description:
+ 'Lists the comments on one project with comment_id, text, author and date. Use List Projects to find the project ID.',
+ idempotent: true,
+ },
+ props: {
+ organizationId: zohoInvoiceAiProps.organizationId({ required: true }),
+ projectId: zohoInvoiceAiProps.projectId({ required: true }),
+ },
+ async run({ auth, propsValue }) {
+ return await zohoInvoiceApi.listProjectComments({
+ auth,
+ organizationId: propsValue.organizationId,
+ projectId: propsValue.projectId,
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-invoice/src/lib/actions/ai/projects/list-project-invoices.ts b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/projects/list-project-invoices.ts
new file mode 100644
index 00000000000..75445dc57a0
--- /dev/null
+++ b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/projects/list-project-invoices.ts
@@ -0,0 +1,41 @@
+import { createAction } from '@activepieces/pieces-framework';
+
+import { zohoInvoiceAuth } from '../../../auth';
+import { zohoInvoiceAiProps } from '../../../common/ai-props';
+import { zohoInvoiceApi } from '../../../common/api';
+import { zohoInvoiceListProjectInvoicesOutputSchema } from '../../../output-schemas';
+
+export const listProjectInvoicesAction = createAction({
+ auth: zohoInvoiceAuth,
+ name: 'zoho_invoice_list_project_invoices',
+ outputSchema: zohoInvoiceListProjectInvoicesOutputSchema,
+ displayName: 'List Project Invoices',
+ description: 'Lists the invoices raised for a project.',
+ audience: 'ai',
+ classification: 'SEARCH',
+ aiMetadata: {
+ description:
+ 'Lists the invoices raised for one project with invoice_id, number, date, total and balance, one page at a time. Use List Projects to find the project ID; use List Invoices for invoices across all projects.',
+ idempotent: true,
+ },
+ props: {
+ organizationId: zohoInvoiceAiProps.organizationId({ required: true }),
+ projectId: zohoInvoiceAiProps.projectId({ required: true }),
+ sortColumn: zohoInvoiceAiProps.sortColumn({
+ required: false,
+ description: 'Field to sort by: invoice_number, date, total, balance or created_time.',
+ }),
+ page: zohoInvoiceAiProps.page({ required: false }),
+ perPage: zohoInvoiceAiProps.perPage({ required: false }),
+ },
+ async run({ auth, propsValue }) {
+ return await zohoInvoiceApi.listProjectInvoices({
+ auth,
+ organizationId: propsValue.organizationId,
+ projectId: propsValue.projectId,
+ sortColumn: propsValue.sortColumn,
+ page: propsValue.page,
+ perPage: propsValue.perPage,
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-invoice/src/lib/actions/ai/projects/list-project-users.ts b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/projects/list-project-users.ts
new file mode 100644
index 00000000000..ba5b47c15c5
--- /dev/null
+++ b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/projects/list-project-users.ts
@@ -0,0 +1,32 @@
+import { createAction } from '@activepieces/pieces-framework';
+
+import { zohoInvoiceAuth } from '../../../auth';
+import { zohoInvoiceAiProps } from '../../../common/ai-props';
+import { zohoInvoiceApi } from '../../../common/api';
+import { zohoInvoiceListProjectUsersOutputSchema } from '../../../output-schemas';
+
+export const listProjectUsersAction = createAction({
+ auth: zohoInvoiceAuth,
+ name: 'zoho_invoice_list_project_users',
+ outputSchema: zohoInvoiceListProjectUsersOutputSchema,
+ displayName: 'List Project Users',
+ description: 'Lists the users assigned to a project.',
+ audience: 'ai',
+ classification: 'SEARCH',
+ aiMetadata: {
+ description:
+ 'Lists the users assigned to one project with user_id, name, role, rate and logged hours. Use List Projects to find the project ID; use List Users for every user of the organization.',
+ idempotent: true,
+ },
+ props: {
+ organizationId: zohoInvoiceAiProps.organizationId({ required: true }),
+ projectId: zohoInvoiceAiProps.projectId({ required: true }),
+ },
+ async run({ auth, propsValue }) {
+ return await zohoInvoiceApi.listProjectUsers({
+ auth,
+ organizationId: propsValue.organizationId,
+ projectId: propsValue.projectId,
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-invoice/src/lib/actions/ai/projects/list-projects.ts b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/projects/list-projects.ts
new file mode 100644
index 00000000000..62a1a889dc2
--- /dev/null
+++ b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/projects/list-projects.ts
@@ -0,0 +1,58 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoInvoiceAuth } from '../../../auth';
+import { zohoInvoiceAiProps } from '../../../common/ai-props';
+import { zohoInvoiceApi } from '../../../common/api';
+import { zohoInvoiceListProjectsOutputSchema } from '../../../output-schemas';
+
+export const listProjectsAction = createAction({
+ auth: zohoInvoiceAuth,
+ name: 'zoho_invoice_list_projects',
+ outputSchema: zohoInvoiceListProjectsOutputSchema,
+ displayName: 'List Projects',
+ description: 'Lists the projects of a Zoho Invoice organization.',
+ audience: 'ai',
+ classification: 'SEARCH',
+ aiMetadata: {
+ description:
+ 'Lists projects with project_id, name, customer, billing method and status, one page at a time. Filter by status or customer. Use it to find the project ID other project, task and time entry actions need.',
+ idempotent: true,
+ },
+ props: {
+ organizationId: zohoInvoiceAiProps.organizationId({ required: true }),
+ filterBy: Property.StaticDropdown({
+ displayName: 'Status',
+ description: 'Only projects with this status. Empty = all projects.',
+ required: false,
+ options: {
+ disabled: false,
+ options: [
+ { label: 'All', value: 'Status.All' },
+ { label: 'Active', value: 'Status.Active' },
+ { label: 'Inactive', value: 'Status.Inactive' },
+ ],
+ },
+ }),
+ customerId: zohoInvoiceAiProps.contactId({
+ required: false,
+ description: 'Only projects of this customer. Use List Contacts to find it.',
+ }),
+ sortColumn: zohoInvoiceAiProps.sortColumn({
+ required: false,
+ description: 'Field to sort by: project_name, customer_name, rate or created_time.',
+ }),
+ page: zohoInvoiceAiProps.page({ required: false }),
+ perPage: zohoInvoiceAiProps.perPage({ required: false }),
+ },
+ async run({ auth, propsValue }) {
+ return await zohoInvoiceApi.listProjects({
+ auth,
+ organizationId: propsValue.organizationId,
+ filterBy: propsValue.filterBy,
+ customerId: propsValue.customerId,
+ sortColumn: propsValue.sortColumn,
+ page: propsValue.page,
+ perPage: propsValue.perPage,
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-invoice/src/lib/actions/ai/projects/list-tasks.ts b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/projects/list-tasks.ts
new file mode 100644
index 00000000000..eb2ab2fd7f8
--- /dev/null
+++ b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/projects/list-tasks.ts
@@ -0,0 +1,36 @@
+import { createAction } from '@activepieces/pieces-framework';
+
+import { zohoInvoiceAuth } from '../../../auth';
+import { zohoInvoiceAiProps } from '../../../common/ai-props';
+import { zohoInvoiceApi } from '../../../common/api';
+import { zohoInvoiceListTasksOutputSchema } from '../../../output-schemas';
+
+export const listTasksAction = createAction({
+ auth: zohoInvoiceAuth,
+ name: 'zoho_invoice_list_tasks',
+ outputSchema: zohoInvoiceListTasksOutputSchema,
+ displayName: 'List Tasks',
+ description: 'Lists the tasks of a project.',
+ audience: 'ai',
+ classification: 'SEARCH',
+ aiMetadata: {
+ description:
+ 'Lists the tasks of one project with task_id, name, rate and status, one page at a time. Use List Projects to find the project ID. Use it to find the task ID that time entries need.',
+ idempotent: true,
+ },
+ props: {
+ organizationId: zohoInvoiceAiProps.organizationId({ required: true }),
+ projectId: zohoInvoiceAiProps.projectId({ required: true }),
+ page: zohoInvoiceAiProps.page({ required: false }),
+ perPage: zohoInvoiceAiProps.perPage({ required: false }),
+ },
+ async run({ auth, propsValue }) {
+ return await zohoInvoiceApi.listProjectTasks({
+ auth,
+ organizationId: propsValue.organizationId,
+ projectId: propsValue.projectId,
+ page: propsValue.page,
+ perPage: propsValue.perPage,
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-invoice/src/lib/actions/ai/projects/list-time-entries.ts b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/projects/list-time-entries.ts
new file mode 100644
index 00000000000..eb14f6eb554
--- /dev/null
+++ b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/projects/list-time-entries.ts
@@ -0,0 +1,88 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoInvoiceAuth } from '../../../auth';
+import { zohoInvoiceAiProps } from '../../../common/ai-props';
+import { zohoInvoiceApi } from '../../../common/api';
+import { zohoInvoiceListTimeEntriesOutputSchema } from '../../../output-schemas';
+
+export const listTimeEntriesAction = createAction({
+ auth: zohoInvoiceAuth,
+ name: 'zoho_invoice_list_time_entries',
+ outputSchema: zohoInvoiceListTimeEntriesOutputSchema,
+ displayName: 'List Time Entries',
+ description: 'Lists the time entries logged in Zoho Invoice.',
+ audience: 'ai',
+ classification: 'SEARCH',
+ aiMetadata: {
+ description:
+ 'Lists time entries with time_entry_id, project, task, user, date, duration and billed status, one page at a time. Filter by project, user, a date range or a period/billing filter. Use List Projects and List Users to find the filter IDs.',
+ idempotent: true,
+ },
+ props: {
+ organizationId: zohoInvoiceAiProps.organizationId({ required: true }),
+ projectId: zohoInvoiceAiProps.projectId({
+ required: false,
+ description: 'Only entries of this project. Use List Projects to find it.',
+ }),
+ userId: zohoInvoiceAiProps.userId({
+ required: false,
+ description: 'Only entries of this user. Use List Users to find it.',
+ }),
+ filterBy: Property.StaticDropdown({
+ displayName: 'Filter',
+ description:
+ 'Only entries in this period or billing status. Pick Custom Date with From Date and To Date. Empty = all entries.',
+ required: false,
+ options: {
+ disabled: false,
+ options: [
+ { label: 'All', value: 'Date.All' },
+ { label: 'Today', value: 'Date.Today' },
+ { label: 'This Week', value: 'Date.ThisWeek' },
+ { label: 'This Month', value: 'Date.ThisMonth' },
+ { label: 'This Quarter', value: 'Date.ThisQuarter' },
+ { label: 'This Year', value: 'Date.ThisYear' },
+ { label: 'Previous Day', value: 'Date.PreviousDay' },
+ { label: 'Previous Week', value: 'Date.PreviousWeek' },
+ { label: 'Previous Month', value: 'Date.PreviousMonth' },
+ { label: 'Previous Quarter', value: 'Date.PreviousQuarter' },
+ { label: 'Previous Year', value: 'Date.PreviousYear' },
+ { label: 'Custom Date', value: 'Date.CustomDate' },
+ { label: 'Unbilled', value: 'Status.Unbilled' },
+ { label: 'Invoiced', value: 'Status.Invoiced' },
+ ],
+ },
+ }),
+ fromDate: Property.ShortText({
+ displayName: 'From Date',
+ description: 'Only entries logged on or after this date, as yyyy-mm-dd.',
+ required: false,
+ }),
+ toDate: Property.ShortText({
+ displayName: 'To Date',
+ description: 'Only entries logged on or before this date, as yyyy-mm-dd.',
+ required: false,
+ }),
+ sortColumn: zohoInvoiceAiProps.sortColumn({
+ required: false,
+ description:
+ 'Field to sort by: project_name, task_name, user_name, log_date, timer_started_at or customer_name.',
+ }),
+ page: zohoInvoiceAiProps.page({ required: false }),
+ perPage: zohoInvoiceAiProps.perPage({ required: false }),
+ },
+ async run({ auth, propsValue }) {
+ return await zohoInvoiceApi.listTimeEntries({
+ auth,
+ organizationId: propsValue.organizationId,
+ projectId: propsValue.projectId,
+ userId: propsValue.userId,
+ filterBy: propsValue.filterBy,
+ fromDate: propsValue.fromDate,
+ toDate: propsValue.toDate,
+ sortColumn: propsValue.sortColumn,
+ page: propsValue.page,
+ perPage: propsValue.perPage,
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-invoice/src/lib/actions/ai/projects/start-timer.ts b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/projects/start-timer.ts
new file mode 100644
index 00000000000..e093feb34ed
--- /dev/null
+++ b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/projects/start-timer.ts
@@ -0,0 +1,32 @@
+import { createAction } from '@activepieces/pieces-framework';
+
+import { zohoInvoiceAuth } from '../../../auth';
+import { zohoInvoiceAiProps } from '../../../common/ai-props';
+import { zohoInvoiceApi } from '../../../common/api';
+import { zohoInvoiceTimeEntryOutputSchema } from '../../../output-schemas';
+
+export const startTimerAction = createAction({
+ auth: zohoInvoiceAuth,
+ name: 'zoho_invoice_start_timer',
+ outputSchema: zohoInvoiceTimeEntryOutputSchema,
+ displayName: 'Start Timer',
+ description: 'Starts the timer on an existing time entry.',
+ audience: 'ai',
+ classification: 'WRITE',
+ aiMetadata: {
+ description:
+ 'Starts (or resumes) the timer on an existing time entry of the current user. Use List Time Entries to find the ID, or Create Time Entry with Start Timer for a new one; stop it with Stop Timer.',
+ idempotent: false,
+ },
+ props: {
+ organizationId: zohoInvoiceAiProps.organizationId({ required: true }),
+ timeEntryId: zohoInvoiceAiProps.timeEntryId({ required: true }),
+ },
+ async run({ auth, propsValue }) {
+ return await zohoInvoiceApi.startTimeEntryTimer({
+ auth,
+ organizationId: propsValue.organizationId,
+ timeEntryId: propsValue.timeEntryId,
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-invoice/src/lib/actions/ai/projects/stop-timer.ts b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/projects/stop-timer.ts
new file mode 100644
index 00000000000..6c1847b04b1
--- /dev/null
+++ b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/projects/stop-timer.ts
@@ -0,0 +1,30 @@
+import { createAction } from '@activepieces/pieces-framework';
+
+import { zohoInvoiceAuth } from '../../../auth';
+import { zohoInvoiceAiProps } from '../../../common/ai-props';
+import { zohoInvoiceApi } from '../../../common/api';
+import { zohoInvoiceTimeEntryOutputSchema } from '../../../output-schemas';
+
+export const stopTimerAction = createAction({
+ auth: zohoInvoiceAuth,
+ name: 'zoho_invoice_stop_timer',
+ outputSchema: zohoInvoiceTimeEntryOutputSchema,
+ displayName: 'Stop Timer',
+ description: "Stops the current user's running timer.",
+ audience: 'ai',
+ classification: 'WRITE',
+ aiMetadata: {
+ description:
+ 'Stops the running timer of the connected user and saves the elapsed time on its time entry. Takes no ID: a user has at most one running timer, see Get Running Timer. Fails when no timer is running.',
+ idempotent: true,
+ },
+ props: {
+ organizationId: zohoInvoiceAiProps.organizationId({ required: true }),
+ },
+ async run({ auth, propsValue }) {
+ return await zohoInvoiceApi.stopTimeEntryTimer({
+ auth,
+ organizationId: propsValue.organizationId,
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-invoice/src/lib/actions/ai/projects/update-project-user.ts b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/projects/update-project-user.ts
new file mode 100644
index 00000000000..0aa92beb8c1
--- /dev/null
+++ b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/projects/update-project-user.ts
@@ -0,0 +1,66 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoInvoiceAuth } from '../../../auth';
+import { zohoInvoiceAiProps } from '../../../common/ai-props';
+import { zohoInvoiceApi } from '../../../common/api';
+import { zohoInvoiceUtils } from '../../../common/utils';
+import { zohoInvoiceGetProjectUserOutputSchema } from '../../../output-schemas';
+
+export const updateProjectUserAction = createAction({
+ auth: zohoInvoiceAuth,
+ name: 'zoho_invoice_update_project_user',
+ outputSchema: zohoInvoiceGetProjectUserOutputSchema,
+ displayName: 'Update Project User',
+ description: "Changes a project user's role, rate or budget hours.",
+ audience: 'ai',
+ classification: 'WRITE',
+ aiMetadata: {
+ description:
+ "Changes a user's role, hourly rate or budget hours on one project. Fields left empty are not sent. Use List Projects for the project ID and List Project Users for the user ID.",
+ idempotent: true,
+ },
+ props: {
+ organizationId: zohoInvoiceAiProps.organizationId({ required: true }),
+ projectId: zohoInvoiceAiProps.projectId({ required: true }),
+ userId: zohoInvoiceAiProps.userId({
+ required: true,
+ description: 'User ID. Use List Project Users to find it.',
+ }),
+ userRole: Property.StaticDropdown({
+ displayName: 'Role',
+ description: 'New role on the project. Empty = unchanged.',
+ required: false,
+ options: {
+ disabled: false,
+ options: [
+ { label: 'Staff', value: 'staff' },
+ { label: 'Admin', value: 'admin' },
+ { label: 'Timesheet staff', value: 'timesheetstaff' },
+ ],
+ },
+ }),
+ rate: Property.Number({
+ displayName: 'Rate',
+ description: 'New hourly rate. Empty = unchanged.',
+ required: false,
+ }),
+ budgetHours: Property.Number({
+ displayName: 'Budget Hours',
+ description: 'New planned hours. Empty = unchanged.',
+ required: false,
+ }),
+ },
+ async run({ auth, propsValue }) {
+ return await zohoInvoiceApi.updateProjectUser({
+ auth,
+ organizationId: propsValue.organizationId,
+ projectId: propsValue.projectId,
+ userId: propsValue.userId,
+ body: zohoInvoiceUtils.compact({
+ user_role: propsValue.userRole,
+ rate: propsValue.rate,
+ budget_hours: propsValue.budgetHours,
+ }),
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-invoice/src/lib/actions/ai/projects/update-project.ts b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/projects/update-project.ts
new file mode 100644
index 00000000000..ecb75d1e595
--- /dev/null
+++ b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/projects/update-project.ts
@@ -0,0 +1,123 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoInvoiceAuth } from '../../../auth';
+import { zohoInvoiceAiProps } from '../../../common/ai-props';
+import { zohoInvoiceApi } from '../../../common/api';
+import { zohoInvoiceUtils } from '../../../common/utils';
+import { zohoInvoiceProjectOutputSchema } from '../../../output-schemas';
+
+export const updateProjectAction = createAction({
+ auth: zohoInvoiceAuth,
+ name: 'zoho_invoice_update_project',
+ outputSchema: zohoInvoiceProjectOutputSchema,
+ displayName: 'Update Project',
+ description: "Changes a project's name, customer, billing method or budget.",
+ audience: 'ai',
+ classification: 'WRITE',
+ aiMetadata: {
+ description:
+ "Changes a project's name, customer, description, billing method, rate or budget. Fields left empty keep their current value. Use List Projects to find the ID; use Create Task to add tasks.",
+ idempotent: true,
+ },
+ props: {
+ organizationId: zohoInvoiceAiProps.organizationId({ required: true }),
+ projectId: zohoInvoiceAiProps.projectId({ required: true }),
+ projectName: Property.ShortText({
+ displayName: 'Project Name',
+ description: 'New project name (max 100 characters). Empty = unchanged.',
+ required: false,
+ }),
+ customerId: zohoInvoiceAiProps.contactId({
+ required: false,
+ description: 'New customer ID. Use List Contacts to find it. Empty = unchanged.',
+ }),
+ billingType: Property.StaticDropdown({
+ displayName: 'Billing Method',
+ description: 'New billing method. Empty = unchanged.',
+ required: false,
+ options: {
+ disabled: false,
+ options: [
+ { label: 'Fixed cost for project', value: 'fixed_cost_for_project' },
+ { label: 'Based on project hours', value: 'based_on_project_hours' },
+ { label: 'Based on staff hours', value: 'based_on_staff_hours' },
+ { label: 'Based on task hours', value: 'based_on_task_hours' },
+ ],
+ },
+ }),
+ userId: zohoInvoiceAiProps.userId({
+ required: false,
+ description:
+ 'ID of a user on the project. Use List Project Users to find it. Empty = the first current project user.',
+ }),
+ description: Property.LongText({
+ displayName: 'Description',
+ description: 'New project description. Empty = unchanged.',
+ required: false,
+ }),
+ rate: Property.Number({
+ displayName: 'Rate',
+ description:
+ 'Total project cost for "Fixed cost for project", or the hourly rate for "Based on project hours". Empty = unchanged.',
+ required: false,
+ }),
+ budgetType: Property.StaticDropdown({
+ displayName: 'Budget Type',
+ description: 'New budget type. Empty = unchanged.',
+ required: false,
+ options: {
+ disabled: false,
+ options: [
+ { label: 'Total project cost', value: 'total_project_cost' },
+ { label: 'Total project hours', value: 'total_project_hours' },
+ { label: 'Hours per task', value: 'hours_per_task' },
+ { label: 'Hours per staff', value: 'hours_per_staff' },
+ ],
+ },
+ }),
+ budgetHours: Property.Number({
+ displayName: 'Budget Hours',
+ description: 'Planned hours, for the "Total project hours" budget type. Empty = unchanged.',
+ required: false,
+ }),
+ budgetAmount: Property.Number({
+ displayName: 'Budget Amount',
+ description:
+ 'Planned budget amount, for the "Total project cost" budget type. Empty = unchanged.',
+ required: false,
+ }),
+ additionalFields: zohoInvoiceAiProps.additionalFields({ required: false }),
+ },
+ async run({ auth, propsValue }) {
+ const { organizationId, projectId } = propsValue;
+ const current = await zohoInvoiceApi.getProject({ auth, organizationId, projectId });
+ return await zohoInvoiceApi.updateProject({
+ auth,
+ organizationId,
+ projectId,
+ body: {
+ ...zohoInvoiceUtils.compact({
+ project_name: current.project?.project_name,
+ customer_id: current.project?.customer_id,
+ billing_type: current.project?.billing_type,
+ user_id: current.project?.users?.[0]?.user_id,
+ description: current.project?.description,
+ rate: current.project?.rate,
+ budget_type: current.project?.budget_type,
+ }),
+ ...(propsValue.additionalFields ?? {}),
+ ...zohoInvoiceUtils.compact({
+ project_name: propsValue.projectName,
+ customer_id: propsValue.customerId,
+ billing_type: propsValue.billingType,
+ user_id: propsValue.userId,
+ description: propsValue.description,
+ rate: propsValue.rate,
+ budget_type: propsValue.budgetType,
+ budget_hours: propsValue.budgetHours,
+ budget_amount: propsValue.budgetAmount,
+ }),
+ },
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-invoice/src/lib/actions/ai/projects/update-task.ts b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/projects/update-task.ts
new file mode 100644
index 00000000000..e2b15a44058
--- /dev/null
+++ b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/projects/update-task.ts
@@ -0,0 +1,68 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoInvoiceAuth } from '../../../auth';
+import { zohoInvoiceAiProps } from '../../../common/ai-props';
+import { zohoInvoiceApi } from '../../../common/api';
+import { zohoInvoiceUtils } from '../../../common/utils';
+import { zohoInvoiceTaskOutputSchema } from '../../../output-schemas';
+
+export const updateTaskAction = createAction({
+ auth: zohoInvoiceAuth,
+ name: 'zoho_invoice_update_task',
+ outputSchema: zohoInvoiceTaskOutputSchema,
+ displayName: 'Update Task',
+ description: "Changes a project task's name, description, rate or budget hours.",
+ audience: 'ai',
+ classification: 'WRITE',
+ aiMetadata: {
+ description:
+ "Changes a project task's name, description, rate or budget hours. Fields left empty keep their current value. Use List Projects for the project ID and List Tasks for the task ID.",
+ idempotent: true,
+ },
+ props: {
+ organizationId: zohoInvoiceAiProps.organizationId({ required: true }),
+ projectId: zohoInvoiceAiProps.projectId({ required: true }),
+ taskId: zohoInvoiceAiProps.taskId({ required: true }),
+ taskName: Property.ShortText({
+ displayName: 'Task Name',
+ description: 'New task name. Empty = unchanged.',
+ required: false,
+ }),
+ description: Property.LongText({
+ displayName: 'Description',
+ description: 'New task description. Empty = unchanged.',
+ required: false,
+ }),
+ rate: Property.Number({
+ displayName: 'Rate',
+ description: 'New hourly rate. Empty = unchanged.',
+ required: false,
+ }),
+ budgetHours: Property.Number({
+ displayName: 'Budget Hours',
+ description: 'New planned hours. Empty = unchanged.',
+ required: false,
+ }),
+ },
+ async run({ auth, propsValue }) {
+ const { organizationId, projectId, taskId } = propsValue;
+ const current = await zohoInvoiceApi.getProjectTask({
+ auth,
+ organizationId,
+ projectId,
+ taskId,
+ });
+ return await zohoInvoiceApi.updateProjectTask({
+ auth,
+ organizationId,
+ projectId,
+ taskId,
+ body: zohoInvoiceUtils.compact({
+ task_name: propsValue.taskName ?? current.task?.task_name,
+ description: propsValue.description ?? current.task?.description,
+ rate: propsValue.rate ?? current.task?.rate,
+ budget_hours: propsValue.budgetHours,
+ }),
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-invoice/src/lib/actions/ai/projects/update-time-entry.ts b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/projects/update-time-entry.ts
new file mode 100644
index 00000000000..6da274f8ef3
--- /dev/null
+++ b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/projects/update-time-entry.ts
@@ -0,0 +1,96 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoInvoiceAuth } from '../../../auth';
+import { zohoInvoiceAiProps } from '../../../common/ai-props';
+import { zohoInvoiceApi } from '../../../common/api';
+import { zohoInvoiceUtils } from '../../../common/utils';
+import { zohoInvoiceTimeEntryOutputSchema } from '../../../output-schemas';
+
+export const updateTimeEntryAction = createAction({
+ auth: zohoInvoiceAuth,
+ name: 'zoho_invoice_update_time_entry',
+ outputSchema: zohoInvoiceTimeEntryOutputSchema,
+ displayName: 'Update Time Entry',
+ description: "Changes a time entry's task, user, date, duration or notes.",
+ audience: 'ai',
+ classification: 'WRITE',
+ aiMetadata: {
+ description:
+ "Changes a time entry's project, task, user, date, duration, billable flag or notes. Fields left empty keep their current value. Use List Time Entries to find the ID; an invoiced entry may be locked.",
+ idempotent: true,
+ },
+ props: {
+ organizationId: zohoInvoiceAiProps.organizationId({ required: true }),
+ timeEntryId: zohoInvoiceAiProps.timeEntryId({ required: true }),
+ projectId: zohoInvoiceAiProps.projectId({
+ required: false,
+ description: 'New project ID. Use List Projects to find it. Empty = unchanged.',
+ }),
+ taskId: zohoInvoiceAiProps.taskId({
+ required: false,
+ description: 'New task ID. Use List Tasks to find it. Empty = unchanged.',
+ }),
+ userId: zohoInvoiceAiProps.userId({
+ required: false,
+ description: 'New user ID. Use List Project Users to find it. Empty = unchanged.',
+ }),
+ logDate: Property.ShortText({
+ displayName: 'Date',
+ description: 'New day the time was spent, as yyyy-mm-dd. Empty = unchanged.',
+ required: false,
+ }),
+ logTime: Property.ShortText({
+ displayName: 'Duration',
+ description:
+ 'New time spent, as HH:mm. Empty = unchanged unless Begin Time or End Time is set.',
+ required: false,
+ }),
+ beginTime: Property.ShortText({
+ displayName: 'Begin Time',
+ description: 'New start time, as HH:mm. Empty = unchanged.',
+ required: false,
+ }),
+ endTime: Property.ShortText({
+ displayName: 'End Time',
+ description: 'New end time, as HH:mm. Empty = unchanged.',
+ required: false,
+ }),
+ isBillable: zohoInvoiceAiProps.yesNo({
+ required: false,
+ displayName: 'Billable',
+ description: 'Whether the time can be billed to the customer. Empty = unchanged.',
+ }),
+ notes: Property.LongText({
+ displayName: 'Notes',
+ description: 'New notes. Empty = unchanged.',
+ required: false,
+ }),
+ },
+ async run({ auth, propsValue }) {
+ const { organizationId, timeEntryId } = propsValue;
+ const current = await zohoInvoiceApi.getTimeEntry({ auth, organizationId, timeEntryId });
+ const entry = current.time_entry;
+ const timeGiven =
+ propsValue.logTime !== undefined ||
+ propsValue.beginTime !== undefined ||
+ propsValue.endTime !== undefined;
+ return await zohoInvoiceApi.updateTimeEntry({
+ auth,
+ organizationId,
+ timeEntryId,
+ body: zohoInvoiceUtils.compact({
+ project_id: propsValue.projectId ?? entry?.project_id,
+ task_id: propsValue.taskId ?? entry?.task_id,
+ user_id: propsValue.userId ?? entry?.user_id,
+ log_date: propsValue.logDate ?? entry?.log_date,
+ log_time: timeGiven ? propsValue.logTime : entry?.log_time,
+ begin_time: propsValue.beginTime,
+ end_time: propsValue.endTime,
+ is_billable:
+ zohoInvoiceUtils.toOptionalBoolean({ value: propsValue.isBillable }) ??
+ entry?.is_billable,
+ notes: propsValue.notes ?? entry?.notes,
+ }),
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-invoice/src/lib/actions/ai/recurring-invoices/create-recurring-invoice.ts b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/recurring-invoices/create-recurring-invoice.ts
new file mode 100644
index 00000000000..ef04e7715c4
--- /dev/null
+++ b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/recurring-invoices/create-recurring-invoice.ts
@@ -0,0 +1,118 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoInvoiceAuth } from '../../../auth';
+import { zohoInvoiceAiProps } from '../../../common/ai-props';
+import { zohoInvoiceApi } from '../../../common/api';
+import { zohoInvoiceUtils } from '../../../common/utils';
+import { zohoInvoiceRecurringInvoiceOutputSchema } from '../../../output-schemas';
+
+export const createRecurringInvoiceAction = createAction({
+ auth: zohoInvoiceAuth,
+ name: 'zoho_invoice_create_recurring_invoice',
+ outputSchema: zohoInvoiceRecurringInvoiceOutputSchema,
+ displayName: 'Create Recurring Invoice',
+ description: 'Creates a recurring invoice profile that generates invoices on a schedule.',
+ audience: 'ai',
+ classification: 'WRITE',
+ aiMetadata: {
+ description:
+ 'Creates a recurring invoice profile for a customer that generates a new invoice every N days, weeks, months or years from the start date. Use List Contacts for the customer ID and List Items for item IDs. Not idempotent: each call creates another profile.',
+ idempotent: false,
+ },
+ props: {
+ organizationId: zohoInvoiceAiProps.organizationId({ required: true }),
+ recurrenceName: Property.ShortText({
+ displayName: 'Profile Name',
+ description: 'Unique name of the recurring invoice profile.',
+ required: true,
+ }),
+ customerId: zohoInvoiceAiProps.contactId({
+ required: true,
+ displayName: 'Customer ID',
+ description: 'Customer contact ID. Use List Contacts to find it.',
+ }),
+ recurrenceFrequency: Property.StaticDropdown({
+ displayName: 'Frequency',
+ description: 'Unit of the interval between generated invoices.',
+ required: true,
+ options: {
+ disabled: false,
+ options: [
+ { label: 'Days', value: 'days' },
+ { label: 'Weeks', value: 'weeks' },
+ { label: 'Months', value: 'months' },
+ { label: 'Years', value: 'years' },
+ ],
+ },
+ }),
+ repeatEvery: Property.Number({
+ displayName: 'Repeat Every',
+ description:
+ 'Number of frequency units between invoices, e.g. 2 with Weeks = every 2 weeks. Empty = 1.',
+ required: false,
+ }),
+ startDate: Property.ShortText({
+ displayName: 'Start Date',
+ description: 'Date of the first invoice, as yyyy-mm-dd. Empty = today.',
+ required: false,
+ }),
+ endDate: Property.ShortText({
+ displayName: 'End Date',
+ description:
+ 'Date after which no more invoices are generated, as yyyy-mm-dd. Empty = never ends.',
+ required: false,
+ }),
+ referenceNumber: Property.ShortText({
+ displayName: 'Reference Number',
+ description: 'Reference number such as a purchase order number.',
+ required: false,
+ }),
+ lineItems: Property.Array({
+ displayName: 'Line Items',
+ description:
+ 'Lines of each generated invoice. Give an Item ID, or a Name and Rate for an ad-hoc line.',
+ required: true,
+ properties: {
+ itemId: Property.ShortText({
+ displayName: 'Item ID',
+ description: 'Item ID. Use List Items to find it.',
+ required: false,
+ }),
+ name: Property.ShortText({ displayName: 'Name', required: false }),
+ description: Property.LongText({ displayName: 'Description', required: false }),
+ rate: Property.Number({ displayName: 'Rate', required: false }),
+ quantity: Property.Number({ displayName: 'Quantity', required: false }),
+ discount: Property.ShortText({
+ displayName: 'Discount',
+ description: 'Flat amount, or a percentage such as "10%".',
+ required: false,
+ }),
+ taxId: Property.ShortText({
+ displayName: 'Tax ID',
+ description: 'Tax ID. Use List Taxes to find it.',
+ required: false,
+ }),
+ },
+ }),
+ additionalFields: zohoInvoiceAiProps.additionalFields({ required: false }),
+ },
+ async run({ auth, propsValue }) {
+ return await zohoInvoiceApi.createRecurringInvoice({
+ auth,
+ organizationId: propsValue.organizationId,
+ body: {
+ ...(propsValue.additionalFields ?? {}),
+ ...zohoInvoiceUtils.compact({
+ recurrence_name: propsValue.recurrenceName,
+ customer_id: propsValue.customerId,
+ recurrence_frequency: propsValue.recurrenceFrequency,
+ repeat_every: propsValue.repeatEvery,
+ start_date: propsValue.startDate,
+ end_date: propsValue.endDate,
+ reference_number: propsValue.referenceNumber,
+ line_items: zohoInvoiceUtils.toLineItems({ rows: propsValue.lineItems }),
+ }),
+ },
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-invoice/src/lib/actions/ai/recurring-invoices/delete-recurring-invoice.ts b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/recurring-invoices/delete-recurring-invoice.ts
new file mode 100644
index 00000000000..1e9432af242
--- /dev/null
+++ b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/recurring-invoices/delete-recurring-invoice.ts
@@ -0,0 +1,32 @@
+import { createAction } from '@activepieces/pieces-framework';
+
+import { zohoInvoiceAuth } from '../../../auth';
+import { zohoInvoiceAiProps } from '../../../common/ai-props';
+import { zohoInvoiceApi } from '../../../common/api';
+import { zohoInvoiceMessageOutputSchema } from '../../../output-schemas';
+
+export const deleteRecurringInvoiceAction = createAction({
+ auth: zohoInvoiceAuth,
+ name: 'zoho_invoice_delete_recurring_invoice',
+ outputSchema: zohoInvoiceMessageOutputSchema,
+ displayName: 'Delete Recurring Invoice',
+ description: 'Deletes a recurring invoice profile.',
+ audience: 'ai',
+ classification: 'DESTRUCTIVE',
+ aiMetadata: {
+ description:
+ 'Permanently deletes a recurring invoice profile so no more invoices are generated from it; invoices already created stay. Use Stop Recurring Invoice instead to pause it. Use List Recurring Invoices to find the ID. Cannot be undone.',
+ idempotent: false,
+ },
+ props: {
+ organizationId: zohoInvoiceAiProps.organizationId({ required: true }),
+ recurringInvoiceId: zohoInvoiceAiProps.recurringInvoiceId({ required: true }),
+ },
+ async run({ auth, propsValue }) {
+ return await zohoInvoiceApi.deleteRecurringInvoice({
+ auth,
+ organizationId: propsValue.organizationId,
+ recurringInvoiceId: propsValue.recurringInvoiceId,
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-invoice/src/lib/actions/ai/recurring-invoices/get-recurring-invoice.ts b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/recurring-invoices/get-recurring-invoice.ts
new file mode 100644
index 00000000000..46b737e1a85
--- /dev/null
+++ b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/recurring-invoices/get-recurring-invoice.ts
@@ -0,0 +1,32 @@
+import { createAction } from '@activepieces/pieces-framework';
+
+import { zohoInvoiceAuth } from '../../../auth';
+import { zohoInvoiceAiProps } from '../../../common/ai-props';
+import { zohoInvoiceApi } from '../../../common/api';
+import { zohoInvoiceRecurringInvoiceOutputSchema } from '../../../output-schemas';
+
+export const getRecurringInvoiceAction = createAction({
+ auth: zohoInvoiceAuth,
+ name: 'zoho_invoice_get_recurring_invoice',
+ outputSchema: zohoInvoiceRecurringInvoiceOutputSchema,
+ displayName: 'Get Recurring Invoice',
+ description: 'Gets one recurring invoice profile.',
+ audience: 'ai',
+ classification: 'READ',
+ aiMetadata: {
+ description:
+ 'Returns one recurring invoice profile by ID: customer, frequency, start and end dates, status, line items and totals. Use List Recurring Invoices to find the ID.',
+ idempotent: true,
+ },
+ props: {
+ organizationId: zohoInvoiceAiProps.organizationId({ required: true }),
+ recurringInvoiceId: zohoInvoiceAiProps.recurringInvoiceId({ required: true }),
+ },
+ async run({ auth, propsValue }) {
+ return await zohoInvoiceApi.getRecurringInvoice({
+ auth,
+ organizationId: propsValue.organizationId,
+ recurringInvoiceId: propsValue.recurringInvoiceId,
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-invoice/src/lib/actions/ai/recurring-invoices/list-recurring-invoice-history.ts b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/recurring-invoices/list-recurring-invoice-history.ts
new file mode 100644
index 00000000000..0fa0a52ecc5
--- /dev/null
+++ b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/recurring-invoices/list-recurring-invoice-history.ts
@@ -0,0 +1,32 @@
+import { createAction } from '@activepieces/pieces-framework';
+
+import { zohoInvoiceAuth } from '../../../auth';
+import { zohoInvoiceAiProps } from '../../../common/ai-props';
+import { zohoInvoiceApi } from '../../../common/api';
+import { zohoInvoiceListRecurringInvoiceHistoryOutputSchema } from '../../../output-schemas';
+
+export const listRecurringInvoiceHistoryAction = createAction({
+ auth: zohoInvoiceAuth,
+ name: 'zoho_invoice_list_recurring_invoice_history',
+ outputSchema: zohoInvoiceListRecurringInvoiceHistoryOutputSchema,
+ displayName: 'List Recurring Invoice History',
+ description: 'Lists the comments and history of a recurring invoice profile.',
+ audience: 'ai',
+ classification: 'SEARCH',
+ aiMetadata: {
+ description:
+ 'Lists the comments and activity history of one recurring invoice profile. Use List Recurring Invoices to find the ID.',
+ idempotent: true,
+ },
+ props: {
+ organizationId: zohoInvoiceAiProps.organizationId({ required: true }),
+ recurringInvoiceId: zohoInvoiceAiProps.recurringInvoiceId({ required: true }),
+ },
+ async run({ auth, propsValue }) {
+ return await zohoInvoiceApi.listRecurringInvoiceHistory({
+ auth,
+ organizationId: propsValue.organizationId,
+ recurringInvoiceId: propsValue.recurringInvoiceId,
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-invoice/src/lib/actions/ai/recurring-invoices/list-recurring-invoices.ts b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/recurring-invoices/list-recurring-invoices.ts
new file mode 100644
index 00000000000..eeb308d6d90
--- /dev/null
+++ b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/recurring-invoices/list-recurring-invoices.ts
@@ -0,0 +1,56 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoInvoiceAuth } from '../../../auth';
+import { zohoInvoiceAiProps } from '../../../common/ai-props';
+import { zohoInvoiceApi } from '../../../common/api';
+import { zohoInvoiceListRecurringInvoicesOutputSchema } from '../../../output-schemas';
+
+export const listRecurringInvoicesAction = createAction({
+ auth: zohoInvoiceAuth,
+ name: 'zoho_invoice_list_recurring_invoices',
+ outputSchema: zohoInvoiceListRecurringInvoicesOutputSchema,
+ displayName: 'List Recurring Invoices',
+ description: 'Lists recurring invoice profiles.',
+ audience: 'ai',
+ classification: 'SEARCH',
+ aiMetadata: {
+ description:
+ 'Lists recurring invoice profiles with recurring_invoice_id, name, customer, frequency, status and next invoice date, one page at a time. Filter by status or search by customer name or reference.',
+ idempotent: true,
+ },
+ props: {
+ organizationId: zohoInvoiceAiProps.organizationId({ required: true }),
+ filterBy: Property.StaticDropdown({
+ displayName: 'Status',
+ description: 'Only profiles with this status. Empty = all profiles.',
+ required: false,
+ options: {
+ disabled: false,
+ options: [
+ { label: 'All', value: 'Status.All' },
+ { label: 'Active', value: 'Status.Active' },
+ { label: 'Stopped', value: 'Status.Stopped' },
+ { label: 'Expired', value: 'Status.Expired' },
+ ],
+ },
+ }),
+ searchText: zohoInvoiceAiProps.searchText({
+ required: false,
+ description: 'Search by invoice number, purchase order or customer name.',
+ }),
+ sortColumn: zohoInvoiceAiProps.sortColumn({ required: false }),
+ page: zohoInvoiceAiProps.page({ required: false }),
+ perPage: zohoInvoiceAiProps.perPage({ required: false }),
+ },
+ async run({ auth, propsValue }) {
+ return await zohoInvoiceApi.listRecurringInvoices({
+ auth,
+ organizationId: propsValue.organizationId,
+ filterBy: propsValue.filterBy,
+ searchText: propsValue.searchText,
+ sortColumn: propsValue.sortColumn,
+ page: propsValue.page,
+ perPage: propsValue.perPage,
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-invoice/src/lib/actions/ai/recurring-invoices/resume-recurring-invoice.ts b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/recurring-invoices/resume-recurring-invoice.ts
new file mode 100644
index 00000000000..4789733b1ce
--- /dev/null
+++ b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/recurring-invoices/resume-recurring-invoice.ts
@@ -0,0 +1,32 @@
+import { createAction } from '@activepieces/pieces-framework';
+
+import { zohoInvoiceAuth } from '../../../auth';
+import { zohoInvoiceAiProps } from '../../../common/ai-props';
+import { zohoInvoiceApi } from '../../../common/api';
+import { zohoInvoiceMessageWithDataOutputSchema } from '../../../output-schemas';
+
+export const resumeRecurringInvoiceAction = createAction({
+ auth: zohoInvoiceAuth,
+ name: 'zoho_invoice_resume_recurring_invoice',
+ outputSchema: zohoInvoiceMessageWithDataOutputSchema,
+ displayName: 'Resume Recurring Invoice',
+ description: 'Resumes a stopped recurring invoice profile.',
+ audience: 'ai',
+ classification: 'WRITE',
+ aiMetadata: {
+ description:
+ 'Resumes a stopped recurring invoice profile so it generates invoices again on its schedule. Use List Recurring Invoices to find the ID.',
+ idempotent: true,
+ },
+ props: {
+ organizationId: zohoInvoiceAiProps.organizationId({ required: true }),
+ recurringInvoiceId: zohoInvoiceAiProps.recurringInvoiceId({ required: true }),
+ },
+ async run({ auth, propsValue }) {
+ return await zohoInvoiceApi.resumeRecurringInvoice({
+ auth,
+ organizationId: propsValue.organizationId,
+ recurringInvoiceId: propsValue.recurringInvoiceId,
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-invoice/src/lib/actions/ai/recurring-invoices/stop-recurring-invoice.ts b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/recurring-invoices/stop-recurring-invoice.ts
new file mode 100644
index 00000000000..ffe9d8c696e
--- /dev/null
+++ b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/recurring-invoices/stop-recurring-invoice.ts
@@ -0,0 +1,32 @@
+import { createAction } from '@activepieces/pieces-framework';
+
+import { zohoInvoiceAuth } from '../../../auth';
+import { zohoInvoiceAiProps } from '../../../common/ai-props';
+import { zohoInvoiceApi } from '../../../common/api';
+import { zohoInvoiceMessageWithDataOutputSchema } from '../../../output-schemas';
+
+export const stopRecurringInvoiceAction = createAction({
+ auth: zohoInvoiceAuth,
+ name: 'zoho_invoice_stop_recurring_invoice',
+ outputSchema: zohoInvoiceMessageWithDataOutputSchema,
+ displayName: 'Stop Recurring Invoice',
+ description: 'Stops a recurring invoice profile.',
+ audience: 'ai',
+ classification: 'WRITE',
+ aiMetadata: {
+ description:
+ 'Stops an active recurring invoice profile so it no longer generates invoices; it can be restarted with Resume Recurring Invoice. Use List Recurring Invoices to find the ID.',
+ idempotent: true,
+ },
+ props: {
+ organizationId: zohoInvoiceAiProps.organizationId({ required: true }),
+ recurringInvoiceId: zohoInvoiceAiProps.recurringInvoiceId({ required: true }),
+ },
+ async run({ auth, propsValue }) {
+ return await zohoInvoiceApi.stopRecurringInvoice({
+ auth,
+ organizationId: propsValue.organizationId,
+ recurringInvoiceId: propsValue.recurringInvoiceId,
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-invoice/src/lib/actions/ai/recurring-invoices/update-recurring-invoice.ts b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/recurring-invoices/update-recurring-invoice.ts
new file mode 100644
index 00000000000..baaba4ea405
--- /dev/null
+++ b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/recurring-invoices/update-recurring-invoice.ts
@@ -0,0 +1,159 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoInvoiceAuth } from '../../../auth';
+import { zohoInvoiceAiProps } from '../../../common/ai-props';
+import { zohoInvoiceApi } from '../../../common/api';
+import { zohoInvoiceUtils } from '../../../common/utils';
+import { zohoInvoiceRecurringInvoiceOutputSchema } from '../../../output-schemas';
+
+import type { ZohoInvoiceDocumentLineItem } from '../../../common/api/recurring-invoices';
+
+export const updateRecurringInvoiceAction = createAction({
+ auth: zohoInvoiceAuth,
+ name: 'zoho_invoice_update_recurring_invoice',
+ outputSchema: zohoInvoiceRecurringInvoiceOutputSchema,
+ displayName: 'Update Recurring Invoice',
+ description: 'Changes a recurring invoice profile.',
+ audience: 'ai',
+ classification: 'WRITE',
+ aiMetadata: {
+ description:
+ 'Changes a recurring invoice profile: name, customer, schedule, reference or line items. Fields left empty keep their current value; Line Items, when given, replace all current lines (pass Line Item ID to keep an existing line). Use List Recurring Invoices to find the ID.',
+ idempotent: true,
+ },
+ props: {
+ organizationId: zohoInvoiceAiProps.organizationId({ required: true }),
+ recurringInvoiceId: zohoInvoiceAiProps.recurringInvoiceId({ required: true }),
+ recurrenceName: Property.ShortText({
+ displayName: 'Profile Name',
+ description: 'New profile name. Empty = unchanged.',
+ required: false,
+ }),
+ customerId: zohoInvoiceAiProps.contactId({
+ required: false,
+ displayName: 'Customer ID',
+ description: 'New customer contact ID. Use List Contacts to find it. Empty = unchanged.',
+ }),
+ recurrenceFrequency: Property.StaticDropdown({
+ displayName: 'Frequency',
+ description: 'New unit of the interval between generated invoices. Empty = unchanged.',
+ required: false,
+ options: {
+ disabled: false,
+ options: [
+ { label: 'Days', value: 'days' },
+ { label: 'Weeks', value: 'weeks' },
+ { label: 'Months', value: 'months' },
+ { label: 'Years', value: 'years' },
+ ],
+ },
+ }),
+ repeatEvery: Property.Number({
+ displayName: 'Repeat Every',
+ description: 'New number of frequency units between invoices. Empty = unchanged.',
+ required: false,
+ }),
+ startDate: Property.ShortText({
+ displayName: 'Start Date',
+ description: 'New start date, as yyyy-mm-dd. Empty = unchanged.',
+ required: false,
+ }),
+ endDate: Property.ShortText({
+ displayName: 'End Date',
+ description: 'New end date, as yyyy-mm-dd. Empty = unchanged.',
+ required: false,
+ }),
+ referenceNumber: Property.ShortText({
+ displayName: 'Reference Number',
+ description: 'New reference number. Empty = unchanged.',
+ required: false,
+ }),
+ lineItems: Property.Array({
+ displayName: 'Line Items',
+ description:
+ 'Full new list of lines; replaces the current ones. Include Line Item ID (from Get Recurring Invoice) to update an existing line. Empty = lines unchanged.',
+ required: false,
+ properties: {
+ lineItemId: Property.ShortText({
+ displayName: 'Line Item ID',
+ description:
+ 'ID of an existing line to update. Use Get Recurring Invoice to find it. Empty = new line.',
+ required: false,
+ }),
+ itemId: Property.ShortText({
+ displayName: 'Item ID',
+ description: 'Item ID. Use List Items to find it.',
+ required: false,
+ }),
+ name: Property.ShortText({ displayName: 'Name', required: false }),
+ description: Property.LongText({ displayName: 'Description', required: false }),
+ rate: Property.Number({ displayName: 'Rate', required: false }),
+ quantity: Property.Number({ displayName: 'Quantity', required: false }),
+ discount: Property.ShortText({
+ displayName: 'Discount',
+ description: 'Flat amount, or a percentage such as "10%".',
+ required: false,
+ }),
+ taxId: Property.ShortText({
+ displayName: 'Tax ID',
+ description: 'Tax ID. Use List Taxes to find it.',
+ required: false,
+ }),
+ },
+ }),
+ additionalFields: zohoInvoiceAiProps.additionalFields({ required: false }),
+ },
+ async run({ auth, propsValue }) {
+ const { organizationId, recurringInvoiceId } = propsValue;
+ const current = await zohoInvoiceApi.getRecurringInvoice({
+ auth,
+ organizationId,
+ recurringInvoiceId,
+ });
+ const profile = current.recurring_invoice;
+ return await zohoInvoiceApi.updateRecurringInvoice({
+ auth,
+ organizationId,
+ recurringInvoiceId,
+ body: {
+ ...zohoInvoiceUtils.compact({
+ recurrence_name: profile?.recurrence_name,
+ customer_id: profile?.customer_id,
+ recurrence_frequency: profile?.recurrence_frequency,
+ repeat_every: profile?.repeat_every,
+ line_items: toCurrentLineItems({ lines: profile?.line_items }),
+ }),
+ ...(propsValue.additionalFields ?? {}),
+ ...zohoInvoiceUtils.compact({
+ recurrence_name: propsValue.recurrenceName,
+ customer_id: propsValue.customerId,
+ recurrence_frequency: propsValue.recurrenceFrequency,
+ repeat_every: propsValue.repeatEvery,
+ start_date: propsValue.startDate,
+ end_date: propsValue.endDate,
+ reference_number: propsValue.referenceNumber,
+ line_items: zohoInvoiceUtils.toLineItems({ rows: propsValue.lineItems }),
+ }),
+ },
+ });
+ },
+});
+
+function toCurrentLineItems({
+ lines,
+}: {
+ lines: ZohoInvoiceDocumentLineItem[] | undefined;
+}): Record<string, unknown>[] | undefined {
+ return lines?.map((line) =>
+ zohoInvoiceUtils.compact({
+ line_item_id: line.line_item_id,
+ item_id: line.item_id,
+ name: line.name,
+ description: line.description,
+ rate: line.rate,
+ quantity: line.quantity,
+ discount: line.discount,
+ tax_id: line.tax_id,
+ }),
+ );
+}
diff --git a/packages/pieces/community/zoho-invoice/src/lib/actions/ai/settings/create-currency.ts b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/settings/create-currency.ts
new file mode 100644
index 00000000000..655848a10e1
--- /dev/null
+++ b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/settings/create-currency.ts
@@ -0,0 +1,62 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoInvoiceAuth } from '../../../auth';
+import { zohoInvoiceAiProps } from '../../../common/ai-props';
+import { zohoInvoiceApi } from '../../../common/api';
+import { zohoInvoiceUtils } from '../../../common/utils';
+import { zohoInvoiceCurrencyOutputSchema } from '../../../output-schemas';
+
+export const createCurrencyAction = createAction({
+ auth: zohoInvoiceAuth,
+ name: 'zoho_invoice_create_currency',
+ outputSchema: zohoInvoiceCurrencyOutputSchema,
+ displayName: 'Create Currency',
+ description: 'Adds a currency to a Zoho Invoice organization.',
+ audience: 'ai',
+ classification: 'WRITE',
+ aiMetadata: {
+ description:
+ 'Adds a foreign currency to the organization so it can be used on invoices and contacts. Needs the Admin role. Not idempotent: a currency code that already exists is rejected.',
+ idempotent: false,
+ },
+ props: {
+ organizationId: zohoInvoiceAiProps.organizationId({ required: true }),
+ currencyCode: Property.ShortText({
+ displayName: 'Currency Code',
+ description: 'ISO 4217 currency code, e.g. "EUR".',
+ required: true,
+ }),
+ currencySymbol: Property.ShortText({
+ displayName: 'Currency Symbol',
+ description: 'Symbol shown with amounts, e.g. "€".',
+ required: true,
+ }),
+ pricePrecision: Property.Number({
+ displayName: 'Price Precision',
+ description: 'Number of decimal places (0, 2 or 3). Empty = the vendor default.',
+ required: false,
+ }),
+ currencyFormat: Property.ShortText({
+ displayName: 'Currency Format',
+ description:
+ 'Number format: 1,234,567.89, 1.234.567,89, 1 234 567,89, 12,34,567.89 or 1234567.89 (Zoho requires one).',
+ required: true,
+ }),
+ additionalFields: zohoInvoiceAiProps.additionalFields({ required: false }),
+ },
+ async run({ auth, propsValue }) {
+ return await zohoInvoiceApi.createCurrency({
+ auth,
+ organizationId: propsValue.organizationId,
+ body: {
+ ...(propsValue.additionalFields ?? {}),
+ ...zohoInvoiceUtils.compact({
+ currency_code: propsValue.currencyCode,
+ currency_symbol: propsValue.currencySymbol,
+ price_precision: propsValue.pricePrecision,
+ currency_format: propsValue.currencyFormat,
+ }),
+ },
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-invoice/src/lib/actions/ai/settings/create-exchange-rate.ts b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/settings/create-exchange-rate.ts
new file mode 100644
index 00000000000..bac74639e36
--- /dev/null
+++ b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/settings/create-exchange-rate.ts
@@ -0,0 +1,51 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoInvoiceAuth } from '../../../auth';
+import { zohoInvoiceAiProps } from '../../../common/ai-props';
+import { zohoInvoiceApi } from '../../../common/api';
+import { zohoInvoiceUtils } from '../../../common/utils';
+import { zohoInvoiceExchangeRateOutputSchema } from '../../../output-schemas';
+
+export const createExchangeRateAction = createAction({
+ auth: zohoInvoiceAuth,
+ name: 'zoho_invoice_create_exchange_rate',
+ outputSchema: zohoInvoiceExchangeRateOutputSchema,
+ displayName: 'Create Exchange Rate',
+ description: 'Adds an exchange rate to a currency in Zoho Invoice.',
+ audience: 'ai',
+ classification: 'WRITE',
+ aiMetadata: {
+ description:
+ 'Adds an exchange rate (to the base currency) for a foreign currency, effective from a given date. Use List Currencies to find the currency ID. Needs the Admin role. Not idempotent.',
+ idempotent: false,
+ },
+ props: {
+ organizationId: zohoInvoiceAiProps.organizationId({ required: true }),
+ currencyId: zohoInvoiceAiProps.currencyId({ required: true }),
+ rate: Property.Number({
+ displayName: 'Rate',
+ description: 'Value of one unit of this currency in the base currency.',
+ required: true,
+ }),
+ effectiveDate: Property.ShortText({
+ displayName: 'Effective Date',
+ description: 'Date the rate applies from, as yyyy-mm-dd.',
+ required: true,
+ }),
+ additionalFields: zohoInvoiceAiProps.additionalFields({ required: false }),
+ },
+ async run({ auth, propsValue }) {
+ return await zohoInvoiceApi.createExchangeRate({
+ auth,
+ organizationId: propsValue.organizationId,
+ currencyId: propsValue.currencyId,
+ body: {
+ ...(propsValue.additionalFields ?? {}),
+ ...zohoInvoiceUtils.compact({
+ rate: propsValue.rate,
+ effective_date: propsValue.effectiveDate,
+ }),
+ },
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-invoice/src/lib/actions/ai/settings/create-tax-group.ts b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/settings/create-tax-group.ts
new file mode 100644
index 00000000000..b9842d3e8c0
--- /dev/null
+++ b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/settings/create-tax-group.ts
@@ -0,0 +1,49 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoInvoiceAuth } from '../../../auth';
+import { zohoInvoiceAiProps } from '../../../common/ai-props';
+import { zohoInvoiceApi } from '../../../common/api';
+import { zohoInvoiceUtils } from '../../../common/utils';
+import { zohoInvoiceTaxGroupOutputSchema } from '../../../output-schemas';
+
+export const createTaxGroupAction = createAction({
+ auth: zohoInvoiceAuth,
+ name: 'zoho_invoice_create_tax_group',
+ outputSchema: zohoInvoiceTaxGroupOutputSchema,
+ displayName: 'Create Tax Group',
+ description: 'Combines several taxes into a tax group in Zoho Invoice.',
+ audience: 'ai',
+ classification: 'WRITE',
+ aiMetadata: {
+ description:
+ 'Creates a tax group that applies several existing taxes together on a line item. Use List Taxes to find the tax IDs. Needs the Admin role. Not idempotent: each call creates a new group.',
+ idempotent: false,
+ },
+ props: {
+ organizationId: zohoInvoiceAiProps.organizationId({ required: true }),
+ taxGroupName: Property.ShortText({
+ displayName: 'Tax Group Name',
+ description: 'Name of the tax group.',
+ required: true,
+ }),
+ taxes: Property.ShortText({
+ displayName: 'Tax IDs',
+ description: 'Comma-separated IDs of the taxes in the group. Use List Taxes to find them.',
+ required: true,
+ }),
+ additionalFields: zohoInvoiceAiProps.additionalFields({ required: false }),
+ },
+ async run({ auth, propsValue }) {
+ return await zohoInvoiceApi.createTaxGroup({
+ auth,
+ organizationId: propsValue.organizationId,
+ body: {
+ ...(propsValue.additionalFields ?? {}),
+ ...zohoInvoiceUtils.compact({
+ tax_group_name: propsValue.taxGroupName,
+ taxes: propsValue.taxes,
+ }),
+ },
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-invoice/src/lib/actions/ai/settings/create-tax.ts b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/settings/create-tax.ts
new file mode 100644
index 00000000000..f3bcdc37d78
--- /dev/null
+++ b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/settings/create-tax.ts
@@ -0,0 +1,63 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoInvoiceAuth } from '../../../auth';
+import { zohoInvoiceAiProps } from '../../../common/ai-props';
+import { zohoInvoiceApi } from '../../../common/api';
+import { zohoInvoiceUtils } from '../../../common/utils';
+import { zohoInvoiceTaxOutputSchema } from '../../../output-schemas';
+
+export const createTaxAction = createAction({
+ auth: zohoInvoiceAuth,
+ name: 'zoho_invoice_create_tax',
+ outputSchema: zohoInvoiceTaxOutputSchema,
+ displayName: 'Create Tax',
+ description: 'Creates a tax rate in a Zoho Invoice organization.',
+ audience: 'ai',
+ classification: 'WRITE',
+ aiMetadata: {
+ description:
+ 'Creates a tax rate that can be applied to line items and grouped with Create Tax Group. Needs the Admin role. Not idempotent: each call creates a new tax.',
+ idempotent: false,
+ },
+ props: {
+ organizationId: zohoInvoiceAiProps.organizationId({ required: true }),
+ taxName: Property.ShortText({
+ displayName: 'Tax Name',
+ description: 'Name of the tax, e.g. "VAT".',
+ required: true,
+ }),
+ taxPercentage: Property.Number({
+ displayName: 'Tax Percentage',
+ description: 'Rate in percent, e.g. 20 for 20%.',
+ required: true,
+ }),
+ taxType: Property.StaticDropdown({
+ displayName: 'Tax Type',
+ description:
+ 'Regular tax or compound tax (applied on top of other taxes). Empty = the vendor default (tax).',
+ required: false,
+ options: {
+ disabled: false,
+ options: [
+ { label: 'Tax', value: 'tax' },
+ { label: 'Compound Tax', value: 'compound_tax' },
+ ],
+ },
+ }),
+ additionalFields: zohoInvoiceAiProps.additionalFields({ required: false }),
+ },
+ async run({ auth, propsValue }) {
+ return await zohoInvoiceApi.createTax({
+ auth,
+ organizationId: propsValue.organizationId,
+ body: {
+ ...(propsValue.additionalFields ?? {}),
+ ...zohoInvoiceUtils.compact({
+ tax_name: propsValue.taxName,
+ tax_percentage: propsValue.taxPercentage,
+ tax_type: propsValue.taxType,
+ }),
+ },
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-invoice/src/lib/actions/ai/settings/delete-currency.ts b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/settings/delete-currency.ts
new file mode 100644
index 00000000000..2721c4f6c43
--- /dev/null
+++ b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/settings/delete-currency.ts
@@ -0,0 +1,32 @@
+import { createAction } from '@activepieces/pieces-framework';
+
+import { zohoInvoiceAuth } from '../../../auth';
+import { zohoInvoiceAiProps } from '../../../common/ai-props';
+import { zohoInvoiceApi } from '../../../common/api';
+import { zohoInvoiceMessageOutputSchema } from '../../../output-schemas';
+
+export const deleteCurrencyAction = createAction({
+ auth: zohoInvoiceAuth,
+ name: 'zoho_invoice_delete_currency',
+ outputSchema: zohoInvoiceMessageOutputSchema,
+ displayName: 'Delete Currency',
+ description: 'Removes a currency from a Zoho Invoice organization.',
+ audience: 'ai',
+ classification: 'DESTRUCTIVE',
+ aiMetadata: {
+ description:
+ 'Permanently removes a currency from the organization; the base currency and currencies used on transactions cannot be deleted. Use List Currencies to find the ID. Needs the Admin role. Cannot be undone.',
+ idempotent: false,
+ },
+ props: {
+ organizationId: zohoInvoiceAiProps.organizationId({ required: true }),
+ currencyId: zohoInvoiceAiProps.currencyId({ required: true }),
+ },
+ async run({ auth, propsValue }) {
+ return await zohoInvoiceApi.deleteCurrency({
+ auth,
+ organizationId: propsValue.organizationId,
+ currencyId: propsValue.currencyId,
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-invoice/src/lib/actions/ai/settings/delete-exchange-rate.ts b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/settings/delete-exchange-rate.ts
new file mode 100644
index 00000000000..10b44c999e3
--- /dev/null
+++ b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/settings/delete-exchange-rate.ts
@@ -0,0 +1,38 @@
+import { createAction } from '@activepieces/pieces-framework';
+
+import { zohoInvoiceAuth } from '../../../auth';
+import { zohoInvoiceAiProps } from '../../../common/ai-props';
+import { zohoInvoiceApi } from '../../../common/api';
+import { zohoInvoiceMessageOutputSchema } from '../../../output-schemas';
+
+export const deleteExchangeRateAction = createAction({
+ auth: zohoInvoiceAuth,
+ name: 'zoho_invoice_delete_exchange_rate',
+ outputSchema: zohoInvoiceMessageOutputSchema,
+ displayName: 'Delete Exchange Rate',
+ description: 'Removes an exchange rate from a currency in Zoho Invoice.',
+ audience: 'ai',
+ classification: 'DESTRUCTIVE',
+ aiMetadata: {
+ description:
+ 'Permanently removes an exchange rate from a currency. Use List Currencies for the currency ID and List Exchange Rates for the exchange rate ID. Needs the Admin role. Cannot be undone.',
+ idempotent: false,
+ },
+ props: {
+ organizationId: zohoInvoiceAiProps.organizationId({ required: true }),
+ currencyId: zohoInvoiceAiProps.currencyId({ required: true }),
+ exchangeRateId: zohoInvoiceAiProps.idProp({
+ required: true,
+ displayName: 'Exchange Rate ID',
+ description: 'Exchange rate ID. Use List Exchange Rates to find it.',
+ }),
+ },
+ async run({ auth, propsValue }) {
+ return await zohoInvoiceApi.deleteExchangeRate({
+ auth,
+ organizationId: propsValue.organizationId,
+ currencyId: propsValue.currencyId,
+ exchangeRateId: propsValue.exchangeRateId,
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-invoice/src/lib/actions/ai/settings/delete-tax-group.ts b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/settings/delete-tax-group.ts
new file mode 100644
index 00000000000..ff31d2c772f
--- /dev/null
+++ b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/settings/delete-tax-group.ts
@@ -0,0 +1,36 @@
+import { createAction } from '@activepieces/pieces-framework';
+
+import { zohoInvoiceAuth } from '../../../auth';
+import { zohoInvoiceAiProps } from '../../../common/ai-props';
+import { zohoInvoiceApi } from '../../../common/api';
+import { zohoInvoiceMessageOutputSchema } from '../../../output-schemas';
+
+export const deleteTaxGroupAction = createAction({
+ auth: zohoInvoiceAuth,
+ name: 'zoho_invoice_delete_tax_group',
+ outputSchema: zohoInvoiceMessageOutputSchema,
+ displayName: 'Delete Tax Group',
+ description: 'Deletes a tax group from a Zoho Invoice organization.',
+ audience: 'ai',
+ classification: 'DESTRUCTIVE',
+ aiMetadata: {
+ description:
+ 'Permanently deletes a tax group; the taxes in it are kept. Use List Taxes to find the ID; use Delete Tax for a single tax. Needs the Admin role. Cannot be undone.',
+ idempotent: false,
+ },
+ props: {
+ organizationId: zohoInvoiceAiProps.organizationId({ required: true }),
+ taxGroupId: zohoInvoiceAiProps.idProp({
+ required: true,
+ displayName: 'Tax Group ID',
+ description: 'Tax group ID. Use List Taxes to find it.',
+ }),
+ },
+ async run({ auth, propsValue }) {
+ return await zohoInvoiceApi.deleteTaxGroup({
+ auth,
+ organizationId: propsValue.organizationId,
+ taxGroupId: propsValue.taxGroupId,
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-invoice/src/lib/actions/ai/settings/delete-tax.ts b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/settings/delete-tax.ts
new file mode 100644
index 00000000000..f4192997ab5
--- /dev/null
+++ b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/settings/delete-tax.ts
@@ -0,0 +1,32 @@
+import { createAction } from '@activepieces/pieces-framework';
+
+import { zohoInvoiceAuth } from '../../../auth';
+import { zohoInvoiceAiProps } from '../../../common/ai-props';
+import { zohoInvoiceApi } from '../../../common/api';
+import { zohoInvoiceMessageOutputSchema } from '../../../output-schemas';
+
+export const deleteTaxAction = createAction({
+ auth: zohoInvoiceAuth,
+ name: 'zoho_invoice_delete_tax',
+ outputSchema: zohoInvoiceMessageOutputSchema,
+ displayName: 'Delete Tax',
+ description: 'Deletes a tax from a Zoho Invoice organization.',
+ audience: 'ai',
+ classification: 'DESTRUCTIVE',
+ aiMetadata: {
+ description:
+ 'Permanently deletes a tax; a tax used on transactions cannot be deleted. Use List Taxes to find the ID; use Delete Tax Group for a tax group. Needs the Admin role. Cannot be undone.',
+ idempotent: false,
+ },
+ props: {
+ organizationId: zohoInvoiceAiProps.organizationId({ required: true }),
+ taxId: zohoInvoiceAiProps.taxId({ required: true }),
+ },
+ async run({ auth, propsValue }) {
+ return await zohoInvoiceApi.deleteTax({
+ auth,
+ organizationId: propsValue.organizationId,
+ taxId: propsValue.taxId,
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-invoice/src/lib/actions/ai/settings/get-currency.ts b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/settings/get-currency.ts
new file mode 100644
index 00000000000..80191b4acc4
--- /dev/null
+++ b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/settings/get-currency.ts
@@ -0,0 +1,32 @@
+import { createAction } from '@activepieces/pieces-framework';
+
+import { zohoInvoiceAuth } from '../../../auth';
+import { zohoInvoiceAiProps } from '../../../common/ai-props';
+import { zohoInvoiceApi } from '../../../common/api';
+import { zohoInvoiceCurrencyOutputSchema } from '../../../output-schemas';
+
+export const getCurrencyAction = createAction({
+ auth: zohoInvoiceAuth,
+ name: 'zoho_invoice_get_currency',
+ outputSchema: zohoInvoiceCurrencyOutputSchema,
+ displayName: 'Get Currency',
+ description: 'Gets one currency of a Zoho Invoice organization.',
+ audience: 'ai',
+ classification: 'READ',
+ aiMetadata: {
+ description:
+ 'Returns one currency by ID: code, symbol, precision, format and whether it is the base currency. Use List Currencies to find the ID.',
+ idempotent: true,
+ },
+ props: {
+ organizationId: zohoInvoiceAiProps.organizationId({ required: true }),
+ currencyId: zohoInvoiceAiProps.currencyId({ required: true }),
+ },
+ async run({ auth, propsValue }) {
+ return await zohoInvoiceApi.getCurrency({
+ auth,
+ organizationId: propsValue.organizationId,
+ currencyId: propsValue.currencyId,
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-invoice/src/lib/actions/ai/settings/get-exchange-rate.ts b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/settings/get-exchange-rate.ts
new file mode 100644
index 00000000000..712782445e6
--- /dev/null
+++ b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/settings/get-exchange-rate.ts
@@ -0,0 +1,38 @@
+import { createAction } from '@activepieces/pieces-framework';
+
+import { zohoInvoiceAuth } from '../../../auth';
+import { zohoInvoiceAiProps } from '../../../common/ai-props';
+import { zohoInvoiceApi } from '../../../common/api';
+import { zohoInvoiceExchangeRateOutputSchema } from '../../../output-schemas';
+
+export const getExchangeRateAction = createAction({
+ auth: zohoInvoiceAuth,
+ name: 'zoho_invoice_get_exchange_rate',
+ outputSchema: zohoInvoiceExchangeRateOutputSchema,
+ displayName: 'Get Exchange Rate',
+ description: 'Gets one exchange rate of a currency in Zoho Invoice.',
+ audience: 'ai',
+ classification: 'READ',
+ aiMetadata: {
+ description:
+ 'Returns one exchange rate by ID: rate and effective date. Use List Currencies for the currency ID and List Exchange Rates for the exchange rate ID.',
+ idempotent: true,
+ },
+ props: {
+ organizationId: zohoInvoiceAiProps.organizationId({ required: true }),
+ currencyId: zohoInvoiceAiProps.currencyId({ required: true }),
+ exchangeRateId: zohoInvoiceAiProps.idProp({
+ required: true,
+ displayName: 'Exchange Rate ID',
+ description: 'Exchange rate ID. Use List Exchange Rates to find it.',
+ }),
+ },
+ async run({ auth, propsValue }) {
+ return await zohoInvoiceApi.getExchangeRate({
+ auth,
+ organizationId: propsValue.organizationId,
+ currencyId: propsValue.currencyId,
+ exchangeRateId: propsValue.exchangeRateId,
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-invoice/src/lib/actions/ai/settings/get-tax-group.ts b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/settings/get-tax-group.ts
new file mode 100644
index 00000000000..4c5fe69e751
--- /dev/null
+++ b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/settings/get-tax-group.ts
@@ -0,0 +1,36 @@
+import { createAction } from '@activepieces/pieces-framework';
+
+import { zohoInvoiceAuth } from '../../../auth';
+import { zohoInvoiceAiProps } from '../../../common/ai-props';
+import { zohoInvoiceApi } from '../../../common/api';
+import { zohoInvoiceTaxGroupOutputSchema } from '../../../output-schemas';
+
+export const getTaxGroupAction = createAction({
+ auth: zohoInvoiceAuth,
+ name: 'zoho_invoice_get_tax_group',
+ outputSchema: zohoInvoiceTaxGroupOutputSchema,
+ displayName: 'Get Tax Group',
+ description: 'Gets one tax group of a Zoho Invoice organization.',
+ audience: 'ai',
+ classification: 'READ',
+ aiMetadata: {
+ description:
+ 'Returns one tax group by ID: name, combined percentage and the taxes it contains. Use List Taxes to find the ID; use Get Tax for a single tax.',
+ idempotent: true,
+ },
+ props: {
+ organizationId: zohoInvoiceAiProps.organizationId({ required: true }),
+ taxGroupId: zohoInvoiceAiProps.idProp({
+ required: true,
+ displayName: 'Tax Group ID',
+ description: 'Tax group ID. Use List Taxes to find it.',
+ }),
+ },
+ async run({ auth, propsValue }) {
+ return await zohoInvoiceApi.getTaxGroup({
+ auth,
+ organizationId: propsValue.organizationId,
+ taxGroupId: propsValue.taxGroupId,
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-invoice/src/lib/actions/ai/settings/get-tax.ts b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/settings/get-tax.ts
new file mode 100644
index 00000000000..2f3e3e9b28e
--- /dev/null
+++ b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/settings/get-tax.ts
@@ -0,0 +1,32 @@
+import { createAction } from '@activepieces/pieces-framework';
+
+import { zohoInvoiceAuth } from '../../../auth';
+import { zohoInvoiceAiProps } from '../../../common/ai-props';
+import { zohoInvoiceApi } from '../../../common/api';
+import { zohoInvoiceTaxOutputSchema } from '../../../output-schemas';
+
+export const getTaxAction = createAction({
+ auth: zohoInvoiceAuth,
+ name: 'zoho_invoice_get_tax',
+ outputSchema: zohoInvoiceTaxOutputSchema,
+ displayName: 'Get Tax',
+ description: 'Gets one tax of a Zoho Invoice organization.',
+ audience: 'ai',
+ classification: 'READ',
+ aiMetadata: {
+ description:
+ 'Returns one tax by ID: name, percentage and type. Use List Taxes to find the ID; use Get Tax Group for a tax group.',
+ idempotent: true,
+ },
+ props: {
+ organizationId: zohoInvoiceAiProps.organizationId({ required: true }),
+ taxId: zohoInvoiceAiProps.taxId({ required: true }),
+ },
+ async run({ auth, propsValue }) {
+ return await zohoInvoiceApi.getTax({
+ auth,
+ organizationId: propsValue.organizationId,
+ taxId: propsValue.taxId,
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-invoice/src/lib/actions/ai/settings/list-currencies.ts b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/settings/list-currencies.ts
new file mode 100644
index 00000000000..4dcc5a29428
--- /dev/null
+++ b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/settings/list-currencies.ts
@@ -0,0 +1,44 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoInvoiceAuth } from '../../../auth';
+import { zohoInvoiceAiProps } from '../../../common/ai-props';
+import { zohoInvoiceApi } from '../../../common/api';
+import { zohoInvoiceListCurrenciesOutputSchema } from '../../../output-schemas';
+
+export const listCurrenciesAction = createAction({
+ auth: zohoInvoiceAuth,
+ name: 'zoho_invoice_list_currencies',
+ outputSchema: zohoInvoiceListCurrenciesOutputSchema,
+ displayName: 'List Currencies',
+ description: 'Lists the currencies of a Zoho Invoice organization.',
+ audience: 'ai',
+ classification: 'SEARCH',
+ aiMetadata: {
+ description:
+ 'Lists the currencies enabled in the organization with currency_id, code, symbol and whether it is the base currency, one page at a time. Use it to find the currency_id other actions need.',
+ idempotent: true,
+ },
+ props: {
+ organizationId: zohoInvoiceAiProps.organizationId({ required: true }),
+ filterBy: Property.StaticDropdown({
+ displayName: 'Filter',
+ description: 'Exclude the base currency. Empty = all currencies.',
+ required: false,
+ options: {
+ disabled: false,
+ options: [{ label: 'Exclude Base Currency', value: 'Currencies.ExcludeBaseCurrency' }],
+ },
+ }),
+ page: zohoInvoiceAiProps.page({ required: false }),
+ perPage: zohoInvoiceAiProps.perPage({ required: false }),
+ },
+ async run({ auth, propsValue }) {
+ return await zohoInvoiceApi.listCurrencies({
+ auth,
+ organizationId: propsValue.organizationId,
+ filterBy: propsValue.filterBy,
+ page: propsValue.page,
+ perPage: propsValue.perPage,
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-invoice/src/lib/actions/ai/settings/list-exchange-rates.ts b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/settings/list-exchange-rates.ts
new file mode 100644
index 00000000000..1c887725e34
--- /dev/null
+++ b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/settings/list-exchange-rates.ts
@@ -0,0 +1,50 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoInvoiceAuth } from '../../../auth';
+import { zohoInvoiceAiProps } from '../../../common/ai-props';
+import { zohoInvoiceApi } from '../../../common/api';
+import { zohoInvoiceUtils } from '../../../common/utils';
+import { zohoInvoiceListExchangeRatesOutputSchema } from '../../../output-schemas';
+
+export const listExchangeRatesAction = createAction({
+ auth: zohoInvoiceAuth,
+ name: 'zoho_invoice_list_exchange_rates',
+ outputSchema: zohoInvoiceListExchangeRatesOutputSchema,
+ displayName: 'List Exchange Rates',
+ description: 'Lists the exchange rates of a currency in Zoho Invoice.',
+ audience: 'ai',
+ classification: 'SEARCH',
+ aiMetadata: {
+ description:
+ 'Lists the exchange rates recorded for one foreign currency with exchange_rate_id, rate and effective date. Use List Currencies to find the currency ID.',
+ idempotent: true,
+ },
+ props: {
+ organizationId: zohoInvoiceAiProps.organizationId({ required: true }),
+ currencyId: zohoInvoiceAiProps.currencyId({ required: true }),
+ fromDate: Property.ShortText({
+ displayName: 'From Date',
+ description: 'Only rates effective on or after this date, as yyyy-mm-dd.',
+ required: false,
+ }),
+ isCurrentDate: zohoInvoiceAiProps.yesNo({
+ required: false,
+ displayName: 'Current Rate Only',
+ description: 'Yes = only the rate effective today. Empty = all rates.',
+ }),
+ sortColumn: zohoInvoiceAiProps.sortColumn({
+ required: false,
+ description: 'Field to sort by, e.g. effective_date.',
+ }),
+ },
+ async run({ auth, propsValue }) {
+ return await zohoInvoiceApi.listExchangeRates({
+ auth,
+ organizationId: propsValue.organizationId,
+ currencyId: propsValue.currencyId,
+ fromDate: propsValue.fromDate,
+ isCurrentDate: zohoInvoiceUtils.toOptionalBoolean({ value: propsValue.isCurrentDate }),
+ sortColumn: propsValue.sortColumn,
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-invoice/src/lib/actions/ai/settings/list-taxes.ts b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/settings/list-taxes.ts
new file mode 100644
index 00000000000..bbc80fda191
--- /dev/null
+++ b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/settings/list-taxes.ts
@@ -0,0 +1,34 @@
+import { createAction } from '@activepieces/pieces-framework';
+
+import { zohoInvoiceAuth } from '../../../auth';
+import { zohoInvoiceAiProps } from '../../../common/ai-props';
+import { zohoInvoiceApi } from '../../../common/api';
+import { zohoInvoiceListTaxesOutputSchema } from '../../../output-schemas';
+
+export const listTaxesAction = createAction({
+ auth: zohoInvoiceAuth,
+ name: 'zoho_invoice_list_taxes',
+ outputSchema: zohoInvoiceListTaxesOutputSchema,
+ displayName: 'List Taxes',
+ description: 'Lists the taxes of a Zoho Invoice organization.',
+ audience: 'ai',
+ classification: 'SEARCH',
+ aiMetadata: {
+ description:
+ 'Lists the taxes and tax groups of the organization with tax_id, name, percentage and type, one page at a time. Use it to find the tax ID or tax group ID other actions need.',
+ idempotent: true,
+ },
+ props: {
+ organizationId: zohoInvoiceAiProps.organizationId({ required: true }),
+ page: zohoInvoiceAiProps.page({ required: false }),
+ perPage: zohoInvoiceAiProps.perPage({ required: false }),
+ },
+ async run({ auth, propsValue }) {
+ return await zohoInvoiceApi.listTaxes({
+ auth,
+ organizationId: propsValue.organizationId,
+ page: propsValue.page,
+ perPage: propsValue.perPage,
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-invoice/src/lib/actions/ai/settings/update-currency.ts b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/settings/update-currency.ts
new file mode 100644
index 00000000000..a87a8df437b
--- /dev/null
+++ b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/settings/update-currency.ts
@@ -0,0 +1,61 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoInvoiceAuth } from '../../../auth';
+import { zohoInvoiceAiProps } from '../../../common/ai-props';
+import { zohoInvoiceApi } from '../../../common/api';
+import { zohoInvoiceUtils } from '../../../common/utils';
+import { zohoInvoiceCurrencyOutputSchema } from '../../../output-schemas';
+
+export const updateCurrencyAction = createAction({
+ auth: zohoInvoiceAuth,
+ name: 'zoho_invoice_update_currency',
+ outputSchema: zohoInvoiceCurrencyOutputSchema,
+ displayName: 'Update Currency',
+ description: "Changes a currency's code, symbol, precision or format.",
+ audience: 'ai',
+ classification: 'WRITE',
+ aiMetadata: {
+ description:
+ "Changes a currency's code, symbol, decimal precision or number format. Fields left empty keep their current value. Use List Currencies to find the ID. Needs the Admin role.",
+ idempotent: true,
+ },
+ props: {
+ organizationId: zohoInvoiceAiProps.organizationId({ required: true }),
+ currencyId: zohoInvoiceAiProps.currencyId({ required: true }),
+ currencyCode: Property.ShortText({
+ displayName: 'Currency Code',
+ description: 'New ISO 4217 currency code. Empty = unchanged.',
+ required: false,
+ }),
+ currencySymbol: Property.ShortText({
+ displayName: 'Currency Symbol',
+ description: 'New symbol. Empty = unchanged.',
+ required: false,
+ }),
+ pricePrecision: Property.Number({
+ displayName: 'Price Precision',
+ description: 'New number of decimal places (0, 2 or 3). Empty = unchanged.',
+ required: false,
+ }),
+ currencyFormat: Property.ShortText({
+ displayName: 'Currency Format',
+ description: 'New number format, e.g. "1,234,567.89". Empty = unchanged.',
+ required: false,
+ }),
+ },
+ async run({ auth, propsValue }) {
+ const { organizationId, currencyId } = propsValue;
+ const current = await zohoInvoiceApi.getCurrency({ auth, organizationId, currencyId });
+ return await zohoInvoiceApi.updateCurrency({
+ auth,
+ organizationId,
+ currencyId,
+ body: zohoInvoiceUtils.compact({
+ currency_code: propsValue.currencyCode ?? current.currency?.currency_code,
+ currency_symbol: propsValue.currencySymbol ?? current.currency?.currency_symbol,
+ price_precision: propsValue.pricePrecision ?? current.currency?.price_precision,
+ currency_format: propsValue.currencyFormat ?? current.currency?.currency_format,
+ }),
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-invoice/src/lib/actions/ai/settings/update-exchange-rate.ts b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/settings/update-exchange-rate.ts
new file mode 100644
index 00000000000..7aee1615633
--- /dev/null
+++ b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/settings/update-exchange-rate.ts
@@ -0,0 +1,54 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoInvoiceAuth } from '../../../auth';
+import { zohoInvoiceAiProps } from '../../../common/ai-props';
+import { zohoInvoiceApi } from '../../../common/api';
+import { zohoInvoiceUtils } from '../../../common/utils';
+import { zohoInvoiceExchangeRateOutputSchema } from '../../../output-schemas';
+
+export const updateExchangeRateAction = createAction({
+ auth: zohoInvoiceAuth,
+ name: 'zoho_invoice_update_exchange_rate',
+ outputSchema: zohoInvoiceExchangeRateOutputSchema,
+ displayName: 'Update Exchange Rate',
+ description: "Changes an exchange rate's value or effective date.",
+ audience: 'ai',
+ classification: 'WRITE',
+ aiMetadata: {
+ description:
+ "Changes an exchange rate's value or effective date. Fields left empty keep their current value. Use List Currencies for the currency ID and List Exchange Rates for the exchange rate ID. Needs the Admin role. Zoho echoes a new effective date in the response but may keep the old one; confirm with Get Exchange Rate.",
+ idempotent: true,
+ },
+ props: {
+ organizationId: zohoInvoiceAiProps.organizationId({ required: true }),
+ currencyId: zohoInvoiceAiProps.currencyId({ required: true }),
+ exchangeRateId: zohoInvoiceAiProps.idProp({
+ required: true,
+ displayName: 'Exchange Rate ID',
+ description: 'Exchange rate ID. Use List Exchange Rates to find it.',
+ }),
+ rate: Property.Number({
+ displayName: 'Rate',
+ description:
+ 'New value of one unit of this currency in the base currency. Empty = unchanged.',
+ required: false,
+ }),
+ effectiveDate: Property.ShortText({
+ displayName: 'Effective Date',
+ description: 'New date the rate applies from, as yyyy-mm-dd. Empty = unchanged.',
+ required: false,
+ }),
+ },
+ async run({ auth, propsValue }) {
+ return await zohoInvoiceApi.updateExchangeRate({
+ auth,
+ organizationId: propsValue.organizationId,
+ currencyId: propsValue.currencyId,
+ exchangeRateId: propsValue.exchangeRateId,
+ body: zohoInvoiceUtils.compact({
+ rate: propsValue.rate,
+ effective_date: propsValue.effectiveDate,
+ }),
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-invoice/src/lib/actions/ai/settings/update-tax-group.ts b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/settings/update-tax-group.ts
new file mode 100644
index 00000000000..32c16151cb5
--- /dev/null
+++ b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/settings/update-tax-group.ts
@@ -0,0 +1,52 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoInvoiceAuth } from '../../../auth';
+import { zohoInvoiceAiProps } from '../../../common/ai-props';
+import { zohoInvoiceApi } from '../../../common/api';
+import { zohoInvoiceUtils } from '../../../common/utils';
+import { zohoInvoiceTaxGroupOutputSchema } from '../../../output-schemas';
+
+export const updateTaxGroupAction = createAction({
+ auth: zohoInvoiceAuth,
+ name: 'zoho_invoice_update_tax_group',
+ outputSchema: zohoInvoiceTaxGroupOutputSchema,
+ displayName: 'Update Tax Group',
+ description: "Changes a tax group's name or member taxes.",
+ audience: 'ai',
+ classification: 'WRITE',
+ aiMetadata: {
+ description:
+ "Changes a tax group's name or replaces its list of member taxes. Fields left empty keep their current value. Use List Taxes to find the tax group ID and tax IDs. Needs the Admin role.",
+ idempotent: true,
+ },
+ props: {
+ organizationId: zohoInvoiceAiProps.organizationId({ required: true }),
+ taxGroupId: zohoInvoiceAiProps.idProp({
+ required: true,
+ displayName: 'Tax Group ID',
+ description: 'Tax group ID. Use List Taxes to find it.',
+ }),
+ taxGroupName: Property.ShortText({
+ displayName: 'Tax Group Name',
+ description: 'New name. Empty = unchanged.',
+ required: false,
+ }),
+ taxes: Property.ShortText({
+ displayName: 'Tax IDs',
+ description:
+ 'Comma-separated IDs of all taxes the group should contain; replaces the current list. Use List Taxes to find them. Empty = unchanged.',
+ required: false,
+ }),
+ },
+ async run({ auth, propsValue }) {
+ return await zohoInvoiceApi.updateTaxGroup({
+ auth,
+ organizationId: propsValue.organizationId,
+ taxGroupId: propsValue.taxGroupId,
+ body: zohoInvoiceUtils.compact({
+ tax_group_name: propsValue.taxGroupName,
+ taxes: propsValue.taxes,
+ }),
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-invoice/src/lib/actions/ai/settings/update-tax.ts b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/settings/update-tax.ts
new file mode 100644
index 00000000000..599bf4ba206
--- /dev/null
+++ b/packages/pieces/community/zoho-invoice/src/lib/actions/ai/settings/update-tax.ts
@@ -0,0 +1,64 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+
+import { zohoInvoiceAuth } from '../../../auth';
+import { zohoInvoiceAiProps } from '../../../common/ai-props';
+import { zohoInvoiceApi } from '../../../common/api';
+import { zohoInvoiceUtils } from '../../../common/utils';
+import { zohoInvoiceTaxOutputSchema } from '../../../output-schemas';
+
+export const updateTaxAction = createAction({
+ auth: zohoInvoiceAuth,
+ name: 'zoho_invoice_update_tax',
+ outputSchema: zohoInvoiceTaxOutputSchema,
+ displayName: 'Update Tax',
+ description: "Changes a tax's name, percentage or type.",
+ audience: 'ai',
+ classification: 'WRITE',
+ aiMetadata: {
+ description:
+ "Changes a tax's name, percentage or type. Fields left empty keep their current value. Use List Taxes to find the ID. Needs the Admin role.",
+ idempotent: true,
+ },
+ props: {
+ organizationId: zohoInvoiceAiProps.organizationId({ required: true }),
+ taxId: zohoInvoiceAiProps.taxId({ required: true }),
+ taxName: Property.ShortText({
+ displayName: 'Tax Name',
+ description: 'New name. Empty = unchanged.',
+ required: false,
+ }),
+ taxPercentage: Property.Number({
+ displayName: 'Tax Percentage',
+ description: 'New rate in percent. Empty = unchanged.',
+ required: false,
+ }),
+ taxType: Property.StaticDropdown({
+ displayName: 'Tax Type',
+ description: 'New type: regular tax or compound tax. Empty = unchanged.',
+ required: false,
+ options: {
+ disabled: false,
+ options: [
+ { label: 'Tax', value: 'tax' },
+ { label: 'Compound Tax', value: 'compound_tax' },
+ ],
+ },
+ }),
+ additionalFields: zohoInvoiceAiProps.additionalFields({ required: false }),
+ },
+ async run({ auth, propsValue }) {
+ return await zohoInvoiceApi.updateTax({
+ auth,
+ organizationId: propsValue.organizationId,
+ taxId: propsValue.taxId,
+ body: {
+ ...(propsValue.additionalFields ?? {}),
+ ...zohoInvoiceUtils.compact({
+ tax_name: propsValue.taxName,
+ tax_percentage: propsValue.taxPercentage,
+ tax_type: propsValue.taxType,
+ }),
+ },
+ });
+ },
+});
diff --git a/packages/pieces/community/zoho-invoice/src/lib/auth.ts b/packages/pieces/community/zoho-invoice/src/lib/auth.ts
new file mode 100644
index 00000000000..c9a9b22aad2
--- /dev/null
+++ b/packages/pieces/community/zoho-invoice/src/lib/auth.ts
@@ -0,0 +1,39 @@
+import { PieceAuth, Property } from '@activepieces/pieces-framework';
+
+export const zohoInvoiceAuth = PieceAuth.OAuth2({
+ required: true,
+ authUrl: 'https://accounts.zoho.{region}/oauth/v2/auth',
+ tokenUrl: 'https://accounts.zoho.{region}/oauth/v2/token',
+ scope: ['ZohoInvoice.fullaccess.all'],
+ props: {
+ region: Property.StaticDropdown({
+ displayName: 'Region',
+ description: 'Select your account region',
+ required: true,
+ options: {
+ options: [
+ {
+ label: 'US (.com)',
+ value: 'com',
+ },
+ {
+ label: 'Europe (.eu)',
+ value: 'eu',
+ },
+ {
+ label: 'India (.in)',
+ value: 'in',
+ },
+ {
+ label: 'Australia (.com.au)',
+ value: 'com.au',
+ },
+ {
+ label: 'Japan (.jp)',
+ value: 'jp',
+ },
+ ],
+ },
+ }),
+ },
+});
diff --git a/packages/pieces/community/zoho-invoice/src/lib/common/ai-props.ts b/packages/pieces/community/zoho-invoice/src/lib/common/ai-props.ts
new file mode 100644
index 00000000000..2be3148817c
--- /dev/null
+++ b/packages/pieces/community/zoho-invoice/src/lib/common/ai-props.ts
@@ -0,0 +1,275 @@
+import { Property } from '@activepieces/pieces-framework';
+
+function idProp<R extends boolean>({
+ required,
+ displayName,
+ description,
+}: PropParams<R> & { displayName: string }) {
+ return Property.ShortText({ displayName, description, required });
+}
+
+function organizationId<R extends boolean>({
+ required,
+ displayName = 'Organization ID',
+ description = 'Zoho Invoice organization ID. Use List Organizations to find it.',
+}: PropParams<R>) {
+ return idProp({ required, displayName, description });
+}
+
+function page<R extends boolean>({
+ required,
+ displayName = 'Page',
+ description = 'Page number to fetch, starting at 1. Defaults to 1. Use page_context.has_more_page in the response to know if there is a next page.',
+}: PropParams<R>) {
+ return Property.Number({ displayName, description, required });
+}
+
+function perPage<R extends boolean>({
+ required,
+ displayName = 'Per Page',
+ description = 'Records per page (1-200). Defaults to 200.',
+}: PropParams<R>) {
+ return Property.Number({ displayName, description, required });
+}
+
+function additionalFields<R extends boolean>({
+ required,
+ displayName = 'Additional Fields',
+ description = 'Other fields to send as-is, as a JSON object using the Zoho Invoice API field names. The dedicated inputs above override keys set here.',
+}: PropParams<R>) {
+ return Property.Json({ displayName, description, required });
+}
+
+function searchText<R extends boolean>({
+ required,
+ displayName = 'Search Text',
+ description = 'Free-text search across the main fields.',
+}: PropParams<R>) {
+ return Property.ShortText({ displayName, description, required });
+}
+
+function sortColumn<R extends boolean>({
+ required,
+ displayName = 'Sort Column',
+ description = 'Field to sort by.',
+}: PropParams<R>) {
+ return Property.ShortText({ displayName, description, required });
+}
+
+function sortOrder<R extends boolean>({
+ required,
+ displayName = 'Sort Order',
+ description = 'Ascending (A) or descending (D). Empty = the vendor default.',
+}: PropParams<R>) {
+ return Property.StaticDropdown({
+ displayName,
+ description,
+ required,
+ options: {
+ disabled: false,
+ options: [
+ { label: 'Ascending', value: 'A' },
+ { label: 'Descending', value: 'D' },
+ ],
+ },
+ });
+}
+
+function yesNo<R extends boolean>({
+ required,
+ displayName,
+ description,
+}: PropParams<R> & { displayName: string }) {
+ return Property.StaticDropdown({
+ displayName,
+ description,
+ required,
+ options: {
+ disabled: false,
+ options: [
+ { label: 'Yes', value: 'true' },
+ { label: 'No', value: 'false' },
+ ],
+ },
+ });
+}
+
+function userId<R extends boolean>({
+ required,
+ displayName = 'User ID',
+ description = 'User ID. Use List Users to find it.',
+}: PropParams<R>) {
+ return idProp({ required, displayName, description });
+}
+
+function contactId<R extends boolean>({
+ required,
+ displayName = 'Contact ID',
+ description = 'Contact (customer) ID. Use List Contacts to find it.',
+}: PropParams<R>) {
+ return idProp({ required, displayName, description });
+}
+
+function contactPersonId<R extends boolean>({
+ required,
+ displayName = 'Contact Person ID',
+ description = 'Contact person ID. Use List Contact Persons to find it.',
+}: PropParams<R>) {
+ return idProp({ required, displayName, description });
+}
+
+function invoiceId<R extends boolean>({
+ required,
+ displayName = 'Invoice ID',
+ description = 'Invoice ID. Use List Invoices to find it.',
+}: PropParams<R>) {
+ return idProp({ required, displayName, description });
+}
+
+function recurringInvoiceId<R extends boolean>({
+ required,
+ displayName = 'Recurring Invoice ID',
+ description = 'Recurring invoice ID. Use List Recurring Invoices to find it.',
+}: PropParams<R>) {
+ return idProp({ required, displayName, description });
+}
+
+function estimateId<R extends boolean>({
+ required,
+ displayName = 'Estimate ID',
+ description = 'Estimate ID. Use List Estimates to find it.',
+}: PropParams<R>) {
+ return idProp({ required, displayName, description });
+}
+
+function creditNoteId<R extends boolean>({
+ required,
+ displayName = 'Credit Note ID',
+ description = 'Credit note ID. Use List Credit Notes to find it.',
+}: PropParams<R>) {
+ return idProp({ required, displayName, description });
+}
+
+function paymentId<R extends boolean>({
+ required,
+ displayName = 'Payment ID',
+ description = 'Customer payment ID. Use List Customer Payments to find it.',
+}: PropParams<R>) {
+ return idProp({ required, displayName, description });
+}
+
+function itemId<R extends boolean>({
+ required,
+ displayName = 'Item ID',
+ description = 'Item ID. Use List Items to find it.',
+}: PropParams<R>) {
+ return idProp({ required, displayName, description });
+}
+
+function expenseId<R extends boolean>({
+ required,
+ displayName = 'Expense ID',
+ description = 'Expense ID. Use List Expenses to find it.',
+}: PropParams<R>) {
+ return idProp({ required, displayName, description });
+}
+
+function expenseCategoryId<R extends boolean>({
+ required,
+ displayName = 'Expense Category ID',
+ description = 'Expense category ID. Use List Expense Categories to find it.',
+}: PropParams<R>) {
+ return idProp({ required, displayName, description });
+}
+
+function projectId<R extends boolean>({
+ required,
+ displayName = 'Project ID',
+ description = 'Project ID. Use List Projects to find it.',
+}: PropParams<R>) {
+ return idProp({ required, displayName, description });
+}
+
+function taskId<R extends boolean>({
+ required,
+ displayName = 'Task ID',
+ description = 'Project task ID. Use List Tasks to find it.',
+}: PropParams<R>) {
+ return idProp({ required, displayName, description });
+}
+
+function timeEntryId<R extends boolean>({
+ required,
+ displayName = 'Time Entry ID',
+ description = 'Time entry ID. Use List Time Entries to find it.',
+}: PropParams<R>) {
+ return idProp({ required, displayName, description });
+}
+
+function currencyId<R extends boolean>({
+ required,
+ displayName = 'Currency ID',
+ description = 'Currency ID. Use List Currencies to find it.',
+}: PropParams<R>) {
+ return idProp({ required, displayName, description });
+}
+
+function taxId<R extends boolean>({
+ required,
+ displayName = 'Tax ID',
+ description = 'Tax ID. Use List Taxes to find it.',
+}: PropParams<R>) {
+ return idProp({ required, displayName, description });
+}
+
+function templateId<R extends boolean>({
+ required,
+ displayName = 'Template ID',
+ description = 'PDF template ID.',
+}: PropParams<R>) {
+ return idProp({ required, displayName, description });
+}
+
+function commentId<R extends boolean>({
+ required,
+ displayName = 'Comment ID',
+ description = 'Comment ID.',
+}: PropParams<R>) {
+ return idProp({ required, displayName, description });
+}
+
+export const zohoInvoiceAiProps = {
+ idProp,
+ organizationId,
+ page,
+ perPage,
+ additionalFields,
+ searchText,
+ sortColumn,
+ sortOrder,
+ yesNo,
+ userId,
+ contactId,
+ contactPersonId,
+ invoiceId,
+ recurringInvoiceId,
+ estimateId,
+ creditNoteId,
+ paymentId,
+ itemId,
+ expenseId,
+ expenseCategoryId,
+ projectId,
+ taskId,
+ timeEntryId,
+ currencyId,
+ taxId,
+ templateId,
+ commentId,
+};
+
+export type PropParams<R extends boolean> = {
+ required: R;
+ displayName?: string;
+ description?: string;
+};
diff --git a/packages/pieces/community/zoho-invoice/src/lib/common/api/contacts.ts b/packages/pieces/community/zoho-invoice/src/lib/common/api/contacts.ts
new file mode 100644
index 00000000000..d911ce5601b
--- /dev/null
+++ b/packages/pieces/community/zoho-invoice/src/lib/common/api/contacts.ts
@@ -0,0 +1,540 @@
+import { HttpMethod } from '@activepieces/pieces-common';
+
+import { zohoInvoiceClient } from '../client';
+import { zohoInvoiceUtils } from '../utils';
+
+import type { ZohoInvoiceAuthValue, ZohoInvoiceOrgScope, ZohoInvoiceResponse } from '../types';
+
+async function createContact({
+ auth,
+ organizationId,
+ body,
+}: ZohoInvoiceOrgScope & {
+ auth: ZohoInvoiceAuthValue;
+ body: Record<string, unknown>;
+}): Promise<ZohoInvoiceResponse> {
+ return await zohoInvoiceClient.request<ZohoInvoiceResponse>({
+ auth,
+ organizationId,
+ method: HttpMethod.POST,
+ path: '/contacts',
+ body,
+ });
+}
+
+async function listContacts({
+ auth,
+ organizationId,
+ contactName,
+ companyName,
+ email,
+ phone,
+ filterBy,
+ searchText,
+ sortColumn,
+ page,
+ perPage,
+}: ZohoInvoiceOrgScope & {
+ auth: ZohoInvoiceAuthValue;
+ contactName?: string;
+ companyName?: string;
+ email?: string;
+ phone?: string;
+ filterBy?: string;
+ searchText?: string;
+ sortColumn?: string;
+ page?: number;
+ perPage?: number;
+}): Promise<ZohoInvoiceResponse> {
+ return await zohoInvoiceClient.request<ZohoInvoiceResponse>({
+ auth,
+ organizationId,
+ method: HttpMethod.GET,
+ path: '/contacts',
+ query: zohoInvoiceUtils.toQuery({
+ contact_name: contactName,
+ company_name: companyName,
+ email,
+ phone,
+ filter_by: filterBy,
+ search_text: searchText,
+ sort_column: sortColumn,
+ page,
+ per_page: perPage,
+ }),
+ });
+}
+
+async function getContact({
+ auth,
+ organizationId,
+ contactId,
+}: ZohoInvoiceOrgScope & {
+ auth: ZohoInvoiceAuthValue;
+ contactId: string;
+}): Promise<ZohoInvoiceContactResponse> {
+ return await zohoInvoiceClient.request<ZohoInvoiceContactResponse>({
+ auth,
+ organizationId,
+ method: HttpMethod.GET,
+ path: `/contacts/${contactId}`,
+ });
+}
+
+async function updateContact({
+ auth,
+ organizationId,
+ contactId,
+ body,
+}: ZohoInvoiceOrgScope & {
+ auth: ZohoInvoiceAuthValue;
+ contactId: string;
+ body: Record<string, unknown>;
+}): Promise<ZohoInvoiceResponse> {
+ return await zohoInvoiceClient.request<ZohoInvoiceResponse>({
+ auth,
+ organizationId,
+ method: HttpMethod.PUT,
+ path: `/contacts/${contactId}`,
+ body,
+ });
+}
+
+async function deleteContact({
+ auth,
+ organizationId,
+ contactId,
+}: ZohoInvoiceOrgScope & {
+ auth: ZohoInvoiceAuthValue;
+ contactId: string;
+}): Promise<ZohoInvoiceResponse> {
+ return await zohoInvoiceClient.request<ZohoInvoiceResponse>({
+ auth,
+ organizationId,
+ method: HttpMethod.DELETE,
+ path: `/contacts/${contactId}`,
+ });
+}
+
+async function markContactActive({
+ auth,
+ organizationId,
+ contactId,
+}: ZohoInvoiceOrgScope & {
+ auth: ZohoInvoiceAuthValue;
+ contactId: string;
+}): Promise<ZohoInvoiceResponse> {
+ return await zohoInvoiceClient.request<ZohoInvoiceResponse>({
+ auth,
+ organizationId,
+ method: HttpMethod.POST,
+ path: `/contacts/${contactId}/active`,
+ });
+}
+
+async function markContactInactive({
+ auth,
+ organizationId,
+ contactId,
+}: ZohoInvoiceOrgScope & {
+ auth: ZohoInvoiceAuthValue;
+ contactId: string;
+}): Promise<ZohoInvoiceResponse> {
+ return await zohoInvoiceClient.request<ZohoInvoiceResponse>({
+ auth,
+ organizationId,
+ method: HttpMethod.POST,
+ path: `/contacts/${contactId}/inactive`,
+ });
+}
+
+async function listContactAddresses({
+ auth,
+ organizationId,
+ contactId,
+}: ZohoInvoiceOrgScope & {
+ auth: ZohoInvoiceAuthValue;
+ contactId: string;
+}): Promise<ZohoInvoiceResponse> {
+ return await zohoInvoiceClient.request<ZohoInvoiceResponse>({
+ auth,
+ organizationId,
+ method: HttpMethod.GET,
+ path: `/contacts/${contactId}/address`,
+ });
+}
+
+async function addContactAddress({
+ auth,
+ organizationId,
+ contactId,
+ body,
+}: ZohoInvoiceOrgScope & {
+ auth: ZohoInvoiceAuthValue;
+ contactId: string;
+ body: Record<string, unknown>;
+}): Promise<ZohoInvoiceResponse> {
+ return await zohoInvoiceClient.request<ZohoInvoiceResponse>({
+ auth,
+ organizationId,
+ method: HttpMethod.POST,
+ path: `/contacts/${contactId}/address`,
+ body,
+ });
+}
+
+async function updateContactAddress({
+ auth,
+ organizationId,
+ contactId,
+ addressId,
+ body,
+}: ZohoInvoiceOrgScope & {
+ auth: ZohoInvoiceAuthValue;
+ contactId: string;
+ addressId: string;
+ body: Record<string, unknown>;
+}): Promise<ZohoInvoiceResponse> {
+ return await zohoInvoiceClient.request<ZohoInvoiceResponse>({
+ auth,
+ organizationId,
+ method: HttpMethod.PUT,
+ path: `/contacts/${contactId}/address/${addressId}`,
+ body: { ...body, address_id: addressId },
+ });
+}
+
+async function deleteContactAddress({
+ auth,
+ organizationId,
+ contactId,
+ addressId,
+}: ZohoInvoiceOrgScope & {
+ auth: ZohoInvoiceAuthValue;
+ contactId: string;
+ addressId: string;
+}): Promise<ZohoInvoiceResponse> {
+ return await zohoInvoiceClient.request<ZohoInvoiceResponse>({
+ auth,
+ organizationId,
+ method: HttpMethod.DELETE,
+ path: `/contacts/${contactId}/address/${addressId}`,
+ });
+}
+
+async function listContactComments({
+ auth,
+ organizationId,
+ contactId,
+ page,
+ perPage,
+}: ZohoInvoiceOrgScope & {
+ auth: ZohoInvoiceAuthValue;
+ contactId: string;
+ page?: number;
+ perPage?: number;
+}): Promise<ZohoInvoiceResponse> {
+ return await zohoInvoiceClient.request<ZohoInvoiceResponse>({
+ auth,
+ organizationId,
+ method: HttpMethod.GET,
+ path: `/contacts/${contactId}/comments`,
+ query: zohoInvoiceUtils.toQuery({ page, per_page: perPage }),
+ });
+}
+
+async function emailContact({
+ auth,
+ organizationId,
+ contactId,
+ sendCustomerStatement,
+ body,
+}: ZohoInvoiceOrgScope & {
+ auth: ZohoInvoiceAuthValue;
+ contactId: string;
+ sendCustomerStatement?: boolean;
+ body: Record<string, unknown>;
+}): Promise<ZohoInvoiceResponse> {
+ return await zohoInvoiceClient.request<ZohoInvoiceResponse>({
+ auth,
+ organizationId,
+ method: HttpMethod.POST,
+ path: `/contacts/${contactId}/email`,
+ query: zohoInvoiceUtils.toQuery({ send_customer_statement: sendCustomerStatement }),
+ body,
+ });
+}
+
+async function disableContactPaymentReminders({
+ auth,
+ organizationId,
+ contactId,
+}: ZohoInvoiceOrgScope & {
+ auth: ZohoInvoiceAuthValue;
+ contactId: string;
+}): Promise<ZohoInvoiceResponse> {
+ return await zohoInvoiceClient.request<ZohoInvoiceResponse>({
+ auth,
+ organizationId,
+ method: HttpMethod.POST,
+ path: `/contacts/${contactId}/paymentreminder/disable`,
+ });
+}
+
+async function enableContactPaymentReminders({
+ auth,
+ organizationId,
+ contactId,
+}: ZohoInvoiceOrgScope & {
+ auth: ZohoInvoiceAuthValue;
+ contactId: string;
+}): Promise<ZohoInvoiceResponse> {
+ return await zohoInvoiceClient.request<ZohoInvoiceResponse>({
+ auth,
+ organizationId,
+ method: HttpMethod.POST,
+ path: `/contacts/${contactId}/paymentreminder/enable`,
+ });
+}
+
+async function enableContactPortalAccess({
+ auth,
+ organizationId,
+ contactId,
+ contactPersonIds,
+}: ZohoInvoiceOrgScope & {
+ auth: ZohoInvoiceAuthValue;
+ contactId: string;
+ contactPersonIds: string[];
+}): Promise<ZohoInvoiceResponse> {
+ return await zohoInvoiceClient.request<ZohoInvoiceResponse>({
+ auth,
+ organizationId,
+ method: HttpMethod.POST,
+ path: `/contacts/${contactId}/portal/enable`,
+ body: {
+ contact_persons: contactPersonIds.map((contactPersonId) => ({
+ contact_person_id: contactPersonId,
+ })),
+ },
+ });
+}
+
+async function listContactRefunds({
+ auth,
+ organizationId,
+ contactId,
+ page,
+ perPage,
+}: ZohoInvoiceOrgScope & {
+ auth: ZohoInvoiceAuthValue;
+ contactId: string;
+ page?: number;
+ perPage?: number;
+}): Promise<ZohoInvoiceResponse> {
+ return await zohoInvoiceClient.request<ZohoInvoiceResponse>({
+ auth,
+ organizationId,
+ method: HttpMethod.GET,
+ path: `/contacts/${contactId}/refunds`,
+ query: zohoInvoiceUtils.toQuery({ page, per_page: perPage }),
+ });
+}
+
+async function emailContactStatement({
+ auth,
+ organizationId,
+ contactId,
+ startDate,
+ endDate,
+ body,
+}: ZohoInvoiceOrgScope & {
+ auth: ZohoInvoiceAuthValue;
+ contactId: string;
+ startDate?: string;
+ endDate?: string;
+ body: Record<string, unknown>;
+}): Promise<ZohoInvoiceResponse> {
+ return await zohoInvoiceClient.request<ZohoInvoiceResponse>({
+ auth,
+ organizationId,
+ method: HttpMethod.POST,
+ path: `/contacts/${contactId}/statements/email`,
+ query: zohoInvoiceUtils.toQuery({ start_date: startDate, end_date: endDate }),
+ body,
+ });
+}
+
+async function getContactStatementEmailContent({
+ auth,
+ organizationId,
+ contactId,
+ startDate,
+ endDate,
+}: ZohoInvoiceOrgScope & {
+ auth: ZohoInvoiceAuthValue;
+ contactId: string;
+ startDate?: string;
+ endDate?: string;
+}): Promise<ZohoInvoiceResponse> {
+ return await zohoInvoiceClient.request<ZohoInvoiceResponse>({
+ auth,
+ organizationId,
+ method: HttpMethod.GET,
+ path: `/contacts/${contactId}/statements/email`,
+ query: zohoInvoiceUtils.toQuery({ start_date: startDate, end_date: endDate }),
+ });
+}
+
+async function createContactPerson({
+ auth,
+ organizationId,
+ body,
+}: ZohoInvoiceOrgScope & {
+ auth: ZohoInvoiceAuthValue;
+ body: Record<string, unknown>;
+}): Promise<ZohoInvoiceResponse> {
+ return await zohoInvoiceClient.request<ZohoInvoiceResponse>({
+ auth,
+ organizationId,
+ method: HttpMethod.POST,
+ path: '/contacts/contactpersons',
+ body,
+ });
+}
+
+async function listContactPersons({
+ auth,
+ organizationId,
+ contactId,
+ page,
+ perPage,
+}: ZohoInvoiceOrgScope & {
+ auth: ZohoInvoiceAuthValue;
+ contactId: string;
+ page?: number;
+ perPage?: number;
+}): Promise<ZohoInvoiceResponse> {
+ return await zohoInvoiceClient.request<ZohoInvoiceResponse>({
+ auth,
+ organizationId,
+ method: HttpMethod.GET,
+ path: `/contacts/${contactId}/contactpersons`,
+ query: zohoInvoiceUtils.toQuery({ page, per_page: perPage }),
+ });
+}
+
+async function getContactPerson({
+ auth,
+ organizationId,
+ contactId,
+ contactPersonId,
+}: ZohoInvoiceOrgScope & {
+ auth: ZohoInvoiceAuthValue;
+ contactId: string;
+ contactPersonId: string;
+}): Promise<ZohoInvoiceContactPersonResponse> {
+ return await zohoInvoiceClient.request<ZohoInvoiceContactPersonResponse>({
+ auth,
+ organizationId,
+ method: HttpMethod.GET,
+ path: `/contacts/${contactId}/contactpersons/${contactPersonId}`,
+ });
+}
+
+async function updateContactPerson({
+ auth,
+ organizationId,
+ contactPersonId,
+ body,
+}: ZohoInvoiceOrgScope & {
+ auth: ZohoInvoiceAuthValue;
+ contactPersonId: string;
+ body: Record<string, unknown>;
+}): Promise<ZohoInvoiceResponse> {
+ return await zohoInvoiceClient.request<ZohoInvoiceResponse>({
+ auth,
+ organizationId,
+ method: HttpMethod.PUT,
+ path: `/contacts/contactpersons/${contactPersonId}`,
+ body,
+ });
+}
+
+async function deleteContactPerson({
+ auth,
+ organizationId,
+ contactPersonId,
+}: ZohoInvoiceOrgScope & {
+ auth: ZohoInvoiceAuthValue;
+ contactPersonId: string;
+}): Promise<ZohoInvoiceResponse> {
+ return await zohoInvoiceClient.request<ZohoInvoiceResponse>({
+ auth,
+ organizationId,
+ method: HttpMethod.DELETE,
+ path: `/contacts/contactpersons/${contactPersonId}`,
+ });
+}
+
+async function markContactPersonPrimary({
+ auth,
+ organizationId,
+ contactPersonId,
+}: ZohoInvoiceOrgScope & {
+ auth: ZohoInvoiceAuthValue;
+ contactPersonId: string;
+}): Promise<ZohoInvoiceResponse> {
+ return await zohoInvoiceClient.request<ZohoInvoiceResponse>({
+ auth,
+ organizationId,
+ method: HttpMethod.POST,
+ path: `/contacts/contactpersons/${contactPersonId}/primary`,
+ });
+}
+
+export const contactsApi = {
+ createContact,
+ listContacts,
+ getContact,
+ updateContact,
+ deleteContact,
+ markContactActive,
+ markContactInactive,
+ listContactAddresses,
+ addContactAddress,
+ updateContactAddress,
+ deleteContactAddress,
+ listContactComments,
+ emailContact,
+ disableContactPaymentReminders,
+ enableContactPaymentReminders,
+ enableContactPortalAccess,
+ listContactRefunds,
+ emailContactStatement,
+ getContactStatementEmailContent,
+ createContactPerson,
+ listContactPersons,
+ getContactPerson,
+ updateContactPerson,
+ deleteContactPerson,
+ markContactPersonPrimary,
+};
+
+export type ZohoInvoiceContactResponse = ZohoInvoiceResponse & {
+ contact?: { contact_name?: string };
+};
+
+export type ZohoInvoiceContactPersonResponse = ZohoInvoiceResponse & {
+ contact_person?: {
+ salutation?: string;
+ first_name?: string;
+ last_name?: string;
+ email?: string;
+ phone?: string;
+ mobile?: string;
+ skype?: string;
+ designation?: string;
+ department?: string;
+ };
+};
diff --git a/packages/pieces/community/zoho-invoice/src/lib/common/api/credit-notes.ts b/packages/pieces/community/zoho-invoice/src/lib/common/api/credit-notes.ts
new file mode 100644
index 00000000000..717616fb694
--- /dev/null
+++ b/packages/pieces/community/zoho-invoice/src/lib/common/api/credit-notes.ts
@@ -0,0 +1,498 @@
+import { HttpMethod } from '@activepieces/pieces-common';
+
+import { zohoInvoiceClient } from '../client';
+import { zohoInvoiceUtils } from '../utils';
+
+import type { ZohoInvoiceAuthValue, ZohoInvoiceOrgScope, ZohoInvoiceResponse } from '../types';
+
+async function createCreditNote({
+ auth,
+ organizationId,
+ invoiceId,
+ ignoreAutoNumberGeneration,
+ body,
+}: ZohoInvoiceOrgScope & {
+ auth: ZohoInvoiceAuthValue;
+ invoiceId?: string;
+ ignoreAutoNumberGeneration?: boolean;
+ body: Record<string, unknown>;
+}): Promise<ZohoInvoiceResponse> {
+ return await zohoInvoiceClient.request<ZohoInvoiceResponse>({
+ auth,
+ organizationId,
+ method: HttpMethod.POST,
+ path: '/creditnotes',
+ query: zohoInvoiceUtils.toQuery({
+ invoice_id: invoiceId,
+ ignore_auto_number_generation: ignoreAutoNumberGeneration,
+ }),
+ body,
+ });
+}
+
+async function listCreditNotes({
+ auth,
+ organizationId,
+ filterBy,
+ customerId,
+ date,
+ searchText,
+ sortColumn,
+ page,
+ perPage,
+}: ZohoInvoiceOrgScope & {
+ auth: ZohoInvoiceAuthValue;
+ filterBy?: string;
+ customerId?: string;
+ date?: string;
+ searchText?: string;
+ sortColumn?: string;
+ page?: number;
+ perPage?: number;
+}): Promise<ZohoInvoiceResponse> {
+ return await zohoInvoiceClient.request<ZohoInvoiceResponse>({
+ auth,
+ organizationId,
+ method: HttpMethod.GET,
+ path: '/creditnotes',
+ query: zohoInvoiceUtils.toQuery({
+ filter_by: filterBy,
+ customer_id: customerId,
+ date,
+ search_text: searchText,
+ sort_column: sortColumn,
+ page,
+ per_page: perPage,
+ }),
+ });
+}
+
+async function getCreditNote({
+ auth,
+ organizationId,
+ creditNoteId,
+}: ZohoInvoiceOrgScope & {
+ auth: ZohoInvoiceAuthValue;
+ creditNoteId: string;
+}): Promise<ZohoInvoiceCreditNoteResponse> {
+ return await zohoInvoiceClient.request<ZohoInvoiceCreditNoteResponse>({
+ auth,
+ organizationId,
+ method: HttpMethod.GET,
+ path: `/creditnotes/${creditNoteId}`,
+ });
+}
+
+async function updateCreditNote({
+ auth,
+ organizationId,
+ creditNoteId,
+ ignoreAutoNumberGeneration,
+ body,
+}: ZohoInvoiceOrgScope & {
+ auth: ZohoInvoiceAuthValue;
+ creditNoteId: string;
+ ignoreAutoNumberGeneration?: boolean;
+ body: Record<string, unknown>;
+}): Promise<ZohoInvoiceResponse> {
+ return await zohoInvoiceClient.request<ZohoInvoiceResponse>({
+ auth,
+ organizationId,
+ method: HttpMethod.PUT,
+ path: `/creditnotes/${creditNoteId}`,
+ query: zohoInvoiceUtils.toQuery({
+ ignore_auto_number_generation: ignoreAutoNumberGeneration,
+ }),
+ body,
+ });
+}
+
+async function deleteCreditNote({
+ auth,
+ organizationId,
+ creditNoteId,
+}: ZohoInvoiceOrgScope & {
+ auth: ZohoInvoiceAuthValue;
+ creditNoteId: string;
+}): Promise<ZohoInvoiceResponse> {
+ return await zohoInvoiceClient.request<ZohoInvoiceResponse>({
+ auth,
+ organizationId,
+ method: HttpMethod.DELETE,
+ path: `/creditnotes/${creditNoteId}`,
+ });
+}
+
+async function voidCreditNote({
+ auth,
+ organizationId,
+ creditNoteId,
+}: ZohoInvoiceOrgScope & {
+ auth: ZohoInvoiceAuthValue;
+ creditNoteId: string;
+}): Promise<ZohoInvoiceResponse> {
+ return await zohoInvoiceClient.request<ZohoInvoiceResponse>({
+ auth,
+ organizationId,
+ method: HttpMethod.POST,
+ path: `/creditnotes/${creditNoteId}/void`,
+ });
+}
+
+async function reopenCreditNote({
+ auth,
+ organizationId,
+ creditNoteId,
+}: ZohoInvoiceOrgScope & {
+ auth: ZohoInvoiceAuthValue;
+ creditNoteId: string;
+}): Promise<ZohoInvoiceResponse> {
+ return await zohoInvoiceClient.request<ZohoInvoiceResponse>({
+ auth,
+ organizationId,
+ method: HttpMethod.POST,
+ path: `/creditnotes/${creditNoteId}/status/open`,
+ });
+}
+
+async function emailCreditNote({
+ auth,
+ organizationId,
+ creditNoteId,
+ body,
+}: ZohoInvoiceOrgScope & {
+ auth: ZohoInvoiceAuthValue;
+ creditNoteId: string;
+ body: Record<string, unknown>;
+}): Promise<ZohoInvoiceResponse> {
+ return await zohoInvoiceClient.request<ZohoInvoiceResponse>({
+ auth,
+ organizationId,
+ method: HttpMethod.POST,
+ path: `/creditnotes/${creditNoteId}/email`,
+ body,
+ });
+}
+
+async function getCreditNoteEmailHistory({
+ auth,
+ organizationId,
+ creditNoteId,
+}: ZohoInvoiceOrgScope & {
+ auth: ZohoInvoiceAuthValue;
+ creditNoteId: string;
+}): Promise<ZohoInvoiceResponse> {
+ return await zohoInvoiceClient.request<ZohoInvoiceResponse>({
+ auth,
+ organizationId,
+ method: HttpMethod.GET,
+ path: `/creditnotes/${creditNoteId}/emailhistory`,
+ });
+}
+
+async function applyCreditNoteToInvoices({
+ auth,
+ organizationId,
+ creditNoteId,
+ body,
+}: ZohoInvoiceOrgScope & {
+ auth: ZohoInvoiceAuthValue;
+ creditNoteId: string;
+ body: Record<string, unknown>;
+}): Promise<ZohoInvoiceResponse> {
+ return await zohoInvoiceClient.request<ZohoInvoiceResponse>({
+ auth,
+ organizationId,
+ method: HttpMethod.POST,
+ path: `/creditnotes/${creditNoteId}/invoices`,
+ body,
+ });
+}
+
+async function listCreditNoteInvoices({
+ auth,
+ organizationId,
+ creditNoteId,
+}: ZohoInvoiceOrgScope & {
+ auth: ZohoInvoiceAuthValue;
+ creditNoteId: string;
+}): Promise<ZohoInvoiceResponse> {
+ return await zohoInvoiceClient.request<ZohoInvoiceResponse>({
+ auth,
+ organizationId,
+ method: HttpMethod.GET,
+ path: `/creditnotes/${creditNoteId}/invoices`,
+ });
+}
+
+async function removeCreditNoteFromInvoice({
+ auth,
+ organizationId,
+ creditNoteId,
+ creditNoteInvoiceId,
+}: ZohoInvoiceOrgScope & {
+ auth: ZohoInvoiceAuthValue;
+ creditNoteId: string;
+ creditNoteInvoiceId: string;
+}): Promise<ZohoInvoiceResponse> {
+ return await zohoInvoiceClient.request<ZohoInvoiceResponse>({
+ auth,
+ organizationId,
+ method: HttpMethod.DELETE,
+ path: `/creditnotes/${creditNoteId}/invoices/${creditNoteInvoiceId}`,
+ });
+}
+
+async function refundCreditNote({
+ auth,
+ organizationId,
+ creditNoteId,
+ body,
+}: ZohoInvoiceOrgScope & {
+ auth: ZohoInvoiceAuthValue;
+ creditNoteId: string;
+ body: Record<string, unknown>;
+}): Promise<ZohoInvoiceResponse> {
+ return await zohoInvoiceClient.request<ZohoInvoiceResponse>({
+ auth,
+ organizationId,
+ method: HttpMethod.POST,
+ path: `/creditnotes/${creditNoteId}/refunds`,
+ body,
+ });
+}
+
+async function listCreditNoteRefunds({
+ auth,
+ organizationId,
+ creditNoteId,
+ page,
+ perPage,
+}: ZohoInvoiceOrgScope & {
+ auth: ZohoInvoiceAuthValue;
+ creditNoteId: string;
+ page?: number;
+ perPage?: number;
+}): Promise<ZohoInvoiceResponse> {
+ return await zohoInvoiceClient.request<ZohoInvoiceResponse>({
+ auth,
+ organizationId,
+ method: HttpMethod.GET,
+ path: `/creditnotes/${creditNoteId}/refunds`,
+ query: zohoInvoiceUtils.toQuery({ page, per_page: perPage }),
+ });
+}
+
+async function listAllCreditNoteRefunds({
+ auth,
+ organizationId,
+ customerId,
+ sortColumn,
+ page,
+ perPage,
+}: ZohoInvoiceOrgScope & {
+ auth: ZohoInvoiceAuthValue;
+ customerId?: string;
+ sortColumn?: string;
+ page?: number;
+ perPage?: number;
+}): Promise<ZohoInvoiceResponse> {
+ return await zohoInvoiceClient.request<ZohoInvoiceResponse>({
+ auth,
+ organizationId,
+ method: HttpMethod.GET,
+ path: '/creditnotes/refunds',
+ query: zohoInvoiceUtils.toQuery({
+ customer_id: customerId,
+ sort_column: sortColumn,
+ page,
+ per_page: perPage,
+ }),
+ });
+}
+
+async function getCreditNoteRefund({
+ auth,
+ organizationId,
+ creditNoteId,
+ refundId,
+}: ZohoInvoiceOrgScope & {
+ auth: ZohoInvoiceAuthValue;
+ creditNoteId: string;
+ refundId: string;
+}): Promise<ZohoInvoiceResponse> {
+ return await zohoInvoiceClient.request<ZohoInvoiceResponse>({
+ auth,
+ organizationId,
+ method: HttpMethod.GET,
+ path: `/creditnotes/${creditNoteId}/refunds/${refundId}`,
+ });
+}
+
+async function updateCreditNoteRefund({
+ auth,
+ organizationId,
+ creditNoteId,
+ refundId,
+ body,
+}: ZohoInvoiceOrgScope & {
+ auth: ZohoInvoiceAuthValue;
+ creditNoteId: string;
+ refundId: string;
+ body: Record<string, unknown>;
+}): Promise<ZohoInvoiceResponse> {
+ return await zohoInvoiceClient.request<ZohoInvoiceResponse>({
+ auth,
+ organizationId,
+ method: HttpMethod.PUT,
+ path: `/creditnotes/${creditNoteId}/refunds/${refundId}`,
+ body,
+ });
+}
+
+async function deleteCreditNoteRefund({
+ auth,
+ organizationId,
+ creditNoteId,
+ refundId,
+}: ZohoInvoiceOrgScope & {
+ auth: ZohoInvoiceAuthValue;
+ creditNoteId: string;
+ refundId: string;
+}): Promise<ZohoInvoiceResponse> {
+ return await zohoInvoiceClient.request<ZohoInvoiceResponse>({
+ auth,
+ organizationId,
+ method: HttpMethod.DELETE,
+ path: `/creditnotes/${creditNoteId}/refunds/${refundId}`,
+ });
+}
+
+async function listCreditNoteComments({
+ auth,
+ organizationId,
+ creditNoteId,
+}: ZohoInvoiceOrgScope & {
+ auth: ZohoInvoiceAuthValue;
+ creditNoteId: string;
+}): Promise<ZohoInvoiceResponse> {
+ return await zohoInvoiceClient.request<ZohoInvoiceResponse>({
+ auth,
+ organizationId,
+ method: HttpMethod.GET,
+ path: `/creditnotes/${creditNoteId}/comments`,
+ });
+}
+
+async function addCreditNoteComment({
+ auth,
+ organizationId,
+ creditNoteId,
+ description,
+}: ZohoInvoiceOrgScope & {
+ auth: ZohoInvoiceAuthValue;
+ creditNoteId: string;
+ description: string;
+}): Promise<ZohoInvoiceResponse> {
+ return await zohoInvoiceClient.request<ZohoInvoiceResponse>({
+ auth,
+ organizationId,
+ method: HttpMethod.POST,
+ path: `/creditnotes/${creditNoteId}/comments`,
+ body: { description },
+ });
+}
+
+async function deleteCreditNoteComment({
+ auth,
+ organizationId,
+ creditNoteId,
+ commentId,
+}: ZohoInvoiceOrgScope & {
+ auth: ZohoInvoiceAuthValue;
+ creditNoteId: string;
+ commentId: string;
+}): Promise<ZohoInvoiceResponse> {
+ return await zohoInvoiceClient.request<ZohoInvoiceResponse>({
+ auth,
+ organizationId,
+ method: HttpMethod.DELETE,
+ path: `/creditnotes/${creditNoteId}/comments/${commentId}`,
+ });
+}
+
+async function listCreditNoteTemplates({
+ auth,
+ organizationId,
+}: ZohoInvoiceOrgScope & { auth: ZohoInvoiceAuthValue }): Promise<ZohoInvoiceResponse> {
+ return await zohoInvoiceClient.request<ZohoInvoiceResponse>({
+ auth,
+ organizationId,
+ method: HttpMethod.GET,
+ path: '/creditnotes/templates',
+ });
+}
+
+async function setCreditNoteTemplate({
+ auth,
+ organizationId,
+ creditNoteId,
+ templateId,
+}: ZohoInvoiceOrgScope & {
+ auth: ZohoInvoiceAuthValue;
+ creditNoteId: string;
+ templateId: string;
+}): Promise<ZohoInvoiceResponse> {
+ return await zohoInvoiceClient.request<ZohoInvoiceResponse>({
+ auth,
+ organizationId,
+ method: HttpMethod.PUT,
+ path: `/creditnotes/${creditNoteId}/templates/${templateId}`,
+ });
+}
+
+export const creditNotesApi = {
+ createCreditNote,
+ listCreditNotes,
+ getCreditNote,
+ updateCreditNote,
+ deleteCreditNote,
+ voidCreditNote,
+ reopenCreditNote,
+ emailCreditNote,
+ getCreditNoteEmailHistory,
+ applyCreditNoteToInvoices,
+ listCreditNoteInvoices,
+ removeCreditNoteFromInvoice,
+ refundCreditNote,
+ listCreditNoteRefunds,
+ listAllCreditNoteRefunds,
+ getCreditNoteRefund,
+ updateCreditNoteRefund,
+ deleteCreditNoteRefund,
+ listCreditNoteComments,
+ addCreditNoteComment,
+ deleteCreditNoteComment,
+ listCreditNoteTemplates,
+ setCreditNoteTemplate,
+};
+
+export type ZohoInvoiceCreditNoteLineItem = {
+ line_item_id?: string;
+ item_id?: string;
+ name?: string;
+ description?: string;
+ rate?: number;
+ quantity?: number;
+ discount?: number | string;
+ tax_id?: string;
+};
+
+export type ZohoInvoiceCreditNoteResponse = ZohoInvoiceResponse & {
+ creditnote?: {
+ customer_id?: string;
+ date?: string;
+ creditnote_number?: string;
+ line_items?: ZohoInvoiceCreditNoteLineItem[];
+ };
+};
diff --git a/packages/pieces/community/zoho-invoice/src/lib/common/api/customer-payments.ts b/packages/pieces/community/zoho-invoice/src/lib/common/api/customer-payments.ts
new file mode 100644
index 00000000000..a600b2bf8e0
--- /dev/null
+++ b/packages/pieces/community/zoho-invoice/src/lib/common/api/customer-payments.ts
@@ -0,0 +1,252 @@
+import { HttpMethod } from '@activepieces/pieces-common';
+
+import { zohoInvoiceClient } from '../client';
+import { zohoInvoiceUtils } from '../utils';
+
+import type { ZohoInvoiceAuthValue, ZohoInvoiceOrgScope, ZohoInvoiceResponse } from '../types';
+
+async function createCustomerPayment({
+ auth,
+ organizationId,
+ body,
+}: ZohoInvoiceOrgScope & {
+ auth: ZohoInvoiceAuthValue;
+ body: Record<string, unknown>;
+}): Promise<ZohoInvoiceResponse> {
+ return await zohoInvoiceClient.request<ZohoInvoiceResponse>({
+ auth,
+ organizationId,
+ method: HttpMethod.POST,
+ path: '/customerpayments',
+ body,
+ });
+}
+
+async function listCustomerPayments({
+ auth,
+ organizationId,
+ filterBy,
+ date,
+ searchText,
+ sortColumn,
+ page,
+ perPage,
+}: ZohoInvoiceOrgScope & {
+ auth: ZohoInvoiceAuthValue;
+ filterBy?: string;
+ date?: string;
+ searchText?: string;
+ sortColumn?: string;
+ page?: number;
+ perPage?: number;
+}): Promise<ZohoInvoiceResponse> {
+ return await zohoInvoiceClient.request<ZohoInvoiceResponse>({
+ auth,
+ organizationId,
+ method: HttpMethod.GET,
+ path: '/customerpayments',
+ query: zohoInvoiceUtils.toQuery({
+ filter_by: filterBy,
+ date,
+ search_text: searchText,
+ sort_column: sortColumn,
+ page,
+ per_page: perPage,
+ }),
+ });
+}
+
+async function getCustomerPayment({
+ auth,
+ organizationId,
+ paymentId,
+}: ZohoInvoiceOrgScope & {
+ auth: ZohoInvoiceAuthValue;
+ paymentId: string;
+}): Promise<ZohoInvoiceCustomerPaymentResponse> {
+ return await zohoInvoiceClient.request<ZohoInvoiceCustomerPaymentResponse>({
+ auth,
+ organizationId,
+ method: HttpMethod.GET,
+ path: `/customerpayments/${paymentId}`,
+ });
+}
+
+async function updateCustomerPayment({
+ auth,
+ organizationId,
+ paymentId,
+ body,
+}: ZohoInvoiceOrgScope & {
+ auth: ZohoInvoiceAuthValue;
+ paymentId: string;
+ body: Record<string, unknown>;
+}): Promise<ZohoInvoiceResponse> {
+ return await zohoInvoiceClient.request<ZohoInvoiceResponse>({
+ auth,
+ organizationId,
+ method: HttpMethod.PUT,
+ path: `/customerpayments/${paymentId}`,
+ body,
+ });
+}
+
+async function deleteCustomerPayment({
+ auth,
+ organizationId,
+ paymentId,
+}: ZohoInvoiceOrgScope & {
+ auth: ZohoInvoiceAuthValue;
+ paymentId: string;
+}): Promise<ZohoInvoiceResponse> {
+ return await zohoInvoiceClient.request<ZohoInvoiceResponse>({
+ auth,
+ organizationId,
+ method: HttpMethod.DELETE,
+ path: `/customerpayments/${paymentId}`,
+ });
+}
+
+async function refundCustomerPayment({
+ auth,
+ organizationId,
+ paymentId,
+ body,
+}: ZohoInvoiceOrgScope & {
+ auth: ZohoInvoiceAuthValue;
+ paymentId: string;
+ body: Record<string, unknown>;
+}): Promise<ZohoInvoiceResponse> {
+ return await zohoInvoiceClient.request<ZohoInvoiceResponse>({
+ auth,
+ organizationId,
+ method: HttpMethod.POST,
+ path: `/customerpayments/${paymentId}/refunds`,
+ body,
+ });
+}
+
+async function listCustomerPaymentRefunds({
+ auth,
+ organizationId,
+ paymentId,
+ page,
+ perPage,
+}: ZohoInvoiceOrgScope & {
+ auth: ZohoInvoiceAuthValue;
+ paymentId: string;
+ page?: number;
+ perPage?: number;
+}): Promise<ZohoInvoiceResponse> {
+ return await zohoInvoiceClient.request<ZohoInvoiceResponse>({
+ auth,
+ organizationId,
+ method: HttpMethod.GET,
+ path: `/customerpayments/${paymentId}/refunds`,
+ query: zohoInvoiceUtils.toQuery({ page, per_page: perPage }),
+ });
+}
+
+async function getCustomerPaymentRefund({
+ auth,
+ organizationId,
+ paymentId,
+ refundId,
+}: ZohoInvoiceOrgScope & {
+ auth: ZohoInvoiceAuthValue;
+ paymentId: string;
+ refundId: string;
+}): Promise<ZohoInvoiceCustomerPaymentRefundResponse> {
+ return await zohoInvoiceClient.request<ZohoInvoiceCustomerPaymentRefundResponse>({
+ auth,
+ organizationId,
+ method: HttpMethod.GET,
+ path: `/customerpayments/${paymentId}/refunds/${refundId}`,
+ });
+}
+
+async function updateCustomerPaymentRefund({
+ auth,
+ organizationId,
+ paymentId,
+ refundId,
+ body,
+}: ZohoInvoiceOrgScope & {
+ auth: ZohoInvoiceAuthValue;
+ paymentId: string;
+ refundId: string;
+ body: Record<string, unknown>;
+}): Promise<ZohoInvoiceResponse> {
+ return await zohoInvoiceClient.request<ZohoInvoiceResponse>({
+ auth,
+ organizationId,
+ method: HttpMethod.PUT,
+ path: `/customerpayments/${paymentId}/refunds/${refundId}`,
+ body,
+ });
+}
+
+async function deleteCustomerPaymentRefund({
+ auth,
+ organizationId,
+ paymentId,
+ refundId,
+}: ZohoInvoiceOrgScope & {
+ auth: ZohoInvoiceAuthValue;
+ paymentId: string;
+ refundId: string;
+}): Promise<ZohoInvoiceResponse> {
+ return await zohoInvoiceClient.request<ZohoInvoiceResponse>({
+ auth,
+ organizationId,
+ method: HttpMethod.DELETE,
+ path: `/customerpayments/${paymentId}/refunds/${refundId}`,
+ });
+}
+
+async function updateCustomerPaymentCustomFields({
+ auth,
+ organizationId,
+ paymentId,
+ customFields,
+}: ZohoInvoiceOrgScope & {
+ auth: ZohoInvoiceAuthValue;
+ paymentId: string;
+ customFields: unknown[];
+}): Promise<ZohoInvoiceResponse> {
+ return await zohoInvoiceClient.request<ZohoInvoiceResponse>({
+ auth,
+ organizationId,
+ method: HttpMethod.PUT,
+ path: `/customerpayment/${paymentId}/customfields`,
+ body: { custom_fields: customFields },
+ });
+}
+
+export const customerPaymentsApi = {
+ createCustomerPayment,
+ listCustomerPayments,
+ getCustomerPayment,
+ updateCustomerPayment,
+ deleteCustomerPayment,
+ refundCustomerPayment,
+ listCustomerPaymentRefunds,
+ getCustomerPaymentRefund,
+ updateCustomerPaymentRefund,
+ deleteCustomerPaymentRefund,
+ updateCustomerPaymentCustomFields,
+};
+
+export type ZohoInvoiceCustomerPaymentResponse = ZohoInvoiceResponse & {
+ payment?: {
+ customer_id?: string;
+ payment_mode?: string;
+ amount?: number;
+ date?: string;
+ invoices?: { invoice_id?: string; invoice_payment_id?: string; amount_applied?: number }[];
+ };
+};
+
+export type ZohoInvoiceCustomerPaymentRefundResponse = ZohoInvoiceResponse & {
+ payment_refunds?: { date?: string; amount?: number };
+};
diff --git a/packages/pieces/community/zoho-invoice/src/lib/common/api/estimates.ts b/packages/pieces/community/zoho-invoice/src/lib/common/api/estimates.ts
new file mode 100644
index 00000000000..d77a4e6aa1a
--- /dev/null
+++ b/packages/pieces/community/zoho-invoice/src/lib/common/api/estimates.ts
@@ -0,0 +1,427 @@
+import { HttpMethod } from '@activepieces/pieces-common';
+
+import { zohoInvoiceClient } from '../client';
+import { zohoInvoiceUtils } from '../utils';
+
+import type { ZohoInvoiceAuthValue, ZohoInvoiceOrgScope, ZohoInvoiceResponse } from '../types';
+import type { ZohoInvoiceDocumentLineItem } from './recurring-invoices';
+
+async function createEstimate({
+ auth,
+ organizationId,
+ ignoreAutoNumberGeneration,
+ body,
+}: ZohoInvoiceOrgScope & {
+ auth: ZohoInvoiceAuthValue;
+ ignoreAutoNumberGeneration?: boolean;
+ body: Record<string, unknown>;
+}): Promise<ZohoInvoiceResponse> {
+ return await zohoInvoiceClient.request<ZohoInvoiceResponse>({
+ auth,
+ organizationId,
+ method: HttpMethod.POST,
+ path: '/estimates',
+ query: zohoInvoiceUtils.toQuery({
+ ignore_auto_number_generation: ignoreAutoNumberGeneration,
+ }),
+ body,
+ });
+}
+
+async function listEstimates({
+ auth,
+ organizationId,
+ filterBy,
+ searchText,
+ customerId,
+ sortColumn,
+ sortOrder,
+ page,
+ perPage,
+}: ZohoInvoiceOrgScope & {
+ auth: ZohoInvoiceAuthValue;
+ filterBy?: string;
+ searchText?: string;
+ customerId?: string;
+ sortColumn?: string;
+ sortOrder?: string;
+ page?: number;
+ perPage?: number;
+}): Promise<ZohoInvoiceResponse> {
+ return await zohoInvoiceClient.request<ZohoInvoiceResponse>({
+ auth,
+ organizationId,
+ method: HttpMethod.GET,
+ path: '/estimates',
+ query: zohoInvoiceUtils.toQuery({
+ filter_by: filterBy,
+ search_text: searchText,
+ customer_id: customerId,
+ sort_column: sortColumn,
+ sort_order: sortOrder,
+ page,
+ per_page: perPage,
+ }),
+ });
+}
+
+async function getEstimate({
+ auth,
+ organizationId,
+ estimateId,
+}: ZohoInvoiceOrgScope & {
+ auth: ZohoInvoiceAuthValue;
+ estimateId: string;
+}): Promise<ZohoInvoiceEstimateResponse> {
+ return await zohoInvoiceClient.request<ZohoInvoiceEstimateResponse>({
+ auth,
+ organizationId,
+ method: HttpMethod.GET,
+ path: `/estimates/${estimateId}`,
+ });
+}
+
+async function updateEstimate({
+ auth,
+ organizationId,
+ estimateId,
+ ignoreAutoNumberGeneration,
+ body,
+}: ZohoInvoiceOrgScope & {
+ auth: ZohoInvoiceAuthValue;
+ estimateId: string;
+ ignoreAutoNumberGeneration?: boolean;
+ body: Record<string, unknown>;
+}): Promise<ZohoInvoiceResponse> {
+ return await zohoInvoiceClient.request<ZohoInvoiceResponse>({
+ auth,
+ organizationId,
+ method: HttpMethod.PUT,
+ path: `/estimates/${estimateId}`,
+ query: zohoInvoiceUtils.toQuery({
+ ignore_auto_number_generation: ignoreAutoNumberGeneration,
+ }),
+ body,
+ });
+}
+
+async function deleteEstimate({
+ auth,
+ organizationId,
+ estimateId,
+}: ZohoInvoiceOrgScope & {
+ auth: ZohoInvoiceAuthValue;
+ estimateId: string;
+}): Promise<ZohoInvoiceResponse> {
+ return await zohoInvoiceClient.request<ZohoInvoiceResponse>({
+ auth,
+ organizationId,
+ method: HttpMethod.DELETE,
+ path: `/estimates/${estimateId}`,
+ });
+}
+
+async function emailEstimate({
+ auth,
+ organizationId,
+ estimateId,
+ body,
+}: ZohoInvoiceOrgScope & {
+ auth: ZohoInvoiceAuthValue;
+ estimateId: string;
+ body: Record<string, unknown>;
+}): Promise<ZohoInvoiceResponse> {
+ return await zohoInvoiceClient.request<ZohoInvoiceResponse>({
+ auth,
+ organizationId,
+ method: HttpMethod.POST,
+ path: `/estimates/${estimateId}/email`,
+ body,
+ });
+}
+
+async function emailMultipleEstimates({
+ auth,
+ organizationId,
+ estimateIds,
+}: ZohoInvoiceOrgScope & {
+ auth: ZohoInvoiceAuthValue;
+ estimateIds: string[];
+}): Promise<ZohoInvoiceResponse> {
+ return await zohoInvoiceClient.request<ZohoInvoiceResponse>({
+ auth,
+ organizationId,
+ method: HttpMethod.POST,
+ path: '/estimates/email',
+ query: zohoInvoiceUtils.toQuery({ estimate_ids: estimateIds.join(',') }),
+ });
+}
+
+async function getEstimateEmailContent({
+ auth,
+ organizationId,
+ estimateId,
+ emailTemplateId,
+}: ZohoInvoiceOrgScope & {
+ auth: ZohoInvoiceAuthValue;
+ estimateId: string;
+ emailTemplateId?: string;
+}): Promise<ZohoInvoiceResponse> {
+ return await zohoInvoiceClient.request<ZohoInvoiceResponse>({
+ auth,
+ organizationId,
+ method: HttpMethod.GET,
+ path: `/estimates/${estimateId}/email`,
+ query: zohoInvoiceUtils.toQuery({ email_template_id: emailTemplateId }),
+ });
+}
+
+async function markEstimateSent({
+ auth,
+ organizationId,
+ estimateId,
+}: ZohoInvoiceOrgScope & {
+ auth: ZohoInvoiceAuthValue;
+ estimateId: string;
+}): Promise<ZohoInvoiceResponse> {
+ return await zohoInvoiceClient.request<ZohoInvoiceResponse>({
+ auth,
+ organizationId,
+ method: HttpMethod.POST,
+ path: `/estimates/${estimateId}/status/sent`,
+ });
+}
+
+async function markEstimateAccepted({
+ auth,
+ organizationId,
+ estimateId,
+}: ZohoInvoiceOrgScope & {
+ auth: ZohoInvoiceAuthValue;
+ estimateId: string;
+}): Promise<ZohoInvoiceResponse> {
+ return await zohoInvoiceClient.request<ZohoInvoiceResponse>({
+ auth,
+ organizationId,
+ method: HttpMethod.POST,
+ path: `/estimates/${estimateId}/status/accepted`,
+ });
+}
+
+async function markEstimateDeclined({
+ auth,
+ organizationId,
+ estimateId,
+}: ZohoInvoiceOrgScope & {
+ auth: ZohoInvoiceAuthValue;
+ estimateId: string;
+}): Promise<ZohoInvoiceResponse> {
+ return await zohoInvoiceClient.request<ZohoInvoiceResponse>({
+ auth,
+ organizationId,
+ method: HttpMethod.POST,
+ path: `/estimates/${estimateId}/status/declined`,
+ });
+}
+
+async function listEstimateComments({
+ auth,
+ organizationId,
+ estimateId,
+}: ZohoInvoiceOrgScope & {
+ auth: ZohoInvoiceAuthValue;
+ estimateId: string;
+}): Promise<ZohoInvoiceResponse> {
+ return await zohoInvoiceClient.request<ZohoInvoiceResponse>({
+ auth,
+ organizationId,
+ method: HttpMethod.GET,
+ path: `/estimates/${estimateId}/comments`,
+ });
+}
+
+async function addEstimateComment({
+ auth,
+ organizationId,
+ estimateId,
+ body,
+}: ZohoInvoiceOrgScope & {
+ auth: ZohoInvoiceAuthValue;
+ estimateId: string;
+ body: Record<string, unknown>;
+}): Promise<ZohoInvoiceResponse> {
+ return await zohoInvoiceClient.request<ZohoInvoiceResponse>({
+ auth,
+ organizationId,
+ method: HttpMethod.POST,
+ path: `/estimates/${estimateId}/comments`,
+ body,
+ });
+}
+
+async function updateEstimateComment({
+ auth,
+ organizationId,
+ estimateId,
+ commentId,
+ body,
+}: ZohoInvoiceOrgScope & {
+ auth: ZohoInvoiceAuthValue;
+ estimateId: string;
+ commentId: string;
+ body: Record<string, unknown>;
+}): Promise<ZohoInvoiceResponse> {
+ return await zohoInvoiceClient.request<ZohoInvoiceResponse>({
+ auth,
+ organizationId,
+ method: HttpMethod.PUT,
+ path: `/estimates/${estimateId}/comments/${commentId}`,
+ body,
+ });
+}
+
+async function deleteEstimateComment({
+ auth,
+ organizationId,
+ estimateId,
+ commentId,
+}: ZohoInvoiceOrgScope & {
+ auth: ZohoInvoiceAuthValue;
+ estimateId: string;
+ commentId: string;
+}): Promise<ZohoInvoiceResponse> {
+ return await zohoInvoiceClient.request<ZohoInvoiceResponse>({
+ auth,
+ organizationId,
+ method: HttpMethod.DELETE,
+ path: `/estimates/${estimateId}/comments/${commentId}`,
+ });
+}
+
+async function updateEstimateBillingAddress({
+ auth,
+ organizationId,
+ estimateId,
+ body,
+}: ZohoInvoiceOrgScope & {
+ auth: ZohoInvoiceAuthValue;
+ estimateId: string;
+ body: Record<string, unknown>;
+}): Promise<ZohoInvoiceResponse> {
+ return await zohoInvoiceClient.request<ZohoInvoiceResponse>({
+ auth,
+ organizationId,
+ method: HttpMethod.PUT,
+ path: `/estimates/${estimateId}/address/billing`,
+ body,
+ });
+}
+
+async function updateEstimateShippingAddress({
+ auth,
+ organizationId,
+ estimateId,
+ body,
+}: ZohoInvoiceOrgScope & {
+ auth: ZohoInvoiceAuthValue;
+ estimateId: string;
+ body: Record<string, unknown>;
+}): Promise<ZohoInvoiceResponse> {
+ return await zohoInvoiceClient.request<ZohoInvoiceResponse>({
+ auth,
+ organizationId,
+ method: HttpMethod.PUT,
+ path: `/estimates/${estimateId}/address/shipping`,
+ body,
+ });
+}
+
+async function listEstimateTemplates({
+ auth,
+ organizationId,
+}: ZohoInvoiceOrgScope & { auth: ZohoInvoiceAuthValue }): Promise<ZohoInvoiceResponse> {
+ return await zohoInvoiceClient.request<ZohoInvoiceResponse>({
+ auth,
+ organizationId,
+ method: HttpMethod.GET,
+ path: '/estimates/templates',
+ });
+}
+
+async function setEstimateTemplate({
+ auth,
+ organizationId,
+ estimateId,
+ templateId,
+}: ZohoInvoiceOrgScope & {
+ auth: ZohoInvoiceAuthValue;
+ estimateId: string;
+ templateId: string;
+}): Promise<ZohoInvoiceResponse> {
+ return await zohoInvoiceClient.request<ZohoInvoiceResponse>({
+ auth,
+ organizationId,
+ method: HttpMethod.PUT,
+ path: `/estimates/${estimateId}/templates/${templateId}`,
+ });
+}
+
+async function exportEstimatesPdf({
+ auth,
+ organizationId,
+ estimateIds,
+}: ZohoInvoiceOrgScope & {
+ auth: ZohoInvoiceAuthValue;
+ estimateIds: string[];
+}): Promise<ArrayBuffer> {
+ return await zohoInvoiceClient.request<ArrayBuffer>({
+ auth,
+ organizationId,
+ method: HttpMethod.GET,
+ path: '/estimates/pdf',
+ headers: { Accept: 'application/pdf' },
+ query: zohoInvoiceUtils.toQuery({ estimate_ids: estimateIds.join(',') }),
+ responseType: 'arraybuffer',
+ });
+}
+
+export const estimatesApi = {
+ createEstimate,
+ listEstimates,
+ getEstimate,
+ updateEstimate,
+ deleteEstimate,
+ emailEstimate,
+ emailMultipleEstimates,
+ getEstimateEmailContent,
+ markEstimateSent,
+ markEstimateAccepted,
+ markEstimateDeclined,
+ listEstimateComments,
+ addEstimateComment,
+ updateEstimateComment,
+ deleteEstimateComment,
+ updateEstimateBillingAddress,
+ updateEstimateShippingAddress,
+ listEstimateTemplates,
+ setEstimateTemplate,
+ exportEstimatesPdf,
+};
+
+export type ZohoInvoiceEstimateAddress = {
+ address?: string;
+ city?: string;
+ state?: string;
+ zip?: string;
+ country?: string;
+ fax?: string;
+};
+
+export type ZohoInvoiceEstimateResponse = ZohoInvoiceResponse & {
+ estimate?: {
+ customer_id?: string;
+ line_items?: ZohoInvoiceDocumentLineItem[];
+ billing_address?: ZohoInvoiceEstimateAddress;
+ shipping_address?: ZohoInvoiceEstimateAddress;
+ };
+};
diff --git a/packages/pieces/community/zoho-invoice/src/lib/common/api/expenses.ts b/packages/pieces/community/zoho-invoice/src/lib/common/api/expenses.ts
new file mode 100644
index 00000000000..8912dd1d466
--- /dev/null
+++ b/packages/pieces/community/zoho-invoice/src/lib/common/api/expenses.ts
@@ -0,0 +1,271 @@
+import { HttpMethod } from '@activepieces/pieces-common';
+
+import { zohoInvoiceClient } from '../client';
+import { zohoInvoiceUtils } from '../utils';
+
+import type { ZohoInvoiceAuthValue, ZohoInvoiceOrgScope, ZohoInvoiceResponse } from '../types';
+
+async function createExpense({
+ auth,
+ organizationId,
+ body,
+}: ZohoInvoiceOrgScope & {
+ auth: ZohoInvoiceAuthValue;
+ body: Record<string, unknown>;
+}): Promise<ZohoInvoiceResponse> {
+ return await zohoInvoiceClient.request<ZohoInvoiceResponse>({
+ auth,
+ organizationId,
+ method: HttpMethod.POST,
+ path: '/expenses',
+ body,
+ });
+}
+
+async function listExpenses({
+ auth,
+ organizationId,
+ filterBy,
+ searchText,
+ dateStart,
+ dateEnd,
+ sortColumn,
+ page,
+ perPage,
+}: ZohoInvoiceOrgScope & {
+ auth: ZohoInvoiceAuthValue;
+ filterBy?: string;
+ searchText?: string;
+ dateStart?: string;
+ dateEnd?: string;
+ sortColumn?: string;
+ page?: number;
+ perPage?: number;
+}): Promise<ZohoInvoiceResponse> {
+ return await zohoInvoiceClient.request<ZohoInvoiceResponse>({
+ auth,
+ organizationId,
+ method: HttpMethod.GET,
+ path: '/expenses',
+ query: zohoInvoiceUtils.toQuery({
+ filter_by: filterBy,
+ search_text: searchText,
+ date_start: dateStart,
+ date_end: dateEnd,
+ sort_column: sortColumn,
+ page,
+ per_page: perPage,
+ }),
+ });
+}
+
+async function getExpense({
+ auth,
+ organizationId,
+ expenseId,
+}: ZohoInvoiceOrgScope & {
+ auth: ZohoInvoiceAuthValue;
+ expenseId: string;
+}): Promise<ZohoInvoiceExpenseResponse> {
+ return await zohoInvoiceClient.request<ZohoInvoiceExpenseResponse>({
+ auth,
+ organizationId,
+ method: HttpMethod.GET,
+ path: `/expenses/${expenseId}`,
+ });
+}
+
+async function updateExpense({
+ auth,
+ organizationId,
+ expenseId,
+ deleteReceipt,
+ body,
+}: ZohoInvoiceOrgScope & {
+ auth: ZohoInvoiceAuthValue;
+ expenseId: string;
+ deleteReceipt?: boolean;
+ body: Record<string, unknown>;
+}): Promise<ZohoInvoiceResponse> {
+ return await zohoInvoiceClient.request<ZohoInvoiceResponse>({
+ auth,
+ organizationId,
+ method: HttpMethod.PUT,
+ path: `/expenses/${expenseId}`,
+ query: zohoInvoiceUtils.toQuery({ delete_receipt: deleteReceipt }),
+ body,
+ });
+}
+
+async function deleteExpense({
+ auth,
+ organizationId,
+ expenseId,
+}: ZohoInvoiceOrgScope & {
+ auth: ZohoInvoiceAuthValue;
+ expenseId: string;
+}): Promise<ZohoInvoiceResponse> {
+ return await zohoInvoiceClient.request<ZohoInvoiceResponse>({
+ auth,
+ organizationId,
+ method: HttpMethod.DELETE,
+ path: `/expenses/${expenseId}`,
+ });
+}
+
+async function listExpenseHistory({
+ auth,
+ organizationId,
+ expenseId,
+}: ZohoInvoiceOrgScope & {
+ auth: ZohoInvoiceAuthValue;
+ expenseId: string;
+}): Promise<ZohoInvoiceResponse> {
+ return await zohoInvoiceClient.request<ZohoInvoiceResponse>({
+ auth,
+ organizationId,
+ method: HttpMethod.GET,
+ path: `/expenses/${expenseId}/comments`,
+ });
+}
+
+async function createExpenseCategory({
+ auth,
+ organizationId,
+ body,
+}: ZohoInvoiceOrgScope & {
+ auth: ZohoInvoiceAuthValue;
+ body: Record<string, unknown>;
+}): Promise<ZohoInvoiceResponse> {
+ return await zohoInvoiceClient.request<ZohoInvoiceResponse>({
+ auth,
+ organizationId,
+ method: HttpMethod.POST,
+ path: '/expensecategories',
+ body,
+ });
+}
+
+async function listExpenseCategories({
+ auth,
+ organizationId,
+ filterBy,
+ page,
+ perPage,
+}: ZohoInvoiceOrgScope & {
+ auth: ZohoInvoiceAuthValue;
+ filterBy?: string;
+ page?: number;
+ perPage?: number;
+}): Promise<ZohoInvoiceResponse> {
+ return await zohoInvoiceClient.request<ZohoInvoiceResponse>({
+ auth,
+ organizationId,
+ method: HttpMethod.GET,
+ path: '/expensecategories',
+ query: zohoInvoiceUtils.toQuery({ filter_by: filterBy, page, per_page: perPage }),
+ });
+}
+
+async function getExpenseCategory({
+ auth,
+ organizationId,
+ expenseCategoryId,
+}: ZohoInvoiceOrgScope & {
+ auth: ZohoInvoiceAuthValue;
+ expenseCategoryId: string;
+}): Promise<ZohoInvoiceResponse> {
+ return await zohoInvoiceClient.request<ZohoInvoiceResponse>({
+ auth,
+ organizationId,
+ method: HttpMethod.GET,
+ path: `/expensecategories/${expenseCategoryId}`,
+ });
+}
+
+async function updateExpenseCategory({
+ auth,
+ organizationId,
+ expenseCategoryId,
+ body,
+}: ZohoInvoiceOrgScope & {
+ auth: ZohoInvoiceAuthValue;
+ expenseCategoryId: string;
+ body: Record<string, unknown>;
+}): Promise<ZohoInvoiceResponse> {
+ return await zohoInvoiceClient.request<ZohoInvoiceResponse>({
+ auth,
+ organizationId,
+ method: HttpMethod.PUT,
+ path: `/expensecategories/${expenseCategoryId}`,
+ body,
+ });
+}
+
+async function deleteExpenseCategory({
+ auth,
+ organizationId,
+ expenseCategoryId,
+}: ZohoInvoiceOrgScope & {
+ auth: ZohoInvoiceAuthValue;
+ expenseCategoryId: string;
+}): Promise<ZohoInvoiceResponse> {
+ return await zohoInvoiceClient.request<ZohoInvoiceResponse>({
+ auth,
+ organizationId,
+ method: HttpMethod.DELETE,
+ path: `/expensecategories/${expenseCategoryId}`,
+ });
+}
+
+async function markExpenseCategoryActive({
+ auth,
+ organizationId,
+ expenseCategoryId,
+}: ZohoInvoiceOrgScope & {
+ auth: ZohoInvoiceAuthValue;
+ expenseCategoryId: string;
+}): Promise<ZohoInvoiceResponse> {
+ return await zohoInvoiceClient.request<ZohoInvoiceResponse>({
+ auth,
+ organizationId,
+ method: HttpMethod.POST,
+ path: `/expensecategories/${expenseCategoryId}/active`,
+ });
+}
+
+async function markExpenseCategoryInactive({
+ auth,
+ organizationId,
+ expenseCategoryId,
+}: ZohoInvoiceOrgScope & {
+ auth: ZohoInvoiceAuthValue;
+ expenseCategoryId: string;
+}): Promise<ZohoInvoiceResponse> {
+ return await zohoInvoiceClient.request<ZohoInvoiceResponse>({
+ auth,
+ organizationId,
+ method: HttpMethod.POST,
+ path: `/expensecategories/${expenseCategoryId}/inactive`,
+ });
+}
+
+export const expensesApi = {
+ createExpense,
+ listExpenses,
+ getExpense,
+ updateExpense,
+ deleteExpense,
+ listExpenseHistory,
+ createExpenseCategory,
+ listExpenseCategories,
+ getExpenseCategory,
+ updateExpenseCategory,
+ deleteExpenseCategory,
+ markExpenseCategoryActive,
+ markExpenseCategoryInactive,
+};
+
+export type ZohoInvoiceExpenseResponse = ZohoInvoiceResponse & {
+ expense?: { amount?: number; reference_number?: string };
+};
diff --git a/packages/pieces/community/zoho-invoice/src/lib/common/api/index.ts b/packages/pieces/community/zoho-invoice/src/lib/common/api/index.ts
new file mode 100644
index 00000000000..f98199c0fcf
--- /dev/null
+++ b/packages/pieces/community/zoho-invoice/src/lib/common/api/index.ts
@@ -0,0 +1,25 @@
+import { contactsApi } from './contacts';
+import { creditNotesApi } from './credit-notes';
+import { customerPaymentsApi } from './customer-payments';
+import { estimatesApi } from './estimates';
+import { expensesApi } from './expenses';
+import { invoicesApi } from './invoices';
+import { itemsApi } from './items';
+import { organizationsApi } from './organizations';
+import { projectsApi } from './projects';
+import { recurringInvoicesApi } from './recurring-invoices';
+import { settingsApi } from './settings';
+
+export const zohoInvoiceApi = {
+ ...organizationsApi,
+ ...contactsApi,
+ ...invoicesApi,
+ ...recurringInvoicesApi,
+ ...estimatesApi,
+ ...creditNotesApi,
+ ...customerPaymentsApi,
+ ...itemsApi,
+ ...expensesApi,
+ ...projectsApi,
+ ...settingsApi,
+};
diff --git a/packages/pieces/community/zoho-invoice/src/lib/common/api/invoices.ts b/packages/pieces/community/zoho-invoice/src/lib/common/api/invoices.ts
new file mode 100644
index 00000000000..5cb5bf76e3f
--- /dev/null
+++ b/packages/pieces/community/zoho-invoice/src/lib/common/api/invoices.ts
@@ -0,0 +1,693 @@
+import { HttpMethod } from '@activepieces/pieces-common';
+
+import { zohoInvoiceClient } from '../client';
+import { zohoInvoiceUtils } from '../utils';
+
+import type {
+ ZohoInvoiceAuthValue,
+ ZohoInvoiceInvoice,
+ ZohoInvoiceListInvoicesResponse,
+ ZohoInvoiceOrgScope,
+ ZohoInvoiceResponse,
+} from '../types';
+
+async function listInvoices({
+ auth,
+ lastModifiedAt,
+}: {
+ auth: ZohoInvoiceAuthValue;
+ lastModifiedAt?: string;
+}): Promise<ZohoInvoiceInvoice[]> {
+ const query: { last_modified_at?: string } = {};
+ if (lastModifiedAt) query.last_modified_at = lastModifiedAt;
+ const response = await zohoInvoiceClient.request<ZohoInvoiceListInvoicesResponse>({
+ auth,
+ method: HttpMethod.GET,
+ path: '/invoices',
+ query,
+ });
+ return response.invoices ?? [];
+}
+
+async function searchInvoices({
+ auth,
+ organizationId,
+ status,
+ customerId,
+ searchText,
+ invoiceNumber,
+ dateStart,
+ dateEnd,
+ sortColumn,
+ page,
+ perPage,
+}: ZohoInvoiceOrgScope & {
+ auth: ZohoInvoiceAuthValue;
+ status?: string;
+ customerId?: string;
+ searchText?: string;
+ invoiceNumber?: string;
+ dateStart?: string;
+ dateEnd?: string;
+ sortColumn?: string;
+ page?: number;
+ perPage?: number;
+}): Promise<ZohoInvoiceResponse> {
+ return await zohoInvoiceClient.request<ZohoInvoiceResponse>({
+ auth,
+ organizationId,
+ method: HttpMethod.GET,
+ path: '/invoices',
+ query: zohoInvoiceUtils.toQuery({
+ status,
+ customer_id: customerId,
+ search_text: searchText,
+ invoice_number: invoiceNumber,
+ date_start: dateStart,
+ date_end: dateEnd,
+ sort_column: sortColumn,
+ page,
+ per_page: perPage,
+ }),
+ });
+}
+
+async function getInvoice({
+ auth,
+ organizationId,
+ invoiceId,
+}: ZohoInvoiceOrgScope & {
+ auth: ZohoInvoiceAuthValue;
+ invoiceId: string;
+}): Promise<ZohoInvoiceInvoiceResponse> {
+ return await zohoInvoiceClient.request<ZohoInvoiceInvoiceResponse>({
+ auth,
+ organizationId,
+ method: HttpMethod.GET,
+ path: `/invoices/${invoiceId}`,
+ });
+}
+
+async function createInvoice({
+ auth,
+ organizationId,
+ send,
+ ignoreAutoNumberGeneration,
+ body,
+}: ZohoInvoiceOrgScope & {
+ auth: ZohoInvoiceAuthValue;
+ send?: boolean;
+ ignoreAutoNumberGeneration?: boolean;
+ body: Record<string, unknown>;
+}): Promise<ZohoInvoiceResponse> {
+ return await zohoInvoiceClient.request<ZohoInvoiceResponse>({
+ auth,
+ organizationId,
+ method: HttpMethod.POST,
+ path: '/invoices',
+ query: zohoInvoiceUtils.toQuery({
+ send,
+ ignore_auto_number_generation: ignoreAutoNumberGeneration,
+ }),
+ body,
+ });
+}
+
+async function updateInvoice({
+ auth,
+ organizationId,
+ invoiceId,
+ ignoreAutoNumberGeneration,
+ body,
+}: ZohoInvoiceOrgScope & {
+ auth: ZohoInvoiceAuthValue;
+ invoiceId: string;
+ ignoreAutoNumberGeneration?: boolean;
+ body: Record<string, unknown>;
+}): Promise<ZohoInvoiceResponse> {
+ return await zohoInvoiceClient.request<ZohoInvoiceResponse>({
+ auth,
+ organizationId,
+ method: HttpMethod.PUT,
+ path: `/invoices/${invoiceId}`,
+ query: zohoInvoiceUtils.toQuery({
+ ignore_auto_number_generation: ignoreAutoNumberGeneration,
+ }),
+ body,
+ });
+}
+
+async function deleteInvoice({
+ auth,
+ organizationId,
+ invoiceId,
+}: ZohoInvoiceOrgScope & {
+ auth: ZohoInvoiceAuthValue;
+ invoiceId: string;
+}): Promise<ZohoInvoiceResponse> {
+ return await zohoInvoiceClient.request<ZohoInvoiceResponse>({
+ auth,
+ organizationId,
+ method: HttpMethod.DELETE,
+ path: `/invoices/${invoiceId}`,
+ });
+}
+
+async function emailInvoice({
+ auth,
+ organizationId,
+ invoiceId,
+ sendCustomerStatement,
+ sendAttachment,
+ body,
+}: ZohoInvoiceOrgScope & {
+ auth: ZohoInvoiceAuthValue;
+ invoiceId: string;
+ sendCustomerStatement?: boolean;
+ sendAttachment?: boolean;
+ body: Record<string, unknown>;
+}): Promise<ZohoInvoiceResponse> {
+ return await zohoInvoiceClient.request<ZohoInvoiceResponse>({
+ auth,
+ organizationId,
+ method: HttpMethod.POST,
+ path: `/invoices/${invoiceId}/email`,
+ query: zohoInvoiceUtils.toQuery({
+ send_customer_statement: sendCustomerStatement,
+ send_attachment: sendAttachment,
+ }),
+ body,
+ });
+}
+
+async function getInvoiceEmailContent({
+ auth,
+ organizationId,
+ invoiceId,
+}: ZohoInvoiceOrgScope & {
+ auth: ZohoInvoiceAuthValue;
+ invoiceId: string;
+}): Promise<ZohoInvoiceResponse> {
+ return await zohoInvoiceClient.request<ZohoInvoiceResponse>({
+ auth,
+ organizationId,
+ method: HttpMethod.GET,
+ path: `/invoices/${invoiceId}/email`,
+ });
+}
+
+async function markInvoiceSent({
+ auth,
+ organizationId,
+ invoiceId,
+}: ZohoInvoiceOrgScope & {
+ auth: ZohoInvoiceAuthValue;
+ invoiceId: string;
+}): Promise<ZohoInvoiceResponse> {
+ return await zohoInvoiceClient.request<ZohoInvoiceResponse>({
+ auth,
+ organizationId,
+ method: HttpMethod.POST,
+ path: `/invoices/${invoiceId}/status/sent`,
+ });
+}
+
+async function markInvoiceDraft({
+ auth,
+ organizationId,
+ invoiceId,
+}: ZohoInvoiceOrgScope & {
+ auth: ZohoInvoiceAuthValue;
+ invoiceId: string;
+}): Promise<ZohoInvoiceResponse> {
+ return await zohoInvoiceClient.request<ZohoInvoiceResponse>({
+ auth,
+ organizationId,
+ method: HttpMethod.POST,
+ path: `/invoices/${invoiceId}/status/draft`,
+ });
+}
+
+async function voidInvoice({
+ auth,
+ organizationId,
+ invoiceId,
+}: ZohoInvoiceOrgScope & {
+ auth: ZohoInvoiceAuthValue;
+ invoiceId: string;
+}): Promise<ZohoInvoiceResponse> {
+ return await zohoInvoiceClient.request<ZohoInvoiceResponse>({
+ auth,
+ organizationId,
+ method: HttpMethod.POST,
+ path: `/invoices/${invoiceId}/status/void`,
+ });
+}
+
+async function writeOffInvoice({
+ auth,
+ organizationId,
+ invoiceId,
+}: ZohoInvoiceOrgScope & {
+ auth: ZohoInvoiceAuthValue;
+ invoiceId: string;
+}): Promise<ZohoInvoiceResponse> {
+ return await zohoInvoiceClient.request<ZohoInvoiceResponse>({
+ auth,
+ organizationId,
+ method: HttpMethod.POST,
+ path: `/invoices/${invoiceId}/writeoff`,
+ });
+}
+
+async function cancelInvoiceWriteOff({
+ auth,
+ organizationId,
+ invoiceId,
+}: ZohoInvoiceOrgScope & {
+ auth: ZohoInvoiceAuthValue;
+ invoiceId: string;
+}): Promise<ZohoInvoiceResponse> {
+ return await zohoInvoiceClient.request<ZohoInvoiceResponse>({
+ auth,
+ organizationId,
+ method: HttpMethod.POST,
+ path: `/invoices/${invoiceId}/writeoff/cancel`,
+ });
+}
+
+async function sendInvoicePaymentReminder({
+ auth,
+ organizationId,
+ invoiceId,
+ sendCustomerStatement,
+ body,
+}: ZohoInvoiceOrgScope & {
+ auth: ZohoInvoiceAuthValue;
+ invoiceId: string;
+ sendCustomerStatement?: boolean;
+ body: Record<string, unknown>;
+}): Promise<ZohoInvoiceResponse> {
+ return await zohoInvoiceClient.request<ZohoInvoiceResponse>({
+ auth,
+ organizationId,
+ method: HttpMethod.POST,
+ path: `/invoices/${invoiceId}/paymentreminder`,
+ query: zohoInvoiceUtils.toQuery({ send_customer_statement: sendCustomerStatement }),
+ body,
+ });
+}
+
+async function sendBulkInvoiceReminder({
+ auth,
+ organizationId,
+ invoiceIds,
+}: ZohoInvoiceOrgScope & {
+ auth: ZohoInvoiceAuthValue;
+ invoiceIds: string[];
+}): Promise<ZohoInvoiceResponse> {
+ return await zohoInvoiceClient.request<ZohoInvoiceResponse>({
+ auth,
+ organizationId,
+ method: HttpMethod.POST,
+ path: '/invoices/paymentreminder',
+ query: zohoInvoiceUtils.toQuery({ invoice_ids: invoiceIds.join(',') }),
+ });
+}
+
+async function getInvoicePaymentReminderContent({
+ auth,
+ organizationId,
+ invoiceId,
+}: ZohoInvoiceOrgScope & {
+ auth: ZohoInvoiceAuthValue;
+ invoiceId: string;
+}): Promise<ZohoInvoiceResponse> {
+ return await zohoInvoiceClient.request<ZohoInvoiceResponse>({
+ auth,
+ organizationId,
+ method: HttpMethod.GET,
+ path: `/invoices/${invoiceId}/paymentreminder`,
+ });
+}
+
+async function enableInvoicePaymentReminder({
+ auth,
+ organizationId,
+ invoiceId,
+}: ZohoInvoiceOrgScope & {
+ auth: ZohoInvoiceAuthValue;
+ invoiceId: string;
+}): Promise<ZohoInvoiceResponse> {
+ return await zohoInvoiceClient.request<ZohoInvoiceResponse>({
+ auth,
+ organizationId,
+ method: HttpMethod.POST,
+ path: `/invoices/${invoiceId}/paymentreminder/enable`,
+ });
+}
+
+async function disableInvoicePaymentReminder({
+ auth,
+ organizationId,
+ invoiceId,
+}: ZohoInvoiceOrgScope & {
+ auth: ZohoInvoiceAuthValue;
+ invoiceId: string;
+}): Promise<ZohoInvoiceResponse> {
+ return await zohoInvoiceClient.request<ZohoInvoiceResponse>({
+ auth,
+ organizationId,
+ method: HttpMethod.POST,
+ path: `/invoices/${invoiceId}/paymentreminder/disable`,
+ });
+}
+
+async function exportInvoicesPdf({
+ auth,
+ organizationId,
+ invoiceIds,
+}: ZohoInvoiceOrgScope & {
+ auth: ZohoInvoiceAuthValue;
+ invoiceIds: string[];
+}): Promise<ArrayBuffer> {
+ return await zohoInvoiceClient.request<ArrayBuffer>({
+ auth,
+ organizationId,
+ method: HttpMethod.GET,
+ path: '/invoices/pdf',
+ headers: { Accept: 'application/pdf' },
+ query: zohoInvoiceUtils.toQuery({ invoice_ids: invoiceIds.join(',') }),
+ responseType: 'arraybuffer',
+ });
+}
+
+async function listInvoiceTemplates({
+ auth,
+ organizationId,
+}: ZohoInvoiceOrgScope & { auth: ZohoInvoiceAuthValue }): Promise<ZohoInvoiceResponse> {
+ return await zohoInvoiceClient.request<ZohoInvoiceResponse>({
+ auth,
+ organizationId,
+ method: HttpMethod.GET,
+ path: '/invoices/templates',
+ });
+}
+
+async function setInvoiceTemplate({
+ auth,
+ organizationId,
+ invoiceId,
+ templateId,
+}: ZohoInvoiceOrgScope & {
+ auth: ZohoInvoiceAuthValue;
+ invoiceId: string;
+ templateId: string;
+}): Promise<ZohoInvoiceResponse> {
+ return await zohoInvoiceClient.request<ZohoInvoiceResponse>({
+ auth,
+ organizationId,
+ method: HttpMethod.PUT,
+ path: `/invoices/${invoiceId}/templates/${templateId}`,
+ });
+}
+
+async function updateInvoiceBillingAddress({
+ auth,
+ organizationId,
+ invoiceId,
+ body,
+}: ZohoInvoiceOrgScope & {
+ auth: ZohoInvoiceAuthValue;
+ invoiceId: string;
+ body: Record<string, unknown>;
+}): Promise<ZohoInvoiceResponse> {
+ return await zohoInvoiceClient.request<ZohoInvoiceResponse>({
+ auth,
+ organizationId,
+ method: HttpMethod.PUT,
+ path: `/invoices/${invoiceId}/address/billing`,
+ body,
+ });
+}
+
+async function updateInvoiceShippingAddress({
+ auth,
+ organizationId,
+ invoiceId,
+ body,
+}: ZohoInvoiceOrgScope & {
+ auth: ZohoInvoiceAuthValue;
+ invoiceId: string;
+ body: Record<string, unknown>;
+}): Promise<ZohoInvoiceResponse> {
+ return await zohoInvoiceClient.request<ZohoInvoiceResponse>({
+ auth,
+ organizationId,
+ method: HttpMethod.PUT,
+ path: `/invoices/${invoiceId}/address/shipping`,
+ body,
+ });
+}
+
+async function getInvoiceAttachment({
+ auth,
+ organizationId,
+ invoiceId,
+}: ZohoInvoiceOrgScope & {
+ auth: ZohoInvoiceAuthValue;
+ invoiceId: string;
+}): Promise<ArrayBuffer> {
+ return await zohoInvoiceClient.request<ArrayBuffer>({
+ auth,
+ organizationId,
+ method: HttpMethod.GET,
+ path: `/invoices/${invoiceId}/attachment`,
+ headers: { Accept: '*/*' },
+ responseType: 'arraybuffer',
+ });
+}
+
+async function addInvoiceAttachment({
+ auth,
+ organizationId,
+ invoiceId,
+ file,
+ canSendInMail,
+}: ZohoInvoiceOrgScope & {
+ auth: ZohoInvoiceAuthValue;
+ invoiceId: string;
+ file: { filename: string; data: Buffer };
+ canSendInMail?: boolean;
+}): Promise<ZohoInvoiceResponse> {
+ const form = new FormData();
+ form.append('attachment', new Blob([new Uint8Array(file.data)]), file.filename);
+ return await zohoInvoiceClient.request<ZohoInvoiceResponse>({
+ auth,
+ organizationId,
+ method: HttpMethod.POST,
+ path: `/invoices/${invoiceId}/attachment`,
+ query: zohoInvoiceUtils.toQuery({ can_send_in_mail: canSendInMail }),
+ body: form,
+ });
+}
+
+async function deleteInvoiceAttachment({
+ auth,
+ organizationId,
+ invoiceId,
+}: ZohoInvoiceOrgScope & {
+ auth: ZohoInvoiceAuthValue;
+ invoiceId: string;
+}): Promise<ZohoInvoiceResponse> {
+ return await zohoInvoiceClient.request<ZohoInvoiceResponse>({
+ auth,
+ organizationId,
+ method: HttpMethod.DELETE,
+ path: `/invoices/${invoiceId}/attachment`,
+ });
+}
+
+async function listInvoiceComments({
+ auth,
+ organizationId,
+ invoiceId,
+}: ZohoInvoiceOrgScope & {
+ auth: ZohoInvoiceAuthValue;
+ invoiceId: string;
+}): Promise<ZohoInvoiceResponse> {
+ return await zohoInvoiceClient.request<ZohoInvoiceResponse>({
+ auth,
+ organizationId,
+ method: HttpMethod.GET,
+ path: `/invoices/${invoiceId}/comments`,
+ });
+}
+
+async function addInvoiceComment({
+ auth,
+ organizationId,
+ invoiceId,
+ body,
+}: ZohoInvoiceOrgScope & {
+ auth: ZohoInvoiceAuthValue;
+ invoiceId: string;
+ body: Record<string, unknown>;
+}): Promise<ZohoInvoiceResponse> {
+ return await zohoInvoiceClient.request<ZohoInvoiceResponse>({
+ auth,
+ organizationId,
+ method: HttpMethod.POST,
+ path: `/invoices/${invoiceId}/comments`,
+ body,
+ });
+}
+
+async function updateInvoiceComment({
+ auth,
+ organizationId,
+ invoiceId,
+ commentId,
+ body,
+}: ZohoInvoiceOrgScope & {
+ auth: ZohoInvoiceAuthValue;
+ invoiceId: string;
+ commentId: string;
+ body: Record<string, unknown>;
+}): Promise<ZohoInvoiceResponse> {
+ return await zohoInvoiceClient.request<ZohoInvoiceResponse>({
+ auth,
+ organizationId,
+ method: HttpMethod.PUT,
+ path: `/invoices/${invoiceId}/comments/${commentId}`,
+ body,
+ });
+}
+
+async function deleteInvoiceComment({
+ auth,
+ organizationId,
+ invoiceId,
+ commentId,
+}: ZohoInvoiceOrgScope & {
+ auth: ZohoInvoiceAuthValue;
+ invoiceId: string;
+ commentId: string;
+}): Promise<ZohoInvoiceResponse> {
+ return await zohoInvoiceClient.request<ZohoInvoiceResponse>({
+ auth,
+ organizationId,
+ method: HttpMethod.DELETE,
+ path: `/invoices/${invoiceId}/comments/${commentId}`,
+ });
+}
+
+async function applyCreditsToInvoice({
+ auth,
+ organizationId,
+ invoiceId,
+ body,
+}: ZohoInvoiceOrgScope & {
+ auth: ZohoInvoiceAuthValue;
+ invoiceId: string;
+ body: Record<string, unknown>;
+}): Promise<ZohoInvoiceResponse> {
+ return await zohoInvoiceClient.request<ZohoInvoiceResponse>({
+ auth,
+ organizationId,
+ method: HttpMethod.POST,
+ path: `/invoices/${invoiceId}/credits`,
+ body,
+ });
+}
+
+async function listInvoiceCreditsApplied({
+ auth,
+ organizationId,
+ invoiceId,
+}: ZohoInvoiceOrgScope & {
+ auth: ZohoInvoiceAuthValue;
+ invoiceId: string;
+}): Promise<ZohoInvoiceResponse> {
+ return await zohoInvoiceClient.request<ZohoInvoiceResponse>({
+ auth,
+ organizationId,
+ method: HttpMethod.GET,
+ path: `/invoices/${invoiceId}/creditsapplied`,
+ });
+}
+
+async function listInvoicePayments({
+ auth,
+ organizationId,
+ invoiceId,
+}: ZohoInvoiceOrgScope & {
+ auth: ZohoInvoiceAuthValue;
+ invoiceId: string;
+}): Promise<ZohoInvoiceResponse> {
+ return await zohoInvoiceClient.request<ZohoInvoiceResponse>({
+ auth,
+ organizationId,
+ method: HttpMethod.GET,
+ path: `/invoices/${invoiceId}/payments`,
+ });
+}
+
+async function deleteInvoicePayment({
+ auth,
+ organizationId,
+ invoiceId,
+ invoicePaymentId,
+}: ZohoInvoiceOrgScope & {
+ auth: ZohoInvoiceAuthValue;
+ invoiceId: string;
+ invoicePaymentId: string;
+}): Promise<ZohoInvoiceResponse> {
+ return await zohoInvoiceClient.request<ZohoInvoiceResponse>({
+ auth,
+ organizationId,
+ method: HttpMethod.DELETE,
+ path: `/invoices/${invoiceId}/payments/${invoicePaymentId}`,
+ });
+}
+
+export const invoicesApi = {
+ listInvoices,
+ searchInvoices,
+ getInvoice,
+ createInvoice,
+ updateInvoice,
+ deleteInvoice,
+ emailInvoice,
+ getInvoiceEmailContent,
+ markInvoiceSent,
+ markInvoiceDraft,
+ voidInvoice,
+ writeOffInvoice,
+ cancelInvoiceWriteOff,
+ sendInvoicePaymentReminder,
+ sendBulkInvoiceReminder,
+ getInvoicePaymentReminderContent,
+ enableInvoicePaymentReminder,
+ disableInvoicePaymentReminder,
+ exportInvoicesPdf,
+ listInvoiceTemplates,
+ setInvoiceTemplate,
+ updateInvoiceBillingAddress,
+ updateInvoiceShippingAddress,
+ getInvoiceAttachment,
+ addInvoiceAttachment,
+ deleteInvoiceAttachment,
+ listInvoiceComments,
+ addInvoiceComment,
+ updateInvoiceComment,
+ deleteInvoiceComment,
+ applyCreditsToInvoice,
+ listInvoiceCreditsApplied,
+ listInvoicePayments,
+ deleteInvoicePayment,
+};
+
+export type ZohoInvoiceInvoiceResponse = ZohoInvoiceResponse & {
+ invoice?: { customer_id?: string; line_items?: Record<string, unknown>[] };
+};
diff --git a/packages/pieces/community/zoho-invoice/src/lib/common/api/items.ts b/packages/pieces/community/zoho-invoice/src/lib/common/api/items.ts
new file mode 100644
index 00000000000..bfaffdb6275
--- /dev/null
+++ b/packages/pieces/community/zoho-invoice/src/lib/common/api/items.ts
@@ -0,0 +1,151 @@
+import { HttpMethod } from '@activepieces/pieces-common';
+
+import { zohoInvoiceClient } from '../client';
+import { zohoInvoiceUtils } from '../utils';
+
+import type { ZohoInvoiceAuthValue, ZohoInvoiceOrgScope, ZohoInvoiceResponse } from '../types';
+
+async function createItem({
+ auth,
+ organizationId,
+ body,
+}: ZohoInvoiceOrgScope & {
+ auth: ZohoInvoiceAuthValue;
+ body: Record<string, unknown>;
+}): Promise<ZohoInvoiceResponse> {
+ return await zohoInvoiceClient.request<ZohoInvoiceResponse>({
+ auth,
+ organizationId,
+ method: HttpMethod.POST,
+ path: '/items',
+ body,
+ });
+}
+
+async function listItems({
+ auth,
+ organizationId,
+ filterBy,
+ searchText,
+ sortColumn,
+ page,
+ perPage,
+}: ZohoInvoiceOrgScope & {
+ auth: ZohoInvoiceAuthValue;
+ filterBy?: string;
+ searchText?: string;
+ sortColumn?: string;
+ page?: number;
+ perPage?: number;
+}): Promise<ZohoInvoiceResponse> {
+ return await zohoInvoiceClient.request<ZohoInvoiceResponse>({
+ auth,
+ organizationId,
+ method: HttpMethod.GET,
+ path: '/items',
+ query: zohoInvoiceUtils.toQuery({
+ filter_by: filterBy,
+ search_text: searchText,
+ sort_column: sortColumn,
+ page,
+ per_page: perPage,
+ }),
+ });
+}
+
+async function getItem({
+ auth,
+ organizationId,
+ itemId,
+}: ZohoInvoiceOrgScope & {
+ auth: ZohoInvoiceAuthValue;
+ itemId: string;
+}): Promise<ZohoInvoiceItemResponse> {
+ return await zohoInvoiceClient.request<ZohoInvoiceItemResponse>({
+ auth,
+ organizationId,
+ method: HttpMethod.GET,
+ path: `/items/${itemId}`,
+ });
+}
+
+async function updateItem({
+ auth,
+ organizationId,
+ itemId,
+ body,
+}: ZohoInvoiceOrgScope & {
+ auth: ZohoInvoiceAuthValue;
+ itemId: string;
+ body: Record<string, unknown>;
+}): Promise<ZohoInvoiceResponse> {
+ return await zohoInvoiceClient.request<ZohoInvoiceResponse>({
+ auth,
+ organizationId,
+ method: HttpMethod.PUT,
+ path: `/items/${itemId}`,
+ body,
+ });
+}
+
+async function deleteItem({
+ auth,
+ organizationId,
+ itemId,
+}: ZohoInvoiceOrgScope & {
+ auth: ZohoInvoiceAuthValue;
+ itemId: string;
+}): Promise<ZohoInvoiceResponse> {
+ return await zohoInvoiceClient.request<ZohoInvoiceResponse>({
+ auth,
+ organizationId,
+ method: HttpMethod.DELETE,
+ path: `/items/${itemId}`,
+ });
+}
+
+async function markItemActive({
+ auth,
+ organizationId,
+ itemId,
+}: ZohoInvoiceOrgScope & {
+ auth: ZohoInvoiceAuthValue;
+ itemId: string;
+}): Promise<ZohoInvoiceResponse> {
+ return await zohoInvoiceClient.request<ZohoInvoiceResponse>({
+ auth,
+ organizationId,
+ method: HttpMethod.POST,
+ path: `/items/${itemId}/active`,
+ });
+}
+
+async function markItemInactive({
+ auth,
+ organizationId,
+ itemId,
+}: ZohoInvoiceOrgScope & {
+ auth: ZohoInvoiceAuthValue;
+ itemId: string;
+}): Promise<ZohoInvoiceResponse> {
+ return await zohoInvoiceClient.request<ZohoInvoiceResponse>({
+ auth,
+ organizationId,
+ method: HttpMethod.POST,
+ path: `/items/${itemId}/inactive`,
+ });
+}
+
+export const itemsApi = {
+ createItem,
+ listItems,
+ getItem,
+ updateItem,
+ deleteItem,
+ markItemActive,
+ markItemInactive,
+};
+
+export type ZohoInvoiceItemResponse = ZohoInvoiceResponse & {
+ item?: { name?: string; rate?: number };
+};
diff --git a/packages/pieces/community/zoho-invoice/src/lib/common/api/organizations.ts b/packages/pieces/community/zoho-invoice/src/lib/common/api/organizations.ts
new file mode 100644
index 00000000000..b1586e40722
--- /dev/null
+++ b/packages/pieces/community/zoho-invoice/src/lib/common/api/organizations.ts
@@ -0,0 +1,121 @@
+import { HttpMethod } from '@activepieces/pieces-common';
+
+import { zohoInvoiceClient } from '../client';
+import { zohoInvoiceUtils } from '../utils';
+
+import type {
+ ZohoInvoiceAuthValue,
+ ZohoInvoiceOrgScope,
+ ZohoInvoiceResponse,
+ ZohoInvoiceUserResponse,
+} from '../types';
+
+async function listOrganizations({
+ auth,
+}: {
+ auth: ZohoInvoiceAuthValue;
+}): Promise<ZohoInvoiceResponse> {
+ return await zohoInvoiceClient.request<ZohoInvoiceResponse>({
+ auth,
+ method: HttpMethod.GET,
+ path: '/organizations',
+ });
+}
+
+async function getOrganization({
+ auth,
+ organizationId,
+}: {
+ auth: ZohoInvoiceAuthValue;
+ organizationId: string;
+}): Promise<ZohoInvoiceResponse> {
+ return await zohoInvoiceClient.request<ZohoInvoiceResponse>({
+ auth,
+ method: HttpMethod.GET,
+ path: `/organizations/${organizationId}`,
+ });
+}
+
+async function listUsers({
+ auth,
+ organizationId,
+ filterBy,
+ sortColumn,
+ page,
+ perPage,
+}: ZohoInvoiceOrgScope & {
+ auth: ZohoInvoiceAuthValue;
+ filterBy?: string;
+ sortColumn?: string;
+ page?: number;
+ perPage?: number;
+}): Promise<ZohoInvoiceResponse> {
+ return await zohoInvoiceClient.request<ZohoInvoiceResponse>({
+ auth,
+ organizationId,
+ method: HttpMethod.GET,
+ path: '/users',
+ query: zohoInvoiceUtils.toQuery({
+ filter_by: filterBy,
+ sort_column: sortColumn,
+ page,
+ per_page: perPage,
+ }),
+ });
+}
+
+async function getCurrentUser({
+ auth,
+ organizationId,
+}: ZohoInvoiceOrgScope & { auth: ZohoInvoiceAuthValue }): Promise<ZohoInvoiceResponse> {
+ return await zohoInvoiceClient.request<ZohoInvoiceResponse>({
+ auth,
+ organizationId,
+ method: HttpMethod.GET,
+ path: '/users/me',
+ });
+}
+
+async function getUser({
+ auth,
+ organizationId,
+ userId,
+}: ZohoInvoiceOrgScope & {
+ auth: ZohoInvoiceAuthValue;
+ userId: string;
+}): Promise<ZohoInvoiceUserResponse> {
+ return await zohoInvoiceClient.request<ZohoInvoiceUserResponse>({
+ auth,
+ organizationId,
+ method: HttpMethod.GET,
+ path: `/users/${userId}`,
+ });
+}
+
+async function updateUser({
+ auth,
+ organizationId,
+ userId,
+ body,
+}: ZohoInvoiceOrgScope & {
+ auth: ZohoInvoiceAuthValue;
+ userId: string;
+ body: Record<string, unknown>;
+}): Promise<ZohoInvoiceResponse> {
+ return await zohoInvoiceClient.request<ZohoInvoiceResponse>({
+ auth,
+ organizationId,
+ method: HttpMethod.PUT,
+ path: `/users/${userId}`,
+ body,
+ });
+}
+
+export const organizationsApi = {
+ listOrganizations,
+ getOrganization,
+ listUsers,
+ getCurrentUser,
+ getUser,
+ updateUser,
+};
diff --git a/packages/pieces/community/zoho-invoice/src/lib/common/api/projects.ts b/packages/pieces/community/zoho-invoice/src/lib/common/api/projects.ts
new file mode 100644
index 00000000000..b451221c6f6
--- /dev/null
+++ b/packages/pieces/community/zoho-invoice/src/lib/common/api/projects.ts
@@ -0,0 +1,654 @@
+import { HttpMethod } from '@activepieces/pieces-common';
+
+import { zohoInvoiceClient } from '../client';
+import { zohoInvoiceUtils } from '../utils';
+
+import type { ZohoInvoiceAuthValue, ZohoInvoiceOrgScope, ZohoInvoiceResponse } from '../types';
+
+async function createProject({
+ auth,
+ organizationId,
+ body,
+}: ZohoInvoiceOrgScope & {
+ auth: ZohoInvoiceAuthValue;
+ body: Record<string, unknown>;
+}): Promise<ZohoInvoiceResponse> {
+ return await zohoInvoiceClient.request<ZohoInvoiceResponse>({
+ auth,
+ organizationId,
+ method: HttpMethod.POST,
+ path: '/projects',
+ body,
+ });
+}
+
+async function listProjects({
+ auth,
+ organizationId,
+ filterBy,
+ customerId,
+ sortColumn,
+ page,
+ perPage,
+}: ZohoInvoiceOrgScope & {
+ auth: ZohoInvoiceAuthValue;
+ filterBy?: string;
+ customerId?: string;
+ sortColumn?: string;
+ page?: number;
+ perPage?: number;
+}): Promise<ZohoInvoiceResponse> {
+ return await zohoInvoiceClient.request<ZohoInvoiceResponse>({
+ auth,
+ organizationId,
+ method: HttpMethod.GET,
+ path: '/projects',
+ query: zohoInvoiceUtils.toQuery({
+ filter_by: filterBy,
+ customer_id: customerId,
+ sort_column: sortColumn,
+ page,
+ per_page: perPage,
+ }),
+ });
+}
+
+async function getProject({
+ auth,
+ organizationId,
+ projectId,
+}: ZohoInvoiceOrgScope & {
+ auth: ZohoInvoiceAuthValue;
+ projectId: string;
+}): Promise<ZohoInvoiceProjectResponse> {
+ return await zohoInvoiceClient.request<ZohoInvoiceProjectResponse>({
+ auth,
+ organizationId,
+ method: HttpMethod.GET,
+ path: `/projects/${projectId}`,
+ });
+}
+
+async function updateProject({
+ auth,
+ organizationId,
+ projectId,
+ body,
+}: ZohoInvoiceOrgScope & {
+ auth: ZohoInvoiceAuthValue;
+ projectId: string;
+ body: Record<string, unknown>;
+}): Promise<ZohoInvoiceResponse> {
+ return await zohoInvoiceClient.request<ZohoInvoiceResponse>({
+ auth,
+ organizationId,
+ method: HttpMethod.PUT,
+ path: `/projects/${projectId}`,
+ body,
+ });
+}
+
+async function deleteProject({
+ auth,
+ organizationId,
+ projectId,
+}: ZohoInvoiceOrgScope & {
+ auth: ZohoInvoiceAuthValue;
+ projectId: string;
+}): Promise<ZohoInvoiceResponse> {
+ return await zohoInvoiceClient.request<ZohoInvoiceResponse>({
+ auth,
+ organizationId,
+ method: HttpMethod.DELETE,
+ path: `/projects/${projectId}`,
+ });
+}
+
+async function cloneProject({
+ auth,
+ organizationId,
+ projectId,
+ body,
+}: ZohoInvoiceOrgScope & {
+ auth: ZohoInvoiceAuthValue;
+ projectId: string;
+ body: Record<string, unknown>;
+}): Promise<ZohoInvoiceResponse> {
+ return await zohoInvoiceClient.request<ZohoInvoiceResponse>({
+ auth,
+ organizationId,
+ method: HttpMethod.POST,
+ path: `/projects/${projectId}/clone`,
+ body,
+ });
+}
+
+async function activateProject({
+ auth,
+ organizationId,
+ projectId,
+}: ZohoInvoiceOrgScope & {
+ auth: ZohoInvoiceAuthValue;
+ projectId: string;
+}): Promise<ZohoInvoiceResponse> {
+ return await zohoInvoiceClient.request<ZohoInvoiceResponse>({
+ auth,
+ organizationId,
+ method: HttpMethod.POST,
+ path: `/projects/${projectId}/active`,
+ });
+}
+
+async function deactivateProject({
+ auth,
+ organizationId,
+ projectId,
+}: ZohoInvoiceOrgScope & {
+ auth: ZohoInvoiceAuthValue;
+ projectId: string;
+}): Promise<ZohoInvoiceResponse> {
+ return await zohoInvoiceClient.request<ZohoInvoiceResponse>({
+ auth,
+ organizationId,
+ method: HttpMethod.POST,
+ path: `/projects/${projectId}/inactive`,
+ });
+}
+
+async function listProjectInvoices({
+ auth,
+ organizationId,
+ projectId,
+ sortColumn,
+ page,
+ perPage,
+}: ZohoInvoiceOrgScope & {
+ auth: ZohoInvoiceAuthValue;
+ projectId: string;
+ sortColumn?: string;
+ page?: number;
+ perPage?: number;
+}): Promise<ZohoInvoiceResponse> {
+ return await zohoInvoiceClient.request<ZohoInvoiceResponse>({
+ auth,
+ organizationId,
+ method: HttpMethod.GET,
+ path: `/projects/${projectId}/invoices`,
+ query: zohoInvoiceUtils.toQuery({
+ sort_column: sortColumn,
+ page,
+ per_page: perPage,
+ }),
+ });
+}
+
+async function listProjectComments({
+ auth,
+ organizationId,
+ projectId,
+}: ZohoInvoiceOrgScope & {
+ auth: ZohoInvoiceAuthValue;
+ projectId: string;
+}): Promise<ZohoInvoiceResponse> {
+ return await zohoInvoiceClient.request<ZohoInvoiceResponse>({
+ auth,
+ organizationId,
+ method: HttpMethod.GET,
+ path: `/projects/${projectId}/comments`,
+ });
+}
+
+async function addProjectComment({
+ auth,
+ organizationId,
+ projectId,
+ body,
+}: ZohoInvoiceOrgScope & {
+ auth: ZohoInvoiceAuthValue;
+ projectId: string;
+ body: Record<string, unknown>;
+}): Promise<ZohoInvoiceResponse> {
+ return await zohoInvoiceClient.request<ZohoInvoiceResponse>({
+ auth,
+ organizationId,
+ method: HttpMethod.POST,
+ path: `/projects/${projectId}/comments`,
+ body,
+ });
+}
+
+async function deleteProjectComment({
+ auth,
+ organizationId,
+ projectId,
+ commentId,
+}: ZohoInvoiceOrgScope & {
+ auth: ZohoInvoiceAuthValue;
+ projectId: string;
+ commentId: string;
+}): Promise<ZohoInvoiceResponse> {
+ return await zohoInvoiceClient.request<ZohoInvoiceResponse>({
+ auth,
+ organizationId,
+ method: HttpMethod.DELETE,
+ path: `/projects/${projectId}/comments/${commentId}`,
+ });
+}
+
+async function createProjectTask({
+ auth,
+ organizationId,
+ projectId,
+ body,
+}: ZohoInvoiceOrgScope & {
+ auth: ZohoInvoiceAuthValue;
+ projectId: string;
+ body: Record<string, unknown>;
+}): Promise<ZohoInvoiceResponse> {
+ return await zohoInvoiceClient.request<ZohoInvoiceResponse>({
+ auth,
+ organizationId,
+ method: HttpMethod.POST,
+ path: `/projects/${projectId}/tasks`,
+ body,
+ });
+}
+
+async function listProjectTasks({
+ auth,
+ organizationId,
+ projectId,
+ page,
+ perPage,
+}: ZohoInvoiceOrgScope & {
+ auth: ZohoInvoiceAuthValue;
+ projectId: string;
+ page?: number;
+ perPage?: number;
+}): Promise<ZohoInvoiceResponse> {
+ return await zohoInvoiceClient.request<ZohoInvoiceResponse>({
+ auth,
+ organizationId,
+ method: HttpMethod.GET,
+ path: `/projects/${projectId}/tasks`,
+ query: zohoInvoiceUtils.toQuery({ page, per_page: perPage }),
+ });
+}
+
+async function getProjectTask({
+ auth,
+ organizationId,
+ projectId,
+ taskId,
+}: ZohoInvoiceOrgScope & {
+ auth: ZohoInvoiceAuthValue;
+ projectId: string;
+ taskId: string;
+}): Promise<ZohoInvoiceProjectTaskResponse> {
+ return await zohoInvoiceClient.request<ZohoInvoiceProjectTaskResponse>({
+ auth,
+ organizationId,
+ method: HttpMethod.GET,
+ path: `/projects/${projectId}/tasks/${taskId}`,
+ });
+}
+
+async function updateProjectTask({
+ auth,
+ organizationId,
+ projectId,
+ taskId,
+ body,
+}: ZohoInvoiceOrgScope & {
+ auth: ZohoInvoiceAuthValue;
+ projectId: string;
+ taskId: string;
+ body: Record<string, unknown>;
+}): Promise<ZohoInvoiceResponse> {
+ return await zohoInvoiceClient.request<ZohoInvoiceResponse>({
+ auth,
+ organizationId,
+ method: HttpMethod.PUT,
+ path: `/projects/${projectId}/tasks/${taskId}`,
+ body,
+ });
+}
+
+async function deleteProjectTask({
+ auth,
+ organizationId,
+ projectId,
+ taskId,
+}: ZohoInvoiceOrgScope & {
+ auth: ZohoInvoiceAuthValue;
+ projectId: string;
+ taskId: string;
+}): Promise<ZohoInvoiceResponse> {
+ return await zohoInvoiceClient.request<ZohoInvoiceResponse>({
+ auth,
+ organizationId,
+ method: HttpMethod.DELETE,
+ path: `/projects/${projectId}/tasks/${taskId}`,
+ });
+}
+
+async function listProjectUsers({
+ auth,
+ organizationId,
+ projectId,
+}: ZohoInvoiceOrgScope & {
+ auth: ZohoInvoiceAuthValue;
+ projectId: string;
+}): Promise<ZohoInvoiceResponse> {
+ return await zohoInvoiceClient.request<ZohoInvoiceResponse>({
+ auth,
+ organizationId,
+ method: HttpMethod.GET,
+ path: `/projects/${projectId}/users`,
+ });
+}
+
+async function getProjectUser({
+ auth,
+ organizationId,
+ projectId,
+ userId,
+}: ZohoInvoiceOrgScope & {
+ auth: ZohoInvoiceAuthValue;
+ projectId: string;
+ userId: string;
+}): Promise<ZohoInvoiceResponse> {
+ return await zohoInvoiceClient.request<ZohoInvoiceResponse>({
+ auth,
+ organizationId,
+ method: HttpMethod.GET,
+ path: `/projects/${projectId}/users/${userId}`,
+ });
+}
+
+async function updateProjectUser({
+ auth,
+ organizationId,
+ projectId,
+ userId,
+ body,
+}: ZohoInvoiceOrgScope & {
+ auth: ZohoInvoiceAuthValue;
+ projectId: string;
+ userId: string;
+ body: Record<string, unknown>;
+}): Promise<ZohoInvoiceResponse> {
+ return await zohoInvoiceClient.request<ZohoInvoiceResponse>({
+ auth,
+ organizationId,
+ method: HttpMethod.PUT,
+ path: `/projects/${projectId}/users/${userId}`,
+ body,
+ });
+}
+
+async function createTimeEntry({
+ auth,
+ organizationId,
+ body,
+}: ZohoInvoiceOrgScope & {
+ auth: ZohoInvoiceAuthValue;
+ body: Record<string, unknown>;
+}): Promise<ZohoInvoiceResponse> {
+ return await zohoInvoiceClient.request<ZohoInvoiceResponse>({
+ auth,
+ organizationId,
+ method: HttpMethod.POST,
+ path: '/projects/timeentries',
+ body,
+ });
+}
+
+async function listTimeEntries({
+ auth,
+ organizationId,
+ fromDate,
+ toDate,
+ filterBy,
+ projectId,
+ userId,
+ sortColumn,
+ page,
+ perPage,
+}: ZohoInvoiceOrgScope & {
+ auth: ZohoInvoiceAuthValue;
+ fromDate?: string;
+ toDate?: string;
+ filterBy?: string;
+ projectId?: string;
+ userId?: string;
+ sortColumn?: string;
+ page?: number;
+ perPage?: number;
+}): Promise<ZohoInvoiceResponse> {
+ return await zohoInvoiceClient.request<ZohoInvoiceResponse>({
+ auth,
+ organizationId,
+ method: HttpMethod.GET,
+ path: '/projects/timeentries',
+ query: zohoInvoiceUtils.toQuery({
+ from_date: fromDate,
+ to_date: toDate,
+ filter_by: filterBy,
+ project_id: projectId,
+ user_id: userId,
+ sort_column: sortColumn,
+ page,
+ per_page: perPage,
+ }),
+ });
+}
+
+async function getTimeEntry({
+ auth,
+ organizationId,
+ timeEntryId,
+}: ZohoInvoiceOrgScope & {
+ auth: ZohoInvoiceAuthValue;
+ timeEntryId: string;
+}): Promise<ZohoInvoiceTimeEntryResponse> {
+ return await zohoInvoiceClient.request<ZohoInvoiceTimeEntryResponse>({
+ auth,
+ organizationId,
+ method: HttpMethod.GET,
+ path: `/projects/timeentries/${timeEntryId}`,
+ });
+}
+
+async function updateTimeEntry({
+ auth,
+ organizationId,
+ timeEntryId,
+ body,
+}: ZohoInvoiceOrgScope & {
+ auth: ZohoInvoiceAuthValue;
+ timeEntryId: string;
+ body: Record<string, unknown>;
+}): Promise<ZohoInvoiceResponse> {
+ return await zohoInvoiceClient.request<ZohoInvoiceResponse>({
+ auth,
+ organizationId,
+ method: HttpMethod.PUT,
+ path: `/projects/timeentries/${timeEntryId}`,
+ body,
+ });
+}
+
+async function deleteTimeEntry({
+ auth,
+ organizationId,
+ timeEntryId,
+}: ZohoInvoiceOrgScope & {
+ auth: ZohoInvoiceAuthValue;
+ timeEntryId: string;
+}): Promise<ZohoInvoiceResponse> {
+ return await zohoInvoiceClient.request<ZohoInvoiceResponse>({
+ auth,
+ organizationId,
+ method: HttpMethod.DELETE,
+ path: `/projects/timeentries/${timeEntryId}`,
+ });
+}
+
+async function startTimeEntryTimer({
+ auth,
+ organizationId,
+ timeEntryId,
+}: ZohoInvoiceOrgScope & {
+ auth: ZohoInvoiceAuthValue;
+ timeEntryId: string;
+}): Promise<ZohoInvoiceResponse> {
+ return await zohoInvoiceClient.request<ZohoInvoiceResponse>({
+ auth,
+ organizationId,
+ method: HttpMethod.POST,
+ path: `/projects/timeentries/${timeEntryId}/timer/start`,
+ });
+}
+
+async function stopTimeEntryTimer({
+ auth,
+ organizationId,
+}: ZohoInvoiceOrgScope & { auth: ZohoInvoiceAuthValue }): Promise<ZohoInvoiceResponse> {
+ return await zohoInvoiceClient.request<ZohoInvoiceResponse>({
+ auth,
+ organizationId,
+ method: HttpMethod.POST,
+ path: '/projects/timeentries/timer/stop',
+ });
+}
+
+async function getRunningTimeEntryTimer({
+ auth,
+ organizationId,
+}: ZohoInvoiceOrgScope & { auth: ZohoInvoiceAuthValue }): Promise<ZohoInvoiceResponse> {
+ return await zohoInvoiceClient.request<ZohoInvoiceResponse>({
+ auth,
+ organizationId,
+ method: HttpMethod.GET,
+ path: '/projects/timeentries/runningtimer/me',
+ });
+}
+
+async function createEmployee({
+ auth,
+ organizationId,
+ body,
+}: ZohoInvoiceOrgScope & {
+ auth: ZohoInvoiceAuthValue;
+ body: Record<string, unknown>;
+}): Promise<ZohoInvoiceResponse> {
+ return await zohoInvoiceClient.request<ZohoInvoiceResponse>({
+ auth,
+ organizationId,
+ method: HttpMethod.POST,
+ path: '/employees',
+ body,
+ });
+}
+
+async function listEmployees({
+ auth,
+ organizationId,
+ page,
+ perPage,
+}: ZohoInvoiceOrgScope & {
+ auth: ZohoInvoiceAuthValue;
+ page?: number;
+ perPage?: number;
+}): Promise<ZohoInvoiceResponse> {
+ return await zohoInvoiceClient.request<ZohoInvoiceResponse>({
+ auth,
+ organizationId,
+ method: HttpMethod.GET,
+ path: '/employees',
+ query: zohoInvoiceUtils.toQuery({ page, per_page: perPage }),
+ });
+}
+
+async function deleteEmployee({
+ auth,
+ organizationId,
+ employeeId,
+}: ZohoInvoiceOrgScope & {
+ auth: ZohoInvoiceAuthValue;
+ employeeId: string;
+}): Promise<ZohoInvoiceResponse> {
+ return await zohoInvoiceClient.request<ZohoInvoiceResponse>({
+ auth,
+ organizationId,
+ method: HttpMethod.DELETE,
+ path: `/employees/${employeeId}`,
+ });
+}
+
+export const projectsApi = {
+ createProject,
+ listProjects,
+ getProject,
+ updateProject,
+ deleteProject,
+ cloneProject,
+ activateProject,
+ deactivateProject,
+ listProjectInvoices,
+ listProjectComments,
+ addProjectComment,
+ deleteProjectComment,
+ createProjectTask,
+ listProjectTasks,
+ getProjectTask,
+ updateProjectTask,
+ deleteProjectTask,
+ listProjectUsers,
+ getProjectUser,
+ updateProjectUser,
+ createTimeEntry,
+ listTimeEntries,
+ getTimeEntry,
+ updateTimeEntry,
+ deleteTimeEntry,
+ startTimeEntryTimer,
+ stopTimeEntryTimer,
+ getRunningTimeEntryTimer,
+ createEmployee,
+ listEmployees,
+ deleteEmployee,
+};
+
+export type ZohoInvoiceProjectResponse = ZohoInvoiceResponse & {
+ project?: {
+ project_name?: string;
+ customer_id?: string;
+ description?: string;
+ billing_type?: string;
+ budget_type?: string;
+ rate?: string | number;
+ users?: { user_id?: string }[];
+ };
+};
+
+export type ZohoInvoiceProjectTaskResponse = ZohoInvoiceResponse & {
+ task?: {
+ task_name?: string;
+ description?: string;
+ rate?: string | number;
+ };
+};
+
+export type ZohoInvoiceTimeEntryResponse = ZohoInvoiceResponse & {
+ time_entry?: {
+ project_id?: string;
+ task_id?: string;
+ user_id?: string;
+ log_date?: string;
+ log_time?: string;
+ is_billable?: boolean;
+ notes?: string;
+ };
+};
diff --git a/packages/pieces/community/zoho-invoice/src/lib/common/api/recurring-invoices.ts b/packages/pieces/community/zoho-invoice/src/lib/common/api/recurring-invoices.ts
new file mode 100644
index 00000000000..4fc3b53b115
--- /dev/null
+++ b/packages/pieces/community/zoho-invoice/src/lib/common/api/recurring-invoices.ts
@@ -0,0 +1,185 @@
+import { HttpMethod } from '@activepieces/pieces-common';
+
+import { zohoInvoiceClient } from '../client';
+import { zohoInvoiceUtils } from '../utils';
+
+import type { ZohoInvoiceAuthValue, ZohoInvoiceOrgScope, ZohoInvoiceResponse } from '../types';
+
+async function createRecurringInvoice({
+ auth,
+ organizationId,
+ body,
+}: ZohoInvoiceOrgScope & {
+ auth: ZohoInvoiceAuthValue;
+ body: Record<string, unknown>;
+}): Promise<ZohoInvoiceResponse> {
+ return await zohoInvoiceClient.request<ZohoInvoiceResponse>({
+ auth,
+ organizationId,
+ method: HttpMethod.POST,
+ path: '/recurringinvoices',
+ body,
+ });
+}
+
+async function listRecurringInvoices({
+ auth,
+ organizationId,
+ filterBy,
+ searchText,
+ sortColumn,
+ page,
+ perPage,
+}: ZohoInvoiceOrgScope & {
+ auth: ZohoInvoiceAuthValue;
+ filterBy?: string;
+ searchText?: string;
+ sortColumn?: string;
+ page?: number;
+ perPage?: number;
+}): Promise<ZohoInvoiceResponse> {
+ return await zohoInvoiceClient.request<ZohoInvoiceResponse>({
+ auth,
+ organizationId,
+ method: HttpMethod.GET,
+ path: '/recurringinvoices',
+ query: zohoInvoiceUtils.toQuery({
+ filter_by: filterBy,
+ search_text: searchText,
+ sort_column: sortColumn,
+ page,
+ per_page: perPage,
+ }),
+ });
+}
+
+async function getRecurringInvoice({
+ auth,
+ organizationId,
+ recurringInvoiceId,
+}: ZohoInvoiceOrgScope & {
+ auth: ZohoInvoiceAuthValue;
+ recurringInvoiceId: string;
+}): Promise<ZohoInvoiceRecurringInvoiceResponse> {
+ return await zohoInvoiceClient.request<ZohoInvoiceRecurringInvoiceResponse>({
+ auth,
+ organizationId,
+ method: HttpMethod.GET,
+ path: `/recurringinvoices/${recurringInvoiceId}`,
+ });
+}
+
+async function updateRecurringInvoice({
+ auth,
+ organizationId,
+ recurringInvoiceId,
+ body,
+}: ZohoInvoiceOrgScope & {
+ auth: ZohoInvoiceAuthValue;
+ recurringInvoiceId: string;
+ body: Record<string, unknown>;
+}): Promise<ZohoInvoiceResponse> {
+ return await zohoInvoiceClient.request<ZohoInvoiceResponse>({
+ auth,
+ organizationId,
+ method: HttpMethod.PUT,
+ path: `/recurringinvoices/${recurringInvoiceId}`,
+ body,
+ });
+}
+
+async function deleteRecurringInvoice({
+ auth,
+ organizationId,
+ recurringInvoiceId,
+}: ZohoInvoiceOrgScope & {
+ auth: ZohoInvoiceAuthValue;
+ recurringInvoiceId: string;
+}): Promise<ZohoInvoiceResponse> {
+ return await zohoInvoiceClient.request<ZohoInvoiceResponse>({
+ auth,
+ organizationId,
+ method: HttpMethod.DELETE,
+ path: `/recurringinvoices/${recurringInvoiceId}`,
+ });
+}
+
+async function stopRecurringInvoice({
+ auth,
+ organizationId,
+ recurringInvoiceId,
+}: ZohoInvoiceOrgScope & {
+ auth: ZohoInvoiceAuthValue;
+ recurringInvoiceId: string;
+}): Promise<ZohoInvoiceResponse> {
+ return await zohoInvoiceClient.request<ZohoInvoiceResponse>({
+ auth,
+ organizationId,
+ method: HttpMethod.POST,
+ path: `/recurringinvoices/${recurringInvoiceId}/status/stop`,
+ });
+}
+
+async function resumeRecurringInvoice({
+ auth,
+ organizationId,
+ recurringInvoiceId,
+}: ZohoInvoiceOrgScope & {
+ auth: ZohoInvoiceAuthValue;
+ recurringInvoiceId: string;
+}): Promise<ZohoInvoiceResponse> {
+ return await zohoInvoiceClient.request<ZohoInvoiceResponse>({
+ auth,
+ organizationId,
+ method: HttpMethod.POST,
+ path: `/recurringinvoices/${recurringInvoiceId}/status/resume`,
+ });
+}
+
+async function listRecurringInvoiceHistory({
+ auth,
+ organizationId,
+ recurringInvoiceId,
+}: ZohoInvoiceOrgScope & {
+ auth: ZohoInvoiceAuthValue;
+ recurringInvoiceId: string;
+}): Promise<ZohoInvoiceResponse> {
+ return await zohoInvoiceClient.request<ZohoInvoiceResponse>({
+ auth,
+ organizationId,
+ method: HttpMethod.GET,
+ path: `/recurringinvoices/${recurringInvoiceId}/comments`,
+ });
+}
+
+export const recurringInvoicesApi = {
+ createRecurringInvoice,
+ listRecurringInvoices,
+ getRecurringInvoice,
+ updateRecurringInvoice,
+ deleteRecurringInvoice,
+ stopRecurringInvoice,
+ resumeRecurringInvoice,
+ listRecurringInvoiceHistory,
+};
+
+export type ZohoInvoiceDocumentLineItem = {
+ line_item_id?: string;
+ item_id?: string;
+ name?: string;
+ description?: string;
+ rate?: number;
+ quantity?: number;
+ discount?: number | string;
+ tax_id?: string;
+};
+
+export type ZohoInvoiceRecurringInvoiceResponse = ZohoInvoiceResponse & {
+ recurring_invoice?: {
+ recurrence_name?: string;
+ customer_id?: string;
+ recurrence_frequency?: string;
+ repeat_every?: number | string;
+ line_items?: ZohoInvoiceDocumentLineItem[];
+ };
+};
diff --git a/packages/pieces/community/zoho-invoice/src/lib/common/api/settings.ts b/packages/pieces/community/zoho-invoice/src/lib/common/api/settings.ts
new file mode 100644
index 00000000000..6aa73ed92f5
--- /dev/null
+++ b/packages/pieces/community/zoho-invoice/src/lib/common/api/settings.ts
@@ -0,0 +1,388 @@
+import { HttpMethod } from '@activepieces/pieces-common';
+
+import { zohoInvoiceClient } from '../client';
+import { zohoInvoiceUtils } from '../utils';
+
+import type { ZohoInvoiceAuthValue, ZohoInvoiceOrgScope, ZohoInvoiceResponse } from '../types';
+
+async function createCurrency({
+ auth,
+ organizationId,
+ body,
+}: ZohoInvoiceOrgScope & {
+ auth: ZohoInvoiceAuthValue;
+ body: Record<string, unknown>;
+}): Promise<ZohoInvoiceResponse> {
+ return await zohoInvoiceClient.request<ZohoInvoiceResponse>({
+ auth,
+ organizationId,
+ method: HttpMethod.POST,
+ path: '/settings/currencies',
+ body,
+ });
+}
+
+async function listCurrencies({
+ auth,
+ organizationId,
+ filterBy,
+ page,
+ perPage,
+}: ZohoInvoiceOrgScope & {
+ auth: ZohoInvoiceAuthValue;
+ filterBy?: string;
+ page?: number;
+ perPage?: number;
+}): Promise<ZohoInvoiceResponse> {
+ return await zohoInvoiceClient.request<ZohoInvoiceResponse>({
+ auth,
+ organizationId,
+ method: HttpMethod.GET,
+ path: '/settings/currencies',
+ query: zohoInvoiceUtils.toQuery({
+ filter_by: filterBy,
+ page,
+ per_page: perPage,
+ }),
+ });
+}
+
+async function getCurrency({
+ auth,
+ organizationId,
+ currencyId,
+}: ZohoInvoiceOrgScope & {
+ auth: ZohoInvoiceAuthValue;
+ currencyId: string;
+}): Promise<ZohoInvoiceCurrencyResponse> {
+ return await zohoInvoiceClient.request<ZohoInvoiceCurrencyResponse>({
+ auth,
+ organizationId,
+ method: HttpMethod.GET,
+ path: `/settings/currencies/${currencyId}`,
+ });
+}
+
+async function updateCurrency({
+ auth,
+ organizationId,
+ currencyId,
+ body,
+}: ZohoInvoiceOrgScope & {
+ auth: ZohoInvoiceAuthValue;
+ currencyId: string;
+ body: Record<string, unknown>;
+}): Promise<ZohoInvoiceResponse> {
+ return await zohoInvoiceClient.request<ZohoInvoiceResponse>({
+ auth,
+ organizationId,
+ method: HttpMethod.PUT,
+ path: `/settings/currencies/${currencyId}`,
+ body,
+ });
+}
+
+async function deleteCurrency({
+ auth,
+ organizationId,
+ currencyId,
+}: ZohoInvoiceOrgScope & {
+ auth: ZohoInvoiceAuthValue;
+ currencyId: string;
+}): Promise<ZohoInvoiceResponse> {
+ return await zohoInvoiceClient.request<ZohoInvoiceResponse>({
+ auth,
+ organizationId,
+ method: HttpMethod.DELETE,
+ path: `/settings/currencies/${currencyId}`,
+ });
+}
+
+async function createExchangeRate({
+ auth,
+ organizationId,
+ currencyId,
+ body,
+}: ZohoInvoiceOrgScope & {
+ auth: ZohoInvoiceAuthValue;
+ currencyId: string;
+ body: Record<string, unknown>;
+}): Promise<ZohoInvoiceResponse> {
+ return await zohoInvoiceClient.request<ZohoInvoiceResponse>({
+ auth,
+ organizationId,
+ method: HttpMethod.POST,
+ path: `/settings/currencies/${currencyId}/exchangerates`,
+ body,
+ });
+}
+
+async function listExchangeRates({
+ auth,
+ organizationId,
+ currencyId,
+ fromDate,
+ isCurrentDate,
+ sortColumn,
+}: ZohoInvoiceOrgScope & {
+ auth: ZohoInvoiceAuthValue;
+ currencyId: string;
+ fromDate?: string;
+ isCurrentDate?: boolean;
+ sortColumn?: string;
+}): Promise<ZohoInvoiceResponse> {
+ return await zohoInvoiceClient.request<ZohoInvoiceResponse>({
+ auth,
+ organizationId,
+ method: HttpMethod.GET,
+ path: `/settings/currencies/${currencyId}/exchangerates`,
+ query: zohoInvoiceUtils.toQuery({
+ from_date: fromDate,
+ is_current_date: isCurrentDate,
+ sort_column: sortColumn,
+ }),
+ });
+}
+
+async function getExchangeRate({
+ auth,
+ organizationId,
+ currencyId,
+ exchangeRateId,
+}: ZohoInvoiceOrgScope & {
+ auth: ZohoInvoiceAuthValue;
+ currencyId: string;
+ exchangeRateId: string;
+}): Promise<ZohoInvoiceResponse> {
+ return await zohoInvoiceClient.request<ZohoInvoiceResponse>({
+ auth,
+ organizationId,
+ method: HttpMethod.GET,
+ path: `/settings/currencies/${currencyId}/exchangerates/${exchangeRateId}`,
+ });
+}
+
+async function updateExchangeRate({
+ auth,
+ organizationId,
+ currencyId,
+ exchangeRateId,
+ body,
+}: ZohoInvoiceOrgScope & {
+ auth: ZohoInvoiceAuthValue;
+ currencyId: string;
+ exchangeRateId: string;
+ body: Record<string, unknown>;
+}): Promise<ZohoInvoiceResponse> {
+ return await zohoInvoiceClient.request<ZohoInvoiceResponse>({
+ auth,
+ organizationId,
+ method: HttpMethod.PUT,
+ path: `/settings/currencies/${currencyId}/exchangerates/${exchangeRateId}`,
+ body,
+ });
+}
+
+async function deleteExchangeRate({
+ auth,
+ organizationId,
+ currencyId,
+ exchangeRateId,
+}: ZohoInvoiceOrgScope & {
+ auth: ZohoInvoiceAuthValue;
+ currencyId: string;
+ exchangeRateId: string;
+}): Promise<ZohoInvoiceResponse> {
+ return await zohoInvoiceClient.request<ZohoInvoiceResponse>({
+ auth,
+ organizationId,
+ method: HttpMethod.DELETE,
+ path: `/settings/currencies/${currencyId}/exchangerates/${exchangeRateId}`,
+ });
+}
+
+async function createTax({
+ auth,
+ organizationId,
+ body,
+}: ZohoInvoiceOrgScope & {
+ auth: ZohoInvoiceAuthValue;
+ body: Record<string, unknown>;
+}): Promise<ZohoInvoiceResponse> {
+ return await zohoInvoiceClient.request<ZohoInvoiceResponse>({
+ auth,
+ organizationId,
+ method: HttpMethod.POST,
+ path: '/settings/taxes',
+ body,
+ });
+}
+
+async function listTaxes({
+ auth,
+ organizationId,
+ page,
+ perPage,
+}: ZohoInvoiceOrgScope & {
+ auth: ZohoInvoiceAuthValue;
+ page?: number;
+ perPage?: number;
+}): Promise<ZohoInvoiceResponse> {
+ return await zohoInvoiceClient.request<ZohoInvoiceResponse>({
+ auth,
+ organizationId,
+ method: HttpMethod.GET,
+ path: '/settings/taxes',
+ query: zohoInvoiceUtils.toQuery({ page, per_page: perPage }),
+ });
+}
+
+async function getTax({
+ auth,
+ organizationId,
+ taxId,
+}: ZohoInvoiceOrgScope & {
+ auth: ZohoInvoiceAuthValue;
+ taxId: string;
+}): Promise<ZohoInvoiceResponse> {
+ return await zohoInvoiceClient.request<ZohoInvoiceResponse>({
+ auth,
+ organizationId,
+ method: HttpMethod.GET,
+ path: `/settings/taxes/${taxId}`,
+ });
+}
+
+async function updateTax({
+ auth,
+ organizationId,
+ taxId,
+ body,
+}: ZohoInvoiceOrgScope & {
+ auth: ZohoInvoiceAuthValue;
+ taxId: string;
+ body: Record<string, unknown>;
+}): Promise<ZohoInvoiceResponse> {
+ return await zohoInvoiceClient.request<ZohoInvoiceResponse>({
+ auth,
+ organizationId,
+ method: HttpMethod.PUT,
+ path: `/settings/taxes/${taxId}`,
+ body,
+ });
+}
+
+async function deleteTax({
+ auth,
+ organizationId,
+ taxId,
+}: ZohoInvoiceOrgScope & {
+ auth: ZohoInvoiceAuthValue;
+ taxId: string;
+}): Promise<ZohoInvoiceResponse> {
+ return await zohoInvoiceClient.request<ZohoInvoiceResponse>({
+ auth,
+ organizationId,
+ method: HttpMethod.DELETE,
+ path: `/settings/taxes/${taxId}`,
+ });
+}
+
+async function createTaxGroup({
+ auth,
+ organizationId,
+ body,
+}: ZohoInvoiceOrgScope & {
+ auth: ZohoInvoiceAuthValue;
+ body: Record<string, unknown>;
+}): Promise<ZohoInvoiceResponse> {
+ return await zohoInvoiceClient.request<ZohoInvoiceResponse>({
+ auth,
+ organizationId,
+ method: HttpMethod.POST,
+ path: '/settings/taxgroups',
+ body,
+ });
+}
+
+async function getTaxGroup({
+ auth,
+ organizationId,
+ taxGroupId,
+}: ZohoInvoiceOrgScope & {
+ auth: ZohoInvoiceAuthValue;
+ taxGroupId: string;
+}): Promise<ZohoInvoiceResponse> {
+ return await zohoInvoiceClient.request<ZohoInvoiceResponse>({
+ auth,
+ organizationId,
+ method: HttpMethod.GET,
+ path: `/settings/taxgroups/${taxGroupId}`,
+ });
+}
+
+async function updateTaxGroup({
+ auth,
+ organizationId,
+ taxGroupId,
+ body,
+}: ZohoInvoiceOrgScope & {
+ auth: ZohoInvoiceAuthValue;
+ taxGroupId: string;
+ body: Record<string, unknown>;
+}): Promise<ZohoInvoiceResponse> {
+ return await zohoInvoiceClient.request<ZohoInvoiceResponse>({
+ auth,
+ organizationId,
+ method: HttpMethod.PUT,
+ path: `/settings/taxgroups/${taxGroupId}`,
+ body,
+ });
+}
+
+async function deleteTaxGroup({
+ auth,
+ organizationId,
+ taxGroupId,
+}: ZohoInvoiceOrgScope & {
+ auth: ZohoInvoiceAuthValue;
+ taxGroupId: string;
+}): Promise<ZohoInvoiceResponse> {
+ return await zohoInvoiceClient.request<ZohoInvoiceResponse>({
+ auth,
+ organizationId,
+ method: HttpMethod.DELETE,
+ path: `/settings/taxgroups/${taxGroupId}`,
+ });
+}
+
+export const settingsApi = {
+ createCurrency,
+ listCurrencies,
+ getCurrency,
+ updateCurrency,
+ deleteCurrency,
+ createExchangeRate,
+ listExchangeRates,
+ getExchangeRate,
+ updateExchangeRate,
+ deleteExchangeRate,
+ createTax,
+ listTaxes,
+ getTax,
+ updateTax,
+ deleteTax,
+ createTaxGroup,
+ getTaxGroup,
+ updateTaxGroup,
+ deleteTaxGroup,
+};
+
+export type ZohoInvoiceCurrencyResponse = ZohoInvoiceResponse & {
+ currency?: {
+ currency_code?: string;
+ currency_symbol?: string;
+ price_precision?: number;
+ currency_format?: string;
+ };
+};
diff --git a/packages/pieces/community/zoho-invoice/src/lib/common/client.ts b/packages/pieces/community/zoho-invoice/src/lib/common/client.ts
new file mode 100644
index 00000000000..0cbe81d6f90
--- /dev/null
+++ b/packages/pieces/community/zoho-invoice/src/lib/common/client.ts
@@ -0,0 +1,52 @@
+import { HttpMethod, HttpRequest, httpClient, QueryParams } from '@activepieces/pieces-common';
+
+import type { ZohoInvoiceAuthValue } from './types';
+
+function baseUrl({ auth }: { auth: ZohoInvoiceAuthValue }): string {
+ return `https://www.zohoapis.${auth.props?.region}/invoice/v3`;
+}
+
+function authHeaders({ auth }: { auth: ZohoInvoiceAuthValue }): Record<string, string> {
+ return {
+ Authorization: `Zoho-oauthtoken ${auth.access_token}`,
+ };
+}
+
+async function request<T>({
+ auth,
+ method,
+ path,
+ query,
+ body,
+ organizationId,
+ headers,
+ responseType,
+}: RequestParams & { auth: ZohoInvoiceAuthValue }): Promise<T> {
+ const response = await httpClient.sendRequest<T>({
+ method,
+ url: `${baseUrl({ auth })}${path}`,
+ headers: {
+ ...authHeaders({ auth }),
+ ...(organizationId ? { [ORGANIZATION_HEADER]: organizationId } : {}),
+ ...headers,
+ },
+ queryParams: query,
+ body,
+ responseType,
+ });
+ return response.body;
+}
+
+export const zohoInvoiceClient = { baseUrl, authHeaders, request };
+
+const ORGANIZATION_HEADER = 'X-com-zoho-invoice-organizationid';
+
+type RequestParams = {
+ method: HttpMethod;
+ path: string;
+ query?: QueryParams;
+ body?: unknown;
+ organizationId?: string;
+ headers?: Record<string, string>;
+ responseType?: HttpRequest['responseType'];
+};
diff --git a/packages/pieces/community/zoho-invoice/src/lib/common/index.ts b/packages/pieces/community/zoho-invoice/src/lib/common/index.ts
deleted file mode 100644
index 969a3f7ed06..00000000000
--- a/packages/pieces/community/zoho-invoice/src/lib/common/index.ts
+++ /dev/null
@@ -1,34 +0,0 @@
-import { HttpMethod, httpClient } from '@activepieces/pieces-common';
-import { OAuth2PropertyValue } from '@activepieces/pieces-framework';
-
-export const common = {
- baseUrl: (region: string) => {
- return `https://www.zohoapis.${region}/invoice/v3`;
- },
- authHeaders: (accessToken: string) => {
- return {
- Authorization: `Zoho-oauthtoken ${accessToken}`,
- };
- },
-
- async getInvoices(
- auth: OAuth2PropertyValue,
- search?: {
- createdSince?: string;
- }
- ) {
- const q: {
- last_modified_at?: string;
- } = {};
- if (search?.createdSince) q.last_modified_at = search.createdSince;
-
- const response = await httpClient.sendRequest({
- url: `${common.baseUrl(auth.props!['region'])}/invoices`,
- method: HttpMethod.GET,
- headers: common.authHeaders(auth.access_token),
- queryParams: q,
- });
-
- return response.body['invoices'];
- },
-};
diff --git a/packages/pieces/community/zoho-invoice/src/lib/common/types.ts b/packages/pieces/community/zoho-invoice/src/lib/common/types.ts
new file mode 100644
index 00000000000..c38142a6ae3
--- /dev/null
+++ b/packages/pieces/community/zoho-invoice/src/lib/common/types.ts
@@ -0,0 +1,27 @@
+export type ZohoInvoiceAuthValue = {
+ access_token: string;
+ props?: { region?: string };
+};
+
+export type ZohoInvoiceOrgScope = {
+ organizationId: string;
+};
+
+export type ZohoInvoiceResponse = {
+ code?: number;
+ message?: string;
+ [key: string]: unknown;
+};
+
+export type ZohoInvoiceUserResponse = ZohoInvoiceResponse & {
+ user?: { user_id?: string; name?: string; email?: string; user_role?: string };
+};
+
+export type ZohoInvoiceInvoice = {
+ invoice_id?: string;
+ created_time: string;
+};
+
+export type ZohoInvoiceListInvoicesResponse = {
+ invoices?: ZohoInvoiceInvoice[];
+};
diff --git a/packages/pieces/community/zoho-invoice/src/lib/common/utils.ts b/packages/pieces/community/zoho-invoice/src/lib/common/utils.ts
new file mode 100644
index 00000000000..b703d023846
--- /dev/null
+++ b/packages/pieces/community/zoho-invoice/src/lib/common/utils.ts
@@ -0,0 +1,63 @@
+import type { QueryParams } from '@activepieces/pieces-common';
+
+function toQuery(params: Record<string, string | number | boolean | undefined>): QueryParams {
+ return Object.fromEntries(
+ Object.entries(params)
+ .filter(
+ (entry): entry is [string, string | number | boolean] =>
+ entry[1] !== undefined && entry[1] !== '',
+ )
+ .map(([key, value]) => [key, String(value)]),
+ );
+}
+
+function compact(body: Record<string, unknown>): Record<string, unknown> {
+ return Object.fromEntries(
+ Object.entries(body).filter(
+ (entry) => entry[1] !== undefined && entry[1] !== null && entry[1] !== '',
+ ),
+ );
+}
+
+function toOptionalBoolean({ value }: { value: string | undefined }): boolean | undefined {
+ return value === undefined ? undefined : value === 'true';
+}
+
+function toRecords({
+ rows,
+ propName,
+}: {
+ rows: unknown[];
+ propName: string;
+}): Record<string, unknown>[] {
+ return rows.map((row) => {
+ if (typeof row !== 'object' || row === null || Array.isArray(row)) {
+ throw new Error(`Each entry of ${propName} must be an object.`);
+ }
+ return Object.fromEntries(Object.entries(row));
+ });
+}
+
+function toLineItems({
+ rows,
+}: {
+ rows: unknown[] | undefined;
+}): Record<string, unknown>[] | undefined {
+ if (rows === undefined || rows.length === 0) {
+ return undefined;
+ }
+ return toRecords({ rows, propName: 'Line Items' }).map((row) =>
+ compact({
+ line_item_id: row['lineItemId'],
+ item_id: row['itemId'],
+ name: row['name'],
+ description: row['description'],
+ rate: row['rate'],
+ quantity: row['quantity'],
+ discount: row['discount'],
+ tax_id: row['taxId'],
+ }),
+ );
+}
+
+export const zohoInvoiceUtils = { toQuery, compact, toOptionalBoolean, toRecords, toLineItems };
diff --git a/packages/pieces/community/zoho-invoice/src/lib/output-schemas.ts b/packages/pieces/community/zoho-invoice/src/lib/output-schemas.ts
new file mode 100644
index 00000000000..77c7a052eb3
--- /dev/null
+++ b/packages/pieces/community/zoho-invoice/src/lib/output-schemas.ts
@@ -0,0 +1,4457 @@
+import { OutputSchema } from '@activepieces/pieces-framework';
+
+const tasksFields: OutputSchema['fields'] = [
+ { key: 'task_id', label: 'Task ID' },
+ { key: 'task_name', label: 'Task Name' },
+ { key: 'description', label: 'Description' },
+ { key: 'rate', label: 'Rate', format: 'currency' },
+ { key: 'budget_hours', label: 'Budget Hours', format: 'number' },
+ { key: 'budget_hours_in_time', label: 'Budget Hours In Time' },
+ { key: 'total_hours', label: 'Total Hours' },
+ { key: 'billed_hours', label: 'Billed Hours' },
+ { key: 'un_billed_hours', label: 'Unbilled Hours' },
+ { key: 'billable_hours', label: 'Billable Hours' },
+ { key: 'non_billable_hours', label: 'Non Billable Hours' },
+ { key: 'status', label: 'Status' },
+ { key: 'is_billable', label: 'Is Billable', format: 'boolean' },
+ { key: 'task_custom_fields', label: 'Task Custom Fields' },
+];
+
+const billingAddressFields: OutputSchema['fields'] = [
+ { key: 'attention', label: 'Attention' },
+ { key: 'address', label: 'Address' },
+ { key: 'street2', label: 'Street2' },
+ { key: 'city', label: 'City' },
+ { key: 'state', label: 'State' },
+ { key: 'country', label: 'Country' },
+ { key: 'phone', label: 'Phone' },
+ { key: 'fax', label: 'Fax' },
+];
+
+const shippingAddressFields: OutputSchema['fields'] = [
+ { key: 'attention', label: 'Attention' },
+ { key: 'address', label: 'Address' },
+ { key: 'street2', label: 'Street2' },
+ { key: 'city', label: 'City' },
+ { key: 'state', label: 'State' },
+ { key: 'country', label: 'Country' },
+ { key: 'phone', label: 'Phone' },
+ { key: 'fax', label: 'Fax' },
+];
+
+const pageContextFields: OutputSchema['fields'] = [
+ { key: 'page', label: 'Page', format: 'number' },
+ { key: 'per_page', label: 'Per Page', format: 'number' },
+ { key: 'has_more_page', label: 'Has More Page', format: 'boolean' },
+];
+
+const customFieldsFields: OutputSchema['fields'] = [
+ { key: 'index', label: 'Index', format: 'number' },
+ { key: 'label', label: 'Label' },
+ { key: 'value', label: 'Value' },
+];
+
+const taxInformationFields: OutputSchema['fields'] = [
+ { key: 'tax_specification', label: 'Tax Specification' },
+ { key: 'tax_specific_type', label: 'Tax Specific Type' },
+ { key: 'end_date', label: 'End Date', format: 'date' },
+ { key: 'is_non_advol_tax', label: 'Is Non Advol Tax', format: 'boolean' },
+ { key: 'tax_groups_details', label: 'Tax Groups Details' },
+ { key: 'type', label: 'Type' },
+ { key: 'country_code', label: 'Country Code' },
+ { key: 'percentage', label: 'Percentage', format: 'number' },
+ { key: 'id', label: 'ID' },
+ { key: 'text', label: 'Text' },
+ { key: 'status', label: 'Status' },
+ { key: 'start_date', label: 'Start Date', format: 'date' },
+];
+
+const defaultPriceBracketsFields: OutputSchema['fields'] = [
+ { key: 'start_quantity', label: 'Start Quantity', format: 'number' },
+ { key: 'end_quantity', label: 'End Quantity', format: 'number' },
+ { key: 'pricebook_rate', label: 'Price List Rate', format: 'currency' },
+];
+
+const taxesFields: OutputSchema['fields'] = [
+ { key: 'tax_id', label: 'Tax ID' },
+ { key: 'tax_display_name', label: 'Tax Display Name' },
+ { key: 'tax_name', label: 'Tax Name' },
+ { key: 'tax_percentage', label: 'Tax Percentage', format: 'number' },
+ { key: 'tax_type', label: 'Tax Type' },
+ { key: 'tax_specific_type', label: 'Tax Specific Type' },
+ { key: 'start_date', label: 'Start Date', format: 'date' },
+ { key: 'end_date', label: 'End Date', format: 'date' },
+ { key: 'status', label: 'Status' },
+];
+
+const rolesFields: OutputSchema['fields'] = [
+ { key: 'role_name', label: 'Role Name' },
+ { key: 'app_source', label: 'App Source', format: 'number' },
+ { key: 'access_type', label: 'Access Type' },
+ { key: 'role_type', label: 'Role Type' },
+ { key: 'role_id', label: 'Role ID' },
+ { key: 'description', label: 'Description' },
+ { key: 'is_current_role', label: 'Is Current Role', format: 'boolean' },
+];
+
+const checkDetailsFields: OutputSchema['fields'] = [
+ { key: 'check_id', label: 'Check ID' },
+ { key: 'check_number', label: 'Check Number' },
+ { key: 'memo', label: 'Memo' },
+ { key: 'check_status', label: 'Check Status' },
+ { key: 'expiry_date', label: 'Expiry Date', format: 'date' },
+];
+
+const paymentRefundsFields: OutputSchema['fields'] = [
+ { key: 'payment_refund_id', label: 'Payment Refund ID' },
+ { key: 'date', label: 'Date', format: 'date' },
+ { key: 'refund_mode', label: 'Refund Mode' },
+ { key: 'reference_number', label: 'Reference Number' },
+ { key: 'description', label: 'Description' },
+ { key: 'amount_bcy', label: 'Amount (Base Currency)', format: 'currency' },
+ { key: 'amount_fcy', label: 'Amount (Foreign Currency)', format: 'currency' },
+];
+
+const fromEmailsFields: OutputSchema['fields'] = [
+ { key: 'is_org_email_id', label: 'Is Org Email ID', format: 'boolean' },
+ { key: 'user_name', label: 'User Name' },
+ { key: 'organization_contact_id', label: 'Organization Contact ID' },
+ { key: 'email', label: 'Email', format: 'email' },
+ { key: 'selected', label: 'Selected', format: 'boolean' },
+];
+
+const toContactsFields: OutputSchema['fields'] = [
+ { key: 'phone', label: 'Phone' },
+ { key: 'mobile', label: 'Mobile' },
+ { key: 'last_name', label: 'Last Name' },
+ { key: 'contact_person_id', label: 'Contact Person ID' },
+ { key: 'salutation', label: 'Salutation' },
+ { key: 'first_name', label: 'First Name' },
+ { key: 'email', label: 'Email', format: 'email' },
+ { key: 'selected', label: 'Selected', format: 'boolean' },
+];
+
+const emailTemplatesFields: OutputSchema['fields'] = [
+ { key: 'email_template_id', label: 'Email Template ID' },
+ { key: 'name', label: 'Name' },
+ { key: 'selected', label: 'Selected', format: 'boolean' },
+];
+
+const commentFields: OutputSchema['fields'] = [
+ { key: 'comment_id', label: 'Comment ID' },
+ { key: 'description', label: 'Description' },
+ { key: 'commented_by_id', label: 'Commented By ID' },
+ { key: 'commented_by', label: 'Commented By' },
+ { key: 'date', label: 'Date', format: 'date' },
+ { key: 'comment_type', label: 'Comment Type' },
+];
+
+const commentsFields: OutputSchema['fields'] = [
+ { key: 'comment_id', label: 'Comment ID' },
+ { key: 'description', label: 'Description' },
+ { key: 'commented_by_id', label: 'Commented By ID' },
+ { key: 'commented_by', label: 'Commented By' },
+ { key: 'date', label: 'Date', format: 'date' },
+ { key: 'date_description', label: 'Date Description' },
+ { key: 'time', label: 'Time' },
+];
+
+const lateFeeFields: OutputSchema['fields'] = [
+ { key: 'name', label: 'Name' },
+ { key: 'type', label: 'Type' },
+ { key: 'rate', label: 'Rate', format: 'currency' },
+ { key: 'frequency_type', label: 'Frequency Type' },
+];
+
+const customerDefaultBillingAddressFields: OutputSchema['fields'] = [
+ { key: 'zip', label: 'Zip' },
+ { key: 'country', label: 'Country' },
+ { key: 'address', label: 'Address' },
+ { key: 'city', label: 'City' },
+ { key: 'phone', label: 'Phone' },
+ { key: 'city_code', label: 'City Code' },
+ { key: 'street2', label: 'Street2' },
+ { key: 'state', label: 'State' },
+ { key: 'fax', label: 'Fax' },
+ { key: 'state_code', label: 'State Code' },
+];
+
+const invoicesCreditedFields: OutputSchema['fields'] = [
+ { key: 'invoice_id', label: 'Invoice ID' },
+ { key: 'creditnote_invoice_id', label: 'Credit Note Invoice ID' },
+ { key: 'date', label: 'Date', format: 'date' },
+ { key: 'invoice_number', label: 'Invoice Number' },
+ { key: 'credited_amount', label: 'Credited Amount', format: 'currency' },
+];
+
+const usersFields: OutputSchema['fields'] = [
+ { key: 'user_id', label: 'User ID' },
+ { key: 'is_current_user', label: 'Is Current User', format: 'boolean' },
+ { key: 'email', label: 'Email', format: 'email' },
+ { key: 'user_role', label: 'User Role' },
+ { key: 'role_id', label: 'Role ID' },
+ { key: 'status', label: 'Status' },
+];
+
+const projectFields: OutputSchema['fields'] = [
+ { key: 'project_id', label: 'Project ID' },
+ { key: 'project_name', label: 'Project Name' },
+ { key: 'project_code', label: 'Project Code' },
+ { key: 'customer_id', label: 'Customer ID' },
+ { key: 'currency_id', label: 'Currency ID' },
+ { key: 'customer_name', label: 'Customer Name' },
+ { key: 'customer_first_name', label: 'Customer First Name' },
+ { key: 'customer_email', label: 'Customer Email', format: 'email' },
+ { key: 'currency_code', label: 'Currency Code' },
+ { key: 'description', label: 'Description' },
+ { key: 'status', label: 'Status' },
+ { key: 'billing_rate_frequency', label: 'Billing Rate Frequency' },
+ { key: 'billing_type', label: 'Billing Type' },
+ { key: 'budget_type', label: 'Budget Type' },
+ { key: 'budget_amount', label: 'Budget Amount', format: 'currency' },
+ { key: 'cost_budget_amount', label: 'Cost Budget Amount', format: 'currency' },
+ {
+ key: 'is_budget_threshold_notification_enabled',
+ label: 'Is Budget Threshold Notification Enabled',
+ format: 'boolean',
+ },
+ { key: 'is_client_approval_needed', label: 'Is Client Approval Needed', format: 'boolean' },
+ { key: 'is_user_approval_needed', label: 'Is User Approval Needed', format: 'boolean' },
+ { key: 'hours_per_day', label: 'Hours Per Day' },
+ { key: 'project_head_id', label: 'Project Head ID' },
+ { key: 'project_head_name', label: 'Project Head Name' },
+ { key: 'is_valid_project_head', label: 'Is Valid Project Head', format: 'boolean' },
+ { key: 'budget_threshold', label: 'Budget Threshold', format: 'number' },
+ { key: 'is_expense_inclusive', label: 'Is Expense Inclusive', format: 'boolean' },
+ { key: 'total_hours', label: 'Total Hours' },
+ { key: 'total_amount_expense_inclusive', label: 'Total Amount Expense Inclusive' },
+ { key: 'billed_hours', label: 'Billed Hours' },
+ { key: 'un_billed_hours', label: 'Unbilled Hours' },
+ { key: 'billable_hours', label: 'Billable Hours' },
+ { key: 'non_billable_hours', label: 'Non Billable Hours' },
+ { key: 'unused_retainer_payments', label: 'Unused Retainer Payments', format: 'currency' },
+ {
+ key: 'has_active_recurring_profiles',
+ label: 'Has Active Recurring Profiles',
+ format: 'boolean',
+ },
+ { key: 'created_by_id', label: 'Created By ID' },
+ { key: 'last_modified_by_id', label: 'Last Modified By ID' },
+ { key: 'created_time', label: 'Created Time', format: 'datetime' },
+ { key: 'accounts_budgets', label: 'Accounts Budgets' },
+ { key: 'tasks', label: 'Tasks', listItems: tasksFields },
+ {
+ key: 'users',
+ label: 'Users',
+ labelKey: 'email',
+ listItems: [
+ ...usersFields,
+ { key: 'user_name', label: 'User Name' },
+ { key: 'rate', label: 'Rate', format: 'currency' },
+ { key: 'budget_hours', label: 'Budget Hours', format: 'number' },
+ { key: 'budget_hours_in_time', label: 'Budget Hours In Time' },
+ { key: 'total_hours', label: 'Total Hours' },
+ { key: 'billed_hours', label: 'Billed Hours' },
+ { key: 'un_billed_hours', label: 'Unbilled Hours' },
+ { key: 'billable_hours', label: 'Billable Hours' },
+ { key: 'non_billable_hours', label: 'Non Billable Hours' },
+ { key: 'staff_role', label: 'Staff Role' },
+ { key: 'staff_status', label: 'Staff Status' },
+ ],
+ },
+ { key: 'custom_fields', label: 'Custom Fields' },
+ { key: 'documents', label: 'Documents' },
+];
+
+const contactPersonsFields: OutputSchema['fields'] = [
+ { key: 'contact_person_id', label: 'Contact Person ID' },
+ { key: 'salutation', label: 'Salutation' },
+ { key: 'first_name', label: 'First Name' },
+ { key: 'last_name', label: 'Last Name' },
+ { key: 'email', label: 'Email', format: 'email' },
+ { key: 'phone', label: 'Phone' },
+ { key: 'mobile', label: 'Mobile' },
+ { key: 'department', label: 'Department' },
+ { key: 'designation', label: 'Designation' },
+ { key: 'skype', label: 'Skype' },
+ { key: 'fax', label: 'Fax' },
+ { key: 'is_added_in_portal', label: 'Is Added In Portal', format: 'boolean' },
+ { key: 'is_primary_contact', label: 'Is Primary Contact', format: 'boolean' },
+ {
+ key: 'is_portal_invitation_accepted',
+ label: 'Is Portal Invitation Accepted',
+ format: 'boolean',
+ },
+ { key: 'contactperson_custom_fields', label: 'Contact Person Custom Fields' },
+];
+
+const itemFields: OutputSchema['fields'] = [
+ { key: 'group_id', label: 'Group ID' },
+ { key: 'item_id', label: 'Item ID' },
+ { key: 'name', label: 'Name' },
+ { key: 'sku', label: 'SKU' },
+ { key: 'brand', label: 'Brand' },
+ { key: 'manufacturer', label: 'Manufacturer' },
+ { key: 'purpose_of_use', label: 'Purpose Of Use' },
+ { key: 'item_code', label: 'Item Code' },
+ { key: 'status', label: 'Status' },
+ { key: 'source', label: 'Source' },
+ { key: 'is_linked_with_zohocrm', label: 'Is Linked With Zohocrm', format: 'boolean' },
+ { key: 'is_deleted_in_crm', label: 'Is Deleted In CRM', format: 'boolean' },
+ { key: 'zcrm_product_id', label: 'Zoho CRM Product ID' },
+ { key: 'crm_owner_id', label: 'CRM Owner ID' },
+ { key: 'unit', label: 'Unit' },
+ { key: 'is_receivable', label: 'Is Receivable', format: 'boolean' },
+ { key: 'unit_id', label: 'Unit ID' },
+ { key: 'description', label: 'Description' },
+ { key: 'rate', label: 'Rate', format: 'currency' },
+ { key: 'tax_id', label: 'Tax ID' },
+ { key: 'tax_name', label: 'Tax Name' },
+ { key: 'tax_percentage', label: 'Tax Percentage', format: 'number' },
+ { key: 'tax_type', label: 'Tax Type' },
+ { key: 'tax_status', label: 'Tax Status' },
+ { key: 'tax_start_date', label: 'Tax Start Date', format: 'date' },
+ { key: 'tax_end_date', label: 'Tax End Date', format: 'date' },
+ { key: 'tax_groups_details', label: 'Tax Groups Details' },
+ { key: 'tax_country_code', label: 'Tax Country Code' },
+ { key: 'tax_information', label: 'Tax Information', children: taxInformationFields },
+ { key: 'is_tax_expired', label: 'Is Tax Expired', format: 'boolean' },
+ { key: 'purchase_tax_information', label: 'Purchase Tax Information' },
+ { key: 'is_default_tax_applied', label: 'Is Default Tax Applied', format: 'boolean' },
+ { key: 'associated_template_id', label: 'Associated Template ID' },
+ { key: 'documents', label: 'Documents' },
+ { key: 'purchase_description', label: 'Purchase Description' },
+ { key: 'pricebook_rate', label: 'Price List Rate', format: 'currency' },
+ { key: 'pricing_scheme', label: 'Pricing Scheme' },
+ { key: 'price_brackets', label: 'Price Brackets' },
+ {
+ key: 'default_price_brackets',
+ label: 'Default Price Brackets',
+ listItems: defaultPriceBracketsFields,
+ },
+ { key: 'sales_rate', label: 'Sales Rate', format: 'currency' },
+ { key: 'purchase_rate', label: 'Purchase Rate', format: 'currency' },
+ { key: 'sales_margin', label: 'Sales Margin' },
+ { key: 'created_at', label: 'Created At', format: 'date' },
+ { key: 'created_time', label: 'Created Time', format: 'datetime' },
+ { key: 'last_modified_time', label: 'Last Modified Time', format: 'datetime' },
+ { key: 'track_inventory', label: 'Track Inventory', format: 'boolean' },
+ { key: 'item_type', label: 'Item Type' },
+ { key: 'product_type', label: 'Product Type' },
+ { key: 'minimum_order_quantity', label: 'Minimum Order Quantity' },
+ { key: 'maximum_order_quantity', label: 'Maximum Order Quantity' },
+ { key: 'custom_fields', label: 'Custom Fields' },
+ { key: 'is_fulfillable', label: 'Is Fulfillable', format: 'boolean' },
+ { key: 'attribute_name1', label: 'Attribute Name1' },
+ { key: 'attribute_name2', label: 'Attribute Name2' },
+ { key: 'attribute_name3', label: 'Attribute Name3' },
+ { key: 'attribute_option_name1', label: 'Attribute Option Name1' },
+ { key: 'attribute_option_name2', label: 'Attribute Option Name2' },
+ { key: 'attribute_option_name3', label: 'Attribute Option Name3' },
+ { key: 'sales_channels', label: 'Sales Channels' },
+ { key: 'is_modifier_item', label: 'Is Modifier Item', format: 'boolean' },
+ { key: 'integration_references', label: 'Integration References' },
+ { key: 'has_variant', label: 'Has Variant', format: 'boolean' },
+ { key: 'default_hosted_page_url', label: 'Default Hosted Page URL', format: 'url' },
+];
+
+const paymentFields: OutputSchema['fields'] = [
+ { key: 'payment_id', label: 'Payment ID' },
+ { key: 'payment_number', label: 'Payment Number' },
+ { key: 'sales_channel', label: 'Sales Channel' },
+ { key: 'account_identifier', label: 'Account Identifier' },
+ { key: 'payment_link_id', label: 'Payment Link ID' },
+ { key: 'created_by', label: 'Created By' },
+ { key: 'created_time', label: 'Created Time', format: 'datetime' },
+ { key: 'updated_time', label: 'Updated Time', format: 'datetime' },
+ { key: 'payment_number_prefix', label: 'Payment Number Prefix' },
+ { key: 'payment_number_suffix', label: 'Payment Number Suffix' },
+ { key: 'documents', label: 'Documents' },
+ { key: 'beat_id', label: 'Beat ID' },
+ { key: 'beat_number', label: 'Beat Number' },
+ { key: 'journey_plan_id', label: 'Journey Plan ID' },
+ { key: 'sales_person_id', label: 'Sales Person ID' },
+ { key: 'sales_person_name', label: 'Sales Person Name' },
+ { key: 'customer_id', label: 'Customer ID' },
+ { key: 'customer_name', label: 'Customer Name' },
+ { key: 'payment_mode', label: 'Payment Mode' },
+ { key: 'card_type', label: 'Card Type' },
+ { key: 'date', label: 'Date', format: 'date' },
+ { key: 'currency_id', label: 'Currency ID' },
+ { key: 'currency_symbol', label: 'Currency Symbol' },
+ { key: 'currency_code', label: 'Currency Code' },
+ { key: 'exchange_rate', label: 'Exchange Rate', format: 'number' },
+ { key: 'amount', label: 'Amount', format: 'currency' },
+ { key: 'bcy_amount', label: 'Amount (Base Currency)', format: 'currency' },
+ { key: 'unused_amount', label: 'Unused Amount', format: 'currency' },
+ { key: 'bank_charges', label: 'Bank Charges', format: 'currency' },
+ {
+ key: 'is_client_review_settings_enabled',
+ label: 'Is Client Review Settings Enabled',
+ format: 'boolean',
+ },
+ { key: 'tax_amount_withheld', label: 'Tax Amount Withheld', format: 'currency' },
+ { key: 'description', label: 'Description' },
+ { key: 'product_description', label: 'Product Description' },
+ { key: 'reference_number', label: 'Reference Number' },
+ { key: 'online_transaction_id', label: 'Online Transaction ID' },
+ { key: 'payment_gateway', label: 'Payment Gateway' },
+ { key: 'settlement_status', label: 'Settlement Status' },
+ { key: 'tds_type', label: 'TDS Type' },
+ { key: 'tds_tax_id', label: 'TDS Tax ID' },
+ { key: 'is_ondc_channel', label: 'Is ONDC Channel', format: 'boolean' },
+ { key: 'is_paid_via_check', label: 'Is Paid Via Check', format: 'boolean' },
+ {
+ key: 'invoices',
+ label: 'Invoices',
+ listItems: [
+ { key: 'invoice_number', label: 'Invoice Number' },
+ { key: 'invoice_payment_id', label: 'Invoice Payment ID' },
+ { key: 'invoice_id', label: 'Invoice ID' },
+ { key: 'invoice_customer_id', label: 'Invoice Customer ID' },
+ { key: 'invoice_customer_name', label: 'Invoice Customer Name' },
+ { key: 'amount_applied', label: 'Amount Applied', format: 'currency' },
+ { key: 'tax_amount_withheld', label: 'Tax Amount Withheld', format: 'currency' },
+ { key: 'total', label: 'Total', format: 'currency' },
+ { key: 'balance', label: 'Balance', format: 'currency' },
+ { key: 'date', label: 'Date', format: 'date' },
+ { key: 'due_date', label: 'Due Date', format: 'date' },
+ {
+ key: 'unprocessed_payment_amount',
+ label: 'Unprocessed Payment Amount',
+ format: 'currency',
+ },
+ { key: 'price_precision', label: 'Price Precision', format: 'number' },
+ { key: 'apply_date', label: 'Apply Date', format: 'date' },
+ { key: 'allow_partial_payments', label: 'Allow Partial Payments' },
+ { key: 'invoice_installments', label: 'Invoice Installments' },
+ { key: 'installments', label: 'Installments' },
+ ],
+ },
+ { key: 'check_details', label: 'Check Details', children: checkDetailsFields },
+ { key: 'registration_details', label: 'Registration Details' },
+ { key: 'payment_status', label: 'Payment Status' },
+ { key: 'tender_id', label: 'Tender ID' },
+ { key: 'deposit_details', label: 'Deposit Details' },
+ { key: 'last_four_digits', label: 'Last Four Digits' },
+ { key: 'template_id', label: 'Template ID' },
+ { key: 'template_name', label: 'Template Name' },
+ { key: 'template_type', label: 'Template Type' },
+ { key: 'attachment_name', label: 'Attachment Name' },
+ { key: 'can_send_in_mail', label: 'Can Send In Mail', format: 'boolean' },
+ { key: 'is_payment_details_required', label: 'Is Payment Details Required', format: 'boolean' },
+ { key: 'price_precision', label: 'Price Precision', format: 'number' },
+ { key: 'rounding_mode', label: 'Rounding Mode' },
+];
+
+const lineItemsFields: OutputSchema['fields'] = [
+ { key: 'line_item_id', label: 'Line Item ID' },
+ { key: 'item_order', label: 'Item Order', format: 'number' },
+ { key: 'description', label: 'Description' },
+ { key: 'tax_id', label: 'Tax ID' },
+ { key: 'tax_name', label: 'Tax Name' },
+ { key: 'tax_type', label: 'Tax Type' },
+ { key: 'tax_percentage', label: 'Tax Percentage', format: 'number' },
+ { key: 'item_total', label: 'Item Total', format: 'currency' },
+ { key: 'line_item_taxes', label: 'Line Item Taxes' },
+];
+
+const contactPersonsDetailsFields: OutputSchema['fields'] = [
+ { key: 'contact_person_id', label: 'Contact Person ID' },
+ { key: 'first_name', label: 'First Name' },
+ { key: 'last_name', label: 'Last Name' },
+ { key: 'email', label: 'Email', format: 'email' },
+ { key: 'phone', label: 'Phone' },
+ { key: 'mobile', label: 'Mobile' },
+ { key: 'is_primary_contact', label: 'Is Primary Contact', format: 'boolean' },
+];
+
+const creditNoteFields: OutputSchema['fields'] = [
+ { key: 'creditnote_id', label: 'Credit Note ID' },
+ { key: 'creditnote_number', label: 'Credit Note Number' },
+ { key: 'date', label: 'Date', format: 'date' },
+];
+
+const userFields: OutputSchema['fields'] = [
+ { key: 'user_id', label: 'User ID' },
+ { key: 'email', label: 'Email', format: 'email' },
+ { key: 'user_role', label: 'User Role' },
+ { key: 'role_id', label: 'Role ID' },
+];
+
+export const zohoInvoiceMessageWithDataOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'message', label: 'Message' },
+ { key: 'data', label: 'Data' },
+ ],
+};
+
+export const zohoInvoiceListProjectUsersOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'message', label: 'Message' },
+ {
+ key: 'users',
+ label: 'Users',
+ labelKey: 'email',
+ listItems: [
+ ...usersFields,
+ { key: 'user_name', label: 'User Name' },
+ { key: 'rate', label: 'Rate', format: 'currency' },
+ { key: 'is_timer_running', label: 'Is Timer Running', format: 'boolean' },
+ { key: 'timer_started_date', label: 'Timer Started Date' },
+ { key: 'timer_running_task', label: 'Timer Running Task' },
+ { key: 'budget_hours', label: 'Budget Hours', format: 'number' },
+ { key: 'budget_hours_in_time', label: 'Budget Hours In Time' },
+ { key: 'un_billed_hours', label: 'Unbilled Hours' },
+ { key: 'billed_hours', label: 'Billed Hours' },
+ { key: 'total_hours', label: 'Total Hours' },
+ ],
+ },
+ ],
+};
+
+export const zohoInvoiceProjectOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'message', label: 'Message' },
+ {
+ key: 'project',
+ label: 'Project',
+ children: [
+ ...projectFields,
+ { key: 'total_amount', label: 'Total Amount', format: 'currency' },
+ { key: 'billed_amount', label: 'Billed Amount', format: 'currency' },
+ { key: 'un_billed_amount', label: 'Unbilled Amount', format: 'currency' },
+ { key: 'billable_amount', label: 'Billable Amount', format: 'currency' },
+ { key: 'non_billable_amount', label: 'Non Billable Amount', format: 'currency' },
+ { key: 'rate', label: 'Rate', format: 'currency' },
+ { key: 'budget_hours', label: 'Budget Hours', format: 'number' },
+ { key: 'budget_hours_in_time', label: 'Budget Hours In Time' },
+ ],
+ },
+ ],
+};
+
+export const zohoInvoiceContactOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'message', label: 'Message' },
+ {
+ key: 'contact',
+ label: 'Contact',
+ children: [
+ { key: 'contact_id', label: 'Contact ID' },
+ { key: 'contact_name', label: 'Contact Name' },
+ { key: 'company_name', label: 'Company Name' },
+ { key: 'contact_tax_information', label: 'Contact Tax Information' },
+ { key: 'contact_blocks', label: 'Contact Blocks' },
+ { key: 'first_name', label: 'First Name' },
+ { key: 'last_name', label: 'Last Name' },
+ { key: 'designation', label: 'Designation' },
+ { key: 'department', label: 'Department' },
+ { key: 'website', label: 'Website', format: 'url' },
+ { key: 'is_bcy_only_contact', label: 'Is Base Currency Only Contact', format: 'boolean' },
+ {
+ key: 'is_credit_limit_migration_completed',
+ label: 'Is Credit Limit Migration Completed',
+ format: 'boolean',
+ },
+ { key: 'language_code', label: 'Language Code' },
+ { key: 'contact_salutation', label: 'Contact Salutation' },
+ { key: 'email', label: 'Email', format: 'email' },
+ { key: 'phone', label: 'Phone' },
+ { key: 'mobile', label: 'Mobile' },
+ { key: 'invited_by', label: 'Invited By' },
+ { key: 'portal_status', label: 'Portal Status' },
+ { key: 'is_client_review_asked', label: 'Is Client Review Asked', format: 'boolean' },
+ { key: 'has_transaction', label: 'Has Transaction', format: 'boolean' },
+ { key: 'contact_type', label: 'Contact Type' },
+ { key: 'customer_sub_type', label: 'Customer Sub Type' },
+ { key: 'contact_relation_type', label: 'Contact Relation Type' },
+ { key: 'owner_id', label: 'Owner ID' },
+ { key: 'owner_name', label: 'Owner Name' },
+ { key: 'source', label: 'Source' },
+ { key: 'documents', label: 'Documents' },
+ { key: 'twitter', label: 'Twitter' },
+ { key: 'facebook', label: 'Facebook' },
+ { key: 'is_crm_customer', label: 'Is CRM Customer', format: 'boolean' },
+ { key: 'is_linked_with_zohocrm', label: 'Is Linked With Zohocrm', format: 'boolean' },
+ { key: 'is_deleted_in_crm', label: 'Is Deleted In CRM', format: 'boolean' },
+ { key: 'primary_contact_id', label: 'Primary Contact ID' },
+ { key: 'zcrm_account_id', label: 'Zoho CRM Account ID' },
+ { key: 'zcrm_contact_id', label: 'Zoho CRM Contact ID' },
+ { key: 'crm_owner_id', label: 'CRM Owner ID' },
+ { key: 'payment_terms', label: 'Payment Terms', format: 'number' },
+ { key: 'payment_terms_label', label: 'Payment Terms Label' },
+ { key: 'payment_terms_id', label: 'Payment Terms ID' },
+ {
+ key: 'credit_limit_exceeded_amount',
+ label: 'Credit Limit Exceeded Amount',
+ format: 'currency',
+ },
+ { key: 'currency_id', label: 'Currency ID' },
+ { key: 'currency_code', label: 'Currency Code' },
+ { key: 'currency_symbol', label: 'Currency Symbol' },
+ { key: 'price_precision', label: 'Price Precision', format: 'number' },
+ { key: 'opening_balance_amount', label: 'Opening Balance Amount', format: 'currency' },
+ {
+ key: 'outstanding_receivable_amount',
+ label: 'Outstanding Receivable Amount',
+ format: 'currency',
+ },
+ {
+ key: 'outstanding_receivable_amount_bcy',
+ label: 'Outstanding Receivable Amount (Base Currency)',
+ format: 'currency',
+ },
+ {
+ key: 'unused_credits_receivable_amount',
+ label: 'Unused Credits Receivable Amount',
+ format: 'currency',
+ },
+ {
+ key: 'unused_credits_receivable_amount_bcy',
+ label: 'Unused Credits Receivable Amount (Base Currency)',
+ format: 'currency',
+ },
+ { key: 'unused_retainer_payments', label: 'Unused Retainer Payments', format: 'currency' },
+ { key: 'status', label: 'Status' },
+ { key: 'payment_reminder_enabled', label: 'Payment Reminder Enabled', format: 'boolean' },
+ { key: 'is_sms_enabled', label: 'Is SMS Enabled', format: 'boolean' },
+ { key: 'is_consent_agreed', label: 'Is Consent Agreed', format: 'boolean' },
+ { key: 'consent_date', label: 'Consent Date', format: 'date' },
+ {
+ key: 'is_client_review_settings_enabled',
+ label: 'Is Client Review Settings Enabled',
+ format: 'boolean',
+ },
+ { key: 'custom_fields', label: 'Custom Fields' },
+ { key: 'tds_tax_id', label: 'TDS Tax ID' },
+ { key: 'pan_no', label: 'PAN No' },
+ { key: 'trader_name', label: 'Trader Name' },
+ { key: 'legal_name', label: 'Legal Name' },
+ { key: 'tax_reg_label', label: 'Tax Reg Label' },
+ { key: 'udyam_reg_no', label: 'Udyam Reg No' },
+ { key: 'msme_type', label: 'MSME Type' },
+ { key: 'is_valid_udyam_no', label: 'Is Valid Udyam No' },
+ { key: 'udyam_validated_time', label: 'Udyam Validated Time', format: 'datetime' },
+ { key: 'contact_category', label: 'Contact Category' },
+ { key: 'sales_channel', label: 'Sales Channel' },
+ { key: 'ach_supported', label: 'ACH Supported', format: 'boolean' },
+ { key: 'portal_receipt_count', label: 'Portal Receipt Count', format: 'number' },
+ { key: 'entity_address_id', label: 'Entity Address ID' },
+ {
+ key: 'billing_address',
+ label: 'Billing Address',
+ children: [
+ ...billingAddressFields,
+ { key: 'address_id', label: 'Address ID' },
+ { key: 'state_code', label: 'State Code' },
+ { key: 'zip', label: 'Zip' },
+ { key: 'county', label: 'County' },
+ { key: 'latitude', label: 'Latitude' },
+ { key: 'longitude', label: 'Longitude' },
+ { key: 'country_code', label: 'Country Code' },
+ ],
+ },
+ {
+ key: 'shipping_address',
+ label: 'Shipping Address',
+ children: [
+ ...shippingAddressFields,
+ { key: 'address_id', label: 'Address ID' },
+ { key: 'state_code', label: 'State Code' },
+ { key: 'zip', label: 'Zip' },
+ { key: 'county', label: 'County' },
+ { key: 'country_code', label: 'Country Code' },
+ { key: 'latitude', label: 'Latitude' },
+ { key: 'longitude', label: 'Longitude' },
+ ],
+ },
+ {
+ key: 'contact_persons',
+ label: 'Contact Persons',
+ labelKey: 'email',
+ listItems: [
+ ...contactPersonsFields,
+ { key: 'mobile_country_code', label: 'Mobile Country Code' },
+ { key: 'date_of_birth', label: 'Date Of Birth', format: 'date' },
+ { key: 'gender', label: 'Gender' },
+ { key: 'zcrm_contact_id', label: 'Zoho CRM Contact ID' },
+ { key: 'is_portal_mfa_enabled', label: 'Is Portal MFA Enabled', format: 'boolean' },
+ { key: 'is_sms_enabled_for_cp', label: 'Is SMS Enabled For Cp', format: 'boolean' },
+ { key: 'portal_enabled_via', label: 'Portal Enabled Via' },
+ {
+ key: 'communication_preference',
+ label: 'Communication Preference',
+ children: [{ key: 'is_email_enabled', label: 'Is Email Enabled', format: 'boolean' }],
+ },
+ ],
+ },
+ { key: 'addresses', label: 'Addresses' },
+ { key: 'pricebook_id', label: 'Price List ID' },
+ { key: 'pricebook_name', label: 'Price List Name' },
+ {
+ key: 'default_templates',
+ label: 'Default Templates',
+ children: [
+ { key: 'statement_template_id', label: 'Statement Template ID' },
+ { key: 'statement_template_name', label: 'Statement Template Name' },
+ { key: 'invoice_template_id', label: 'Invoice Template ID' },
+ { key: 'invoice_template_name', label: 'Invoice Template Name' },
+ { key: 'bill_template_id', label: 'Bill Template ID' },
+ { key: 'bill_template_name', label: 'Bill Template Name' },
+ { key: 'estimate_template_id', label: 'Estimate Template ID' },
+ { key: 'estimate_template_name', label: 'Estimate Template Name' },
+ { key: 'creditnote_template_id', label: 'Credit Note Template ID' },
+ { key: 'creditnote_template_name', label: 'Credit Note Template Name' },
+ { key: 'paymentthankyou_template_id', label: 'Payment Thank-You Template ID' },
+ { key: 'paymentthankyou_template_name', label: 'Payment Thank-You Template Name' },
+ { key: 'invoice_email_template_id', label: 'Invoice Email Template ID' },
+ { key: 'invoice_email_template_name', label: 'Invoice Email Template Name' },
+ { key: 'estimate_email_template_id', label: 'Estimate Email Template ID' },
+ { key: 'estimate_email_template_name', label: 'Estimate Email Template Name' },
+ { key: 'creditnote_email_template_id', label: 'Credit Note Email Template ID' },
+ { key: 'creditnote_email_template_name', label: 'Credit Note Email Template Name' },
+ {
+ key: 'paymentthankyou_email_template_id',
+ label: 'Payment Thank-You Email Template ID',
+ },
+ {
+ key: 'paymentthankyou_email_template_name',
+ label: 'Payment Thank-You Email Template Name',
+ },
+ {
+ key: 'payment_remittance_email_template_id',
+ label: 'Payment Remittance Email Template ID',
+ },
+ {
+ key: 'payment_remittance_email_template_name',
+ label: 'Payment Remittance Email Template Name',
+ },
+ ],
+ },
+ { key: 'associated_with_square', label: 'Associated With Square', format: 'boolean' },
+ { key: 'cards', label: 'Cards' },
+ { key: 'checks', label: 'Checks' },
+ { key: 'upi_mandates', label: 'UPI Mandates' },
+ { key: 'bank_accounts', label: 'Bank Accounts' },
+ { key: 'vpa_list', label: 'VPA List' },
+ { key: 'notes', label: 'Notes' },
+ { key: 'created_time', label: 'Created Time', format: 'datetime' },
+ { key: 'created_date', label: 'Created Date', format: 'date' },
+ { key: 'created_by_name', label: 'Created By Name' },
+ { key: 'created_by_id', label: 'Created By ID' },
+ { key: 'last_modified_by_id', label: 'Last Modified By ID' },
+ { key: 'last_modified_time', label: 'Last Modified Time', format: 'datetime' },
+ {
+ key: 'customer_currency_summaries',
+ label: 'Customer Currency Summaries',
+ listItems: [
+ { key: 'currency_id', label: 'Currency ID' },
+ { key: 'currency_code', label: 'Currency Code' },
+ { key: 'currency_symbol', label: 'Currency Symbol' },
+ { key: 'price_precision', label: 'Price Precision', format: 'number' },
+ { key: 'is_base_currency', label: 'Is Base Currency', format: 'boolean' },
+ {
+ key: 'outstanding_receivable_amount',
+ label: 'Outstanding Receivable Amount',
+ format: 'currency',
+ },
+ {
+ key: 'unused_credits_receivable_amount',
+ label: 'Unused Credits Receivable Amount',
+ format: 'currency',
+ },
+ ],
+ },
+ { key: 'approvers_list', label: 'Approvers List' },
+ { key: 'submitted_date', label: 'Submitted Date', format: 'date' },
+ { key: 'submitted_by', label: 'Submitted By' },
+ { key: 'submitted_by_name', label: 'Submitted By Name' },
+ { key: 'submitted_by_email', label: 'Submitted By Email' },
+ { key: 'submitter_id', label: 'Submitter ID' },
+ { key: 'approver_id', label: 'Approver ID' },
+ { key: 'is_multi_match_approval', label: 'Is Multi Match Approval', format: 'boolean' },
+ { key: 'approval_name', label: 'Approval Name' },
+ { key: 'approval_path', label: 'Approval Path' },
+ { key: 'approvers', label: 'Approvers' },
+ { key: 'note_to_approver', label: 'Note To Approver' },
+ { key: 'integration_references', label: 'Integration References' },
+ { key: 'additional_information', label: 'Additional Information' },
+ { key: 'registration_details', label: 'Registration Details' },
+ ],
+ },
+ ],
+};
+
+export const zohoInvoiceMessageOutputSchema: OutputSchema = {
+ fields: [{ key: 'message', label: 'Message' }],
+};
+
+export const zohoInvoiceCurrencyOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'message', label: 'Message' },
+ {
+ key: 'currency',
+ label: 'Currency',
+ children: [
+ { key: 'currency_id', label: 'Currency ID' },
+ { key: 'currency_code', label: 'Currency Code' },
+ { key: 'currency_name', label: 'Currency Name' },
+ { key: 'currency_symbol', label: 'Currency Symbol' },
+ { key: 'price_precision', label: 'Price Precision', format: 'number' },
+ { key: 'currency_format', label: 'Currency Format' },
+ { key: 'is_base_currency', label: 'Is Base Currency', format: 'boolean' },
+ {
+ key: 'auto_exchange_rate_enabled',
+ label: 'Auto Exchange Rate Enabled',
+ format: 'boolean',
+ },
+ ],
+ },
+ ],
+};
+
+export const zohoInvoiceListCurrenciesOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'message', label: 'Message' },
+ {
+ key: 'currencies',
+ label: 'Currencies',
+ listItems: [
+ { key: 'currency_id', label: 'Currency ID' },
+ { key: 'currency_code', label: 'Currency Code' },
+ { key: 'currency_name', label: 'Currency Name' },
+ { key: 'currency_symbol', label: 'Currency Symbol' },
+ { key: 'price_precision', label: 'Price Precision', format: 'number' },
+ { key: 'currency_format', label: 'Currency Format' },
+ { key: 'is_base_currency', label: 'Is Base Currency', format: 'boolean' },
+ { key: 'exchange_rate', label: 'Exchange Rate', format: 'number' },
+ { key: 'effective_date', label: 'Effective Date', format: 'date' },
+ {
+ key: 'auto_exchange_rate_enabled',
+ label: 'Auto Exchange Rate Enabled',
+ format: 'boolean',
+ },
+ ],
+ },
+ {
+ key: 'page_context',
+ label: 'Page Context',
+ children: [
+ ...pageContextFields,
+ { key: 'applied_filter', label: 'Applied Filter' },
+ { key: 'as_of_date', label: 'As Of Date', format: 'date' },
+ { key: 'to_date', label: 'To Date', format: 'date' },
+ ],
+ },
+ ],
+};
+
+export const zohoInvoiceGetOrganizationOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'message', label: 'Message' },
+ {
+ key: 'organization',
+ label: 'Organization',
+ children: [
+ { key: 'organization_id', label: 'Organization ID' },
+ { key: 'name', label: 'Name' },
+ { key: 'first_name', label: 'First Name' },
+ { key: 'last_name', label: 'Last Name' },
+ { key: 'is_default_org', label: 'Is Default Org', format: 'boolean' },
+ { key: 'user_role', label: 'User Role' },
+ { key: 'role_id', label: 'Role ID' },
+ { key: 'account_created_date', label: 'Account Created Date', format: 'date' },
+ { key: 'time_zone', label: 'Time Zone' },
+ { key: 'language_code', label: 'Language Code' },
+ { key: 'customer_languages', label: 'Customer Languages' },
+ { key: 'date_format', label: 'Date Format' },
+ { key: 'field_separator', label: 'Field Separator' },
+ { key: 'fiscal_year_start_month', label: 'Fiscal Year Start Month' },
+ { key: 'primary_domain_name', label: 'Primary Domain Name' },
+ { key: 'is_public_domain', label: 'Is Public Domain', format: 'boolean' },
+ { key: 'fiscal_year_start_date', label: 'Fiscal Year Start Date', format: 'number' },
+ { key: 'contact_name', label: 'Contact Name' },
+ { key: 'industry_type', label: 'Industry Type' },
+ { key: 'industry_size', label: 'Industry Size' },
+ { key: 'previous_invoicing_option', label: 'Previous Invoicing Option' },
+ { key: 'previous_product_option', label: 'Previous Product Option' },
+ { key: 'business_management_type', label: 'Business Management Type' },
+ { key: 'company_id_label', label: 'Company ID Label' },
+ { key: 'custom_field_type', label: 'Custom Field Type', format: 'number' },
+ { key: 'is_trial_period_extended', label: 'Is Trial Period Extended', format: 'boolean' },
+ { key: 'is_sez', label: 'Is SEZ', format: 'boolean' },
+ { key: 'is_designated_zone', label: 'Is Designated Zone', format: 'boolean' },
+ { key: 'is_free_zone', label: 'Is Free Zone', format: 'boolean' },
+ { key: 'store_url', label: 'Store URL', format: 'url' },
+ { key: 'company_id_value', label: 'Company ID Value' },
+ { key: 'label_for_company_id', label: 'Label For Company ID' },
+ { key: 'tax_id_label', label: 'Tax ID Label' },
+ { key: 'tax_id_value', label: 'Tax ID Value' },
+ { key: 'currency_id', label: 'Currency ID' },
+ { key: 'currency_code', label: 'Currency Code' },
+ { key: 'currency_symbol', label: 'Currency Symbol' },
+ { key: 'currency_format', label: 'Currency Format' },
+ { key: 'price_precision', label: 'Price Precision', format: 'number' },
+ { key: 'status', label: 'Status' },
+ {
+ key: 'address',
+ label: 'Address',
+ children: [
+ { key: 'street_address1', label: 'Street Address1' },
+ { key: 'street_address2', label: 'Street Address2' },
+ { key: 'city', label: 'City' },
+ { key: 'state', label: 'State' },
+ { key: 'state_code', label: 'State Code' },
+ { key: 'country', label: 'Country' },
+ { key: 'zip', label: 'Zip' },
+ { key: 'latitude', label: 'Latitude' },
+ { key: 'longitude', label: 'Longitude' },
+ { key: 'attention', label: 'Attention' },
+ ],
+ },
+ {
+ key: 'tax_settings',
+ label: 'Tax Settings',
+ children: [
+ { key: 'is_tax_registered', label: 'Is Tax Registered', format: 'boolean' },
+ { key: 'tax_reg_no', label: 'Tax Reg No' },
+ ],
+ },
+ { key: 'is_registered_for_gst', label: 'Is Registered For GST', format: 'boolean' },
+ {
+ key: 'is_composition_scheme_enabled',
+ label: 'Is Composition Scheme Enabled',
+ format: 'boolean',
+ },
+ { key: 'org_address', label: 'Org Address' },
+ { key: 'remit_to_address', label: 'Remit To Address' },
+ { key: 'phone', label: 'Phone' },
+ { key: 'fax', label: 'Fax' },
+ { key: 'website', label: 'Website', format: 'url' },
+ { key: 'version', label: 'Version' },
+ { key: 'weight_unit', label: 'Weight Unit' },
+ { key: 'dimension_unit', label: 'Dimension Unit' },
+ { key: 'business_type', label: 'Business Type' },
+ { key: 'email', label: 'Email', format: 'email' },
+ { key: 'unverified_emails_count', label: 'Unverified Emails Count', format: 'number' },
+ {
+ key: 'custom_fields',
+ label: 'Custom Fields',
+ labelKey: 'label',
+ listItems: customFieldsFields,
+ },
+ { key: 'is_org_active', label: 'Is Org Active', format: 'boolean' },
+ {
+ key: 'is_new_customer_custom_fields',
+ label: 'Is New Customer Custom Fields',
+ format: 'boolean',
+ },
+ { key: 'is_late_fee_disabled', label: 'Is Late Fee Disabled', format: 'boolean' },
+ { key: 'is_portal_enabled', label: 'Is Portal Enabled', format: 'boolean' },
+ { key: 'org_joined_app_list', label: 'Org Joined App List' },
+ { key: 'company_identification_labels_list', label: 'Company Identification Labels List' },
+ { key: 'portal_name', label: 'Portal Name' },
+ { key: 'is_estimate_enabled', label: 'Is Estimate Enabled', format: 'boolean' },
+ { key: 'is_project_enabled', label: 'Is Project Enabled', format: 'boolean' },
+ {
+ key: 'is_retainerinvoice_enabled',
+ label: 'Is Retainer Invoice Enabled',
+ format: 'boolean',
+ },
+ { key: 'mode', label: 'Mode' },
+ { key: 'payments_url', label: 'Payments URL', format: 'url' },
+ ],
+ },
+ ],
+};
+
+export const zohoInvoiceCreateItemOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'message', label: 'Message' },
+ { key: 'item', label: 'Item', children: itemFields },
+ ],
+};
+
+export const zohoInvoiceItemOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'message', label: 'Message' },
+ { key: 'item', label: 'Item', children: itemFields },
+ ],
+};
+
+export const zohoInvoiceListItemsOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'message', label: 'Message' },
+ {
+ key: 'items',
+ label: 'Items',
+ labelKey: 'name',
+ listItems: [
+ { key: 'item_id', label: 'Item ID' },
+ { key: 'name', label: 'Name' },
+ { key: 'item_name', label: 'Item Name' },
+ { key: 'unit', label: 'Unit' },
+ { key: 'status', label: 'Status' },
+ { key: 'source', label: 'Source' },
+ { key: 'is_linked_with_zohocrm', label: 'Is Linked With Zohocrm', format: 'boolean' },
+ { key: 'zcrm_product_id', label: 'Zoho CRM Product ID' },
+ { key: 'description', label: 'Description' },
+ { key: 'rate', label: 'Rate', format: 'currency' },
+ { key: 'tax_id', label: 'Tax ID' },
+ { key: 'tax_name', label: 'Tax Name' },
+ { key: 'tax_percentage', label: 'Tax Percentage', format: 'number' },
+ { key: 'track_inventory', label: 'Track Inventory', format: 'boolean' },
+ { key: 'product_type', label: 'Product Type' },
+ { key: 'has_attachment', label: 'Has Attachment', format: 'boolean' },
+ { key: 'sku', label: 'SKU' },
+ { key: 'created_time', label: 'Created Time', format: 'datetime' },
+ { key: 'last_modified_time', label: 'Last Modified Time', format: 'datetime' },
+ { key: 'purpose_of_use', label: 'Purpose Of Use' },
+ { key: 'vendor_name', label: 'Vendor Name' },
+ ],
+ },
+ {
+ key: 'page_context',
+ label: 'Page Context',
+ children: [
+ ...pageContextFields,
+ { key: 'applied_filter', label: 'Applied Filter' },
+ { key: 'custom_fields', label: 'Custom Fields' },
+ { key: 'sort_column', label: 'Sort Column' },
+ { key: 'sort_order', label: 'Sort Order' },
+ ],
+ },
+ ],
+};
+
+export const zohoInvoiceTaxOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'message', label: 'Message' },
+ {
+ key: 'tax',
+ label: 'Tax',
+ children: [
+ { key: 'tax_id', label: 'Tax ID' },
+ { key: 'tax_display_name', label: 'Tax Display Name' },
+ { key: 'tax_name', label: 'Tax Name' },
+ { key: 'tax_percentage', label: 'Tax Percentage', format: 'number' },
+ { key: 'tax_type', label: 'Tax Type' },
+ { key: 'tax_specific_type', label: 'Tax Specific Type' },
+ { key: 'tax_specification', label: 'Tax Specification' },
+ { key: 'diff_rate_reason', label: 'Diff Rate Reason' },
+ { key: 'start_date', label: 'Start Date', format: 'date' },
+ { key: 'end_date', label: 'End Date', format: 'date' },
+ { key: 'status', label: 'Status' },
+ { key: 'description', label: 'Description' },
+ { key: 'reference_id', label: 'Reference ID' },
+ ],
+ },
+ ],
+};
+
+export const zohoInvoiceListTaxesOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'message', label: 'Message' },
+ {
+ key: 'taxes',
+ label: 'Taxes',
+ listItems: [
+ ...taxesFields,
+ { key: 'is_inactive', label: 'Is Inactive', format: 'boolean' },
+ { key: 'is_default_tax', label: 'Is Default Tax', format: 'boolean' },
+ { key: 'is_editable', label: 'Is Editable', format: 'boolean' },
+ { key: 'tax_specification', label: 'Tax Specification' },
+ { key: 'diff_rate_reason', label: 'Diff Rate Reason' },
+ { key: 'last_modified_time', label: 'Last Modified Time', format: 'datetime' },
+ { key: 'description', label: 'Description' },
+ { key: 'reference_id', label: 'Reference ID' },
+ ],
+ },
+ {
+ key: 'page_context',
+ label: 'Page Context',
+ children: [
+ ...pageContextFields,
+ { key: 'applied_filter', label: 'Applied Filter' },
+ { key: 'as_of_date', label: 'As Of Date', format: 'date' },
+ { key: 'to_date', label: 'To Date', format: 'date' },
+ { key: 'sort_column', label: 'Sort Column' },
+ { key: 'sort_order', label: 'Sort Order' },
+ ],
+ },
+ ],
+};
+
+export const zohoInvoiceTaxGroupOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'message', label: 'Message' },
+ {
+ key: 'tax_group',
+ label: 'Tax Group',
+ children: [
+ { key: 'tax_group_id', label: 'Tax Group ID' },
+ { key: 'tax_type', label: 'Tax Type' },
+ { key: 'tax_group_name', label: 'Tax Group Name' },
+ { key: 'tax_group_percentage', label: 'Tax Group Percentage', format: 'number' },
+ { key: 'taxes', label: 'Taxes', listItems: taxesFields },
+ { key: 'status', label: 'Status' },
+ { key: 'start_date', label: 'Start Date', format: 'date' },
+ { key: 'end_date', label: 'End Date', format: 'date' },
+ ],
+ },
+ ],
+};
+
+export const zohoInvoiceUserOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'message', label: 'Message' },
+ {
+ key: 'user',
+ label: 'User',
+ children: [
+ ...userFields,
+ { key: 'name', label: 'Name' },
+ { key: 'is_super_admin', label: 'Is Super Admin', format: 'boolean' },
+ { key: 'source', label: 'Source' },
+ {
+ key: 'email_ids',
+ label: 'Email IDs',
+ labelKey: 'email',
+ listItems: [
+ { key: 'is_selected', label: 'Is Selected', format: 'boolean' },
+ { key: 'email', label: 'Email', format: 'email' },
+ ],
+ },
+ { key: 'status', label: 'Status' },
+ { key: 'iam_contact_email', label: 'Iam Contact Email', format: 'email' },
+ { key: 'mobile', label: 'Mobile' },
+ { key: 'iam_contact_mobile', label: 'Iam Contact Mobile' },
+ { key: 'invitation_status', label: 'Invitation Status' },
+ { key: 'invitation_type', label: 'Invitation Type' },
+ { key: 'user_type', label: 'User Type' },
+ { key: 'custom_fields', label: 'Custom Fields' },
+ { key: 'created_time', label: 'Created Time', format: 'datetime' },
+ {
+ key: 'role',
+ label: 'Role',
+ children: [
+ {
+ key: 'role',
+ label: 'Role',
+ children: [
+ { key: 'role_name', label: 'Role Name' },
+ {
+ key: 'permissions',
+ label: 'Permissions',
+ listItems: [
+ { key: 'full_access', label: 'Full Access', format: 'boolean' },
+ { key: 'entity', label: 'Entity' },
+ ],
+ },
+ { key: 'description', label: 'Description' },
+ { key: 'display_name', label: 'Display Name' },
+ ],
+ },
+ { key: 'role_id', label: 'Role ID' },
+ { key: 'name', label: 'Name' },
+ { key: 'email', label: 'Email', format: 'email' },
+ { key: 'zuid', label: 'ZUID' },
+ ],
+ },
+ { key: 'is_claimant', label: 'Is Claimant', format: 'boolean' },
+ { key: 'is_employee', label: 'Is Employee', format: 'boolean' },
+ { key: 'billing_rate', label: 'Billing Rate', format: 'currency' },
+ { key: 'is_customer_segmented', label: 'Is Customer Segmented', format: 'boolean' },
+ { key: 'is_vendor_segmented', label: 'Is Vendor Segmented', format: 'boolean' },
+ { key: 'is_accountant', label: 'Is Accountant', format: 'boolean' },
+ { key: 'roles', label: 'Roles', listItems: rolesFields },
+ {
+ key: 'is_associated_for_approval',
+ label: 'Is Associated For Approval',
+ format: 'boolean',
+ },
+ {
+ key: 'is_associated_with_org_email',
+ label: 'Is Associated With Org Email',
+ format: 'boolean',
+ },
+ { key: 'associated_clients', label: 'Associated Clients' },
+ ],
+ },
+ ],
+};
+
+export const zohoInvoiceListUsersOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'message', label: 'Message' },
+ {
+ key: 'users',
+ label: 'Users',
+ labelKey: 'name',
+ listItems: [
+ ...usersFields,
+ { key: 'name', label: 'Name' },
+ { key: 'mobile', label: 'Mobile' },
+ { key: 'invitation_type', label: 'Invitation Type' },
+ { key: 'is_super_admin', label: 'Is Super Admin', format: 'boolean' },
+ { key: 'user_type', label: 'User Type' },
+ { key: 'is_customer_segmented', label: 'Is Customer Segmented', format: 'boolean' },
+ { key: 'is_vendor_segmented', label: 'Is Vendor Segmented', format: 'boolean' },
+ { key: 'roles', label: 'Roles', listItems: rolesFields },
+ { key: 'is_employee', label: 'Is Employee', format: 'boolean' },
+ { key: 'source', label: 'Source' },
+ ],
+ },
+ {
+ key: 'page_context',
+ label: 'Page Context',
+ children: [
+ ...pageContextFields,
+ { key: 'applied_filter', label: 'Applied Filter' },
+ { key: 'sort_column', label: 'Sort Column' },
+ { key: 'sort_order', label: 'Sort Order' },
+ ],
+ },
+ ],
+};
+
+export const zohoInvoiceExchangeRateOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'message', label: 'Message' },
+ {
+ key: 'exchange_rate',
+ label: 'Exchange Rate',
+ children: [
+ { key: 'exchange_rate_id', label: 'Exchange Rate ID' },
+ { key: 'currency_id', label: 'Currency ID' },
+ { key: 'currency_code', label: 'Currency Code' },
+ { key: 'effective_date', label: 'Effective Date', format: 'date' },
+ { key: 'rate', label: 'Rate', format: 'number' },
+ ],
+ },
+ ],
+};
+
+export const zohoInvoiceListExchangeRatesOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'message', label: 'Message' },
+ {
+ key: 'exchange_rates',
+ label: 'Exchange Rates',
+ listItems: [
+ { key: 'exchange_rate_id', label: 'Exchange Rate ID' },
+ { key: 'currency_id', label: 'Currency ID' },
+ { key: 'currency_code', label: 'Currency Code' },
+ { key: 'effective_date', label: 'Effective Date', format: 'date' },
+ { key: 'rate', label: 'Rate', format: 'number' },
+ ],
+ },
+ ],
+};
+
+export const zohoInvoiceAddressInfoOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'message', label: 'Message' },
+ {
+ key: 'address_info',
+ label: 'Address Info',
+ children: [
+ { key: 'address_id', label: 'Address ID' },
+ { key: 'address_type', label: 'Address Type' },
+ { key: 'attention', label: 'Attention' },
+ { key: 'address', label: 'Address' },
+ { key: 'street2', label: 'Street2' },
+ { key: 'city', label: 'City' },
+ { key: 'state_code', label: 'State Code' },
+ { key: 'city_code', label: 'City Code' },
+ { key: 'state', label: 'State' },
+ { key: 'zip', label: 'Zip' },
+ { key: 'country', label: 'Country' },
+ { key: 'county', label: 'County' },
+ { key: 'country_code', label: 'Country Code' },
+ { key: 'phone', label: 'Phone' },
+ { key: 'fax', label: 'Fax' },
+ { key: 'latitude', label: 'Latitude' },
+ { key: 'longitude', label: 'Longitude' },
+ {
+ key: 'update_existing_transactions_address',
+ label: 'Update Existing Transactions Address',
+ },
+ ],
+ },
+ ],
+};
+
+export const zohoInvoiceListContactAddressesOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'message', label: 'Message' },
+ {
+ key: 'addresses',
+ label: 'Addresses',
+ listItems: [
+ { key: 'address_id', label: 'Address ID' },
+ { key: 'attention', label: 'Attention' },
+ { key: 'address', label: 'Address' },
+ { key: 'street2', label: 'Street2' },
+ { key: 'city', label: 'City' },
+ { key: 'state', label: 'State' },
+ { key: 'state_code', label: 'State Code' },
+ { key: 'city_code', label: 'City Code' },
+ { key: 'zip', label: 'Zip' },
+ { key: 'country', label: 'Country' },
+ { key: 'county', label: 'County' },
+ { key: 'country_code', label: 'Country Code' },
+ { key: 'phone', label: 'Phone' },
+ { key: 'fax', label: 'Fax' },
+ ],
+ },
+ ],
+};
+
+export const zohoInvoiceListContactCommentsOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'message', label: 'Message' },
+ {
+ key: 'contact_comments',
+ label: 'Contact Comments',
+ listItems: [
+ { key: 'comment_id', label: 'Comment ID' },
+ { key: 'contact_id', label: 'Contact ID' },
+ { key: 'contact_name', label: 'Contact Name' },
+ { key: 'description', label: 'Description' },
+ { key: 'commented_by_id', label: 'Commented By ID' },
+ { key: 'commented_by', label: 'Commented By' },
+ { key: 'date', label: 'Date', format: 'date' },
+ { key: 'date_description', label: 'Date Description' },
+ { key: 'time', label: 'Time' },
+ { key: 'transaction_id', label: 'Transaction ID' },
+ { key: 'transaction_type', label: 'Transaction Type' },
+ { key: 'is_entity_deleted', label: 'Is Entity Deleted', format: 'boolean' },
+ { key: 'operation_type', label: 'Operation Type' },
+ ],
+ },
+ {
+ key: 'page_context',
+ label: 'Page Context',
+ children: [
+ ...pageContextFields,
+ { key: 'customer_name', label: 'Customer Name' },
+ { key: 'applied_filter', label: 'Applied Filter' },
+ { key: 'sort_column', label: 'Sort Column' },
+ { key: 'sort_order', label: 'Sort Order' },
+ ],
+ },
+ ],
+};
+
+export const zohoInvoiceListContactsOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'message', label: 'Message' },
+ {
+ key: 'contacts',
+ label: 'Contacts',
+ labelKey: 'email',
+ listItems: [
+ { key: 'contact_id', label: 'Contact ID' },
+ { key: 'contact_name', label: 'Contact Name' },
+ { key: 'customer_name', label: 'Customer Name' },
+ { key: 'vendor_name', label: 'Vendor Name' },
+ { key: 'company_name', label: 'Company Name' },
+ { key: 'website', label: 'Website', format: 'url' },
+ { key: 'language_code', label: 'Language Code' },
+ { key: 'contact_type', label: 'Contact Type' },
+ { key: 'status', label: 'Status' },
+ { key: 'customer_sub_type', label: 'Customer Sub Type' },
+ { key: 'source', label: 'Source' },
+ { key: 'is_linked_with_zohocrm', label: 'Is Linked With Zohocrm', format: 'boolean' },
+ { key: 'payment_terms', label: 'Payment Terms', format: 'number' },
+ { key: 'payment_terms_id', label: 'Payment Terms ID' },
+ { key: 'payment_terms_label', label: 'Payment Terms Label' },
+ { key: 'currency_id', label: 'Currency ID' },
+ { key: 'twitter', label: 'Twitter' },
+ { key: 'facebook', label: 'Facebook' },
+ { key: 'currency_code', label: 'Currency Code' },
+ {
+ key: 'outstanding_receivable_amount',
+ label: 'Outstanding Receivable Amount',
+ format: 'currency',
+ },
+ {
+ key: 'outstanding_receivable_amount_bcy',
+ label: 'Outstanding Receivable Amount (Base Currency)',
+ format: 'currency',
+ },
+ {
+ key: 'unused_credits_receivable_amount',
+ label: 'Unused Credits Receivable Amount',
+ format: 'currency',
+ },
+ {
+ key: 'unused_credits_receivable_amount_bcy',
+ label: 'Unused Credits Receivable Amount (Base Currency)',
+ format: 'currency',
+ },
+ { key: 'first_name', label: 'First Name' },
+ { key: 'last_name', label: 'Last Name' },
+ { key: 'email', label: 'Email', format: 'email' },
+ { key: 'phone', label: 'Phone' },
+ { key: 'mobile', label: 'Mobile' },
+ { key: 'portal_status', label: 'Portal Status' },
+ { key: 'created_time', label: 'Created Time', format: 'datetime' },
+ { key: 'last_modified_time', label: 'Last Modified Time', format: 'datetime' },
+ { key: 'custom_fields', label: 'Custom Fields' },
+ { key: 'contactperson_custom_fields', label: 'Contact Person Custom Fields' },
+ { key: 'ach_supported', label: 'ACH Supported', format: 'boolean' },
+ { key: 'has_attachment', label: 'Has Attachment', format: 'boolean' },
+ { key: 'pan_no', label: 'PAN No' },
+ { key: 'registration_details', label: 'Registration Details' },
+ ],
+ },
+ {
+ key: 'page_context',
+ label: 'Page Context',
+ children: [
+ ...pageContextFields,
+ { key: 'applied_filter', label: 'Applied Filter' },
+ { key: 'custom_fields', label: 'Custom Fields' },
+ { key: 'sort_column', label: 'Sort Column' },
+ { key: 'sort_order', label: 'Sort Order' },
+ ],
+ },
+ ],
+};
+
+export const zohoInvoiceListContactRefundsOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'message', label: 'Message' },
+ { key: 'creditnote_refunds', label: 'Credit Note Refunds' },
+ {
+ key: 'page_context',
+ label: 'Page Context',
+ children: [
+ ...pageContextFields,
+ { key: 'sort_column', label: 'Sort Column' },
+ { key: 'sort_order', label: 'Sort Order' },
+ ],
+ },
+ ],
+};
+
+export const zohoInvoiceContactPersonOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'message', label: 'Message' },
+ {
+ key: 'contact_person',
+ label: 'Contact Person',
+ children: [
+ { key: 'contact_id', label: 'Contact ID' },
+ { key: 'contact_person_id', label: 'Contact Person ID' },
+ { key: 'zcrm_contact_id', label: 'Zoho CRM Contact ID' },
+ { key: 'salutation', label: 'Salutation' },
+ { key: 'first_name', label: 'First Name' },
+ { key: 'last_name', label: 'Last Name' },
+ { key: 'email', label: 'Email', format: 'email' },
+ { key: 'phone', label: 'Phone' },
+ { key: 'mobile', label: 'Mobile' },
+ { key: 'mobile_country_code', label: 'Mobile Country Code' },
+ { key: 'department', label: 'Department' },
+ { key: 'designation', label: 'Designation' },
+ { key: 'skype', label: 'Skype' },
+ { key: 'fax', label: 'Fax' },
+ { key: 'is_primary_contact', label: 'Is Primary Contact', format: 'boolean' },
+ { key: 'is_added_in_portal', label: 'Is Added In Portal', format: 'boolean' },
+ { key: 'created_time', label: 'Created Time', format: 'datetime' },
+ { key: 'updated_time', label: 'Updated Time', format: 'datetime' },
+ { key: 'contactperson_custom_fields', label: 'Contact Person Custom Fields' },
+ {
+ key: 'communication_preference',
+ label: 'Communication Preference',
+ children: [{ key: 'is_email_enabled', label: 'Is Email Enabled', format: 'boolean' }],
+ },
+ ],
+ },
+ ],
+};
+
+export const zohoInvoiceListContactPersonsOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'message', label: 'Message' },
+ {
+ key: 'contact_persons',
+ label: 'Contact Persons',
+ labelKey: 'email',
+ listItems: contactPersonsFields,
+ },
+ {
+ key: 'page_context',
+ label: 'Page Context',
+ children: [
+ ...pageContextFields,
+ { key: 'customer_name', label: 'Customer Name' },
+ { key: 'sort_column', label: 'Sort Column' },
+ { key: 'sort_order', label: 'Sort Order' },
+ ],
+ },
+ ],
+};
+
+export const zohoInvoiceGetCustomerPaymentOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'message', label: 'Message' },
+ {
+ key: 'payment',
+ label: 'Payment',
+ children: [
+ ...paymentFields,
+ { key: 'payment_refunds', label: 'Payment Refunds', listItems: paymentRefundsFields },
+ {
+ key: 'custom_fields',
+ label: 'Custom Fields',
+ labelKey: 'label',
+ listItems: [
+ ...customFieldsFields,
+ { key: 'field_id', label: 'Field ID' },
+ { key: 'customfield_id', label: 'Customfield ID' },
+ { key: 'is_active', label: 'Is Active', format: 'boolean' },
+ { key: 'is_custom_field', label: 'Is Custom Field', format: 'boolean' },
+ { key: 'edit_on_portal', label: 'Edit On Portal', format: 'boolean' },
+ { key: 'edit_on_store', label: 'Edit On Store', format: 'boolean' },
+ { key: 'api_name', label: 'API Name' },
+ { key: 'search_entity', label: 'Search Entity' },
+ { key: 'data_type', label: 'Data Type' },
+ { key: 'placeholder', label: 'Placeholder' },
+ { key: 'is_dependent_field', label: 'Is Dependent Field', format: 'boolean' },
+ ],
+ },
+ ],
+ },
+ ],
+};
+
+export const zohoInvoicePaymentOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'message', label: 'Message' },
+ {
+ key: 'payment',
+ label: 'Payment',
+ children: [
+ ...paymentFields,
+ { key: 'payment_refunds', label: 'Payment Refunds' },
+ { key: 'custom_fields', label: 'Custom Fields' },
+ ],
+ },
+ ],
+};
+
+export const zohoInvoiceListCustomerPaymentsOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'message', label: 'Message' },
+ {
+ key: 'customerpayments',
+ label: 'Customer Payments',
+ listItems: [
+ { key: 'payment_id', label: 'Payment ID' },
+ { key: 'payment_number', label: 'Payment Number' },
+ { key: 'invoice_numbers', label: 'Invoice Numbers' },
+ { key: 'date', label: 'Date', format: 'date' },
+ { key: 'payment_mode', label: 'Payment Mode' },
+ { key: 'amount', label: 'Amount', format: 'currency' },
+ { key: 'bcy_amount', label: 'Amount (Base Currency)', format: 'currency' },
+ { key: 'unused_amount', label: 'Unused Amount', format: 'currency' },
+ { key: 'bcy_unused_amount', label: 'Unused Amount (Base Currency)', format: 'currency' },
+ { key: 'description', label: 'Description' },
+ { key: 'product_description', label: 'Product Description' },
+ { key: 'reference_number', label: 'Reference Number' },
+ { key: 'is_paid_via_check', label: 'Is Paid Via Check', format: 'boolean' },
+ { key: 'check_details', label: 'Check Details', children: checkDetailsFields },
+ { key: 'customer_id', label: 'Customer ID' },
+ { key: 'customer_name', label: 'Customer Name' },
+ { key: 'created_time', label: 'Created Time', format: 'datetime' },
+ { key: 'last_modified_time', label: 'Last Modified Time', format: 'datetime' },
+ { key: 'last_four_digits', label: 'Last Four Digits' },
+ { key: 'gateway_transaction_id', label: 'Gateway Transaction ID' },
+ { key: 'payment_gateway', label: 'Payment Gateway' },
+ {
+ key: 'bcy_refunded_amount',
+ label: 'Refunded Amount (Base Currency)',
+ format: 'currency',
+ },
+ { key: 'applied_invoices', label: 'Applied Invoices' },
+ { key: 'has_attachment', label: 'Has Attachment', format: 'boolean' },
+ { key: 'documents', label: 'Documents' },
+ { key: 'custom_fields_list', label: 'Custom Fields List' },
+ { key: 'tax_amount_withheld', label: 'Tax Amount Withheld', format: 'currency' },
+ { key: 'payment_type', label: 'Payment Type' },
+ { key: 'payment_status', label: 'Payment Status' },
+ { key: 'settlement_status', label: 'Settlement Status' },
+ { key: 'registration_details', label: 'Registration Details' },
+ { key: 'sales_channel', label: 'Sales Channel' },
+ ],
+ },
+ {
+ key: 'page_context',
+ label: 'Page Context',
+ children: [
+ ...pageContextFields,
+ { key: 'applied_filter', label: 'Applied Filter' },
+ { key: 'custom_fields', label: 'Custom Fields' },
+ { key: 'sort_column', label: 'Sort Column' },
+ { key: 'sort_order', label: 'Sort Order' },
+ ],
+ },
+ ],
+};
+
+export const zohoInvoicePaymentRefundOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'message', label: 'Message' },
+ {
+ key: 'payment_refund',
+ label: 'Payment Refund',
+ children: [
+ { key: 'payment_refund_id', label: 'Payment Refund ID' },
+ { key: 'payment_id', label: 'Payment ID' },
+ { key: 'date', label: 'Date', format: 'date' },
+ { key: 'created_time', label: 'Created Time', format: 'datetime' },
+ { key: 'refund_mode', label: 'Refund Mode' },
+ { key: 'reference_number', label: 'Reference Number' },
+ { key: 'amount', label: 'Amount', format: 'currency' },
+ { key: 'exchange_rate', label: 'Exchange Rate', format: 'number' },
+ { key: 'description', label: 'Description' },
+ { key: 'product_description', label: 'Product Description' },
+ { key: 'custom_fields', label: 'Custom Fields' },
+ { key: 'rounding_mode', label: 'Rounding Mode' },
+ { key: 'price_precision', label: 'Price Precision', format: 'number' },
+ ],
+ },
+ ],
+};
+
+export const zohoInvoiceListCustomerPaymentRefundsOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'message', label: 'Message' },
+ {
+ key: 'payment_refunds',
+ label: 'Payment Refunds',
+ listItems: [
+ ...paymentRefundsFields,
+ { key: 'payment_id', label: 'Payment ID' },
+ { key: 'payment_number', label: 'Payment Number' },
+ { key: 'customer_name', label: 'Customer Name' },
+ ],
+ },
+ {
+ key: 'page_context',
+ label: 'Page Context',
+ children: [
+ ...pageContextFields,
+ { key: 'sort_column', label: 'Sort Column' },
+ { key: 'sort_order', label: 'Sort Order' },
+ ],
+ },
+ ],
+};
+
+export const zohoInvoiceGetContactStatementEmailContentOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'message', label: 'Message' },
+ {
+ key: 'data',
+ label: 'Data',
+ children: [
+ { key: 'to_followers', label: 'To Followers' },
+ { key: 'contact_name', label: 'Contact Name' },
+ { key: 'file_name_without_extension', label: 'File Name Without Extension' },
+ { key: 'from_email', label: 'From Email', format: 'email' },
+ { key: 'bcc_mails', label: 'BCC Mails' },
+ { key: 'subject', label: 'Subject' },
+ { key: 'file_name', label: 'File Name' },
+ { key: 'filter_by', label: 'Filter By' },
+ { key: 'contact_id', label: 'Contact ID' },
+ { key: 'bcc_mails_str', label: 'BCC Mails (Text)' },
+ { key: 'body', label: 'Body' },
+ { key: 'entity_id', label: 'Entity ID' },
+ { key: 'emailtemplate_documents', label: 'Email Template Documents' },
+ { key: 'to_mails_str', label: 'To Mails (Text)', format: 'email' },
+ { key: 'cc_mails_list', label: 'CC Mails List' },
+ { key: 'error_list', label: 'Error List' },
+ {
+ key: 'translated_languages',
+ label: 'Translated Languages',
+ listItems: [
+ { key: 'language_code', label: 'Language Code' },
+ { key: 'is_selected', label: 'Is Selected', format: 'boolean' },
+ ],
+ },
+ { key: 'cc_mails_str', label: 'CC Mails (Text)' },
+ {
+ key: 'from_emails',
+ label: 'From Emails',
+ labelKey: 'email',
+ listItems: fromEmailsFields,
+ },
+ {
+ key: 'to_contacts',
+ label: 'To Contacts',
+ labelKey: 'email',
+ listItems: toContactsFields,
+ },
+ {
+ key: 'emailtemplates',
+ label: 'Email Templates',
+ labelKey: 'name',
+ listItems: emailTemplatesFields,
+ },
+ { key: 'from_address', label: 'From Address' },
+ ],
+ },
+ ],
+};
+
+export const zohoInvoiceApplyCreditsToInvoiceOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'message', label: 'Message' },
+ {
+ key: 'use_credits',
+ label: 'Use Credits',
+ children: [
+ {
+ key: 'invoice_payments',
+ label: 'Invoice Payments',
+ listItems: [
+ { key: 'invoice_payment_id', label: 'Invoice Payment ID' },
+ { key: 'payment_id', label: 'Payment ID' },
+ { key: 'invoice_id', label: 'Invoice ID' },
+ { key: 'amount_used', label: 'Amount Used', format: 'currency' },
+ ],
+ },
+ {
+ key: 'apply_creditnotes',
+ label: 'Apply Credit Notes',
+ listItems: [
+ { key: 'creditnotes_invoice_id', label: 'Credit Notes Invoice ID' },
+ { key: 'creditnote_id', label: 'Credit Note ID' },
+ { key: 'invoice_id', label: 'Invoice ID' },
+ { key: 'amount_applied', label: 'Amount Applied', format: 'currency' },
+ { key: 'date', label: 'Date', format: 'date' },
+ ],
+ },
+ { key: 'apply_journals', label: 'Apply Journals' },
+ ],
+ },
+ ],
+};
+
+export const zohoInvoiceAddInvoiceAttachmentOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'message', label: 'Message' },
+ {
+ key: 'documents',
+ label: 'Documents',
+ listItems: [
+ { key: 'document_id', label: 'Document ID' },
+ { key: 'file_name', label: 'File Name' },
+ { key: 'file_type', label: 'File Type' },
+ { key: 'file_size', label: 'File Size', format: 'number' },
+ ],
+ },
+ ],
+};
+
+export const zohoInvoiceGetInvoiceAttachmentOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'file', label: 'File', format: 'url' },
+ { key: 'fileName', label: 'File Name' },
+ ],
+};
+
+export const zohoInvoiceBillingAddressOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'message', label: 'Message' },
+ {
+ key: 'billing_address',
+ label: 'Billing Address',
+ children: [
+ ...billingAddressFields,
+ { key: 'zip', label: 'Zip' },
+ { key: 'is_one_off_address', label: 'Is One Off Address', format: 'boolean' },
+ { key: 'is_update_customer', label: 'Is Update Customer' },
+ ],
+ },
+ ],
+};
+
+export const zohoInvoiceCommentOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'message', label: 'Message' },
+ {
+ key: 'comment',
+ label: 'Comment',
+ children: [
+ ...commentFields,
+ { key: 'invoice_id', label: 'Invoice ID' },
+ { key: 'date_description', label: 'Date Description' },
+ { key: 'time', label: 'Time' },
+ ],
+ },
+ ],
+};
+
+export const zohoInvoiceListInvoiceCommentsOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'message', label: 'Message' },
+ {
+ key: 'comments',
+ label: 'Comments',
+ listItems: [
+ ...commentsFields,
+ { key: 'invoice_id', label: 'Invoice ID' },
+ { key: 'comment_type', label: 'Comment Type' },
+ { key: 'operation_type', label: 'Operation Type' },
+ { key: 'transaction_id', label: 'Transaction ID' },
+ { key: 'transaction_type', label: 'Transaction Type' },
+ ],
+ },
+ ],
+};
+
+export const zohoInvoiceListInvoiceCreditsAppliedOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'message', label: 'Message' },
+ {
+ key: 'credits',
+ label: 'Credits',
+ listItems: [
+ { key: 'creditnote_id', label: 'Credit Note ID' },
+ { key: 'creditnotes_invoice_id', label: 'Credit Notes Invoice ID' },
+ { key: 'creditnotes_number', label: 'Credit Notes Number' },
+ { key: 'credited_date', label: 'Credited Date', format: 'date' },
+ { key: 'amount_applied', label: 'Amount Applied', format: 'currency' },
+ ],
+ },
+ ],
+};
+
+export const zohoInvoiceGetInvoiceEmailContentOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'message', label: 'Message' },
+ {
+ key: 'data',
+ label: 'Data',
+ children: [
+ { key: 'to_followers', label: 'To Followers' },
+ { key: 'file_name_without_extension', label: 'File Name Without Extension' },
+ { key: 'from_email', label: 'From Email', format: 'email' },
+ { key: 'documents', label: 'Documents' },
+ { key: 'bcc_mails', label: 'BCC Mails' },
+ { key: 'subject', label: 'Subject' },
+ { key: 'attachment_name', label: 'Attachment Name' },
+ { key: 'attach_pdf', label: 'Attach PDF', format: 'boolean' },
+ { key: 'to_salesperson', label: 'To Salesperson' },
+ { key: 'body', label: 'Body' },
+ { key: 'to_mails_str', label: 'To Mails (Text)' },
+ {
+ key: 'translated_languages',
+ label: 'Translated Languages',
+ listItems: [
+ { key: 'language_code', label: 'Language Code' },
+ { key: 'is_selected', label: 'Is Selected', format: 'boolean' },
+ ],
+ },
+ { key: 'gateways_configured', label: 'Gateways Configured', format: 'boolean' },
+ {
+ key: 'from_emails',
+ label: 'From Emails',
+ labelKey: 'email',
+ listItems: fromEmailsFields,
+ },
+ {
+ key: 'to_contacts',
+ label: 'To Contacts',
+ labelKey: 'email',
+ listItems: toContactsFields,
+ },
+ {
+ key: 'emailtemplates',
+ label: 'Email Templates',
+ labelKey: 'name',
+ listItems: emailTemplatesFields,
+ },
+ { key: 'from_address', label: 'From Address' },
+ { key: 'customer_sub_type', label: 'Customer Sub Type' },
+ { key: 'file_name', label: 'File Name' },
+ { key: 'bcc_mails_str', label: 'BCC Mails (Text)' },
+ { key: 'entity_id', label: 'Entity ID' },
+ { key: 'emailtemplate_documents', label: 'Email Template Documents' },
+ { key: 'entity_type', label: 'Entity Type' },
+ {
+ key: 'cc_mails_list',
+ label: 'CC Mails List',
+ labelKey: 'email',
+ listItems: [
+ { key: 'user_name', label: 'User Name' },
+ { key: 'email', label: 'Email', format: 'email' },
+ ],
+ },
+ { key: 'error_list', label: 'Error List' },
+ { key: 'cc_mails_str', label: 'CC Mails (Text)', format: 'email' },
+ { key: 'gateways_associated', label: 'Gateways Associated', format: 'boolean' },
+ { key: 'customer_name', label: 'Customer Name' },
+ { key: 'customer_id', label: 'Customer ID' },
+ { key: 'status', label: 'Status' },
+ ],
+ },
+ ],
+};
+
+export const zohoInvoiceEmailInvoiceOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'message', label: 'Message' },
+ { key: 'is_first_email', label: 'Is First Email', format: 'boolean' },
+ ],
+};
+
+export const zohoInvoiceInvoiceOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'message', label: 'Message' },
+ {
+ key: 'invoice',
+ label: 'Invoice',
+ children: [
+ { key: 'invoice_id', label: 'Invoice ID' },
+ { key: 'channel_invoice_id', label: 'Channel Invoice ID' },
+ { key: 'account_identifier', label: 'Account Identifier' },
+ { key: 'invoice_number', label: 'Invoice Number' },
+ { key: 'date', label: 'Date', format: 'date' },
+ { key: 'due_date', label: 'Due Date', format: 'date' },
+ { key: 'issued_date', label: 'Issued Date', format: 'date' },
+ { key: 'customer_id', label: 'Customer ID' },
+ { key: 'customer_name', label: 'Customer Name' },
+ { key: 'customer_custom_fields', label: 'Customer Custom Fields' },
+ { key: 'email', label: 'Email', format: 'email' },
+ { key: 'currency_id', label: 'Currency ID' },
+ {
+ key: 'currency_formatter',
+ label: 'Currency Formatter',
+ children: [
+ { key: 'decimal_separator', label: 'Decimal Separator' },
+ { key: 'number_separator', label: 'Number Separator' },
+ { key: 'secondary_grouping_size', label: 'Secondary Grouping Size', format: 'number' },
+ ],
+ },
+ { key: 'invoice_source', label: 'Invoice Source' },
+ { key: 'currency_code', label: 'Currency Code' },
+ { key: 'currency_symbol', label: 'Currency Symbol' },
+ { key: 'status', label: 'Status' },
+ {
+ key: 'unprocessed_payment_amount',
+ label: 'Unprocessed Payment Amount',
+ format: 'currency',
+ },
+ { key: 'custom_fields', label: 'Custom Fields' },
+ { key: 'recurring_invoice_id', label: 'Recurring Invoice ID' },
+ { key: 'is_last_child_invoice', label: 'Is Last Child Invoice', format: 'boolean' },
+ { key: 'payment_terms', label: 'Payment Terms', format: 'number' },
+ { key: 'payment_terms_label', label: 'Payment Terms Label' },
+ { key: 'payment_terms_id', label: 'Payment Terms ID' },
+ { key: 'invoice_installments', label: 'Invoice Installments' },
+ { key: 'payment_reminder_enabled', label: 'Payment Reminder Enabled', format: 'boolean' },
+ { key: 'payment_made', label: 'Payment Made', format: 'currency' },
+ { key: 'zcrm_potential_id', label: 'Zoho CRM Potential ID' },
+ { key: 'zcrm_potential_name', label: 'Zoho CRM Potential Name' },
+ { key: 'reference_number', label: 'Reference Number' },
+ { key: 'discount_code', label: 'Discount Code' },
+ { key: 'is_kit_partial_return', label: 'Is Kit Partial Return', format: 'boolean' },
+ {
+ key: 'line_items',
+ label: 'Line Items',
+ labelKey: 'name',
+ listItems: [
+ ...lineItemsFields,
+ { key: 'item_id', label: 'Item ID' },
+ { key: 'name', label: 'Name' },
+ { key: 'internal_name', label: 'Internal Name' },
+ { key: 'discount_account_id', label: 'Discount Account ID' },
+ { key: 'discount_account_name', label: 'Discount Account Name' },
+ { key: 'unit', label: 'Unit' },
+ { key: 'quantity', label: 'Quantity', format: 'number' },
+ { key: 'discount_amount', label: 'Discount Amount', format: 'number' },
+ { key: 'discount', label: 'Discount', format: 'number' },
+ { key: 'discounts', label: 'Discounts' },
+ { key: 'bcy_rate', label: 'Rate (Base Currency)', format: 'currency' },
+ { key: 'rate', label: 'Rate', format: 'currency' },
+ { key: 'header_id', label: 'Header ID' },
+ { key: 'header_name', label: 'Header Name' },
+ { key: 'pricebook_id', label: 'Price List ID' },
+ { key: 'item_custom_fields', label: 'Item Custom Fields' },
+ { key: 'pricing_scheme', label: 'Pricing Scheme' },
+ { key: 'documents', label: 'Documents' },
+ { key: 'tds_tax_id', label: 'TDS Tax ID' },
+ { key: 'tds_tax_name', label: 'TDS Tax Name' },
+ { key: 'tds_tax_percentage', label: 'TDS Tax Percentage' },
+ { key: 'tds_tax_amount', label: 'TDS Tax Amount', format: 'currency' },
+ { key: 'line_item_tds', label: 'Line Item TDS' },
+ { key: 'stock_on_hand', label: 'Stock On Hand' },
+ { key: 'available_stock', label: 'Available Stock' },
+ { key: 'committed_stock', label: 'Committed Stock' },
+ { key: 'available_for_sale_stock', label: 'Available For Sale Stock' },
+ { key: 'project_id', label: 'Project ID' },
+ { key: 'time_entry_ids', label: 'Time Entry IDs' },
+ { key: 'expense_id', label: 'Expense ID' },
+ { key: 'item_type', label: 'Item Type' },
+ { key: 'expense_receipt_name', label: 'Expense Receipt Name' },
+ { key: 'sales_rate', label: 'Sales Rate', format: 'currency' },
+ { key: 'purchase_rate', label: 'Purchase Rate' },
+ { key: 'salesorder_item_id', label: 'Sales Order Item ID' },
+ { key: 'cost_amount', label: 'Cost Amount', format: 'currency' },
+ { key: 'markup_percent', label: 'Markup Percent', format: 'number' },
+ { key: 'item_code', label: 'Item Code' },
+ { key: 'mapped_items', label: 'Mapped Items' },
+ { key: 'is_modifier_item', label: 'Is Modifier Item', format: 'boolean' },
+ { key: 'line_item_category', label: 'Line Item Category' },
+ ],
+ },
+ { key: 'total_retention_amount', label: 'Total Retention Amount', format: 'currency' },
+ { key: 'retention_items', label: 'Retention Items' },
+ { key: 'retention_override_preference', label: 'Retention Override Preference' },
+ { key: 'credits_associated', label: 'Credits Associated' },
+ { key: 'exchange_rate', label: 'Exchange Rate', format: 'number' },
+ { key: 'is_autobill_enabled', label: 'Is Autobill Enabled', format: 'boolean' },
+ {
+ key: 'inprocess_transaction_present',
+ label: 'Inprocess Transaction Present',
+ format: 'boolean',
+ },
+ { key: 'allow_partial_payments', label: 'Allow Partial Payments', format: 'boolean' },
+ { key: 'price_precision', label: 'Price Precision', format: 'number' },
+ { key: 'sub_total', label: 'Sub Total', format: 'currency' },
+ { key: 'tax_total', label: 'Tax Total', format: 'currency' },
+ { key: 'total_taxable_amount', label: 'Total Taxable Amount', format: 'currency' },
+ { key: 'discount_total', label: 'Discount Total', format: 'number' },
+ { key: 'discount_percent', label: 'Discount Percent', format: 'number' },
+ { key: 'discount', label: 'Discount', format: 'number' },
+ {
+ key: 'discount_applied_on_amount',
+ label: 'Discount Applied On Amount',
+ format: 'number',
+ },
+ { key: 'discount_type', label: 'Discount Type' },
+ { key: 'tds_override_preference', label: 'TDS Override Preference' },
+ { key: 'is_discount_before_tax', label: 'Is Discount Before Tax', format: 'boolean' },
+ { key: 'adjustment', label: 'Adjustment', format: 'currency' },
+ { key: 'adjustment_description', label: 'Adjustment Description' },
+ { key: 'shipping_charge_tax_id', label: 'Shipping Charge Tax ID' },
+ { key: 'shipping_charge_tax_name', label: 'Shipping Charge Tax Name' },
+ { key: 'shipping_charge_tax_type', label: 'Shipping Charge Tax Type' },
+ { key: 'shipping_charge_tax_percentage', label: 'Shipping Charge Tax Percentage' },
+ { key: 'shipping_charge_tax_exemption_id', label: 'Shipping Charge Tax Exemption ID' },
+ { key: 'shipping_charge_tax_exemption_code', label: 'Shipping Charge Tax Exemption Code' },
+ { key: 'shipping_charge_tax', label: 'Shipping Charge Tax' },
+ { key: 'bcy_shipping_charge_tax', label: 'Shipping Charge Tax (Base Currency)' },
+ {
+ key: 'shipping_charge_exclusive_of_tax',
+ label: 'Shipping Charge Exclusive Of Tax',
+ format: 'currency',
+ },
+ {
+ key: 'shipping_charge_inclusive_of_tax',
+ label: 'Shipping Charge Inclusive Of Tax',
+ format: 'currency',
+ },
+ { key: 'shipping_charge_account_id', label: 'Shipping Charge Account ID' },
+ { key: 'shipping_charge_account_name', label: 'Shipping Charge Account Name' },
+ { key: 'shipping_charge', label: 'Shipping Charge', format: 'currency' },
+ {
+ key: 'bcy_shipping_charge',
+ label: 'Shipping Charge (Base Currency)',
+ format: 'currency',
+ },
+ { key: 'bcy_adjustment', label: 'Adjustment (Base Currency)', format: 'currency' },
+ { key: 'bcy_sub_total', label: 'Sub Total (Base Currency)', format: 'currency' },
+ { key: 'bcy_discount_total', label: 'Discount Total (Base Currency)', format: 'number' },
+ { key: 'bcy_tax_total', label: 'Tax Total (Base Currency)', format: 'currency' },
+ { key: 'bcy_total', label: 'Total (Base Currency)', format: 'currency' },
+ { key: 'total', label: 'Total', format: 'currency' },
+ { key: 'balance', label: 'Balance', format: 'currency' },
+ { key: 'write_off_amount', label: 'Write Off Amount', format: 'currency' },
+ { key: 'roundoff_value', label: 'Roundoff Value', format: 'number' },
+ { key: 'transaction_rounding_type', label: 'Transaction Rounding Type' },
+ { key: 'rounding_mode', label: 'Rounding Mode' },
+ { key: 'bcy_rounding_mode', label: 'Rounding Mode (Base Currency)' },
+ { key: 'is_inclusive_tax', label: 'Is Inclusive Tax', format: 'boolean' },
+ {
+ key: 'sub_total_inclusive_of_tax',
+ label: 'Sub Total Inclusive Of Tax',
+ format: 'currency',
+ },
+ { key: 'contact_category', label: 'Contact Category' },
+ { key: 'tax_rounding', label: 'Tax Rounding' },
+ { key: 'taxes', label: 'Taxes' },
+ { key: 'shipping_charge_taxes', label: 'Shipping Charge Taxes' },
+ { key: 'exceptions', label: 'Exceptions' },
+ { key: 'tds_calculation_type', label: 'TDS Calculation Type' },
+ { key: 'payment_expected_date', label: 'Payment Expected Date', format: 'date' },
+ { key: 'payment_discount', label: 'Payment Discount', format: 'number' },
+ {
+ key: 'stop_reminder_until_payment_expected_date',
+ label: 'Stop Reminder Until Payment Expected Date',
+ format: 'boolean',
+ },
+ { key: 'last_payment_date', label: 'Last Payment Date', format: 'date' },
+ { key: 'ach_supported', label: 'ACH Supported', format: 'boolean' },
+ { key: 'ach_payment_initiated', label: 'ACH Payment Initiated', format: 'boolean' },
+ {
+ key: 'payment_options',
+ label: 'Payment Options',
+ children: [{ key: 'payment_gateways', label: 'Payment Gateways' }],
+ },
+ {
+ key: 'reader_offline_payment_initiated',
+ label: 'Reader Offline Payment Initiated',
+ format: 'boolean',
+ },
+ { key: 'contact_persons', label: 'Contact Persons' },
+ { key: 'contact_persons_associated', label: 'Contact Persons Associated' },
+ { key: 'attachment_name', label: 'Attachment Name' },
+ { key: 'documents', label: 'Documents' },
+ { key: 'computation_type', label: 'Computation Type' },
+ { key: 'tds_summary', label: 'TDS Summary' },
+ {
+ key: 'late_fee',
+ label: 'Late Fee',
+ children: [...lateFeeFields, { key: 'amount', label: 'Amount', format: 'currency' }],
+ },
+ { key: 'debit_notes', label: 'Debit Notes' },
+ { key: 'in_process_payments', label: 'In Process Payments' },
+ { key: 'deliverychallans', label: 'Delivery Challans' },
+ { key: 'ewaybills', label: 'E-Way Bills' },
+ { key: 'dispatch_from_address', label: 'Dispatch From Address' },
+ { key: 'is_eway_bill_required', label: 'Is Eway Bill Required', format: 'boolean' },
+ { key: 'merchant_id', label: 'Merchant ID' },
+ { key: 'merchant_name', label: 'Merchant Name' },
+ { key: 'ecomm_operator_id', label: 'Ecomm Operator ID' },
+ { key: 'ecomm_operator_name', label: 'Ecomm Operator Name' },
+ { key: 'salesorder_id', label: 'Sales Order ID' },
+ { key: 'salesorder_number', label: 'Sales Order Number' },
+ { key: 'salesorders', label: 'Sales Orders' },
+ { key: 'packages', label: 'Packages' },
+ { key: 'shipping_bills', label: 'Shipping Bills' },
+ {
+ key: 'contact_persons_details',
+ label: 'Contact Persons Details',
+ labelKey: 'email',
+ listItems: [
+ ...contactPersonsDetailsFields,
+ {
+ key: 'communication_preference',
+ label: 'Communication Preference',
+ children: [{ key: 'is_email_enabled', label: 'Is Email Enabled', format: 'boolean' }],
+ },
+ ],
+ },
+ {
+ key: 'contact',
+ label: 'Contact',
+ children: [
+ { key: 'customer_balance', label: 'Customer Balance', format: 'currency' },
+ { key: 'credit_limit', label: 'Credit Limit', format: 'currency' },
+ {
+ key: 'unused_customer_credits',
+ label: 'Unused Customer Credits',
+ format: 'currency',
+ },
+ {
+ key: 'is_credit_limit_migration_completed',
+ label: 'Is Credit Limit Migration Completed',
+ format: 'boolean',
+ },
+ ],
+ },
+ { key: 'salesperson_id', label: 'Salesperson ID' },
+ { key: 'salesperson_name', label: 'Salesperson Name' },
+ { key: 'is_emailed', label: 'Is Emailed', format: 'boolean' },
+ { key: 'reminders_sent', label: 'Reminders Sent', format: 'number' },
+ { key: 'last_reminder_sent_date', label: 'Last Reminder Sent Date', format: 'date' },
+ { key: 'is_viewed_by_client', label: 'Is Viewed By Client', format: 'boolean' },
+ { key: 'client_viewed_time', label: 'Client Viewed Time', format: 'datetime' },
+ { key: 'submitter_id', label: 'Submitter ID' },
+ { key: 'approver_id', label: 'Approver ID' },
+ { key: 'submitted_date', label: 'Submitted Date', format: 'date' },
+ { key: 'submitted_by', label: 'Submitted By' },
+ { key: 'submitted_by_name', label: 'Submitted By Name' },
+ { key: 'submitted_by_email', label: 'Submitted By Email' },
+ { key: 'template_id', label: 'Template ID' },
+ { key: 'template_name', label: 'Template Name' },
+ { key: 'template_type', label: 'Template Type' },
+ { key: 'notes', label: 'Notes' },
+ { key: 'terms', label: 'Terms' },
+ {
+ key: 'billing_address',
+ label: 'Billing Address',
+ children: [
+ ...billingAddressFields,
+ { key: 'street', label: 'Street' },
+ { key: 'zip', label: 'Zip' },
+ { key: 'country_code', label: 'Country Code' },
+ ],
+ },
+ {
+ key: 'shipping_address',
+ label: 'Shipping Address',
+ children: [
+ ...shippingAddressFields,
+ { key: 'street', label: 'Street' },
+ { key: 'zip', label: 'Zip' },
+ { key: 'country_code', label: 'Country Code' },
+ ],
+ },
+ { key: 'invoice_url', label: 'Invoice URL', format: 'url' },
+ { key: 'subject_content', label: 'Subject Content' },
+ { key: 'can_send_in_mail', label: 'Can Send In Mail', format: 'boolean' },
+ { key: 'created_time', label: 'Created Time', format: 'datetime' },
+ { key: 'last_modified_time', label: 'Last Modified Time', format: 'datetime' },
+ { key: 'created_date', label: 'Created Date', format: 'date' },
+ { key: 'created_by_id', label: 'Created By ID' },
+ { key: 'created_by_name', label: 'Created By Name' },
+ { key: 'last_modified_by_id', label: 'Last Modified By ID' },
+ { key: 'is_backorder', label: 'Is Backorder' },
+ { key: 'sales_channel', label: 'Sales Channel' },
+ { key: 'type', label: 'Type' },
+ { key: 'current_sub_status_id', label: 'Current Sub Status ID' },
+ { key: 'current_sub_status', label: 'Current Sub Status' },
+ { key: 'sub_statuses', label: 'Sub Statuses' },
+ { key: 'reason_for_debit_note', label: 'Reason For Debit Note' },
+ { key: 'estimate_id', label: 'Estimate ID' },
+ {
+ key: 'is_client_review_settings_enabled',
+ label: 'Is Client Review Settings Enabled',
+ format: 'boolean',
+ },
+ { key: 'unused_retainer_payments', label: 'Unused Retainer Payments', format: 'currency' },
+ { key: 'credits_applied', label: 'Credits Applied', format: 'currency' },
+ { key: 'tax_amount_withheld', label: 'Tax Amount Withheld', format: 'currency' },
+ { key: 'schedule_time', label: 'Schedule Time' },
+ { key: 'no_of_copies', label: 'No Of Copies', format: 'number' },
+ {
+ key: 'customer_default_billing_address',
+ label: 'Customer Default Billing Address',
+ children: customerDefaultBillingAddressFields,
+ },
+ {
+ key: 'reference_invoice',
+ label: 'Reference Invoice',
+ children: [{ key: 'reference_invoice_id', label: 'Reference Invoice ID' }],
+ },
+ {
+ key: 'includes_package_tracking_info',
+ label: 'Includes Package Tracking Info',
+ format: 'boolean',
+ },
+ { key: 'approvers_list', label: 'Approvers List' },
+ {
+ key: 'qr_code',
+ label: 'QR Code',
+ children: [
+ { key: 'qr_source', label: 'QR Source' },
+ { key: 'is_qr_enabled', label: 'Is QR Enabled', format: 'boolean' },
+ { key: 'qr_value', label: 'QR Value' },
+ { key: 'qr_description', label: 'QR Description' },
+ ],
+ },
+ { key: 'exchange_invoices', label: 'Exchange Invoices' },
+ { key: 'registration_details', label: 'Registration Details' },
+ ],
+ },
+ ],
+};
+
+export const zohoInvoiceListInvoicesOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'message', label: 'Message' },
+ {
+ key: 'invoices',
+ label: 'Invoices',
+ labelKey: 'email',
+ listItems: [
+ { key: 'ach_payment_initiated', label: 'ACH Payment Initiated', format: 'boolean' },
+ { key: 'invoice_id', label: 'Invoice ID' },
+ { key: 'zcrm_potential_id', label: 'Zoho CRM Potential ID' },
+ { key: 'customer_id', label: 'Customer ID' },
+ { key: 'zcrm_potential_name', label: 'Zoho CRM Potential Name' },
+ { key: 'customer_name', label: 'Customer Name' },
+ { key: 'company_name', label: 'Company Name' },
+ { key: 'registration_details', label: 'Registration Details' },
+ { key: 'status', label: 'Status' },
+ { key: 'invoice_number', label: 'Invoice Number' },
+ { key: 'reference_number', label: 'Reference Number' },
+ { key: 'date', label: 'Date', format: 'date' },
+ { key: 'due_date', label: 'Due Date', format: 'date' },
+ { key: 'issued_date', label: 'Issued Date', format: 'date' },
+ { key: 'due_days', label: 'Due Days' },
+ { key: 'email', label: 'Email', format: 'email' },
+ { key: 'type', label: 'Type' },
+ { key: 'project_name', label: 'Project Name' },
+ {
+ key: 'billing_address',
+ label: 'Billing Address',
+ children: [...billingAddressFields, { key: 'zipcode', label: 'Zipcode' }],
+ },
+ {
+ key: 'shipping_address',
+ label: 'Shipping Address',
+ children: [...shippingAddressFields, { key: 'zipcode', label: 'Zipcode' }],
+ },
+ { key: 'country', label: 'Country' },
+ { key: 'phone', label: 'Phone' },
+ { key: 'created_by', label: 'Created By' },
+ { key: 'total', label: 'Total', format: 'currency' },
+ { key: 'balance', label: 'Balance', format: 'currency' },
+ { key: 'payment_expected_date', label: 'Payment Expected Date', format: 'date' },
+ { key: 'custom_fields', label: 'Custom Fields' },
+ { key: 'salesperson_name', label: 'Salesperson Name' },
+ { key: 'shipping_charge', label: 'Shipping Charge', format: 'currency' },
+ { key: 'adjustment', label: 'Adjustment', format: 'currency' },
+ { key: 'created_time', label: 'Created Time', format: 'datetime' },
+ { key: 'last_modified_time', label: 'Last Modified Time', format: 'datetime' },
+ { key: 'updated_time', label: 'Updated Time', format: 'datetime' },
+ { key: 'is_viewed_by_client', label: 'Is Viewed By Client', format: 'boolean' },
+ { key: 'has_attachment', label: 'Has Attachment', format: 'boolean' },
+ { key: 'client_viewed_time', label: 'Client Viewed Time', format: 'datetime' },
+ { key: 'is_emailed', label: 'Is Emailed', format: 'boolean' },
+ { key: 'current_sub_status_id', label: 'Current Sub Status ID' },
+ { key: 'current_sub_status', label: 'Current Sub Status' },
+ { key: 'currency_id', label: 'Currency ID' },
+ { key: 'schedule_time', label: 'Schedule Time' },
+ { key: 'currency_code', label: 'Currency Code' },
+ { key: 'currency_symbol', label: 'Currency Symbol' },
+ { key: 'template_type', label: 'Template Type' },
+ { key: 'no_of_copies', label: 'No Of Copies', format: 'number' },
+ { key: 'invoice_source', label: 'Invoice Source' },
+ { key: 'sales_channel', label: 'Sales Channel' },
+ { key: 'transaction_type', label: 'Transaction Type' },
+ { key: 'reminders_sent', label: 'Reminders Sent', format: 'number' },
+ { key: 'last_reminder_sent_date', label: 'Last Reminder Sent Date', format: 'date' },
+ { key: 'last_payment_date', label: 'Last Payment Date', format: 'date' },
+ { key: 'template_id', label: 'Template ID' },
+ { key: 'documents', label: 'Documents' },
+ { key: 'salesperson_id', label: 'Salesperson ID' },
+ { key: 'write_off_amount', label: 'Write Off Amount', format: 'currency' },
+ { key: 'exchange_rate', label: 'Exchange Rate', format: 'number' },
+ {
+ key: 'unprocessed_payment_amount',
+ label: 'Unprocessed Payment Amount',
+ format: 'currency',
+ },
+ { key: 'invoice_url', label: 'Invoice URL', format: 'url' },
+ ],
+ },
+ {
+ key: 'page_context',
+ label: 'Page Context',
+ children: [
+ ...pageContextFields,
+ { key: 'applied_filter', label: 'Applied Filter' },
+ { key: 'custom_fields', label: 'Custom Fields' },
+ { key: 'seller_app_sales_channels', label: 'Seller App Sales Channels' },
+ { key: 'sort_column', label: 'Sort Column' },
+ { key: 'sort_order', label: 'Sort Order' },
+ ],
+ },
+ ],
+};
+
+export const zohoInvoiceListInvoicePaymentsOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'message', label: 'Message' },
+ {
+ key: 'payments',
+ label: 'Payments',
+ listItems: [
+ { key: 'payment_id', label: 'Payment ID' },
+ { key: 'payment_number', label: 'Payment Number' },
+ { key: 'invoice_id', label: 'Invoice ID' },
+ { key: 'invoice_payment_id', label: 'Invoice Payment ID' },
+ { key: 'payment_mode', label: 'Payment Mode' },
+ { key: 'description', label: 'Description' },
+ { key: 'date', label: 'Date', format: 'date' },
+ { key: 'reference_number', label: 'Reference Number' },
+ { key: 'exchange_rate', label: 'Exchange Rate', format: 'number' },
+ { key: 'amount', label: 'Amount', format: 'currency' },
+ { key: 'tax_amount_withheld', label: 'Tax Amount Withheld', format: 'currency' },
+ { key: 'online_transaction_id', label: 'Online Transaction ID' },
+ { key: 'is_single_invoice_payment', label: 'Is Single Invoice Payment', format: 'boolean' },
+ ],
+ },
+ ],
+};
+
+export const zohoInvoiceSendBulkInvoiceReminderOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'message', label: 'Message' },
+ {
+ key: 'info',
+ label: 'Info',
+ children: [
+ {
+ key: 'email_errors_info',
+ label: 'Email Errors Info',
+ listItems: [
+ { key: 'code', label: 'Code', format: 'number' },
+ { key: 'ids', label: 'IDs' },
+ { key: 'message', label: 'Message' },
+ ],
+ },
+ {
+ key: 'email_success_info',
+ label: 'Email Success Info',
+ children: [
+ { key: 'message', label: 'Message' },
+ { key: 'sent_count', label: 'Sent Count', format: 'number' },
+ ],
+ },
+ ],
+ },
+ ],
+};
+
+export const zohoInvoiceGetInvoicePaymentReminderContentOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'message', label: 'Message' },
+ {
+ key: 'data',
+ label: 'Data',
+ children: [
+ { key: 'to_followers', label: 'To Followers' },
+ { key: 'file_name_without_extension', label: 'File Name Without Extension' },
+ { key: 'from_email', label: 'From Email', format: 'email' },
+ { key: 'documents', label: 'Documents' },
+ { key: 'bcc_mails', label: 'BCC Mails' },
+ { key: 'subject', label: 'Subject' },
+ { key: 'attachment_name', label: 'Attachment Name' },
+ { key: 'attach_pdf', label: 'Attach PDF', format: 'boolean' },
+ { key: 'is_reminder_enabled', label: 'Is Reminder Enabled', format: 'boolean' },
+ { key: 'body', label: 'Body' },
+ { key: 'to_mails_str', label: 'To Mails (Text)' },
+ { key: 'translated_languages', label: 'Translated Languages' },
+ { key: 'gateways_configured', label: 'Gateways Configured', format: 'boolean' },
+ {
+ key: 'from_emails',
+ label: 'From Emails',
+ labelKey: 'email',
+ listItems: fromEmailsFields,
+ },
+ {
+ key: 'to_contacts',
+ label: 'To Contacts',
+ labelKey: 'email',
+ listItems: toContactsFields,
+ },
+ { key: 'from_address', label: 'From Address' },
+ { key: 'customer_sub_type', label: 'Customer Sub Type' },
+ { key: 'file_name', label: 'File Name' },
+ { key: 'bcc_mails_str', label: 'BCC Mails (Text)' },
+ { key: 'entity_id', label: 'Entity ID' },
+ { key: 'next_reminder_date', label: 'Next Reminder Date', format: 'date' },
+ { key: 'emailtemplate_documents', label: 'Email Template Documents' },
+ { key: 'cc_mails_list', label: 'CC Mails List' },
+ { key: 'error_list', label: 'Error List' },
+ { key: 'cc_mails_str', label: 'CC Mails (Text)' },
+ { key: 'gateways_associated', label: 'Gateways Associated', format: 'boolean' },
+ { key: 'customer_name', label: 'Customer Name' },
+ { key: 'customer_id', label: 'Customer ID' },
+ ],
+ },
+ ],
+};
+
+export const zohoInvoiceSendInvoicePaymentReminderOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'message', label: 'Message' },
+ {
+ key: 'data',
+ label: 'Data',
+ children: [{ key: 'is_first_email', label: 'Is First Email', format: 'boolean' }],
+ },
+ ],
+};
+
+export const zohoInvoiceShippingAddressOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'message', label: 'Message' },
+ {
+ key: 'shipping_address',
+ label: 'Shipping Address',
+ children: [
+ ...shippingAddressFields,
+ { key: 'company_name', label: 'Company Name' },
+ { key: 'zip', label: 'Zip' },
+ { key: 'is_one_off_address', label: 'Is One Off Address', format: 'boolean' },
+ { key: 'is_update_customer', label: 'Is Update Customer' },
+ ],
+ },
+ ],
+};
+
+export const newInvoiceOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'ach_payment_initiated', label: 'ACH Payment Initiated', format: 'boolean' },
+ { key: 'invoice_id', label: 'Invoice ID' },
+ { key: 'zcrm_potential_id', label: 'Zoho CRM Potential ID' },
+ { key: 'customer_id', label: 'Customer ID' },
+ { key: 'zcrm_potential_name', label: 'Zoho CRM Potential Name' },
+ { key: 'customer_name', label: 'Customer Name' },
+ { key: 'company_name', label: 'Company Name' },
+ { key: 'registration_details', label: 'Registration Details' },
+ { key: 'status', label: 'Status' },
+ { key: 'invoice_number', label: 'Invoice Number' },
+ { key: 'reference_number', label: 'Reference Number' },
+ { key: 'date', label: 'Date', format: 'date' },
+ { key: 'due_date', label: 'Due Date', format: 'date' },
+ { key: 'issued_date', label: 'Issued Date', format: 'date' },
+ { key: 'due_days', label: 'Due Days' },
+ { key: 'email', label: 'Email', format: 'email' },
+ { key: 'type', label: 'Type' },
+ { key: 'project_name', label: 'Project Name' },
+ {
+ key: 'billing_address',
+ label: 'Billing Address',
+ children: [...billingAddressFields, { key: 'zipcode', label: 'Zipcode' }],
+ },
+ {
+ key: 'shipping_address',
+ label: 'Shipping Address',
+ children: [...shippingAddressFields, { key: 'zipcode', label: 'Zipcode' }],
+ },
+ { key: 'country', label: 'Country' },
+ { key: 'phone', label: 'Phone' },
+ { key: 'created_by', label: 'Created By' },
+ { key: 'total', label: 'Total', format: 'currency' },
+ { key: 'balance', label: 'Balance', format: 'currency' },
+ { key: 'payment_expected_date', label: 'Payment Expected Date', format: 'date' },
+ { key: 'custom_fields', label: 'Custom Fields' },
+ { key: 'custom_field_hash', label: 'Custom Field Hash' },
+ { key: 'salesperson_name', label: 'Salesperson Name' },
+ { key: 'shipping_charge', label: 'Shipping Charge', format: 'currency' },
+ { key: 'adjustment', label: 'Adjustment', format: 'currency' },
+ { key: 'created_time', label: 'Created Time', format: 'datetime' },
+ { key: 'last_modified_time', label: 'Last Modified Time', format: 'datetime' },
+ { key: 'updated_time', label: 'Updated Time', format: 'datetime' },
+ { key: 'is_viewed_by_client', label: 'Is Viewed By Client', format: 'boolean' },
+ { key: 'has_attachment', label: 'Has Attachment', format: 'boolean' },
+ { key: 'client_viewed_time', label: 'Client Viewed Time', format: 'datetime' },
+ { key: 'is_emailed', label: 'Is Emailed', format: 'boolean' },
+ { key: 'color_code', label: 'Color Code' },
+ { key: 'current_sub_status_id', label: 'Current Sub Status ID' },
+ { key: 'current_sub_status', label: 'Current Sub Status' },
+ { key: 'currency_id', label: 'Currency ID' },
+ { key: 'schedule_time', label: 'Schedule Time' },
+ { key: 'currency_code', label: 'Currency Code' },
+ { key: 'currency_symbol', label: 'Currency Symbol' },
+ { key: 'is_pre_gst', label: 'Is Pre GST', format: 'boolean' },
+ { key: 'template_type', label: 'Template Type' },
+ { key: 'no_of_copies', label: 'No Of Copies', format: 'number' },
+ { key: 'show_no_of_copies', label: 'Show No Of Copies', format: 'boolean' },
+ { key: 'invoice_source', label: 'Invoice Source' },
+ { key: 'sales_channel', label: 'Sales Channel' },
+ { key: 'transaction_type', label: 'Transaction Type' },
+ { key: 'reminders_sent', label: 'Reminders Sent', format: 'number' },
+ { key: 'last_reminder_sent_date', label: 'Last Reminder Sent Date', format: 'date' },
+ { key: 'last_payment_date', label: 'Last Payment Date', format: 'date' },
+ { key: 'template_id', label: 'Template ID' },
+ { key: 'documents', label: 'Documents' },
+ { key: 'salesperson_id', label: 'Salesperson ID' },
+ { key: 'write_off_amount', label: 'Write Off Amount', format: 'currency' },
+ { key: 'exchange_rate', label: 'Exchange Rate', format: 'number' },
+ { key: 'unprocessed_payment_amount', label: 'Unprocessed Payment Amount', format: 'currency' },
+ ],
+};
+
+export const zohoInvoiceTemplatesOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'message', label: 'Message' },
+ {
+ key: 'templates',
+ label: 'Templates',
+ listItems: [
+ { key: 'template_name', label: 'Template Name' },
+ { key: 'template_id', label: 'Template ID' },
+ { key: 'template_type', label: 'Template Type' },
+ ],
+ },
+ ],
+};
+
+export const zohoInvoiceCreditNoteOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'message', label: 'Message' },
+ {
+ key: 'creditnote',
+ label: 'Credit Note',
+ children: [
+ ...creditNoteFields,
+ { key: 'module_id', label: 'Module ID' },
+ { key: 'sub_module_details', label: 'Sub Module Details' },
+ { key: 'status', label: 'Status' },
+ { key: 'issued_date', label: 'Issued Date', format: 'date' },
+ { key: 'reference_number', label: 'Reference Number' },
+ { key: 'is_emailed', label: 'Is Emailed', format: 'boolean' },
+ { key: 'notes', label: 'Notes' },
+ { key: 'terms', label: 'Terms' },
+ { key: 'created_time', label: 'Created Time', format: 'datetime' },
+ { key: 'created_by_id', label: 'Created By ID' },
+ { key: 'last_modified_by_id', label: 'Last Modified By ID' },
+ { key: 'last_modified_time', label: 'Last Modified Time', format: 'datetime' },
+ { key: 'subject_content', label: 'Subject Content' },
+ { key: 'created_by_name', label: 'Created By Name' },
+ { key: 'invoice_id', label: 'Invoice ID' },
+ { key: 'sales_channel', label: 'Sales Channel' },
+ {
+ key: 'invoices_credited',
+ label: 'Invoices Credited',
+ listItems: [
+ ...invoicesCreditedFields,
+ { key: 'invoice_customer_id', label: 'Invoice Customer ID' },
+ { key: 'invoice_customer_name', label: 'Invoice Customer Name' },
+ ],
+ },
+ { key: 'customer_id', label: 'Customer ID' },
+ { key: 'customer_name', label: 'Customer Name' },
+ { key: 'is_viewed_by_client', label: 'Is Viewed By Client', format: 'boolean' },
+ { key: 'client_viewed_time', label: 'Client Viewed Time', format: 'datetime' },
+ { key: 'contact_persons', label: 'Contact Persons' },
+ { key: 'contact_persons_associated', label: 'Contact Persons Associated' },
+ { key: 'salesperson_id', label: 'Salesperson ID' },
+ { key: 'salesperson_name', label: 'Salesperson Name' },
+ { key: 'tds_calculation_type', label: 'TDS Calculation Type' },
+ { key: 'contact_category', label: 'Contact Category' },
+ { key: 'tax_rounding', label: 'Tax Rounding' },
+ { key: 'tds_override_preference', label: 'TDS Override Preference' },
+ { key: 'exceptions', label: 'Exceptions' },
+ { key: 'current_sub_status_id', label: 'Current Sub Status ID' },
+ { key: 'current_sub_status', label: 'Current Sub Status' },
+ { key: 'sub_statuses', label: 'Sub Statuses' },
+ { key: 'template_id', label: 'Template ID' },
+ { key: 'template_type', label: 'Template Type' },
+ { key: 'template_name', label: 'Template Name' },
+ { key: 'currency_id', label: 'Currency ID' },
+ { key: 'currency_code', label: 'Currency Code' },
+ { key: 'currency_symbol', label: 'Currency Symbol' },
+ { key: 'exchange_rate', label: 'Exchange Rate', format: 'number' },
+ { key: 'price_precision', label: 'Price Precision', format: 'number' },
+ { key: 'is_inclusive_tax', label: 'Is Inclusive Tax', format: 'boolean' },
+ { key: 'discount', label: 'Discount', format: 'number' },
+ {
+ key: 'discount_applied_on_amount',
+ label: 'Discount Applied On Amount',
+ format: 'number',
+ },
+ { key: 'is_discount_before_tax', label: 'Is Discount Before Tax', format: 'boolean' },
+ { key: 'discount_type', label: 'Discount Type' },
+ { key: 'is_eway_bill_required', label: 'Is Eway Bill Required', format: 'boolean' },
+ { key: 'ewaybills', label: 'E-Way Bills' },
+ { key: 'dispatch_from_address', label: 'Dispatch From Address' },
+ {
+ key: 'line_items',
+ label: 'Line Items',
+ labelKey: 'name',
+ listItems: [
+ ...lineItemsFields,
+ { key: 'item_id', label: 'Item ID' },
+ { key: 'name', label: 'Name' },
+ { key: 'internal_name', label: 'Internal Name' },
+ { key: 'invoice_id', label: 'Invoice ID' },
+ { key: 'invoice_item_id', label: 'Invoice Item ID' },
+ { key: 'quantity', label: 'Quantity', format: 'number' },
+ { key: 'pricing_scheme', label: 'Pricing Scheme' },
+ { key: 'unit', label: 'Unit' },
+ { key: 'item_custom_fields', label: 'Item Custom Fields' },
+ { key: 'line_item_category', label: 'Line Item Category' },
+ { key: 'project_id', label: 'Project ID' },
+ { key: 'pricebook_id', label: 'Price List ID' },
+ { key: 'discount_amount', label: 'Discount Amount', format: 'number' },
+ { key: 'discount', label: 'Discount', format: 'number' },
+ { key: 'discounts', label: 'Discounts' },
+ { key: 'discount_account_id', label: 'Discount Account ID' },
+ { key: 'discount_account_name', label: 'Discount Account Name' },
+ { key: 'bcy_rate', label: 'Rate (Base Currency)', format: 'currency' },
+ { key: 'rate', label: 'Rate', format: 'currency' },
+ { key: 'sales_margin', label: 'Sales Margin' },
+ { key: 'tds_tax_id', label: 'TDS Tax ID' },
+ { key: 'tds_tax_name', label: 'TDS Tax Name' },
+ { key: 'tds_tax_percentage', label: 'TDS Tax Percentage' },
+ { key: 'tds_tax_amount', label: 'TDS Tax Amount', format: 'currency' },
+ { key: 'line_item_tds', label: 'Line Item TDS' },
+ { key: 'item_type', label: 'Item Type' },
+ { key: 'item_code', label: 'Item Code' },
+ { key: 'is_credit_only_item', label: 'Is Credit Only Item', format: 'boolean' },
+ { key: 'mapped_items', label: 'Mapped Items' },
+ { key: 'is_modifier_item', label: 'Is Modifier Item', format: 'boolean' },
+ ],
+ },
+ { key: 'submitter_id', label: 'Submitter ID' },
+ { key: 'approver_id', label: 'Approver ID' },
+ { key: 'submitted_date', label: 'Submitted Date', format: 'date' },
+ { key: 'submitted_by', label: 'Submitted By' },
+ { key: 'submitted_by_name', label: 'Submitted By Name' },
+ { key: 'submitted_by_email', label: 'Submitted By Email' },
+ { key: 'documents', label: 'Documents' },
+ { key: 'custom_fields', label: 'Custom Fields' },
+ { key: 'shipping_charge_tax_id', label: 'Shipping Charge Tax ID' },
+ { key: 'shipping_charge_tax_name', label: 'Shipping Charge Tax Name' },
+ { key: 'shipping_charge_tax_type', label: 'Shipping Charge Tax Type' },
+ { key: 'shipping_charge_tax_percentage', label: 'Shipping Charge Tax Percentage' },
+ { key: 'shipping_charge_tax_exemption_id', label: 'Shipping Charge Tax Exemption ID' },
+ { key: 'shipping_charge_tax_exemption_code', label: 'Shipping Charge Tax Exemption Code' },
+ { key: 'shipping_charge_tax', label: 'Shipping Charge Tax' },
+ { key: 'bcy_shipping_charge_tax', label: 'Shipping Charge Tax (Base Currency)' },
+ {
+ key: 'shipping_charge_exclusive_of_tax',
+ label: 'Shipping Charge Exclusive Of Tax',
+ format: 'currency',
+ },
+ {
+ key: 'shipping_charge_inclusive_of_tax',
+ label: 'Shipping Charge Inclusive Of Tax',
+ format: 'currency',
+ },
+ { key: 'shipping_charge_account_id', label: 'Shipping Charge Account ID' },
+ { key: 'shipping_charge_account_name', label: 'Shipping Charge Account Name' },
+ { key: 'shipping_charge', label: 'Shipping Charge', format: 'currency' },
+ { key: 'shipping_charge_taxes', label: 'Shipping Charge Taxes' },
+ { key: 'adjustment', label: 'Adjustment', format: 'currency' },
+ { key: 'adjustment_description', label: 'Adjustment Description' },
+ { key: 'roundoff_value', label: 'Roundoff Value', format: 'number' },
+ { key: 'transaction_rounding_type', label: 'Transaction Rounding Type' },
+ { key: 'rounding_mode', label: 'Rounding Mode' },
+ { key: 'bcy_rounding_mode', label: 'Rounding Mode (Base Currency)' },
+ { key: 'sub_total', label: 'Sub Total', format: 'currency' },
+ {
+ key: 'sub_total_inclusive_of_tax',
+ label: 'Sub Total Inclusive Of Tax',
+ format: 'currency',
+ },
+ { key: 'tax_total', label: 'Tax Total', format: 'currency' },
+ { key: 'total', label: 'Total', format: 'currency' },
+ { key: 'total_credits_used', label: 'Total Credits Used', format: 'currency' },
+ { key: 'total_refunded_amount', label: 'Total Refunded Amount', format: 'currency' },
+ { key: 'balance', label: 'Balance', format: 'currency' },
+ { key: 'taxes', label: 'Taxes' },
+ { key: 'computation_type', label: 'Computation Type' },
+ { key: 'tds_summary', label: 'TDS Summary' },
+ { key: 'creditnote_refunds', label: 'Credit Note Refunds' },
+ {
+ key: 'billing_address',
+ label: 'Billing Address',
+ children: [...billingAddressFields, { key: 'zip', label: 'Zip' }],
+ },
+ {
+ key: 'shipping_address',
+ label: 'Shipping Address',
+ children: [...shippingAddressFields, { key: 'zip', label: 'Zip' }],
+ },
+ { key: 'approvers_list', label: 'Approvers List' },
+ { key: 'registration_details', label: 'Registration Details' },
+ ],
+ },
+ ],
+};
+
+export const zohoInvoiceCreditNoteRefundsOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'message', label: 'Message' },
+ {
+ key: 'creditnote_refunds',
+ label: 'Credit Note Refunds',
+ listItems: [
+ { key: 'creditnote_refund_id', label: 'Credit Note Refund ID' },
+ { key: 'creditnote_id', label: 'Credit Note ID' },
+ { key: 'date', label: 'Date', format: 'date' },
+ { key: 'refund_mode', label: 'Refund Mode', format: 'number' },
+ { key: 'reference_number', label: 'Reference Number' },
+ { key: 'creditnote_number', label: 'Credit Note Number' },
+ { key: 'customer_name', label: 'Customer Name' },
+ { key: 'description', label: 'Description' },
+ { key: 'amount_bcy', label: 'Amount (Base Currency)', format: 'currency' },
+ { key: 'amount_fcy', label: 'Amount (Foreign Currency)', format: 'currency' },
+ ],
+ },
+ {
+ key: 'page_context',
+ label: 'Page Context',
+ children: [
+ ...pageContextFields,
+ { key: 'sort_column', label: 'Sort Column' },
+ { key: 'sort_order', label: 'Sort Order' },
+ ],
+ },
+ ],
+};
+
+export const zohoInvoiceApplyCreditNoteToInvoicesOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'message', label: 'Message' },
+ {
+ key: 'apply_to_invoices',
+ label: 'Apply To Invoices',
+ children: [
+ {
+ key: 'invoices',
+ label: 'Invoices',
+ listItems: [
+ { key: 'invoice_id', label: 'Invoice ID' },
+ { key: 'amount_applied', label: 'Amount Applied', format: 'currency' },
+ { key: 'apply_date', label: 'Apply Date', format: 'date' },
+ ],
+ },
+ ],
+ },
+ ],
+};
+
+export const zohoInvoiceAddCreditNoteCommentOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'message', label: 'Message' },
+ {
+ key: 'comment',
+ label: 'Comment',
+ children: [...commentFields, { key: 'creditnote_id', label: 'Credit Note ID' }],
+ },
+ ],
+};
+
+export const zohoInvoiceListCreditNoteCommentsOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'message', label: 'Message' },
+ {
+ key: 'comments',
+ label: 'Comments',
+ listItems: [
+ ...commentsFields,
+ { key: 'creditnote_id', label: 'Credit Note ID' },
+ { key: 'comment_type', label: 'Comment Type' },
+ { key: 'operation_type', label: 'Operation Type' },
+ { key: 'transaction_id', label: 'Transaction ID' },
+ { key: 'transaction_type', label: 'Transaction Type' },
+ ],
+ },
+ ],
+};
+
+export const zohoInvoiceGetCreditNoteOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'message', label: 'Message' },
+ {
+ key: 'creditnote',
+ label: 'Credit Note',
+ children: [
+ ...creditNoteFields,
+ { key: 'module_id', label: 'Module ID' },
+ { key: 'sub_module_details', label: 'Sub Module Details' },
+ { key: 'status', label: 'Status' },
+ { key: 'issued_date', label: 'Issued Date', format: 'date' },
+ { key: 'reference_number', label: 'Reference Number' },
+ { key: 'is_emailed', label: 'Is Emailed', format: 'boolean' },
+ { key: 'notes', label: 'Notes' },
+ { key: 'terms', label: 'Terms' },
+ { key: 'created_time', label: 'Created Time', format: 'datetime' },
+ { key: 'created_by_id', label: 'Created By ID' },
+ { key: 'last_modified_by_id', label: 'Last Modified By ID' },
+ { key: 'last_modified_time', label: 'Last Modified Time', format: 'datetime' },
+ { key: 'subject_content', label: 'Subject Content' },
+ { key: 'created_by_name', label: 'Created By Name' },
+ { key: 'invoice_id', label: 'Invoice ID' },
+ { key: 'sales_channel', label: 'Sales Channel' },
+ { key: 'invoices_credited', label: 'Invoices Credited' },
+ { key: 'customer_id', label: 'Customer ID' },
+ { key: 'customer_name', label: 'Customer Name' },
+ { key: 'is_viewed_by_client', label: 'Is Viewed By Client', format: 'boolean' },
+ { key: 'client_viewed_time', label: 'Client Viewed Time', format: 'datetime' },
+ { key: 'contact_persons', label: 'Contact Persons' },
+ { key: 'contact_persons_associated', label: 'Contact Persons Associated' },
+ { key: 'salesperson_id', label: 'Salesperson ID' },
+ { key: 'salesperson_name', label: 'Salesperson Name' },
+ { key: 'tds_calculation_type', label: 'TDS Calculation Type' },
+ { key: 'contact_category', label: 'Contact Category' },
+ { key: 'tax_rounding', label: 'Tax Rounding' },
+ { key: 'tds_override_preference', label: 'TDS Override Preference' },
+ { key: 'exceptions', label: 'Exceptions' },
+ { key: 'current_sub_status_id', label: 'Current Sub Status ID' },
+ { key: 'current_sub_status', label: 'Current Sub Status' },
+ { key: 'sub_statuses', label: 'Sub Statuses' },
+ { key: 'template_id', label: 'Template ID' },
+ { key: 'template_type', label: 'Template Type' },
+ { key: 'template_name', label: 'Template Name' },
+ { key: 'currency_id', label: 'Currency ID' },
+ { key: 'currency_code', label: 'Currency Code' },
+ { key: 'currency_symbol', label: 'Currency Symbol' },
+ { key: 'exchange_rate', label: 'Exchange Rate', format: 'number' },
+ { key: 'price_precision', label: 'Price Precision', format: 'number' },
+ { key: 'is_inclusive_tax', label: 'Is Inclusive Tax', format: 'boolean' },
+ { key: 'discount', label: 'Discount', format: 'number' },
+ {
+ key: 'discount_applied_on_amount',
+ label: 'Discount Applied On Amount',
+ format: 'number',
+ },
+ { key: 'is_discount_before_tax', label: 'Is Discount Before Tax', format: 'boolean' },
+ { key: 'discount_type', label: 'Discount Type' },
+ { key: 'is_eway_bill_required', label: 'Is Eway Bill Required', format: 'boolean' },
+ { key: 'ewaybills', label: 'E-Way Bills' },
+ { key: 'dispatch_from_address', label: 'Dispatch From Address' },
+ {
+ key: 'line_items',
+ label: 'Line Items',
+ labelKey: 'name',
+ listItems: [
+ ...lineItemsFields,
+ { key: 'item_id', label: 'Item ID' },
+ { key: 'name', label: 'Name' },
+ { key: 'internal_name', label: 'Internal Name' },
+ { key: 'invoice_id', label: 'Invoice ID' },
+ { key: 'invoice_item_id', label: 'Invoice Item ID' },
+ { key: 'quantity', label: 'Quantity', format: 'number' },
+ { key: 'pricing_scheme', label: 'Pricing Scheme' },
+ { key: 'unit', label: 'Unit' },
+ { key: 'item_custom_fields', label: 'Item Custom Fields' },
+ { key: 'line_item_category', label: 'Line Item Category' },
+ { key: 'project_id', label: 'Project ID' },
+ { key: 'pricebook_id', label: 'Price List ID' },
+ { key: 'discount_amount', label: 'Discount Amount', format: 'number' },
+ { key: 'discount', label: 'Discount', format: 'number' },
+ { key: 'discounts', label: 'Discounts' },
+ { key: 'discount_account_id', label: 'Discount Account ID' },
+ { key: 'discount_account_name', label: 'Discount Account Name' },
+ { key: 'bcy_rate', label: 'Rate (Base Currency)', format: 'currency' },
+ { key: 'rate', label: 'Rate', format: 'currency' },
+ { key: 'sales_margin', label: 'Sales Margin' },
+ { key: 'tds_tax_id', label: 'TDS Tax ID' },
+ { key: 'tds_tax_name', label: 'TDS Tax Name' },
+ { key: 'tds_tax_percentage', label: 'TDS Tax Percentage' },
+ { key: 'tds_tax_amount', label: 'TDS Tax Amount', format: 'currency' },
+ { key: 'line_item_tds', label: 'Line Item TDS' },
+ { key: 'item_type', label: 'Item Type' },
+ { key: 'item_code', label: 'Item Code' },
+ { key: 'is_credit_only_item', label: 'Is Credit Only Item', format: 'boolean' },
+ { key: 'mapped_items', label: 'Mapped Items' },
+ { key: 'is_modifier_item', label: 'Is Modifier Item', format: 'boolean' },
+ ],
+ },
+ { key: 'submitter_id', label: 'Submitter ID' },
+ { key: 'approver_id', label: 'Approver ID' },
+ { key: 'submitted_date', label: 'Submitted Date', format: 'date' },
+ { key: 'submitted_by', label: 'Submitted By' },
+ { key: 'submitted_by_name', label: 'Submitted By Name' },
+ { key: 'submitted_by_email', label: 'Submitted By Email' },
+ { key: 'documents', label: 'Documents' },
+ { key: 'custom_fields', label: 'Custom Fields' },
+ { key: 'shipping_charge_tax_id', label: 'Shipping Charge Tax ID' },
+ { key: 'shipping_charge_tax_name', label: 'Shipping Charge Tax Name' },
+ { key: 'shipping_charge_tax_type', label: 'Shipping Charge Tax Type' },
+ { key: 'shipping_charge_tax_percentage', label: 'Shipping Charge Tax Percentage' },
+ { key: 'shipping_charge_tax_exemption_id', label: 'Shipping Charge Tax Exemption ID' },
+ { key: 'shipping_charge_tax_exemption_code', label: 'Shipping Charge Tax Exemption Code' },
+ { key: 'shipping_charge_tax', label: 'Shipping Charge Tax' },
+ { key: 'bcy_shipping_charge_tax', label: 'Shipping Charge Tax (Base Currency)' },
+ {
+ key: 'shipping_charge_exclusive_of_tax',
+ label: 'Shipping Charge Exclusive Of Tax',
+ format: 'currency',
+ },
+ {
+ key: 'shipping_charge_inclusive_of_tax',
+ label: 'Shipping Charge Inclusive Of Tax',
+ format: 'currency',
+ },
+ { key: 'shipping_charge_account_id', label: 'Shipping Charge Account ID' },
+ { key: 'shipping_charge_account_name', label: 'Shipping Charge Account Name' },
+ { key: 'shipping_charge', label: 'Shipping Charge', format: 'currency' },
+ { key: 'shipping_charge_taxes', label: 'Shipping Charge Taxes' },
+ { key: 'adjustment', label: 'Adjustment', format: 'currency' },
+ { key: 'adjustment_description', label: 'Adjustment Description' },
+ { key: 'roundoff_value', label: 'Roundoff Value', format: 'number' },
+ { key: 'transaction_rounding_type', label: 'Transaction Rounding Type' },
+ { key: 'rounding_mode', label: 'Rounding Mode' },
+ { key: 'bcy_rounding_mode', label: 'Rounding Mode (Base Currency)' },
+ { key: 'sub_total', label: 'Sub Total', format: 'currency' },
+ {
+ key: 'sub_total_inclusive_of_tax',
+ label: 'Sub Total Inclusive Of Tax',
+ format: 'currency',
+ },
+ { key: 'tax_total', label: 'Tax Total', format: 'currency' },
+ { key: 'total', label: 'Total', format: 'currency' },
+ { key: 'total_credits_used', label: 'Total Credits Used', format: 'currency' },
+ { key: 'total_refunded_amount', label: 'Total Refunded Amount', format: 'currency' },
+ { key: 'balance', label: 'Balance', format: 'currency' },
+ { key: 'taxes', label: 'Taxes' },
+ { key: 'computation_type', label: 'Computation Type' },
+ { key: 'tds_summary', label: 'TDS Summary' },
+ { key: 'creditnote_refunds', label: 'Credit Note Refunds' },
+ {
+ key: 'billing_address',
+ label: 'Billing Address',
+ children: [...billingAddressFields, { key: 'zip', label: 'Zip' }],
+ },
+ {
+ key: 'shipping_address',
+ label: 'Shipping Address',
+ children: [...shippingAddressFields, { key: 'zip', label: 'Zip' }],
+ },
+ { key: 'approvers_list', label: 'Approvers List' },
+ { key: 'registration_details', label: 'Registration Details' },
+ ],
+ },
+ ],
+};
+
+export const zohoInvoiceListCreditNoteInvoicesOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'message', label: 'Message' },
+ {
+ key: 'invoices_credited',
+ label: 'Invoices Credited',
+ listItems: [
+ ...invoicesCreditedFields,
+ { key: 'creditnote_id', label: 'Credit Note ID' },
+ { key: 'creditnote_number', label: 'Credit Note Number' },
+ ],
+ },
+ ],
+};
+
+export const zohoInvoiceListCreditNotesOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'message', label: 'Message' },
+ {
+ key: 'creditnotes',
+ label: 'Credit Notes',
+ listItems: [
+ { key: 'creditnote_id', label: 'Credit Note ID' },
+ { key: 'creditnote_number', label: 'Credit Note Number' },
+ { key: 'status', label: 'Status' },
+ { key: 'reference_number', label: 'Reference Number' },
+ { key: 'date', label: 'Date', format: 'date' },
+ { key: 'issued_date', label: 'Issued Date', format: 'date' },
+ { key: 'total', label: 'Total', format: 'currency' },
+ { key: 'balance', label: 'Balance', format: 'currency' },
+ { key: 'customer_id', label: 'Customer ID' },
+ { key: 'customer_name', label: 'Customer Name' },
+ { key: 'applied_invoices', label: 'Applied Invoices' },
+ { key: 'is_emailed', label: 'Is Emailed', format: 'boolean' },
+ { key: 'has_attachment', label: 'Has Attachment', format: 'boolean' },
+ { key: 'salesperson_name', label: 'Salesperson Name' },
+ { key: 'salesperson_id', label: 'Salesperson ID' },
+ { key: 'sales_channel', label: 'Sales Channel' },
+ { key: 'is_viewed_by_client', label: 'Is Viewed By Client', format: 'boolean' },
+ { key: 'client_viewed_time', label: 'Client Viewed Time', format: 'datetime' },
+ { key: 'current_sub_status_id', label: 'Current Sub Status ID' },
+ { key: 'current_sub_status', label: 'Current Sub Status' },
+ { key: 'currency_id', label: 'Currency ID' },
+ { key: 'currency_code', label: 'Currency Code' },
+ { key: 'created_time', label: 'Created Time', format: 'datetime' },
+ { key: 'last_modified_time', label: 'Last Modified Time', format: 'datetime' },
+ { key: 'exchange_rate', label: 'Exchange Rate', format: 'number' },
+ { key: 'template_id', label: 'Template ID' },
+ { key: 'template_type', label: 'Template Type' },
+ { key: 'rounding_mode', label: 'Rounding Mode' },
+ { key: 'price_precision', label: 'Price Precision', format: 'number' },
+ { key: 'registration_details', label: 'Registration Details' },
+ { key: 'item_quantity', label: 'Item Quantity', format: 'number' },
+ { key: 'item_price', label: 'Item Price', format: 'currency' },
+ { key: 'item_total_price', label: 'Item Total Price', format: 'currency' },
+ { key: 'item_total', label: 'Item Total', format: 'currency' },
+ { key: 'item_total_without_tax', label: 'Item Total Without Tax', format: 'currency' },
+ ],
+ },
+ {
+ key: 'page_context',
+ label: 'Page Context',
+ children: [
+ ...pageContextFields,
+ { key: 'applied_filter', label: 'Applied Filter' },
+ { key: 'custom_fields', label: 'Custom Fields' },
+ { key: 'sort_column', label: 'Sort Column' },
+ { key: 'sort_order', label: 'Sort Order' },
+ ],
+ },
+ ],
+};
+
+export const zohoInvoiceGetCreditNoteEmailHistoryOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'message', label: 'Message' },
+ {
+ key: 'email_history',
+ label: 'Email History',
+ labelKey: 'subject',
+ listItems: [
+ { key: 'mailhistory_id', label: 'Mail History ID' },
+ { key: 'from', label: 'From', format: 'email' },
+ { key: 'to_mail_ids', label: 'To Mail IDs', format: 'email' },
+ { key: 'subject', label: 'Subject' },
+ { key: 'date', label: 'Date', format: 'date' },
+ { key: 'type', label: 'Type', format: 'number' },
+ ],
+ },
+ ],
+};
+
+export const zohoInvoiceCreditNoteRefundOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'message', label: 'Message' },
+ {
+ key: 'creditnote_refund',
+ label: 'Credit Note Refund',
+ children: [
+ { key: 'creditnote_refund_id', label: 'Credit Note Refund ID' },
+ { key: 'creditnote_id', label: 'Credit Note ID' },
+ { key: 'date', label: 'Date', format: 'date' },
+ { key: 'refund_mode', label: 'Refund Mode' },
+ { key: 'reference_number', label: 'Reference Number' },
+ { key: 'amount', label: 'Amount', format: 'currency' },
+ { key: 'exchange_rate', label: 'Exchange Rate', format: 'number' },
+ { key: 'description', label: 'Description' },
+ { key: 'status', label: 'Status' },
+ { key: 'customer_id', label: 'Customer ID' },
+ { key: 'customer_name', label: 'Customer Name' },
+ { key: 'email', label: 'Email' },
+ { key: 'price_precision', label: 'Price Precision', format: 'number' },
+ { key: 'currency_code', label: 'Currency Code' },
+ { key: 'currency_symbol', label: 'Currency Symbol' },
+ { key: 'created_by_id', label: 'Created By ID' },
+ { key: 'last_modified_by_id', label: 'Last Modified By ID' },
+ { key: 'created_date', label: 'Created Date', format: 'number' },
+ {
+ key: 'creditnote',
+ label: 'Credit Note',
+ children: [
+ ...creditNoteFields,
+ { key: 'amount', label: 'Amount', format: 'currency' },
+ { key: 'refund_amount', label: 'Refund Amount', format: 'currency' },
+ { key: 'balance_amount', label: 'Balance Amount', format: 'currency' },
+ ],
+ },
+ { key: 'rounding_mode', label: 'Rounding Mode' },
+ ],
+ },
+ ],
+};
+
+export const zohoInvoiceEstimateOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'message', label: 'Message' },
+ {
+ key: 'estimate',
+ label: 'Estimate',
+ children: [
+ { key: 'estimate_id', label: 'Estimate ID' },
+ { key: 'estimate_number', label: 'Estimate Number' },
+ { key: 'zcrm_potential_id', label: 'Zoho CRM Potential ID' },
+ { key: 'zcrm_potential_name', label: 'Zoho CRM Potential Name' },
+ { key: 'date', label: 'Date', format: 'date' },
+ { key: 'created_date', label: 'Created Date', format: 'date' },
+ { key: 'invoice_conversion_type', label: 'Invoice Conversion Type' },
+ { key: 'reference_number', label: 'Reference Number' },
+ { key: 'status', label: 'Status' },
+ { key: 'current_sub_status_id', label: 'Current Sub Status ID' },
+ { key: 'current_sub_status', label: 'Current Sub Status' },
+ { key: 'sub_statuses', label: 'Sub Statuses' },
+ { key: 'customer_id', label: 'Customer ID' },
+ { key: 'documents', label: 'Documents' },
+ { key: 'customer_name', label: 'Customer Name' },
+ { key: 'is_transaction_created', label: 'Is Transaction Created', format: 'boolean' },
+ { key: 'is_converted_to_open', label: 'Is Converted To Open', format: 'boolean' },
+ { key: 'contact_category', label: 'Contact Category' },
+ { key: 'exceptions', label: 'Exceptions' },
+ { key: 'contact_persons', label: 'Contact Persons' },
+ { key: 'currency_id', label: 'Currency ID' },
+ { key: 'currency_code', label: 'Currency Code' },
+ { key: 'currency_symbol', label: 'Currency Symbol' },
+ { key: 'exchange_rate', label: 'Exchange Rate', format: 'number' },
+ { key: 'expiry_date', label: 'Expiry Date', format: 'date' },
+ { key: 'discount', label: 'Discount', format: 'number' },
+ {
+ key: 'discount_applied_on_amount',
+ label: 'Discount Applied On Amount',
+ format: 'number',
+ },
+ { key: 'is_discount_before_tax', label: 'Is Discount Before Tax', format: 'boolean' },
+ { key: 'discount_type', label: 'Discount Type' },
+ { key: 'is_viewed_by_client', label: 'Is Viewed By Client', format: 'boolean' },
+ { key: 'client_viewed_time', label: 'Client Viewed Time', format: 'datetime' },
+ { key: 'is_inclusive_tax', label: 'Is Inclusive Tax', format: 'boolean' },
+ { key: 'tax_rounding', label: 'Tax Rounding' },
+ { key: 'tds_calculation_type', label: 'TDS Calculation Type' },
+ { key: 'estimate_url', label: 'Estimate URL', format: 'url' },
+ { key: 'cart_id', label: 'Cart ID' },
+ { key: 'journey_plan_id', label: 'Journey Plan ID' },
+ {
+ key: 'line_items',
+ label: 'Line Items',
+ labelKey: 'name',
+ listItems: [
+ ...lineItemsFields,
+ { key: 'item_id', label: 'Item ID' },
+ { key: 'documents', label: 'Documents' },
+ { key: 'name', label: 'Name' },
+ { key: 'internal_name', label: 'Internal Name' },
+ { key: 'header_id', label: 'Header ID' },
+ { key: 'header_name', label: 'Header Name' },
+ { key: 'bcy_rate', label: 'Rate (Base Currency)', format: 'currency' },
+ { key: 'rate', label: 'Rate', format: 'currency' },
+ { key: 'quantity', label: 'Quantity', format: 'number' },
+ { key: 'unit', label: 'Unit' },
+ { key: 'pricing_scheme', label: 'Pricing Scheme' },
+ { key: 'pricebook_id', label: 'Price List ID' },
+ { key: 'line_item_category', label: 'Line Item Category' },
+ { key: 'discount_amount', label: 'Discount Amount', format: 'number' },
+ { key: 'discount', label: 'Discount', format: 'number' },
+ { key: 'discounts', label: 'Discounts' },
+ { key: 'line_item_tds', label: 'Line Item TDS' },
+ { key: 'combo_type', label: 'Combo Type' },
+ { key: 'item_code', label: 'Item Code' },
+ { key: 'is_modifier_item', label: 'Is Modifier Item', format: 'boolean' },
+ { key: 'tds_tax_id', label: 'TDS Tax ID' },
+ { key: 'tds_tax_name', label: 'TDS Tax Name' },
+ { key: 'tds_tax_percentage', label: 'TDS Tax Percentage' },
+ { key: 'tds_tax_amount', label: 'TDS Tax Amount', format: 'currency' },
+ { key: 'item_custom_fields', label: 'Item Custom Fields' },
+ { key: 'mapped_items', label: 'Mapped Items' },
+ ],
+ },
+ { key: 'submitter_id', label: 'Submitter ID' },
+ { key: 'submitted_date', label: 'Submitted Date', format: 'date' },
+ { key: 'submitted_by', label: 'Submitted By' },
+ { key: 'submitted_by_name', label: 'Submitted By Name' },
+ { key: 'submitted_by_email', label: 'Submitted By Email' },
+ { key: 'approver_id', label: 'Approver ID' },
+ { key: 'shipping_charge_tax_id', label: 'Shipping Charge Tax ID' },
+ { key: 'shipping_charge_tax_name', label: 'Shipping Charge Tax Name' },
+ { key: 'shipping_charge_tax_type', label: 'Shipping Charge Tax Type' },
+ { key: 'shipping_charge_tax_percentage', label: 'Shipping Charge Tax Percentage' },
+ { key: 'shipping_charge_tax_exemption_id', label: 'Shipping Charge Tax Exemption ID' },
+ { key: 'shipping_charge_tax_exemption_code', label: 'Shipping Charge Tax Exemption Code' },
+ { key: 'shipping_charge_tax', label: 'Shipping Charge Tax' },
+ { key: 'bcy_shipping_charge_tax', label: 'Shipping Charge Tax (Base Currency)' },
+ {
+ key: 'shipping_charge_exclusive_of_tax',
+ label: 'Shipping Charge Exclusive Of Tax',
+ format: 'currency',
+ },
+ {
+ key: 'shipping_charge_inclusive_of_tax',
+ label: 'Shipping Charge Inclusive Of Tax',
+ format: 'currency',
+ },
+ { key: 'shipping_charge_account_id', label: 'Shipping Charge Account ID' },
+ { key: 'shipping_charge_account_name', label: 'Shipping Charge Account Name' },
+ { key: 'shipping_charge', label: 'Shipping Charge', format: 'currency' },
+ {
+ key: 'bcy_shipping_charge',
+ label: 'Shipping Charge (Base Currency)',
+ format: 'currency',
+ },
+ { key: 'shipping_charge_taxes', label: 'Shipping Charge Taxes' },
+ { key: 'adjustment', label: 'Adjustment', format: 'currency' },
+ { key: 'bcy_adjustment', label: 'Adjustment (Base Currency)', format: 'currency' },
+ { key: 'adjustment_description', label: 'Adjustment Description' },
+ { key: 'roundoff_value', label: 'Roundoff Value', format: 'number' },
+ { key: 'transaction_rounding_type', label: 'Transaction Rounding Type' },
+ { key: 'rounding_mode', label: 'Rounding Mode' },
+ { key: 'bcy_rounding_mode', label: 'Rounding Mode (Base Currency)' },
+ { key: 'sub_total', label: 'Sub Total', format: 'currency' },
+ { key: 'bcy_sub_total', label: 'Sub Total (Base Currency)', format: 'currency' },
+ {
+ key: 'sub_total_inclusive_of_tax',
+ label: 'Sub Total Inclusive Of Tax',
+ format: 'currency',
+ },
+ {
+ key: 'sub_total_exclusive_of_discount',
+ label: 'Sub Total Exclusive Of Discount',
+ format: 'number',
+ },
+ { key: 'discount_total', label: 'Discount Total', format: 'number' },
+ { key: 'bcy_discount_total', label: 'Discount Total (Base Currency)', format: 'number' },
+ { key: 'discount_percent', label: 'Discount Percent', format: 'number' },
+ { key: 'total', label: 'Total', format: 'currency' },
+ { key: 'bcy_total', label: 'Total (Base Currency)', format: 'currency' },
+ { key: 'tax_total', label: 'Tax Total', format: 'currency' },
+ { key: 'bcy_tax_total', label: 'Tax Total (Base Currency)', format: 'currency' },
+ { key: 'price_precision', label: 'Price Precision', format: 'number' },
+ { key: 'taxes', label: 'Taxes' },
+ { key: 'tds_override_preference', label: 'TDS Override Preference' },
+ { key: 'tds_summary', label: 'TDS Summary' },
+ { key: 'invoice_ids', label: 'Invoice IDs' },
+ { key: 'subscription_ids', label: 'Subscription IDs' },
+ {
+ key: 'billing_address',
+ label: 'Billing Address',
+ children: [...billingAddressFields, { key: 'zip', label: 'Zip' }],
+ },
+ {
+ key: 'shipping_address',
+ label: 'Shipping Address',
+ children: [...shippingAddressFields, { key: 'zip', label: 'Zip' }],
+ },
+ { key: 'dispatch_from_address', label: 'Dispatch From Address' },
+ {
+ key: 'customer_default_billing_address',
+ label: 'Customer Default Billing Address',
+ children: customerDefaultBillingAddressFields,
+ },
+ { key: 'notes', label: 'Notes' },
+ { key: 'terms', label: 'Terms' },
+ { key: 'custom_fields', label: 'Custom Fields' },
+ { key: 'template_id', label: 'Template ID' },
+ { key: 'template_name', label: 'Template Name' },
+ { key: 'template_type', label: 'Template Type' },
+ { key: 'created_time', label: 'Created Time', format: 'datetime' },
+ { key: 'last_modified_time', label: 'Last Modified Time', format: 'datetime' },
+ { key: 'created_by_id', label: 'Created By ID' },
+ { key: 'last_modified_by_id', label: 'Last Modified By ID' },
+ { key: 'contact_persons_associated', label: 'Contact Persons Associated' },
+ {
+ key: 'contact_persons_details',
+ label: 'Contact Persons Details',
+ labelKey: 'email',
+ listItems: contactPersonsDetailsFields,
+ },
+ { key: 'salesperson_id', label: 'Salesperson ID' },
+ { key: 'salesperson_name', label: 'Salesperson Name' },
+ { key: 'attachment_name', label: 'Attachment Name' },
+ { key: 'can_send_in_mail', label: 'Can Send In Mail', format: 'boolean' },
+ { key: 'allow_partial_payments', label: 'Allow Partial Payments', format: 'boolean' },
+ {
+ key: 'payment_options',
+ label: 'Payment Options',
+ children: [{ key: 'payment_gateways', label: 'Payment Gateways' }],
+ },
+ { key: 'retainerinvoices', label: 'Retainer Invoices' },
+ { key: 'estimate_type', label: 'Estimate Type' },
+ { key: 'salesorders', label: 'Sales Orders' },
+ { key: 'subject_content', label: 'Subject Content' },
+ { key: 'approvers_list', label: 'Approvers List' },
+ { key: 'registration_details', label: 'Registration Details' },
+ ],
+ },
+ ],
+};
+
+export const zohoInvoiceAddEstimateCommentOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'message', label: 'Message' },
+ {
+ key: 'comment',
+ label: 'Comment',
+ children: [
+ ...commentFields,
+ { key: 'estimate_id', label: 'Estimate ID' },
+ { key: 'date_description', label: 'Date Description' },
+ { key: 'time', label: 'Time' },
+ ],
+ },
+ ],
+};
+
+export const zohoInvoiceListEstimateCommentsOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'message', label: 'Message' },
+ {
+ key: 'comments',
+ label: 'Comments',
+ listItems: [
+ ...commentsFields,
+ { key: 'estimate_id', label: 'Estimate ID' },
+ { key: 'comment_type', label: 'Comment Type' },
+ { key: 'operation_type', label: 'Operation Type' },
+ { key: 'transaction_id', label: 'Transaction ID' },
+ { key: 'transaction_type', label: 'Transaction Type' },
+ ],
+ },
+ ],
+};
+
+export const zohoInvoiceListEstimatesOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'message', label: 'Message' },
+ {
+ key: 'estimates',
+ label: 'Estimates',
+ listItems: [
+ { key: 'estimate_id', label: 'Estimate ID' },
+ { key: 'zcrm_potential_id', label: 'Zoho CRM Potential ID' },
+ { key: 'zcrm_potential_name', label: 'Zoho CRM Potential Name' },
+ { key: 'customer_name', label: 'Customer Name' },
+ { key: 'customer_id', label: 'Customer ID' },
+ { key: 'company_name', label: 'Company Name' },
+ { key: 'status', label: 'Status' },
+ { key: 'current_sub_status_id', label: 'Current Sub Status ID' },
+ { key: 'current_sub_status', label: 'Current Sub Status' },
+ { key: 'estimate_number', label: 'Estimate Number' },
+ { key: 'reference_number', label: 'Reference Number' },
+ { key: 'date', label: 'Date', format: 'date' },
+ { key: 'currency_id', label: 'Currency ID' },
+ { key: 'currency_code', label: 'Currency Code' },
+ { key: 'total', label: 'Total', format: 'currency' },
+ { key: 'created_time', label: 'Created Time', format: 'datetime' },
+ { key: 'last_modified_time', label: 'Last Modified Time', format: 'datetime' },
+ { key: 'accepted_date', label: 'Accepted Date', format: 'date' },
+ { key: 'declined_date', label: 'Declined Date', format: 'date' },
+ { key: 'expiry_date', label: 'Expiry Date', format: 'date' },
+ { key: 'has_attachment', label: 'Has Attachment', format: 'boolean' },
+ { key: 'is_viewed_by_client', label: 'Is Viewed By Client', format: 'boolean' },
+ { key: 'client_viewed_time', label: 'Client Viewed Time', format: 'datetime' },
+ { key: 'is_emailed', label: 'Is Emailed', format: 'boolean' },
+ { key: 'template_type', label: 'Template Type' },
+ { key: 'template_id', label: 'Template ID' },
+ { key: 'salesperson_id', label: 'Salesperson ID' },
+ { key: 'salesperson_name', label: 'Salesperson Name' },
+ { key: 'registration_details', label: 'Registration Details' },
+ ],
+ },
+ {
+ key: 'page_context',
+ label: 'Page Context',
+ children: [
+ ...pageContextFields,
+ { key: 'applied_filter', label: 'Applied Filter' },
+ { key: 'custom_fields', label: 'Custom Fields' },
+ { key: 'sort_column', label: 'Sort Column' },
+ { key: 'sort_order', label: 'Sort Order' },
+ ],
+ },
+ ],
+};
+
+export const zohoInvoiceGetEstimateEmailContentOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'message', label: 'Message' },
+ {
+ key: 'data',
+ label: 'Data',
+ children: [
+ {
+ key: 'to_followers',
+ label: 'To Followers',
+ labelKey: 'name',
+ listItems: [
+ { key: 'user_id', label: 'User ID' },
+ { key: 'name', label: 'Name' },
+ { key: 'mobile', label: 'Mobile' },
+ { key: 'email', label: 'Email', format: 'email' },
+ ],
+ },
+ { key: 'file_name_without_extension', label: 'File Name Without Extension' },
+ { key: 'from_email', label: 'From Email', format: 'email' },
+ { key: 'documents', label: 'Documents' },
+ { key: 'bcc_mails', label: 'BCC Mails' },
+ { key: 'subject', label: 'Subject' },
+ { key: 'attachment_name', label: 'Attachment Name' },
+ { key: 'attach_pdf', label: 'Attach PDF', format: 'boolean' },
+ { key: 'to_salesperson', label: 'To Salesperson' },
+ { key: 'body', label: 'Body' },
+ { key: 'to_mails_str', label: 'To Mails (Text)' },
+ {
+ key: 'translated_languages',
+ label: 'Translated Languages',
+ listItems: [
+ { key: 'language_code', label: 'Language Code' },
+ { key: 'is_selected', label: 'Is Selected', format: 'boolean' },
+ ],
+ },
+ {
+ key: 'from_emails',
+ label: 'From Emails',
+ labelKey: 'email',
+ listItems: fromEmailsFields,
+ },
+ {
+ key: 'to_contacts',
+ label: 'To Contacts',
+ labelKey: 'email',
+ listItems: toContactsFields,
+ },
+ {
+ key: 'emailtemplates',
+ label: 'Email Templates',
+ labelKey: 'name',
+ listItems: emailTemplatesFields,
+ },
+ { key: 'from_address', label: 'From Address' },
+ { key: 'customer_sub_type', label: 'Customer Sub Type' },
+ { key: 'file_name', label: 'File Name' },
+ { key: 'bcc_mails_str', label: 'BCC Mails (Text)' },
+ { key: 'entity_id', label: 'Entity ID' },
+ { key: 'emailtemplate_documents', label: 'Email Template Documents' },
+ { key: 'entity_type', label: 'Entity Type' },
+ {
+ key: 'cc_mails_list',
+ label: 'CC Mails List',
+ labelKey: 'email',
+ listItems: [
+ { key: 'user_name', label: 'User Name' },
+ { key: 'email', label: 'Email', format: 'email' },
+ ],
+ },
+ { key: 'error_list', label: 'Error List' },
+ { key: 'cc_mails_str', label: 'CC Mails (Text)', format: 'email' },
+ { key: 'customer_name', label: 'Customer Name' },
+ { key: 'customer_id', label: 'Customer ID' },
+ { key: 'status', label: 'Status' },
+ ],
+ },
+ ],
+};
+
+export const zohoInvoiceExpenseCategoryOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'message', label: 'Message' },
+ {
+ key: 'expense_category',
+ label: 'Expense Category',
+ children: [
+ { key: 'account_id', label: 'Account ID' },
+ { key: 'account_name', label: 'Account Name' },
+ { key: 'description', label: 'Description' },
+ { key: 'status', label: 'Status' },
+ { key: 'created_time', label: 'Created Time', format: 'datetime' },
+ { key: 'last_modified_time', label: 'Last Modified Time', format: 'datetime' },
+ ],
+ },
+ ],
+};
+
+export const zohoInvoiceListExpenseCategoriesOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'message', label: 'Message' },
+ {
+ key: 'expense_accounts',
+ label: 'Expense Accounts',
+ listItems: [
+ { key: 'account_id', label: 'Account ID' },
+ { key: 'account_name', label: 'Account Name' },
+ { key: 'description', label: 'Description' },
+ { key: 'status', label: 'Status' },
+ ],
+ },
+ {
+ key: 'page_context',
+ label: 'Page Context',
+ children: [
+ ...pageContextFields,
+ { key: 'applied_filter', label: 'Applied Filter' },
+ { key: 'sort_column', label: 'Sort Column' },
+ { key: 'sort_order', label: 'Sort Order' },
+ ],
+ },
+ ],
+};
+
+export const zohoInvoiceExpenseOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'message', label: 'Message' },
+ {
+ key: 'expense',
+ label: 'Expense',
+ children: [
+ { key: 'expense_id', label: 'Expense ID' },
+ { key: 'is_expense_claim', label: 'Is Expense Claim', format: 'boolean' },
+ { key: 'transaction_type', label: 'Transaction Type' },
+ { key: 'expense_item_id', label: 'Expense Item ID' },
+ { key: 'account_id', label: 'Account ID' },
+ { key: 'account_name', label: 'Account Name' },
+ { key: 'invoice_conversion_type', label: 'Invoice Conversion Type' },
+ { key: 'documents', label: 'Documents' },
+ { key: 'date', label: 'Date', format: 'date' },
+ { key: 'markup_percent', label: 'Markup Percent', format: 'number' },
+ { key: 'tax_id', label: 'Tax ID' },
+ { key: 'tax_name', label: 'Tax Name' },
+ { key: 'tax_percentage', label: 'Tax Percentage', format: 'number' },
+ { key: 'taxes', label: 'Taxes' },
+ { key: 'tax_override_preference', label: 'Tax Override Preference' },
+ { key: 'currency_id', label: 'Currency ID' },
+ { key: 'currency_code', label: 'Currency Code' },
+ { key: 'exchange_rate', label: 'Exchange Rate', format: 'number' },
+ { key: 'tax_amount', label: 'Tax Amount', format: 'currency' },
+ { key: 'sub_total', label: 'Sub Total', format: 'currency' },
+ { key: 'total', label: 'Total', format: 'currency' },
+ { key: 'bcy_total', label: 'Total (Base Currency)', format: 'currency' },
+ { key: 'amount', label: 'Amount', format: 'currency' },
+ { key: 'is_inclusive_tax', label: 'Is Inclusive Tax', format: 'boolean' },
+ { key: 'reference_number', label: 'Reference Number' },
+ { key: 'description', label: 'Description' },
+ { key: 'is_billable', label: 'Is Billable', format: 'boolean' },
+ { key: 'is_personal', label: 'Is Personal', format: 'boolean' },
+ { key: 'customer_id', label: 'Customer ID' },
+ { key: 'customer_name', label: 'Customer Name' },
+ { key: 'expense_receipt_name', label: 'Expense Receipt Name' },
+ { key: 'expense_receipt_type', label: 'Expense Receipt Type' },
+ { key: 'created_time', label: 'Created Time', format: 'datetime' },
+ { key: 'created_by_id', label: 'Created By ID' },
+ { key: 'last_modified_by_id', label: 'Last Modified By ID' },
+ { key: 'last_modified_time', label: 'Last Modified Time', format: 'datetime' },
+ { key: 'employee_id', label: 'Employee ID' },
+ { key: 'employee_name', label: 'Employee Name' },
+ { key: 'employee_email', label: 'Employee Email' },
+ { key: 'vehicle_id', label: 'Vehicle ID' },
+ { key: 'vehicle_name', label: 'Vehicle Name' },
+ { key: 'mileage_rate', label: 'Mileage Rate', format: 'currency' },
+ { key: 'mileage_unit', label: 'Mileage Unit' },
+ { key: 'mileage_type', label: 'Mileage Type' },
+ { key: 'expense_type', label: 'Expense Type' },
+ { key: 'start_reading', label: 'Start Reading' },
+ { key: 'end_reading', label: 'End Reading' },
+ { key: 'status', label: 'Status' },
+ { key: 'invoice_id', label: 'Invoice ID' },
+ { key: 'invoice_number', label: 'Invoice Number' },
+ { key: 'report_id', label: 'Report ID' },
+ { key: 'report_number', label: 'Report Number' },
+ { key: 'user_id', label: 'User ID' },
+ { key: 'user_name', label: 'User Name' },
+ { key: 'user_email', label: 'User Email' },
+ { key: 'approver_id', label: 'Approver ID' },
+ { key: 'approver_name', label: 'Approver Name' },
+ { key: 'approver_email', label: 'Approver Email' },
+ { key: 'report_status', label: 'Report Status' },
+ { key: 'is_reimbursable', label: 'Is Reimbursable', format: 'boolean' },
+ { key: 'trip_id', label: 'Trip ID' },
+ { key: 'trip_number', label: 'Trip Number' },
+ { key: 'location', label: 'Location' },
+ { key: 'merchant_id', label: 'Merchant ID' },
+ { key: 'merchant_name', label: 'Merchant Name' },
+ { key: 'payment_mode', label: 'Payment Mode' },
+ { key: 'project_id', label: 'Project ID' },
+ { key: 'template_id', label: 'Template ID' },
+ { key: 'template_name', label: 'Template Name' },
+ { key: 'template_type', label: 'Template Type' },
+ { key: 'project_name', label: 'Project Name' },
+ { key: 'custom_fields', label: 'Custom Fields' },
+ { key: 'is_recurring_applicable', label: 'Is Recurring Applicable', format: 'boolean' },
+ {
+ key: 'line_items',
+ label: 'Line Items',
+ listItems: [
+ ...lineItemsFields,
+ { key: 'account_id', label: 'Account ID' },
+ { key: 'account_name', label: 'Account Name' },
+ { key: 'tax_amount', label: 'Tax Amount', format: 'currency' },
+ { key: 'amount', label: 'Amount', format: 'currency' },
+ ],
+ },
+ { key: 'is_surcharge_applicable', label: 'Is Surcharge Applicable', format: 'boolean' },
+ { key: 'fcy_surcharge_amount', label: 'Surcharge Amount', format: 'currency' },
+ {
+ key: 'bcy_surcharge_amount',
+ label: 'Surcharge Amount (Base Currency)',
+ format: 'currency',
+ },
+ { key: 'zcrm_potential_id', label: 'Zoho CRM Potential ID' },
+ { key: 'zcrm_potential_name', label: 'Zoho CRM Potential Name' },
+ { key: 'registration_details', label: 'Registration Details' },
+ ],
+ },
+ ],
+};
+
+export const zohoInvoiceListExpenseHistoryOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'message', label: 'Message' },
+ {
+ key: 'comments',
+ label: 'Comments',
+ listItems: [
+ ...commentsFields,
+ { key: 'expense_id', label: 'Expense ID' },
+ { key: 'operation_type', label: 'Operation Type' },
+ { key: 'transaction_id', label: 'Transaction ID' },
+ { key: 'transaction_type', label: 'Transaction Type' },
+ ],
+ },
+ ],
+};
+
+export const zohoInvoiceListExpensesOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'message', label: 'Message' },
+ {
+ key: 'expenses',
+ label: 'Expenses',
+ listItems: [
+ { key: 'expense_id', label: 'Expense ID' },
+ { key: 'date', label: 'Date', format: 'date' },
+ { key: 'user_name', label: 'User Name' },
+ { key: 'account_name', label: 'Account Name' },
+ { key: 'description', label: 'Description' },
+ { key: 'currency_id', label: 'Currency ID' },
+ { key: 'currency_code', label: 'Currency Code' },
+ { key: 'bcy_total', label: 'Total (Base Currency)', format: 'currency' },
+ {
+ key: 'bcy_total_without_tax',
+ label: 'Total Without Tax (Base Currency)',
+ format: 'currency',
+ },
+ { key: 'total', label: 'Total', format: 'currency' },
+ { key: 'total_without_tax', label: 'Total Without Tax', format: 'currency' },
+ { key: 'is_billable', label: 'Is Billable', format: 'boolean' },
+ { key: 'reference_number', label: 'Reference Number' },
+ { key: 'customer_id', label: 'Customer ID' },
+ { key: 'is_personal', label: 'Is Personal', format: 'boolean' },
+ { key: 'customer_name', label: 'Customer Name' },
+ { key: 'status', label: 'Status' },
+ { key: 'created_time', label: 'Created Time', format: 'datetime' },
+ { key: 'last_modified_time', label: 'Last Modified Time', format: 'datetime' },
+ { key: 'expense_receipt_name', label: 'Expense Receipt Name' },
+ { key: 'exchange_rate', label: 'Exchange Rate', format: 'number' },
+ { key: 'distance', label: 'Distance', format: 'number' },
+ { key: 'mileage_rate', label: 'Mileage Rate', format: 'currency' },
+ { key: 'mileage_unit', label: 'Mileage Unit' },
+ { key: 'mileage_type', label: 'Mileage Type' },
+ { key: 'expense_type', label: 'Expense Type' },
+ { key: 'report_id', label: 'Report ID' },
+ { key: 'start_reading', label: 'Start Reading' },
+ { key: 'end_reading', label: 'End Reading' },
+ { key: 'report_number', label: 'Report Number' },
+ { key: 'has_attachment', label: 'Has Attachment', format: 'boolean' },
+ { key: 'custom_fields_list', label: 'Custom Fields List' },
+ { key: 'registration_details', label: 'Registration Details' },
+ ],
+ },
+ {
+ key: 'page_context',
+ label: 'Page Context',
+ children: [
+ ...pageContextFields,
+ { key: 'applied_filter', label: 'Applied Filter' },
+ { key: 'sort_column', label: 'Sort Column' },
+ { key: 'sort_order', label: 'Sort Order' },
+ { key: 'custom_fields', label: 'Custom Fields' },
+ ],
+ },
+ ],
+};
+
+export const zohoInvoiceRecurringInvoiceOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'message', label: 'Message' },
+ {
+ key: 'recurring_invoice',
+ label: 'Recurring Invoice',
+ children: [
+ { key: 'recurring_invoice_id', label: 'Recurring Invoice ID' },
+ { key: 'recurrence_name', label: 'Recurrence Name' },
+ { key: 'reference_number', label: 'Reference Number' },
+ { key: 'status', label: 'Status' },
+ { key: 'recurrence_frequency', label: 'Recurrence Frequency' },
+ { key: 'repeat_every', label: 'Repeat Every', format: 'number' },
+ { key: 'child_entity_type', label: 'Child Entity Type' },
+ { key: 'start_date', label: 'Start Date', format: 'date' },
+ { key: 'end_date', label: 'End Date', format: 'date' },
+ { key: 'last_sent_date', label: 'Last Sent Date', format: 'date' },
+ { key: 'next_invoice_date', label: 'Next Invoice Date', format: 'date' },
+ { key: 'subject_content', label: 'Subject Content' },
+ { key: 'payment_terms', label: 'Payment Terms', format: 'number' },
+ { key: 'payment_terms_label', label: 'Payment Terms Label' },
+ { key: 'payment_terms_id', label: 'Payment Terms ID' },
+ { key: 'contact_category', label: 'Contact Category' },
+ { key: 'exceptions', label: 'Exceptions' },
+ { key: 'customer_id', label: 'Customer ID' },
+ { key: 'customer_name', label: 'Customer Name' },
+ { key: 'customer_email', label: 'Customer Email', format: 'email' },
+ { key: 'customer_phone', label: 'Customer Phone' },
+ { key: 'customer_mobile_phone', label: 'Customer Mobile Phone' },
+ { key: 'company_name', label: 'Company Name' },
+ { key: 'contact_persons', label: 'Contact Persons' },
+ { key: 'contact_persons_associated', label: 'Contact Persons Associated' },
+ { key: 'currency_id', label: 'Currency ID' },
+ { key: 'price_precision', label: 'Price Precision', format: 'number' },
+ { key: 'currency_code', label: 'Currency Code' },
+ { key: 'currency_symbol', label: 'Currency Symbol' },
+ { key: 'exchange_rate', label: 'Exchange Rate', format: 'number' },
+ { key: 'discount', label: 'Discount', format: 'number' },
+ {
+ key: 'discount_applied_on_amount',
+ label: 'Discount Applied On Amount',
+ format: 'number',
+ },
+ { key: 'is_discount_before_tax', label: 'Is Discount Before Tax', format: 'boolean' },
+ { key: 'discount_type', label: 'Discount Type' },
+ { key: 'tax_rounding', label: 'Tax Rounding' },
+ { key: 'is_inclusive_tax', label: 'Is Inclusive Tax', format: 'boolean' },
+ { key: 'paid_invoices_total', label: 'Paid Invoices Total', format: 'currency' },
+ { key: 'unpaid_invoices_balance', label: 'Unpaid Invoices Balance', format: 'currency' },
+ {
+ key: 'line_items',
+ label: 'Line Items',
+ labelKey: 'name',
+ listItems: [
+ ...lineItemsFields,
+ { key: 'item_id', label: 'Item ID' },
+ { key: 'name', label: 'Name' },
+ { key: 'header_id', label: 'Header ID' },
+ { key: 'header_name', label: 'Header Name' },
+ { key: 'project_id', label: 'Project ID' },
+ { key: 'rate', label: 'Rate', format: 'currency' },
+ { key: 'quantity', label: 'Quantity', format: 'number' },
+ { key: 'unit', label: 'Unit' },
+ { key: 'pricebook_id', label: 'Price List ID' },
+ { key: 'discount_amount', label: 'Discount Amount', format: 'number' },
+ { key: 'discount', label: 'Discount', format: 'number' },
+ {
+ key: 'discounts',
+ label: 'Discounts',
+ listItems: [
+ { key: 'discount_order', label: 'Discount Order', format: 'number' },
+ { key: 'discount_amount', label: 'Discount Amount' },
+ { key: 'discount_percent', label: 'Discount Percent' },
+ ],
+ },
+ { key: 'discount_account_id', label: 'Discount Account ID' },
+ { key: 'discount_account_name', label: 'Discount Account Name' },
+ { key: 'tds_tax_id', label: 'TDS Tax ID' },
+ { key: 'tds_tax_name', label: 'TDS Tax Name' },
+ { key: 'tds_tax_percentage', label: 'TDS Tax Percentage' },
+ { key: 'tds_tax_amount', label: 'TDS Tax Amount', format: 'currency' },
+ { key: 'line_item_tds', label: 'Line Item TDS' },
+ { key: 'line_item_category', label: 'Line Item Category' },
+ { key: 'item_code', label: 'Item Code' },
+ { key: 'item_custom_fields', label: 'Item Custom Fields' },
+ { key: 'mapped_items', label: 'Mapped Items' },
+ ],
+ },
+ {
+ key: 'bcy_shipping_charge',
+ label: 'Shipping Charge (Base Currency)',
+ format: 'currency',
+ },
+ { key: 'bcy_adjustment', label: 'Adjustment (Base Currency)', format: 'currency' },
+ { key: 'bcy_sub_total', label: 'Sub Total (Base Currency)', format: 'currency' },
+ { key: 'bcy_discount_total', label: 'Discount Total (Base Currency)', format: 'number' },
+ { key: 'bcy_tax_total', label: 'Tax Total (Base Currency)', format: 'currency' },
+ { key: 'bcy_total', label: 'Total (Base Currency)', format: 'currency' },
+ { key: 'discount_percent', label: 'Discount Percent', format: 'number' },
+ { key: 'discount_total', label: 'Discount Total', format: 'number' },
+ { key: 'adjustment', label: 'Adjustment', format: 'currency' },
+ { key: 'adjustment_description', label: 'Adjustment Description' },
+ { key: 'recurrence_preferences', label: 'Recurrence Preferences' },
+ { key: 'is_general_preference', label: 'Is General Preference', format: 'boolean' },
+ { key: 'shipping_charge_tax_id', label: 'Shipping Charge Tax ID' },
+ { key: 'shipping_charge_tax_name', label: 'Shipping Charge Tax Name' },
+ { key: 'shipping_charge_tax_type', label: 'Shipping Charge Tax Type' },
+ { key: 'shipping_charge_tax_percentage', label: 'Shipping Charge Tax Percentage' },
+ { key: 'shipping_charge_tax_exemption_id', label: 'Shipping Charge Tax Exemption ID' },
+ { key: 'shipping_charge_tax_exemption_code', label: 'Shipping Charge Tax Exemption Code' },
+ { key: 'shipping_charge_tax', label: 'Shipping Charge Tax' },
+ { key: 'bcy_shipping_charge_tax', label: 'Shipping Charge Tax (Base Currency)' },
+ {
+ key: 'shipping_charge_exclusive_of_tax',
+ label: 'Shipping Charge Exclusive Of Tax',
+ format: 'currency',
+ },
+ {
+ key: 'shipping_charge_inclusive_of_tax',
+ label: 'Shipping Charge Inclusive Of Tax',
+ format: 'currency',
+ },
+ { key: 'shipping_charge_account_id', label: 'Shipping Charge Account ID' },
+ { key: 'shipping_charge_account_name', label: 'Shipping Charge Account Name' },
+ { key: 'shipping_charge', label: 'Shipping Charge', format: 'currency' },
+ { key: 'shipping_charge_taxes', label: 'Shipping Charge Taxes' },
+ { key: 'roundoff_value', label: 'Roundoff Value', format: 'number' },
+ { key: 'transaction_rounding_type', label: 'Transaction Rounding Type' },
+ { key: 'rounding_mode', label: 'Rounding Mode' },
+ { key: 'bcy_rounding_mode', label: 'Rounding Mode (Base Currency)' },
+ { key: 'late_fee', label: 'Late Fee', children: lateFeeFields },
+ { key: 'sub_total', label: 'Sub Total', format: 'currency' },
+ {
+ key: 'sub_total_inclusive_of_tax',
+ label: 'Sub Total Inclusive Of Tax',
+ format: 'currency',
+ },
+ { key: 'total', label: 'Total', format: 'currency' },
+ { key: 'tds_override_preference', label: 'TDS Override Preference' },
+ { key: 'tax_total', label: 'Tax Total', format: 'currency' },
+ { key: 'allow_partial_payments', label: 'Allow Partial Payments', format: 'boolean' },
+ { key: 'taxes', label: 'Taxes' },
+ { key: 'tds_summary', label: 'TDS Summary' },
+ { key: 'tds_calculation_type', label: 'TDS Calculation Type' },
+ { key: 'custom_fields', label: 'Custom Fields' },
+ {
+ key: 'comments',
+ label: 'Comments',
+ listItems: [
+ ...commentsFields,
+ { key: 'recurring_invoice_id', label: 'Recurring Invoice ID' },
+ { key: 'comment_type', label: 'Comment Type' },
+ { key: 'operation_type', label: 'Operation Type' },
+ { key: 'transaction_id', label: 'Transaction ID' },
+ { key: 'transaction_type', label: 'Transaction Type' },
+ ],
+ },
+ {
+ key: 'payment_options',
+ label: 'Payment Options',
+ children: [{ key: 'payment_gateways', label: 'Payment Gateways' }],
+ },
+ {
+ key: 'billing_address',
+ label: 'Billing Address',
+ children: [...billingAddressFields, { key: 'zip', label: 'Zip' }],
+ },
+ {
+ key: 'shipping_address',
+ label: 'Shipping Address',
+ children: [...shippingAddressFields, { key: 'zip', label: 'Zip' }],
+ },
+ { key: 'dispatch_from_address', label: 'Dispatch From Address' },
+ { key: 'template_id', label: 'Template ID' },
+ { key: 'template_name', label: 'Template Name' },
+ { key: 'notes', label: 'Notes' },
+ { key: 'terms', label: 'Terms' },
+ {
+ key: 'actual_child_invoices_count',
+ label: 'Actual Child Invoices Count',
+ format: 'number',
+ },
+ {
+ key: 'manual_child_invoices_count',
+ label: 'Manual Child Invoices Count',
+ format: 'number',
+ },
+ { key: 'unpaid_child_invoices_count', label: 'Unpaid Child Invoices Count' },
+ { key: 'is_autobill_enabled', label: 'Is Autobill Enabled', format: 'boolean' },
+ { key: 'salesperson_id', label: 'Salesperson ID' },
+ { key: 'salesperson_name', label: 'Salesperson Name' },
+ { key: 'created_time', label: 'Created Time', format: 'datetime' },
+ { key: 'last_modified_time', label: 'Last Modified Time', format: 'datetime' },
+ { key: 'created_by_id', label: 'Created By ID' },
+ { key: 'last_modified_by_id', label: 'Last Modified By ID' },
+ { key: 'project_details', label: 'Project Details' },
+ { key: 'registration_details', label: 'Registration Details' },
+ ],
+ },
+ ],
+};
+
+export const zohoInvoiceListRecurringInvoiceHistoryOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'message', label: 'Message' },
+ {
+ key: 'comments',
+ label: 'Comments',
+ listItems: [
+ ...commentsFields,
+ { key: 'recurring_invoice_id', label: 'Recurring Invoice ID' },
+ { key: 'comment_type', label: 'Comment Type' },
+ { key: 'operation_type', label: 'Operation Type' },
+ { key: 'transaction_id', label: 'Transaction ID' },
+ { key: 'transaction_type', label: 'Transaction Type' },
+ ],
+ },
+ ],
+};
+
+export const zohoInvoiceListRecurringInvoicesOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'message', label: 'Message' },
+ {
+ key: 'recurring_invoices',
+ label: 'Recurring Invoices',
+ listItems: [
+ { key: 'recurring_invoice_id', label: 'Recurring Invoice ID' },
+ { key: 'recurrence_name', label: 'Recurrence Name' },
+ { key: 'reference_number', label: 'Reference Number' },
+ { key: 'status', label: 'Status' },
+ { key: 'total', label: 'Total', format: 'currency' },
+ { key: 'customer_id', label: 'Customer ID' },
+ { key: 'customer_name', label: 'Customer Name' },
+ { key: 'child_entity_type', label: 'Child Entity Type' },
+ { key: 'start_date', label: 'Start Date', format: 'date' },
+ { key: 'end_date', label: 'End Date', format: 'date' },
+ { key: 'last_sent_date', label: 'Last Sent Date', format: 'date' },
+ { key: 'next_invoice_date', label: 'Next Invoice Date', format: 'date' },
+ { key: 'recurrence_frequency', label: 'Recurrence Frequency' },
+ { key: 'repeat_every', label: 'Repeat Every', format: 'number' },
+ { key: 'created_time', label: 'Created Time', format: 'datetime' },
+ { key: 'last_modified_time', label: 'Last Modified Time', format: 'datetime' },
+ { key: 'salesperson_id', label: 'Salesperson ID' },
+ { key: 'salesperson_name', label: 'Salesperson Name' },
+ { key: 'last_four_digits', label: 'Last Four Digits' },
+ { key: 'registration_details', label: 'Registration Details' },
+ ],
+ },
+ {
+ key: 'page_context',
+ label: 'Page Context',
+ children: [
+ ...pageContextFields,
+ { key: 'applied_filter', label: 'Applied Filter' },
+ { key: 'sort_column', label: 'Sort Column' },
+ { key: 'sort_order', label: 'Sort Order' },
+ { key: 'custom_fields', label: 'Custom Fields' },
+ ],
+ },
+ ],
+};
+
+export const zohoInvoiceCloneProjectOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'message', label: 'Message' },
+ {
+ key: 'project',
+ label: 'Project',
+ children: [
+ ...projectFields,
+ { key: 'total_amount', label: 'Total Amount' },
+ { key: 'billed_amount', label: 'Billed Amount' },
+ { key: 'un_billed_amount', label: 'Unbilled Amount' },
+ { key: 'billable_amount', label: 'Billable Amount' },
+ { key: 'non_billable_amount', label: 'Non Billable Amount' },
+ ],
+ },
+ ],
+};
+
+export const zohoInvoiceGetProjectOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'message', label: 'Message' },
+ {
+ key: 'project',
+ label: 'Project',
+ children: [
+ ...projectFields,
+ { key: 'total_amount', label: 'Total Amount', format: 'currency' },
+ { key: 'billed_amount', label: 'Billed Amount', format: 'currency' },
+ { key: 'un_billed_amount', label: 'Unbilled Amount', format: 'currency' },
+ { key: 'billable_amount', label: 'Billable Amount', format: 'currency' },
+ { key: 'non_billable_amount', label: 'Non Billable Amount', format: 'currency' },
+ { key: 'task_custom_fields', label: 'Task Custom Fields' },
+ { key: 'rate', label: 'Rate', format: 'currency' },
+ { key: 'budget_hours', label: 'Budget Hours', format: 'number' },
+ { key: 'budget_hours_in_time', label: 'Budget Hours In Time' },
+ ],
+ },
+ ],
+};
+
+export const zohoInvoiceAddProjectCommentOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'message', label: 'Message' },
+ {
+ key: 'comment',
+ label: 'Comment',
+ children: [
+ ...commentFields,
+ { key: 'project_id', label: 'Project ID' },
+ { key: 'date_description', label: 'Date Description' },
+ { key: 'time', label: 'Time' },
+ ],
+ },
+ ],
+};
+
+export const zohoInvoiceListProjectCommentsOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'message', label: 'Message' },
+ {
+ key: 'comments',
+ label: 'Comments',
+ listItems: [
+ ...commentsFields,
+ { key: 'project_id', label: 'Project ID' },
+ { key: 'is_current_user', label: 'Is Current User', format: 'boolean' },
+ ],
+ },
+ {
+ key: 'page_context',
+ label: 'Page Context',
+ children: [
+ ...pageContextFields,
+ { key: 'project_name', label: 'Project Name' },
+ { key: 'sort_column', label: 'Sort Column' },
+ { key: 'sort_order', label: 'Sort Order' },
+ ],
+ },
+ ],
+};
+
+export const zohoInvoiceCreateEmployeeOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'message', label: 'Message' },
+ {
+ key: 'employee',
+ label: 'Employee',
+ children: [
+ { key: 'employee_id', label: 'Employee ID' },
+ { key: 'name', label: 'Name' },
+ { key: 'email', label: 'Email', format: 'email' },
+ ],
+ },
+ ],
+};
+
+export const zohoInvoiceListEmployeesOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'message', label: 'Message' },
+ {
+ key: 'employees',
+ label: 'Employees',
+ labelKey: 'name',
+ listItems: [
+ { key: 'employee_id', label: 'Employee ID' },
+ { key: 'name', label: 'Name' },
+ { key: 'email', label: 'Email', format: 'email' },
+ ],
+ },
+ {
+ key: 'page_context',
+ label: 'Page Context',
+ children: [
+ ...pageContextFields,
+ { key: 'applied_filter', label: 'Applied Filter' },
+ { key: 'sort_column', label: 'Sort Column' },
+ { key: 'sort_order', label: 'Sort Order' },
+ ],
+ },
+ ],
+};
+
+export const zohoInvoiceListProjectInvoicesOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'message', label: 'Message' },
+ { key: 'invoices', label: 'Invoices' },
+ {
+ key: 'page_context',
+ label: 'Page Context',
+ children: [
+ ...pageContextFields,
+ { key: 'project_name', label: 'Project Name' },
+ { key: 'sort_column', label: 'Sort Column' },
+ { key: 'sort_order', label: 'Sort Order' },
+ ],
+ },
+ ],
+};
+
+export const zohoInvoiceListProjectsOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'message', label: 'Message' },
+ {
+ key: 'projects',
+ label: 'Projects',
+ listItems: [
+ { key: 'project_id', label: 'Project ID' },
+ { key: 'project_name', label: 'Project Name' },
+ { key: 'project_code', label: 'Project Code' },
+ { key: 'customer_id', label: 'Customer ID' },
+ { key: 'customer_name', label: 'Customer Name' },
+ { key: 'description', label: 'Description' },
+ { key: 'status', label: 'Status' },
+ { key: 'billing_type', label: 'Billing Type' },
+ { key: 'rate', label: 'Rate', format: 'currency' },
+ { key: 'created_time', label: 'Created Time', format: 'datetime' },
+ { key: 'last_modified_time', label: 'Last Modified Time', format: 'datetime' },
+ { key: 'has_attachment', label: 'Has Attachment', format: 'boolean' },
+ { key: 'total_hours', label: 'Total Hours' },
+ { key: 'billable_hours', label: 'Billable Hours' },
+ { key: 'other_service_app_source', label: 'Other Service App Source' },
+ { key: 'users_working', label: 'Users Working', format: 'number' },
+ { key: 'custom_fields', label: 'Custom Fields' },
+ ],
+ },
+ {
+ key: 'page_context',
+ label: 'Page Context',
+ children: [
+ ...pageContextFields,
+ { key: 'applied_filter', label: 'Applied Filter' },
+ { key: 'custom_fields', label: 'Custom Fields' },
+ { key: 'sort_column', label: 'Sort Column' },
+ { key: 'sort_order', label: 'Sort Order' },
+ ],
+ },
+ ],
+};
+
+export const zohoInvoiceGetProjectUserOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'message', label: 'Message' },
+ {
+ key: 'user',
+ label: 'User',
+ children: [
+ ...userFields,
+ { key: 'project_id', label: 'Project ID' },
+ { key: 'is_current_user', label: 'Is Current User', format: 'boolean' },
+ { key: 'user_name', label: 'User Name' },
+ ],
+ },
+ ],
+};
+
+export const zohoInvoiceTimeEntryOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'message', label: 'Message' },
+ {
+ key: 'time_entry',
+ label: 'Time Entry',
+ children: [
+ { key: 'time_entry_id', label: 'Time Entry ID' },
+ { key: 'project_id', label: 'Project ID' },
+ { key: 'project_name', label: 'Project Name' },
+ { key: 'customer_id', label: 'Customer ID' },
+ { key: 'customer_name', label: 'Customer Name' },
+ { key: 'task_id', label: 'Task ID' },
+ { key: 'task_name', label: 'Task Name' },
+ { key: 'user_id', label: 'User ID' },
+ { key: 'user_name', label: 'User Name' },
+ { key: 'is_current_user', label: 'Is Current User', format: 'boolean' },
+ { key: 'log_date', label: 'Log Date', format: 'date' },
+ { key: 'begin_time', label: 'Begin Time' },
+ { key: 'end_time', label: 'End Time' },
+ { key: 'log_time', label: 'Log Time', format: 'duration' },
+ { key: 'logged_day', label: 'Logged Day', format: 'number' },
+ { key: 'is_billable', label: 'Is Billable', format: 'boolean' },
+ { key: 'billed_status', label: 'Billed Status' },
+ { key: 'invoice_id', label: 'Invoice ID' },
+ { key: 'notes', label: 'Notes' },
+ { key: 'is_paused', label: 'Is Paused', format: 'boolean' },
+ { key: 'timer_started_at', label: 'Timer Started At', format: 'datetime' },
+ {
+ key: 'timer_started_at_utc_time',
+ label: 'Timer Started At UTC Time',
+ format: 'datetime',
+ },
+ { key: 'timer_duration_in_minutes', label: 'Timer Duration In Minutes', format: 'number' },
+ { key: 'timer_duration_in_seconds', label: 'Timer Duration In Seconds', format: 'number' },
+ { key: 'created_time', label: 'Created Time', format: 'datetime' },
+ { key: 'timesheet_custom_fields', label: 'Timesheet Custom Fields' },
+ ],
+ },
+ ],
+};
+
+export const zohoInvoiceTaskOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'message', label: 'Message' },
+ {
+ key: 'task',
+ label: 'Task',
+ children: [
+ { key: 'project_id', label: 'Project ID' },
+ { key: 'project_name', label: 'Project Name' },
+ { key: 'task_id', label: 'Task ID' },
+ { key: 'task_name', label: 'Task Name' },
+ { key: 'description', label: 'Description' },
+ { key: 'rate', label: 'Rate', format: 'currency' },
+ { key: 'status', label: 'Status' },
+ { key: 'is_billable', label: 'Is Billable', format: 'boolean' },
+ { key: 'task_custom_fields', label: 'Task Custom Fields' },
+ ],
+ },
+ ],
+};
+
+export const zohoInvoiceListTasksOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'message', label: 'Message' },
+ {
+ key: 'task',
+ label: 'Task',
+ listItems: [
+ { key: 'project_id', label: 'Project ID' },
+ { key: 'task_id', label: 'Task ID' },
+ { key: 'currency_id', label: 'Currency ID' },
+ { key: 'customer_id', label: 'Customer ID' },
+ { key: 'task_name', label: 'Task Name' },
+ { key: 'description', label: 'Description' },
+ { key: 'project_name', label: 'Project Name' },
+ { key: 'customer_name', label: 'Customer Name' },
+ { key: 'billed_hours', label: 'Billed Hours' },
+ { key: 'log_time', label: 'Log Time', format: 'duration' },
+ { key: 'un_billed_hours', label: 'Unbilled Hours' },
+ { key: 'rate', label: 'Rate', format: 'currency' },
+ { key: 'status', label: 'Status' },
+ { key: 'is_billable', label: 'Is Billable', format: 'boolean' },
+ ],
+ },
+ {
+ key: 'page_context',
+ label: 'Page Context',
+ children: [
+ ...pageContextFields,
+ { key: 'project_name', label: 'Project Name' },
+ { key: 'custom_fields', label: 'Custom Fields' },
+ { key: 'sort_column', label: 'Sort Column' },
+ { key: 'sort_order', label: 'Sort Order' },
+ ],
+ },
+ ],
+};
+
+export const zohoInvoiceListTimeEntriesOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'message', label: 'Message' },
+ {
+ key: 'time_entries',
+ label: 'Time Entries',
+ listItems: [
+ { key: 'time_entry_id', label: 'Time Entry ID' },
+ { key: 'project_id', label: 'Project ID' },
+ { key: 'project_name', label: 'Project Name' },
+ { key: 'customer_id', label: 'Customer ID' },
+ { key: 'customer_first_name', label: 'Customer First Name' },
+ { key: 'customer_name', label: 'Customer Name' },
+ { key: 'task_id', label: 'Task ID' },
+ { key: 'task_name', label: 'Task Name' },
+ { key: 'user_id', label: 'User ID' },
+ { key: 'is_current_user', label: 'Is Current User', format: 'boolean' },
+ { key: 'user_name', label: 'User Name' },
+ { key: 'log_date', label: 'Log Date', format: 'date' },
+ { key: 'begin_time', label: 'Begin Time' },
+ { key: 'end_time', label: 'End Time' },
+ { key: 'log_time', label: 'Log Time', format: 'duration' },
+ { key: 'billing_rate_frequency', label: 'Billing Rate Frequency' },
+ { key: 'logged_day', label: 'Logged Day', format: 'number' },
+ { key: 'is_billable', label: 'Is Billable', format: 'boolean' },
+ { key: 'billed_status', label: 'Billed Status' },
+ { key: 'is_client_approval_needed', label: 'Is Client Approval Needed', format: 'boolean' },
+ { key: 'invoice_id', label: 'Invoice ID' },
+ { key: 'invoice_number', label: 'Invoice Number' },
+ { key: 'notes', label: 'Notes' },
+ { key: 'timer_started_at', label: 'Timer Started At', format: 'datetime' },
+ { key: 'is_paused', label: 'Is Paused', format: 'boolean' },
+ { key: 'timer_duration_in_minutes', label: 'Timer Duration In Minutes', format: 'number' },
+ { key: 'created_time', label: 'Created Time', format: 'datetime' },
+ ],
+ },
+ {
+ key: 'page_context',
+ label: 'Page Context',
+ children: [
+ ...pageContextFields,
+ { key: 'applied_filter', label: 'Applied Filter' },
+ { key: 'from_date', label: 'From Date', format: 'date' },
+ { key: 'to_date', label: 'To Date', format: 'date' },
+ { key: 'custom_fields', label: 'Custom Fields' },
+ { key: 'sort_column', label: 'Sort Column' },
+ { key: 'sort_order', label: 'Sort Order' },
+ ],
+ },
+ ],
+};
+
+export const zohoInvoiceListOrganizationsOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'message', label: 'Message' },
+ {
+ key: 'organizations',
+ label: 'Organizations',
+ labelKey: 'name',
+ listItems: [
+ { key: 'isOrgNotSupported', label: 'Is Org Not Supported', format: 'boolean' },
+ { key: 'organization_id', label: 'Organization ID' },
+ { key: 'name', label: 'Name' },
+ { key: 'org_alias_name', label: 'Org Alias Name' },
+ { key: 'contact_name', label: 'Contact Name' },
+ { key: 'email', label: 'Email', format: 'email' },
+ { key: 'source', label: 'Source', format: 'number' },
+ { key: 'country', label: 'Country' },
+ { key: 'country_code', label: 'Country Code' },
+ { key: 'org_settings', label: 'Org Settings', format: 'boolean' },
+ { key: 'custom_field_type', label: 'Custom Field Type', format: 'number' },
+ {
+ key: 'custom_fields',
+ label: 'Custom Fields',
+ labelKey: 'label',
+ listItems: customFieldsFields,
+ },
+ { key: 'is_sku_enabled', label: 'Is SKU Enabled', format: 'boolean' },
+ { key: 'phone', label: 'Phone' },
+ { key: 'org_type', label: 'Org Type' },
+ { key: 'state_code', label: 'State Code' },
+ { key: 'state', label: 'State' },
+ { key: 'zoho_one_org', label: 'Zoho One Org' },
+ { key: 'org_created_app_source', label: 'Org Created App Source', format: 'number' },
+ { key: 'is_solo_org', label: 'Is Solo Org', format: 'boolean' },
+ { key: 'partners_domain', label: 'Partners Domain' },
+ { key: 'version', label: 'Version' },
+ { key: 'is_search360_enabled', label: 'Is Search360 Enabled' },
+ {
+ key: 'is_sales_inclusive_tax_enabled',
+ label: 'Is Sales Inclusive Tax Enabled',
+ format: 'boolean',
+ },
+ { key: 'sales_tax_type', label: 'Sales Tax Type' },
+ { key: 'tax_group_enabled', label: 'Tax Group Enabled', format: 'boolean' },
+ { key: 'language_code', label: 'Language Code' },
+ { key: 'fiscal_year_start_month', label: 'Fiscal Year Start Month', format: 'number' },
+ { key: 'time_zone', label: 'Time Zone' },
+ { key: 'field_separator', label: 'Field Separator' },
+ { key: 'digital_signature_mode', label: 'Digital Signature Mode' },
+ { key: 'is_dsign_required', label: 'Is Dsign Required', format: 'boolean' },
+ { key: 'is_user_dsign_mandatory', label: 'Is User Dsign Mandatory', format: 'boolean' },
+ { key: 'currency_id', label: 'Currency ID' },
+ { key: 'currency_code', label: 'Currency Code' },
+ { key: 'currency_symbol', label: 'Currency Symbol' },
+ { key: 'currency_format', label: 'Currency Format' },
+ { key: 'price_precision', label: 'Price Precision', format: 'number' },
+ { key: 'org_joined_app_list', label: 'Org Joined App List' },
+ { key: 'is_designated_zone', label: 'Is Designated Zone', format: 'boolean' },
+ { key: 'is_free_zone', label: 'Is Free Zone', format: 'boolean' },
+ {
+ key: 'is_registered_for_composite_scheme',
+ label: 'Is Registered For Composite Scheme',
+ format: 'boolean',
+ },
+ {
+ key: 'is_sales_reverse_charge_enabled',
+ label: 'Is Sales Reverse Charge Enabled',
+ format: 'boolean',
+ },
+ {
+ key: 'is_export_with_payment_enabled',
+ label: 'Is Export With Payment Enabled',
+ format: 'boolean',
+ },
+ { key: 'is_registered_for_tax', label: 'Is Registered For Tax', format: 'boolean' },
+ { key: 'is_tax_registered', label: 'Is Tax Registered', format: 'boolean' },
+ {
+ key: 'is_international_trade_enabled',
+ label: 'Is International Trade Enabled',
+ format: 'boolean',
+ },
+ { key: 'is_gst_india_version', label: 'Is GST India Version', format: 'boolean' },
+ { key: 'is_registered_for_gst', label: 'Is Registered For GST', format: 'boolean' },
+ { key: 'is_multientity_org', label: 'Is Multientity Org', format: 'boolean' },
+ { key: 'is_multientity_enabled', label: 'Is Multientity Enabled', format: 'boolean' },
+ { key: 'isOrgActive', label: 'Is Org Active', format: 'boolean' },
+ { key: 'plan_type', label: 'Plan Type', format: 'number' },
+ { key: 'plan_name', label: 'Plan Name' },
+ { key: 'plan_period', label: 'Plan Period' },
+ { key: 'account_created_date', label: 'Account Created Date', format: 'date' },
+ { key: 'is_org_active', label: 'Is Org Active', format: 'boolean' },
+ { key: 'is_quick_setup_completed', label: 'Is Quick Setup Completed', format: 'boolean' },
+ { key: 'is_trial_period_extended', label: 'Is Trial Period Extended', format: 'boolean' },
+ {
+ key: 'is_invoice_pmt_tds_allowed',
+ label: 'Is Invoice Pmt TDS Allowed',
+ format: 'boolean',
+ },
+ { key: 'is_hsn_or_sac_enabled', label: 'Is HSN Or Sac Enabled', format: 'boolean' },
+ { key: 'is_location_enabled', label: 'Is Location Enabled', format: 'boolean' },
+ { key: 'mode', label: 'Mode' },
+ { key: 'other_active_services', label: 'Other Active Services' },
+ { key: 'is_last_active_service', label: 'Is Last Active Service', format: 'boolean' },
+ { key: 'support_email', label: 'Support Email', format: 'email' },
+ { key: 'is_user_last_admin', label: 'Is User Last Admin', format: 'boolean' },
+ { key: 'is_user_super_admin', label: 'Is User Super Admin', format: 'boolean' },
+ { key: 'user_status', label: 'User Status', format: 'number' },
+ { key: 'org_action', label: 'Org Action' },
+ { key: 'is_default_org', label: 'Is Default Org', format: 'boolean' },
+ { key: 'is_subscription_paused', label: 'Is Subscription Paused', format: 'boolean' },
+ ],
+ },
+ ],
+};
diff --git a/packages/pieces/community/zoho-invoice/src/lib/triggers/new-invoice.ts b/packages/pieces/community/zoho-invoice/src/lib/triggers/new-invoice.ts
index dee361a65c4..9d5000ab719 100644
--- a/packages/pieces/community/zoho-invoice/src/lib/triggers/new-invoice.ts
+++ b/packages/pieces/community/zoho-invoice/src/lib/triggers/new-invoice.ts
@@ -1,6 +1,5 @@
import {
AppConnectionValueForAuthProperty,
- PiecePropValueSchema,
TriggerStrategy,
createTrigger,
} from '@activepieces/pieces-framework';
@@ -10,34 +9,32 @@ import {
pollingHelper,
} from '@activepieces/pieces-common';
-import { common } from '../common';
-
import dayjs from 'dayjs';
-import { zohoAuth } from '../..';
+import { zohoInvoiceAuth } from '../auth';
+import { zohoInvoiceApi } from '../common/api';
+import { newInvoiceOutputSchema } from '../output-schemas';
const polling: Polling<
- AppConnectionValueForAuthProperty<typeof zohoAuth>,
+ AppConnectionValueForAuthProperty<typeof zohoInvoiceAuth>,
Record<string, never>
> = {
strategy: DedupeStrategy.TIMEBASED,
items: async ({ auth, lastFetchEpochMS }) => {
- const currentValues =
- (await common.getInvoices(auth, {
- createdSince: dayjs(lastFetchEpochMS).format('YYYY-MM-DD'),
- })) ?? [];
- const items = (currentValues as any[]).map(
- (item: { created_time: string }) => ({
- epochMilliSeconds: dayjs(item.created_time).valueOf(),
- data: item,
- })
- );
- return items;
+ const invoices = await zohoInvoiceApi.listInvoices({
+ auth,
+ lastModifiedAt: dayjs(lastFetchEpochMS).format('YYYY-MM-DD'),
+ });
+ return invoices.map((item) => ({
+ epochMilliSeconds: dayjs(item.created_time).valueOf(),
+ data: item,
+ }));
},
};
-export const newInvoice = createTrigger({
- auth: zohoAuth,
+export const newInvoiceTrigger = createTrigger({
+ auth: zohoInvoiceAuth,
name: 'new_invoice',
+ outputSchema: newInvoiceOutputSchema,
classification: 'READ',
displayName: 'New Invoice',
description: 'Trigger when a new invoice is received.',