{"id":25642101,"url":"https://github.com/trieb-work/zoho-ts","last_synced_at":"2025-07-03T14:40:31.797Z","repository":{"id":38197363,"uuid":"364246283","full_name":"trieb-work/zoho-ts","owner":"trieb-work","description":"Zoho Inventory, Invoice and Books Typescript library with several predefined functions","archived":false,"fork":false,"pushed_at":"2024-05-21T07:17:48.000Z","size":849,"stargazers_count":15,"open_issues_count":2,"forks_count":5,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-06-14T07:44:17.185Z","etag":null,"topics":["typescript","zoho","zoho-books","zoho-inventory","zoho-invoice","zoho-one"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/trieb-work.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-05-04T12:19:27.000Z","updated_at":"2025-05-22T13:47:59.000Z","dependencies_parsed_at":"2024-06-12T15:43:09.991Z","dependency_job_id":"13dddbe1-ec61-47fe-b116-c962fda19600","html_url":"https://github.com/trieb-work/zoho-ts","commit_stats":{"total_commits":395,"total_committers":6,"mean_commits":65.83333333333333,"dds":"0.25063291139240507","last_synced_commit":"51946ec7006c780ae4050101dca34e632a12dafe"},"previous_names":[],"tags_count":104,"template":false,"template_full_name":null,"purl":"pkg:github/trieb-work/zoho-ts","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trieb-work%2Fzoho-ts","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trieb-work%2Fzoho-ts/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trieb-work%2Fzoho-ts/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trieb-work%2Fzoho-ts/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/trieb-work","download_url":"https://codeload.github.com/trieb-work/zoho-ts/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trieb-work%2Fzoho-ts/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263343165,"owners_count":23452120,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["typescript","zoho","zoho-books","zoho-inventory","zoho-invoice","zoho-one"],"created_at":"2025-02-23T05:18:39.465Z","updated_at":"2025-07-03T14:40:31.765Z","avatar_url":"https://github.com/trieb-work.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![npm version](https://badge.fury.io/js/@trieb.work%2Fzoho-ts.svg)](https://badge.fury.io/js/@trieb.work%2Fzoho-ts)\n\n# Zoho TS\n\nA typescript / node.js library used to work with Zoho Finance Suite APIs:  Zoho Inventory, Zoho Books and Zoho Invoice.\nThese APIs are for most entities the same, apart from some specific functions.  \nThere are several functions already created, but in the end they are all custom. Some of them are documented and some are reverse-engineered and implemented in this library to have an optimised, easy way working with the Zoho APIs.\n\nAll entities are fully typed.\n\n\n## Installation\n```\nyarn add @trieb.work/zoho-ts\n```\n```\nnpm i @trieb.work/zoho-ts\n```\n```\npnpm i @trieb.work/zoho-ts\n```\n\n## Usage on server\nMake sure to select the correct datacenter for your API client credentials: e.g. \".com\" or \".eu\".\nYou can also select, which API endpoint to use - Zoho Books, Zoho Invoice or Zoho Inventory. Most API endpoints are the same\nand work the same. You just need to select the product, that you have licensed. \n\n\n```\nimport { Zoho, ZohoApiClient } from \"@trieb.work/zoho-ts\";\n\nconst zoho = new Zoho(\n    await ZohoApiClient.fromOAuth({\n      orgId: \"243546\",\n      dc: \".com\",\n      apiFlavour: \"invoice\",\n      scope: \"ZohoInvoice.fullaccess.all\"\n      client: {\n        id: \"\",\n        secret: \"\",\n      },\n    }),\n  );\n\n```\n\nYou can decide, which API to use - Zoho Inventory, Zoho Books, Zoho Invoice. Currently, you can only decide per instance. It is planned \nto make it possible to decide which API to use on function level.\n\n### Authentication with OAuth\nThe library on the server should be used with a client ID and a client secret, that you can register at the developer console: https://api-console.zoho.eu/ (Self Client)\n\n\n## Usage in Browser Context (use cookies for auth)\nThe library can run in the browser as well (for example with browser extensions)\n\n```\nimport { Zoho, ZohoApiClient } from \"@trieb.work/zoho-ts\";\n\nconst zoho = new Zoho(\n    await ZohoApiClient.fromCookies({ \n        orgId: \"\",\n        cookie: \"\",\n        zsrfToken: \"\"\n    }),\n  );\n\n```\n\n## Implemented entities\n|Entity|Functions|\n|---|---|\n|bankaccount|`list`|\n|contact|`create`, `get`, `update`, `delete`, `list`, `addAddress`,`updateAddress`, `listContactPersons`|\n|contactperson|`create`, `get`, `delete`, `list`|\n|invoice|`create`, `get`, `delete`, `list`, `createFromSalesOrder`, `sent`|\n|item|`create`, `get`, `delete`, `list`, `createGroup`, `deleteGroup`, `getComposite`|\n|organizations|`list`|\n|package|`create`, `get`, `delete`, `list`,`bulkCreateQuickShipment`, `createShipment`, `markDelivered`, `deleteShipmentOrder`|\n|payment|`create`, `get`, `delete`, `list`|\n|salesorder|`create`, `get`, `delete`, `list`, `update`, `confirm`, `markVoid`, `setCustomFieldValue`, `search`|\n|tax|`list`|\n|warehouse|`get`, `list`|\n\nUsage example:\n```\nimport { Zoho, ZohoApiClient } from \"@trieb.work/zoho-ts\";\n\nconst zoho = new Zoho(\n    await ZohoApiClient.fromOAuth({\n      orgId: \"243546\",\n      dc: \".com\",\n      client: {\n        id: \"\",\n        secret: \"\",\n      },\n    }),\n  );\n\n/// Get all payments that were modified in the last hour\nconst payments = await zoho.payment.list({\n    lastModifiedTime: subHours(new Date(), 1),\n})  \n```\n\n## Error Handling\nThe library includes a custom error type, that you can use to handle the from Zoho returned error type:\n```\ntry {\n  \n  await zoho.invoice.createFromSalesOrder(id)\n\n} catch(err) {\n  if ((err as ZohoApiError).code === 36026) {\n    console.warn(\n      \"Aborting sync of this invoice since it was already created. Original Error: \" +\n        err.message,\n    );\n  } else {\n    console.error(err.message);\n  }\n}\n\n```          \n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftrieb-work%2Fzoho-ts","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftrieb-work%2Fzoho-ts","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftrieb-work%2Fzoho-ts/lists"}