{"id":21893774,"url":"https://github.com/goodwaygroup/intacct-api","last_synced_at":"2025-07-25T20:11:32.334Z","repository":{"id":13808696,"uuid":"73654440","full_name":"GoodwayGroup/intacct-api","owner":"GoodwayGroup","description":"Node.js library to interact with Intacct's XML API","archived":false,"fork":false,"pushed_at":"2022-12-06T16:28:31.000Z","size":680,"stargazers_count":5,"open_issues_count":12,"forks_count":6,"subscribers_count":16,"default_branch":"master","last_synced_at":"2024-04-14T12:30:21.994Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/GoodwayGroup.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}},"created_at":"2016-11-14T01:11:59.000Z","updated_at":"2023-06-01T22:48:51.000Z","dependencies_parsed_at":"2023-01-13T17:38:05.322Z","dependency_job_id":null,"html_url":"https://github.com/GoodwayGroup/intacct-api","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GoodwayGroup%2Fintacct-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GoodwayGroup%2Fintacct-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GoodwayGroup%2Fintacct-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GoodwayGroup%2Fintacct-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/GoodwayGroup","download_url":"https://codeload.github.com/GoodwayGroup/intacct-api/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249095218,"owners_count":21211887,"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":[],"created_at":"2024-11-28T13:16:40.632Z","updated_at":"2025-04-15T15:22:18.892Z","avatar_url":"https://github.com/GoodwayGroup.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# intacct-api\n\n[![CircleCI](https://img.shields.io/circleci/project/github/GoodwayGroup/intacct-api.svg)](https://circleci.com/gh/GoodwayGroup/intacct-api)\n[![Codecov](https://img.shields.io/codecov/c/github/GoodwayGroup/intacct-api.svg)](https://codecov.io/github/GoodwayGroup/intacct-api)\n\n## IntacctApi(options)\n\n### options\n\n* auth\n    * senderId\n    * senderPassword\n    * [sessionId] - required if missing userId\n    * [userId] - cannot be used with sessionId\n    * [companyId] - required if userId given\n    * [password] - required if userId given\n* [controlId] - defaults to v1 uuid\n* [uniqueId] - boolean\n* [dtdVersion] - defaults to '3.0'\n\n### .request(...controlFunctions)\n\nMake a request to Intacct's API to fulfill the given control functions. You can provide arrays of control functions via many arguments and/or single array. See the following examples:\n\n```javascript\nconst api = new IntacctApi({ ... });\n\nconst cid1 = api.inspect({ object: 'PROJECT' });\nconst cid2 = api.inspect({ object: 'VENDOR' });\n\n// With a single array\nconst singleArray = await api.request([cid1, cid2]);\n\n// With arguments\nconst withArgs = await api.request(cid1, cid2);\n\n// Mixed arguments\nconst mixedArgs = await api.request(cid1, [cid2]);\n```\n\n#### Request Result\n\nThere are a couple ways to retrieve the results from the control functions: 1) from the return of the `request` function call or 2) from the reference of the control function you passed into the `request` call.\n\n##### Invocation Return\n\n* functions - object hash of control functions keyed by control Function's control id\n* payload - converted payload from xml\n* rawPayload - raw payload string\n\n## ControlFunction Class\n\nIt's exported from the module as `ControlFunction`.\n\n### constructor(name, params = {}, controlId = null, parse = true)\n\nSets up a control function. It is recommended that you use one of the static factory methods.\n\n### .get([path])\n\nIf path is given, [hoek.reach](https://github.com/hapijs/hoek/blob/master/API.md#reachobj-chain-options) is used to retrieve the desired property. If path isn't given, the entire `this.data` variable is returned.\n```javascript\n// EXAMPLE using ARINVOICE\nconst cid1 = IntacctApi.readByQuery({ object: 'ARINVOICE', pagesize: 1 });\nconst result1 = await obj.request(cid1);\nlet invoices = cid1.get('arinvoice');\n```\n### .isSuccessful()\n\nReturns a boolean of the contextual control function's resulting success.\n\n### .assignControlId(controlId = null)\n\nAssigns or generates a control id. Caution to not duplicate control ids, duplicate id's will result in a thrown error.\n\n## Static Functions\n\nAll static functions return an instance of the ControlFunction class with the name defined by the static function's name. All static functions have the same signature: `(params, controlId = null, parse = true)`\n\nRefer to [Intacct's API Documentation](https://developer.intacct.com/api/) for how to understand the parameters needed to make these functions work.\n\n* .consolidate(...)\n* .create(...)\n* .delete(...)\n* .getAPISession(...)\n* .getUserPermissions(...)\n* .inspect(...)\n* .installApp(...)\n* .read(...)\n* .readByName(...)\n* .readByQuery(...)\n* .readMore(...)\n* .readRelated(...)\n* .readReport(...)\n* .readView(...)\n* .update(...)\n\n## Static Function: readMore\n\nThis static function is special in that, instead of passing a parameters object to it, you can pass it a successful ControlFunction. This is important because to paginate using Intacct's API, you have to pass it a cursor they understand. Passing the successful ControlFunction allows this function to properly construct a readMore control function for you to then request. See this example:\n\n```javascript\nconst cid1 = IntacctApi.readByQuery({ object: 'PROJECT', pagesize: 1 });\n\nconst result1 = await obj.request(cid1);\n\nconst cid2 = IntacctApi.readMore(cid1);\n\nconst result2 = await obj.request(cid2);\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgoodwaygroup%2Fintacct-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgoodwaygroup%2Fintacct-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgoodwaygroup%2Fintacct-api/lists"}