{"_id":"@codat/sync-for-payables-version-1","_rev":"3-8960481438e859b6f130f5e20a96c918","name":"@codat/sync-for-payables-version-1","dist-tags":{"latest":"2.4.0"},"versions":{"2.3.0":{"name":"@codat/sync-for-payables-version-1","version":"2.3.0","author":{"name":"Codat"},"_id":"@codat/sync-for-payables-version-1@2.3.0","maintainers":[{"name":"mcclowes","email":"contact@mcclowes.com"},{"name":"codat-engineer","email":"eng-leadership@codat.io"}],"homepage":"https://github.com/codatio/client-sdk-typescript#readme","bugs":{"url":"https://github.com/codatio/client-sdk-typescript/issues"},"dist":{"shasum":"7c23dfd607fd365265ad0b50e72fa5bb150e935f","tarball":"https://registry.npmjs.org/@codat/sync-for-payables-version-1/-/sync-for-payables-version-1-2.3.0.tgz","fileCount":1494,"integrity":"sha512-rudksTqWgMnGio6hAcmEZlN731Ww8iaf3krYHQTsDO/tSdMB+82/C2oYDoWtcokIb6nl2IFXs0umdXMLYVrzCg==","signatures":[{"sig":"MEQCIEN3R9BlN4uuCGGtNvdFOO6L5kw39Xahzobqfuibc8rHAiAab7ozaWGziScXae5SuSasV+ETCHOZoz9gKx0uu7L4Wg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":4605126},"main":"./index.js","types":"./index.d.ts","gitHead":"0634fc3af4847b55e48339f0792de550db8534f1","scripts":{"lint":"eslint --max-warnings=0 src","build":"tsc","prepublishOnly":"npm run build"},"_npmUser":{"name":"mcclowes","email":"contact@mcclowes.com"},"repository":{"url":"git+https://github.com/codatio/client-sdk-typescript.git","type":"git","directory":"previous-versions/sync-for-payables-version-1"},"_npmVersion":"8.19.4","description":"<!-- Start Codat Library Description --> Streamline your customers' accounts payable workflow. <!-- End Codat Library Description -->","directories":{},"sideEffects":false,"_nodeVersion":"16.20.2","dependencies":{"decimal.js":"^10.4.3"},"_hasShrinkwrap":false,"devDependencies":{"zod":"^3.23.4","eslint":"^8.57.0","typescript":"^5.4.5","@types/node":"^18.19.3","eslint-plugin-import":"^2.29.1","@typescript-eslint/parser":"^7.7.1","@typescript-eslint/eslint-plugin":"^7.7.1","eslint-import-resolver-typescript":"^3.6.1"},"peerDependencies":{"zod":">= 3"},"_npmOperationalInternal":{"tmp":"tmp/sync-for-payables-version-1_2.3.0_1726243109691_0.00204976967543935","host":"s3://npm-registry-packages"}},"2.4.0":{"name":"@codat/sync-for-payables-version-1","version":"2.4.0","author":{"name":"Codat"},"main":"./index.js","sideEffects":false,"repository":{"type":"git","url":"git+https://github.com/codatio/client-sdk-typescript.git","directory":"previous-versions/sync-for-payables-version-1"},"scripts":{"lint":"eslint --cache --max-warnings=0 src","build":"tsc","prepublishOnly":"npm run build"},"peerDependencies":{},"devDependencies":{"@eslint/js":"^9.19.0","eslint":"^9.19.0","globals":"^15.14.0","typescript":"~5.8.3","typescript-eslint":"^8.26.0"},"dependencies":{"decimal.js":"^10.4.3","zod":"^3.25.0 || ^4.0.0"},"gitHead":"9b643557291480abf94d4d2b68a896ea0ad8a24a","types":"./index.d.ts","_id":"@codat/sync-for-payables-version-1@2.4.0","description":"<!-- Start Codat Library Description --> Streamline your customers' accounts payable workflow. <!-- End Codat Library Description -->","bugs":{"url":"https://github.com/codatio/client-sdk-typescript/issues"},"homepage":"https://github.com/codatio/client-sdk-typescript#readme","_nodeVersion":"24.12.0","_npmVersion":"11.6.2","dist":{"integrity":"sha512-XGkoppLxjxUGswSKuDnH11MjB70HmRchADzDKw7VB6th6heR+dqt9jnz733ho1kafmUVlJbiofqXPHXZeLKt7w==","shasum":"5c1d4434be61ab39bab7fc98ec65d1e812abf9ca","tarball":"https://registry.npmjs.org/@codat/sync-for-payables-version-1/-/sync-for-payables-version-1-2.4.0.tgz","fileCount":1504,"unpackedSize":3824275,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIG6R2SpfwofM5bkCvZSE36Ajke7zxhSFnyxB7pjkd3AIAiEA4yVXwOLHLTwOGhsM+2pxqd6LwYPfRZLzf55rY/dfcFY="}]},"_npmUser":{"name":"codat-engineer","email":"eng-leadership@codat.io"},"directories":{},"maintainers":[{"name":"codat-engineer","email":"eng-leadership@codat.io"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/sync-for-payables-version-1_2.4.0_1767951012408_0.8347471006981799"},"_hasShrinkwrap":false}},"time":{"created":"2024-09-13T15:58:29.563Z","modified":"2026-01-09T09:30:12.861Z","2.3.0":"2024-09-13T15:58:29.953Z","2.4.0":"2026-01-09T09:30:12.622Z"},"bugs":{"url":"https://github.com/codatio/client-sdk-typescript/issues"},"author":{"name":"Codat"},"homepage":"https://github.com/codatio/client-sdk-typescript#readme","repository":{"type":"git","url":"git+https://github.com/codatio/client-sdk-typescript.git","directory":"previous-versions/sync-for-payables-version-1"},"description":"<!-- Start Codat Library Description --> Streamline your customers' accounts payable workflow. <!-- End Codat Library Description -->","maintainers":[{"name":"codat-engineer","email":"eng-leadership@codat.io"}],"readme":"# Sync for Payables\n\n<!-- Start Codat Library Description -->\nStreamline your customers' accounts payable workflow.\n<!-- End Codat Library Description -->\n\n<!-- Start Summary [summary] -->\n## Summary\n\nSync for Payables: The API for asynchronous Bill Pay solution. \n\nAsynchronous Bill Pay solution is an API and a set of supporting tools built to help integrate with your customers' accounting software, and keep their supplier information, invoices, and payments in sync.\n\n[Explore solution](https://docs.codat.io/payables/overview) | [See OpenAPI spec](https://github.com/codatio/oas)\n\n---\n<!-- Start Codat Tags Table -->\n## Endpoints\n\n| Endpoints | Description |\n| :- |:- |\n| Companies | Create and manage your SMB users' companies. |\n| Connections | Create new and manage existing data connections for a company. |\n| Accounts | Get, create, and update Accounts. |\n| Bank accounts | Get, create, and update Bank accounts. |\n| Bills | Get, create, and update Bills. |\n| Bill credit notes | Get, create, and update Bill credit notes. |\n| Bill payments | Get, create, and update Bill payments. |\n| Journals | Get, create, and update Journals. |\n| Journal entries | Get, create, and update Journal entries. |\n| Payment methods | Get, create, and update Payment methods. |\n| Suppliers | Get, create, and update Suppliers. |\n| Tax rates | Get, create, and update Tax rates. |\n| Tracking categories | Get, create, and update Tracking categories. |\n| Company info | View company profile from the source platform. |\n| Push operations | View historic push operations. |\n| Manage data | Control how data is retrieved from an integration. |\n<!-- End Codat Tags Table -->\n<!-- End Summary [summary] -->\n\n<!-- Start Table of Contents [toc] -->\n## Table of Contents\n<!-- $toc-max-depth=2 -->\n* [Sync for Payables](#sync-for-payables)\n  * [Endpoints](#endpoints)\n  * [SDK Installation](#sdk-installation)\n  * [Example Usage](#example-usage)\n  * [Requirements](#requirements)\n  * [SDK Example Usage](#sdk-example-usage)\n  * [Available Resources and Operations](#available-resources-and-operations)\n  * [Standalone functions](#standalone-functions)\n  * [File uploads](#file-uploads)\n  * [Retries](#retries)\n  * [Error Handling](#error-handling)\n  * [Server Selection](#server-selection)\n  * [Custom HTTP Client](#custom-http-client)\n  * [Authentication](#authentication)\n  * [Debugging](#debugging)\n  * [Support](#support)\n\n<!-- End Table of Contents [toc] -->\n\n<!-- Start SDK Installation [installation] -->\n## SDK Installation\n\nThe SDK can be installed with either [npm](https://www.npmjs.com/), [pnpm](https://pnpm.io/), [bun](https://bun.sh/) or [yarn](https://classic.yarnpkg.com/en/) package managers.\n\n### NPM\n\n```bash\nnpm add @codat/sync-for-payables-version-1\n```\n\n### PNPM\n\n```bash\npnpm add @codat/sync-for-payables-version-1\n```\n\n### Bun\n\n```bash\nbun add @codat/sync-for-payables-version-1\n```\n\n### Yarn\n\n```bash\nyarn add @codat/sync-for-payables-version-1\n```\n<!-- End SDK Installation [installation] -->\n\n## Example Usage\n<!-- Start Requirements [requirements] -->\n## Requirements\n\nFor supported JavaScript runtimes, please consult [RUNTIMES.md](RUNTIMES.md).\n<!-- End Requirements [requirements] -->\n\n<!-- Start SDK Example Usage [usage] -->\n## SDK Example Usage\n\n### Example\n\n```typescript\nimport { CodatSyncPayables } from \"@codat/sync-for-payables-version-1\";\n\nconst codatSyncPayables = new CodatSyncPayables({\n  authHeader: \"Basic BASE_64_ENCODED(API_KEY)\",\n});\n\nasync function run() {\n  const result = await codatSyncPayables.companies.list({\n    query: \"id=e3334455-1aed-4e71-ab43-6bccf12092ee\",\n    orderBy: \"-modifiedDate\",\n    tags: \"region=uk && team=invoice-finance\",\n  });\n\n  console.log(result);\n}\n\nrun();\n\n```\n<!-- End SDK Example Usage [usage] -->\n\n<!-- Start Available Resources and Operations [operations] -->\n## Available Resources and Operations\n\n<details open>\n<summary>Available methods</summary>\n\n### [accounts](docs/sdks/accounts/README.md)\n\n* [list](docs/sdks/accounts/README.md#list) - List accounts\n* [get](docs/sdks/accounts/README.md#get) - Get account\n* [getCreateModel](docs/sdks/accounts/README.md#getcreatemodel) - Get create account model\n* [create](docs/sdks/accounts/README.md#create) - Create account\n\n### [bankAccounts](docs/sdks/bankaccounts/README.md)\n\n* [getCreateModel](docs/sdks/bankaccounts/README.md#getcreatemodel) - Get create/update bank account model\n* [create](docs/sdks/bankaccounts/README.md#create) - Create bank account\n\n### [billCreditNotes](docs/sdks/billcreditnotes/README.md)\n\n* [list](docs/sdks/billcreditnotes/README.md#list) - List bill credit notes\n* [get](docs/sdks/billcreditnotes/README.md#get) - Get bill credit note\n* [getCreateUpdateModel](docs/sdks/billcreditnotes/README.md#getcreateupdatemodel) - Get create/update bill credit note model\n* [create](docs/sdks/billcreditnotes/README.md#create) - Create bill credit note\n* [update](docs/sdks/billcreditnotes/README.md#update) - Update bill credit note\n\n### [billPayments](docs/sdks/billpayments/README.md)\n\n* [list](docs/sdks/billpayments/README.md#list) - List bill payments\n* [get](docs/sdks/billpayments/README.md#get) - Get bill payment\n* [delete](docs/sdks/billpayments/README.md#delete) - Delete bill payment\n* [getCreateModel](docs/sdks/billpayments/README.md#getcreatemodel) - Get create bill payment model\n* [create](docs/sdks/billpayments/README.md#create) - Create bill payments\n\n### [bills](docs/sdks/bills/README.md)\n\n* [list](docs/sdks/bills/README.md#list) - List bills\n* [get](docs/sdks/bills/README.md#get) - Get bill\n* [getCreateUpdateModel](docs/sdks/bills/README.md#getcreateupdatemodel) - Get create/update bill model\n* [create](docs/sdks/bills/README.md#create) - Create bill\n* [update](docs/sdks/bills/README.md#update) - Update bill\n* [delete](docs/sdks/bills/README.md#delete) - Delete bill\n* [listAttachments](docs/sdks/bills/README.md#listattachments) - List bill attachments\n* [getAttachment](docs/sdks/bills/README.md#getattachment) - Get bill attachment\n* [deleteAttachment](docs/sdks/bills/README.md#deleteattachment) - Delete bill attachment\n* [downloadAttachment](docs/sdks/bills/README.md#downloadattachment) - Download bill attachment\n* [uploadAttachment](docs/sdks/bills/README.md#uploadattachment) - Upload bill attachment\n\n### [companies](docs/sdks/companies/README.md)\n\n* [list](docs/sdks/companies/README.md#list) - List companies\n* [create](docs/sdks/companies/README.md#create) - Create company\n* [replace](docs/sdks/companies/README.md#replace) - Replace company\n* [update](docs/sdks/companies/README.md#update) - Update company\n* [delete](docs/sdks/companies/README.md#delete) - Delete a company\n* [get](docs/sdks/companies/README.md#get) - Get company\n\n### [companyInfo](docs/sdks/companyinfo/README.md)\n\n* [getAccountingProfile](docs/sdks/companyinfo/README.md#getaccountingprofile) - Get company accounting profile\n\n### [connections](docs/sdks/connections/README.md)\n\n* [list](docs/sdks/connections/README.md#list) - List connections\n* [create](docs/sdks/connections/README.md#create) - Create connection\n* [get](docs/sdks/connections/README.md#get) - Get connection\n* [delete](docs/sdks/connections/README.md#delete) - Delete connection\n* [unlink](docs/sdks/connections/README.md#unlink) - Unlink connection\n\n### [journalEntries](docs/sdks/journalentries/README.md)\n\n* [getCreateModel](docs/sdks/journalentries/README.md#getcreatemodel) - Get create journal entry model\n* [create](docs/sdks/journalentries/README.md#create) - Create journal entry\n\n### [journals](docs/sdks/journals/README.md)\n\n* [list](docs/sdks/journals/README.md#list) - List journals\n* [get](docs/sdks/journals/README.md#get) - Get journal\n* [getCreateModel](docs/sdks/journals/README.md#getcreatemodel) - Get create journal model\n* [create](docs/sdks/journals/README.md#create) - Create journal\n\n### [manageData](docs/sdks/managedata/README.md)\n\n* [refreshAllDataTypes](docs/sdks/managedata/README.md#refreshalldatatypes) - Refresh all data\n* [get](docs/sdks/managedata/README.md#get) - Get data status\n* [refreshDataType](docs/sdks/managedata/README.md#refreshdatatype) - Refresh data type\n* [listPullOperations](docs/sdks/managedata/README.md#listpulloperations) - List pull operations\n* [getPullOperation](docs/sdks/managedata/README.md#getpulloperation) - Get pull operation\n\n### [paymentMethods](docs/sdks/paymentmethods/README.md)\n\n* [list](docs/sdks/paymentmethods/README.md#list) - List payment methods\n* [get](docs/sdks/paymentmethods/README.md#get) - Get payment method\n\n### [pushOperations](docs/sdks/pushoperations/README.md)\n\n* [list](docs/sdks/pushoperations/README.md#list) - List push operations\n* [get](docs/sdks/pushoperations/README.md#get) - Get push operation\n\n### [suppliers](docs/sdks/suppliers/README.md)\n\n* [list](docs/sdks/suppliers/README.md#list) - List suppliers\n* [get](docs/sdks/suppliers/README.md#get) - Get supplier\n* [getCreateUpdateModel](docs/sdks/suppliers/README.md#getcreateupdatemodel) - Get create/update supplier model\n* [create](docs/sdks/suppliers/README.md#create) - Create supplier\n* [update](docs/sdks/suppliers/README.md#update) - Update supplier\n\n### [taxRates](docs/sdks/taxrates/README.md)\n\n* [list](docs/sdks/taxrates/README.md#list) - List all tax rates\n* [get](docs/sdks/taxrates/README.md#get) - Get tax rate\n\n### [trackingCategories](docs/sdks/trackingcategories/README.md)\n\n* [list](docs/sdks/trackingcategories/README.md#list) - List tracking categories\n* [get](docs/sdks/trackingcategories/README.md#get) - Get tracking categories\n\n</details>\n<!-- End Available Resources and Operations [operations] -->\n\n\n\n\n\n<!-- Start Standalone functions [standalone-funcs] -->\n## Standalone functions\n\nAll the methods listed above are available as standalone functions. These\nfunctions are ideal for use in applications running in the browser, serverless\nruntimes or other environments where application bundle size is a primary\nconcern. When using a bundler to build your application, all unused\nfunctionality will be either excluded from the final bundle or tree-shaken away.\n\nTo read more about standalone functions, check [FUNCTIONS.md](./FUNCTIONS.md).\n\n<details>\n\n<summary>Available standalone functions</summary>\n\n- [`accountsCreate`](docs/sdks/accounts/README.md#create) - Create account\n- [`accountsGet`](docs/sdks/accounts/README.md#get) - Get account\n- [`accountsGetCreateModel`](docs/sdks/accounts/README.md#getcreatemodel) - Get create account model\n- [`accountsList`](docs/sdks/accounts/README.md#list) - List accounts\n- [`bankAccountsCreate`](docs/sdks/bankaccounts/README.md#create) - Create bank account\n- [`bankAccountsGetCreateModel`](docs/sdks/bankaccounts/README.md#getcreatemodel) - Get create/update bank account model\n- [`billCreditNotesCreate`](docs/sdks/billcreditnotes/README.md#create) - Create bill credit note\n- [`billCreditNotesGet`](docs/sdks/billcreditnotes/README.md#get) - Get bill credit note\n- [`billCreditNotesGetCreateUpdateModel`](docs/sdks/billcreditnotes/README.md#getcreateupdatemodel) - Get create/update bill credit note model\n- [`billCreditNotesList`](docs/sdks/billcreditnotes/README.md#list) - List bill credit notes\n- [`billCreditNotesUpdate`](docs/sdks/billcreditnotes/README.md#update) - Update bill credit note\n- [`billPaymentsCreate`](docs/sdks/billpayments/README.md#create) - Create bill payments\n- [`billPaymentsDelete`](docs/sdks/billpayments/README.md#delete) - Delete bill payment\n- [`billPaymentsGet`](docs/sdks/billpayments/README.md#get) - Get bill payment\n- [`billPaymentsGetCreateModel`](docs/sdks/billpayments/README.md#getcreatemodel) - Get create bill payment model\n- [`billPaymentsList`](docs/sdks/billpayments/README.md#list) - List bill payments\n- [`billsCreate`](docs/sdks/bills/README.md#create) - Create bill\n- [`billsDelete`](docs/sdks/bills/README.md#delete) - Delete bill\n- [`billsDeleteAttachment`](docs/sdks/bills/README.md#deleteattachment) - Delete bill attachment\n- [`billsDownloadAttachment`](docs/sdks/bills/README.md#downloadattachment) - Download bill attachment\n- [`billsGet`](docs/sdks/bills/README.md#get) - Get bill\n- [`billsGetAttachment`](docs/sdks/bills/README.md#getattachment) - Get bill attachment\n- [`billsGetCreateUpdateModel`](docs/sdks/bills/README.md#getcreateupdatemodel) - Get create/update bill model\n- [`billsList`](docs/sdks/bills/README.md#list) - List bills\n- [`billsListAttachments`](docs/sdks/bills/README.md#listattachments) - List bill attachments\n- [`billsUpdate`](docs/sdks/bills/README.md#update) - Update bill\n- [`billsUploadAttachment`](docs/sdks/bills/README.md#uploadattachment) - Upload bill attachment\n- [`companiesCreate`](docs/sdks/companies/README.md#create) - Create company\n- [`companiesDelete`](docs/sdks/companies/README.md#delete) - Delete a company\n- [`companiesGet`](docs/sdks/companies/README.md#get) - Get company\n- [`companiesList`](docs/sdks/companies/README.md#list) - List companies\n- [`companiesReplace`](docs/sdks/companies/README.md#replace) - Replace company\n- [`companiesUpdate`](docs/sdks/companies/README.md#update) - Update company\n- [`companyInfoGetAccountingProfile`](docs/sdks/companyinfo/README.md#getaccountingprofile) - Get company accounting profile\n- [`connectionsCreate`](docs/sdks/connections/README.md#create) - Create connection\n- [`connectionsDelete`](docs/sdks/connections/README.md#delete) - Delete connection\n- [`connectionsGet`](docs/sdks/connections/README.md#get) - Get connection\n- [`connectionsList`](docs/sdks/connections/README.md#list) - List connections\n- [`connectionsUnlink`](docs/sdks/connections/README.md#unlink) - Unlink connection\n- [`journalEntriesCreate`](docs/sdks/journalentries/README.md#create) - Create journal entry\n- [`journalEntriesGetCreateModel`](docs/sdks/journalentries/README.md#getcreatemodel) - Get create journal entry model\n- [`journalsCreate`](docs/sdks/journals/README.md#create) - Create journal\n- [`journalsGet`](docs/sdks/journals/README.md#get) - Get journal\n- [`journalsGetCreateModel`](docs/sdks/journals/README.md#getcreatemodel) - Get create journal model\n- [`journalsList`](docs/sdks/journals/README.md#list) - List journals\n- [`manageDataGet`](docs/sdks/managedata/README.md#get) - Get data status\n- [`manageDataGetPullOperation`](docs/sdks/managedata/README.md#getpulloperation) - Get pull operation\n- [`manageDataListPullOperations`](docs/sdks/managedata/README.md#listpulloperations) - List pull operations\n- [`manageDataRefreshAllDataTypes`](docs/sdks/managedata/README.md#refreshalldatatypes) - Refresh all data\n- [`manageDataRefreshDataType`](docs/sdks/managedata/README.md#refreshdatatype) - Refresh data type\n- [`paymentMethodsGet`](docs/sdks/paymentmethods/README.md#get) - Get payment method\n- [`paymentMethodsList`](docs/sdks/paymentmethods/README.md#list) - List payment methods\n- [`pushOperationsGet`](docs/sdks/pushoperations/README.md#get) - Get push operation\n- [`pushOperationsList`](docs/sdks/pushoperations/README.md#list) - List push operations\n- [`suppliersCreate`](docs/sdks/suppliers/README.md#create) - Create supplier\n- [`suppliersGet`](docs/sdks/suppliers/README.md#get) - Get supplier\n- [`suppliersGetCreateUpdateModel`](docs/sdks/suppliers/README.md#getcreateupdatemodel) - Get create/update supplier model\n- [`suppliersList`](docs/sdks/suppliers/README.md#list) - List suppliers\n- [`suppliersUpdate`](docs/sdks/suppliers/README.md#update) - Update supplier\n- [`taxRatesGet`](docs/sdks/taxrates/README.md#get) - Get tax rate\n- [`taxRatesList`](docs/sdks/taxrates/README.md#list) - List all tax rates\n- [`trackingCategoriesGet`](docs/sdks/trackingcategories/README.md#get) - Get tracking categories\n- [`trackingCategoriesList`](docs/sdks/trackingcategories/README.md#list) - List tracking categories\n\n</details>\n<!-- End Standalone functions [standalone-funcs] -->\n\n<!-- Start File uploads [file-upload] -->\n## File uploads\n\nCertain SDK methods accept files as part of a multi-part request. It is possible and typically recommended to upload files as a stream rather than reading the entire contents into memory. This avoids excessive memory consumption and potentially crashing with out-of-memory errors when working with very large files. The following example demonstrates how to attach a file stream to a request.\n\n> [!TIP]\n>\n> Depending on your JavaScript runtime, there are convenient utilities that return a handle to a file without reading the entire contents into memory:\n>\n> - **Node.js v20+:** Since v20, Node.js comes with a native `openAsBlob` function in [`node:fs`](https://nodejs.org/docs/latest-v20.x/api/fs.html#fsopenasblobpath-options).\n> - **Bun:** The native [`Bun.file`](https://bun.sh/docs/api/file-io#reading-files-bun-file) function produces a file handle that can be used for streaming file uploads.\n> - **Browsers:** All supported browsers return an instance to a [`File`](https://developer.mozilla.org/en-US/docs/Web/API/File) when reading the value from an `<input type=\"file\">` element.\n> - **Node.js v18:** A file stream can be created using the `fileFrom` helper from [`fetch-blob/from.js`](https://www.npmjs.com/package/fetch-blob).\n\n```typescript\nimport { CodatSyncPayables } from \"@codat/sync-for-payables-version-1\";\n\nconst codatSyncPayables = new CodatSyncPayables({\n  authHeader: \"Basic BASE_64_ENCODED(API_KEY)\",\n});\n\nasync function run() {\n  await codatSyncPayables.bills.uploadAttachment({\n    companyId: \"8a210b68-6988-11ed-a1eb-0242ac120002\",\n    connectionId: \"2e9d2c44-f675-40ba-8049-353bfcb5e171\",\n    billId: \"13d946f0-c5d5-42bc-b092-97ece17923ab\",\n  });\n}\n\nrun();\n\n```\n<!-- End File uploads [file-upload] -->\n\n<!-- Start Retries [retries] -->\n## Retries\n\nSome of the endpoints in this SDK support retries.  If you use the SDK without any configuration, it will fall back to the default retry strategy provided by the API.  However, the default retry strategy can be overridden on a per-operation basis, or across the entire SDK.\n\nTo change the default retry strategy for a single API call, simply provide a retryConfig object to the call:\n```typescript\nimport { CodatSyncPayables } from \"@codat/sync-for-payables-version-1\";\n\nconst codatSyncPayables = new CodatSyncPayables({\n  authHeader: \"Basic BASE_64_ENCODED(API_KEY)\",\n});\n\nasync function run() {\n  const result = await codatSyncPayables.companies.list({\n    query: \"id=e3334455-1aed-4e71-ab43-6bccf12092ee\",\n    orderBy: \"-modifiedDate\",\n    tags: \"region=uk && team=invoice-finance\",\n  }, {\n    retries: {\n      strategy: \"backoff\",\n      backoff: {\n        initialInterval: 1,\n        maxInterval: 50,\n        exponent: 1.1,\n        maxElapsedTime: 100,\n      },\n      retryConnectionErrors: false,\n    },\n  });\n\n  console.log(result);\n}\n\nrun();\n\n```\n\nIf you'd like to override the default retry strategy for all operations that support retries, you can provide a retryConfig at SDK initialization:\n```typescript\nimport { CodatSyncPayables } from \"@codat/sync-for-payables-version-1\";\n\nconst codatSyncPayables = new CodatSyncPayables({\n  retryConfig: {\n    strategy: \"backoff\",\n    backoff: {\n      initialInterval: 1,\n      maxInterval: 50,\n      exponent: 1.1,\n      maxElapsedTime: 100,\n    },\n    retryConnectionErrors: false,\n  },\n  authHeader: \"Basic BASE_64_ENCODED(API_KEY)\",\n});\n\nasync function run() {\n  const result = await codatSyncPayables.companies.list({\n    query: \"id=e3334455-1aed-4e71-ab43-6bccf12092ee\",\n    orderBy: \"-modifiedDate\",\n    tags: \"region=uk && team=invoice-finance\",\n  });\n\n  console.log(result);\n}\n\nrun();\n\n```\n<!-- End Retries [retries] -->\n\n<!-- Start Error Handling [errors] -->\n## Error Handling\n\n[`CodatSyncPayablesError`](./src/sdk/models/errors/codatsyncpayableserror.ts) is the base class for all HTTP error responses. It has the following properties:\n\n| Property            | Type       | Description                                                                             |\n| ------------------- | ---------- | --------------------------------------------------------------------------------------- |\n| `error.message`     | `string`   | Error message                                                                           |\n| `error.statusCode`  | `number`   | HTTP response status code eg `404`                                                      |\n| `error.headers`     | `Headers`  | HTTP response headers                                                                   |\n| `error.body`        | `string`   | HTTP body. Can be empty string if no body is returned.                                  |\n| `error.rawResponse` | `Response` | Raw HTTP response                                                                       |\n| `error.data$`       |            | Optional. Some errors may contain structured data. [See Error Classes](#error-classes). |\n\n### Example\n```typescript\nimport { CodatSyncPayables } from \"@codat/sync-for-payables-version-1\";\nimport * as errors from \"@codat/sync-for-payables-version-1/sdk/models/errors\";\n\nconst codatSyncPayables = new CodatSyncPayables({\n  authHeader: \"Basic BASE_64_ENCODED(API_KEY)\",\n});\n\nasync function run() {\n  try {\n    const result = await codatSyncPayables.companies.list({\n      query: \"id=e3334455-1aed-4e71-ab43-6bccf12092ee\",\n      orderBy: \"-modifiedDate\",\n      tags: \"region=uk && team=invoice-finance\",\n    });\n\n    console.log(result);\n  } catch (error) {\n    // The base class for HTTP error responses\n    if (error instanceof errors.CodatSyncPayablesError) {\n      console.log(error.message);\n      console.log(error.statusCode);\n      console.log(error.body);\n      console.log(error.headers);\n\n      // Depending on the method different errors may be thrown\n      if (error instanceof errors.ErrorMessage) {\n        console.log(error.data$.statusCode); // number\n        console.log(error.data$.service); // string\n        console.log(error.data$.error); // string\n        console.log(error.data$.correlationId); // string\n        console.log(error.data$.validation); // shared.ErrorValidation\n      }\n    }\n  }\n}\n\nrun();\n\n```\n\n### Error Classes\n**Primary errors:**\n* [`CodatSyncPayablesError`](./src/sdk/models/errors/codatsyncpayableserror.ts): The base class for HTTP error responses.\n  * [`ErrorMessage`](./src/sdk/models/errors/errormessage.ts): Your `query` parameter was not correctly formed.\n\n<details><summary>Less common errors (6)</summary>\n\n<br />\n\n**Network errors:**\n* [`ConnectionError`](./src/sdk/models/errors/httpclienterrors.ts): HTTP client was unable to make a request to a server.\n* [`RequestTimeoutError`](./src/sdk/models/errors/httpclienterrors.ts): HTTP request timed out due to an AbortSignal signal.\n* [`RequestAbortedError`](./src/sdk/models/errors/httpclienterrors.ts): HTTP request was aborted by the client.\n* [`InvalidRequestError`](./src/sdk/models/errors/httpclienterrors.ts): Any input used to create a request is invalid.\n* [`UnexpectedClientError`](./src/sdk/models/errors/httpclienterrors.ts): Unrecognised or unexpected error.\n\n\n**Inherit from [`CodatSyncPayablesError`](./src/sdk/models/errors/codatsyncpayableserror.ts)**:\n* [`ResponseValidationError`](./src/sdk/models/errors/responsevalidationerror.ts): Type mismatch between the data returned from the server and the structure expected by the SDK. See `error.rawValue` for the raw value and `error.pretty()` for a nicely formatted multi-line string.\n\n</details>\n<!-- End Error Handling [errors] -->\n\n<!-- Start Server Selection [server] -->\n## Server Selection\n\n### Override Server URL Per-Client\n\nThe default server can be overridden globally by passing a URL to the `serverURL: string` optional parameter when initializing the SDK client instance. For example:\n```typescript\nimport { CodatSyncPayables } from \"@codat/sync-for-payables-version-1\";\n\nconst codatSyncPayables = new CodatSyncPayables({\n  serverURL: \"https://api.codat.io\",\n  authHeader: \"Basic BASE_64_ENCODED(API_KEY)\",\n});\n\nasync function run() {\n  const result = await codatSyncPayables.companies.list({\n    query: \"id=e3334455-1aed-4e71-ab43-6bccf12092ee\",\n    orderBy: \"-modifiedDate\",\n    tags: \"region=uk && team=invoice-finance\",\n  });\n\n  console.log(result);\n}\n\nrun();\n\n```\n<!-- End Server Selection [server] -->\n\n<!-- Start Custom HTTP Client [http-client] -->\n## Custom HTTP Client\n\nThe TypeScript SDK makes API calls using an `HTTPClient` that wraps the native\n[Fetch API](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API). This\nclient is a thin wrapper around `fetch` and provides the ability to attach hooks\naround the request lifecycle that can be used to modify the request or handle\nerrors and response.\n\nThe `HTTPClient` constructor takes an optional `fetcher` argument that can be\nused to integrate a third-party HTTP client or when writing tests to mock out\nthe HTTP client and feed in fixtures.\n\nThe following example shows how to use the `\"beforeRequest\"` hook to to add a\ncustom header and a timeout to requests and how to use the `\"requestError\"` hook\nto log errors:\n\n```typescript\nimport { CodatSyncPayables } from \"@codat/sync-for-payables-version-1\";\nimport { HTTPClient } from \"@codat/sync-for-payables-version-1/lib/http\";\n\nconst httpClient = new HTTPClient({\n  // fetcher takes a function that has the same signature as native `fetch`.\n  fetcher: (request) => {\n    return fetch(request);\n  }\n});\n\nhttpClient.addHook(\"beforeRequest\", (request) => {\n  const nextRequest = new Request(request, {\n    signal: request.signal || AbortSignal.timeout(5000)\n  });\n\n  nextRequest.headers.set(\"x-custom-header\", \"custom value\");\n\n  return nextRequest;\n});\n\nhttpClient.addHook(\"requestError\", (error, request) => {\n  console.group(\"Request Error\");\n  console.log(\"Reason:\", `${error}`);\n  console.log(\"Endpoint:\", `${request.method} ${request.url}`);\n  console.groupEnd();\n});\n\nconst sdk = new CodatSyncPayables({ httpClient: httpClient });\n```\n<!-- End Custom HTTP Client [http-client] -->\n\n<!-- Start Authentication [security] -->\n## Authentication\n\n### Per-Client Security Schemes\n\nThis SDK supports the following security scheme globally:\n\n| Name         | Type   | Scheme  |\n| ------------ | ------ | ------- |\n| `authHeader` | apiKey | API key |\n\nTo authenticate with the API the `authHeader` parameter must be set when initializing the SDK client instance. For example:\n```typescript\nimport { CodatSyncPayables } from \"@codat/sync-for-payables-version-1\";\n\nconst codatSyncPayables = new CodatSyncPayables({\n  authHeader: \"Basic BASE_64_ENCODED(API_KEY)\",\n});\n\nasync function run() {\n  const result = await codatSyncPayables.companies.list({\n    query: \"id=e3334455-1aed-4e71-ab43-6bccf12092ee\",\n    orderBy: \"-modifiedDate\",\n    tags: \"region=uk && team=invoice-finance\",\n  });\n\n  console.log(result);\n}\n\nrun();\n\n```\n<!-- End Authentication [security] -->\n\n<!-- Start Debugging [debug] -->\n## Debugging\n\nYou can setup your SDK to emit debug logs for SDK requests and responses.\n\nYou can pass a logger that matches `console`'s interface as an SDK option.\n\n> [!WARNING]\n> Beware that debug logging will reveal secrets, like API tokens in headers, in log messages printed to a console or files. It's recommended to use this feature only during local development and not in production.\n\n```typescript\nimport { CodatSyncPayables } from \"@codat/sync-for-payables-version-1\";\n\nconst sdk = new CodatSyncPayables({ debugLogger: console });\n```\n<!-- End Debugging [debug] -->\n\n<!-- Placeholder for Future Speakeasy SDK Sections -->\n\n<!-- Start Codat Support Notes -->\n## Support\n\nIf you encounter any challenges while utilizing our SDKs, please don't hesitate to reach out for assistance. \nYou can raise any issues by contacting your dedicated Codat representative or reaching out to our [support team](mailto:support@codat.io).\nWe're here to help ensure a smooth experience for you.\n<!-- End Codat Support Notes -->\n\n<!-- Start Codat Generated By -->\n### Library generated by [Speakeasy](https://docs.speakeasyapi.dev/docs/using-speakeasy/client-sdks)\n<!-- End Codat Generated By -->","readmeFilename":"README.md"}