diff --git a/.speakeasy/logs/changes/changes.html b/.speakeasy/logs/changes/changes.html index 3271e28b2..958ff42e8 100644 --- a/.speakeasy/logs/changes/changes.html +++ b/.speakeasy/logs/changes/changes.html @@ -98,6 +98,7 @@

Typescript SDK Changes:

diff --git a/.speakeasy/logs/changes/changes.md b/.speakeasy/logs/changes/changes.md index 36bf97e6b..39b139946 100644 --- a/.speakeasy/logs/changes/changes.md +++ b/.speakeasy/logs/changes/changes.md @@ -1,2 +1,3 @@ ## Typescript SDK Changes: +* `codatsyncpayables.bills.update()`: **Added** * `codatlending.banking.categorizedStatement.get()`: `response.reportItems[].transactions[].isRecurring` **Added** diff --git a/.speakeasy/logs/changes/new.openapi.yaml b/.speakeasy/logs/changes/new.openapi.yaml index dbf989a4c..22a9a5b3f 100644 --- a/.speakeasy/logs/changes/new.openapi.yaml +++ b/.speakeasy/logs/changes/new.openapi.yaml @@ -3,6 +3,27 @@ servers: - description: Production url: 'https://api.codat.io' info: + title: Bill pay (synchronous solution) + description: |- + The API reference for the synchronous Bill Pay solution. + + The synchronous Bill Pay solution is an API and a set of supporting tools designed to integrate a bill pay flow into your app as quickly as possible. It's ideal for facilitating essential bill payment processes within your SMB's accounting software. + + [Explore solution](https://docs.codat.io/payables/overview) | [See OpenAPI spec](https://github.com/codatio/oas) + + --- + ## Supported Integrations + + | Integration | Supported | + |-------------------------------|-----------| + | FreeAgent | Yes | + | QuickBooks Online | Yes | + | Oracle NetSuite | Yes | + | Sage Intacct | Yes | + | Xero | Yes | + | Zoho Books | Yes | + + --- title: Lending description: |- Our Lending solution helps you make smarter credit decisions on small businesses by enabling you to pull your customers' latest data from accounting, banking, and commerce software they are already using. It also includes features to help providers verify the accuracy of data and process it more efficiently. @@ -18,6 +39,11 @@ info: | :- |:- | | Companies | Create and manage your SMB users' companies. | | Connections | Create new and manage existing data connections for a company. | + | Company information | View company profile from the source platform. | + | Bills | Get, create, and update Bills. | + | Bill payments | Get, create, and update Bill payments. | + | Suppliers | Get, create, and update Suppliers. | + | Bank accounts | Create a bank account for a given company's connection. | | Bank statements | Retrieve banking data from linked bank accounts. | | Sales | Retrieve standardized sales data from a linked commerce software. | | Financial statements | Financial data and reports from a linked accounting software. | @@ -76,6 +102,7 @@ x-speakeasy-name-override: methodNameOverride: download-attachment - operationId: ^upload-.*?-attachment methodNameOverride: upload-attachment +x-codat-docs-path: sync-for-payables-api x-codat-docs-path: lending-api x-codat-keep-docs-paths-local: true x-codat-speakeasy-pagination: @@ -91,6 +118,16 @@ tags: description: Create and manage your SMB users' companies. - name: Connections description: Create new and manage existing data connections for a company. + - name: Company information + description: View company profile from the source platform. + - name: Bills + description: 'Get, create, and update Bills.' + - name: Bill payments + description: 'Get, create, and update Bill payments.' + - name: Suppliers + description: 'Get, create, and update Suppliers.' + - name: Bank accounts + description: Create a bank account for a given company's connection. - name: Bank statements description: Retrieve banking data from linked bank accounts. - name: Sales @@ -292,6 +329,7 @@ paths: '503': $ref: '#/components/responses/Service-Unavailable' operationId: list-companies + description: "\uFEFFThe *List companies* endpoint returns a list of [companies](https://docs.codat.io/sync-for-payables-api#/schemas/Company) associated to your instances.\n\nA [company](https://docs.codat.io/sync-for-payables-api#/schemas/Company) represents a business sharing access to their data.\nEach company can have multiple [connections](https://docs.codat.io/sync-for-payables-api#/schemas/Connection) to different data sources, such as one connection to Xero for accounting data, two connections to Plaid for two bank accounts, and a connection to Zettle for POS data.\n\n## Filter by tags\n\nThe *List companies* endpoint supports the filtering of companies using [tags](https://docs.codat.io/using-the-api/managing-companies#add-metadata-to-a-company). It supports the following operators with [Codat’s query language](https://docs.codat.io/using-the-api/querying):\n\n- equals (`=`)\n- not equals (`!=`)\n- contains (`~`)\n\nFor example, you can use the querying to filter companies tagged with a specific foreign key, region, or owning team: \n- Foreign key: `uid = {yourCustomerId}`\n- Region: `region != uk`\n- Owning team and region: `region = uk && owningTeam = invoice-finance`" description: "\uFEFFThe *List companies* endpoint returns a list of [companies](https://docs.codat.io/lending-api#/schemas/Company) associated to your instances.\n\nA [company](https://docs.codat.io/lending-api#/schemas/Company) represents a business sharing access to their data.\nEach company can have multiple [connections](https://docs.codat.io/lending-api#/schemas/Connection) to different data sources, such as one connection to Xero for accounting data, two connections to Plaid for two bank accounts, and a connection to Zettle for POS data.\n\n## Filter by tags\n\nThe *List companies* endpoint supports the filtering of companies using [tags](https://docs.codat.io/using-the-api/managing-companies#add-metadata-to-a-company). It supports the following operators with [Codat’s query language](https://docs.codat.io/using-the-api/querying):\n\n- equals (`=`)\n- not equals (`!=`)\n- contains (`~`)\n\nFor example, you can use the querying to filter companies tagged with a specific foreign key, region, or owning team: \n- Foreign key: `uid = {yourCustomerId}`\n- Region: `region != uk`\n- Owning team and region: `region = uk && owningTeam = invoice-finance`" parameters: - $ref: '#/components/parameters/page' @@ -373,6 +411,7 @@ paths: $ref: '#/components/responses/Internal-Server-Error' '503': $ref: '#/components/responses/Service-Unavailable' + description: "\uFEFFUse the *Create company* endpoint to create a new [company](https://docs.codat.io/sync-for-payables-api#/schemas/Company) that represents your customer in Codat. \n\nA [company](https://docs.codat.io/sync-for-payables-api#/schemas/Company) represents a business sharing access to their data.\nEach company can have multiple [connections](https://docs.codat.io/sync-for-payables-api#/schemas/Connection) to different data sources, such as one connection to Xero for accounting data, two connections to Plaid for two bank accounts, and a connection to Zettle for POS data.\n\nIf forbidden characters (see `name` pattern) are present in the request, a company will be created with the forbidden characters removed. For example, `Company (Codat[1])` with be created as `Company Codat1`." description: "\uFEFFUse the *Create company* endpoint to create a new [company](https://docs.codat.io/lending-api#/schemas/Company) that represents your customer in Codat. \n\nA [company](https://docs.codat.io/lending-api#/schemas/Company) represents a business sharing access to their data.\nEach company can have multiple [connections](https://docs.codat.io/lending-api#/schemas/Connection) to different data sources, such as one connection to Xero for accounting data, two connections to Plaid for two bank accounts, and a connection to Zettle for POS data.\n\nIf forbidden characters (see `name` pattern) are present in the request, a company will be created with the forbidden characters removed. For example, `Company (Codat[1])` with be created as `Company Codat1`." requestBody: content: @@ -390,6 +429,7 @@ paths: '/companies/{companyId}': put: summary: Replace company + description: "\uFEFFUse the *Replace company* endpoint to replace the existing name, description, and tags of the company. Calling the endpoint will replace existing values even if new values haven't been defined in the payload.\n\nA [company](https://docs.codat.io/sync-for-payables-api#/schemas/Company) represents a business sharing access to their data.\nEach company can have multiple [connections](https://docs.codat.io/sync-for-payables-api#/schemas/Connection) to different data sources, such as one connection to Xero for accounting data, two connections to Plaid for two bank accounts, and a connection to Zettle for POS data." description: "\uFEFFUse the *Replace company* endpoint to replace the existing name, description, and tags of the company. Calling the endpoint will replace existing values even if new values haven't been defined in the payload.\n\nA [company](https://docs.codat.io/lending-api#/schemas/Company) represents a business sharing access to their data.\nEach company can have multiple [connections](https://docs.codat.io/lending-api#/schemas/Connection) to different data sources, such as one connection to Xero for accounting data, two connections to Plaid for two bank accounts, and a connection to Zettle for POS data." operationId: replace-company x-speakeasy-name-override: replace @@ -433,6 +473,7 @@ paths: description: Additional documents required patch: summary: Update company + description: "\uFEFFUse the *Update company* endpoint to update the name, description, or tags of the company.\n\nThe *Update company* endpoint doesn't have any required fields. If any of the fields provided are `null` or not provided, they won't be included in the update. \n\nA [company](https://docs.codat.io/sync-for-payables-api#/schemas/Company) represents a business sharing access to their data." description: "\uFEFFUse the *Update company* endpoint to update the name, description, or tags of the company.\n\nThe *Update company* endpoint doesn't have any required fields. If any of the fields provided are `null` or not provided, they won't be included in the update. \n\nA [company](https://docs.codat.io/lending-api#/schemas/Company) represents a business sharing access to their data." operationId: update-company parameters: @@ -478,6 +519,7 @@ paths: operationId: delete-company parameters: - $ref: '#/components/parameters/companyId' + description: "\uFEFFThe *Delete company* endpoint permanently deletes a [company](https://docs.codat.io/sync-for-payables-api#/schemas/Company), its [connections](https://docs.codat.io/sync-for-payables-api#/schemas/Connection) and any cached data. This operation is irreversible.\n\nA [company](https://docs.codat.io/sync-for-payables-api#/schemas/Company) represents a business sharing access to their data.\nEach company can have multiple [connections](https://docs.codat.io/sync-for-payables-api#/schemas/Connection) to different data sources, such as one connection to Xero for accounting data, two connections to Plaid for two bank accounts, and a connection to Zettle for POS data.\n" description: "\uFEFFThe *Delete company* endpoint permanently deletes a [company](https://docs.codat.io/lending-api#/schemas/Company), its [connections](https://docs.codat.io/lending-api#/schemas/Connection) and any cached data. This operation is irreversible.\n\nA [company](https://docs.codat.io/lending-api#/schemas/Company) represents a business sharing access to their data.\nEach company can have multiple [connections](https://docs.codat.io/lending-api#/schemas/Connection) to different data sources, such as one connection to Xero for accounting data, two connections to Plaid for two bank accounts, and a connection to Zettle for POS data.\n" tags: - Companies @@ -501,6 +543,7 @@ paths: get: summary: Get company operationId: get-company + description: "\uFEFFThe *Get company* endpoint returns a single company for a given `companyId`.\n\nA [company](https://docs.codat.io/sync-for-payables-api#/schemas/Company) represents a business sharing access to their data.\nEach company can have multiple [connections](https://docs.codat.io/sync-for-payables-api#/schemas/Connection) to different data sources, such as one connection to Xero for accounting data, two connections to Plaid for two bank accounts, and a connection to Zettle for POS data.\n" description: "\uFEFFThe *Get company* endpoint returns a single company for a given `companyId`.\n\nA [company](https://docs.codat.io/lending-api#/schemas/Company) represents a business sharing access to their data.\nEach company can have multiple [connections](https://docs.codat.io/lending-api#/schemas/Connection) to different data sources, such as one connection to Xero for accounting data, two connections to Plaid for two bank accounts, and a connection to Zettle for POS data.\n" parameters: - $ref: '#/components/parameters/companyId' @@ -835,6 +878,32 @@ paths: value: status: Unlinked description: '' + '/companies/{companyId}/connections/{connectionId}/payables/info': + parameters: + - $ref: '#/components/parameters/companyId' + - $ref: '#/components/parameters/connectionId' + get: + summary: Get company information + description: |+ + Use the *Get company information* endpoint to return information about the company available from the underlying accounting software. + + operationId: get-company-information + tags: + - Company information + responses: + '200': + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/CompanyInformation' + examples: + Company information: + value: + companyName: Bank of Dave + baseCurrency: GBP + '400': + $ref: '#/components/responses/BadRequest' '/companies/{companyId}/data/all': parameters: - $ref: '#/components/parameters/companyId' @@ -862,6 +931,209 @@ paths: $ref: '#/components/responses/Internal-Server-Error' '503': $ref: '#/components/responses/Service-Unavailable' + '/companies/{companyId}/connections/{connectionId}/payables/mappingOptions/bills': + parameters: + - $ref: '#/components/parameters/companyId' + - $ref: '#/components/parameters/connectionId' + get: + summary: Get bill mapping options + description: "\uFEFFUse the *Get mapping options - Bills* endpoint to return a list of available mapping options for a given company's connection ID.\n\nBy default, this endpoint returns a list of active accounts and tax rates. You can use [querying](https://docs.codat.io/using-the-api/querying) to change that.\n\nMapping options are a set of accounts and tax rates used to configure the SMB's payables integration." + operationId: get-mapping-options-bills + x-speakeasy-name-override: get-bill-options + tags: + - Bills + parameters: + - $ref: '#/components/parameters/continuationToken' + - $ref: '#/components/parameters/statusQuery' + responses: + '200': + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/BillMappingOptions' + examples: + Mapping options: + value: + accounts: + - id: 1b6266d1-1e44-46c5-8eb5-a8f98e03124e + nominalCode: 879-i + name: Accounts payable + type: Liability + currency: GBP + status: Active + sourceModifiedDate: '2022-10-23T00:00:00.000Z' + taxRates: + - id: d2939064-dd3a-4c0f-9865-a238c2193515 + name: VAT @ 20% + code: VAT20 + effectiveTaxRate: 20 + totalTaxRate: 20 + status: Active + sourceModifiedDate: '2022-10-23T00:00:00.000Z' + pagination: + continuationToken: eyJwYWdlIjoyLCJwYWdlU2l6ZSI6MTAwLCJwYWdlQ291bnQiOjExfQ== + '400': + $ref: '#/components/responses/BadRequest' + '401': + $ref: '#/components/responses/Unauthorized' + '402': + $ref: '#/components/responses/Payment-Required' + '403': + $ref: '#/components/responses/Forbidden' + '404': + $ref: '#/components/responses/Not-Found' + '429': + $ref: '#/components/responses/Too-Many-Requests' + '500': + $ref: '#/components/responses/Internal-Server-Error' + '503': + $ref: '#/components/responses/Service-Unavailable' + '/companies/{companyId}/connections/{connectionId}/payables/mappingOptions/payments': + parameters: + - $ref: '#/components/parameters/companyId' + - $ref: '#/components/parameters/connectionId' + get: + summary: Get payment mapping options + description: "Use the *Get mapping options - Payments* endpoint to return a list of available mapping options for a given company's connection ID.\r\n\r\nBy default, this endpoint returns a list of active bank accounts. You can use [querying](https://docs.codat.io/using-the-api/querying) to change that.\r\n\r\nMapping options are a set of bank accounts used to configure the SMB's payables integration." + operationId: get-mapping-options-payments + x-speakeasy-name-override: get-payment-options + tags: + - Bill payments + parameters: + - $ref: '#/components/parameters/continuationToken' + - $ref: '#/components/parameters/statusQuery' + responses: + '200': + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/PaymentMappingOptions' + examples: + Mapping options: + value: + bankAccounts: + - id: 3d5a8e00-d108-4045-8823-7f342676cffa + name: Bank of Dave current account + accountNumber: '12345678' + currency: GBP + nominalCode: '1234567' + sortCode: '123456' + status: Active + accountType: Debit + sourceModifiedDate: '2022-10-23T00:00:00.000Z' + pagination: + continuationToken: eyJwYWdlIjoyLCJwYWdlU2l6ZSI6MTAwLCJwYWdlQ291bnQiOjExfQ== + '400': + $ref: '#/components/responses/BadRequest' + '401': + $ref: '#/components/responses/Unauthorized' + '402': + $ref: '#/components/responses/Payment-Required' + '403': + $ref: '#/components/responses/Forbidden' + '404': + $ref: '#/components/responses/Not-Found' + '429': + $ref: '#/components/responses/Too-Many-Requests' + '500': + $ref: '#/components/responses/Internal-Server-Error' + '503': + $ref: '#/components/responses/Service-Unavailable' + '/companies/{companyId}/connections/{connectionId}/payables/bills': + parameters: + - $ref: '#/components/parameters/companyId' + - $ref: '#/components/parameters/connectionId' + get: + summary: List bills + description: |- + The *List bills* endpoint returns a list of [bills](https://docs.codat.io/sync-for-payables-api#/schemas/Bill) for a given company's connection. + + [Bills](https://docs.codat.io/sync-for-payables-api#/schemas/Bill) are invoices that represent the SMB's financial obligations to their supplier for a purchase of goods or services. + + By default, the endpoint will return all bills with a status of 'Open' & 'PartiallyPaid' to show all oustanding bills. + operationId: list-bills + tags: + - Bills + parameters: + - $ref: '#/components/parameters/continuationToken' + - name: query + in: query + required: false + schema: + type: string + examples: + Status (open): + value: status=Open + Status (partially paid): + value: status=PartiallyPaid + Source modified date: + value: 'sourceModifiedDate>2023-12-15T00:00:00.000Z' + Status (open) & source modified date: + value: 'sourceModifiedDate>2023-12-15T00:00:00.000Z&&status=Open' + Status (partially paid) & source modified date: + value: 'sourceModifiedDate>2023-12-15T00:00:00.000Z&&status=PartiallyPaid' + description: 'Codat query string allows you to filter by `status` and `sourceModifiedDate`. Learn more about Codat''s query string [here](https://docs.codat.io/using-the-api/querying). Platfrom specfic statuses: Xero supports Open | PartiallyPaid | Paid | Void | Draft. Qbo supports Open | PartiallyPaid | Paid. FreeAgent supports Open | PartiallyPaid | Paid.' + responses: + '200': + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/Bill/definitions/bills' + examples: + Bills: + value: + results: + - id: '18' + reference: '12' + supplierRef: + id: '4' + supplierName: BILLy elliot + issueDate: '2019-05-13T00:00:00' + dueDate: '2019-05-13T00:00:00' + currency: GBP + currencyRate: '1,' + lineItems: + - description: Dance shoes + unitAmount: 5 + quantity: 1 + taxAmount: 0 + accountRef: + id: '16' + taxRateRef: + id: NON + totalAmount: 5 + status: Open + totalAmount: 5 + amountDue: 0 + sourceModifiedDate: '2022-05-26T10:34:10Z' + - id: '22' + reference: '12' + supplierRef: + id: '4' + supplierName: BILLy elliot + issueDate: '2019-05-13T00:00:00' + dueDate: '2019-05-13T00:00:00' + currency: GBP + currencyRate: 1 + lineItems: + - description: Dance shoes + unitAmount: 5 + quantity: 1 + taxAmount: 0 + accountRef: + id: '16' + taxRateRef: + id: NON + totalAmount: 5 + status: Paid + totalAmount: 5 + amountDue: 0 + sourceModifiedDate: '2022-05-26T10:34:10Z' + pagination: + continuationToken: eyJwYWdlIjoyLCJwYWdlU2l6ZSI6MTAwLCJwYWdlQ291bnQiOjExfQ== description: |- Refreshes all data types with `fetch on first link` set to `true` for a given company. @@ -3707,6 +3979,324 @@ paths: $ref: '#/components/responses/Internal-Server-Error' '503': $ref: '#/components/responses/Service-Unavailable' + post: + summary: Create bill + description: |- + The *Create bill* endpoint creates a new [bill](https://docs.codat.io/sync-for-payables-api#/schemas/Bill) for a given company's connection. + + [Bills](https://docs.codat.io/sync-for-payables-api#/schemas/Bill) are invoices that represent the SMB's financial obligations to their supplier for a purchase of goods or services. + operationId: create-bill + tags: + - Bills + parameters: + - in: header + name: Idempotency-Key + description: A unique identifier to ensure idempotent behaviour for subsequent requests. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Bill/definitions/billPrototype' + examples: + Create bill: + value: + reference: bill_b8qmmj4ksf1suax + supplierRef: + id: 1262c350-fe0f-40ec-aeff-41c95b4a45af + supplierName: DIISR - Small Business Services + issueDate: '2023-04-23T00:00:00' + dueDate: '2023-04-23T00:00:00' + currency: GBP + currencyRate: 1 + lineItems: + - description: Half day training - Microsoft Office + unitAmount: 1800 + quantity: 1 + taxAmount: 360 + totalAmount: 2160 + accountRef: + id: 46f9461e-788b-4906-8b74-d1ea17f6dc10 + taxRateRef: + id: INPUT2 + - description: Desktop/network support via email & phone.Per month fixed fee for minimum 20 hours/month. + unitAmount: 4000 + quantity: 1 + taxAmount: 800 + totalAmount: 4800 + accountRef: + id: f96c9458-d724-47bf-8f74-a9d5726465ce + taxRateRef: + id: INPUT2 + - description: Stationery charges + unitAmount: 32 + quantity: 8 + taxAmount: 51.2 + totalAmount: 307.2 + accountRef: + id: cba6527d-f102-4538-b421-e483233e9d5a + taxRateRef: + id: INPUT2 + trackingRefs: + - id: dba3d4da-f9ed-4eee-8e0b-452d11fdb1fa + dataType: trackingCategories + status: Open + responses: + '201': + description: Created + content: + application/json: + schema: + $ref: '#/components/schemas/Bill' + examples: + Created bill: + value: + id: bill-1029932 + reference: bill_b8qmmj4ksf1suax + supplierRef: + id: 1262c350-fe0f-40ec-aeff-41c95b4a45af + supplierName: DIISR - Small Business Services + issueDate: '2023-04-23T00:00:00' + dueDate: '2023-04-23T00:00:00' + currency: GBP + lineItems: + - description: Half day training - Microsoft Office + unitAmount: 1800 + quantity: 1 + taxAmount: 360 + totalAmount: 2160 + accountRef: + id: 46f9461e-788b-4906-8b74-d1ea17f6dc10 + taxRateRef: + id: INPUT2 + - description: Desktop/network support via email & phone.Per month fixed fee for minimum 20 hours/month. + unitAmount: 4000 + quantity: 1 + taxAmount: 800 + totalAmount: 4800 + accountRef: + id: f96c9458-d724-47bf-8f74-a9d5726465ce + taxRateRef: + id: INPUT2 + - description: Stationery charges + unitAmount: 32 + quantity: 8 + taxAmount: 51.2 + totalAmount: 307.2 + accountRef: + id: cba6527d-f102-4538-b421-e483233e9d5a + taxRateRef: + id: INPUT2 + trackingRefs: + - id: dba3d4da-f9ed-4eee-8e0b-452d11fdb1fa + dataType: trackingCategories + status: Open + totalAmount: 7267.2 + amountDue: 7267.2 + '400': + $ref: '#/components/responses/BadRequest' + '401': + $ref: '#/components/responses/Unauthorized' + '402': + $ref: '#/components/responses/Payment-Required' + '403': + $ref: '#/components/responses/Forbidden' + '404': + $ref: '#/components/responses/Not-Found' + '409': + $ref: '#/components/responses/Idempotency-Conflict' + '429': + $ref: '#/components/responses/Too-Many-Requests' + '500': + $ref: '#/components/responses/Internal-Server-Error' + '503': + $ref: '#/components/responses/Service-Unavailable' + '/companies/{companyId}/connections/{connectionId}/payables/bills/{billId}': + parameters: + - $ref: '#/components/parameters/companyId' + - $ref: '#/components/parameters/connectionId' + - $ref: '#/components/parameters/billId' + put: + summary: Update bill + description: | + The *Update bill* endpoint updates an existing [bill](https://docs.codat.io/sync-for-payables-api#/schemas/Bill) for a given company's connection. + + [Bills](https://docs.codat.io/sync-for-payables-api#/schemas/Bill) are invoices that represent the SMB's financial obligations to their supplier for a purchase of goods or services. + + ### Supported Integrations + + | Integration | Supported | + |-------------------------------|-----------| + | FreeAgent | Yes | + | QuickBooks Online | Yes | + | Xero | Yes | + | Oracle NetSuite | No | + | Sage Intacct | No | + | Zoho Books | No | + operationId: update-bill + tags: + - Bills + parameters: + - in: header + name: Idempotency-Key + description: A unique identifier to ensure idempotent behaviour for subsequent requests. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Bill/definitions/billPrototype' + examples: + Update bill: + value: + reference: bill_updated_ref + supplierRef: + id: 1262c350-fe0f-40ec-aeff-41c95b4a45af + issueDate: '2023-04-23T00:00:00' + dueDate: '2023-05-23T00:00:00' + currency: GBP + currencyRate: 1 + lineItems: + - description: Updated line item - Microsoft Office training + unitAmount: 2000 + quantity: 1 + taxAmount: 400 + totalAmount: 2400 + accountRef: + id: 46f9461e-788b-4906-8b74-d1ea17f6dc10 + taxRateRef: + id: INPUT2 + - description: Desktop/network support via email & phone - updated rate + unitAmount: 4500 + quantity: 1 + taxAmount: 900 + totalAmount: 5400 + accountRef: + id: f96c9458-d724-47bf-8f74-a9d5726465ce + taxRateRef: + id: INPUT2 + trackingRefs: + - id: dba3d4da-f9ed-4eee-8e0b-452d11fdb1fa + dataType: trackingCategories + status: Open + responses: + '200': + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/Bill' + examples: + Updated bill: + value: + id: bill-1029932 + reference: bill_updated_ref + supplierRef: + id: 1262c350-fe0f-40ec-aeff-41c95b4a45af + supplierName: DIISR - Small Business Services + issueDate: '2023-04-23T00:00:00' + dueDate: '2023-05-23T00:00:00' + currency: GBP + lineItems: + - description: Updated line item - Microsoft Office training + unitAmount: 2000 + quantity: 1 + taxAmount: 400 + totalAmount: 2400 + accountRef: + id: 46f9461e-788b-4906-8b74-d1ea17f6dc10 + taxRateRef: + id: INPUT2 + - description: Desktop/network support via email & phone - updated rate + unitAmount: 4500 + quantity: 1 + taxAmount: 900 + totalAmount: 5400 + accountRef: + id: f96c9458-d724-47bf-8f74-a9d5726465ce + taxRateRef: + id: INPUT2 + trackingRefs: + - id: dba3d4da-f9ed-4eee-8e0b-452d11fdb1fa + dataType: trackingCategories + status: Open + totalAmount: 7800 + amountDue: 7800 + '400': + $ref: '#/components/responses/BadRequest' + '401': + $ref: '#/components/responses/Unauthorized' + '402': + $ref: '#/components/responses/Payment-Required' + '403': + $ref: '#/components/responses/Forbidden' + '404': + $ref: '#/components/responses/Not-Found' + '409': + $ref: '#/components/responses/Idempotency-Conflict' + '429': + $ref: '#/components/responses/Too-Many-Requests' + '500': + $ref: '#/components/responses/Internal-Server-Error' + '503': + $ref: '#/components/responses/Service-Unavailable' + '/companies/{companyId}/connections/{connectionId}/payables/bills/{billId}/attachments': + parameters: + - $ref: '#/components/parameters/companyId' + - $ref: '#/components/parameters/connectionId' + - $ref: '#/components/parameters/billId' + post: + summary: Upload bill attachment + description: "The *Upload bill attachment* endpoint uploads an attachment and assigns it against a specific `billId`.\r\n\r\n[Bills](https://docs.codat.io/sync-for-payables-api#/schemas/Bill) are invoices that represent the SMB's financial obligations to their supplier for a purchase of goods or services." + operationId: upload-bill-attachment + tags: + - Bills + requestBody: + content: + multipart/form-data: + schema: + $ref: '#/components/schemas/AttachmentUpload' + responses: + '201': + description: Created + content: + application/json: + schema: + $ref: '#/components/schemas/Attachment' + examples: + Attachment metadata: + value: + id: 422f093f-e556-4bf3-91c0-93af70c3e850 + name: receipt.png + contentType: image/png + dateCreated: '2022-10-23T00:00:00.000Z' + fileSize: 100 + includeWhenSent: true + sourceModifiedDate: '2022-05-26T10:34:10Z' + '400': + $ref: '#/components/responses/BadRequest' + '401': + $ref: '#/components/responses/Unauthorized' + '402': + $ref: '#/components/responses/Payment-Required' + '403': + $ref: '#/components/responses/Forbidden' + '404': + $ref: '#/components/responses/Not-Found' + '429': + $ref: '#/components/responses/Too-Many-Requests' + '500': + $ref: '#/components/responses/Internal-Server-Error' + '503': + $ref: '#/components/responses/Service-Unavailable' + get: + summary: List bill attachments + description: "The *List bill attachments* endpoint returns a list of attachments available to download for a given `billId`.\r\n\r\n[Bills](https://docs.codat.io/sync-for-payables-api#/schemas/Bill) are invoices that represent the SMB's financial obligations to their supplier for a purchase of goods or services." + operationId: list-bill-attachments + tags: + - Bills '/companies/{companyId}/connections/{connectionId}/data/accountTransactions/{accountTransactionId}': get: tags: @@ -3735,6 +4325,24 @@ paths: content: application/json: schema: + $ref: '#/components/schemas/Attachment/definitions/attachments' + examples: + Success: + value: + - id: 422f093f-e556-4bf3-91c0-93af70c3e850 + name: receipt.png + contentType: image/png + dateCreated: '2022-10-23T00:00:00.000Z' + fileSize: 100 + includeWhenSent: true + sourceModifiedDate: '2022-05-26T10:34:10Z' + - id: 20cfd269-2f0f-44ef-a28c-7b5f725cf1aa + name: another_receipt.png + contentType: image/png + dateCreated: '2022-10-24T00:00:00.000Z' + fileSize: 98 + includeWhenSent: true + sourceModifiedDate: '2022-05-27T12:38:10Z' $ref: '#/components/schemas/AccountingAccountTransaction' examples: Clear Books: @@ -3861,6 +4469,23 @@ paths: $ref: '#/components/responses/Internal-Server-Error' '503': $ref: '#/components/responses/Service-Unavailable' + '/companies/{companyId}/connections/{connectionId}/payables/bills/{billId}/attachments/{attachmentId}/download': + parameters: + - $ref: '#/components/parameters/companyId' + - $ref: '#/components/parameters/connectionId' + - $ref: '#/components/parameters/billId' + - $ref: '#/components/parameters/attachmentId' + get: + summary: Download bill attachment + description: | + The *Download bill attachment* endpoint downloads a specific attachment for a given `billId` and `attachmentId`. + + [Bills](https://docs.codat.io/sync-for-payables-api#/schemas/Bill) are invoices that represent the SMB's financial obligations to their supplier for a purchase of goods or services. + + Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=bills) for integrations that support downloading a bill attachment. + operationId: download-bill-attachment + tags: + - Bills '/companies/{companyId}/data/accounts': get: tags: @@ -12361,6 +12986,110 @@ paths: $ref: '#/components/responses/Internal-Server-Error' '503': $ref: '#/components/responses/Service-Unavailable' + '/companies/{companyId}/connections/{connectionId}/payables/bills/{billId}/payment': + parameters: + - $ref: '#/components/parameters/companyId' + - $ref: '#/components/parameters/connectionId' + - $ref: '#/components/parameters/billId' + - in: header + name: Idempotency-Key + description: A unique identifier to ensure idempotent behaviour for subsequent requests. + schema: + type: string + post: + summary: Create bill payment + description: |- + The *Create bill payment* endpoint creates a new [bill payment](https://docs.codat.io/sync-for-payables-api#/schemas/BillPayment) for a given company's connection. + + [Bill payments](https://docs.codat.io/sync-for-payables-api#/schemas/BillPayment) are an allocation of money within any Accounts Payable account. + operationId: create-bill-payment + tags: + - Bill payments + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/BillPayment/definitions/billPaymentPrototype' + examples: + Bill payment example: + value: + amount: 22 + currencyRate: 1 + date: '2022-10-23T00:00:00.000Z' + accountRef: + id: 7bda9f44sr56 + reference: Bill Payment against bill c13e37b6 dfaa-4894-b3be-9fe97bda9f44 + responses: + '201': + description: Created + content: + application/json: + schema: + $ref: '#/components/schemas/BillPayment' + examples: + Bill payment: + value: + id: billPayment-1029932 + amount: 22 + currencyRate: 1 + date: '2022-10-23T00:00:00.000Z' + accountRef: + id: 7bda9f44sr56 + reference: Bill Payment against bill c13e37b6 dfaa-4894-b3be-9fe97bda9f44 + '400': + $ref: '#/components/responses/BadRequest' + '401': + $ref: '#/components/responses/Unauthorized' + '402': + $ref: '#/components/responses/Payment-Required' + '403': + $ref: '#/components/responses/Forbidden' + '404': + $ref: '#/components/responses/Not-Found' + '409': + $ref: '#/components/responses/Idempotency-Conflict' + '429': + $ref: '#/components/responses/Too-Many-Requests' + '500': + $ref: '#/components/responses/Internal-Server-Error' + '503': + $ref: '#/components/responses/Service-Unavailable' + '/companies/{companyId}/connections/{connectionId}/payables/suppliers': + parameters: + - $ref: '#/components/parameters/companyId' + - $ref: '#/components/parameters/connectionId' + get: + tags: + - Suppliers + summary: List suppliers + description: |- + The *List suppliers* endpoint returns a list of [suppliers](https://docs.codat.io/sync-for-payables-api#/schemas/Supplier) for a given company's connection. + + [Suppliers](https://docs.codat.io/sync-for-payables-api#/schemas/Supplier) are people or organizations that provide something, such as a product or service. + + By default, this endpoint returns a list of active and archived suppliers. You can use [querying](https://docs.codat.io/using-the-api/querying) to change that. + + For example, to retrieve only active suppliers (i.e. `status=Active`) or suppliers created within the specified number of days (e.g. `sourceModifiedDate>2023-12-15T00:00:00.000Z`), query the endpoint as follows: `/payables/suppliers?query=sourceModifiedDate>2023-12-15T00:00:00.000Z&&status=Active`.For example, to retrieve active suppliers modified after a particular date use `query=sourceModifiedDate>2023-12-15T00:00:00.000Z&&status=Active`. + operationId: list-suppliers + parameters: + - $ref: '#/components/parameters/continuationToken' + - name: query + in: query + required: false + schema: + type: string + examples: + Source modified date: + value: 'sourceModifiedDate>2023-12-15T00:00:00.000Z' + Status (active): + value: status=Active + Status (archived): + value: status=Archived + Status (active) & source modified date: + value: 'sourceModifiedDate>2023-12-15T00:00:00.000Z&&status=Active' + Status (archived) & source modified date: + value: 'sourceModifiedDate>2023-12-15T00:00:00.000Z&&status=Archived' + description: 'Codat query string allows you to filter by `sourceModifiedDate` or if a supplier is `Active` or `Archived` in the accounting software. Learn more about Codat''s query string [here](https://docs.codat.io/using-the-api/querying).' summary: Download bill attachment description: |- The *Download bill attachment* endpoint downloads a specific attachment for a given `billId` and `attachmentId`. @@ -12386,6 +13115,41 @@ paths: content: application/json: schema: + $ref: '#/components/schemas/Supplier/definitions/suppliers' + examples: + Suppliers: + value: + results: + - id: c523e12f-8b74-4d3a-bbd8-32d7a2f598b4 + supplierName: City Limousines + contactName: Martin Dale + emailAddress: martyd@citylim.co + phone: 07999 999999 + addresses: + - type: Billing + line1: Unit 51 + line2: Bakersfield Industrial Estate + city: Bakersfield + region: California + country: USA + postalcode: '93308' + status: Active + balance: 100 + defaultCurrency: GBP + sourceModifiedDate: '2022-10-23T00:00:00Z' + - id: '41' + supplierName: AI Support + contactName: AI Support + addresses: + - type: Billing + line1: test + region: string + country: Djibouti + status: Active + defaultCurrency: GBP + sourceModifiedDate: '2022-12-07T10:48:18Z' + pagination: + continuationToken: eyJwYWdlIjoyLCJwYWdlU2l6ZSI6MTAwLCJwYWdlQ291bnQiOjExfQ== $ref: '#/components/schemas/AccountingCreditNotes' examples: Dynamics 365 Business Central: @@ -14086,6 +14850,65 @@ paths: $ref: '#/components/responses/Internal-Server-Error' '503': $ref: '#/components/responses/Service-Unavailable' + post: + tags: + - Suppliers + summary: Create supplier + description: "The *Create supplier* endpoint creates a new [supplier](https://docs.codat.io/sync-for-payables-api#/schemas/Supplier) for a given company's connection.\r\n\r\n[Suppliers](https://docs.codat.io/sync-for-payables-api#/schemas/Supplier) are people or organizations that provide something, such as a product or service.\r\n" + operationId: create-supplier + parameters: + - in: header + name: Idempotency-Key + description: A unique identifier to ensure idempotent behaviour for subsequent requests. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Supplier/definitions/supplierPrototype' + examples: + Suppliers: + value: + supplierName: Greggs + contactName: Greg Greggs + emailAddress: greg@greggs.com + phone: +44 (0)1223 322410 + addresses: + - type: Billing + line1: Flat 1 + line2: 2 Dennis Avenue + city: London + region: Camden + country: GBR + postalCode: EC1N 7TE + status: Active + defaultCurrency: GBP + responses: + '201': + description: Created + content: + application/json: + schema: + $ref: '#/components/schemas/Supplier' + examples: + Suppliers: + value: + id: sup-10933920 + supplierName: Greggs + contactName: Greg Greggs + emailAddress: greg@greggs.com + phone: +44 (0)1223 322410 + address: + - type: Billing + line1: Flat 1 + line2: 2 Dennis Avenue + city: London + region: Camden + country: GBR + postalCode: EC1N 7TE + status: Active + defaultCurrency: GBP description: |- The *List credit notes* endpoint returns a list of [credit notes](https://docs.codat.io/lending-api#/schemas/CreditNote) for a given company's connection. @@ -59850,6 +60673,7 @@ paths: $ref: '#/components/responses/Internal-Server-Error' '503': $ref: '#/components/responses/Service-Unavailable' + '/companies/{companyId}/connections/{connectionId}/payables/bankAccounts': description: The *Download files* endpoint downloads all files that have been uploaded by to SMB to Codat. A `date` may be specified to download any files uploaded on the date provided. operationId: download-files x-speakeasy-name-override: download @@ -59859,6 +60683,14 @@ paths: - $ref: '#/components/parameters/connectionId' post: tags: + - Bank accounts + summary: Create bank account + parameters: + - in: header + name: Idempotency-Key + description: A unique identifier to ensure idempotent behaviour for subsequent requests. + schema: + type: string - File upload summary: Upload files for a company responses: @@ -60770,6 +61602,26 @@ paths: content: application/json: schema: + $ref: '#/components/schemas/BankAccount/definitions/bankAccountPrototype' + examples: + Bank account example: + value: + id: fb623ab2-f6ff-4b22-b7d3-b7cc2a4aa0ea + nominalCode: '22' + name: Plutus - Payables - Bank Account 12 + accountNumber: 0120 0440 + sortCode: 50-50-50 + currency: GBP + accountType: Debit + status: Active + sourceModifiedDate: '2024-02-22T14:46:43.99Z' + responses: + '201': + description: Created + content: + application/json: + schema: + $ref: '#/components/schemas/BankAccount' $ref: '#/components/schemas/AccountingBankAccount' examples: {} responses: @@ -60796,6 +61648,9 @@ paths: $ref: '#/components/responses/Internal-Server-Error' '503': $ref: '#/components/responses/Service-Unavailable' + description: "The *Create bank account* endpoint creates a new [bank account](https://docs.codat.io/sync-for-payables-api#/schemas/BankAccount) for a given company's connection.\r\n\r\n[Bank accounts](https://docs.codat.io/sync-for-payables-api#/schemas/BankAccount) are financial accounts maintained by a bank or other financial institution." + operationId: create-bank-account +webhooks: description: "The *Create bank account* endpoint creates a new [bank account](https://docs.codat.io/lending-api#/schemas/BankAccount) for a given company's connection.\r\n\r\n[Bank accounts](https://docs.codat.io/lending-api#/schemas/BankAccount) are financial accounts maintained by a bank or other financial institution.\r\n\r\n**Integration-specific behavior**\r\n\r\nRequired data may vary by integration. To see what data to post, first call [Get create/update bank account model](https://docs.codat.io/lending-api#/operations/get-create-update-bankAccounts-model)." operationId: create-bank-account x-speakeasy-group: loan-writeback.bank-accounts @@ -76018,6 +76873,10 @@ webhooks: responses: '200': description: Return a 200 status to indicate that the webhook was received successfully. +components: + schemas: + Address: + title: Address reports.categorizedBankStatement.generate.successful: post: description: Called when a categorized bank statement is successfully generated for a company. @@ -76508,6 +77367,7 @@ components: type: object properties: type: + $ref: '#/components/schemas/Address/definitions/addressType' $ref: '#/components/schemas/AccountingAddress/definitions/accountingAddressType' line1: type: string @@ -76528,11 +77388,14 @@ components: country: type: string nullable: true + description: 'Country of the customer''s address. For NetSuite, use the 2-digit [ISO 3166](https://en.wikipedia.org/wiki/List_of_ISO_3166_country_codes) country code.' description: Country of the customer address. postalCode: type: string nullable: true description: Postal code or zip code. + definitions: + addressType: required: - type definitions: @@ -76543,6 +77406,28 @@ components: - Unknown - Billing - Delivery + Attachment: + title: Attachment metadata + description: |2- + The Codat API supports pulling and pushing of file attachments for invoices, bills, direct costs, and direct incomes. + + > **Retrieving attachments** + > + > If a company is authorized, you can query the Codat API to read, download, and upload attachments without requiring a fresh sync of data. + + Unlike other data types, Codat doesn't support [sync settings](https://docs.codat.io/knowledge-base/advanced-sync-settings) for attachments. + + Note that different integrations have different requirements for file size and extension of attachments. + + | Integration | File size | File extension | + |-------------------|-----------|--------------------------------------------------------------------------------------------------------------------------------------------------------------| + | Xero | 4 MB | 7Z, BMP, CSV, DOC, DOCX, EML, GIF, JPEG, JPG, KEYNOTE, MSG, NUMBERS, ODF, ODS, ODT, PAGES, PDF, PNG, PPT, PPTX, RAR, RTF, TIF, TIFF, TXT, XLS, XLSX, ZIP | + | QuickBooks Online | 100 MB | AI, CSV, DOC, DOCX, EPS, GIF, JPEG, JPG, ODS, PAGES, PDF, PNG, RTF, TIF, TXT, XLS, XLSX, XML | + | NetSuite | 100 MB | BMP, CSV, XLS, XLSX, JSON, PDF, PJPG, PJPEG, PNG, TXT, SVG, TIF, TIFF, DOC, DOCX, ZIP | + | Dynamics 365 Business Central | 350 MB | Dynamics do not explicitly outline which file types are supported but they do state here that "You can attach any type of file, such as text, image, or video files". | + type: object + allOf: + - properties: AccountingAgedCreditorReport: title: 'Accounting: Aged creditors report' description: |- @@ -76741,6 +77626,9 @@ components: description: |- File type of the attachment. This is represented by appending the file type to the [IETF standard file naming requirements](https://tools.ietf.org/html/rfc6838). For example, for a jpeg file the output is **image/jpeg**. + Supported file types vary per platform. + dateCreated: + $ref: '#/components/schemas/Connection/properties/created' Supported file types vary per platform. dateCreated: $ref: '#/components/schemas/DateTime' @@ -76752,6 +77640,41 @@ components: includeWhenSent: type: boolean description: 'If `true`, then the attachment is included with the associated invoice, bill or direct costs when it is printed, emailed, or sent to a customer, if the underlying accounting software allows this.' + sourceModifiedDate: + allOf: + - $ref: '#/components/schemas/Connection/properties/created' + - description: |- + The date when a record was last modified in the accounting software, usually by the business or a business process. For example, when payments are made against an invoice. + + It is not populated ([read more](https://docs.codat.io/using-the-api/modified-dates#source-modified-date)) when: + - Pulling attachments + - The accounting software does not provide modification dates for a data type + - A record has been deleted from the source platform and Codat doesn't have a record of when the deletion occurred + - A record has been voided. For certain platforms that soft delete records, `isDeleted` metadata is used to identify void records + + In Codat's data model, dates and times are represented using the ISO 8601 standard. + definitions: + attachments: + title: Attachments + type: array + items: + $ref: '#/components/schemas/Attachment' + AttachmentUpload: + title: Attachment upload + type: object + x-internal: true + required: + - file + properties: + file: + $ref: '#/components/schemas/AttachmentUpload/definitions/codatFile' + definitions: + codatFile: + type: string + description: The file to be uploaded as an attachment. + format: binary + BankAccount: + title: Bank accounts - $ref: '#/components/schemas/CommerceOrder/allOf/3' examples: [] definitions: @@ -76849,6 +77772,12 @@ components: - properties: id: type: string + description: 'Identifier for the bank account, unique for the company in the accounting software.' + nominalCode: + type: string + nullable: true + description: Code used to identify each nominal account for a business. + name: description: 'Identifier for the account, unique for the company in the accounting software.' - $ref: '#/components/schemas/AccountingBankAccount/definitions/bankAccountPrototype' - properties: @@ -76867,6 +77796,7 @@ components: nullable: true description: Name of the bank account in the accounting software. accountType: + $ref: '#/components/schemas/BankAccountType' $ref: '#/components/schemas/AccountingBankAccountType' nominalCode: type: string @@ -76888,6 +77818,66 @@ components: Xero integrations Only a UK account number shows for bank accounts with GBP currency and a combined total of sort code and account number that equals 14 digits, For non-GBP accounts, the full bank account number is populated. + sortCode: + type: string + nullable: true + description: |- + Sort code for the bank account. This is relevant to UK bank accounts. + + Xero integrations + The sort code is only displayed when the currency = GBP and the sort code and account number sum to 14 digits. For non-GBP accounts, this field is not populated. + currency: + $ref: '#/components/schemas/Bill/properties/currency' + description: Base currency of the bank account. + status: + $ref: '#/components/schemas/BankAccount/definitions/bankAccountStatus' + - title: Source Modified Date + x-internal: true + type: object + nullable: true + properties: + sourceModifiedDate: + allOf: + - $ref: '#/components/schemas/Connection/properties/created' + - description: |- + The date when a record was last modified in the accounting software, usually by the business or a business process. For example, when payments are made against an invoice. + + It is not populated ([read more](https://docs.codat.io/using-the-api/modified-dates#source-modified-date)) when: + - Pulling attachments + - The accounting software does not provide modification dates for a data type + - A record has been deleted from the source platform and Codat doesn't have a record of when the deletion occurred + - A record has been voided. For certain platforms that soft delete records, `isDeleted` metadata is used to identify void records + + In Codat's data model, dates and times are represented using the ISO 8601 standard. + definitions: + bankAccountStatus: + type: string + description: The current status of the bank account. + enum: + - Active + - Archived + bankAccountPrototype: + title: Bank account prototype + type: object + properties: + nominalCode: + $ref: '#/components/schemas/BankAccount/allOf/0/properties/nominalCode' + name: + $ref: '#/components/schemas/BankAccount/allOf/0/properties/name' + accountType: + $ref: '#/components/schemas/BankAccountType' + accountNumber: + $ref: '#/components/schemas/BankAccount/allOf/0/properties/accountNumber' + sortCode: + $ref: '#/components/schemas/BankAccount/allOf/0/properties/sortCode' + currency: + $ref: '#/components/schemas/BankAccount/allOf/0/properties/currency' + required: + - name + - accountType + - accountNumber + - currency + BankAccountType: FreeAgent integrations For Credit accounts, only the last four digits are required. For other types, the field is optional. @@ -76985,6 +77975,148 @@ components: The type of transactions and balances on the account. For Credit accounts, positive balances are liabilities, and positive transactions **reduce** liabilities. For Debit accounts, positive balances are assets, and positive transactions **increase** assets. + Bill: + title: Bill + description: "\uFEFFBills are invoices that represent the SMB's financial obligations to their supplier for a purchase of goods or services." + type: object + properties: + id: + type: string + description: 'Identifier for the bill, unique for the company in the accounting software.' + reference: + type: string + nullable: true + description: User-friendly reference for the bill. + supplierRef: + $ref: '#/components/schemas/Supplier/definitions/supplierRef' + issueDate: + allOf: + - description: Date of the bill as recorded in the accounting software. + - $ref: '#/components/schemas/Connection/properties/created' + dueDate: + allOf: + - description: Date the supplier is due to be paid. + - $ref: '#/components/schemas/Connection/properties/created' + currency: + title: Currency + x-internal: true + type: string + description: |- + The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + + ## Unknown currencies + + In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + + There are only a very small number of edge cases where this currency code is returned by the Codat system. + format: ISO4217 + examples: + - GBP + - USD + - EUR + currencyRate: + title: Currency rate + type: number + format: decimal + nullable: true + description: |- + Rate to convert the total amount of the payment into the base currency for the company at the time of the payment. + + Currency rates in Codat are implemented as the multiple of foreign currency units to each base currency unit. + + It is not possible to perform the currency conversion with two or more non-base currencies participating in the transaction. For example, if a company's base currency is USD, and it has a bill issued in EUR, then the bill payment must happen in USD or EUR. + + Where the currency rate is provided by the underlying accounting software, it will be available from Codat with the same precision (up to a maximum of 9 decimal places). + + For accounting software which do not provide an explicit currency rate, it is calculated as `baseCurrency / foreignCurrency` and will be returned to 9 decimal places. + + ## Examples with base currency of GBP + + | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (GBP) | + | :--------------- | :------------- | :------------ | :------------------------- | + | **USD** | $20 | 0.781 | £15.62 | + | **EUR** | €20 | 0.885 | £17.70 | + | **RUB** | ₽20 | 0.011 | £0.22 | + + ## Examples with base currency of USD + + | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (USD) | + | :--------------- | :------------- | :------------ | :------------------------- | + | **GBP** | £20 | 1.277 | $25.54 | + | **EUR** | €20 | 1.134 | $22.68 | + | **RUB** | ₽20 | 0.015 | $0.30 | + + + ### Integration-specific details + + | Integration | Scenario | System behavior | + |-------------------|-------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------| + | QuickBooks Online | Transaction currency differs from base currency | If currency rate value is left `null`, a rate of 1 will be used by QBO by default. To override this, specify a currencyRate in the request body. | + lineItems: + type: array + nullable: true + description: Array of Bill line items. + items: + $ref: '#/components/schemas/Bill/definitions/billLineItem' + status: + $ref: '#/components/schemas/Bill/definitions/billStatus' + totalAmount: + type: number + format: decimal + description: 'Amount of the bill, including tax.' + amountDue: + type: number + format: decimal + nullable: true + description: Amount outstanding on the bill. + sourceModifiedDate: + allOf: + - $ref: '#/components/schemas/Connection/properties/created' + - description: |- + The date when a record was last modified in the accounting software, usually by the business or a business process. For example, when payments are made against an invoice. + + It is not populated ([read more](https://docs.codat.io/using-the-api/modified-dates#source-modified-date)) when: + - Pulling attachments + - The accounting software does not provide modification dates for a data type + - A record has been deleted from the source platform and Codat doesn't have a record of when the deletion occurred + - A record has been voided. For certain platforms that soft delete records, `isDeleted` metadata is used to identify void records + + In Codat's data model, dates and times are represented using the ISO 8601 standard. + required: + - supplierRef + - issueDate + - dueDate + - currency + - status + definitions: + billPrototype: + title: Bill prototype + type: object + properties: + reference: + $ref: '#/components/schemas/Bill/properties/reference' + supplierRef: + $ref: '#/components/schemas/Supplier/definitions/supplierRef' + issueDate: + $ref: '#/components/schemas/Bill/properties/issueDate' + dueDate: + $ref: '#/components/schemas/Bill/properties/dueDate' + currency: + $ref: '#/components/schemas/Bill/properties/currency' + currencyRate: + $ref: '#/components/schemas/Bill/properties/currencyRate' + lineItems: + $ref: '#/components/schemas/Bill/properties/lineItems' + status: + $ref: '#/components/schemas/Bill/definitions/billStatus' + required: + - supplierRef + - issueDate + - dueDate + - currency + - status + billStatus: + description: Current state of the bill. If creating a bill the status must be `Open`. AccountingBankTransaction: title: 'Accounting: Bank account transaction' description: |- @@ -77202,6 +78334,7 @@ components: - Paid - Void - Draft + example: Open billLineItem: title: Bill line item type: object @@ -77217,11 +78350,18 @@ components: unitAmount: type: number format: decimal + description: Unit price of the goods or service. description: Price of each unit of goods or services. quantity: type: number format: decimal description: Number of units of goods or services received. + taxAmount: + type: number + format: decimal + description: Amount of tax applied to the line item. + accountRef: + $ref: '#/components/schemas/Bill/definitions/billAccountRef' unitOfMeasurement: type: string nullable: true @@ -77249,6 +78389,32 @@ components: format: decimal nullable: true description: 'Total amount of the line, including tax.' + taxRateRef: + $ref: '#/components/schemas/Bill/definitions/billTaxRateRef' + trackingRefs: + type: array + nullable: true + items: + $ref: '#/components/schemas/Bill/definitions/trackingRef' + billAccountRef: + title: Account reference + type: object + description: Reference to the account to which the line item is linked. + properties: + id: + type: string + description: '''id'' from the Accounts data type.' + billTaxRateRef: + title: Tax rate reference + type: object + description: Reference to the tax rate to which the line item is linked. + properties: + id: + type: string + description: Unique identifier for the tax rate in the accounting software. + bills: + title: Bills + type: object discountPercentage: type: number format: decimal @@ -77616,6 +78782,200 @@ components: results: type: array items: + $ref: '#/components/schemas/Bill' + pagination: + $ref: '#/components/schemas/Pagination' + trackingRef: + type: object + title: Tracking reference + properties: + id: + type: string + example: e9a1b63d-9ff0-40e7-8038-016354b987e6 + description: Unique identifier of the linked tracking category or the unique identifier of the linked customer. + dataType: + type: string + example: trackingCategories + description: The type of the linked reference. + enum: + - trackingCategories + - customers + isBillable: + type: boolean + description: If a customer has been set as the trackingRefs.id then this boolean can be used to set whether the line item is billable to the customer or not. + BillEventWebhook: + x-internal: true + title: Bill event webhook + type: object + properties: + id: + type: string + format: uuid + description: Unique identifier of the bill event. + type: + type: string + description: Type of webhook event. + example: payables.bill.created + createdDate: + type: string + description: The datetime in UTC of when the webhook event was produced by Codat. + examples: + - '2022-10-23T11:03:35Z' + payload: + $ref: '#/components/schemas/BillEventWebhook/definitions/billEventPayload' + definitions: + billEventPayload: + title: Bill event payload + type: object + properties: + companyId: + $ref: '#/components/parameters/companyId/schema' + connectionId: + $ref: '#/components/parameters/connectionId/schema' + pushOperationKey: + type: string + format: uuid + example: 2e9d2c44-f675-40ba-8049-353bfcb5e171 + description: Unique identifier for the push operation. + bill: + $ref: '#/components/schemas/Bill' + BillMappingOptions: + x-internal: true + title: Mapping options bills + description: The bill mapping options for a company's accounting software. + type: object + properties: + accounts: + type: array + items: + $ref: '#/components/schemas/BillMappingOptions/definitions/accountMappingOption' + taxRates: + type: array + items: + $ref: '#/components/schemas/BillMappingOptions/definitions/taxRateMappingOption' + pagination: + $ref: '#/components/schemas/Pagination' + definitions: + accountMappingOption: + title: Account mapping option + type: object + allOf: + - properties: + id: + type: string + description: 'Identifier for the account, unique for the company.' + example: 1b6266d1-1e44-46c5-8eb5-a8f98e03124e + nominalCode: + type: string + nullable: true + description: Reference given to each nominal account for a business. It ensures money is allocated to the correct account. This code isn't a unique identifier in the Codat system. + example: '610' + name: + type: string + nullable: true + description: Name of the account. + example: Accounts Payable + type: + type: string + nullable: true + description: Type of account. + example: Liability + currency: + $ref: '#/components/schemas/Bill/properties/currency' + status: + $ref: '#/components/schemas/BillMappingOptions/definitions/accountStatus' + - $ref: '#/components/schemas/BankAccount/allOf/1' + taxRateMappingOption: + title: Tax rate mapping option + type: object + allOf: + - properties: + id: + type: string + description: 'Identifier for the tax rate, unique for the company in the accounting software.' + example: d2939064-dd3a-4c0f-9865-a238c2193515 + name: + type: string + nullable: true + description: Codat-augmented name of the tax rate in the accounting software. + code: + type: string + nullable: true + description: Code for the tax rate from the accounting software. + effectiveTaxRate: + type: number + format: decimal + nullable: true + description: See Effective tax rates description. + totalTaxRate: + type: number + format: decimal + nullable: true + description: Total (not compounded) sum of the components of a tax rate. + status: + title: Tax rate status + type: string + enum: + - Active + - Archived + description: |- + Status of the tax rate in the accounting software. + - `Active` - An active tax rate in use by a company. + - `Archived` - A tax rate that has been archived or is inactive in the accounting software. + accountStatus: + type: string + description: The current status of the account. + enum: + - Active + - Archived + example: Active + BillPayment: + title: Bill payment + type: object + description: '' + properties: + id: + type: string + description: 'Identifier for the bill payment, unique for the company in the accounting software.' + amount: + type: number + format: decimal + description: Amount of the payment in the bill currency. + example: 1329.54 + date: + allOf: + - $ref: '#/components/schemas/Connection/properties/created' + - description: Date the bill payment was recorded in the accounting software. + reference: + type: string + nullable: true + description: Additional information associated with the payment. + example: Bill Payment against bill c13e37b6-dfaa-4894-b3be-9fe97bda9f44 + accountRef: + $ref: '#/components/schemas/BillPayment/definitions/billPaymentAccountRef' + currencyRate: + $ref: '#/components/schemas/Bill/properties/currencyRate' + definitions: + billPaymentPrototype: + title: Bill payment prototype + type: object + properties: + amount: + $ref: '#/components/schemas/BillPayment/properties/amount' + date: + $ref: '#/components/schemas/BillPayment/properties/date' + reference: + $ref: '#/components/schemas/BillPayment/properties/reference' + accountRef: + $ref: '#/components/schemas/BillPayment/definitions/billPaymentAccountRef' + currencyRate: + $ref: '#/components/schemas/Bill/properties/currencyRate' + required: + - amount + - date + - accountRef + billPaymentAccountRef: + description: Reference to the bank account / credit card which you are using to pay the bill. $ref: '#/components/schemas/AccountingBillCreditNote' - $ref: '#/components/schemas/PagingInfo' AccountingBillPayment: @@ -78294,6 +79654,16 @@ components: properties: id: type: string + description: Unique ID of the bank account / credit card + required: + - id + example: + amount: 22 + date: '2022-10-23T00:00:00.000Z' + reference: Bill Payment against bill c13e37b6 dfaa-4894-b3be-9fe97bda9f44 + accountRef: + id: 9e32cbf8-e7d5-4d4d-a593-08d550682aab + currencyRate: 1 description: 'Identifier for the bank account transaction, unique for the company in the accounting software.' amount: type: number @@ -81184,6 +82554,7 @@ components: - client.rateLimit.reset - client.rateLimit.reached generatedDate: + $ref: '#/components/schemas/Connection/properties/created' $ref: '#/components/schemas/DateTime' description: The date time in UTC the event was generated in Codat. payload: @@ -81200,6 +82571,8 @@ components: type: integer description: Total number of requests remaining for your client. expiryDate: + $ref: '#/components/schemas/Connection/properties/created' + description: The date time in UTC when your daily quota is reset. $ref: '#/components/schemas/DateTime' description: The date time in UTC when your daily quota is reset. CommerceAddress: @@ -82711,6 +84084,7 @@ components: - $ref: '#/components/schemas/PagingInfo' Company: title: Company + description: "\uFEFFIn Codat, a company represents a business sharing access to their data. Each company can have multiple [connections](https://docs.codat.io/sync-for-payables-api#/schemas/Connection) to different data sources such as one connection to [Xero](https://docs.codat.io/integrations/accounting/xero/accounting-xero) for accounting data, two connections to [Plaid](https://docs.codat.io/integrations/banking/plaid/banking-plaid) for two bank accounts and a connection to [Zettle](https://docs.codat.io/integrations/commerce/zettle/commerce-zettle) for POS data.\n\nTypically each company is one of your customers.\n\nWhen you create a company, you can specify a `name` and we will automatically generate a unique `id` for the company. You can also add a `description` to store any additional information about the company." description: "\uFEFFIn Codat, a company represents a business sharing access to their data. Each company can have multiple [connections](https://docs.codat.io/lending-api#/schemas/Connection) to different data sources such as one connection to [Xero](https://docs.codat.io/integrations/accounting/xero/accounting-xero) for accounting data, two connections to [Plaid](https://docs.codat.io/integrations/banking/plaid/banking-plaid) for two bank accounts and a connection to [Zettle](https://docs.codat.io/integrations/commerce/zettle/commerce-zettle) for POS data.\n\nTypically each company is one of your customers.\n\nWhen you create a company, you can specify a `name` and we will automatically generate a unique `id` for the company. You can also add a `description` to store any additional information about the company." type: object allOf: @@ -82741,6 +84115,10 @@ components: description: 'The `redirect` [Link URL](https://docs.codat.io/auth-flow/authorize-hosted-link) enabling the customer to start their auth flow journey for the company.' example: 'https://link.codat.io/company/27628208-459c-46a2-a705-5641ce25f739' lastSync: + $ref: '#/components/schemas/Connection/properties/created' + nullable: true + created: + $ref: '#/components/schemas/Connection/properties/created' $ref: '#/components/schemas/DateTime' nullable: true created: @@ -82823,6 +84201,19 @@ components: products: - spend-insights - lending + CompanyInformation: + title: Company information + type: object + description: Gets the latest basic info for a company. + properties: + companyName: + type: string + nullable: true + description: Name of the linked company. + baseCurrency: + type: string + nullable: true + description: Currency set in the accounting software of the linked company. Used by the currency rate. CompanyRequestBody: title: Create company request x-internal: true @@ -82859,6 +84250,7 @@ components: $ref: '#/components/schemas/Company/definitions/companyDetails/properties/tags' Connection: title: Connection + description: "\uFEFFA connection represents a [company's](https://docs.codat.io/sync-for-payables-api#/schemas/Company) connection to a data source and allows you to synchronize data (pull and/or push) with that source.\n\nA company can have multiple data connections depending on the type of data source it is connecting to. For example, a single company can link to:\n\n- [Accounting data](https://docs.codat.io/accounting-api/overview) - 1 active connection.\n- [Banking data](https://docs.codat.io/banking-api/overview) - Multiple active connections.\n- [Commerce data](https://docs.codat.io/commerce-api/overview) - Multiple active connections.\nAny combination of accounting, banking, and commerce data connections is allowed.\n\nBefore you can use a data connection to pull or push data, the company must grant you access to their business data by [linking the connection](https://docs.codat.io/auth-flow/overview)." description: "\uFEFFA connection represents a [company's](https://docs.codat.io/lending-api#/schemas/Company) connection to a data source and allows you to synchronize data (pull and/or push) with that source.\n\nA company can have multiple data connections depending on the type of data source it is connecting to. For example, a single company can link to:\n\n- [Accounting data](https://docs.codat.io/accounting-api/overview) - 1 active connection.\n- [Banking data](https://docs.codat.io/banking-api/overview) - Multiple active connections.\n- [Commerce data](https://docs.codat.io/commerce-api/overview) - Multiple active connections.\nAny combination of accounting, banking, and commerce data connections is allowed.\n\nBefore you can use a data connection to pull or push data, the company must grant you access to their business data by [linking the connection](https://docs.codat.io/auth-flow/overview)." type: object properties: @@ -82901,6 +84293,34 @@ components: status: $ref: '#/components/schemas/Connection/definitions/dataConnectionStatus' lastSync: + $ref: '#/components/schemas/Connection/properties/created' + nullable: true + created: + title: Date time + type: string + examples: + - '2022-10-23T00:00:00Z' + - '2022-10-23' + description: |- + In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: + + ``` + 2020-10-08T22:40:50Z + 2021-01-01T00:00:00 + ``` + + + + When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: + + - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` + - Unqualified local time: `2021-11-15T01:00:00` + - UTC time offsets: `2021-11-15T01:00:00-05:00` + + > Time zones + > + > Not all dates from Codat will contain information about time zones. + > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. $ref: '#/components/schemas/DateTime' nullable: true created: @@ -82949,6 +84369,7 @@ components: type: string description: A message about a error returned by Codat. erroredOnUtc: + $ref: '#/components/schemas/Connection/properties/created' $ref: '#/components/schemas/DateTime' status: title: Error status @@ -82961,6 +84382,7 @@ components: resolvedOnUtc: description: The datetime in Utc that the error was resolved. nullable: true + $ref: '#/components/schemas/Connection/properties/created' $ref: '#/components/schemas/DateTime' dataConnectionSourceType: title: Source Type @@ -83309,6 +84731,7 @@ components: - commerce-transactions example: invoices lastSuccessfulSync: + $ref: '#/components/schemas/Connection/properties/created' $ref: '#/components/schemas/DateTime' currentStatus: $ref: '#/components/schemas/PullOperation/properties/status' @@ -83328,6 +84751,9 @@ components: currentStatus: string latestSyncId: ad474a37-2003-478e-baee-9af9f1ec2fe3 latestSuccessfulSyncId: 8220fc90-55b6-47bc-9417-48ac6ea93101 + DataType: + x-internal: true + $ref: '#/components/schemas/DataStatus/properties/dataType' DataStatusResponse: x-internal: true title: Data status response @@ -83943,6 +85369,14 @@ components: type: string nullable: true description: Name of validator. + Pagination: + title: Pagination metadata + x-internal: true + type: object + properties: + continuationToken: + type: string + description: 'A continuation token indicating there are more results to be fetched. Supply this value in the `continuationToken` query parameter in the next request to fetch the next set of results. Once no more results are available, the continuation token will not be present in the response.' ExcelStatus: type: object title: Excel status @@ -84358,6 +85792,69 @@ components: href: '/companies/{id}/data/{dataType}' current: href: '/companies/{id}/data/{dataType}?page=1&pageSize=10' + PaymentMappingOptions: + x-internal: true + title: Mapping Options Payments + description: Gets the bill payments mapping options for a company's accounting software + type: object + properties: + bankAccounts: + type: array + items: + $ref: '#/components/schemas/PaymentMappingOptions/definitions/bankAccountMappingOption' + pagination: + $ref: '#/components/schemas/Pagination' + definitions: + bankAccountMappingOption: + title: Bank account mapping option + type: object + allOf: + - properties: + id: + type: string + description: 'Identifier for the account, unique for the company in the accounting software.' + example: 3d5a8e00-d108-4045-8823-7f342676cffa + name: + type: string + nullable: true + description: Name of the bank account in the accounting software. + example: Bank of Dave current account + accountNumber: + type: string + nullable: true + description: |- + Account number for the bank account. + + Xero integrations + Only a UK account number shows for bank accounts with GBP currency and a combined total of sort code and account number that equals 14 digits, For non-GBP accounts, the full bank account number is populated. + nominalCode: + type: string + nullable: true + description: Code used to identify each nominal account for a business. + sortCode: + type: string + nullable: true + description: |- + Sort code for the bank account. + + Xero integrations + The sort code is only displayed when the currency = GBP and the sort code and account number sum to 14 digits. For non-GBP accounts, this field is not populated. + currency: + type: string + nullable: true + description: The bank account's base currency. + status: + $ref: '#/components/schemas/PaymentMappingOptions/definitions/bankAccountStatus' + accountType: + $ref: '#/components/schemas/BankAccountType' + - $ref: '#/components/schemas/BankAccount/allOf/1' + bankAccountStatus: + type: string + description: The current status of the bank account. + enum: + - Active + - Archived + example: Active PaymentMethodRef: type: object title: Payment method reference @@ -84476,6 +85973,9 @@ components: nullable: true description: A message about a transient or persistent error returned by Codat or the source platform. requested: + $ref: '#/components/schemas/Connection/properties/created' + completed: + $ref: '#/components/schemas/Connection/properties/created' $ref: '#/components/schemas/DateTime' completed: $ref: '#/components/schemas/DateTime' @@ -84543,6 +86043,10 @@ components: dataConnectionKey: $ref: '#/components/parameters/connectionId/schema' requestedOnUtc: + $ref: '#/components/schemas/Connection/properties/created' + description: The datetime when the push was requested. + completedOnUtc: + $ref: '#/components/schemas/Connection/properties/created' $ref: '#/components/schemas/DateTime' description: The datetime when the push was requested. completedOnUtc: @@ -84663,6 +86167,9 @@ components: items: $ref: '#/components/schemas/PushOperation' - $ref: '#/components/schemas/PagingInfo' + Supplier: + title: Supplier + description: "\uFEFFSuppliers are people or organizations that provide something, such as a product or service. Use the [List suppliers](https://docs.codat.io/sync-for-payables-v2-api#/operations/list-suppliers) endpoint to retrieve a list of all suppliers for a company.\n\nSuppliers' data links to accounts payable [bills](https://docs.codat.io/sync-for-payables-v2-api#/schemas/Bill).\n " PushOption: title: Push option x-internal: true @@ -84821,6 +86328,34 @@ components: properties: id: type: string + description: 'Identifier for the supplier, unique to the company in the accounting software.' + supplierName: + type: string + description: 'Name of the supplier as recorded in the accounting system, typically the company name.' + contactName: + type: string + nullable: true + description: Name of the main contact for the supplier. + emailAddress: + type: string + nullable: true + description: Email address that the supplier may be contacted on. + phone: + type: string + nullable: true + description: Phone number that the supplier may be contacted on. + examples: + - +44 25691 154789 + - (877) 492-8687 + - 01224 658 999 + addresses: + type: array + nullable: true + description: An array of Addresses. + items: + $ref: '#/components/schemas/Address' + status: + $ref: '#/components/schemas/Supplier/definitions/supplierStatus' format: uuid description: Unique identifier of the report example: 52c0f26b-051a-43ff-b02a-258eec67f5ef @@ -84908,6 +86443,108 @@ components: type: number format: decimal nullable: true + description: Amount outstanding against the supplier. + defaultCurrency: + type: string + nullable: true + description: Default currency the supplier's transactional data is recorded in. + sourceModifiedDate: + allOf: + - $ref: '#/components/schemas/Connection/properties/created' + - description: |- + The date when a record was last modified in the accounting software, usually by the business or a business process. For example, when payments are made against an invoice. + + It is not populated ([read more](https://docs.codat.io/using-the-api/modified-dates#source-modified-date)) when: + - Pulling attachments + - The accounting software does not provide modification dates for a data type + - A record has been deleted from the source platform and Codat doesn't have a record of when the deletion occurred + - A record has been voided. For certain platforms that soft delete records, `isDeleted` metadata is used to identify void records + + In Codat's data model, dates and times are represented using the ISO 8601 standard. + definitions: + supplierPrototype: + title: Supplier prototype + type: object + properties: + supplierName: + $ref: '#/components/schemas/Supplier/properties/supplierName' + contactName: + $ref: '#/components/schemas/Supplier/properties/contactName' + emailAddress: + $ref: '#/components/schemas/Supplier/properties/emailAddress' + phone: + $ref: '#/components/schemas/Supplier/properties/phone' + addresses: + $ref: '#/components/schemas/Supplier/properties/addresses' + status: + $ref: '#/components/schemas/Supplier/definitions/supplierStatus' + balance: + $ref: '#/components/schemas/Supplier/properties/balance' + defaultCurrency: + $ref: '#/components/schemas/Supplier/properties/defaultCurrency' + required: + - supplierName + - status + supplierRef: + title: Supplier reference + description: Reference to the supplier the record relates to. + type: object + properties: + id: + minLength: 1 + type: string + description: The supplier's unique ID + supplierName: + type: string + nullable: true + description: The supplier's name + required: + - id + supplierStatus: + description: Status of the supplier. + type: string + enum: + - Unknown + - Active + - Archived + suppliers: + title: Suppliers + type: object + properties: + results: + type: array + items: + $ref: '#/components/schemas/Supplier' + pagination: + $ref: '#/components/schemas/Pagination' + examples: + - id: C520FFD4-F6F6-4FC2-A6D2-5D7088B2B14F + supplierName: Kelly's Industrial Supplies + contactName: Kelly Ipsum + emailAddress: sales@kellysupplies.com + phone: 07999 999999 + addresses: + - type: Billing + line1: Unit 51 + line2: Bakersfield Industrial Estate + city: Bakersfield + region: California + country: USA + postalcode: '93308' + status: Active + amount: 100 + defaultCurrency: GBP + sourceModifiedDate: '2022-10-23T00:00:00Z' + parameters: + attachmentId: + name: attachmentId + in: path + required: true + schema: + type: string + format: uuid + example: 8a210b68-6988-11ed-a1eb-0242ac120002 + description: Unique identifier for an attachment. description: The latest balance for the bank account. modifiedDate: $ref: '#/components/schemas/DateTime' @@ -85253,6 +86890,18 @@ components: type: string example: '-modifiedDate' description: 'Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results).' + billId: + name: billId + in: path + required: true + schema: + type: string + examples: + - 13d946f0-c5d5-42bc-b092-97ece17923ab + - 9wg4lep4ush5cxs79pl8sozmsndbaukll3ind4g7buqbm1h2 + - 7110701885 + - EILBDVJVNUAGVKRQ + description: Unique identifier for a bill. companyId: name: companyId in: path @@ -85273,6 +86922,8 @@ components: example: 2e9d2c44-f675-40ba-8049-353bfcb5e171 description: Unique identifier for a company's data connection. description: Unique identifier for a connection. + continuationToken: + name: continuationToken dataType: name: dataType description: A key for a Codat data type. @@ -85576,6 +87227,16 @@ components: required: false schema: type: string + example: continuationToken=eyJwYWdlIjoyLCJwYWdlU2l6ZSI6MTAwLCJwYWdlQ291bnQiOjExfQ== + description: Retrieve the next page of results using the continuation token from the previous response. + statusQuery: + name: statusQuery + in: query + required: false + schema: + type: string + example: status=Archived + description: 'Codat query string allows you to filter by `status` (`status=Active||status=Archived`). [Learn more](https://docs.codat.io/using-the-api/querying) about Codat''s query string.' enum: - auth/get reportType: @@ -85747,6 +87408,21 @@ components: correlationId: bc997528a9d7abb9161ef45f05d38599 canBeRetried: Unknown detailedErrorCode: 0 + Idempotency-Conflict: + description: A request is in progress with the same idempotency key. + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorMessage' + examples: + Conflict: + value: + statusCode: 409 + service: PublicApi + error: The data set has not been requested. + correlationId: bc997528a9d7abb9161ef45f05d38599 + canBeRetried: Unknown + detailedErrorCode: 0 Too-Many-Requests: description: Too many requests were made in a given amount of time. Wait a short period and then try again. content: diff --git a/.speakeasy/logs/changes/old.openapi.yaml b/.speakeasy/logs/changes/old.openapi.yaml index 747aeacf1..9e1b0d9a0 100644 --- a/.speakeasy/logs/changes/old.openapi.yaml +++ b/.speakeasy/logs/changes/old.openapi.yaml @@ -3,6 +3,8 @@ servers: - description: Production url: 'https://api.codat.io' info: + title: Bill pay (synchronous solution) + description: "The API reference for the synchronous Bill Pay solution. \n\nThe synchronous Bill Pay solution is an API and a set of supporting tools designed to integrate a bill pay flow into your app as quickly as possible. It's ideal for facilitating essential bill payment processes within your SMB's accounting software.\n\n[Explore solution](https://docs.codat.io/payables/overview) | [See OpenAPI spec](https://github.com/codatio/oas)\n\n---\n## Supported Integrations\n\n| Integration | Supported |\n|-------------------------------|-----------|\n| FreeAgent | Yes |\n| QuickBooks Online | Yes |\n| Oracle NetSuite | Yes |\n| Sage Intacct | Yes |\n| Xero | Yes |\n| Zoho Books | Yes |\n\n---\n\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| Company information | View company profile from the source platform. |\n| Bills | Get, create, and update Bills. |\n| Bill payments | Get, create, and update Bill payments. |\n| Suppliers | Get, create, and update Suppliers. |\n| Bank accounts | Create a bank account for a given company's connection. |\n" title: Lending description: |- Our Lending solution helps you make smarter credit decisions on small businesses by enabling you to pull your customers' latest data from accounting, banking, and commerce software they are already using. It also includes features to help providers verify the accuracy of data and process it more efficiently. @@ -76,6 +78,7 @@ x-speakeasy-name-override: methodNameOverride: download-attachment - operationId: ^upload-.*?-attachment methodNameOverride: upload-attachment +x-codat-docs-path: sync-for-payables-api x-codat-docs-path: lending-api x-codat-keep-docs-paths-local: true x-codat-speakeasy-pagination: @@ -91,6 +94,16 @@ tags: description: Create and manage your SMB users' companies. - name: Connections description: Create new and manage existing data connections for a company. + - name: Company information + description: View company profile from the source platform. + - name: Bills + description: 'Get, create, and update Bills.' + - name: Bill payments + description: 'Get, create, and update Bill payments.' + - name: Suppliers + description: 'Get, create, and update Suppliers.' + - name: Bank accounts + description: Create a bank account for a given company's connection. - name: Bank statements description: Retrieve banking data from linked bank accounts. - name: Sales @@ -292,6 +305,7 @@ paths: '503': $ref: '#/components/responses/Service-Unavailable' operationId: list-companies + description: "\uFEFF\x54\x68\x65\x20\x2A\x4C\x69\x73\x74\x20\x63\x6F\x6D\x70\x61\x6E\x69\x65\x73\x2A\x20\x65\x6E\x64\x70\x6F\x69\x6E\x74\x20\x72\x65\x74\x75\x72\x6E\x73\x20\x61\x20\x6C\x69\x73\x74\x20\x6F\x66\x20\x5B\x63\x6F\x6D\x70\x61\x6E\x69\x65\x73\x5D\x28\x68\x74\x74\x70\x73\x3A\x2F\x2F\x64\x6F\x63\x73\x2E\x63\x6F\x64\x61\x74\x2E\x69\x6F\x2F\x73\x79\x6E\x63\x2D\x66\x6F\x72\x2D\x70\x61\x79\x61\x62\x6C\x65\x73\x2D\x61\x70\x69\x23\x2F\x73\x63\x68\x65\x6D\x61\x73\x2F\x43\x6F\x6D\x70\x61\x6E\x79\x29\x20\x61\x73\x73\x6F\x63\x69\x61\x74\x65\x64\x20\x74\x6F\x20\x79\x6F\x75\x72\x20\x69\x6E\x73\x74\x61\x6E\x63\x65\x73\x2E\n\n\x41\x20\x5B\x63\x6F\x6D\x70\x61\x6E\x79\x5D\x28\x68\x74\x74\x70\x73\x3A\x2F\x2F\x64\x6F\x63\x73\x2E\x63\x6F\x64\x61\x74\x2E\x69\x6F\x2F\x73\x79\x6E\x63\x2D\x66\x6F\x72\x2D\x70\x61\x79\x61\x62\x6C\x65\x73\x2D\x61\x70\x69\x23\x2F\x73\x63\x68\x65\x6D\x61\x73\x2F\x43\x6F\x6D\x70\x61\x6E\x79\x29\x20\x72\x65\x70\x72\x65\x73\x65\x6E\x74\x73\x20\x61\x20\x62\x75\x73\x69\x6E\x65\x73\x73\x20\x73\x68\x61\x72\x69\x6E\x67\x20\x61\x63\x63\x65\x73\x73\x20\x74\x6F\x20\x74\x68\x65\x69\x72\x20\x64\x61\x74\x61\x2E\n\x45\x61\x63\x68\x20\x63\x6F\x6D\x70\x61\x6E\x79\x20\x63\x61\x6E\x20\x68\x61\x76\x65\x20\x6D\x75\x6C\x74\x69\x70\x6C\x65\x20\x5B\x63\x6F\x6E\x6E\x65\x63\x74\x69\x6F\x6E\x73\x5D\x28\x68\x74\x74\x70\x73\x3A\x2F\x2F\x64\x6F\x63\x73\x2E\x63\x6F\x64\x61\x74\x2E\x69\x6F\x2F\x73\x79\x6E\x63\x2D\x66\x6F\x72\x2D\x70\x61\x79\x61\x62\x6C\x65\x73\x2D\x61\x70\x69\x23\x2F\x73\x63\x68\x65\x6D\x61\x73\x2F\x43\x6F\x6E\x6E\x65\x63\x74\x69\x6F\x6E\x29\x20\x74\x6F\x20\x64\x69\x66\x66\x65\x72\x65\x6E\x74\x20\x64\x61\x74\x61\x20\x73\x6F\x75\x72\x63\x65\x73\x2C\x20\x73\x75\x63\x68\x20\x61\x73\x20\x6F\x6E\x65\x20\x63\x6F\x6E\x6E\x65\x63\x74\x69\x6F\x6E\x20\x74\x6F\x20\x58\x65\x72\x6F\x20\x66\x6F\x72\x20\x61\x63\x63\x6F\x75\x6E\x74\x69\x6E\x67\x20\x64\x61\x74\x61\x2C\x20\x74\x77\x6F\x20\x63\x6F\x6E\x6E\x65\x63\x74\x69\x6F\x6E\x73\x20\x74\x6F\x20\x50\x6C\x61\x69\x64\x20\x66\x6F\x72\x20\x74\x77\x6F\x20\x62\x61\x6E\x6B\x20\x61\x63\x63\x6F\x75\x6E\x74\x73\x2C\x20\x61\x6E\x64\x20\x61\x20\x63\x6F\x6E\x6E\x65\x63\x74\x69\x6F\x6E\x20\x74\x6F\x20\x5A\x65\x74\x74\x6C\x65\x20\x66\x6F\x72\x20\x50\x4F\x53\x20\x64\x61\x74\x61\x2E\n\n\x23\x23\x20\x46\x69\x6C\x74\x65\x72\x20\x62\x79\x20\x74\x61\x67\x73\n\n\x54\x68\x65\x20\x2A\x4C\x69\x73\x74\x20\x63\x6F\x6D\x70\x61\x6E\x69\x65\x73\x2A\x20\x65\x6E\x64\x70\x6F\x69\x6E\x74\x20\x73\x75\x70\x70\x6F\x72\x74\x73\x20\x74\x68\x65\x20\x66\x69\x6C\x74\x65\x72\x69\x6E\x67\x20\x6F\x66\x20\x63\x6F\x6D\x70\x61\x6E\x69\x65\x73\x20\x75\x73\x69\x6E\x67\x20\x5B\x74\x61\x67\x73\x5D\x28\x68\x74\x74\x70\x73\x3A\x2F\x2F\x64\x6F\x63\x73\x2E\x63\x6F\x64\x61\x74\x2E\x69\x6F\x2F\x75\x73\x69\x6E\x67\x2D\x74\x68\x65\x2D\x61\x70\x69\x2F\x6D\x61\x6E\x61\x67\x69\x6E\x67\x2D\x63\x6F\x6D\x70\x61\x6E\x69\x65\x73\x23\x61\x64\x64\x2D\x6D\x65\x74\x61\x64\x61\x74\x61\x2D\x74\x6F\x2D\x61\x2D\x63\x6F\x6D\x70\x61\x6E\x79\x29\x2E\x20\x49\x74\x20\x73\x75\x70\x70\x6F\x72\x74\x73\x20\x74\x68\x65\x20\x66\x6F\x6C\x6C\x6F\x77\x69\x6E\x67\x20\x6F\x70\x65\x72\x61\x74\x6F\x72\x73\x20\x77\x69\x74\x68\x20\x5B\x43\x6F\x64\x61\x74\u2019\x73\x20\x71\x75\x65\x72\x79\x20\x6C\x61\x6E\x67\x75\x61\x67\x65\x5D\x28\x68\x74\x74\x70\x73\x3A\x2F\x2F\x64\x6F\x63\x73\x2E\x63\x6F\x64\x61\x74\x2E\x69\x6F\x2F\x75\x73\x69\x6E\x67\x2D\x74\x68\x65\x2D\x61\x70\x69\x2F\x71\x75\x65\x72\x79\x69\x6E\x67\x29\x3A\n\n\x2D\x20\x65\x71\x75\x61\x6C\x73\x20\x28\x60\x3D\x60\x29\n\x2D\x20\x6E\x6F\x74\x20\x65\x71\x75\x61\x6C\x73\x20\x28\x60\x21\x3D\x60\x29\n\x2D\x20\x63\x6F\x6E\x74\x61\x69\x6E\x73\x20\x28\x60\x7E\x60\x29\n\n\x46\x6F\x72\x20\x65\x78\x61\x6D\x70\x6C\x65\x2C\x20\x79\x6F\x75\x20\x63\x61\x6E\x20\x75\x73\x65\x20\x74\x68\x65\x20\x71\x75\x65\x72\x79\x69\x6E\x67\x20\x74\x6F\x20\x66\x69\x6C\x74\x65\x72\x20\x63\x6F\x6D\x70\x61\x6E\x69\x65\x73\x20\x74\x61\x67\x67\x65\x64\x20\x77\x69\x74\x68\x20\x61\x20\x73\x70\x65\x63\x69\x66\x69\x63\x20\x66\x6F\x72\x65\x69\x67\x6E\x20\x6B\x65\x79\x2C\x20\x72\x65\x67\x69\x6F\x6E\x2C\x20\x6F\x72\x20\x6F\x77\x6E\x69\x6E\x67\x20\x74\x65\x61\x6D\x3A\x20\n\x2D\x20\x46\x6F\x72\x65\x69\x67\x6E\x20\x6B\x65\x79\x3A\x20\x60\x75\x69\x64\x20\x3D\x20\x7B\x79\x6F\x75\x72\x43\x75\x73\x74\x6F\x6D\x65\x72\x49\x64\x7D\x60\n\x2D\x20\x52\x65\x67\x69\x6F\x6E\x3A\x20\x60\x72\x65\x67\x69\x6F\x6E\x20\x21\x3D\x20\x75\x6B\x60\n\x2D\x20\x4F\x77\x6E\x69\x6E\x67\x20\x74\x65\x61\x6D\x20\x61\x6E\x64\x20\x72\x65\x67\x69\x6F\x6E\x3A\x20\x60\x72\x65\x67\x69\x6F\x6E\x20\x3D\x20\x75\x6B\x20\x26\x26\x20\x6F\x77\x6E\x69\x6E\x67\x54\x65\x61\x6D\x20\x3D\x20\x69\x6E\x76\x6F\x69\x63\x65\x2D\x66\x69\x6E\x61\x6E\x63\x65\x60" description: "\uFEFF\x54\x68\x65\x20\x2A\x4C\x69\x73\x74\x20\x63\x6F\x6D\x70\x61\x6E\x69\x65\x73\x2A\x20\x65\x6E\x64\x70\x6F\x69\x6E\x74\x20\x72\x65\x74\x75\x72\x6E\x73\x20\x61\x20\x6C\x69\x73\x74\x20\x6F\x66\x20\x5B\x63\x6F\x6D\x70\x61\x6E\x69\x65\x73\x5D\x28\x68\x74\x74\x70\x73\x3A\x2F\x2F\x64\x6F\x63\x73\x2E\x63\x6F\x64\x61\x74\x2E\x69\x6F\x2F\x6C\x65\x6E\x64\x69\x6E\x67\x2D\x61\x70\x69\x23\x2F\x73\x63\x68\x65\x6D\x61\x73\x2F\x43\x6F\x6D\x70\x61\x6E\x79\x29\x20\x61\x73\x73\x6F\x63\x69\x61\x74\x65\x64\x20\x74\x6F\x20\x79\x6F\x75\x72\x20\x69\x6E\x73\x74\x61\x6E\x63\x65\x73\x2E\n\n\x41\x20\x5B\x63\x6F\x6D\x70\x61\x6E\x79\x5D\x28\x68\x74\x74\x70\x73\x3A\x2F\x2F\x64\x6F\x63\x73\x2E\x63\x6F\x64\x61\x74\x2E\x69\x6F\x2F\x6C\x65\x6E\x64\x69\x6E\x67\x2D\x61\x70\x69\x23\x2F\x73\x63\x68\x65\x6D\x61\x73\x2F\x43\x6F\x6D\x70\x61\x6E\x79\x29\x20\x72\x65\x70\x72\x65\x73\x65\x6E\x74\x73\x20\x61\x20\x62\x75\x73\x69\x6E\x65\x73\x73\x20\x73\x68\x61\x72\x69\x6E\x67\x20\x61\x63\x63\x65\x73\x73\x20\x74\x6F\x20\x74\x68\x65\x69\x72\x20\x64\x61\x74\x61\x2E\n\x45\x61\x63\x68\x20\x63\x6F\x6D\x70\x61\x6E\x79\x20\x63\x61\x6E\x20\x68\x61\x76\x65\x20\x6D\x75\x6C\x74\x69\x70\x6C\x65\x20\x5B\x63\x6F\x6E\x6E\x65\x63\x74\x69\x6F\x6E\x73\x5D\x28\x68\x74\x74\x70\x73\x3A\x2F\x2F\x64\x6F\x63\x73\x2E\x63\x6F\x64\x61\x74\x2E\x69\x6F\x2F\x6C\x65\x6E\x64\x69\x6E\x67\x2D\x61\x70\x69\x23\x2F\x73\x63\x68\x65\x6D\x61\x73\x2F\x43\x6F\x6E\x6E\x65\x63\x74\x69\x6F\x6E\x29\x20\x74\x6F\x20\x64\x69\x66\x66\x65\x72\x65\x6E\x74\x20\x64\x61\x74\x61\x20\x73\x6F\x75\x72\x63\x65\x73\x2C\x20\x73\x75\x63\x68\x20\x61\x73\x20\x6F\x6E\x65\x20\x63\x6F\x6E\x6E\x65\x63\x74\x69\x6F\x6E\x20\x74\x6F\x20\x58\x65\x72\x6F\x20\x66\x6F\x72\x20\x61\x63\x63\x6F\x75\x6E\x74\x69\x6E\x67\x20\x64\x61\x74\x61\x2C\x20\x74\x77\x6F\x20\x63\x6F\x6E\x6E\x65\x63\x74\x69\x6F\x6E\x73\x20\x74\x6F\x20\x50\x6C\x61\x69\x64\x20\x66\x6F\x72\x20\x74\x77\x6F\x20\x62\x61\x6E\x6B\x20\x61\x63\x63\x6F\x75\x6E\x74\x73\x2C\x20\x61\x6E\x64\x20\x61\x20\x63\x6F\x6E\x6E\x65\x63\x74\x69\x6F\x6E\x20\x74\x6F\x20\x5A\x65\x74\x74\x6C\x65\x20\x66\x6F\x72\x20\x50\x4F\x53\x20\x64\x61\x74\x61\x2E\n\n\x23\x23\x20\x46\x69\x6C\x74\x65\x72\x20\x62\x79\x20\x74\x61\x67\x73\n\n\x54\x68\x65\x20\x2A\x4C\x69\x73\x74\x20\x63\x6F\x6D\x70\x61\x6E\x69\x65\x73\x2A\x20\x65\x6E\x64\x70\x6F\x69\x6E\x74\x20\x73\x75\x70\x70\x6F\x72\x74\x73\x20\x74\x68\x65\x20\x66\x69\x6C\x74\x65\x72\x69\x6E\x67\x20\x6F\x66\x20\x63\x6F\x6D\x70\x61\x6E\x69\x65\x73\x20\x75\x73\x69\x6E\x67\x20\x5B\x74\x61\x67\x73\x5D\x28\x68\x74\x74\x70\x73\x3A\x2F\x2F\x64\x6F\x63\x73\x2E\x63\x6F\x64\x61\x74\x2E\x69\x6F\x2F\x75\x73\x69\x6E\x67\x2D\x74\x68\x65\x2D\x61\x70\x69\x2F\x6D\x61\x6E\x61\x67\x69\x6E\x67\x2D\x63\x6F\x6D\x70\x61\x6E\x69\x65\x73\x23\x61\x64\x64\x2D\x6D\x65\x74\x61\x64\x61\x74\x61\x2D\x74\x6F\x2D\x61\x2D\x63\x6F\x6D\x70\x61\x6E\x79\x29\x2E\x20\x49\x74\x20\x73\x75\x70\x70\x6F\x72\x74\x73\x20\x74\x68\x65\x20\x66\x6F\x6C\x6C\x6F\x77\x69\x6E\x67\x20\x6F\x70\x65\x72\x61\x74\x6F\x72\x73\x20\x77\x69\x74\x68\x20\x5B\x43\x6F\x64\x61\x74\u2019\x73\x20\x71\x75\x65\x72\x79\x20\x6C\x61\x6E\x67\x75\x61\x67\x65\x5D\x28\x68\x74\x74\x70\x73\x3A\x2F\x2F\x64\x6F\x63\x73\x2E\x63\x6F\x64\x61\x74\x2E\x69\x6F\x2F\x75\x73\x69\x6E\x67\x2D\x74\x68\x65\x2D\x61\x70\x69\x2F\x71\x75\x65\x72\x79\x69\x6E\x67\x29\x3A\n\n\x2D\x20\x65\x71\x75\x61\x6C\x73\x20\x28\x60\x3D\x60\x29\n\x2D\x20\x6E\x6F\x74\x20\x65\x71\x75\x61\x6C\x73\x20\x28\x60\x21\x3D\x60\x29\n\x2D\x20\x63\x6F\x6E\x74\x61\x69\x6E\x73\x20\x28\x60\x7E\x60\x29\n\n\x46\x6F\x72\x20\x65\x78\x61\x6D\x70\x6C\x65\x2C\x20\x79\x6F\x75\x20\x63\x61\x6E\x20\x75\x73\x65\x20\x74\x68\x65\x20\x71\x75\x65\x72\x79\x69\x6E\x67\x20\x74\x6F\x20\x66\x69\x6C\x74\x65\x72\x20\x63\x6F\x6D\x70\x61\x6E\x69\x65\x73\x20\x74\x61\x67\x67\x65\x64\x20\x77\x69\x74\x68\x20\x61\x20\x73\x70\x65\x63\x69\x66\x69\x63\x20\x66\x6F\x72\x65\x69\x67\x6E\x20\x6B\x65\x79\x2C\x20\x72\x65\x67\x69\x6F\x6E\x2C\x20\x6F\x72\x20\x6F\x77\x6E\x69\x6E\x67\x20\x74\x65\x61\x6D\x3A\x20\n\x2D\x20\x46\x6F\x72\x65\x69\x67\x6E\x20\x6B\x65\x79\x3A\x20\x60\x75\x69\x64\x20\x3D\x20\x7B\x79\x6F\x75\x72\x43\x75\x73\x74\x6F\x6D\x65\x72\x49\x64\x7D\x60\n\x2D\x20\x52\x65\x67\x69\x6F\x6E\x3A\x20\x60\x72\x65\x67\x69\x6F\x6E\x20\x21\x3D\x20\x75\x6B\x60\n\x2D\x20\x4F\x77\x6E\x69\x6E\x67\x20\x74\x65\x61\x6D\x20\x61\x6E\x64\x20\x72\x65\x67\x69\x6F\x6E\x3A\x20\x60\x72\x65\x67\x69\x6F\x6E\x20\x3D\x20\x75\x6B\x20\x26\x26\x20\x6F\x77\x6E\x69\x6E\x67\x54\x65\x61\x6D\x20\x3D\x20\x69\x6E\x76\x6F\x69\x63\x65\x2D\x66\x69\x6E\x61\x6E\x63\x65\x60" parameters: - $ref: '#/components/parameters/page' @@ -373,6 +387,7 @@ paths: $ref: '#/components/responses/Internal-Server-Error' '503': $ref: '#/components/responses/Service-Unavailable' + description: "\uFEFF\x55\x73\x65\x20\x74\x68\x65\x20\x2A\x43\x72\x65\x61\x74\x65\x20\x63\x6F\x6D\x70\x61\x6E\x79\x2A\x20\x65\x6E\x64\x70\x6F\x69\x6E\x74\x20\x74\x6F\x20\x63\x72\x65\x61\x74\x65\x20\x61\x20\x6E\x65\x77\x20\x5B\x63\x6F\x6D\x70\x61\x6E\x79\x5D\x28\x68\x74\x74\x70\x73\x3A\x2F\x2F\x64\x6F\x63\x73\x2E\x63\x6F\x64\x61\x74\x2E\x69\x6F\x2F\x73\x79\x6E\x63\x2D\x66\x6F\x72\x2D\x70\x61\x79\x61\x62\x6C\x65\x73\x2D\x61\x70\x69\x23\x2F\x73\x63\x68\x65\x6D\x61\x73\x2F\x43\x6F\x6D\x70\x61\x6E\x79\x29\x20\x74\x68\x61\x74\x20\x72\x65\x70\x72\x65\x73\x65\x6E\x74\x73\x20\x79\x6F\x75\x72\x20\x63\x75\x73\x74\x6F\x6D\x65\x72\x20\x69\x6E\x20\x43\x6F\x64\x61\x74\x2E\x20\n\n\x41\x20\x5B\x63\x6F\x6D\x70\x61\x6E\x79\x5D\x28\x68\x74\x74\x70\x73\x3A\x2F\x2F\x64\x6F\x63\x73\x2E\x63\x6F\x64\x61\x74\x2E\x69\x6F\x2F\x73\x79\x6E\x63\x2D\x66\x6F\x72\x2D\x70\x61\x79\x61\x62\x6C\x65\x73\x2D\x61\x70\x69\x23\x2F\x73\x63\x68\x65\x6D\x61\x73\x2F\x43\x6F\x6D\x70\x61\x6E\x79\x29\x20\x72\x65\x70\x72\x65\x73\x65\x6E\x74\x73\x20\x61\x20\x62\x75\x73\x69\x6E\x65\x73\x73\x20\x73\x68\x61\x72\x69\x6E\x67\x20\x61\x63\x63\x65\x73\x73\x20\x74\x6F\x20\x74\x68\x65\x69\x72\x20\x64\x61\x74\x61\x2E\n\x45\x61\x63\x68\x20\x63\x6F\x6D\x70\x61\x6E\x79\x20\x63\x61\x6E\x20\x68\x61\x76\x65\x20\x6D\x75\x6C\x74\x69\x70\x6C\x65\x20\x5B\x63\x6F\x6E\x6E\x65\x63\x74\x69\x6F\x6E\x73\x5D\x28\x68\x74\x74\x70\x73\x3A\x2F\x2F\x64\x6F\x63\x73\x2E\x63\x6F\x64\x61\x74\x2E\x69\x6F\x2F\x73\x79\x6E\x63\x2D\x66\x6F\x72\x2D\x70\x61\x79\x61\x62\x6C\x65\x73\x2D\x61\x70\x69\x23\x2F\x73\x63\x68\x65\x6D\x61\x73\x2F\x43\x6F\x6E\x6E\x65\x63\x74\x69\x6F\x6E\x29\x20\x74\x6F\x20\x64\x69\x66\x66\x65\x72\x65\x6E\x74\x20\x64\x61\x74\x61\x20\x73\x6F\x75\x72\x63\x65\x73\x2C\x20\x73\x75\x63\x68\x20\x61\x73\x20\x6F\x6E\x65\x20\x63\x6F\x6E\x6E\x65\x63\x74\x69\x6F\x6E\x20\x74\x6F\x20\x58\x65\x72\x6F\x20\x66\x6F\x72\x20\x61\x63\x63\x6F\x75\x6E\x74\x69\x6E\x67\x20\x64\x61\x74\x61\x2C\x20\x74\x77\x6F\x20\x63\x6F\x6E\x6E\x65\x63\x74\x69\x6F\x6E\x73\x20\x74\x6F\x20\x50\x6C\x61\x69\x64\x20\x66\x6F\x72\x20\x74\x77\x6F\x20\x62\x61\x6E\x6B\x20\x61\x63\x63\x6F\x75\x6E\x74\x73\x2C\x20\x61\x6E\x64\x20\x61\x20\x63\x6F\x6E\x6E\x65\x63\x74\x69\x6F\x6E\x20\x74\x6F\x20\x5A\x65\x74\x74\x6C\x65\x20\x66\x6F\x72\x20\x50\x4F\x53\x20\x64\x61\x74\x61\x2E\n\n\x49\x66\x20\x66\x6F\x72\x62\x69\x64\x64\x65\x6E\x20\x63\x68\x61\x72\x61\x63\x74\x65\x72\x73\x20\x28\x73\x65\x65\x20\x60\x6E\x61\x6D\x65\x60\x20\x70\x61\x74\x74\x65\x72\x6E\x29\x20\x61\x72\x65\x20\x70\x72\x65\x73\x65\x6E\x74\x20\x69\x6E\x20\x74\x68\x65\x20\x72\x65\x71\x75\x65\x73\x74\x2C\x20\x61\x20\x63\x6F\x6D\x70\x61\x6E\x79\x20\x77\x69\x6C\x6C\x20\x62\x65\x20\x63\x72\x65\x61\x74\x65\x64\x20\x77\x69\x74\x68\x20\x74\x68\x65\x20\x66\x6F\x72\x62\x69\x64\x64\x65\x6E\x20\x63\x68\x61\x72\x61\x63\x74\x65\x72\x73\x20\x72\x65\x6D\x6F\x76\x65\x64\x2E\x20\x46\x6F\x72\x20\x65\x78\x61\x6D\x70\x6C\x65\x2C\x20\x60\x43\x6F\x6D\x70\x61\x6E\x79\x20\x28\x43\x6F\x64\x61\x74\x5B\x31\x5D\x29\x60\x20\x77\x69\x74\x68\x20\x62\x65\x20\x63\x72\x65\x61\x74\x65\x64\x20\x61\x73\x20\x60\x43\x6F\x6D\x70\x61\x6E\x79\x20\x43\x6F\x64\x61\x74\x31\x60\x2E" description: "\uFEFF\x55\x73\x65\x20\x74\x68\x65\x20\x2A\x43\x72\x65\x61\x74\x65\x20\x63\x6F\x6D\x70\x61\x6E\x79\x2A\x20\x65\x6E\x64\x70\x6F\x69\x6E\x74\x20\x74\x6F\x20\x63\x72\x65\x61\x74\x65\x20\x61\x20\x6E\x65\x77\x20\x5B\x63\x6F\x6D\x70\x61\x6E\x79\x5D\x28\x68\x74\x74\x70\x73\x3A\x2F\x2F\x64\x6F\x63\x73\x2E\x63\x6F\x64\x61\x74\x2E\x69\x6F\x2F\x6C\x65\x6E\x64\x69\x6E\x67\x2D\x61\x70\x69\x23\x2F\x73\x63\x68\x65\x6D\x61\x73\x2F\x43\x6F\x6D\x70\x61\x6E\x79\x29\x20\x74\x68\x61\x74\x20\x72\x65\x70\x72\x65\x73\x65\x6E\x74\x73\x20\x79\x6F\x75\x72\x20\x63\x75\x73\x74\x6F\x6D\x65\x72\x20\x69\x6E\x20\x43\x6F\x64\x61\x74\x2E\x20\n\n\x41\x20\x5B\x63\x6F\x6D\x70\x61\x6E\x79\x5D\x28\x68\x74\x74\x70\x73\x3A\x2F\x2F\x64\x6F\x63\x73\x2E\x63\x6F\x64\x61\x74\x2E\x69\x6F\x2F\x6C\x65\x6E\x64\x69\x6E\x67\x2D\x61\x70\x69\x23\x2F\x73\x63\x68\x65\x6D\x61\x73\x2F\x43\x6F\x6D\x70\x61\x6E\x79\x29\x20\x72\x65\x70\x72\x65\x73\x65\x6E\x74\x73\x20\x61\x20\x62\x75\x73\x69\x6E\x65\x73\x73\x20\x73\x68\x61\x72\x69\x6E\x67\x20\x61\x63\x63\x65\x73\x73\x20\x74\x6F\x20\x74\x68\x65\x69\x72\x20\x64\x61\x74\x61\x2E\n\x45\x61\x63\x68\x20\x63\x6F\x6D\x70\x61\x6E\x79\x20\x63\x61\x6E\x20\x68\x61\x76\x65\x20\x6D\x75\x6C\x74\x69\x70\x6C\x65\x20\x5B\x63\x6F\x6E\x6E\x65\x63\x74\x69\x6F\x6E\x73\x5D\x28\x68\x74\x74\x70\x73\x3A\x2F\x2F\x64\x6F\x63\x73\x2E\x63\x6F\x64\x61\x74\x2E\x69\x6F\x2F\x6C\x65\x6E\x64\x69\x6E\x67\x2D\x61\x70\x69\x23\x2F\x73\x63\x68\x65\x6D\x61\x73\x2F\x43\x6F\x6E\x6E\x65\x63\x74\x69\x6F\x6E\x29\x20\x74\x6F\x20\x64\x69\x66\x66\x65\x72\x65\x6E\x74\x20\x64\x61\x74\x61\x20\x73\x6F\x75\x72\x63\x65\x73\x2C\x20\x73\x75\x63\x68\x20\x61\x73\x20\x6F\x6E\x65\x20\x63\x6F\x6E\x6E\x65\x63\x74\x69\x6F\x6E\x20\x74\x6F\x20\x58\x65\x72\x6F\x20\x66\x6F\x72\x20\x61\x63\x63\x6F\x75\x6E\x74\x69\x6E\x67\x20\x64\x61\x74\x61\x2C\x20\x74\x77\x6F\x20\x63\x6F\x6E\x6E\x65\x63\x74\x69\x6F\x6E\x73\x20\x74\x6F\x20\x50\x6C\x61\x69\x64\x20\x66\x6F\x72\x20\x74\x77\x6F\x20\x62\x61\x6E\x6B\x20\x61\x63\x63\x6F\x75\x6E\x74\x73\x2C\x20\x61\x6E\x64\x20\x61\x20\x63\x6F\x6E\x6E\x65\x63\x74\x69\x6F\x6E\x20\x74\x6F\x20\x5A\x65\x74\x74\x6C\x65\x20\x66\x6F\x72\x20\x50\x4F\x53\x20\x64\x61\x74\x61\x2E\n\n\x49\x66\x20\x66\x6F\x72\x62\x69\x64\x64\x65\x6E\x20\x63\x68\x61\x72\x61\x63\x74\x65\x72\x73\x20\x28\x73\x65\x65\x20\x60\x6E\x61\x6D\x65\x60\x20\x70\x61\x74\x74\x65\x72\x6E\x29\x20\x61\x72\x65\x20\x70\x72\x65\x73\x65\x6E\x74\x20\x69\x6E\x20\x74\x68\x65\x20\x72\x65\x71\x75\x65\x73\x74\x2C\x20\x61\x20\x63\x6F\x6D\x70\x61\x6E\x79\x20\x77\x69\x6C\x6C\x20\x62\x65\x20\x63\x72\x65\x61\x74\x65\x64\x20\x77\x69\x74\x68\x20\x74\x68\x65\x20\x66\x6F\x72\x62\x69\x64\x64\x65\x6E\x20\x63\x68\x61\x72\x61\x63\x74\x65\x72\x73\x20\x72\x65\x6D\x6F\x76\x65\x64\x2E\x20\x46\x6F\x72\x20\x65\x78\x61\x6D\x70\x6C\x65\x2C\x20\x60\x43\x6F\x6D\x70\x61\x6E\x79\x20\x28\x43\x6F\x64\x61\x74\x5B\x31\x5D\x29\x60\x20\x77\x69\x74\x68\x20\x62\x65\x20\x63\x72\x65\x61\x74\x65\x64\x20\x61\x73\x20\x60\x43\x6F\x6D\x70\x61\x6E\x79\x20\x43\x6F\x64\x61\x74\x31\x60\x2E" requestBody: content: @@ -390,6 +405,7 @@ paths: '/companies/{companyId}': put: summary: Replace company + description: "\uFEFF\x55\x73\x65\x20\x74\x68\x65\x20\x2A\x52\x65\x70\x6C\x61\x63\x65\x20\x63\x6F\x6D\x70\x61\x6E\x79\x2A\x20\x65\x6E\x64\x70\x6F\x69\x6E\x74\x20\x74\x6F\x20\x72\x65\x70\x6C\x61\x63\x65\x20\x74\x68\x65\x20\x65\x78\x69\x73\x74\x69\x6E\x67\x20\x6E\x61\x6D\x65\x2C\x20\x64\x65\x73\x63\x72\x69\x70\x74\x69\x6F\x6E\x2C\x20\x61\x6E\x64\x20\x74\x61\x67\x73\x20\x6F\x66\x20\x74\x68\x65\x20\x63\x6F\x6D\x70\x61\x6E\x79\x2E\x20\x43\x61\x6C\x6C\x69\x6E\x67\x20\x74\x68\x65\x20\x65\x6E\x64\x70\x6F\x69\x6E\x74\x20\x77\x69\x6C\x6C\x20\x72\x65\x70\x6C\x61\x63\x65\x20\x65\x78\x69\x73\x74\x69\x6E\x67\x20\x76\x61\x6C\x75\x65\x73\x20\x65\x76\x65\x6E\x20\x69\x66\x20\x6E\x65\x77\x20\x76\x61\x6C\x75\x65\x73\x20\x68\x61\x76\x65\x6E\x27\x74\x20\x62\x65\x65\x6E\x20\x64\x65\x66\x69\x6E\x65\x64\x20\x69\x6E\x20\x74\x68\x65\x20\x70\x61\x79\x6C\x6F\x61\x64\x2E\n\n\x41\x20\x5B\x63\x6F\x6D\x70\x61\x6E\x79\x5D\x28\x68\x74\x74\x70\x73\x3A\x2F\x2F\x64\x6F\x63\x73\x2E\x63\x6F\x64\x61\x74\x2E\x69\x6F\x2F\x73\x79\x6E\x63\x2D\x66\x6F\x72\x2D\x70\x61\x79\x61\x62\x6C\x65\x73\x2D\x61\x70\x69\x23\x2F\x73\x63\x68\x65\x6D\x61\x73\x2F\x43\x6F\x6D\x70\x61\x6E\x79\x29\x20\x72\x65\x70\x72\x65\x73\x65\x6E\x74\x73\x20\x61\x20\x62\x75\x73\x69\x6E\x65\x73\x73\x20\x73\x68\x61\x72\x69\x6E\x67\x20\x61\x63\x63\x65\x73\x73\x20\x74\x6F\x20\x74\x68\x65\x69\x72\x20\x64\x61\x74\x61\x2E\n\x45\x61\x63\x68\x20\x63\x6F\x6D\x70\x61\x6E\x79\x20\x63\x61\x6E\x20\x68\x61\x76\x65\x20\x6D\x75\x6C\x74\x69\x70\x6C\x65\x20\x5B\x63\x6F\x6E\x6E\x65\x63\x74\x69\x6F\x6E\x73\x5D\x28\x68\x74\x74\x70\x73\x3A\x2F\x2F\x64\x6F\x63\x73\x2E\x63\x6F\x64\x61\x74\x2E\x69\x6F\x2F\x73\x79\x6E\x63\x2D\x66\x6F\x72\x2D\x70\x61\x79\x61\x62\x6C\x65\x73\x2D\x61\x70\x69\x23\x2F\x73\x63\x68\x65\x6D\x61\x73\x2F\x43\x6F\x6E\x6E\x65\x63\x74\x69\x6F\x6E\x29\x20\x74\x6F\x20\x64\x69\x66\x66\x65\x72\x65\x6E\x74\x20\x64\x61\x74\x61\x20\x73\x6F\x75\x72\x63\x65\x73\x2C\x20\x73\x75\x63\x68\x20\x61\x73\x20\x6F\x6E\x65\x20\x63\x6F\x6E\x6E\x65\x63\x74\x69\x6F\x6E\x20\x74\x6F\x20\x58\x65\x72\x6F\x20\x66\x6F\x72\x20\x61\x63\x63\x6F\x75\x6E\x74\x69\x6E\x67\x20\x64\x61\x74\x61\x2C\x20\x74\x77\x6F\x20\x63\x6F\x6E\x6E\x65\x63\x74\x69\x6F\x6E\x73\x20\x74\x6F\x20\x50\x6C\x61\x69\x64\x20\x66\x6F\x72\x20\x74\x77\x6F\x20\x62\x61\x6E\x6B\x20\x61\x63\x63\x6F\x75\x6E\x74\x73\x2C\x20\x61\x6E\x64\x20\x61\x20\x63\x6F\x6E\x6E\x65\x63\x74\x69\x6F\x6E\x20\x74\x6F\x20\x5A\x65\x74\x74\x6C\x65\x20\x66\x6F\x72\x20\x50\x4F\x53\x20\x64\x61\x74\x61\x2E" description: "\uFEFF\x55\x73\x65\x20\x74\x68\x65\x20\x2A\x52\x65\x70\x6C\x61\x63\x65\x20\x63\x6F\x6D\x70\x61\x6E\x79\x2A\x20\x65\x6E\x64\x70\x6F\x69\x6E\x74\x20\x74\x6F\x20\x72\x65\x70\x6C\x61\x63\x65\x20\x74\x68\x65\x20\x65\x78\x69\x73\x74\x69\x6E\x67\x20\x6E\x61\x6D\x65\x2C\x20\x64\x65\x73\x63\x72\x69\x70\x74\x69\x6F\x6E\x2C\x20\x61\x6E\x64\x20\x74\x61\x67\x73\x20\x6F\x66\x20\x74\x68\x65\x20\x63\x6F\x6D\x70\x61\x6E\x79\x2E\x20\x43\x61\x6C\x6C\x69\x6E\x67\x20\x74\x68\x65\x20\x65\x6E\x64\x70\x6F\x69\x6E\x74\x20\x77\x69\x6C\x6C\x20\x72\x65\x70\x6C\x61\x63\x65\x20\x65\x78\x69\x73\x74\x69\x6E\x67\x20\x76\x61\x6C\x75\x65\x73\x20\x65\x76\x65\x6E\x20\x69\x66\x20\x6E\x65\x77\x20\x76\x61\x6C\x75\x65\x73\x20\x68\x61\x76\x65\x6E\x27\x74\x20\x62\x65\x65\x6E\x20\x64\x65\x66\x69\x6E\x65\x64\x20\x69\x6E\x20\x74\x68\x65\x20\x70\x61\x79\x6C\x6F\x61\x64\x2E\n\n\x41\x20\x5B\x63\x6F\x6D\x70\x61\x6E\x79\x5D\x28\x68\x74\x74\x70\x73\x3A\x2F\x2F\x64\x6F\x63\x73\x2E\x63\x6F\x64\x61\x74\x2E\x69\x6F\x2F\x6C\x65\x6E\x64\x69\x6E\x67\x2D\x61\x70\x69\x23\x2F\x73\x63\x68\x65\x6D\x61\x73\x2F\x43\x6F\x6D\x70\x61\x6E\x79\x29\x20\x72\x65\x70\x72\x65\x73\x65\x6E\x74\x73\x20\x61\x20\x62\x75\x73\x69\x6E\x65\x73\x73\x20\x73\x68\x61\x72\x69\x6E\x67\x20\x61\x63\x63\x65\x73\x73\x20\x74\x6F\x20\x74\x68\x65\x69\x72\x20\x64\x61\x74\x61\x2E\n\x45\x61\x63\x68\x20\x63\x6F\x6D\x70\x61\x6E\x79\x20\x63\x61\x6E\x20\x68\x61\x76\x65\x20\x6D\x75\x6C\x74\x69\x70\x6C\x65\x20\x5B\x63\x6F\x6E\x6E\x65\x63\x74\x69\x6F\x6E\x73\x5D\x28\x68\x74\x74\x70\x73\x3A\x2F\x2F\x64\x6F\x63\x73\x2E\x63\x6F\x64\x61\x74\x2E\x69\x6F\x2F\x6C\x65\x6E\x64\x69\x6E\x67\x2D\x61\x70\x69\x23\x2F\x73\x63\x68\x65\x6D\x61\x73\x2F\x43\x6F\x6E\x6E\x65\x63\x74\x69\x6F\x6E\x29\x20\x74\x6F\x20\x64\x69\x66\x66\x65\x72\x65\x6E\x74\x20\x64\x61\x74\x61\x20\x73\x6F\x75\x72\x63\x65\x73\x2C\x20\x73\x75\x63\x68\x20\x61\x73\x20\x6F\x6E\x65\x20\x63\x6F\x6E\x6E\x65\x63\x74\x69\x6F\x6E\x20\x74\x6F\x20\x58\x65\x72\x6F\x20\x66\x6F\x72\x20\x61\x63\x63\x6F\x75\x6E\x74\x69\x6E\x67\x20\x64\x61\x74\x61\x2C\x20\x74\x77\x6F\x20\x63\x6F\x6E\x6E\x65\x63\x74\x69\x6F\x6E\x73\x20\x74\x6F\x20\x50\x6C\x61\x69\x64\x20\x66\x6F\x72\x20\x74\x77\x6F\x20\x62\x61\x6E\x6B\x20\x61\x63\x63\x6F\x75\x6E\x74\x73\x2C\x20\x61\x6E\x64\x20\x61\x20\x63\x6F\x6E\x6E\x65\x63\x74\x69\x6F\x6E\x20\x74\x6F\x20\x5A\x65\x74\x74\x6C\x65\x20\x66\x6F\x72\x20\x50\x4F\x53\x20\x64\x61\x74\x61\x2E" operationId: replace-company x-speakeasy-name-override: replace @@ -433,6 +449,7 @@ paths: description: Additional documents required patch: summary: Update company + description: "\uFEFF\x55\x73\x65\x20\x74\x68\x65\x20\x2A\x55\x70\x64\x61\x74\x65\x20\x63\x6F\x6D\x70\x61\x6E\x79\x2A\x20\x65\x6E\x64\x70\x6F\x69\x6E\x74\x20\x74\x6F\x20\x75\x70\x64\x61\x74\x65\x20\x74\x68\x65\x20\x6E\x61\x6D\x65\x2C\x20\x64\x65\x73\x63\x72\x69\x70\x74\x69\x6F\x6E\x2C\x20\x6F\x72\x20\x74\x61\x67\x73\x20\x6F\x66\x20\x74\x68\x65\x20\x63\x6F\x6D\x70\x61\x6E\x79\x2E\n\n\x54\x68\x65\x20\x2A\x55\x70\x64\x61\x74\x65\x20\x63\x6F\x6D\x70\x61\x6E\x79\x2A\x20\x65\x6E\x64\x70\x6F\x69\x6E\x74\x20\x64\x6F\x65\x73\x6E\x27\x74\x20\x68\x61\x76\x65\x20\x61\x6E\x79\x20\x72\x65\x71\x75\x69\x72\x65\x64\x20\x66\x69\x65\x6C\x64\x73\x2E\x20\x49\x66\x20\x61\x6E\x79\x20\x6F\x66\x20\x74\x68\x65\x20\x66\x69\x65\x6C\x64\x73\x20\x70\x72\x6F\x76\x69\x64\x65\x64\x20\x61\x72\x65\x20\x60\x6E\x75\x6C\x6C\x60\x20\x6F\x72\x20\x6E\x6F\x74\x20\x70\x72\x6F\x76\x69\x64\x65\x64\x2C\x20\x74\x68\x65\x79\x20\x77\x6F\x6E\x27\x74\x20\x62\x65\x20\x69\x6E\x63\x6C\x75\x64\x65\x64\x20\x69\x6E\x20\x74\x68\x65\x20\x75\x70\x64\x61\x74\x65\x2E\x20\x20\n\n\x41\x20\x5B\x63\x6F\x6D\x70\x61\x6E\x79\x5D\x28\x68\x74\x74\x70\x73\x3A\x2F\x2F\x64\x6F\x63\x73\x2E\x63\x6F\x64\x61\x74\x2E\x69\x6F\x2F\x73\x79\x6E\x63\x2D\x66\x6F\x72\x2D\x70\x61\x79\x61\x62\x6C\x65\x73\x2D\x61\x70\x69\x23\x2F\x73\x63\x68\x65\x6D\x61\x73\x2F\x43\x6F\x6D\x70\x61\x6E\x79\x29\x20\x72\x65\x70\x72\x65\x73\x65\x6E\x74\x73\x20\x61\x20\x62\x75\x73\x69\x6E\x65\x73\x73\x20\x73\x68\x61\x72\x69\x6E\x67\x20\x61\x63\x63\x65\x73\x73\x20\x74\x6F\x20\x74\x68\x65\x69\x72\x20\x64\x61\x74\x61\x2E" description: "\uFEFF\x55\x73\x65\x20\x74\x68\x65\x20\x2A\x55\x70\x64\x61\x74\x65\x20\x63\x6F\x6D\x70\x61\x6E\x79\x2A\x20\x65\x6E\x64\x70\x6F\x69\x6E\x74\x20\x74\x6F\x20\x75\x70\x64\x61\x74\x65\x20\x74\x68\x65\x20\x6E\x61\x6D\x65\x2C\x20\x64\x65\x73\x63\x72\x69\x70\x74\x69\x6F\x6E\x2C\x20\x6F\x72\x20\x74\x61\x67\x73\x20\x6F\x66\x20\x74\x68\x65\x20\x63\x6F\x6D\x70\x61\x6E\x79\x2E\n\n\x54\x68\x65\x20\x2A\x55\x70\x64\x61\x74\x65\x20\x63\x6F\x6D\x70\x61\x6E\x79\x2A\x20\x65\x6E\x64\x70\x6F\x69\x6E\x74\x20\x64\x6F\x65\x73\x6E\x27\x74\x20\x68\x61\x76\x65\x20\x61\x6E\x79\x20\x72\x65\x71\x75\x69\x72\x65\x64\x20\x66\x69\x65\x6C\x64\x73\x2E\x20\x49\x66\x20\x61\x6E\x79\x20\x6F\x66\x20\x74\x68\x65\x20\x66\x69\x65\x6C\x64\x73\x20\x70\x72\x6F\x76\x69\x64\x65\x64\x20\x61\x72\x65\x20\x60\x6E\x75\x6C\x6C\x60\x20\x6F\x72\x20\x6E\x6F\x74\x20\x70\x72\x6F\x76\x69\x64\x65\x64\x2C\x20\x74\x68\x65\x79\x20\x77\x6F\x6E\x27\x74\x20\x62\x65\x20\x69\x6E\x63\x6C\x75\x64\x65\x64\x20\x69\x6E\x20\x74\x68\x65\x20\x75\x70\x64\x61\x74\x65\x2E\x20\x20\n\n\x41\x20\x5B\x63\x6F\x6D\x70\x61\x6E\x79\x5D\x28\x68\x74\x74\x70\x73\x3A\x2F\x2F\x64\x6F\x63\x73\x2E\x63\x6F\x64\x61\x74\x2E\x69\x6F\x2F\x6C\x65\x6E\x64\x69\x6E\x67\x2D\x61\x70\x69\x23\x2F\x73\x63\x68\x65\x6D\x61\x73\x2F\x43\x6F\x6D\x70\x61\x6E\x79\x29\x20\x72\x65\x70\x72\x65\x73\x65\x6E\x74\x73\x20\x61\x20\x62\x75\x73\x69\x6E\x65\x73\x73\x20\x73\x68\x61\x72\x69\x6E\x67\x20\x61\x63\x63\x65\x73\x73\x20\x74\x6F\x20\x74\x68\x65\x69\x72\x20\x64\x61\x74\x61\x2E" operationId: update-company parameters: @@ -478,6 +495,7 @@ paths: operationId: delete-company parameters: - $ref: '#/components/parameters/companyId' + description: "\uFEFF\x54\x68\x65\x20\x2A\x44\x65\x6C\x65\x74\x65\x20\x63\x6F\x6D\x70\x61\x6E\x79\x2A\x20\x65\x6E\x64\x70\x6F\x69\x6E\x74\x20\x70\x65\x72\x6D\x61\x6E\x65\x6E\x74\x6C\x79\x20\x64\x65\x6C\x65\x74\x65\x73\x20\x61\x20\x5B\x63\x6F\x6D\x70\x61\x6E\x79\x5D\x28\x68\x74\x74\x70\x73\x3A\x2F\x2F\x64\x6F\x63\x73\x2E\x63\x6F\x64\x61\x74\x2E\x69\x6F\x2F\x73\x79\x6E\x63\x2D\x66\x6F\x72\x2D\x70\x61\x79\x61\x62\x6C\x65\x73\x2D\x61\x70\x69\x23\x2F\x73\x63\x68\x65\x6D\x61\x73\x2F\x43\x6F\x6D\x70\x61\x6E\x79\x29\x2C\x20\x69\x74\x73\x20\x5B\x63\x6F\x6E\x6E\x65\x63\x74\x69\x6F\x6E\x73\x5D\x28\x68\x74\x74\x70\x73\x3A\x2F\x2F\x64\x6F\x63\x73\x2E\x63\x6F\x64\x61\x74\x2E\x69\x6F\x2F\x73\x79\x6E\x63\x2D\x66\x6F\x72\x2D\x70\x61\x79\x61\x62\x6C\x65\x73\x2D\x61\x70\x69\x23\x2F\x73\x63\x68\x65\x6D\x61\x73\x2F\x43\x6F\x6E\x6E\x65\x63\x74\x69\x6F\x6E\x29\x20\x61\x6E\x64\x20\x61\x6E\x79\x20\x63\x61\x63\x68\x65\x64\x20\x64\x61\x74\x61\x2E\x20\x54\x68\x69\x73\x20\x6F\x70\x65\x72\x61\x74\x69\x6F\x6E\x20\x69\x73\x20\x69\x72\x72\x65\x76\x65\x72\x73\x69\x62\x6C\x65\x2E\n\n\x41\x20\x5B\x63\x6F\x6D\x70\x61\x6E\x79\x5D\x28\x68\x74\x74\x70\x73\x3A\x2F\x2F\x64\x6F\x63\x73\x2E\x63\x6F\x64\x61\x74\x2E\x69\x6F\x2F\x73\x79\x6E\x63\x2D\x66\x6F\x72\x2D\x70\x61\x79\x61\x62\x6C\x65\x73\x2D\x61\x70\x69\x23\x2F\x73\x63\x68\x65\x6D\x61\x73\x2F\x43\x6F\x6D\x70\x61\x6E\x79\x29\x20\x72\x65\x70\x72\x65\x73\x65\x6E\x74\x73\x20\x61\x20\x62\x75\x73\x69\x6E\x65\x73\x73\x20\x73\x68\x61\x72\x69\x6E\x67\x20\x61\x63\x63\x65\x73\x73\x20\x74\x6F\x20\x74\x68\x65\x69\x72\x20\x64\x61\x74\x61\x2E\n\x45\x61\x63\x68\x20\x63\x6F\x6D\x70\x61\x6E\x79\x20\x63\x61\x6E\x20\x68\x61\x76\x65\x20\x6D\x75\x6C\x74\x69\x70\x6C\x65\x20\x5B\x63\x6F\x6E\x6E\x65\x63\x74\x69\x6F\x6E\x73\x5D\x28\x68\x74\x74\x70\x73\x3A\x2F\x2F\x64\x6F\x63\x73\x2E\x63\x6F\x64\x61\x74\x2E\x69\x6F\x2F\x73\x79\x6E\x63\x2D\x66\x6F\x72\x2D\x70\x61\x79\x61\x62\x6C\x65\x73\x2D\x61\x70\x69\x23\x2F\x73\x63\x68\x65\x6D\x61\x73\x2F\x43\x6F\x6E\x6E\x65\x63\x74\x69\x6F\x6E\x29\x20\x74\x6F\x20\x64\x69\x66\x66\x65\x72\x65\x6E\x74\x20\x64\x61\x74\x61\x20\x73\x6F\x75\x72\x63\x65\x73\x2C\x20\x73\x75\x63\x68\x20\x61\x73\x20\x6F\x6E\x65\x20\x63\x6F\x6E\x6E\x65\x63\x74\x69\x6F\x6E\x20\x74\x6F\x20\x58\x65\x72\x6F\x20\x66\x6F\x72\x20\x61\x63\x63\x6F\x75\x6E\x74\x69\x6E\x67\x20\x64\x61\x74\x61\x2C\x20\x74\x77\x6F\x20\x63\x6F\x6E\x6E\x65\x63\x74\x69\x6F\x6E\x73\x20\x74\x6F\x20\x50\x6C\x61\x69\x64\x20\x66\x6F\x72\x20\x74\x77\x6F\x20\x62\x61\x6E\x6B\x20\x61\x63\x63\x6F\x75\x6E\x74\x73\x2C\x20\x61\x6E\x64\x20\x61\x20\x63\x6F\x6E\x6E\x65\x63\x74\x69\x6F\x6E\x20\x74\x6F\x20\x5A\x65\x74\x74\x6C\x65\x20\x66\x6F\x72\x20\x50\x4F\x53\x20\x64\x61\x74\x61\x2E\n" description: "\uFEFF\x54\x68\x65\x20\x2A\x44\x65\x6C\x65\x74\x65\x20\x63\x6F\x6D\x70\x61\x6E\x79\x2A\x20\x65\x6E\x64\x70\x6F\x69\x6E\x74\x20\x70\x65\x72\x6D\x61\x6E\x65\x6E\x74\x6C\x79\x20\x64\x65\x6C\x65\x74\x65\x73\x20\x61\x20\x5B\x63\x6F\x6D\x70\x61\x6E\x79\x5D\x28\x68\x74\x74\x70\x73\x3A\x2F\x2F\x64\x6F\x63\x73\x2E\x63\x6F\x64\x61\x74\x2E\x69\x6F\x2F\x6C\x65\x6E\x64\x69\x6E\x67\x2D\x61\x70\x69\x23\x2F\x73\x63\x68\x65\x6D\x61\x73\x2F\x43\x6F\x6D\x70\x61\x6E\x79\x29\x2C\x20\x69\x74\x73\x20\x5B\x63\x6F\x6E\x6E\x65\x63\x74\x69\x6F\x6E\x73\x5D\x28\x68\x74\x74\x70\x73\x3A\x2F\x2F\x64\x6F\x63\x73\x2E\x63\x6F\x64\x61\x74\x2E\x69\x6F\x2F\x6C\x65\x6E\x64\x69\x6E\x67\x2D\x61\x70\x69\x23\x2F\x73\x63\x68\x65\x6D\x61\x73\x2F\x43\x6F\x6E\x6E\x65\x63\x74\x69\x6F\x6E\x29\x20\x61\x6E\x64\x20\x61\x6E\x79\x20\x63\x61\x63\x68\x65\x64\x20\x64\x61\x74\x61\x2E\x20\x54\x68\x69\x73\x20\x6F\x70\x65\x72\x61\x74\x69\x6F\x6E\x20\x69\x73\x20\x69\x72\x72\x65\x76\x65\x72\x73\x69\x62\x6C\x65\x2E\n\n\x41\x20\x5B\x63\x6F\x6D\x70\x61\x6E\x79\x5D\x28\x68\x74\x74\x70\x73\x3A\x2F\x2F\x64\x6F\x63\x73\x2E\x63\x6F\x64\x61\x74\x2E\x69\x6F\x2F\x6C\x65\x6E\x64\x69\x6E\x67\x2D\x61\x70\x69\x23\x2F\x73\x63\x68\x65\x6D\x61\x73\x2F\x43\x6F\x6D\x70\x61\x6E\x79\x29\x20\x72\x65\x70\x72\x65\x73\x65\x6E\x74\x73\x20\x61\x20\x62\x75\x73\x69\x6E\x65\x73\x73\x20\x73\x68\x61\x72\x69\x6E\x67\x20\x61\x63\x63\x65\x73\x73\x20\x74\x6F\x20\x74\x68\x65\x69\x72\x20\x64\x61\x74\x61\x2E\n\x45\x61\x63\x68\x20\x63\x6F\x6D\x70\x61\x6E\x79\x20\x63\x61\x6E\x20\x68\x61\x76\x65\x20\x6D\x75\x6C\x74\x69\x70\x6C\x65\x20\x5B\x63\x6F\x6E\x6E\x65\x63\x74\x69\x6F\x6E\x73\x5D\x28\x68\x74\x74\x70\x73\x3A\x2F\x2F\x64\x6F\x63\x73\x2E\x63\x6F\x64\x61\x74\x2E\x69\x6F\x2F\x6C\x65\x6E\x64\x69\x6E\x67\x2D\x61\x70\x69\x23\x2F\x73\x63\x68\x65\x6D\x61\x73\x2F\x43\x6F\x6E\x6E\x65\x63\x74\x69\x6F\x6E\x29\x20\x74\x6F\x20\x64\x69\x66\x66\x65\x72\x65\x6E\x74\x20\x64\x61\x74\x61\x20\x73\x6F\x75\x72\x63\x65\x73\x2C\x20\x73\x75\x63\x68\x20\x61\x73\x20\x6F\x6E\x65\x20\x63\x6F\x6E\x6E\x65\x63\x74\x69\x6F\x6E\x20\x74\x6F\x20\x58\x65\x72\x6F\x20\x66\x6F\x72\x20\x61\x63\x63\x6F\x75\x6E\x74\x69\x6E\x67\x20\x64\x61\x74\x61\x2C\x20\x74\x77\x6F\x20\x63\x6F\x6E\x6E\x65\x63\x74\x69\x6F\x6E\x73\x20\x74\x6F\x20\x50\x6C\x61\x69\x64\x20\x66\x6F\x72\x20\x74\x77\x6F\x20\x62\x61\x6E\x6B\x20\x61\x63\x63\x6F\x75\x6E\x74\x73\x2C\x20\x61\x6E\x64\x20\x61\x20\x63\x6F\x6E\x6E\x65\x63\x74\x69\x6F\x6E\x20\x74\x6F\x20\x5A\x65\x74\x74\x6C\x65\x20\x66\x6F\x72\x20\x50\x4F\x53\x20\x64\x61\x74\x61\x2E\n" tags: - Companies @@ -501,6 +519,7 @@ paths: get: summary: Get company operationId: get-company + description: "\uFEFF\x54\x68\x65\x20\x2A\x47\x65\x74\x20\x63\x6F\x6D\x70\x61\x6E\x79\x2A\x20\x65\x6E\x64\x70\x6F\x69\x6E\x74\x20\x72\x65\x74\x75\x72\x6E\x73\x20\x61\x20\x73\x69\x6E\x67\x6C\x65\x20\x63\x6F\x6D\x70\x61\x6E\x79\x20\x66\x6F\x72\x20\x61\x20\x67\x69\x76\x65\x6E\x20\x60\x63\x6F\x6D\x70\x61\x6E\x79\x49\x64\x60\x2E\n\n\x41\x20\x5B\x63\x6F\x6D\x70\x61\x6E\x79\x5D\x28\x68\x74\x74\x70\x73\x3A\x2F\x2F\x64\x6F\x63\x73\x2E\x63\x6F\x64\x61\x74\x2E\x69\x6F\x2F\x73\x79\x6E\x63\x2D\x66\x6F\x72\x2D\x70\x61\x79\x61\x62\x6C\x65\x73\x2D\x61\x70\x69\x23\x2F\x73\x63\x68\x65\x6D\x61\x73\x2F\x43\x6F\x6D\x70\x61\x6E\x79\x29\x20\x72\x65\x70\x72\x65\x73\x65\x6E\x74\x73\x20\x61\x20\x62\x75\x73\x69\x6E\x65\x73\x73\x20\x73\x68\x61\x72\x69\x6E\x67\x20\x61\x63\x63\x65\x73\x73\x20\x74\x6F\x20\x74\x68\x65\x69\x72\x20\x64\x61\x74\x61\x2E\n\x45\x61\x63\x68\x20\x63\x6F\x6D\x70\x61\x6E\x79\x20\x63\x61\x6E\x20\x68\x61\x76\x65\x20\x6D\x75\x6C\x74\x69\x70\x6C\x65\x20\x5B\x63\x6F\x6E\x6E\x65\x63\x74\x69\x6F\x6E\x73\x5D\x28\x68\x74\x74\x70\x73\x3A\x2F\x2F\x64\x6F\x63\x73\x2E\x63\x6F\x64\x61\x74\x2E\x69\x6F\x2F\x73\x79\x6E\x63\x2D\x66\x6F\x72\x2D\x70\x61\x79\x61\x62\x6C\x65\x73\x2D\x61\x70\x69\x23\x2F\x73\x63\x68\x65\x6D\x61\x73\x2F\x43\x6F\x6E\x6E\x65\x63\x74\x69\x6F\x6E\x29\x20\x74\x6F\x20\x64\x69\x66\x66\x65\x72\x65\x6E\x74\x20\x64\x61\x74\x61\x20\x73\x6F\x75\x72\x63\x65\x73\x2C\x20\x73\x75\x63\x68\x20\x61\x73\x20\x6F\x6E\x65\x20\x63\x6F\x6E\x6E\x65\x63\x74\x69\x6F\x6E\x20\x74\x6F\x20\x58\x65\x72\x6F\x20\x66\x6F\x72\x20\x61\x63\x63\x6F\x75\x6E\x74\x69\x6E\x67\x20\x64\x61\x74\x61\x2C\x20\x74\x77\x6F\x20\x63\x6F\x6E\x6E\x65\x63\x74\x69\x6F\x6E\x73\x20\x74\x6F\x20\x50\x6C\x61\x69\x64\x20\x66\x6F\x72\x20\x74\x77\x6F\x20\x62\x61\x6E\x6B\x20\x61\x63\x63\x6F\x75\x6E\x74\x73\x2C\x20\x61\x6E\x64\x20\x61\x20\x63\x6F\x6E\x6E\x65\x63\x74\x69\x6F\x6E\x20\x74\x6F\x20\x5A\x65\x74\x74\x6C\x65\x20\x66\x6F\x72\x20\x50\x4F\x53\x20\x64\x61\x74\x61\x2E\n" description: "\uFEFF\x54\x68\x65\x20\x2A\x47\x65\x74\x20\x63\x6F\x6D\x70\x61\x6E\x79\x2A\x20\x65\x6E\x64\x70\x6F\x69\x6E\x74\x20\x72\x65\x74\x75\x72\x6E\x73\x20\x61\x20\x73\x69\x6E\x67\x6C\x65\x20\x63\x6F\x6D\x70\x61\x6E\x79\x20\x66\x6F\x72\x20\x61\x20\x67\x69\x76\x65\x6E\x20\x60\x63\x6F\x6D\x70\x61\x6E\x79\x49\x64\x60\x2E\n\n\x41\x20\x5B\x63\x6F\x6D\x70\x61\x6E\x79\x5D\x28\x68\x74\x74\x70\x73\x3A\x2F\x2F\x64\x6F\x63\x73\x2E\x63\x6F\x64\x61\x74\x2E\x69\x6F\x2F\x6C\x65\x6E\x64\x69\x6E\x67\x2D\x61\x70\x69\x23\x2F\x73\x63\x68\x65\x6D\x61\x73\x2F\x43\x6F\x6D\x70\x61\x6E\x79\x29\x20\x72\x65\x70\x72\x65\x73\x65\x6E\x74\x73\x20\x61\x20\x62\x75\x73\x69\x6E\x65\x73\x73\x20\x73\x68\x61\x72\x69\x6E\x67\x20\x61\x63\x63\x65\x73\x73\x20\x74\x6F\x20\x74\x68\x65\x69\x72\x20\x64\x61\x74\x61\x2E\n\x45\x61\x63\x68\x20\x63\x6F\x6D\x70\x61\x6E\x79\x20\x63\x61\x6E\x20\x68\x61\x76\x65\x20\x6D\x75\x6C\x74\x69\x70\x6C\x65\x20\x5B\x63\x6F\x6E\x6E\x65\x63\x74\x69\x6F\x6E\x73\x5D\x28\x68\x74\x74\x70\x73\x3A\x2F\x2F\x64\x6F\x63\x73\x2E\x63\x6F\x64\x61\x74\x2E\x69\x6F\x2F\x6C\x65\x6E\x64\x69\x6E\x67\x2D\x61\x70\x69\x23\x2F\x73\x63\x68\x65\x6D\x61\x73\x2F\x43\x6F\x6E\x6E\x65\x63\x74\x69\x6F\x6E\x29\x20\x74\x6F\x20\x64\x69\x66\x66\x65\x72\x65\x6E\x74\x20\x64\x61\x74\x61\x20\x73\x6F\x75\x72\x63\x65\x73\x2C\x20\x73\x75\x63\x68\x20\x61\x73\x20\x6F\x6E\x65\x20\x63\x6F\x6E\x6E\x65\x63\x74\x69\x6F\x6E\x20\x74\x6F\x20\x58\x65\x72\x6F\x20\x66\x6F\x72\x20\x61\x63\x63\x6F\x75\x6E\x74\x69\x6E\x67\x20\x64\x61\x74\x61\x2C\x20\x74\x77\x6F\x20\x63\x6F\x6E\x6E\x65\x63\x74\x69\x6F\x6E\x73\x20\x74\x6F\x20\x50\x6C\x61\x69\x64\x20\x66\x6F\x72\x20\x74\x77\x6F\x20\x62\x61\x6E\x6B\x20\x61\x63\x63\x6F\x75\x6E\x74\x73\x2C\x20\x61\x6E\x64\x20\x61\x20\x63\x6F\x6E\x6E\x65\x63\x74\x69\x6F\x6E\x20\x74\x6F\x20\x5A\x65\x74\x74\x6C\x65\x20\x66\x6F\x72\x20\x50\x4F\x53\x20\x64\x61\x74\x61\x2E\n" parameters: - $ref: '#/components/parameters/companyId' @@ -835,6 +854,32 @@ paths: value: status: Unlinked description: '' + '/companies/{companyId}/connections/{connectionId}/payables/info': + parameters: + - $ref: '#/components/parameters/companyId' + - $ref: '#/components/parameters/connectionId' + get: + summary: Get company information + description: |+ + Use the *Get company information* endpoint to return information about the company available from the underlying accounting software. + + operationId: get-company-information + tags: + - Company information + responses: + '200': + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/CompanyInformation' + examples: + Company information: + value: + companyName: Bank of Dave + baseCurrency: GBP + '400': + $ref: '#/components/responses/BadRequest' '/companies/{companyId}/data/all': parameters: - $ref: '#/components/parameters/companyId' @@ -862,6 +907,209 @@ paths: $ref: '#/components/responses/Internal-Server-Error' '503': $ref: '#/components/responses/Service-Unavailable' + '/companies/{companyId}/connections/{connectionId}/payables/mappingOptions/bills': + parameters: + - $ref: '#/components/parameters/companyId' + - $ref: '#/components/parameters/connectionId' + get: + summary: Get bill mapping options + description: "\uFEFF\x55\x73\x65\x20\x74\x68\x65\x20\x2A\x47\x65\x74\x20\x6D\x61\x70\x70\x69\x6E\x67\x20\x6F\x70\x74\x69\x6F\x6E\x73\x20\x2D\x20\x42\x69\x6C\x6C\x73\x2A\x20\x65\x6E\x64\x70\x6F\x69\x6E\x74\x20\x74\x6F\x20\x72\x65\x74\x75\x72\x6E\x20\x61\x20\x6C\x69\x73\x74\x20\x6F\x66\x20\x61\x76\x61\x69\x6C\x61\x62\x6C\x65\x20\x6D\x61\x70\x70\x69\x6E\x67\x20\x6F\x70\x74\x69\x6F\x6E\x73\x20\x66\x6F\x72\x20\x61\x20\x67\x69\x76\x65\x6E\x20\x63\x6F\x6D\x70\x61\x6E\x79\x27\x73\x20\x63\x6F\x6E\x6E\x65\x63\x74\x69\x6F\x6E\x20\x49\x44\x2E\n\n\x42\x79\x20\x64\x65\x66\x61\x75\x6C\x74\x2C\x20\x74\x68\x69\x73\x20\x65\x6E\x64\x70\x6F\x69\x6E\x74\x20\x72\x65\x74\x75\x72\x6E\x73\x20\x61\x20\x6C\x69\x73\x74\x20\x6F\x66\x20\x61\x63\x74\x69\x76\x65\x20\x61\x63\x63\x6F\x75\x6E\x74\x73\x20\x61\x6E\x64\x20\x74\x61\x78\x20\x72\x61\x74\x65\x73\x2E\x20\x59\x6F\x75\x20\x63\x61\x6E\x20\x75\x73\x65\x20\x5B\x71\x75\x65\x72\x79\x69\x6E\x67\x5D\x28\x68\x74\x74\x70\x73\x3A\x2F\x2F\x64\x6F\x63\x73\x2E\x63\x6F\x64\x61\x74\x2E\x69\x6F\x2F\x75\x73\x69\x6E\x67\x2D\x74\x68\x65\x2D\x61\x70\x69\x2F\x71\x75\x65\x72\x79\x69\x6E\x67\x29\x20\x74\x6F\x20\x63\x68\x61\x6E\x67\x65\x20\x74\x68\x61\x74\x2E\n\n\x4D\x61\x70\x70\x69\x6E\x67\x20\x6F\x70\x74\x69\x6F\x6E\x73\x20\x61\x72\x65\x20\x61\x20\x73\x65\x74\x20\x6F\x66\x20\x61\x63\x63\x6F\x75\x6E\x74\x73\x20\x61\x6E\x64\x20\x74\x61\x78\x20\x72\x61\x74\x65\x73\x20\x75\x73\x65\x64\x20\x74\x6F\x20\x63\x6F\x6E\x66\x69\x67\x75\x72\x65\x20\x74\x68\x65\x20\x53\x4D\x42\x27\x73\x20\x70\x61\x79\x61\x62\x6C\x65\x73\x20\x69\x6E\x74\x65\x67\x72\x61\x74\x69\x6F\x6E\x2E" + operationId: get-mapping-options-bills + x-speakeasy-name-override: get-bill-options + tags: + - Bills + parameters: + - $ref: '#/components/parameters/continuationToken' + - $ref: '#/components/parameters/statusQuery' + responses: + '200': + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/BillMappingOptions' + examples: + Mapping options: + value: + accounts: + - id: 1b6266d1-1e44-46c5-8eb5-a8f98e03124e + nominalCode: 879-i + name: Accounts payable + type: Liability + currency: GBP + status: Active + sourceModifiedDate: '2022-10-23T00:00:00.000Z' + taxRates: + - id: d2939064-dd3a-4c0f-9865-a238c2193515 + name: VAT @ 20% + code: VAT20 + effectiveTaxRate: 20 + totalTaxRate: 20 + status: Active + sourceModifiedDate: '2022-10-23T00:00:00.000Z' + pagination: + continuationToken: eyJwYWdlIjoyLCJwYWdlU2l6ZSI6MTAwLCJwYWdlQ291bnQiOjExfQ== + '400': + $ref: '#/components/responses/BadRequest' + '401': + $ref: '#/components/responses/Unauthorized' + '402': + $ref: '#/components/responses/Payment-Required' + '403': + $ref: '#/components/responses/Forbidden' + '404': + $ref: '#/components/responses/Not-Found' + '429': + $ref: '#/components/responses/Too-Many-Requests' + '500': + $ref: '#/components/responses/Internal-Server-Error' + '503': + $ref: '#/components/responses/Service-Unavailable' + '/companies/{companyId}/connections/{connectionId}/payables/mappingOptions/payments': + parameters: + - $ref: '#/components/parameters/companyId' + - $ref: '#/components/parameters/connectionId' + get: + summary: Get payment mapping options + description: "Use the *Get mapping options - Payments* endpoint to return a list of available mapping options for a given company's connection ID.\r\n\r\nBy default, this endpoint returns a list of active bank accounts. You can use [querying](https://docs.codat.io/using-the-api/querying) to change that.\r\n\r\nMapping options are a set of bank accounts used to configure the SMB's payables integration." + operationId: get-mapping-options-payments + x-speakeasy-name-override: get-payment-options + tags: + - Bill payments + parameters: + - $ref: '#/components/parameters/continuationToken' + - $ref: '#/components/parameters/statusQuery' + responses: + '200': + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/PaymentMappingOptions' + examples: + Mapping options: + value: + bankAccounts: + - id: 3d5a8e00-d108-4045-8823-7f342676cffa + name: Bank of Dave current account + accountNumber: '12345678' + currency: GBP + nominalCode: '1234567' + sortCode: '123456' + status: Active + accountType: Debit + sourceModifiedDate: '2022-10-23T00:00:00.000Z' + pagination: + continuationToken: eyJwYWdlIjoyLCJwYWdlU2l6ZSI6MTAwLCJwYWdlQ291bnQiOjExfQ== + '400': + $ref: '#/components/responses/BadRequest' + '401': + $ref: '#/components/responses/Unauthorized' + '402': + $ref: '#/components/responses/Payment-Required' + '403': + $ref: '#/components/responses/Forbidden' + '404': + $ref: '#/components/responses/Not-Found' + '429': + $ref: '#/components/responses/Too-Many-Requests' + '500': + $ref: '#/components/responses/Internal-Server-Error' + '503': + $ref: '#/components/responses/Service-Unavailable' + '/companies/{companyId}/connections/{connectionId}/payables/bills': + parameters: + - $ref: '#/components/parameters/companyId' + - $ref: '#/components/parameters/connectionId' + get: + summary: List bills + description: |- + The *List bills* endpoint returns a list of [bills](https://docs.codat.io/sync-for-payables-api#/schemas/Bill) for a given company's connection. + + [Bills](https://docs.codat.io/sync-for-payables-api#/schemas/Bill) are invoices that represent the SMB's financial obligations to their supplier for a purchase of goods or services. + + By default, the endpoint will return all bills with a status of 'Open' & 'PartiallyPaid' to show all oustanding bills. + operationId: list-bills + tags: + - Bills + parameters: + - $ref: '#/components/parameters/continuationToken' + - name: query + in: query + required: false + schema: + type: string + examples: + Status (open): + value: status=Open + Status (partially paid): + value: status=PartiallyPaid + Source modified date: + value: 'sourceModifiedDate>2023-12-15T00:00:00.000Z' + Status (open) & source modified date: + value: 'sourceModifiedDate>2023-12-15T00:00:00.000Z&&status=Open' + Status (partially paid) & source modified date: + value: 'sourceModifiedDate>2023-12-15T00:00:00.000Z&&status=PartiallyPaid' + description: 'Codat query string allows you to filter by `status` and `sourceModifiedDate`. Learn more about Codat''s query string [here](https://docs.codat.io/using-the-api/querying). Platfrom specfic statuses: Xero supports Open | PartiallyPaid | Paid | Void | Draft. Qbo supports Open | PartiallyPaid | Paid. FreeAgent supports Open | PartiallyPaid | Paid.' + responses: + '200': + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/Bill/definitions/bills' + examples: + Bills: + value: + results: + - id: '18' + reference: '12' + supplierRef: + id: '4' + supplierName: BILLy elliot + issueDate: '2019-05-13T00:00:00' + dueDate: '2019-05-13T00:00:00' + currency: GBP + currencyRate: '1,' + lineItems: + - description: Dance shoes + unitAmount: 5 + quantity: 1 + taxAmount: 0 + accountRef: + id: '16' + taxRateRef: + id: NON + totalAmount: 5 + status: Open + totalAmount: 5 + amountDue: 0 + sourceModifiedDate: '2022-05-26T10:34:10Z' + - id: '22' + reference: '12' + supplierRef: + id: '4' + supplierName: BILLy elliot + issueDate: '2019-05-13T00:00:00' + dueDate: '2019-05-13T00:00:00' + currency: GBP + currencyRate: 1 + lineItems: + - description: Dance shoes + unitAmount: 5 + quantity: 1 + taxAmount: 0 + accountRef: + id: '16' + taxRateRef: + id: NON + totalAmount: 5 + status: Paid + totalAmount: 5 + amountDue: 0 + sourceModifiedDate: '2022-05-26T10:34:10Z' + pagination: + continuationToken: eyJwYWdlIjoyLCJwYWdlU2l6ZSI6MTAwLCJwYWdlQ291bnQiOjExfQ== description: |- Refreshes all data types with `fetch on first link` set to `true` for a given company. @@ -3603,6 +3851,194 @@ paths: $ref: '#/components/responses/Internal-Server-Error' '503': $ref: '#/components/responses/Service-Unavailable' + post: + summary: Create bill + description: |- + The *Create bill* endpoint creates a new [bill](https://docs.codat.io/sync-for-payables-api#/schemas/Bill) for a given company's connection. + + [Bills](https://docs.codat.io/sync-for-payables-api#/schemas/Bill) are invoices that represent the SMB's financial obligations to their supplier for a purchase of goods or services. + operationId: create-bill + tags: + - Bills + parameters: + - in: header + name: Idempotency-Key + description: A unique identifier to ensure idempotent behaviour for subsequent requests. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Bill/definitions/billPrototype' + examples: + Create bill: + value: + reference: bill_b8qmmj4ksf1suax + supplierRef: + id: 1262c350-fe0f-40ec-aeff-41c95b4a45af + supplierName: DIISR - Small Business Services + issueDate: '2023-04-23T00:00:00' + dueDate: '2023-04-23T00:00:00' + currency: GBP + currencyRate: 1 + lineItems: + - description: Half day training - Microsoft Office + unitAmount: 1800 + quantity: 1 + taxAmount: 360 + totalAmount: 2160 + accountRef: + id: 46f9461e-788b-4906-8b74-d1ea17f6dc10 + taxRateRef: + id: INPUT2 + - description: Desktop/network support via email & phone.Per month fixed fee for minimum 20 hours/month. + unitAmount: 4000 + quantity: 1 + taxAmount: 800 + totalAmount: 4800 + accountRef: + id: f96c9458-d724-47bf-8f74-a9d5726465ce + taxRateRef: + id: INPUT2 + - description: Stationery charges + unitAmount: 32 + quantity: 8 + taxAmount: 51.2 + totalAmount: 307.2 + accountRef: + id: cba6527d-f102-4538-b421-e483233e9d5a + taxRateRef: + id: INPUT2 + trackingRefs: + - id: dba3d4da-f9ed-4eee-8e0b-452d11fdb1fa + dataType: trackingCategories + status: Open + responses: + '201': + description: Created + content: + application/json: + schema: + $ref: '#/components/schemas/Bill' + examples: + Created bill: + value: + id: bill-1029932 + reference: bill_b8qmmj4ksf1suax + supplierRef: + id: 1262c350-fe0f-40ec-aeff-41c95b4a45af + supplierName: DIISR - Small Business Services + issueDate: '2023-04-23T00:00:00' + dueDate: '2023-04-23T00:00:00' + currency: GBP + lineItems: + - description: Half day training - Microsoft Office + unitAmount: 1800 + quantity: 1 + taxAmount: 360 + totalAmount: 2160 + accountRef: + id: 46f9461e-788b-4906-8b74-d1ea17f6dc10 + taxRateRef: + id: INPUT2 + - description: Desktop/network support via email & phone.Per month fixed fee for minimum 20 hours/month. + unitAmount: 4000 + quantity: 1 + taxAmount: 800 + totalAmount: 4800 + accountRef: + id: f96c9458-d724-47bf-8f74-a9d5726465ce + taxRateRef: + id: INPUT2 + - description: Stationery charges + unitAmount: 32 + quantity: 8 + taxAmount: 51.2 + totalAmount: 307.2 + accountRef: + id: cba6527d-f102-4538-b421-e483233e9d5a + taxRateRef: + id: INPUT2 + trackingRefs: + - id: dba3d4da-f9ed-4eee-8e0b-452d11fdb1fa + dataType: trackingCategories + status: Open + totalAmount: 7267.2 + amountDue: 7267.2 + '400': + $ref: '#/components/responses/BadRequest' + '401': + $ref: '#/components/responses/Unauthorized' + '402': + $ref: '#/components/responses/Payment-Required' + '403': + $ref: '#/components/responses/Forbidden' + '404': + $ref: '#/components/responses/Not-Found' + '409': + $ref: '#/components/responses/Idempotency-Conflict' + '429': + $ref: '#/components/responses/Too-Many-Requests' + '500': + $ref: '#/components/responses/Internal-Server-Error' + '503': + $ref: '#/components/responses/Service-Unavailable' + '/companies/{companyId}/connections/{connectionId}/payables/bills/{billId}/attachments': + parameters: + - $ref: '#/components/parameters/companyId' + - $ref: '#/components/parameters/connectionId' + - $ref: '#/components/parameters/billId' + post: + summary: Upload bill attachment + description: "The *Upload bill attachment* endpoint uploads an attachment and assigns it against a specific `billId`.\r\n\r\n[Bills](https://docs.codat.io/sync-for-payables-api#/schemas/Bill) are invoices that represent the SMB's financial obligations to their supplier for a purchase of goods or services." + operationId: upload-bill-attachment + tags: + - Bills + requestBody: + content: + multipart/form-data: + schema: + $ref: '#/components/schemas/AttachmentUpload' + responses: + '201': + description: Created + content: + application/json: + schema: + $ref: '#/components/schemas/Attachment' + examples: + Attachment metadata: + value: + id: 422f093f-e556-4bf3-91c0-93af70c3e850 + name: receipt.png + contentType: image/png + dateCreated: '2022-10-23T00:00:00.000Z' + fileSize: 100 + includeWhenSent: true + sourceModifiedDate: '2022-05-26T10:34:10Z' + '400': + $ref: '#/components/responses/BadRequest' + '401': + $ref: '#/components/responses/Unauthorized' + '402': + $ref: '#/components/responses/Payment-Required' + '403': + $ref: '#/components/responses/Forbidden' + '404': + $ref: '#/components/responses/Not-Found' + '429': + $ref: '#/components/responses/Too-Many-Requests' + '500': + $ref: '#/components/responses/Internal-Server-Error' + '503': + $ref: '#/components/responses/Service-Unavailable' + get: + summary: List bill attachments + description: "The *List bill attachments* endpoint returns a list of attachments available to download for a given `billId`.\r\n\r\n[Bills](https://docs.codat.io/sync-for-payables-api#/schemas/Bill) are invoices that represent the SMB's financial obligations to their supplier for a purchase of goods or services." + operationId: list-bill-attachments + tags: + - Bills '/companies/{companyId}/connections/{connectionId}/data/accountTransactions/{accountTransactionId}': get: tags: @@ -3631,6 +4067,24 @@ paths: content: application/json: schema: + $ref: '#/components/schemas/Attachment/definitions/attachments' + examples: + Success: + value: + - id: 422f093f-e556-4bf3-91c0-93af70c3e850 + name: receipt.png + contentType: image/png + dateCreated: '2022-10-23T00:00:00.000Z' + fileSize: 100 + includeWhenSent: true + sourceModifiedDate: '2022-05-26T10:34:10Z' + - id: 20cfd269-2f0f-44ef-a28c-7b5f725cf1aa + name: another_receipt.png + contentType: image/png + dateCreated: '2022-10-24T00:00:00.000Z' + fileSize: 98 + includeWhenSent: true + sourceModifiedDate: '2022-05-27T12:38:10Z' $ref: '#/components/schemas/AccountingAccountTransaction' examples: Clear Books: @@ -3757,6 +4211,23 @@ paths: $ref: '#/components/responses/Internal-Server-Error' '503': $ref: '#/components/responses/Service-Unavailable' + '/companies/{companyId}/connections/{connectionId}/payables/bills/{billId}/attachments/{attachmentId}/download': + parameters: + - $ref: '#/components/parameters/companyId' + - $ref: '#/components/parameters/connectionId' + - $ref: '#/components/parameters/billId' + - $ref: '#/components/parameters/attachmentId' + get: + summary: Download bill attachment + description: | + The *Download bill attachment* endpoint downloads a specific attachment for a given `billId` and `attachmentId`. + + [Bills](https://docs.codat.io/sync-for-payables-api#/schemas/Bill) are invoices that represent the SMB's financial obligations to their supplier for a purchase of goods or services. + + Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=bills) for integrations that support downloading a bill attachment. + operationId: download-bill-attachment + tags: + - Bills '/companies/{companyId}/data/accounts': get: tags: @@ -12241,6 +12712,103 @@ paths: $ref: '#/components/responses/Internal-Server-Error' '503': $ref: '#/components/responses/Service-Unavailable' + '/companies/{companyId}/connections/{connectionId}/payables/bills/{billId}/payment': + parameters: + - $ref: '#/components/parameters/companyId' + - $ref: '#/components/parameters/connectionId' + - $ref: '#/components/parameters/billId' + - in: header + name: Idempotency-Key + description: A unique identifier to ensure idempotent behaviour for subsequent requests. + schema: + type: string + post: + summary: Create bill payment + description: |- + The *Create bill payment* endpoint creates a new [bill payment](https://docs.codat.io/sync-for-payables-api#/schemas/BillPayment) for a given company's connection. + + [Bill payments](https://docs.codat.io/sync-for-payables-api#/schemas/BillPayment) are an allocation of money within any Accounts Payable account. + operationId: create-bill-payment + tags: + - Bill payments + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/BillPayment/definitions/billPaymentPrototype' + examples: + Bill payment example: + value: + amount: 22 + currencyRate: 1 + date: '2022-10-23T00:00:00.000Z' + accountRef: + id: 7bda9f44sr56 + reference: Bill Payment against bill c13e37b6 dfaa-4894-b3be-9fe97bda9f44 + responses: + '201': + description: Created + content: + application/json: + schema: + $ref: '#/components/schemas/BillPayment' + examples: + Bill payment: + value: + id: billPayment-1029932 + amount: 22 + currencyRate: 1 + date: '2022-10-23T00:00:00.000Z' + accountRef: + id: 7bda9f44sr56 + reference: Bill Payment against bill c13e37b6 dfaa-4894-b3be-9fe97bda9f44 + '400': + $ref: '#/components/responses/BadRequest' + '401': + $ref: '#/components/responses/Unauthorized' + '402': + $ref: '#/components/responses/Payment-Required' + '403': + $ref: '#/components/responses/Forbidden' + '404': + $ref: '#/components/responses/Not-Found' + '409': + $ref: '#/components/responses/Idempotency-Conflict' + '429': + $ref: '#/components/responses/Too-Many-Requests' + '500': + $ref: '#/components/responses/Internal-Server-Error' + '503': + $ref: '#/components/responses/Service-Unavailable' + '/companies/{companyId}/connections/{connectionId}/payables/suppliers': + parameters: + - $ref: '#/components/parameters/companyId' + - $ref: '#/components/parameters/connectionId' + get: + tags: + - Suppliers + summary: List suppliers + description: "The *List suppliers* endpoint returns a list of [suppliers](https://docs.codat.io/sync-for-payables-api#/schemas/Supplier) for a given company's connection.\n\n[Suppliers](https://docs.codat.io/sync-for-payables-api#/schemas/Supplier) are people or organizations that provide something, such as a product or service.\n\nBy default, this endpoint returns a list of active and archived suppliers. You can use [querying](https://docs.codat.io/using-the-api/querying) to change that. \n\nFor example, to retrieve only active suppliers (i.e. `status=Active`) or suppliers created within the specified number of days (e.g. `sourceModifiedDate>2023-12-15T00:00:00.000Z`), query the endpoint as follows: `/payables/suppliers?query=sourceModifiedDate>2023-12-15T00:00:00.000Z&&status=Active`.For example, to retrieve active suppliers modified after a particular date use `query=sourceModifiedDate>2023-12-15T00:00:00.000Z&&status=Active`." + operationId: list-suppliers + parameters: + - $ref: '#/components/parameters/continuationToken' + - name: query + in: query + required: false + schema: + type: string + examples: + Source modified date: + value: 'sourceModifiedDate>2023-12-15T00:00:00.000Z' + Status (active): + value: status=Active + Status (archived): + value: status=Archived + Status (active) & source modified date: + value: 'sourceModifiedDate>2023-12-15T00:00:00.000Z&&status=Active' + Status (archived) & source modified date: + value: 'sourceModifiedDate>2023-12-15T00:00:00.000Z&&status=Archived' + description: 'Codat query string allows you to filter by `sourceModifiedDate` or if a supplier is `Active` or `Archived` in the accounting software. Learn more about Codat''s query string [here](https://docs.codat.io/using-the-api/querying).' summary: Download bill attachment description: |- The *Download bill attachment* endpoint downloads a specific attachment for a given `billId` and `attachmentId`. @@ -12266,6 +12834,41 @@ paths: content: application/json: schema: + $ref: '#/components/schemas/Supplier/definitions/suppliers' + examples: + Suppliers: + value: + results: + - id: c523e12f-8b74-4d3a-bbd8-32d7a2f598b4 + supplierName: City Limousines + contactName: Martin Dale + emailAddress: martyd@citylim.co + phone: 07999 999999 + addresses: + - type: Billing + line1: Unit 51 + line2: Bakersfield Industrial Estate + city: Bakersfield + region: California + country: USA + postalcode: '93308' + status: Active + balance: 100 + defaultCurrency: GBP + sourceModifiedDate: '2022-10-23T00:00:00Z' + - id: '41' + supplierName: AI Support + contactName: AI Support + addresses: + - type: Billing + line1: test + region: string + country: Djibouti + status: Active + defaultCurrency: GBP + sourceModifiedDate: '2022-12-07T10:48:18Z' + pagination: + continuationToken: eyJwYWdlIjoyLCJwYWdlU2l6ZSI6MTAwLCJwYWdlQ291bnQiOjExfQ== $ref: '#/components/schemas/AccountingCreditNotes' examples: Dynamics 365 Business Central: @@ -13966,6 +14569,65 @@ paths: $ref: '#/components/responses/Internal-Server-Error' '503': $ref: '#/components/responses/Service-Unavailable' + post: + tags: + - Suppliers + summary: Create supplier + description: "The *Create supplier* endpoint creates a new [supplier](https://docs.codat.io/sync-for-payables-api#/schemas/Supplier) for a given company's connection.\r\n\r\n[Suppliers](https://docs.codat.io/sync-for-payables-api#/schemas/Supplier) are people or organizations that provide something, such as a product or service.\r\n" + operationId: create-supplier + parameters: + - in: header + name: Idempotency-Key + description: A unique identifier to ensure idempotent behaviour for subsequent requests. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Supplier/definitions/supplierPrototype' + examples: + Suppliers: + value: + supplierName: Greggs + contactName: Greg Greggs + emailAddress: greg@greggs.com + phone: +44 (0)1223 322410 + addresses: + - type: Billing + line1: Flat 1 + line2: 2 Dennis Avenue + city: London + region: Camden + country: GBR + postalCode: EC1N 7TE + status: Active + defaultCurrency: GBP + responses: + '201': + description: Created + content: + application/json: + schema: + $ref: '#/components/schemas/Supplier' + examples: + Suppliers: + value: + id: sup-10933920 + supplierName: Greggs + contactName: Greg Greggs + emailAddress: greg@greggs.com + phone: +44 (0)1223 322410 + address: + - type: Billing + line1: Flat 1 + line2: 2 Dennis Avenue + city: London + region: Camden + country: GBR + postalCode: EC1N 7TE + status: Active + defaultCurrency: GBP description: "The *List credit notes* endpoint returns a list of [credit notes](https://docs.codat.io/lending-api#/schemas/CreditNote) for a given company's connection.\n\n[Credit notes](https://docs.codat.io/lending-api#/schemas/CreditNote) are issued to a customer to indicate debt, typically with reference to a previously issued invoice and/or purchase.\n\nBefore using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/lending-api#/operations/refresh-company-data).\n " operationId: list-accounting-credit-notes x-speakeasy-group: accounts-receivable.credit-notes @@ -59576,6 +60238,7 @@ paths: $ref: '#/components/responses/Internal-Server-Error' '503': $ref: '#/components/responses/Service-Unavailable' + '/companies/{companyId}/connections/{connectionId}/payables/bankAccounts': description: The *Download files* endpoint downloads all files that have been uploaded by to SMB to Codat. A `date` may be specified to download any files uploaded on the date provided. operationId: download-files x-speakeasy-name-override: download @@ -59585,6 +60248,14 @@ paths: - $ref: '#/components/parameters/connectionId' post: tags: + - Bank accounts + summary: Create bank account + parameters: + - in: header + name: Idempotency-Key + description: A unique identifier to ensure idempotent behaviour for subsequent requests. + schema: + type: string - File upload summary: Upload files for a company responses: @@ -60496,6 +61167,26 @@ paths: content: application/json: schema: + $ref: '#/components/schemas/BankAccount/definitions/bankAccountPrototype' + examples: + Bank account example: + value: + id: fb623ab2-f6ff-4b22-b7d3-b7cc2a4aa0ea + nominalCode: '22' + name: Plutus - Payables - Bank Account 12 + accountNumber: 0120 0440 + sortCode: 50-50-50 + currency: GBP + accountType: Debit + status: Active + sourceModifiedDate: '2024-02-22T14:46:43.99Z' + responses: + '201': + description: Created + content: + application/json: + schema: + $ref: '#/components/schemas/BankAccount' $ref: '#/components/schemas/AccountingBankAccount' examples: {} responses: @@ -60522,6 +61213,9 @@ paths: $ref: '#/components/responses/Internal-Server-Error' '503': $ref: '#/components/responses/Service-Unavailable' + description: "The *Create bank account* endpoint creates a new [bank account](https://docs.codat.io/sync-for-payables-api#/schemas/BankAccount) for a given company's connection.\r\n\r\n[Bank accounts](https://docs.codat.io/sync-for-payables-api#/schemas/BankAccount) are financial accounts maintained by a bank or other financial institution." + operationId: create-bank-account +webhooks: description: "The *Create bank account* endpoint creates a new [bank account](https://docs.codat.io/lending-api#/schemas/BankAccount) for a given company's connection.\r\n\r\n[Bank accounts](https://docs.codat.io/lending-api#/schemas/BankAccount) are financial accounts maintained by a bank or other financial institution.\r\n\r\n**Integration-specific behavior**\r\n\r\nRequired data may vary by integration. To see what data to post, first call [Get create/update bank account model](https://docs.codat.io/lending-api#/operations/get-create-update-bankAccounts-model)." operationId: create-bank-account x-speakeasy-group: loan-writeback.bank-accounts @@ -75703,6 +76397,10 @@ webhooks: responses: '200': description: Return a 200 status to indicate that the webhook was received successfully. +components: + schemas: + Address: + title: Address reports.categorizedBankStatement.generate.successful: post: description: Called when a categorized bank statement is successfully generated for a company. @@ -76153,6 +76851,7 @@ components: type: object properties: type: + $ref: '#/components/schemas/Address/definitions/addressType' $ref: '#/components/schemas/AccountingAddress/definitions/accountingAddressType' line1: type: string @@ -76173,11 +76872,14 @@ components: country: type: string nullable: true + description: 'Country of the customer''s address. For NetSuite, use the 2-digit [ISO 3166](https://en.wikipedia.org/wiki/List_of_ISO_3166_country_codes) country code.' description: Country of the customer address. postalCode: type: string nullable: true description: Postal code or zip code. + definitions: + addressType: required: - type definitions: @@ -76188,6 +76890,12 @@ components: - Unknown - Billing - Delivery + Attachment: + title: Attachment metadata + description: " The Codat API supports pulling and pushing of file attachments for invoices, bills, direct costs, and direct incomes.\n\n > **Retrieving attachments**\n > \n > If a company is authorized, you can query the Codat API to read, download, and upload attachments without requiring a fresh sync of data.\n\n Unlike other data types, Codat doesn't support [sync settings](https://docs.codat.io/knowledge-base/advanced-sync-settings) for attachments.\n\n Note that different integrations have different requirements for file size and extension of attachments.\n\n | Integration | File size | File extension |\n |-------------------|-----------|--------------------------------------------------------------------------------------------------------------------------------------------------------------|\n | Xero | 4 MB | 7Z, BMP, CSV, DOC, DOCX, EML, GIF, JPEG, JPG, KEYNOTE, MSG, NUMBERS, ODF, ODS, ODT, PAGES, PDF, PNG, PPT, PPTX, RAR, RTF, TIF, TIFF, TXT, XLS, XLSX, ZIP |\n | QuickBooks Online | 100 MB | AI, CSV, DOC, DOCX, EPS, GIF, JPEG, JPG, ODS, PAGES, PDF, PNG, RTF, TIF, TXT, XLS, XLSX, XML |\n | NetSuite | 100 MB | BMP, CSV, XLS, XLSX, JSON, PDF, PJPG, PJPEG, PNG, TXT, SVG, TIF, TIFF, DOC, DOCX, ZIP |\n | Dynamics 365 Business Central | 350 MB | Dynamics do not explicitly outline which file types are supported but they do state here that \"You can attach any type of file, such as text, image, or video files\". |" + type: object + allOf: + - properties: AccountingAgedCreditorReport: title: 'Accounting: Aged creditors report' description: "The Aged Creditors report shows the total balance owed by a business to its suppliers over time.\n\nYou can generate it for a company based on recently synced data from your customers' accounting software. The report is available in the **Reports** tab in the Codat portal.\n\nTotal assets or liabilities are grouped into 30-day periods for each supplier, up to the current date. You can adjust the report date, period length, and number of periods to show on each report. The data can be grouped by customer or currency.\n\n> It is not guaranteed that write-offs are included in the Aged Creditors report.\n\n## Underlying data\n\nThe Aged Creditors report is generated from a set of required data types: [Suppliers](https://docs.codat.io/lending-api#/schemas/Supplier), [Bills](https://docs.codat.io/lending-api#/schemas/Bill), [Bill credit notes](https://docs.codat.io/lending-api#/schemas/BillCreditNote), and [Bill payments](https://docs.codat.io/lending-api#/schemas/BillPayment).\n\nTo generate the report, the underlying data types must have been synced within 24 hours of each other. Otherwise an error is displayed when you try to run the report. Sync the required data types by clicking the link in the error, and then run the report again.\n\n> The Aged Creditor report runs based on the **issue dates** of the underlying data types rather than the due date.\n\n## Accessing the Aged Creditors report in Portal\n\nApart from returning the report via the API as JSON and query, you can also return the Aged Creditors report in the Codat portal.\n\n1. In the navigation bar, click **Companies**.\n2. Click the name of the company you want to generate the report for. The company's data page is displayed.\n3. Click the **Accounting** tab then click **Reports**.\n4. Select **Aged Creditors**.\n5. _(Optional)_ Edit the default reporting parameters.\n a. You can change the report date in the **Date** box. By default, the report includes transactions that occurred up to, but not including, today's date. To include transactions for today, enter tomorrow's date. \n b. In the **Period Length Days** box, select the default period length for each column (the default is 30 days).\n b. In the **Number of Periods** box, enter the number of periods to show as columns in the report (the default is 4 periods).\n6. To run the report, click **Load aged creditors**.\n7. The report is generated and displayed at the bottom of the page.\n\nThe report will be grouped per supplier and depending on the periods requested. The details indicates whether the amounts owed come from outstanding bills or bill credit notes." @@ -76303,6 +77011,12 @@ components: contentType: type: string nullable: true + description: |- + File type of the attachment. This is represented by appending the file type to the [IETF standard file naming requirements](https://tools.ietf.org/html/rfc6838). For example, for a jpeg file the output is **image/jpeg**. + + Supported file types vary per platform. + dateCreated: + $ref: '#/components/schemas/Connection/properties/created' description: "File type of the attachment. This is represented by appending the file type to the [IETF standard file naming requirements](https://tools.ietf.org/html/rfc6838). For example, for a jpeg file the output is **image/jpeg**.\n\nSupported file types vary per platform. " dateCreated: $ref: '#/components/schemas/DateTime' @@ -76314,6 +77028,32 @@ components: includeWhenSent: type: boolean description: 'If `true`, then the attachment is included with the associated invoice, bill or direct costs when it is printed, emailed, or sent to a customer, if the underlying accounting software allows this.' + sourceModifiedDate: + allOf: + - $ref: '#/components/schemas/Connection/properties/created' + - description: "The date when a record was last modified in the accounting software, usually by the business or a business process. For example, when payments are made against an invoice. \n\nIt is not populated ([read more](https://docs.codat.io/using-the-api/modified-dates#source-modified-date)) when:\n - Pulling attachments\n - The accounting software does not provide modification dates for a data type\n - A record has been deleted from the source platform and Codat doesn't have a record of when the deletion occurred\n - A record has been voided. For certain platforms that soft delete records, `isDeleted` metadata is used to identify void records\n\nIn Codat's data model, dates and times are represented using the ISO 8601 standard." + definitions: + attachments: + title: Attachments + type: array + items: + $ref: '#/components/schemas/Attachment' + AttachmentUpload: + title: Attachment upload + type: object + x-internal: true + required: + - file + properties: + file: + $ref: '#/components/schemas/AttachmentUpload/definitions/codatFile' + definitions: + codatFile: + type: string + description: The file to be uploaded as an attachment. + format: binary + BankAccount: + title: Bank accounts - $ref: '#/components/schemas/CommerceOrder/allOf/3' examples: [] definitions: @@ -76397,6 +77137,54 @@ components: - properties: id: type: string + description: 'Identifier for the bank account, unique for the company in the accounting software.' + nominalCode: + type: string + nullable: true + description: Code used to identify each nominal account for a business. + name: + type: string + nullable: true + description: Name of the bank account in the accounting software. + accountType: + $ref: '#/components/schemas/BankAccountType' + accountNumber: + type: string + nullable: true + description: |- + Account number for the bank account. + + Xero integrations + Only a UK account number shows for bank accounts with GBP currency and a combined total of sort code and account number that equals 14 digits, For non-GBP accounts, the full bank account number is populated. + sortCode: + type: string + nullable: true + description: |- + Sort code for the bank account. This is relevant to UK bank accounts. + + Xero integrations + The sort code is only displayed when the currency = GBP and the sort code and account number sum to 14 digits. For non-GBP accounts, this field is not populated. + currency: + $ref: '#/components/schemas/Bill/properties/currency' + description: Base currency of the bank account. + status: + $ref: '#/components/schemas/BankAccount/definitions/bankAccountStatus' + - title: Source Modified Date + x-internal: true + type: object + nullable: true + properties: + sourceModifiedDate: + allOf: + - $ref: '#/components/schemas/Connection/properties/created' + - description: "The date when a record was last modified in the accounting software, usually by the business or a business process. For example, when payments are made against an invoice. \n\nIt is not populated ([read more](https://docs.codat.io/using-the-api/modified-dates#source-modified-date)) when:\n - Pulling attachments\n - The accounting software does not provide modification dates for a data type\n - A record has been deleted from the source platform and Codat doesn't have a record of when the deletion occurred\n - A record has been voided. For certain platforms that soft delete records, `isDeleted` metadata is used to identify void records\n\nIn Codat's data model, dates and times are represented using the ISO 8601 standard." + definitions: + bankAccountStatus: + type: string + description: The current status of the bank account. + enum: + - Active + - Archived description: 'Identifier for the account, unique for the company in the accounting software.' - $ref: '#/components/schemas/AccountingBankAccount/definitions/bankAccountPrototype' - properties: @@ -76410,6 +77198,24 @@ components: title: Bank account prototype type: object properties: + nominalCode: + $ref: '#/components/schemas/BankAccount/allOf/0/properties/nominalCode' + name: + $ref: '#/components/schemas/BankAccount/allOf/0/properties/name' + accountType: + $ref: '#/components/schemas/BankAccountType' + accountNumber: + $ref: '#/components/schemas/BankAccount/allOf/0/properties/accountNumber' + sortCode: + $ref: '#/components/schemas/BankAccount/allOf/0/properties/sortCode' + currency: + $ref: '#/components/schemas/BankAccount/allOf/0/properties/currency' + required: + - name + - accountType + - accountNumber + - currency + BankAccountType: accountName: type: string nullable: true @@ -76530,6 +77336,100 @@ components: - Debit type: string description: "The type of transactions and balances on the account. \nFor Credit accounts, positive balances are liabilities, and positive transactions **reduce** liabilities. \nFor Debit accounts, positive balances are assets, and positive transactions **increase** assets." + Bill: + title: Bill + description: "\uFEFF\x42\x69\x6C\x6C\x73\x20\x61\x72\x65\x20\x69\x6E\x76\x6F\x69\x63\x65\x73\x20\x74\x68\x61\x74\x20\x72\x65\x70\x72\x65\x73\x65\x6E\x74\x20\x74\x68\x65\x20\x53\x4D\x42\x27\x73\x20\x66\x69\x6E\x61\x6E\x63\x69\x61\x6C\x20\x6F\x62\x6C\x69\x67\x61\x74\x69\x6F\x6E\x73\x20\x74\x6F\x20\x74\x68\x65\x69\x72\x20\x73\x75\x70\x70\x6C\x69\x65\x72\x20\x66\x6F\x72\x20\x61\x20\x70\x75\x72\x63\x68\x61\x73\x65\x20\x6F\x66\x20\x67\x6F\x6F\x64\x73\x20\x6F\x72\x20\x73\x65\x72\x76\x69\x63\x65\x73\x2E" + type: object + properties: + id: + type: string + description: 'Identifier for the bill, unique for the company in the accounting software.' + reference: + type: string + nullable: true + description: User-friendly reference for the bill. + supplierRef: + $ref: '#/components/schemas/Supplier/definitions/supplierRef' + issueDate: + allOf: + - description: Date of the bill as recorded in the accounting software. + - $ref: '#/components/schemas/Connection/properties/created' + dueDate: + allOf: + - description: Date the supplier is due to be paid. + - $ref: '#/components/schemas/Connection/properties/created' + currency: + title: Currency + x-internal: true + type: string + description: "The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_.\n\n## Unknown currencies\n\nIn line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. \n\nThere are only a very small number of edge cases where this currency code is returned by the Codat system." + format: ISO4217 + examples: + - GBP + - USD + - EUR + currencyRate: + title: Currency rate + type: number + format: decimal + nullable: true + description: "Rate to convert the total amount of the payment into the base currency for the company at the time of the payment.\n\nCurrency rates in Codat are implemented as the multiple of foreign currency units to each base currency unit. \n\nIt is not possible to perform the currency conversion with two or more non-base currencies participating in the transaction. For example, if a company's base currency is USD, and it has a bill issued in EUR, then the bill payment must happen in USD or EUR.\n\nWhere the currency rate is provided by the underlying accounting software, it will be available from Codat with the same precision (up to a maximum of 9 decimal places). \n\nFor accounting software which do not provide an explicit currency rate, it is calculated as `baseCurrency / foreignCurrency` and will be returned to 9 decimal places.\n\n## Examples with base currency of GBP\n\n| Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (GBP) |\n| :--------------- | :------------- | :------------ | :------------------------- |\n| **USD** | $20 | 0.781 | £15.62 |\n| **EUR** | €20 | 0.885 | £17.70 |\n| **RUB** | ₽20 | 0.011 | £0.22 |\n\n## Examples with base currency of USD\n\n| Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (USD) |\n| :--------------- | :------------- | :------------ | :------------------------- |\n| **GBP** | £20 | 1.277 | $25.54 |\n| **EUR** | €20 | 1.134 | $22.68 |\n| **RUB** | ₽20 | 0.015 | $0.30 |\n\n\n### Integration-specific details\n\n| Integration | Scenario | System behavior |\n|-------------------|-------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| QuickBooks Online | Transaction currency differs from base currency | If currency rate value is left `null`, a rate of 1 will be used by QBO by default. To override this, specify a currencyRate in the request body. |" + lineItems: + type: array + nullable: true + description: Array of Bill line items. + items: + $ref: '#/components/schemas/Bill/definitions/billLineItem' + status: + $ref: '#/components/schemas/Bill/definitions/billStatus' + totalAmount: + type: number + format: decimal + description: 'Amount of the bill, including tax.' + amountDue: + type: number + format: decimal + nullable: true + description: Amount outstanding on the bill. + sourceModifiedDate: + allOf: + - $ref: '#/components/schemas/Connection/properties/created' + - description: "The date when a record was last modified in the accounting software, usually by the business or a business process. For example, when payments are made against an invoice. \n\nIt is not populated ([read more](https://docs.codat.io/using-the-api/modified-dates#source-modified-date)) when:\n - Pulling attachments\n - The accounting software does not provide modification dates for a data type\n - A record has been deleted from the source platform and Codat doesn't have a record of when the deletion occurred\n - A record has been voided. For certain platforms that soft delete records, `isDeleted` metadata is used to identify void records\n\nIn Codat's data model, dates and times are represented using the ISO 8601 standard." + required: + - supplierRef + - issueDate + - dueDate + - currency + - status + definitions: + billPrototype: + title: Bill prototype + type: object + properties: + reference: + $ref: '#/components/schemas/Bill/properties/reference' + supplierRef: + $ref: '#/components/schemas/Supplier/definitions/supplierRef' + issueDate: + $ref: '#/components/schemas/Bill/properties/issueDate' + dueDate: + $ref: '#/components/schemas/Bill/properties/dueDate' + currency: + $ref: '#/components/schemas/Bill/properties/currency' + currencyRate: + $ref: '#/components/schemas/Bill/properties/currencyRate' + lineItems: + $ref: '#/components/schemas/Bill/properties/lineItems' + status: + $ref: '#/components/schemas/Bill/definitions/billStatus' + required: + - supplierRef + - issueDate + - dueDate + - currency + - status + billStatus: + description: Current state of the bill. If creating a bill the status must be `Open`. AccountingBankTransaction: title: 'Accounting: Bank account transaction' description: "> **Accessing Bank Accounts through Banking API**\n> \n> This datatype was originally used for accessing bank account data both in accounting integrations and open banking aggregators. \n>\n> To view bank account data through the Banking API, please refer to the new [Banking: Transaction](https://docs.codat.io/lending-api#/operations/list-transactions) data type.\n\n## Overview\n\nTransactional banking data for a specific company and account.\n\nBank transactions include the:\n* Amount of the transaction.\n* Current account balance.\n* Transaction type, for example, credit, debit, or transfer." @@ -76733,6 +77633,7 @@ components: - Paid - Void - Draft + example: Open billLineItem: title: Bill line item type: object @@ -76748,11 +77649,18 @@ components: unitAmount: type: number format: decimal + description: Unit price of the goods or service. description: Price of each unit of goods or services. quantity: type: number format: decimal description: Number of units of goods or services received. + taxAmount: + type: number + format: decimal + description: Amount of tax applied to the line item. + accountRef: + $ref: '#/components/schemas/Bill/definitions/billAccountRef' unitOfMeasurement: type: string nullable: true @@ -76780,6 +77688,227 @@ components: format: decimal nullable: true description: 'Total amount of the line, including tax.' + taxRateRef: + $ref: '#/components/schemas/Bill/definitions/billTaxRateRef' + trackingRefs: + type: array + nullable: true + items: + $ref: '#/components/schemas/Bill/definitions/trackingRef' + billAccountRef: + title: Account reference + type: object + description: Reference to the account to which the line item is linked. + properties: + id: + type: string + description: '''id'' from the Accounts data type.' + billTaxRateRef: + title: Tax rate reference + type: object + description: Reference to the tax rate to which the line item is linked. + properties: + id: + type: string + description: Unique identifier for the tax rate in the accounting software. + bills: + title: Bills + type: object + properties: + results: + type: array + items: + $ref: '#/components/schemas/Bill' + pagination: + $ref: '#/components/schemas/Pagination' + trackingRef: + type: object + title: Tracking reference + properties: + id: + type: string + example: e9a1b63d-9ff0-40e7-8038-016354b987e6 + description: Unique identifier of the linked tracking category or the unique identifier of the linked customer. + dataType: + type: string + example: trackingCategories + description: The type of the linked reference. + enum: + - trackingCategories + - customers + isBillable: + type: boolean + description: If a customer has been set as the trackingRefs.id then this boolean can be used to set whether the line item is billable to the customer or not. + BillEventWebhook: + x-internal: true + title: Bill event webhook + type: object + properties: + id: + type: string + format: uuid + description: Unique identifier of the bill event. + type: + type: string + description: Type of webhook event. + example: payables.bill.created + createdDate: + type: string + description: The datetime in UTC of when the webhook event was produced by Codat. + examples: + - '2022-10-23T11:03:35Z' + payload: + $ref: '#/components/schemas/BillEventWebhook/definitions/billEventPayload' + definitions: + billEventPayload: + title: Bill event payload + type: object + properties: + companyId: + $ref: '#/components/parameters/companyId/schema' + connectionId: + $ref: '#/components/parameters/connectionId/schema' + pushOperationKey: + type: string + format: uuid + example: 2e9d2c44-f675-40ba-8049-353bfcb5e171 + description: Unique identifier for the push operation. + bill: + $ref: '#/components/schemas/Bill' + BillMappingOptions: + x-internal: true + title: Mapping options bills + description: The bill mapping options for a company's accounting software. + type: object + properties: + accounts: + type: array + items: + $ref: '#/components/schemas/BillMappingOptions/definitions/accountMappingOption' + taxRates: + type: array + items: + $ref: '#/components/schemas/BillMappingOptions/definitions/taxRateMappingOption' + pagination: + $ref: '#/components/schemas/Pagination' + definitions: + accountMappingOption: + title: Account mapping option + type: object + allOf: + - properties: + id: + type: string + description: 'Identifier for the account, unique for the company.' + example: 1b6266d1-1e44-46c5-8eb5-a8f98e03124e + nominalCode: + type: string + nullable: true + description: Reference given to each nominal account for a business. It ensures money is allocated to the correct account. This code isn't a unique identifier in the Codat system. + example: '610' + name: + type: string + nullable: true + description: Name of the account. + example: Accounts Payable + type: + type: string + nullable: true + description: Type of account. + example: Liability + currency: + $ref: '#/components/schemas/Bill/properties/currency' + status: + $ref: '#/components/schemas/BillMappingOptions/definitions/accountStatus' + - $ref: '#/components/schemas/BankAccount/allOf/1' + taxRateMappingOption: + title: Tax rate mapping option + type: object + allOf: + - properties: + id: + type: string + description: 'Identifier for the tax rate, unique for the company in the accounting software.' + example: d2939064-dd3a-4c0f-9865-a238c2193515 + name: + type: string + nullable: true + description: Codat-augmented name of the tax rate in the accounting software. + code: + type: string + nullable: true + description: Code for the tax rate from the accounting software. + effectiveTaxRate: + type: number + format: decimal + nullable: true + description: See Effective tax rates description. + totalTaxRate: + type: number + format: decimal + nullable: true + description: Total (not compounded) sum of the components of a tax rate. + status: + title: Tax rate status + type: string + enum: + - Active + - Archived + description: "Status of the tax rate in the accounting software. \n- `Active` - An active tax rate in use by a company. \n- `Archived` - A tax rate that has been archived or is inactive in the accounting software. " + accountStatus: + type: string + description: The current status of the account. + enum: + - Active + - Archived + example: Active + BillPayment: + title: Bill payment + type: object + description: '' + properties: + id: + type: string + description: 'Identifier for the bill payment, unique for the company in the accounting software.' + amount: + type: number + format: decimal + description: Amount of the payment in the bill currency. + example: 1329.54 + date: + allOf: + - $ref: '#/components/schemas/Connection/properties/created' + - description: Date the bill payment was recorded in the accounting software. + reference: + type: string + nullable: true + description: Additional information associated with the payment. + example: Bill Payment against bill c13e37b6-dfaa-4894-b3be-9fe97bda9f44 + accountRef: + $ref: '#/components/schemas/BillPayment/definitions/billPaymentAccountRef' + currencyRate: + $ref: '#/components/schemas/Bill/properties/currencyRate' + definitions: + billPaymentPrototype: + title: Bill payment prototype + type: object + properties: + amount: + $ref: '#/components/schemas/BillPayment/properties/amount' + date: + $ref: '#/components/schemas/BillPayment/properties/date' + reference: + $ref: '#/components/schemas/BillPayment/properties/reference' + accountRef: + $ref: '#/components/schemas/BillPayment/definitions/billPaymentAccountRef' + currencyRate: + $ref: '#/components/schemas/Bill/properties/currencyRate' + required: + - amount + - date + - accountRef + billPaymentAccountRef: + description: Reference to the bank account / credit card which you are using to pay the bill. discountPercentage: type: number format: decimal @@ -77644,6 +78773,16 @@ components: properties: id: type: string + description: Unique ID of the bank account / credit card + required: + - id + example: + amount: 22 + date: '2022-10-23T00:00:00.000Z' + reference: Bill Payment against bill c13e37b6 dfaa-4894-b3be-9fe97bda9f44 + accountRef: + id: 9e32cbf8-e7d5-4d4d-a593-08d550682aab + currencyRate: 1 description: 'Identifier for the bank account transaction, unique for the company in the accounting software.' amount: type: number @@ -80259,6 +81398,7 @@ components: - client.rateLimit.reset - client.rateLimit.reached generatedDate: + $ref: '#/components/schemas/Connection/properties/created' $ref: '#/components/schemas/DateTime' description: The date time in UTC the event was generated in Codat. payload: @@ -80275,6 +81415,8 @@ components: type: integer description: Total number of requests remaining for your client. expiryDate: + $ref: '#/components/schemas/Connection/properties/created' + description: The date time in UTC when your daily quota is reset. $ref: '#/components/schemas/DateTime' description: The date time in UTC when your daily quota is reset. CommerceAddress: @@ -81704,6 +82846,7 @@ components: - $ref: '#/components/schemas/PagingInfo' Company: title: Company + description: "\uFEFF\x49\x6E\x20\x43\x6F\x64\x61\x74\x2C\x20\x61\x20\x63\x6F\x6D\x70\x61\x6E\x79\x20\x72\x65\x70\x72\x65\x73\x65\x6E\x74\x73\x20\x61\x20\x62\x75\x73\x69\x6E\x65\x73\x73\x20\x73\x68\x61\x72\x69\x6E\x67\x20\x61\x63\x63\x65\x73\x73\x20\x74\x6F\x20\x74\x68\x65\x69\x72\x20\x64\x61\x74\x61\x2E\x20\x45\x61\x63\x68\x20\x63\x6F\x6D\x70\x61\x6E\x79\x20\x63\x61\x6E\x20\x68\x61\x76\x65\x20\x6D\x75\x6C\x74\x69\x70\x6C\x65\x20\x5B\x63\x6F\x6E\x6E\x65\x63\x74\x69\x6F\x6E\x73\x5D\x28\x68\x74\x74\x70\x73\x3A\x2F\x2F\x64\x6F\x63\x73\x2E\x63\x6F\x64\x61\x74\x2E\x69\x6F\x2F\x73\x79\x6E\x63\x2D\x66\x6F\x72\x2D\x70\x61\x79\x61\x62\x6C\x65\x73\x2D\x61\x70\x69\x23\x2F\x73\x63\x68\x65\x6D\x61\x73\x2F\x43\x6F\x6E\x6E\x65\x63\x74\x69\x6F\x6E\x29\x20\x74\x6F\x20\x64\x69\x66\x66\x65\x72\x65\x6E\x74\x20\x64\x61\x74\x61\x20\x73\x6F\x75\x72\x63\x65\x73\x20\x73\x75\x63\x68\x20\x61\x73\x20\x6F\x6E\x65\x20\x63\x6F\x6E\x6E\x65\x63\x74\x69\x6F\x6E\x20\x74\x6F\x20\x5B\x58\x65\x72\x6F\x5D\x28\x68\x74\x74\x70\x73\x3A\x2F\x2F\x64\x6F\x63\x73\x2E\x63\x6F\x64\x61\x74\x2E\x69\x6F\x2F\x69\x6E\x74\x65\x67\x72\x61\x74\x69\x6F\x6E\x73\x2F\x61\x63\x63\x6F\x75\x6E\x74\x69\x6E\x67\x2F\x78\x65\x72\x6F\x2F\x61\x63\x63\x6F\x75\x6E\x74\x69\x6E\x67\x2D\x78\x65\x72\x6F\x29\x20\x66\x6F\x72\x20\x61\x63\x63\x6F\x75\x6E\x74\x69\x6E\x67\x20\x64\x61\x74\x61\x2C\x20\x74\x77\x6F\x20\x63\x6F\x6E\x6E\x65\x63\x74\x69\x6F\x6E\x73\x20\x74\x6F\x20\x5B\x50\x6C\x61\x69\x64\x5D\x28\x68\x74\x74\x70\x73\x3A\x2F\x2F\x64\x6F\x63\x73\x2E\x63\x6F\x64\x61\x74\x2E\x69\x6F\x2F\x69\x6E\x74\x65\x67\x72\x61\x74\x69\x6F\x6E\x73\x2F\x62\x61\x6E\x6B\x69\x6E\x67\x2F\x70\x6C\x61\x69\x64\x2F\x62\x61\x6E\x6B\x69\x6E\x67\x2D\x70\x6C\x61\x69\x64\x29\x20\x66\x6F\x72\x20\x74\x77\x6F\x20\x62\x61\x6E\x6B\x20\x61\x63\x63\x6F\x75\x6E\x74\x73\x20\x61\x6E\x64\x20\x61\x20\x63\x6F\x6E\x6E\x65\x63\x74\x69\x6F\x6E\x20\x74\x6F\x20\x5B\x5A\x65\x74\x74\x6C\x65\x5D\x28\x68\x74\x74\x70\x73\x3A\x2F\x2F\x64\x6F\x63\x73\x2E\x63\x6F\x64\x61\x74\x2E\x69\x6F\x2F\x69\x6E\x74\x65\x67\x72\x61\x74\x69\x6F\x6E\x73\x2F\x63\x6F\x6D\x6D\x65\x72\x63\x65\x2F\x7A\x65\x74\x74\x6C\x65\x2F\x63\x6F\x6D\x6D\x65\x72\x63\x65\x2D\x7A\x65\x74\x74\x6C\x65\x29\x20\x66\x6F\x72\x20\x50\x4F\x53\x20\x64\x61\x74\x61\x2E\n\n\x54\x79\x70\x69\x63\x61\x6C\x6C\x79\x20\x65\x61\x63\x68\x20\x63\x6F\x6D\x70\x61\x6E\x79\x20\x69\x73\x20\x6F\x6E\x65\x20\x6F\x66\x20\x79\x6F\x75\x72\x20\x63\x75\x73\x74\x6F\x6D\x65\x72\x73\x2E\n\n\x57\x68\x65\x6E\x20\x79\x6F\x75\x20\x63\x72\x65\x61\x74\x65\x20\x61\x20\x63\x6F\x6D\x70\x61\x6E\x79\x2C\x20\x79\x6F\x75\x20\x63\x61\x6E\x20\x73\x70\x65\x63\x69\x66\x79\x20\x61\x20\x60\x6E\x61\x6D\x65\x60\x20\x61\x6E\x64\x20\x77\x65\x20\x77\x69\x6C\x6C\x20\x61\x75\x74\x6F\x6D\x61\x74\x69\x63\x61\x6C\x6C\x79\x20\x67\x65\x6E\x65\x72\x61\x74\x65\x20\x61\x20\x75\x6E\x69\x71\x75\x65\x20\x60\x69\x64\x60\x20\x66\x6F\x72\x20\x74\x68\x65\x20\x63\x6F\x6D\x70\x61\x6E\x79\x2E\x20\x59\x6F\x75\x20\x63\x61\x6E\x20\x61\x6C\x73\x6F\x20\x61\x64\x64\x20\x61\x20\x60\x64\x65\x73\x63\x72\x69\x70\x74\x69\x6F\x6E\x60\x20\x74\x6F\x20\x73\x74\x6F\x72\x65\x20\x61\x6E\x79\x20\x61\x64\x64\x69\x74\x69\x6F\x6E\x61\x6C\x20\x69\x6E\x66\x6F\x72\x6D\x61\x74\x69\x6F\x6E\x20\x61\x62\x6F\x75\x74\x20\x74\x68\x65\x20\x63\x6F\x6D\x70\x61\x6E\x79\x2E" description: "\uFEFF\x49\x6E\x20\x43\x6F\x64\x61\x74\x2C\x20\x61\x20\x63\x6F\x6D\x70\x61\x6E\x79\x20\x72\x65\x70\x72\x65\x73\x65\x6E\x74\x73\x20\x61\x20\x62\x75\x73\x69\x6E\x65\x73\x73\x20\x73\x68\x61\x72\x69\x6E\x67\x20\x61\x63\x63\x65\x73\x73\x20\x74\x6F\x20\x74\x68\x65\x69\x72\x20\x64\x61\x74\x61\x2E\x20\x45\x61\x63\x68\x20\x63\x6F\x6D\x70\x61\x6E\x79\x20\x63\x61\x6E\x20\x68\x61\x76\x65\x20\x6D\x75\x6C\x74\x69\x70\x6C\x65\x20\x5B\x63\x6F\x6E\x6E\x65\x63\x74\x69\x6F\x6E\x73\x5D\x28\x68\x74\x74\x70\x73\x3A\x2F\x2F\x64\x6F\x63\x73\x2E\x63\x6F\x64\x61\x74\x2E\x69\x6F\x2F\x6C\x65\x6E\x64\x69\x6E\x67\x2D\x61\x70\x69\x23\x2F\x73\x63\x68\x65\x6D\x61\x73\x2F\x43\x6F\x6E\x6E\x65\x63\x74\x69\x6F\x6E\x29\x20\x74\x6F\x20\x64\x69\x66\x66\x65\x72\x65\x6E\x74\x20\x64\x61\x74\x61\x20\x73\x6F\x75\x72\x63\x65\x73\x20\x73\x75\x63\x68\x20\x61\x73\x20\x6F\x6E\x65\x20\x63\x6F\x6E\x6E\x65\x63\x74\x69\x6F\x6E\x20\x74\x6F\x20\x5B\x58\x65\x72\x6F\x5D\x28\x68\x74\x74\x70\x73\x3A\x2F\x2F\x64\x6F\x63\x73\x2E\x63\x6F\x64\x61\x74\x2E\x69\x6F\x2F\x69\x6E\x74\x65\x67\x72\x61\x74\x69\x6F\x6E\x73\x2F\x61\x63\x63\x6F\x75\x6E\x74\x69\x6E\x67\x2F\x78\x65\x72\x6F\x2F\x61\x63\x63\x6F\x75\x6E\x74\x69\x6E\x67\x2D\x78\x65\x72\x6F\x29\x20\x66\x6F\x72\x20\x61\x63\x63\x6F\x75\x6E\x74\x69\x6E\x67\x20\x64\x61\x74\x61\x2C\x20\x74\x77\x6F\x20\x63\x6F\x6E\x6E\x65\x63\x74\x69\x6F\x6E\x73\x20\x74\x6F\x20\x5B\x50\x6C\x61\x69\x64\x5D\x28\x68\x74\x74\x70\x73\x3A\x2F\x2F\x64\x6F\x63\x73\x2E\x63\x6F\x64\x61\x74\x2E\x69\x6F\x2F\x69\x6E\x74\x65\x67\x72\x61\x74\x69\x6F\x6E\x73\x2F\x62\x61\x6E\x6B\x69\x6E\x67\x2F\x70\x6C\x61\x69\x64\x2F\x62\x61\x6E\x6B\x69\x6E\x67\x2D\x70\x6C\x61\x69\x64\x29\x20\x66\x6F\x72\x20\x74\x77\x6F\x20\x62\x61\x6E\x6B\x20\x61\x63\x63\x6F\x75\x6E\x74\x73\x20\x61\x6E\x64\x20\x61\x20\x63\x6F\x6E\x6E\x65\x63\x74\x69\x6F\x6E\x20\x74\x6F\x20\x5B\x5A\x65\x74\x74\x6C\x65\x5D\x28\x68\x74\x74\x70\x73\x3A\x2F\x2F\x64\x6F\x63\x73\x2E\x63\x6F\x64\x61\x74\x2E\x69\x6F\x2F\x69\x6E\x74\x65\x67\x72\x61\x74\x69\x6F\x6E\x73\x2F\x63\x6F\x6D\x6D\x65\x72\x63\x65\x2F\x7A\x65\x74\x74\x6C\x65\x2F\x63\x6F\x6D\x6D\x65\x72\x63\x65\x2D\x7A\x65\x74\x74\x6C\x65\x29\x20\x66\x6F\x72\x20\x50\x4F\x53\x20\x64\x61\x74\x61\x2E\n\n\x54\x79\x70\x69\x63\x61\x6C\x6C\x79\x20\x65\x61\x63\x68\x20\x63\x6F\x6D\x70\x61\x6E\x79\x20\x69\x73\x20\x6F\x6E\x65\x20\x6F\x66\x20\x79\x6F\x75\x72\x20\x63\x75\x73\x74\x6F\x6D\x65\x72\x73\x2E\n\n\x57\x68\x65\x6E\x20\x79\x6F\x75\x20\x63\x72\x65\x61\x74\x65\x20\x61\x20\x63\x6F\x6D\x70\x61\x6E\x79\x2C\x20\x79\x6F\x75\x20\x63\x61\x6E\x20\x73\x70\x65\x63\x69\x66\x79\x20\x61\x20\x60\x6E\x61\x6D\x65\x60\x20\x61\x6E\x64\x20\x77\x65\x20\x77\x69\x6C\x6C\x20\x61\x75\x74\x6F\x6D\x61\x74\x69\x63\x61\x6C\x6C\x79\x20\x67\x65\x6E\x65\x72\x61\x74\x65\x20\x61\x20\x75\x6E\x69\x71\x75\x65\x20\x60\x69\x64\x60\x20\x66\x6F\x72\x20\x74\x68\x65\x20\x63\x6F\x6D\x70\x61\x6E\x79\x2E\x20\x59\x6F\x75\x20\x63\x61\x6E\x20\x61\x6C\x73\x6F\x20\x61\x64\x64\x20\x61\x20\x60\x64\x65\x73\x63\x72\x69\x70\x74\x69\x6F\x6E\x60\x20\x74\x6F\x20\x73\x74\x6F\x72\x65\x20\x61\x6E\x79\x20\x61\x64\x64\x69\x74\x69\x6F\x6E\x61\x6C\x20\x69\x6E\x66\x6F\x72\x6D\x61\x74\x69\x6F\x6E\x20\x61\x62\x6F\x75\x74\x20\x74\x68\x65\x20\x63\x6F\x6D\x70\x61\x6E\x79\x2E" type: object allOf: @@ -81734,6 +82877,10 @@ components: description: 'The `redirect` [Link URL](https://docs.codat.io/auth-flow/authorize-hosted-link) enabling the customer to start their auth flow journey for the company.' example: 'https://link.codat.io/company/27628208-459c-46a2-a705-5641ce25f739' lastSync: + $ref: '#/components/schemas/Connection/properties/created' + nullable: true + created: + $ref: '#/components/schemas/Connection/properties/created' $ref: '#/components/schemas/DateTime' nullable: true created: @@ -81816,6 +82963,19 @@ components: products: - spend-insights - lending + CompanyInformation: + title: Company information + type: object + description: Gets the latest basic info for a company. + properties: + companyName: + type: string + nullable: true + description: Name of the linked company. + baseCurrency: + type: string + nullable: true + description: Currency set in the accounting software of the linked company. Used by the currency rate. CompanyRequestBody: title: Create company request x-internal: true @@ -81852,6 +83012,7 @@ components: $ref: '#/components/schemas/Company/definitions/companyDetails/properties/tags' Connection: title: Connection + description: "\uFEFF\x41\x20\x63\x6F\x6E\x6E\x65\x63\x74\x69\x6F\x6E\x20\x72\x65\x70\x72\x65\x73\x65\x6E\x74\x73\x20\x61\x20\x5B\x63\x6F\x6D\x70\x61\x6E\x79\x27\x73\x5D\x28\x68\x74\x74\x70\x73\x3A\x2F\x2F\x64\x6F\x63\x73\x2E\x63\x6F\x64\x61\x74\x2E\x69\x6F\x2F\x73\x79\x6E\x63\x2D\x66\x6F\x72\x2D\x70\x61\x79\x61\x62\x6C\x65\x73\x2D\x61\x70\x69\x23\x2F\x73\x63\x68\x65\x6D\x61\x73\x2F\x43\x6F\x6D\x70\x61\x6E\x79\x29\x20\x63\x6F\x6E\x6E\x65\x63\x74\x69\x6F\x6E\x20\x74\x6F\x20\x61\x20\x64\x61\x74\x61\x20\x73\x6F\x75\x72\x63\x65\x20\x61\x6E\x64\x20\x61\x6C\x6C\x6F\x77\x73\x20\x79\x6F\x75\x20\x74\x6F\x20\x73\x79\x6E\x63\x68\x72\x6F\x6E\x69\x7A\x65\x20\x64\x61\x74\x61\x20\x28\x70\x75\x6C\x6C\x20\x61\x6E\x64\x2F\x6F\x72\x20\x70\x75\x73\x68\x29\x20\x77\x69\x74\x68\x20\x74\x68\x61\x74\x20\x73\x6F\x75\x72\x63\x65\x2E\n\n\x41\x20\x63\x6F\x6D\x70\x61\x6E\x79\x20\x63\x61\x6E\x20\x68\x61\x76\x65\x20\x6D\x75\x6C\x74\x69\x70\x6C\x65\x20\x64\x61\x74\x61\x20\x63\x6F\x6E\x6E\x65\x63\x74\x69\x6F\x6E\x73\x20\x64\x65\x70\x65\x6E\x64\x69\x6E\x67\x20\x6F\x6E\x20\x74\x68\x65\x20\x74\x79\x70\x65\x20\x6F\x66\x20\x64\x61\x74\x61\x20\x73\x6F\x75\x72\x63\x65\x20\x69\x74\x20\x69\x73\x20\x63\x6F\x6E\x6E\x65\x63\x74\x69\x6E\x67\x20\x74\x6F\x2E\x20\x46\x6F\x72\x20\x65\x78\x61\x6D\x70\x6C\x65\x2C\x20\x61\x20\x73\x69\x6E\x67\x6C\x65\x20\x63\x6F\x6D\x70\x61\x6E\x79\x20\x63\x61\x6E\x20\x6C\x69\x6E\x6B\x20\x74\x6F\x3A\n\n\x2D\x20\x5B\x41\x63\x63\x6F\x75\x6E\x74\x69\x6E\x67\x20\x64\x61\x74\x61\x5D\x28\x68\x74\x74\x70\x73\x3A\x2F\x2F\x64\x6F\x63\x73\x2E\x63\x6F\x64\x61\x74\x2E\x69\x6F\x2F\x61\x63\x63\x6F\x75\x6E\x74\x69\x6E\x67\x2D\x61\x70\x69\x2F\x6F\x76\x65\x72\x76\x69\x65\x77\x29\x20\x2D\x20\x31\x20\x61\x63\x74\x69\x76\x65\x20\x63\x6F\x6E\x6E\x65\x63\x74\x69\x6F\x6E\x2E\n\x2D\x20\x5B\x42\x61\x6E\x6B\x69\x6E\x67\x20\x64\x61\x74\x61\x5D\x28\x68\x74\x74\x70\x73\x3A\x2F\x2F\x64\x6F\x63\x73\x2E\x63\x6F\x64\x61\x74\x2E\x69\x6F\x2F\x62\x61\x6E\x6B\x69\x6E\x67\x2D\x61\x70\x69\x2F\x6F\x76\x65\x72\x76\x69\x65\x77\x29\x20\x2D\x20\x4D\x75\x6C\x74\x69\x70\x6C\x65\x20\x61\x63\x74\x69\x76\x65\x20\x63\x6F\x6E\x6E\x65\x63\x74\x69\x6F\x6E\x73\x2E\n\x2D\x20\x5B\x43\x6F\x6D\x6D\x65\x72\x63\x65\x20\x64\x61\x74\x61\x5D\x28\x68\x74\x74\x70\x73\x3A\x2F\x2F\x64\x6F\x63\x73\x2E\x63\x6F\x64\x61\x74\x2E\x69\x6F\x2F\x63\x6F\x6D\x6D\x65\x72\x63\x65\x2D\x61\x70\x69\x2F\x6F\x76\x65\x72\x76\x69\x65\x77\x29\x20\x2D\x20\x4D\x75\x6C\x74\x69\x70\x6C\x65\x20\x61\x63\x74\x69\x76\x65\x20\x63\x6F\x6E\x6E\x65\x63\x74\x69\x6F\x6E\x73\x2E\n\x41\x6E\x79\x20\x63\x6F\x6D\x62\x69\x6E\x61\x74\x69\x6F\x6E\x20\x6F\x66\x20\x61\x63\x63\x6F\x75\x6E\x74\x69\x6E\x67\x2C\x20\x62\x61\x6E\x6B\x69\x6E\x67\x2C\x20\x61\x6E\x64\x20\x63\x6F\x6D\x6D\x65\x72\x63\x65\x20\x64\x61\x74\x61\x20\x63\x6F\x6E\x6E\x65\x63\x74\x69\x6F\x6E\x73\x20\x69\x73\x20\x61\x6C\x6C\x6F\x77\x65\x64\x2E\n\n\x42\x65\x66\x6F\x72\x65\x20\x79\x6F\x75\x20\x63\x61\x6E\x20\x75\x73\x65\x20\x61\x20\x64\x61\x74\x61\x20\x63\x6F\x6E\x6E\x65\x63\x74\x69\x6F\x6E\x20\x74\x6F\x20\x70\x75\x6C\x6C\x20\x6F\x72\x20\x70\x75\x73\x68\x20\x64\x61\x74\x61\x2C\x20\x74\x68\x65\x20\x63\x6F\x6D\x70\x61\x6E\x79\x20\x6D\x75\x73\x74\x20\x67\x72\x61\x6E\x74\x20\x79\x6F\x75\x20\x61\x63\x63\x65\x73\x73\x20\x74\x6F\x20\x74\x68\x65\x69\x72\x20\x62\x75\x73\x69\x6E\x65\x73\x73\x20\x64\x61\x74\x61\x20\x62\x79\x20\x5B\x6C\x69\x6E\x6B\x69\x6E\x67\x20\x74\x68\x65\x20\x63\x6F\x6E\x6E\x65\x63\x74\x69\x6F\x6E\x5D\x28\x68\x74\x74\x70\x73\x3A\x2F\x2F\x64\x6F\x63\x73\x2E\x63\x6F\x64\x61\x74\x2E\x69\x6F\x2F\x61\x75\x74\x68\x2D\x66\x6C\x6F\x77\x2F\x6F\x76\x65\x72\x76\x69\x65\x77\x29\x2E" description: "\uFEFF\x41\x20\x63\x6F\x6E\x6E\x65\x63\x74\x69\x6F\x6E\x20\x72\x65\x70\x72\x65\x73\x65\x6E\x74\x73\x20\x61\x20\x5B\x63\x6F\x6D\x70\x61\x6E\x79\x27\x73\x5D\x28\x68\x74\x74\x70\x73\x3A\x2F\x2F\x64\x6F\x63\x73\x2E\x63\x6F\x64\x61\x74\x2E\x69\x6F\x2F\x6C\x65\x6E\x64\x69\x6E\x67\x2D\x61\x70\x69\x23\x2F\x73\x63\x68\x65\x6D\x61\x73\x2F\x43\x6F\x6D\x70\x61\x6E\x79\x29\x20\x63\x6F\x6E\x6E\x65\x63\x74\x69\x6F\x6E\x20\x74\x6F\x20\x61\x20\x64\x61\x74\x61\x20\x73\x6F\x75\x72\x63\x65\x20\x61\x6E\x64\x20\x61\x6C\x6C\x6F\x77\x73\x20\x79\x6F\x75\x20\x74\x6F\x20\x73\x79\x6E\x63\x68\x72\x6F\x6E\x69\x7A\x65\x20\x64\x61\x74\x61\x20\x28\x70\x75\x6C\x6C\x20\x61\x6E\x64\x2F\x6F\x72\x20\x70\x75\x73\x68\x29\x20\x77\x69\x74\x68\x20\x74\x68\x61\x74\x20\x73\x6F\x75\x72\x63\x65\x2E\n\n\x41\x20\x63\x6F\x6D\x70\x61\x6E\x79\x20\x63\x61\x6E\x20\x68\x61\x76\x65\x20\x6D\x75\x6C\x74\x69\x70\x6C\x65\x20\x64\x61\x74\x61\x20\x63\x6F\x6E\x6E\x65\x63\x74\x69\x6F\x6E\x73\x20\x64\x65\x70\x65\x6E\x64\x69\x6E\x67\x20\x6F\x6E\x20\x74\x68\x65\x20\x74\x79\x70\x65\x20\x6F\x66\x20\x64\x61\x74\x61\x20\x73\x6F\x75\x72\x63\x65\x20\x69\x74\x20\x69\x73\x20\x63\x6F\x6E\x6E\x65\x63\x74\x69\x6E\x67\x20\x74\x6F\x2E\x20\x46\x6F\x72\x20\x65\x78\x61\x6D\x70\x6C\x65\x2C\x20\x61\x20\x73\x69\x6E\x67\x6C\x65\x20\x63\x6F\x6D\x70\x61\x6E\x79\x20\x63\x61\x6E\x20\x6C\x69\x6E\x6B\x20\x74\x6F\x3A\n\n\x2D\x20\x5B\x41\x63\x63\x6F\x75\x6E\x74\x69\x6E\x67\x20\x64\x61\x74\x61\x5D\x28\x68\x74\x74\x70\x73\x3A\x2F\x2F\x64\x6F\x63\x73\x2E\x63\x6F\x64\x61\x74\x2E\x69\x6F\x2F\x61\x63\x63\x6F\x75\x6E\x74\x69\x6E\x67\x2D\x61\x70\x69\x2F\x6F\x76\x65\x72\x76\x69\x65\x77\x29\x20\x2D\x20\x31\x20\x61\x63\x74\x69\x76\x65\x20\x63\x6F\x6E\x6E\x65\x63\x74\x69\x6F\x6E\x2E\n\x2D\x20\x5B\x42\x61\x6E\x6B\x69\x6E\x67\x20\x64\x61\x74\x61\x5D\x28\x68\x74\x74\x70\x73\x3A\x2F\x2F\x64\x6F\x63\x73\x2E\x63\x6F\x64\x61\x74\x2E\x69\x6F\x2F\x62\x61\x6E\x6B\x69\x6E\x67\x2D\x61\x70\x69\x2F\x6F\x76\x65\x72\x76\x69\x65\x77\x29\x20\x2D\x20\x4D\x75\x6C\x74\x69\x70\x6C\x65\x20\x61\x63\x74\x69\x76\x65\x20\x63\x6F\x6E\x6E\x65\x63\x74\x69\x6F\x6E\x73\x2E\n\x2D\x20\x5B\x43\x6F\x6D\x6D\x65\x72\x63\x65\x20\x64\x61\x74\x61\x5D\x28\x68\x74\x74\x70\x73\x3A\x2F\x2F\x64\x6F\x63\x73\x2E\x63\x6F\x64\x61\x74\x2E\x69\x6F\x2F\x63\x6F\x6D\x6D\x65\x72\x63\x65\x2D\x61\x70\x69\x2F\x6F\x76\x65\x72\x76\x69\x65\x77\x29\x20\x2D\x20\x4D\x75\x6C\x74\x69\x70\x6C\x65\x20\x61\x63\x74\x69\x76\x65\x20\x63\x6F\x6E\x6E\x65\x63\x74\x69\x6F\x6E\x73\x2E\n\x41\x6E\x79\x20\x63\x6F\x6D\x62\x69\x6E\x61\x74\x69\x6F\x6E\x20\x6F\x66\x20\x61\x63\x63\x6F\x75\x6E\x74\x69\x6E\x67\x2C\x20\x62\x61\x6E\x6B\x69\x6E\x67\x2C\x20\x61\x6E\x64\x20\x63\x6F\x6D\x6D\x65\x72\x63\x65\x20\x64\x61\x74\x61\x20\x63\x6F\x6E\x6E\x65\x63\x74\x69\x6F\x6E\x73\x20\x69\x73\x20\x61\x6C\x6C\x6F\x77\x65\x64\x2E\n\n\x42\x65\x66\x6F\x72\x65\x20\x79\x6F\x75\x20\x63\x61\x6E\x20\x75\x73\x65\x20\x61\x20\x64\x61\x74\x61\x20\x63\x6F\x6E\x6E\x65\x63\x74\x69\x6F\x6E\x20\x74\x6F\x20\x70\x75\x6C\x6C\x20\x6F\x72\x20\x70\x75\x73\x68\x20\x64\x61\x74\x61\x2C\x20\x74\x68\x65\x20\x63\x6F\x6D\x70\x61\x6E\x79\x20\x6D\x75\x73\x74\x20\x67\x72\x61\x6E\x74\x20\x79\x6F\x75\x20\x61\x63\x63\x65\x73\x73\x20\x74\x6F\x20\x74\x68\x65\x69\x72\x20\x62\x75\x73\x69\x6E\x65\x73\x73\x20\x64\x61\x74\x61\x20\x62\x79\x20\x5B\x6C\x69\x6E\x6B\x69\x6E\x67\x20\x74\x68\x65\x20\x63\x6F\x6E\x6E\x65\x63\x74\x69\x6F\x6E\x5D\x28\x68\x74\x74\x70\x73\x3A\x2F\x2F\x64\x6F\x63\x73\x2E\x63\x6F\x64\x61\x74\x2E\x69\x6F\x2F\x61\x75\x74\x68\x2D\x66\x6C\x6F\x77\x2F\x6F\x76\x65\x72\x76\x69\x65\x77\x29\x2E" type: object properties: @@ -81894,6 +83055,15 @@ components: status: $ref: '#/components/schemas/Connection/definitions/dataConnectionStatus' lastSync: + $ref: '#/components/schemas/Connection/properties/created' + nullable: true + created: + title: Date time + type: string + examples: + - '2022-10-23T00:00:00Z' + - '2022-10-23' + description: "In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example:\n\n```\n2020-10-08T22:40:50Z\n2021-01-01T00:00:00\n```\n\n\n\nWhen syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information:\n\n- Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z`\n- Unqualified local time: `2021-11-15T01:00:00`\n- UTC time offsets: `2021-11-15T01:00:00-05:00`\n\n> Time zones\n> \n> Not all dates from Codat will contain information about time zones. \n> Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced." $ref: '#/components/schemas/DateTime' nullable: true created: @@ -81942,6 +83112,7 @@ components: type: string description: A message about a error returned by Codat. erroredOnUtc: + $ref: '#/components/schemas/Connection/properties/created' $ref: '#/components/schemas/DateTime' status: title: Error status @@ -81954,6 +83125,7 @@ components: resolvedOnUtc: description: The datetime in Utc that the error was resolved. nullable: true + $ref: '#/components/schemas/Connection/properties/created' $ref: '#/components/schemas/DateTime' dataConnectionSourceType: title: Source Type @@ -82302,6 +83474,7 @@ components: - commerce-transactions example: invoices lastSuccessfulSync: + $ref: '#/components/schemas/Connection/properties/created' $ref: '#/components/schemas/DateTime' currentStatus: $ref: '#/components/schemas/PullOperation/properties/status' @@ -82321,6 +83494,9 @@ components: currentStatus: string latestSyncId: ad474a37-2003-478e-baee-9af9f1ec2fe3 latestSuccessfulSyncId: 8220fc90-55b6-47bc-9417-48ac6ea93101 + DataType: + x-internal: true + $ref: '#/components/schemas/DataStatus/properties/dataType' DataStatusResponse: x-internal: true title: Data status response @@ -82913,6 +84089,14 @@ components: type: string nullable: true description: Name of validator. + Pagination: + title: Pagination metadata + x-internal: true + type: object + properties: + continuationToken: + type: string + description: 'A continuation token indicating there are more results to be fetched. Supply this value in the `continuationToken` query parameter in the next request to fetch the next set of results. Once no more results are available, the continuation token will not be present in the response.' ExcelStatus: type: object title: Excel status @@ -83328,6 +84512,69 @@ components: href: '/companies/{id}/data/{dataType}' current: href: '/companies/{id}/data/{dataType}?page=1&pageSize=10' + PaymentMappingOptions: + x-internal: true + title: Mapping Options Payments + description: Gets the bill payments mapping options for a company's accounting software + type: object + properties: + bankAccounts: + type: array + items: + $ref: '#/components/schemas/PaymentMappingOptions/definitions/bankAccountMappingOption' + pagination: + $ref: '#/components/schemas/Pagination' + definitions: + bankAccountMappingOption: + title: Bank account mapping option + type: object + allOf: + - properties: + id: + type: string + description: 'Identifier for the account, unique for the company in the accounting software.' + example: 3d5a8e00-d108-4045-8823-7f342676cffa + name: + type: string + nullable: true + description: Name of the bank account in the accounting software. + example: Bank of Dave current account + accountNumber: + type: string + nullable: true + description: |- + Account number for the bank account. + + Xero integrations + Only a UK account number shows for bank accounts with GBP currency and a combined total of sort code and account number that equals 14 digits, For non-GBP accounts, the full bank account number is populated. + nominalCode: + type: string + nullable: true + description: Code used to identify each nominal account for a business. + sortCode: + type: string + nullable: true + description: |- + Sort code for the bank account. + + Xero integrations + The sort code is only displayed when the currency = GBP and the sort code and account number sum to 14 digits. For non-GBP accounts, this field is not populated. + currency: + type: string + nullable: true + description: The bank account's base currency. + status: + $ref: '#/components/schemas/PaymentMappingOptions/definitions/bankAccountStatus' + accountType: + $ref: '#/components/schemas/BankAccountType' + - $ref: '#/components/schemas/BankAccount/allOf/1' + bankAccountStatus: + type: string + description: The current status of the bank account. + enum: + - Active + - Archived + example: Active PaymentMethodRef: type: object title: Payment method reference @@ -83446,6 +84693,9 @@ components: nullable: true description: A message about a transient or persistent error returned by Codat or the source platform. requested: + $ref: '#/components/schemas/Connection/properties/created' + completed: + $ref: '#/components/schemas/Connection/properties/created' $ref: '#/components/schemas/DateTime' completed: $ref: '#/components/schemas/DateTime' @@ -83513,6 +84763,10 @@ components: dataConnectionKey: $ref: '#/components/parameters/connectionId/schema' requestedOnUtc: + $ref: '#/components/schemas/Connection/properties/created' + description: The datetime when the push was requested. + completedOnUtc: + $ref: '#/components/schemas/Connection/properties/created' $ref: '#/components/schemas/DateTime' description: The datetime when the push was requested. completedOnUtc: @@ -83633,6 +84887,9 @@ components: items: $ref: '#/components/schemas/PushOperation' - $ref: '#/components/schemas/PagingInfo' + Supplier: + title: Supplier + description: "\uFEFF\x53\x75\x70\x70\x6C\x69\x65\x72\x73\x20\x61\x72\x65\x20\x70\x65\x6F\x70\x6C\x65\x20\x6F\x72\x20\x6F\x72\x67\x61\x6E\x69\x7A\x61\x74\x69\x6F\x6E\x73\x20\x74\x68\x61\x74\x20\x70\x72\x6F\x76\x69\x64\x65\x20\x73\x6F\x6D\x65\x74\x68\x69\x6E\x67\x2C\x20\x73\x75\x63\x68\x20\x61\x73\x20\x61\x20\x70\x72\x6F\x64\x75\x63\x74\x20\x6F\x72\x20\x73\x65\x72\x76\x69\x63\x65\x2E\x20\x55\x73\x65\x20\x74\x68\x65\x20\x5B\x4C\x69\x73\x74\x20\x73\x75\x70\x70\x6C\x69\x65\x72\x73\x5D\x28\x68\x74\x74\x70\x73\x3A\x2F\x2F\x64\x6F\x63\x73\x2E\x63\x6F\x64\x61\x74\x2E\x69\x6F\x2F\x73\x79\x6E\x63\x2D\x66\x6F\x72\x2D\x70\x61\x79\x61\x62\x6C\x65\x73\x2D\x76\x32\x2D\x61\x70\x69\x23\x2F\x6F\x70\x65\x72\x61\x74\x69\x6F\x6E\x73\x2F\x6C\x69\x73\x74\x2D\x73\x75\x70\x70\x6C\x69\x65\x72\x73\x29\x20\x65\x6E\x64\x70\x6F\x69\x6E\x74\x20\x74\x6F\x20\x72\x65\x74\x72\x69\x65\x76\x65\x20\x61\x20\x6C\x69\x73\x74\x20\x6F\x66\x20\x61\x6C\x6C\x20\x73\x75\x70\x70\x6C\x69\x65\x72\x73\x20\x66\x6F\x72\x20\x61\x20\x63\x6F\x6D\x70\x61\x6E\x79\x2E\n\n\x53\x75\x70\x70\x6C\x69\x65\x72\x73\x27\x20\x64\x61\x74\x61\x20\x6C\x69\x6E\x6B\x73\x20\x74\x6F\x20\x61\x63\x63\x6F\x75\x6E\x74\x73\x20\x70\x61\x79\x61\x62\x6C\x65\x20\x5B\x62\x69\x6C\x6C\x73\x5D\x28\x68\x74\x74\x70\x73\x3A\x2F\x2F\x64\x6F\x63\x73\x2E\x63\x6F\x64\x61\x74\x2E\x69\x6F\x2F\x73\x79\x6E\x63\x2D\x66\x6F\x72\x2D\x70\x61\x79\x61\x62\x6C\x65\x73\x2D\x76\x32\x2D\x61\x70\x69\x23\x2F\x73\x63\x68\x65\x6D\x61\x73\x2F\x42\x69\x6C\x6C\x29\x2E\n\x20" PushOption: title: Push option x-internal: true @@ -83791,6 +85048,34 @@ components: properties: id: type: string + description: 'Identifier for the supplier, unique to the company in the accounting software.' + supplierName: + type: string + description: 'Name of the supplier as recorded in the accounting system, typically the company name.' + contactName: + type: string + nullable: true + description: Name of the main contact for the supplier. + emailAddress: + type: string + nullable: true + description: Email address that the supplier may be contacted on. + phone: + type: string + nullable: true + description: Phone number that the supplier may be contacted on. + examples: + - +44 25691 154789 + - (877) 492-8687 + - 01224 658 999 + addresses: + type: array + nullable: true + description: An array of Addresses. + items: + $ref: '#/components/schemas/Address' + status: + $ref: '#/components/schemas/Supplier/definitions/supplierStatus' format: uuid description: Unique identifier of the report example: 52c0f26b-051a-43ff-b02a-258eec67f5ef @@ -83871,6 +85156,99 @@ components: type: number format: decimal nullable: true + description: Amount outstanding against the supplier. + defaultCurrency: + type: string + nullable: true + description: Default currency the supplier's transactional data is recorded in. + sourceModifiedDate: + allOf: + - $ref: '#/components/schemas/Connection/properties/created' + - description: "The date when a record was last modified in the accounting software, usually by the business or a business process. For example, when payments are made against an invoice. \n\nIt is not populated ([read more](https://docs.codat.io/using-the-api/modified-dates#source-modified-date)) when:\n - Pulling attachments\n - The accounting software does not provide modification dates for a data type\n - A record has been deleted from the source platform and Codat doesn't have a record of when the deletion occurred\n - A record has been voided. For certain platforms that soft delete records, `isDeleted` metadata is used to identify void records\n\nIn Codat's data model, dates and times are represented using the ISO 8601 standard." + definitions: + supplierPrototype: + title: Supplier prototype + type: object + properties: + supplierName: + $ref: '#/components/schemas/Supplier/properties/supplierName' + contactName: + $ref: '#/components/schemas/Supplier/properties/contactName' + emailAddress: + $ref: '#/components/schemas/Supplier/properties/emailAddress' + phone: + $ref: '#/components/schemas/Supplier/properties/phone' + addresses: + $ref: '#/components/schemas/Supplier/properties/addresses' + status: + $ref: '#/components/schemas/Supplier/definitions/supplierStatus' + balance: + $ref: '#/components/schemas/Supplier/properties/balance' + defaultCurrency: + $ref: '#/components/schemas/Supplier/properties/defaultCurrency' + required: + - supplierName + - status + supplierRef: + title: Supplier reference + description: Reference to the supplier the record relates to. + type: object + properties: + id: + minLength: 1 + type: string + description: The supplier's unique ID + supplierName: + type: string + nullable: true + description: The supplier's name + required: + - id + supplierStatus: + description: Status of the supplier. + type: string + enum: + - Unknown + - Active + - Archived + suppliers: + title: Suppliers + type: object + properties: + results: + type: array + items: + $ref: '#/components/schemas/Supplier' + pagination: + $ref: '#/components/schemas/Pagination' + examples: + - id: C520FFD4-F6F6-4FC2-A6D2-5D7088B2B14F + supplierName: Kelly's Industrial Supplies + contactName: Kelly Ipsum + emailAddress: sales@kellysupplies.com + phone: 07999 999999 + addresses: + - type: Billing + line1: Unit 51 + line2: Bakersfield Industrial Estate + city: Bakersfield + region: California + country: USA + postalcode: '93308' + status: Active + amount: 100 + defaultCurrency: GBP + sourceModifiedDate: '2022-10-23T00:00:00Z' + parameters: + attachmentId: + name: attachmentId + in: path + required: true + schema: + type: string + format: uuid + example: 8a210b68-6988-11ed-a1eb-0242ac120002 + description: Unique identifier for an attachment. description: The latest balance for the bank account. modifiedDate: $ref: '#/components/schemas/DateTime' @@ -84213,6 +85591,18 @@ components: type: string example: '-modifiedDate' description: 'Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results).' + billId: + name: billId + in: path + required: true + schema: + type: string + examples: + - 13d946f0-c5d5-42bc-b092-97ece17923ab + - 9wg4lep4ush5cxs79pl8sozmsndbaukll3ind4g7buqbm1h2 + - 7110701885 + - EILBDVJVNUAGVKRQ + description: Unique identifier for a bill. companyId: name: companyId in: path @@ -84233,6 +85623,8 @@ components: example: 2e9d2c44-f675-40ba-8049-353bfcb5e171 description: Unique identifier for a company's data connection. description: Unique identifier for a connection. + continuationToken: + name: continuationToken dataType: name: dataType description: A key for a Codat data type. @@ -84536,6 +85928,16 @@ components: required: false schema: type: string + example: continuationToken=eyJwYWdlIjoyLCJwYWdlU2l6ZSI6MTAwLCJwYWdlQ291bnQiOjExfQ== + description: Retrieve the next page of results using the continuation token from the previous response. + statusQuery: + name: statusQuery + in: query + required: false + schema: + type: string + example: status=Archived + description: 'Codat query string allows you to filter by `status` (`status=Active||status=Archived`). [Learn more](https://docs.codat.io/using-the-api/querying) about Codat''s query string.' enum: - auth/get reportType: @@ -84707,6 +86109,21 @@ components: correlationId: bc997528a9d7abb9161ef45f05d38599 canBeRetried: Unknown detailedErrorCode: 0 + Idempotency-Conflict: + description: A request is in progress with the same idempotency key. + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorMessage' + examples: + Conflict: + value: + statusCode: 409 + service: PublicApi + error: The data set has not been requested. + correlationId: bc997528a9d7abb9161ef45f05d38599 + canBeRetried: Unknown + detailedErrorCode: 0 Too-Many-Requests: description: Too many requests were made in a given amount of time. Wait a short period and then try again. content: diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock index 3f2b6be03..1841e3638 100644 --- a/.speakeasy/workflow.lock +++ b/.speakeasy/workflow.lock @@ -1,3 +1,4 @@ +speakeasyVersion: 1.709.1 speakeasyVersion: 1.701.0 sources: bank-feeds-source: @@ -42,11 +43,11 @@ sources: - prealpha sync-for-payables-source: sourceNamespace: sync-for-payables-source - sourceRevisionDigest: sha256:f70dfe42888a956f70c0e7cecc46b1c38d2bcc3fdd8256037ef65f9c1e302042 - sourceBlobDigest: sha256:a1a7a05293d9dcd7b726bb27b3ba0589ba9cbbd462641608615bb200c3239ffe + sourceRevisionDigest: sha256:9bd9e36fdb60e3d73fe7cc209c24ce0325919a523acec3edd84ee2f26420bedc + sourceBlobDigest: sha256:59b5c9d3aa1a43fa4186c6ae1bf1108bf40d44d22f65ed6118b763574e0cf669 tags: - latest - - speakeasy-sdk-regen-1767965617 + - speakeasy-sdk-regen-1770645512 - 3.0.0 sync-for-payables-version-1-source: sourceNamespace: sync-for-payables-version-1-source @@ -102,10 +103,10 @@ targets: sync-for-payables-library: source: sync-for-payables-source sourceNamespace: sync-for-payables-source - sourceRevisionDigest: sha256:f70dfe42888a956f70c0e7cecc46b1c38d2bcc3fdd8256037ef65f9c1e302042 - sourceBlobDigest: sha256:a1a7a05293d9dcd7b726bb27b3ba0589ba9cbbd462641608615bb200c3239ffe + sourceRevisionDigest: sha256:9bd9e36fdb60e3d73fe7cc209c24ce0325919a523acec3edd84ee2f26420bedc + sourceBlobDigest: sha256:59b5c9d3aa1a43fa4186c6ae1bf1108bf40d44d22f65ed6118b763574e0cf669 codeSamplesNamespace: sync-for-payables-source-typescript-code-samples - codeSamplesRevisionDigest: sha256:7ae61273e83f23daa74a3016db35fa2dbfc8fdeb5bdff893b50bf2394560535a + codeSamplesRevisionDigest: sha256:5f88c2c6b5a989b240bab7291806e7cfa89761bf865becebb0412b83bbe74909 sync-for-payables-version-1-library: source: sync-for-payables-version-1-source sourceNamespace: sync-for-payables-version-1-source diff --git a/sync-for-payables/.speakeasy/gen.lock b/sync-for-payables/.speakeasy/gen.lock index 02495ced3..bd1310bd3 100644 --- a/sync-for-payables/.speakeasy/gen.lock +++ b/sync-for-payables/.speakeasy/gen.lock @@ -1,39 +1,39 @@ lockVersion: 2.0.0 id: fc401bb0-cd17-4863-8f85-003111be4b43 management: - docChecksum: 80094d79321ca2e6cbfc100b36881f64 + docChecksum: 2c97e4172eda0b5a31c6dc31f428235d docVersion: 3.0.0 - speakeasyVersion: 1.683.1 - generationVersion: 2.792.2 - releaseVersion: 9.2.0 - configChecksum: 47eff6703a17e17280b578afebf4d71c + speakeasyVersion: 1.709.1 + generationVersion: 2.812.2 + releaseVersion: 9.3.0 + configChecksum: eb76039957333544a749c3c7cdb088ba repoURL: https://github.com/codatio/client-sdk-typescript.git repoSubDirectory: sync-for-payables installationURL: https://gitpkg.now.sh/codatio/client-sdk-typescript/sync-for-payables published: true persistentEdits: - generation_id: f0a571f8-3875-4ff4-8067-839704e0edd3 - pristine_commit_hash: 40acec8afb75b38fa2fc2012b7deff7ba1cd9b8d - pristine_tree_hash: a9c3caf6ab9019c3649b7c4287157f72e29c6426 + generation_id: acead2d8-1254-45eb-9a4a-ded52846926f + pristine_commit_hash: 4b1a31628b26572f81563bf5589a981b1fd80984 + pristine_tree_hash: c417f50ecda0802d3fbe751c1aeef66becba5173 features: typescript: additionalDependencies: 0.1.0 - constsAndDefaults: 0.1.12 - core: 3.26.19 + constsAndDefaults: 0.1.13 + core: 3.26.27 decimal: 0.1.2 defaultEnabledRetries: 0.1.0 downloadStreams: 0.1.1 enumUnions: 0.1.0 envVarSecurityUsage: 0.1.2 examples: 2.82.4 - globalSecurity: 2.82.14 + globalSecurity: 2.82.15 globalSecurityCallbacks: 0.1.0 globalSecurityFlattening: 0.1.0 globalServerURLs: 2.83.0 methodArguments: 0.1.2 nameOverrides: 2.81.2 nullables: 0.1.1 - responseFormat: 0.2.3 + responseFormat: 0.3.0 retries: 2.83.0 sdkHooks: 0.4.0 serverEventsSentinels: 0.1.0 @@ -74,8 +74,8 @@ trackedFiles: pristine_git_object: 69ced2b3597cc95b373739d28e0932d2536f90f4 docs/sdk/models/operations/createbillpaymentrequest.md: id: 9b17afa6f632 - last_write_checksum: sha1:2ecb6e46c7feb79e0a01cfa91ebd61f7313d8917 - pristine_git_object: 4a18ead3feb2065fbb2a93b1d133be54722ba81b + last_write_checksum: sha1:087ad523d1e3902a530c0fcc6673b912515eef27 + pristine_git_object: d6a553341c3855b78159c98464d38d1e5445b3c3 docs/sdk/models/operations/createbillrequest.md: id: 5e4c2319d34a last_write_checksum: sha1:b65d34426fedb83df7c23b76812aa8846832db45 @@ -102,8 +102,8 @@ trackedFiles: pristine_git_object: 9d33a8e82a535f2c0ff5afe0b0269a6aa89d849f docs/sdk/models/operations/downloadbillattachmentrequest.md: id: 61983c8df748 - last_write_checksum: sha1:2bc5bdb9efba02e4872d78024fa956c6e010c34d - pristine_git_object: 813c2200ad4f61c5a106006e059d1f575c1860de + last_write_checksum: sha1:4b9f5b550b89ac9cbfc2660672320bb66b4d9e55 + pristine_git_object: e770d323831e80b2bf7de4c1dc5ec3555523db10 docs/sdk/models/operations/getcompanyinformationrequest.md: id: e53b744ff888 last_write_checksum: sha1:fdff5a03f97e1397473991f73f0338c802f2b406 @@ -126,8 +126,8 @@ trackedFiles: pristine_git_object: de36ca7895eaf3831383d8224ffa79f831365059 docs/sdk/models/operations/listbillattachmentsrequest.md: id: 9debe2c87e3c - last_write_checksum: sha1:57dba1d776cf9ce3638497782cbd948fc6a30f4f - pristine_git_object: 07656597f1f4d73aad5e60d1b530aee88db75548 + last_write_checksum: sha1:514b37f3fd315e3fd9f3733ed4b8fe18f57a0cfe + pristine_git_object: 603c66a5b15ee85718956e8361f3499995a7e9ad docs/sdk/models/operations/listbillsrequest.md: id: 88f8e1095669 last_write_checksum: sha1:2b2f6765b8ca5ad3243a1e9e976e7223a1e9c616 @@ -156,18 +156,22 @@ trackedFiles: id: 454c96f5ba2d last_write_checksum: sha1:7ef87755b95f4b86d49855d58179ef61130021c9 pristine_git_object: 8e09632f06b883a64bf56d8c1a3289aef39ddb1f + docs/sdk/models/operations/updatebillrequest.md: + id: dbad2065f696 + last_write_checksum: sha1:3d55b95c97ca2bd2eb139851f4749212b652ef3e + pristine_git_object: f00dbf031bd526e9815fb44913d3f6a046fa85d0 docs/sdk/models/operations/updatecompanyrequest.md: id: 6501e66b32d2 last_write_checksum: sha1:dca465bcbdfdbbbcd5768b034d226b32430ef0a3 pristine_git_object: 144ed6cd0ab3894091b385527fd93617248e9214 docs/sdk/models/operations/uploadbillattachmentrequest.md: id: 4d0fc508b57c - last_write_checksum: sha1:1a87d69eff6980750b3fc00bee7cadf4e201900b - pristine_git_object: a485793aefd726ff2eaa6bef18e96d499deddc9f + last_write_checksum: sha1:1b6833d55c20ff5022b26e198c1d10a9a8d2da55 + pristine_git_object: eeccc260188092622afbe529f63c04a06f788f8c docs/sdk/models/shared/accountmappingoption.md: id: f8960c862e21 - last_write_checksum: sha1:76e283fd3c75ebaf0697f31fa17a1fdb80751a82 - pristine_git_object: a7c274f6a8554eacfaec67d95db2ab92b62bc787 + last_write_checksum: sha1:70a0697c7b04c9a3f5e9f6a25c17d7077c317fce + pristine_git_object: 012cbca5f05656bbc455cc8756aaf3bf4b725aad docs/sdk/models/shared/accountstatus.md: id: a8da19baff08 last_write_checksum: sha1:6ac56b8e5fd4b21dbdfc1fe83e34bc182ec69ab7 @@ -182,24 +186,24 @@ trackedFiles: pristine_git_object: 4dad9f2df1c59734aed95c619b18e7c726f08adc docs/sdk/models/shared/attachment.md: id: 36725df2d249 - last_write_checksum: sha1:efc3f6340e71c77bbf29da07217a98c55bcbfdc6 - pristine_git_object: 225eb90642f4f4dcd7f06c64267f91b10cec2351 + last_write_checksum: sha1:2ecd74f90044d62846c28e1131de099a3381d228 + pristine_git_object: 83e98b96e5b418cb596467a4c2ffd612284fad2c docs/sdk/models/shared/attachmentupload.md: id: d5b29912ce98 last_write_checksum: sha1:c66dea74f005d8c2b3b0d83e3b3ce8914d7c8ba1 pristine_git_object: f574e91eeea75b77876e8b57c600a82cca974542 docs/sdk/models/shared/bankaccount.md: id: a71ab3d0bf48 - last_write_checksum: sha1:ccd5299dc032ed8a87cebd33c286029560a77602 - pristine_git_object: faed406599521b56452b5502c9f19719641c9683 + last_write_checksum: sha1:334ee524bc71d1ca23899a90a1b967c1a4e7f305 + pristine_git_object: 75197d533be1c41a50f1cc95dd38c28daf696c56 docs/sdk/models/shared/bankaccountmappingoption.md: id: 29e658f6e450 - last_write_checksum: sha1:53dea7c541c1257b432b18ad55a2e3f3b2e396b1 - pristine_git_object: 4a742f4905f634ecb17c25934d53a3c34bd858a5 + last_write_checksum: sha1:c5a3b134e8332c7f5ff4a21c5159ee1dd469d22e + pristine_git_object: af7f469d50770577171bc6a2fc1c84e4fc22ab4f docs/sdk/models/shared/bankaccountprototype.md: id: 18647b021627 - last_write_checksum: sha1:9a60a35cceb3a086ec16c49d0653d1b3399b3f17 - pristine_git_object: 41f82d64a60e78f3d45f5a0fe405d37e6321afaf + last_write_checksum: sha1:52f384565eddaf3b7f40580d0859c2031d73c12c + pristine_git_object: 16cff76dca8ae7c3038a1ecfa852e5a3bda0f23a docs/sdk/models/shared/bankaccountstatus.md: id: bb5d0730c110 last_write_checksum: sha1:60d8edd47c360c1192f450de1e144ab941c68fad @@ -210,8 +214,8 @@ trackedFiles: pristine_git_object: 4fac2543aa7e0c0dc1ea7f888aee2bcb5db942b2 docs/sdk/models/shared/bill.md: id: 00ca34a63909 - last_write_checksum: sha1:0088442222e96ec2ea9f96b196c8d55c44d1bc23 - pristine_git_object: 9752ddeb4d9e1c723e76614cf8c99003d5de10a1 + last_write_checksum: sha1:745e1ee50594b75055a6edbca7f88c16fbeef036 + pristine_git_object: 7f71a429412386989736fadc0176ecd1760c5c45 docs/sdk/models/shared/billaccountref.md: id: ab2a9fcc40b6 last_write_checksum: sha1:35e9dbe72ee7f810f1dc222f01fe0854071ef252 @@ -226,20 +230,20 @@ trackedFiles: pristine_git_object: ce404e26f35c7acf4b525d18af3dd6664ed1073c docs/sdk/models/shared/billpayment.md: id: 3c14f1e2cb4b - last_write_checksum: sha1:de588c7d1c9b8dae61286ed3ffa56eef08b245ab - pristine_git_object: 611cbf73975391b0c9144eaa4e47294d49bff617 + last_write_checksum: sha1:e532046d8f6d8f9107947684f1dbcc880ca195d2 + pristine_git_object: 9a39e102b58035238366da60b8111f93f1cbbe1c docs/sdk/models/shared/billpaymentaccountref.md: id: ad79442633c0 last_write_checksum: sha1:ebf131c8609c441f44a6666aaf8851f3c0b929f9 pristine_git_object: 1ba880f63ed1824af8bfdf3149ee1533413a2bfd docs/sdk/models/shared/billpaymentprototype.md: id: 9370ce20d209 - last_write_checksum: sha1:c67bafd7bde1601941de41835877415b69f1e6c5 - pristine_git_object: 3e4224ccc8288635ec7b1d16019f0147a37aa88a + last_write_checksum: sha1:88608bb57230c27385620731d0657e369a7b0ea4 + pristine_git_object: d9aadc8bb5650e39baebc785d70c5498f4adf0e9 docs/sdk/models/shared/billprototype.md: id: 7f39fff97328 - last_write_checksum: sha1:e67e12b959e1d71e53c87ff640997936e13cea96 - pristine_git_object: 3227186133f744eb9041599fc1b2570315212228 + last_write_checksum: sha1:272887dc134f8b00f3b9b802a2d32acbc30df472 + pristine_git_object: d3be780207f7d8249451c6b7712c9488f3da5f27 docs/sdk/models/shared/bills.md: id: 9f0e932f8fb7 last_write_checksum: sha1:aba6b2c049b0f164acec8dfd955905a06571bfb0 @@ -254,12 +258,12 @@ trackedFiles: pristine_git_object: 4233d84a846692644a61ea68d3bedd6236e06fe1 docs/sdk/models/shared/clientratelimitwebhook.md: id: 2ad187176bc8 - last_write_checksum: sha1:aba014ef818b300a2a99f32871952603d83d8723 - pristine_git_object: 797ebda4702b75fdf9a93a6e609732d788cc3d18 + last_write_checksum: sha1:7aa2f52ccc8f0088a765c5ed78bf322b62f132ab + pristine_git_object: b1e7e5ffa2da695d73825ac70dc568b67112c445 docs/sdk/models/shared/clientratelimitwebhookpayload.md: id: 455bfe8fe625 - last_write_checksum: sha1:4e513cf7749ac85ab79abdbc700354433b92cdd1 - pristine_git_object: dec3e05c1d25919401906457bc75e192d1bbc00d + last_write_checksum: sha1:e44330624b87c24001524cab67c86c88fc412c7d + pristine_git_object: afe0d6bcff1c7ed490f70319f29514a0b8f3c0a7 docs/sdk/models/shared/codatfile.md: id: b32544e3a5a3 last_write_checksum: sha1:18eb035edd767bb64b5bf7785735f526a7db0d4a @@ -270,8 +274,8 @@ trackedFiles: pristine_git_object: 6d817ea79a353d68a783b50742c6d5f47018a586 docs/sdk/models/shared/company.md: id: fb5206b144df - last_write_checksum: sha1:3dc251179a6736b5476fe1c7ee300cc3973efeca - pristine_git_object: 77257345d9c0ca253ed5d372d40f94bc5d32c97d + last_write_checksum: sha1:3f099693b05ea9fd938bd657aa6148e8baec645a + pristine_git_object: b1717626e006e2ecb56b671886794c7901495a2a docs/sdk/models/shared/companyinformation.md: id: d78b0b4b325a last_write_checksum: sha1:ba150ec2e88dc076ca4b33b29754c38070b941e1 @@ -294,16 +298,16 @@ trackedFiles: pristine_git_object: c2895414e053283bafcd9865baaa72a806a83444 docs/sdk/models/shared/connection.md: id: 1c171381dd82 - last_write_checksum: sha1:f79da66873f4f9e0a6c74dd3d33627b53e78f423 - pristine_git_object: d19550723a9bb1e7da81bb74a9eaae1d1dc580fd + last_write_checksum: sha1:1d46733a254ce67dbd7e9b0391c89f27e6aab035 + pristine_git_object: 762b25c0460165793afcbce6aa013f395ddff35b docs/sdk/models/shared/connections.md: id: c39072f6f8dc last_write_checksum: sha1:e1a0cd88fda53543151de90e25b28c34ca6629f8 pristine_git_object: 4605317ee995d364b8e6766bd4cbef276a3a2577 docs/sdk/models/shared/dataconnectionerror.md: id: 993cf6eb3364 - last_write_checksum: sha1:674706c320bd73aeafd4724276448a5425c728eb - pristine_git_object: 045a260445d530cf6c3872098a330017ed495c23 + last_write_checksum: sha1:872055e84691229e26abbb0ae930fce260f298c0 + pristine_git_object: 9c60fb1dba39474f8ca0598c6206196f1ce30837 docs/sdk/models/shared/dataconnectionstatus.md: id: fd14e3dc6ca5 last_write_checksum: sha1:57c75966eb6caafc78628cd9a82861a16d12af3b @@ -350,12 +354,12 @@ trackedFiles: pristine_git_object: f0a72e771acb7f304ce0ddfcab254c0dff5c6e0a docs/sdk/models/shared/supplier.md: id: 18b82dd2f554 - last_write_checksum: sha1:d8a566bae76d8224bb0ada377e8ae95ae0c2cd55 - pristine_git_object: a15e0fcfdfc8b4fdff86f2093489e328797a5d88 + last_write_checksum: sha1:edfaa31f05d418469b81ce8ae8ccf3c452cf8197 + pristine_git_object: 5081b9b67f7294f928896e8f7329e8dab9cd0868 docs/sdk/models/shared/supplierprototype.md: id: a27221eee44d - last_write_checksum: sha1:f7de9d7f53c2fc4d57d3706a7211a02aa8dd4bdb - pristine_git_object: d352c080a663296a066f80b387cec6bbe77cc757 + last_write_checksum: sha1:ddba8dad1749525662b8584769a81031984966e4 + pristine_git_object: 2e69e091e6980133ec9f80ec2e84109268df345f docs/sdk/models/shared/supplierref.md: id: 8bf8e8bdeb32 last_write_checksum: sha1:1cf012570e51569753ee90384a858bab01433686 @@ -382,32 +386,32 @@ trackedFiles: pristine_git_object: ca27b21833be5f0fdf1d881925f1ff78ad069828 docs/sdks/bankaccounts/README.md: id: 510ffee224ea - last_write_checksum: sha1:f230e67bcdc7aa8b08b85b3a4a50a4b9a8950061 - pristine_git_object: 3fc4582ed50c51fea4f4f5df959a7a5221c47a69 + last_write_checksum: sha1:9c7c1463ccd19d91cce4534e7b25ed02ebcec2bc + pristine_git_object: db9df7c371199f7b719a7cee753f8d65abfb503d docs/sdks/billpayments/README.md: id: 9436cf9c44bd - last_write_checksum: sha1:19fd7e1edebafb105c063d80a2051204d170f4ac - pristine_git_object: cfba7b6afa58d2ddc8170da2f7b1bbdd824425af + last_write_checksum: sha1:ef4376c2d72147a0f042f0f53a56f99afc45f3b4 + pristine_git_object: c0ce8a6c8983312aaeeacf2cf9fd41a22506ebd2 docs/sdks/bills/README.md: id: 2a9c97966ab7 - last_write_checksum: sha1:55e66962c3b821801173327114a0049d78754420 - pristine_git_object: 937d36fd03129f4eb5a886360202a0f69e7c08f4 + last_write_checksum: sha1:f0c756b9ab954d18a3295b1f757e6e03b3051f18 + pristine_git_object: 545aa7c433b6d1c02e3987a62f6c6a233d7a8efe docs/sdks/companies/README.md: id: 67e8a49afa67 - last_write_checksum: sha1:29b8ed3045169efe7fc8d5eeb42227db4451948b - pristine_git_object: 33217f2fb129e95031508e14f118f099635dcbcc + last_write_checksum: sha1:25dc55545cecb7e370f0250422daad664b367ca3 + pristine_git_object: 86f656c14fd1a7136166117f6b2eb8ca20ef2fb4 docs/sdks/companyinformation/README.md: id: 319c7ed51023 - last_write_checksum: sha1:9edff1d747b0eef638dbacea70c6fb7fd4b1224a - pristine_git_object: bf1bdf7f327b85013f508a6f038a08101860b0e9 + last_write_checksum: sha1:e58f7db62956aa5382f424725b4d849bff2622ae + pristine_git_object: 69ba5168f3474d9be176c37afceb9bcb1932c96e docs/sdks/connections/README.md: id: 3ef8931411ea - last_write_checksum: sha1:5b794a5b7a3f6e3005963d2878371166ffdc934b - pristine_git_object: 4f09f80c03c833dd04a81e560f7bddbc1d526d05 + last_write_checksum: sha1:81809c76ff5a4f03544f9109fe581a8e226ef6ab + pristine_git_object: 452a258b593b694757e26817c56f6fe1a51fc3d9 docs/sdks/suppliers/README.md: id: 85867190cd79 - last_write_checksum: sha1:46781f3a75eab256cb37132ef9b40a9e347879d7 - pristine_git_object: dec70519e57fda24d874d4c0b25fdad1efa25f52 + last_write_checksum: sha1:39cbdf19ec3edd6615a9aa57250e36a3987b0f9e + pristine_git_object: dfc03ec5304835b004c45b9a6e6e611c09861740 eslint.config.mjs: id: 461c8d07f6da last_write_checksum: sha1:9398f326377fe47f67af2df6eb6370750c0790b4 @@ -430,12 +434,12 @@ trackedFiles: pristine_git_object: 978c98ebda9a2b1f9ea0961b7a06643f604d1d24 jsr.json: id: 7f6ab7767282 - last_write_checksum: sha1:7e428d16b98cc823067d02faf758b15542fad2a3 - pristine_git_object: a3b100df62e435455456dfe9a06f7017184aff5e + last_write_checksum: sha1:c6b3f0829d9e0c044498adbd9a6f5a4b79beeb06 + pristine_git_object: 0cb5b5775a7680695fc5d2c1ee7a137c8274980d package.json: id: 7030d0b2f71b - last_write_checksum: sha1:3da0d5028ebe8afcfe3e08de0090701fd20e4d5a - pristine_git_object: aa0fea63a788d20dd23bf2cef18c7284ce7883b4 + last_write_checksum: sha1:aaeff6d243afdfa522559b767dec7ff92fcfe163 + pristine_git_object: 7b0eb141c13e8964955e10403880be3c51d78101 src/core.ts: id: f431fdbcd144 last_write_checksum: sha1:8ac194d8a86c95d66ff881034c874004f103d6e8 @@ -472,6 +476,10 @@ trackedFiles: id: 116a7b452f5c last_write_checksum: sha1:daa08113502a895da2c9034fb34c7fa1991029c3 pristine_git_object: 2a8fd61dd7fa0be4aeb7b9db027f785da97888f0 + src/funcs/billsUpdate.ts: + id: a652cf860449 + last_write_checksum: sha1:d1481a9aa3b0e23e19f567047d88318d8ee4ab3b + pristine_git_object: bcf5448414a1dbb1e3081803c0bec87405f6a9be src/funcs/billsUploadAttachment.ts: id: d7311d53bc2f last_write_checksum: sha1:1fb8e84e689008f91f420ba5cf7b6f3792980e25 @@ -558,8 +566,8 @@ trackedFiles: pristine_git_object: 0aebd8b0a4867e35cb3348fc52921c3c0b4725b7 src/lib/config.ts: id: 320761608fb3 - last_write_checksum: sha1:6e7025631d380b68e03277e65054cb711ac2c5bf - pristine_git_object: 24d5a0cf094254fc274205c384958f10c8b313f2 + last_write_checksum: sha1:390a98b7d59665baee40b7eeb5276a8b9ed11761 + pristine_git_object: fd701a606a0cdedc02bcc0bacf3e0fcb1cfe8b20 src/lib/dlv.ts: id: b1988214835a last_write_checksum: sha1:1dd3e3fbb4550c4bf31f5ef997faff355d6f3250 @@ -602,8 +610,8 @@ trackedFiles: pristine_git_object: dc2510e330727b01894e4d3954ea92a62c962e5d src/lib/sdks.ts: id: 8a6d91f1218d - last_write_checksum: sha1:faf3ab84ae7a0104c0c43c6accd3e081cf33d191 - pristine_git_object: b1d7b5c0743b08f4248bdc0e0b84ec4d0617dffb + last_write_checksum: sha1:18da4753f916af929ae4a2445b13b09c23e1cc6f + pristine_git_object: 126029ae98e4c0ceb16ccfa40f8dd82890dd3193 src/lib/security.ts: id: 0502afa7922e last_write_checksum: sha1:c04a467e412cdd09a03239de17aa7d6a9afc246e @@ -622,8 +630,8 @@ trackedFiles: pristine_git_object: 63591a2053553e15dc188866e2ac283119813157 src/sdk/bills.ts: id: bfb7cb6dd91e - last_write_checksum: sha1:788d2a84ff79d6a0ccf1ce1e09b7b50ce0610ec8 - pristine_git_object: 9b074ec5261998f2208fb4837c6933a17c2f4a5d + last_write_checksum: sha1:d97ffac8d7b1b62e8e02d5dcf7e2d0a024f53fa9 + pristine_git_object: 37c217d486e24c24c3145d7fdca0628c427e5706 src/sdk/companies.ts: id: 7d7df3fca5ca last_write_checksum: sha1:adf6eda45c373f26cb05782b1056e6a5c2c13d52 @@ -722,8 +730,8 @@ trackedFiles: pristine_git_object: e3abe91dc20b75266936498daa6a04e90f407226 src/sdk/models/operations/index.ts: id: b2864d0519d7 - last_write_checksum: sha1:b44fffa284de9b2bd8d653775acd40e591bf18cf - pristine_git_object: 581b2008d85ebef77cd23fbc4bcf3e7b1a9dcb95 + last_write_checksum: sha1:4934cad9df052a399535eac591d0bc05d118d013 + pristine_git_object: 12cda2c10abda85b69ff014ab7541de1c155eb2b src/sdk/models/operations/listbillattachments.ts: id: 4c9488a771ad last_write_checksum: sha1:4ce52025b4b566e46e0a3a1795becd64d7c094c3 @@ -752,6 +760,10 @@ trackedFiles: id: 91e6d25ecd14 last_write_checksum: sha1:5f4e32b0424df5658a94c777839f8a75adbe40ed pristine_git_object: dbdba4a38ab397554e0d92300812dda648e941fd + src/sdk/models/operations/updatebill.ts: + id: 1c8f01a8941b + last_write_checksum: sha1:4f1ac22c3c7a78064cb2b0fb61a24a7848d15a67 + pristine_git_object: 2ccc0c5a87f77d28cd72451839b1dc0942d6f141 src/sdk/models/operations/updatecompany.ts: id: dbafb9e0f8d9 last_write_checksum: sha1:937aaa5e965aae942c6550456dbe3c37b5d2b280 @@ -1150,6 +1162,19 @@ examples: application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} "500": application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} + speakeasy-default-replace-company: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + requestBody: + application/json: {"name": "Bank of Dave", "description": "Requested early access to the new financing scheme."} + responses: + "200": + application/json: {"id": "0498e921-9b53-4396-a412-4f2f5983b0a2", "name": "string", "redirect": "https://link.codat.io/company/27628208-459c-46a2-a705-5641ce25f739", "lastSync": "2022-01-01T12:00:00.000Z", "created": "2022-01-01T12:00:00.000Z", "createdByUserName": "string", "products": ["spend-insights", "lending"], "tags": {"region": "us", "uid": "f6b0c253-16c7-4da1-a0c5-9c871e9c9d6c"}, "dataConnections": [{"id": "ee2eb431-c0fa-4dc9-93fa-d29781c12bcd", "integrationId": "bf083d72-62c7-493e-aec9-81b4dbba7e2c", "integrationKey": "dfxm", "sourceId": "bdd831ce-eebd-4896-89a7-20e5ee8989ee", "sourceType": "Banking", "platformName": "Basiq", "linkUrl": "https://link-api.codat.io/companies/86bd88cb-44ab-4dfb-b32f-87b19b14287f/connections/ee2eb431-c0fa-4dc9-93fa-d29781c12bcd/start", "status": "Linked", "lastSync": "2022-10-27T10:22:43.6464237Z", "created": "2022-10-27T09:53:29Z"}]} + "401": + application/json: {} + "500": + application/json: {} update-company: Update tags: parameters: @@ -1188,6 +1213,19 @@ examples: application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} "500": application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} + speakeasy-default-update-company: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + requestBody: + application/json: {"name": "Bank of Dave", "description": "Requested early access to the new financing scheme."} + responses: + "200": + application/json: {"id": "0498e921-9b53-4396-a412-4f2f5983b0a2", "name": "string", "redirect": "https://link.codat.io/company/27628208-459c-46a2-a705-5641ce25f739", "lastSync": "2022-01-01T12:00:00.000Z", "created": "2022-01-01T12:00:00.000Z", "createdByUserName": "string", "products": ["spend-insights", "lending"], "tags": {"region": "us", "uid": "f6b0c253-16c7-4da1-a0c5-9c871e9c9d6c"}, "dataConnections": [{"id": "ee2eb431-c0fa-4dc9-93fa-d29781c12bcd", "integrationId": "bf083d72-62c7-493e-aec9-81b4dbba7e2c", "integrationKey": "dfxm", "sourceId": "bdd831ce-eebd-4896-89a7-20e5ee8989ee", "sourceType": "Banking", "platformName": "Basiq", "linkUrl": "https://link-api.codat.io/companies/86bd88cb-44ab-4dfb-b32f-87b19b14287f/connections/ee2eb431-c0fa-4dc9-93fa-d29781c12bcd/start", "status": "Linked", "lastSync": "2022-10-27T10:22:43.6464237Z", "created": "2022-10-27T09:53:29Z"}]} + "401": + application/json: {} + "500": + application/json: {} delete-company: Unauthorized: parameters: @@ -1198,6 +1236,15 @@ examples: application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} "500": application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} + speakeasy-default-delete-company: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + responses: + "401": + application/json: {} + "500": + application/json: {} get-company: Simple company: parameters: @@ -1337,6 +1384,16 @@ examples: application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} "500": application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} + speakeasy-default-delete-connection: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + responses: + "401": + application/json: {} + "500": + application/json: {} unlink-connection: Example: parameters: @@ -1362,6 +1419,18 @@ examples: application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} "500": application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} + speakeasy-default-unlink-connection: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + responses: + "200": + application/json: {"id": "ee2eb431-c0fa-4dc9-93fa-d29781c12bcd", "integrationId": "bf083d72-62c7-493e-aec9-81b4dbba7e2c", "integrationKey": "dfxm", "sourceId": "bdd831ce-eebd-4896-89a7-20e5ee8989ee", "sourceType": "Banking", "platformName": "Basiq", "linkUrl": "https://link-api.codat.io/companies/86bd88cb-44ab-4dfb-b32f-87b19b14287f/connections/ee2eb431-c0fa-4dc9-93fa-d29781c12bcd/start", "status": "Linked", "lastSync": "2022-10-27T10:22:43.6464237Z", "created": "2022-10-27T09:53:29Z"} + "401": + application/json: {} + "500": + application/json: {} get-company-information: Company information: parameters: @@ -1623,6 +1692,20 @@ examples: application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} "500": application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} + speakeasy-default-download-bill-attachment: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + billId: "13d946f0-c5d5-42bc-b092-97ece17923ab" + attachmentId: "8a210b68-6988-11ed-a1eb-0242ac120002" + responses: + "200": + application/octet-stream: "x-file: example.file" + "401": + application/json: {} + "500": + application/json: {} get-mapping-options-payments: speakeasy-default-get-mapping-options-payments: parameters: @@ -1863,9 +1946,65 @@ examples: application/json: {"statusCode": 400, "service": "PublicApi", "error": "Error processing request - not valid.", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "canBeRetried": "Unknown", "detailedErrorCode": 0} "500": application/json: {"statusCode": 400, "service": "PublicApi", "error": "Error processing request - not valid.", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "canBeRetried": "Unknown", "detailedErrorCode": 0} + speakeasy-default-create-bank-account: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + requestBody: + application/json: {"name": "", "accountType": "Debit", "accountNumber": "", "currency": "GBP"} + responses: + "201": + application/json: {"currency": "GBP", "status": "Active", "sourceModifiedDate": "2022-10-23T00:00:00Z"} + "400": + application/json: {} + "500": + application/json: {} + update-bill: + Update bill: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + billId: "13d946f0-c5d5-42bc-b092-97ece17923ab" + requestBody: + application/json: {"reference": "bill_updated_ref", "supplierRef": {"id": "1262c350-fe0f-40ec-aeff-41c95b4a45af"}, "issueDate": "2023-04-23T00:00:00", "dueDate": "2023-05-23T00:00:00", "currency": "GBP", "currencyRate": 1, "lineItems": [{"description": "Updated line item - Microsoft Office training", "unitAmount": 2000, "quantity": 1, "taxAmount": 400, "accountRef": {"id": "46f9461e-788b-4906-8b74-d1ea17f6dc10"}, "totalAmount": 2400, "taxRateRef": {"id": "INPUT2"}}, {"description": "Desktop/network support via email & phone - updated rate", "unitAmount": 4500, "quantity": 1, "taxAmount": 900, "accountRef": {"id": "f96c9458-d724-47bf-8f74-a9d5726465ce"}, "totalAmount": 5400, "taxRateRef": {"id": "INPUT2"}, "trackingRefs": [{"id": "dba3d4da-f9ed-4eee-8e0b-452d11fdb1fa", "dataType": "trackingCategories"}]}], "status": "Open"} + responses: + "200": + application/json: {"supplierRef": {"id": ""}, "issueDate": "2022-10-23T00:00:00Z", "dueDate": "2022-10-23T00:00:00Z", "currency": "GBP", "lineItems": [{"trackingRefs": [{"id": "e9a1b63d-9ff0-40e7-8038-016354b987e6", "dataType": "trackingCategories"}]}], "status": "Open", "sourceModifiedDate": "2022-10-23T00:00:00Z"} + "400": + application/json: {} + "500": + application/json: {} + Updated bill: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + billId: "13d946f0-c5d5-42bc-b092-97ece17923ab" + requestBody: + application/json: {"supplierRef": {"id": ""}, "issueDate": "2022-10-23T00:00:00Z", "dueDate": "2022-10-23T00:00:00Z", "currency": "GBP", "lineItems": [{"trackingRefs": [{"id": "e9a1b63d-9ff0-40e7-8038-016354b987e6", "dataType": "trackingCategories"}]}], "status": "Open"} + responses: + "200": + application/json: {"id": "bill-1029932", "reference": "bill_updated_ref", "supplierRef": {"id": "1262c350-fe0f-40ec-aeff-41c95b4a45af", "supplierName": "DIISR - Small Business Services"}, "issueDate": "2023-04-23T00:00:00", "dueDate": "2023-05-23T00:00:00", "currency": "GBP", "lineItems": [{"description": "Updated line item - Microsoft Office training", "unitAmount": 2000, "quantity": 1, "taxAmount": 400, "accountRef": {"id": "46f9461e-788b-4906-8b74-d1ea17f6dc10"}, "totalAmount": 2400, "taxRateRef": {"id": "INPUT2"}}, {"description": "Desktop/network support via email & phone - updated rate", "unitAmount": 4500, "quantity": 1, "taxAmount": 900, "accountRef": {"id": "f96c9458-d724-47bf-8f74-a9d5726465ce"}, "totalAmount": 5400, "taxRateRef": {"id": "INPUT2"}, "trackingRefs": [{"id": "dba3d4da-f9ed-4eee-8e0b-452d11fdb1fa", "dataType": "trackingCategories"}]}], "status": "Open", "totalAmount": 7800, "amountDue": 7800} + Malformed query: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + billId: "13d946f0-c5d5-42bc-b092-97ece17923ab" + requestBody: + application/json: {"supplierRef": {"id": ""}, "issueDate": "2022-10-23T00:00:00Z", "dueDate": "2022-10-23T00:00:00Z", "currency": "GBP", "lineItems": [{"trackingRefs": [{"id": "e9a1b63d-9ff0-40e7-8038-016354b987e6", "dataType": "trackingCategories"}]}], "status": "Open"} + responses: + "400": + application/json: {"statusCode": 400, "service": "PublicApi", "error": "Error processing request - not valid.", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "canBeRetried": "Unknown", "detailedErrorCode": 0} + "500": + application/json: {"statusCode": 400, "service": "PublicApi", "error": "Error processing request - not valid.", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "canBeRetried": "Unknown", "detailedErrorCode": 0} examplesVersion: 1.0.2 generatedTests: {} -releaseNotes: "## Typescript SDK Changes:\n* `codatsyncpayables.bills.list()`: `response.results.[].lineItems.[]` **Changed**\n* `codatsyncpayables.bills.create()`: \n * `request.billPrototype.lineItems.[]` **Changed**\n * `response.lineitems.[]` **Changed**\n" +releaseNotes: | + ## Typescript SDK Changes: + * `codatsyncpayables.bills.update()`: **Added** generatedFiles: - .gitattributes - .npmignore diff --git a/sync-for-payables/.speakeasy/gen.yaml b/sync-for-payables/.speakeasy/gen.yaml index 813a939c0..7b2a5b6f6 100644 --- a/sync-for-payables/.speakeasy/gen.yaml +++ b/sync-for-payables/.speakeasy/gen.yaml @@ -13,6 +13,7 @@ generation: requestResponseComponentNamesFeb2024: true securityFeb2025: false sharedErrorComponentsApr2025: false + sharedNestedComponentsJan2026: false auth: oAuth2ClientCredentialsEnabled: false oAuth2PasswordEnabled: false @@ -20,6 +21,7 @@ generation: schemas: allOfMergeStrategy: shallowMerge requestBodyFieldName: "" + versioningStrategy: automatic persistentEdits: {} tests: generateTests: true @@ -27,7 +29,7 @@ generation: skipResponseBodyAssertions: false telemetryEnabled: true typescript: - version: 9.2.0 + version: 9.3.0 acceptHeaderEnum: true additionalDependencies: dependencies: {} @@ -66,6 +68,7 @@ typescript: inputModelSuffix: input jsonpath: legacy laxMode: strict + legacyFileNaming: true maxMethodParams: 0 methodArguments: infer-optional-args modelPropertyCasing: camel diff --git a/sync-for-payables/README.md b/sync-for-payables/README.md index c7d2c64e3..d271e8094 100644 --- a/sync-for-payables/README.md +++ b/sync-for-payables/README.md @@ -82,6 +82,7 @@ run(); * [getBillOptions](docs/sdks/bills/README.md#getbilloptions) - Get bill mapping options * [list](docs/sdks/bills/README.md#list) - List bills * [create](docs/sdks/bills/README.md#create) - Create bill +* [update](docs/sdks/bills/README.md#update) - Update bill * [uploadAttachment](docs/sdks/bills/README.md#uploadattachment) - Upload bill attachment * [listAttachments](docs/sdks/bills/README.md#listattachments) - List bill attachments * [downloadAttachment](docs/sdks/bills/README.md#downloadattachment) - Download bill attachment @@ -203,6 +204,7 @@ To read more about standalone functions, check [FUNCTIONS.md](./FUNCTIONS.md). - [`billsGetBillOptions`](docs/sdks/bills/README.md#getbilloptions) - Get bill mapping options - [`billsList`](docs/sdks/bills/README.md#list) - List bills - [`billsListAttachments`](docs/sdks/bills/README.md#listattachments) - List bill attachments +- [`billsUpdate`](docs/sdks/bills/README.md#update) - Update bill - [`billsUploadAttachment`](docs/sdks/bills/README.md#uploadattachment) - Upload bill attachment - [`companiesCreate`](docs/sdks/companies/README.md#create) - Create company - [`companiesDelete`](docs/sdks/companies/README.md#delete) - Delete a company diff --git a/sync-for-payables/RELEASES.md b/sync-for-payables/RELEASES.md index 3505da507..af724b7b4 100644 --- a/sync-for-payables/RELEASES.md +++ b/sync-for-payables/RELEASES.md @@ -88,4 +88,14 @@ Based on: ### Generated - [typescript v9.2.0] sync-for-payables ### Releases -- [NPM v9.2.0] https://www.npmjs.com/package/@codat/sync-for-payables/v/9.2.0 - sync-for-payables \ No newline at end of file +- [NPM v9.2.0] https://www.npmjs.com/package/@codat/sync-for-payables/v/9.2.0 - sync-for-payables + +## 2026-02-09 13:58:05 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.709.1 (2.812.2) https://github.com/speakeasy-api/speakeasy +### Generated +- [typescript v9.3.0] sync-for-payables +### Releases +- [NPM v9.3.0] https://www.npmjs.com/package/@codat/sync-for-payables/v/9.3.0 - sync-for-payables \ No newline at end of file diff --git a/sync-for-payables/docs/sdk/models/operations/createbillpaymentrequest.md b/sync-for-payables/docs/sdk/models/operations/createbillpaymentrequest.md index 4a18ead3f..d6a553341 100644 --- a/sync-for-payables/docs/sdk/models/operations/createbillpaymentrequest.md +++ b/sync-for-payables/docs/sdk/models/operations/createbillpaymentrequest.md @@ -14,10 +14,10 @@ let value: CreateBillPaymentRequest = { ## Fields -| Field | Type | Required | Description | Example | -| --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | -| `companyId` | *string* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | -| `connectionId` | *string* | :heavy_check_mark: | Unique identifier for a connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | -| `billId` | *string* | :heavy_check_mark: | Unique identifier for a bill. | 13d946f0-c5d5-42bc-b092-97ece17923ab | -| `idempotencyKey` | *string* | :heavy_minus_sign: | A unique identifier to ensure idempotent behaviour for subsequent requests. | | -| `billPaymentPrototype` | [shared.BillPaymentPrototype](../../../sdk/models/shared/billpaymentprototype.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `companyId` | *string* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `connectionId` | *string* | :heavy_check_mark: | Unique identifier for a connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | +| `billId` | *string* | :heavy_check_mark: | Unique identifier for a bill. | **Example 1:** 13d946f0-c5d5-42bc-b092-97ece17923ab
**Example 2:** 9wg4lep4ush5cxs79pl8sozmsndbaukll3ind4g7buqbm1h2
**Example 3:** 7110701885
**Example 4:** EILBDVJVNUAGVKRQ | +| `idempotencyKey` | *string* | :heavy_minus_sign: | A unique identifier to ensure idempotent behaviour for subsequent requests. | | +| `billPaymentPrototype` | [shared.BillPaymentPrototype](../../../sdk/models/shared/billpaymentprototype.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/sync-for-payables/docs/sdk/models/operations/downloadbillattachmentrequest.md b/sync-for-payables/docs/sdk/models/operations/downloadbillattachmentrequest.md index 813c2200a..e770d3238 100644 --- a/sync-for-payables/docs/sdk/models/operations/downloadbillattachmentrequest.md +++ b/sync-for-payables/docs/sdk/models/operations/downloadbillattachmentrequest.md @@ -15,9 +15,9 @@ let value: DownloadBillAttachmentRequest = { ## Fields -| Field | Type | Required | Description | Example | -| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | -| `companyId` | *string* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | -| `connectionId` | *string* | :heavy_check_mark: | Unique identifier for a connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | -| `billId` | *string* | :heavy_check_mark: | Unique identifier for a bill. | 13d946f0-c5d5-42bc-b092-97ece17923ab | -| `attachmentId` | *string* | :heavy_check_mark: | Unique identifier for an attachment. | 8a210b68-6988-11ed-a1eb-0242ac120002 | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `companyId` | *string* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `connectionId` | *string* | :heavy_check_mark: | Unique identifier for a connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | +| `billId` | *string* | :heavy_check_mark: | Unique identifier for a bill. | **Example 1:** 13d946f0-c5d5-42bc-b092-97ece17923ab
**Example 2:** 9wg4lep4ush5cxs79pl8sozmsndbaukll3ind4g7buqbm1h2
**Example 3:** 7110701885
**Example 4:** EILBDVJVNUAGVKRQ | +| `attachmentId` | *string* | :heavy_check_mark: | Unique identifier for an attachment. | 8a210b68-6988-11ed-a1eb-0242ac120002 | \ No newline at end of file diff --git a/sync-for-payables/docs/sdk/models/operations/listbillattachmentsrequest.md b/sync-for-payables/docs/sdk/models/operations/listbillattachmentsrequest.md index 07656597f..603c66a5b 100644 --- a/sync-for-payables/docs/sdk/models/operations/listbillattachmentsrequest.md +++ b/sync-for-payables/docs/sdk/models/operations/listbillattachmentsrequest.md @@ -14,8 +14,8 @@ let value: ListBillAttachmentsRequest = { ## Fields -| Field | Type | Required | Description | Example | -| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | -| `companyId` | *string* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | -| `connectionId` | *string* | :heavy_check_mark: | Unique identifier for a connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | -| `billId` | *string* | :heavy_check_mark: | Unique identifier for a bill. | 13d946f0-c5d5-42bc-b092-97ece17923ab | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `companyId` | *string* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `connectionId` | *string* | :heavy_check_mark: | Unique identifier for a connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | +| `billId` | *string* | :heavy_check_mark: | Unique identifier for a bill. | **Example 1:** 13d946f0-c5d5-42bc-b092-97ece17923ab
**Example 2:** 9wg4lep4ush5cxs79pl8sozmsndbaukll3ind4g7buqbm1h2
**Example 3:** 7110701885
**Example 4:** EILBDVJVNUAGVKRQ | \ No newline at end of file diff --git a/sync-for-payables/docs/sdk/models/operations/updatebillrequest.md b/sync-for-payables/docs/sdk/models/operations/updatebillrequest.md new file mode 100644 index 000000000..f00dbf031 --- /dev/null +++ b/sync-for-payables/docs/sdk/models/operations/updatebillrequest.md @@ -0,0 +1,23 @@ +# UpdateBillRequest + +## Example Usage + +```typescript +import { UpdateBillRequest } from "@codat/sync-for-payables/sdk/models/operations"; + +let value: UpdateBillRequest = { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + billId: "13d946f0-c5d5-42bc-b092-97ece17923ab", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `companyId` | *string* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `connectionId` | *string* | :heavy_check_mark: | Unique identifier for a connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | +| `billId` | *string* | :heavy_check_mark: | Unique identifier for a bill. | **Example 1:** 13d946f0-c5d5-42bc-b092-97ece17923ab
**Example 2:** 9wg4lep4ush5cxs79pl8sozmsndbaukll3ind4g7buqbm1h2
**Example 3:** 7110701885
**Example 4:** EILBDVJVNUAGVKRQ | +| `idempotencyKey` | *string* | :heavy_minus_sign: | A unique identifier to ensure idempotent behaviour for subsequent requests. | | +| `billPrototype` | [shared.BillPrototype](../../../sdk/models/shared/billprototype.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/sync-for-payables/docs/sdk/models/operations/uploadbillattachmentrequest.md b/sync-for-payables/docs/sdk/models/operations/uploadbillattachmentrequest.md index a485793ae..eeccc2601 100644 --- a/sync-for-payables/docs/sdk/models/operations/uploadbillattachmentrequest.md +++ b/sync-for-payables/docs/sdk/models/operations/uploadbillattachmentrequest.md @@ -10,9 +10,9 @@ import { UploadBillAttachmentRequest } from "@codat/sync-for-payables/sdk/models ## Fields -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | -| `companyId` | *string* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | -| `connectionId` | *string* | :heavy_check_mark: | Unique identifier for a connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | -| `billId` | *string* | :heavy_check_mark: | Unique identifier for a bill. | 13d946f0-c5d5-42bc-b092-97ece17923ab | -| `attachmentUpload` | [shared.AttachmentUpload](../../../sdk/models/shared/attachmentupload.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `companyId` | *string* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `connectionId` | *string* | :heavy_check_mark: | Unique identifier for a connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | +| `billId` | *string* | :heavy_check_mark: | Unique identifier for a bill. | **Example 1:** 13d946f0-c5d5-42bc-b092-97ece17923ab
**Example 2:** 9wg4lep4ush5cxs79pl8sozmsndbaukll3ind4g7buqbm1h2
**Example 3:** 7110701885
**Example 4:** EILBDVJVNUAGVKRQ | +| `attachmentUpload` | [shared.AttachmentUpload](../../../sdk/models/shared/attachmentupload.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/sync-for-payables/docs/sdk/models/shared/accountmappingoption.md b/sync-for-payables/docs/sdk/models/shared/accountmappingoption.md index a7c274f6a..012cbca5f 100644 --- a/sync-for-payables/docs/sdk/models/shared/accountmappingoption.md +++ b/sync-for-payables/docs/sdk/models/shared/accountmappingoption.md @@ -24,6 +24,6 @@ let value: AccountMappingOption = { | `nominalCode` | *string* | :heavy_minus_sign: | Reference given to each nominal account for a business. It ensures money is allocated to the correct account. This code isn't a unique identifier in the Codat system. | 610 | | `name` | *string* | :heavy_minus_sign: | Name of the account. | Accounts Payable | | `type` | *string* | :heavy_minus_sign: | Type of account. | Liability | -| `currency` | *string* | :heavy_minus_sign: | The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_.

## Unknown currencies

In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction.

There are only a very small number of edge cases where this currency code is returned by the Codat system. | GBP | +| `currency` | *string* | :heavy_minus_sign: | The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_.

## Unknown currencies

In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction.

There are only a very small number of edge cases where this currency code is returned by the Codat system. | **Example 1:** GBP
**Example 2:** USD
**Example 3:** EUR | | `status` | [shared.AccountStatus](../../../sdk/models/shared/accountstatus.md) | :heavy_minus_sign: | The current status of the account. | Active | -| `sourceModifiedDate` | *string* | :heavy_minus_sign: | N/A | 2022-10-23T00:00:00Z | \ No newline at end of file +| `sourceModifiedDate` | *string* | :heavy_minus_sign: | N/A | **Example 1:** 2022-10-23T00:00:00Z
**Example 2:** 2022-10-23 | \ No newline at end of file diff --git a/sync-for-payables/docs/sdk/models/shared/attachment.md b/sync-for-payables/docs/sdk/models/shared/attachment.md index 225eb9064..83e98b96e 100644 --- a/sync-for-payables/docs/sdk/models/shared/attachment.md +++ b/sync-for-payables/docs/sdk/models/shared/attachment.md @@ -35,7 +35,7 @@ let value: Attachment = { | `id` | *string* | :heavy_minus_sign: | Identifier for the attachment, unique for the company in the accounting software. | | | `name` | *string* | :heavy_minus_sign: | Name of the attachment file. | | | `contentType` | *string* | :heavy_minus_sign: | File type of the attachment. This is represented by appending the file type to the [IETF standard file naming requirements](https://tools.ietf.org/html/rfc6838). For example, for a jpeg file the output is **image/jpeg**.

Supported file types vary per platform. | | -| `dateCreated` | *string* | :heavy_minus_sign: | In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example:

```
2020-10-08T22:40:50Z
2021-01-01T00:00:00
```



When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information:

- Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z`
- Unqualified local time: `2021-11-15T01:00:00`
- UTC time offsets: `2021-11-15T01:00:00-05:00`

> Time zones
>
> Not all dates from Codat will contain information about time zones.
> Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. | 2022-10-23T00:00:00Z | +| `dateCreated` | *string* | :heavy_minus_sign: | In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example:

```
2020-10-08T22:40:50Z
2021-01-01T00:00:00
```



When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information:

- Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z`
- Unqualified local time: `2021-11-15T01:00:00`
- UTC time offsets: `2021-11-15T01:00:00-05:00`

> Time zones
>
> Not all dates from Codat will contain information about time zones.
> Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. | **Example 1:** 2022-10-23T00:00:00Z
**Example 2:** 2022-10-23 | | `fileSize` | *number* | :heavy_minus_sign: | File size in bytes. For example, if this reads **46153**, then the file size is 46kb. | | | `includeWhenSent` | *boolean* | :heavy_minus_sign: | If `true`, then the attachment is included with the associated invoice, bill or direct costs when it is printed, emailed, or sent to a customer, if the underlying accounting software allows this. | | -| `sourceModifiedDate` | *string* | :heavy_minus_sign: | N/A | 2022-10-23T00:00:00Z | \ No newline at end of file +| `sourceModifiedDate` | *string* | :heavy_minus_sign: | N/A | **Example 1:** 2022-10-23T00:00:00Z
**Example 2:** 2022-10-23 | \ No newline at end of file diff --git a/sync-for-payables/docs/sdk/models/shared/bankaccount.md b/sync-for-payables/docs/sdk/models/shared/bankaccount.md index faed40659..75197d533 100644 --- a/sync-for-payables/docs/sdk/models/shared/bankaccount.md +++ b/sync-for-payables/docs/sdk/models/shared/bankaccount.md @@ -22,6 +22,6 @@ let value: BankAccount = { | `accountType` | [shared.BankAccountType](../../../sdk/models/shared/bankaccounttype.md) | :heavy_minus_sign: | The type of transactions and balances on the account.
For Credit accounts, positive balances are liabilities, and positive transactions **reduce** liabilities.
For Debit accounts, positive balances are assets, and positive transactions **increase** assets. | | | `accountNumber` | *string* | :heavy_minus_sign: | Account number for the bank account.

Xero integrations
Only a UK account number shows for bank accounts with GBP currency and a combined total of sort code and account number that equals 14 digits, For non-GBP accounts, the full bank account number is populated. | | | `sortCode` | *string* | :heavy_minus_sign: | Sort code for the bank account. This is relevant to UK bank accounts.

Xero integrations
The sort code is only displayed when the currency = GBP and the sort code and account number sum to 14 digits. For non-GBP accounts, this field is not populated. | | -| `currency` | *string* | :heavy_minus_sign: | The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_.

## Unknown currencies

In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction.

There are only a very small number of edge cases where this currency code is returned by the Codat system. | GBP | +| `currency` | *string* | :heavy_minus_sign: | The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_.

## Unknown currencies

In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction.

There are only a very small number of edge cases where this currency code is returned by the Codat system. | **Example 1:** GBP
**Example 2:** USD
**Example 3:** EUR | | `status` | [shared.BankAccountStatus](../../../sdk/models/shared/bankaccountstatus.md) | :heavy_minus_sign: | The current status of the bank account. | Active | -| `sourceModifiedDate` | *string* | :heavy_minus_sign: | N/A | 2022-10-23T00:00:00Z | \ No newline at end of file +| `sourceModifiedDate` | *string* | :heavy_minus_sign: | N/A | **Example 1:** 2022-10-23T00:00:00Z
**Example 2:** 2022-10-23 | \ No newline at end of file diff --git a/sync-for-payables/docs/sdk/models/shared/bankaccountmappingoption.md b/sync-for-payables/docs/sdk/models/shared/bankaccountmappingoption.md index 4a742f490..af7f469d5 100644 --- a/sync-for-payables/docs/sdk/models/shared/bankaccountmappingoption.md +++ b/sync-for-payables/docs/sdk/models/shared/bankaccountmappingoption.md @@ -25,4 +25,4 @@ let value: BankAccountMappingOption = { | `currency` | *string* | :heavy_minus_sign: | The bank account's base currency. | | | `status` | [shared.BankAccountStatus](../../../sdk/models/shared/bankaccountstatus.md) | :heavy_minus_sign: | The current status of the bank account. | Active | | `accountType` | [shared.BankAccountType](../../../sdk/models/shared/bankaccounttype.md) | :heavy_minus_sign: | The type of transactions and balances on the account.
For Credit accounts, positive balances are liabilities, and positive transactions **reduce** liabilities.
For Debit accounts, positive balances are assets, and positive transactions **increase** assets. | | -| `sourceModifiedDate` | *string* | :heavy_minus_sign: | N/A | 2022-10-23T00:00:00Z | \ No newline at end of file +| `sourceModifiedDate` | *string* | :heavy_minus_sign: | N/A | **Example 1:** 2022-10-23T00:00:00Z
**Example 2:** 2022-10-23 | \ No newline at end of file diff --git a/sync-for-payables/docs/sdk/models/shared/bankaccountprototype.md b/sync-for-payables/docs/sdk/models/shared/bankaccountprototype.md index 41f82d64a..16cff76dc 100644 --- a/sync-for-payables/docs/sdk/models/shared/bankaccountprototype.md +++ b/sync-for-payables/docs/sdk/models/shared/bankaccountprototype.md @@ -22,4 +22,4 @@ let value: BankAccountPrototype = { | `accountType` | [shared.BankAccountType](../../../sdk/models/shared/bankaccounttype.md) | :heavy_check_mark: | The type of transactions and balances on the account.
For Credit accounts, positive balances are liabilities, and positive transactions **reduce** liabilities.
For Debit accounts, positive balances are assets, and positive transactions **increase** assets. | | | `accountNumber` | *string* | :heavy_check_mark: | Account number for the bank account.

Xero integrations
Only a UK account number shows for bank accounts with GBP currency and a combined total of sort code and account number that equals 14 digits, For non-GBP accounts, the full bank account number is populated. | | | `sortCode` | *string* | :heavy_minus_sign: | Sort code for the bank account. This is relevant to UK bank accounts.

Xero integrations
The sort code is only displayed when the currency = GBP and the sort code and account number sum to 14 digits. For non-GBP accounts, this field is not populated. | | -| `currency` | *string* | :heavy_check_mark: | The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_.

## Unknown currencies

In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction.

There are only a very small number of edge cases where this currency code is returned by the Codat system. | GBP | \ No newline at end of file +| `currency` | *string* | :heavy_check_mark: | The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_.

## Unknown currencies

In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction.

There are only a very small number of edge cases where this currency code is returned by the Codat system. | **Example 1:** GBP
**Example 2:** USD
**Example 3:** EUR | \ No newline at end of file diff --git a/sync-for-payables/docs/sdk/models/shared/bill.md b/sync-for-payables/docs/sdk/models/shared/bill.md index 9752ddeb4..7f71a4294 100644 --- a/sync-for-payables/docs/sdk/models/shared/bill.md +++ b/sync-for-payables/docs/sdk/models/shared/bill.md @@ -27,12 +27,12 @@ let value: Bill = { | `id` | *string* | :heavy_minus_sign: | Identifier for the bill, unique for the company in the accounting software. | | | `reference` | *string* | :heavy_minus_sign: | User-friendly reference for the bill. | | | `supplierRef` | [shared.SupplierRef](../../../sdk/models/shared/supplierref.md) | :heavy_check_mark: | Reference to the supplier the record relates to. | | -| `issueDate` | *string* | :heavy_check_mark: | N/A | 2022-10-23T00:00:00Z | -| `dueDate` | *string* | :heavy_check_mark: | N/A | 2022-10-23T00:00:00Z | -| `currency` | *string* | :heavy_check_mark: | The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_.

## Unknown currencies

In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction.

There are only a very small number of edge cases where this currency code is returned by the Codat system. | GBP | +| `issueDate` | *string* | :heavy_check_mark: | N/A | **Example 1:** 2022-10-23T00:00:00Z
**Example 2:** 2022-10-23 | +| `dueDate` | *string* | :heavy_check_mark: | N/A | **Example 1:** 2022-10-23T00:00:00Z
**Example 2:** 2022-10-23 | +| `currency` | *string* | :heavy_check_mark: | The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_.

## Unknown currencies

In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction.

There are only a very small number of edge cases where this currency code is returned by the Codat system. | **Example 1:** GBP
**Example 2:** USD
**Example 3:** EUR | | `currencyRate` | *Decimal* | :heavy_minus_sign: | Rate to convert the total amount of the payment into the base currency for the company at the time of the payment.

Currency rates in Codat are implemented as the multiple of foreign currency units to each base currency unit.

It is not possible to perform the currency conversion with two or more non-base currencies participating in the transaction. For example, if a company's base currency is USD, and it has a bill issued in EUR, then the bill payment must happen in USD or EUR.

Where the currency rate is provided by the underlying accounting software, it will be available from Codat with the same precision (up to a maximum of 9 decimal places).

For accounting software which do not provide an explicit currency rate, it is calculated as `baseCurrency / foreignCurrency` and will be returned to 9 decimal places.

## Examples with base currency of GBP

\| Foreign Currency \| Foreign Amount \| Currency Rate \| Base Currency Amount (GBP) \|
\| :--------------- \| :------------- \| :------------ \| :------------------------- \|
\| **USD** \| $20 \| 0.781 \| £15.62 \|
\| **EUR** \| €20 \| 0.885 \| £17.70 \|
\| **RUB** \| ₽20 \| 0.011 \| £0.22 \|

## Examples with base currency of USD

\| Foreign Currency \| Foreign Amount \| Currency Rate \| Base Currency Amount (USD) \|
\| :--------------- \| :------------- \| :------------ \| :------------------------- \|
\| **GBP** \| £20 \| 1.277 \| $25.54 \|
\| **EUR** \| €20 \| 1.134 \| $22.68 \|
\| **RUB** \| ₽20 \| 0.015 \| $0.30 \|


### Integration-specific details

\| Integration \| Scenario \| System behavior \|
\|-------------------\|-------------------------------------------------\|----------------------------------------------------------------------------------------------------------------------------------------------------------------------\|
\| QuickBooks Online \| Transaction currency differs from base currency \| If currency rate value is left `null`, a rate of 1 will be used by QBO by default. To override this, specify a currencyRate in the request body. \| | | | `lineItems` | [shared.BillLineItem](../../../sdk/models/shared/billlineitem.md)[] | :heavy_minus_sign: | Array of Bill line items. | | | `status` | [shared.BillStatus](../../../sdk/models/shared/billstatus.md) | :heavy_check_mark: | Current state of the bill. If creating a bill the status must be `Open`. | Open | | `totalAmount` | *Decimal* | :heavy_minus_sign: | Amount of the bill, including tax. | | | `amountDue` | *Decimal* | :heavy_minus_sign: | Amount outstanding on the bill. | | -| `sourceModifiedDate` | *string* | :heavy_minus_sign: | N/A | 2022-10-23T00:00:00Z | \ No newline at end of file +| `sourceModifiedDate` | *string* | :heavy_minus_sign: | N/A | **Example 1:** 2022-10-23T00:00:00Z
**Example 2:** 2022-10-23 | \ No newline at end of file diff --git a/sync-for-payables/docs/sdk/models/shared/billpayment.md b/sync-for-payables/docs/sdk/models/shared/billpayment.md index 611cbf739..9a39e102b 100644 --- a/sync-for-payables/docs/sdk/models/shared/billpayment.md +++ b/sync-for-payables/docs/sdk/models/shared/billpayment.md @@ -23,7 +23,7 @@ let value: BillPayment = { | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `id` | *string* | :heavy_minus_sign: | Identifier for the bill payment, unique for the company in the accounting software. | | | `amount` | *Decimal* | :heavy_minus_sign: | Amount of the payment in the bill currency. | 1329.54 | -| `date` | *string* | :heavy_minus_sign: | N/A | 2022-10-23T00:00:00Z | +| `date` | *string* | :heavy_minus_sign: | N/A | **Example 1:** 2022-10-23T00:00:00Z
**Example 2:** 2022-10-23 | | `reference` | *string* | :heavy_minus_sign: | Additional information associated with the payment. | Bill Payment against bill c13e37b6-dfaa-4894-b3be-9fe97bda9f44 | | `accountRef` | [shared.BillPaymentAccountRef](../../../sdk/models/shared/billpaymentaccountref.md) | :heavy_minus_sign: | Reference to the bank account / credit card which you are using to pay the bill. | | | `currencyRate` | *Decimal* | :heavy_minus_sign: | Rate to convert the total amount of the payment into the base currency for the company at the time of the payment.

Currency rates in Codat are implemented as the multiple of foreign currency units to each base currency unit.

It is not possible to perform the currency conversion with two or more non-base currencies participating in the transaction. For example, if a company's base currency is USD, and it has a bill issued in EUR, then the bill payment must happen in USD or EUR.

Where the currency rate is provided by the underlying accounting software, it will be available from Codat with the same precision (up to a maximum of 9 decimal places).

For accounting software which do not provide an explicit currency rate, it is calculated as `baseCurrency / foreignCurrency` and will be returned to 9 decimal places.

## Examples with base currency of GBP

\| Foreign Currency \| Foreign Amount \| Currency Rate \| Base Currency Amount (GBP) \|
\| :--------------- \| :------------- \| :------------ \| :------------------------- \|
\| **USD** \| $20 \| 0.781 \| £15.62 \|
\| **EUR** \| €20 \| 0.885 \| £17.70 \|
\| **RUB** \| ₽20 \| 0.011 \| £0.22 \|

## Examples with base currency of USD

\| Foreign Currency \| Foreign Amount \| Currency Rate \| Base Currency Amount (USD) \|
\| :--------------- \| :------------- \| :------------ \| :------------------------- \|
\| **GBP** \| £20 \| 1.277 \| $25.54 \|
\| **EUR** \| €20 \| 1.134 \| $22.68 \|
\| **RUB** \| ₽20 \| 0.015 \| $0.30 \|


### Integration-specific details

\| Integration \| Scenario \| System behavior \|
\|-------------------\|-------------------------------------------------\|----------------------------------------------------------------------------------------------------------------------------------------------------------------------\|
\| QuickBooks Online \| Transaction currency differs from base currency \| If currency rate value is left `null`, a rate of 1 will be used by QBO by default. To override this, specify a currencyRate in the request body. \| | | \ No newline at end of file diff --git a/sync-for-payables/docs/sdk/models/shared/billpaymentprototype.md b/sync-for-payables/docs/sdk/models/shared/billpaymentprototype.md index 3e4224ccc..d9aadc8bb 100644 --- a/sync-for-payables/docs/sdk/models/shared/billpaymentprototype.md +++ b/sync-for-payables/docs/sdk/models/shared/billpaymentprototype.md @@ -21,7 +21,7 @@ let value: BillPaymentPrototype = { | Field | Type | Required | Description | Example | | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `amount` | *Decimal* | :heavy_check_mark: | Amount of the payment in the bill currency. | 1329.54 | -| `date` | *string* | :heavy_check_mark: | N/A | 2022-10-23T00:00:00Z | +| `date` | *string* | :heavy_check_mark: | N/A | **Example 1:** 2022-10-23T00:00:00Z
**Example 2:** 2022-10-23 | | `reference` | *string* | :heavy_minus_sign: | Additional information associated with the payment. | Bill Payment against bill c13e37b6-dfaa-4894-b3be-9fe97bda9f44 | | `accountRef` | [shared.BillPaymentAccountRef](../../../sdk/models/shared/billpaymentaccountref.md) | :heavy_check_mark: | Reference to the bank account / credit card which you are using to pay the bill. | | | `currencyRate` | *Decimal* | :heavy_minus_sign: | Rate to convert the total amount of the payment into the base currency for the company at the time of the payment.

Currency rates in Codat are implemented as the multiple of foreign currency units to each base currency unit.

It is not possible to perform the currency conversion with two or more non-base currencies participating in the transaction. For example, if a company's base currency is USD, and it has a bill issued in EUR, then the bill payment must happen in USD or EUR.

Where the currency rate is provided by the underlying accounting software, it will be available from Codat with the same precision (up to a maximum of 9 decimal places).

For accounting software which do not provide an explicit currency rate, it is calculated as `baseCurrency / foreignCurrency` and will be returned to 9 decimal places.

## Examples with base currency of GBP

\| Foreign Currency \| Foreign Amount \| Currency Rate \| Base Currency Amount (GBP) \|
\| :--------------- \| :------------- \| :------------ \| :------------------------- \|
\| **USD** \| $20 \| 0.781 \| £15.62 \|
\| **EUR** \| €20 \| 0.885 \| £17.70 \|
\| **RUB** \| ₽20 \| 0.011 \| £0.22 \|

## Examples with base currency of USD

\| Foreign Currency \| Foreign Amount \| Currency Rate \| Base Currency Amount (USD) \|
\| :--------------- \| :------------- \| :------------ \| :------------------------- \|
\| **GBP** \| £20 \| 1.277 \| $25.54 \|
\| **EUR** \| €20 \| 1.134 \| $22.68 \|
\| **RUB** \| ₽20 \| 0.015 \| $0.30 \|


### Integration-specific details

\| Integration \| Scenario \| System behavior \|
\|-------------------\|-------------------------------------------------\|----------------------------------------------------------------------------------------------------------------------------------------------------------------------\|
\| QuickBooks Online \| Transaction currency differs from base currency \| If currency rate value is left `null`, a rate of 1 will be used by QBO by default. To override this, specify a currencyRate in the request body. \| | | \ No newline at end of file diff --git a/sync-for-payables/docs/sdk/models/shared/billprototype.md b/sync-for-payables/docs/sdk/models/shared/billprototype.md index 322718613..d3be78020 100644 --- a/sync-for-payables/docs/sdk/models/shared/billprototype.md +++ b/sync-for-payables/docs/sdk/models/shared/billprototype.md @@ -23,9 +23,9 @@ let value: BillPrototype = { | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `reference` | *string* | :heavy_minus_sign: | User-friendly reference for the bill. | | | `supplierRef` | [shared.SupplierRef](../../../sdk/models/shared/supplierref.md) | :heavy_check_mark: | Reference to the supplier the record relates to. | | -| `issueDate` | *string* | :heavy_check_mark: | N/A | 2022-10-23T00:00:00Z | -| `dueDate` | *string* | :heavy_check_mark: | N/A | 2022-10-23T00:00:00Z | -| `currency` | *string* | :heavy_check_mark: | The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_.

## Unknown currencies

In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction.

There are only a very small number of edge cases where this currency code is returned by the Codat system. | GBP | +| `issueDate` | *string* | :heavy_check_mark: | N/A | **Example 1:** 2022-10-23T00:00:00Z
**Example 2:** 2022-10-23 | +| `dueDate` | *string* | :heavy_check_mark: | N/A | **Example 1:** 2022-10-23T00:00:00Z
**Example 2:** 2022-10-23 | +| `currency` | *string* | :heavy_check_mark: | The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_.

## Unknown currencies

In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction.

There are only a very small number of edge cases where this currency code is returned by the Codat system. | **Example 1:** GBP
**Example 2:** USD
**Example 3:** EUR | | `currencyRate` | *Decimal* | :heavy_minus_sign: | Rate to convert the total amount of the payment into the base currency for the company at the time of the payment.

Currency rates in Codat are implemented as the multiple of foreign currency units to each base currency unit.

It is not possible to perform the currency conversion with two or more non-base currencies participating in the transaction. For example, if a company's base currency is USD, and it has a bill issued in EUR, then the bill payment must happen in USD or EUR.

Where the currency rate is provided by the underlying accounting software, it will be available from Codat with the same precision (up to a maximum of 9 decimal places).

For accounting software which do not provide an explicit currency rate, it is calculated as `baseCurrency / foreignCurrency` and will be returned to 9 decimal places.

## Examples with base currency of GBP

\| Foreign Currency \| Foreign Amount \| Currency Rate \| Base Currency Amount (GBP) \|
\| :--------------- \| :------------- \| :------------ \| :------------------------- \|
\| **USD** \| $20 \| 0.781 \| £15.62 \|
\| **EUR** \| €20 \| 0.885 \| £17.70 \|
\| **RUB** \| ₽20 \| 0.011 \| £0.22 \|

## Examples with base currency of USD

\| Foreign Currency \| Foreign Amount \| Currency Rate \| Base Currency Amount (USD) \|
\| :--------------- \| :------------- \| :------------ \| :------------------------- \|
\| **GBP** \| £20 \| 1.277 \| $25.54 \|
\| **EUR** \| €20 \| 1.134 \| $22.68 \|
\| **RUB** \| ₽20 \| 0.015 \| $0.30 \|


### Integration-specific details

\| Integration \| Scenario \| System behavior \|
\|-------------------\|-------------------------------------------------\|----------------------------------------------------------------------------------------------------------------------------------------------------------------------\|
\| QuickBooks Online \| Transaction currency differs from base currency \| If currency rate value is left `null`, a rate of 1 will be used by QBO by default. To override this, specify a currencyRate in the request body. \| | | | `lineItems` | [shared.BillLineItem](../../../sdk/models/shared/billlineitem.md)[] | :heavy_minus_sign: | Array of Bill line items. | | | `status` | [shared.BillStatus](../../../sdk/models/shared/billstatus.md) | :heavy_check_mark: | Current state of the bill. If creating a bill the status must be `Open`. | Open | \ No newline at end of file diff --git a/sync-for-payables/docs/sdk/models/shared/clientratelimitwebhook.md b/sync-for-payables/docs/sdk/models/shared/clientratelimitwebhook.md index 797ebda47..b1e7e5ffa 100644 --- a/sync-for-payables/docs/sdk/models/shared/clientratelimitwebhook.md +++ b/sync-for-payables/docs/sdk/models/shared/clientratelimitwebhook.md @@ -20,6 +20,6 @@ let value: ClientRateLimitWebhook = { | Field | Type | Required | Description | Example | | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `id` | *string* | :heavy_minus_sign: | Unique identifier of the event. | 743ec94a-8aa4-44bb-8bd4-e1855ee0e74b | -| `eventType` | *string* | :heavy_minus_sign: | The type of event. | client.rateLimit.reset | -| `generatedDate` | *string* | :heavy_minus_sign: | In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example:

```
2020-10-08T22:40:50Z
2021-01-01T00:00:00
```



When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information:

- Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z`
- Unqualified local time: `2021-11-15T01:00:00`
- UTC time offsets: `2021-11-15T01:00:00-05:00`

> Time zones
>
> Not all dates from Codat will contain information about time zones.
> Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. | 2022-10-23T00:00:00Z | +| `eventType` | *string* | :heavy_minus_sign: | The type of event. | **Example 1:** client.rateLimit.reset
**Example 2:** client.rateLimit.reached | +| `generatedDate` | *string* | :heavy_minus_sign: | In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example:

```
2020-10-08T22:40:50Z
2021-01-01T00:00:00
```



When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information:

- Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z`
- Unqualified local time: `2021-11-15T01:00:00`
- UTC time offsets: `2021-11-15T01:00:00-05:00`

> Time zones
>
> Not all dates from Codat will contain information about time zones.
> Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. | **Example 1:** 2022-10-23T00:00:00Z
**Example 2:** 2022-10-23 | | `payload` | [shared.ClientRateLimitWebhookPayload](../../../sdk/models/shared/clientratelimitwebhookpayload.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/sync-for-payables/docs/sdk/models/shared/clientratelimitwebhookpayload.md b/sync-for-payables/docs/sdk/models/shared/clientratelimitwebhookpayload.md index dec3e05c1..afe0d6bcf 100644 --- a/sync-for-payables/docs/sdk/models/shared/clientratelimitwebhookpayload.md +++ b/sync-for-payables/docs/sdk/models/shared/clientratelimitwebhookpayload.md @@ -16,4 +16,4 @@ let value: ClientRateLimitWebhookPayload = { | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `dailyQuota` | *number* | :heavy_minus_sign: | The number of available requests per day. | | | `quotaRemaining` | *number* | :heavy_minus_sign: | Total number of requests remaining for your client. | | -| `expiryDate` | *string* | :heavy_minus_sign: | In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example:

```
2020-10-08T22:40:50Z
2021-01-01T00:00:00
```



When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information:

- Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z`
- Unqualified local time: `2021-11-15T01:00:00`
- UTC time offsets: `2021-11-15T01:00:00-05:00`

> Time zones
>
> Not all dates from Codat will contain information about time zones.
> Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. | 2022-10-23T00:00:00Z | \ No newline at end of file +| `expiryDate` | *string* | :heavy_minus_sign: | In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example:

```
2020-10-08T22:40:50Z
2021-01-01T00:00:00
```



When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information:

- Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z`
- Unqualified local time: `2021-11-15T01:00:00`
- UTC time offsets: `2021-11-15T01:00:00-05:00`

> Time zones
>
> Not all dates from Codat will contain information about time zones.
> Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. | **Example 1:** 2022-10-23T00:00:00Z
**Example 2:** 2022-10-23 | \ No newline at end of file diff --git a/sync-for-payables/docs/sdk/models/shared/company.md b/sync-for-payables/docs/sdk/models/shared/company.md index 77257345d..b1717626e 100644 --- a/sync-for-payables/docs/sdk/models/shared/company.md +++ b/sync-for-payables/docs/sdk/models/shared/company.md @@ -53,8 +53,8 @@ let value: Company = { | `name` | *string* | :heavy_check_mark: | The name of the company | Codat Ltd. | | `description` | *string* | :heavy_minus_sign: | Additional information about the company. This can be used to store foreign IDs, references, etc. | Requested early access to the new financing scheme. | | `redirect` | *string* | :heavy_check_mark: | The `redirect` [Link URL](https://docs.codat.io/auth-flow/authorize-hosted-link) enabling the customer to start their auth flow journey for the company. | https://link.codat.io/company/27628208-459c-46a2-a705-5641ce25f739 | -| `lastSync` | *string* | :heavy_minus_sign: | In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example:

```
2020-10-08T22:40:50Z
2021-01-01T00:00:00
```



When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information:

- Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z`
- Unqualified local time: `2021-11-15T01:00:00`
- UTC time offsets: `2021-11-15T01:00:00-05:00`

> Time zones
>
> Not all dates from Codat will contain information about time zones.
> Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. | 2022-10-23T00:00:00Z | -| `created` | *string* | :heavy_minus_sign: | In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example:

```
2020-10-08T22:40:50Z
2021-01-01T00:00:00
```



When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information:

- Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z`
- Unqualified local time: `2021-11-15T01:00:00`
- UTC time offsets: `2021-11-15T01:00:00-05:00`

> Time zones
>
> Not all dates from Codat will contain information about time zones.
> Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. | 2022-10-23T00:00:00Z | +| `lastSync` | *string* | :heavy_minus_sign: | In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example:

```
2020-10-08T22:40:50Z
2021-01-01T00:00:00
```



When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information:

- Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z`
- Unqualified local time: `2021-11-15T01:00:00`
- UTC time offsets: `2021-11-15T01:00:00-05:00`

> Time zones
>
> Not all dates from Codat will contain information about time zones.
> Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. | **Example 1:** 2022-10-23T00:00:00Z
**Example 2:** 2022-10-23 | +| `created` | *string* | :heavy_minus_sign: | In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example:

```
2020-10-08T22:40:50Z
2021-01-01T00:00:00
```



When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information:

- Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z`
- Unqualified local time: `2021-11-15T01:00:00`
- UTC time offsets: `2021-11-15T01:00:00-05:00`

> Time zones
>
> Not all dates from Codat will contain information about time zones.
> Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. | **Example 1:** 2022-10-23T00:00:00Z
**Example 2:** 2022-10-23 | | `createdByUserName` | *string* | :heavy_minus_sign: | Name of user that created the company in Codat. | | | `products` | *string*[] | :heavy_minus_sign: | An array of products that are currently enabled for the company. | | | `tags` | Record | :heavy_minus_sign: | A collection of user-defined key-value pairs that store custom metadata against the company. | | diff --git a/sync-for-payables/docs/sdk/models/shared/connection.md b/sync-for-payables/docs/sdk/models/shared/connection.md index d19550723..762b25c04 100644 --- a/sync-for-payables/docs/sdk/models/shared/connection.md +++ b/sync-for-payables/docs/sdk/models/shared/connection.md @@ -43,7 +43,7 @@ let value: Connection = { | `platformName` | *string* | :heavy_check_mark: | Name of integration connected to company. | | | `linkUrl` | *string* | :heavy_check_mark: | The link URL your customers can use to authorize access to their business application. | https://link-api.codat.io/companies/86bd88cb-44ab-4dfb-b32f-87b19b14287f/connections/2e2eb431-c1fa-4dc9-93fa-d29781c12bcd/start | | `status` | [shared.DataConnectionStatus](../../../sdk/models/shared/dataconnectionstatus.md) | :heavy_check_mark: | The current authorization status of the data connection. | | -| `lastSync` | *string* | :heavy_minus_sign: | In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example:

```
2020-10-08T22:40:50Z
2021-01-01T00:00:00
```



When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information:

- Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z`
- Unqualified local time: `2021-11-15T01:00:00`
- UTC time offsets: `2021-11-15T01:00:00-05:00`

> Time zones
>
> Not all dates from Codat will contain information about time zones.
> Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. | 2022-10-23T00:00:00Z | -| `created` | *string* | :heavy_check_mark: | In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example:

```
2020-10-08T22:40:50Z
2021-01-01T00:00:00
```



When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information:

- Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z`
- Unqualified local time: `2021-11-15T01:00:00`
- UTC time offsets: `2021-11-15T01:00:00-05:00`

> Time zones
>
> Not all dates from Codat will contain information about time zones.
> Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. | 2022-10-23T00:00:00Z | +| `lastSync` | *string* | :heavy_minus_sign: | In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example:

```
2020-10-08T22:40:50Z
2021-01-01T00:00:00
```



When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information:

- Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z`
- Unqualified local time: `2021-11-15T01:00:00`
- UTC time offsets: `2021-11-15T01:00:00-05:00`

> Time zones
>
> Not all dates from Codat will contain information about time zones.
> Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. | **Example 1:** 2022-10-23T00:00:00Z
**Example 2:** 2022-10-23 | +| `created` | *string* | :heavy_check_mark: | In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example:

```
2020-10-08T22:40:50Z
2021-01-01T00:00:00
```



When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information:

- Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z`
- Unqualified local time: `2021-11-15T01:00:00`
- UTC time offsets: `2021-11-15T01:00:00-05:00`

> Time zones
>
> Not all dates from Codat will contain information about time zones.
> Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. | **Example 1:** 2022-10-23T00:00:00Z
**Example 2:** 2022-10-23 | | `dataConnectionErrors` | [shared.DataConnectionError](../../../sdk/models/shared/dataconnectionerror.md)[] | :heavy_minus_sign: | N/A | | | `connectionInfo` | Record | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/sync-for-payables/docs/sdk/models/shared/dataconnectionerror.md b/sync-for-payables/docs/sdk/models/shared/dataconnectionerror.md index 045a26044..9c60fb1db 100644 --- a/sync-for-payables/docs/sdk/models/shared/dataconnectionerror.md +++ b/sync-for-payables/docs/sdk/models/shared/dataconnectionerror.md @@ -18,6 +18,6 @@ let value: DataConnectionError = { | `statusCode` | *string* | :heavy_minus_sign: | The HTTP status code returned by the source platform when the error occurred. | | | `statusText` | *string* | :heavy_minus_sign: | A non-numeric status code/text returned by the source platform when the error occurred. | | | `errorMessage` | *string* | :heavy_minus_sign: | A message about a error returned by Codat. | | -| `erroredOnUtc` | *string* | :heavy_minus_sign: | In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example:

```
2020-10-08T22:40:50Z
2021-01-01T00:00:00
```



When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information:

- Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z`
- Unqualified local time: `2021-11-15T01:00:00`
- UTC time offsets: `2021-11-15T01:00:00-05:00`

> Time zones
>
> Not all dates from Codat will contain information about time zones.
> Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. | 2022-10-23T00:00:00Z | +| `erroredOnUtc` | *string* | :heavy_minus_sign: | In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example:

```
2020-10-08T22:40:50Z
2021-01-01T00:00:00
```



When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information:

- Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z`
- Unqualified local time: `2021-11-15T01:00:00`
- UTC time offsets: `2021-11-15T01:00:00-05:00`

> Time zones
>
> Not all dates from Codat will contain information about time zones.
> Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. | **Example 1:** 2022-10-23T00:00:00Z
**Example 2:** 2022-10-23 | | `status` | [shared.ErrorStatus](../../../sdk/models/shared/errorstatus.md) | :heavy_minus_sign: | The current status of a transient error. Null statuses indicate that the error is not transient. | | -| `resolvedOnUtc` | *string* | :heavy_minus_sign: | In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example:

```
2020-10-08T22:40:50Z
2021-01-01T00:00:00
```



When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information:

- Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z`
- Unqualified local time: `2021-11-15T01:00:00`
- UTC time offsets: `2021-11-15T01:00:00-05:00`

> Time zones
>
> Not all dates from Codat will contain information about time zones.
> Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. | 2022-10-23T00:00:00Z | \ No newline at end of file +| `resolvedOnUtc` | *string* | :heavy_minus_sign: | In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example:

```
2020-10-08T22:40:50Z
2021-01-01T00:00:00
```



When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information:

- Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z`
- Unqualified local time: `2021-11-15T01:00:00`
- UTC time offsets: `2021-11-15T01:00:00-05:00`

> Time zones
>
> Not all dates from Codat will contain information about time zones.
> Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. | **Example 1:** 2022-10-23T00:00:00Z
**Example 2:** 2022-10-23 | \ No newline at end of file diff --git a/sync-for-payables/docs/sdk/models/shared/supplier.md b/sync-for-payables/docs/sdk/models/shared/supplier.md index a15e0fcfd..5081b9b67 100644 --- a/sync-for-payables/docs/sdk/models/shared/supplier.md +++ b/sync-for-payables/docs/sdk/models/shared/supplier.md @@ -34,15 +34,15 @@ let value: Supplier = { ## Fields -| Field | Type | Required | Description | Example | -| -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -| `id` | *string* | :heavy_minus_sign: | Identifier for the supplier, unique to the company in the accounting software. | | -| `supplierName` | *string* | :heavy_minus_sign: | Name of the supplier as recorded in the accounting system, typically the company name. | | -| `contactName` | *string* | :heavy_minus_sign: | Name of the main contact for the supplier. | | -| `emailAddress` | *string* | :heavy_minus_sign: | Email address that the supplier may be contacted on. | | -| `phone` | *string* | :heavy_minus_sign: | Phone number that the supplier may be contacted on. | +44 25691 154789 | -| `addresses` | [shared.Address](../../../sdk/models/shared/address.md)[] | :heavy_minus_sign: | An array of Addresses. | | -| `status` | [shared.SupplierStatus](../../../sdk/models/shared/supplierstatus.md) | :heavy_minus_sign: | Status of the supplier. | | -| `balance` | *Decimal* | :heavy_minus_sign: | Amount outstanding against the supplier. | | -| `defaultCurrency` | *string* | :heavy_minus_sign: | Default currency the supplier's transactional data is recorded in. | | -| `sourceModifiedDate` | *string* | :heavy_minus_sign: | N/A | 2022-10-23T00:00:00Z | \ No newline at end of file +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | +| `id` | *string* | :heavy_minus_sign: | Identifier for the supplier, unique to the company in the accounting software. | | +| `supplierName` | *string* | :heavy_minus_sign: | Name of the supplier as recorded in the accounting system, typically the company name. | | +| `contactName` | *string* | :heavy_minus_sign: | Name of the main contact for the supplier. | | +| `emailAddress` | *string* | :heavy_minus_sign: | Email address that the supplier may be contacted on. | | +| `phone` | *string* | :heavy_minus_sign: | Phone number that the supplier may be contacted on. | **Example 1:** +44 25691 154789
**Example 2:** (877) 492-8687
**Example 3:** 01224 658 999 | +| `addresses` | [shared.Address](../../../sdk/models/shared/address.md)[] | :heavy_minus_sign: | An array of Addresses. | | +| `status` | [shared.SupplierStatus](../../../sdk/models/shared/supplierstatus.md) | :heavy_minus_sign: | Status of the supplier. | | +| `balance` | *Decimal* | :heavy_minus_sign: | Amount outstanding against the supplier. | | +| `defaultCurrency` | *string* | :heavy_minus_sign: | Default currency the supplier's transactional data is recorded in. | | +| `sourceModifiedDate` | *string* | :heavy_minus_sign: | N/A | **Example 1:** 2022-10-23T00:00:00Z
**Example 2:** 2022-10-23 | \ No newline at end of file diff --git a/sync-for-payables/docs/sdk/models/shared/supplierprototype.md b/sync-for-payables/docs/sdk/models/shared/supplierprototype.md index d352c080a..2e69e091e 100644 --- a/sync-for-payables/docs/sdk/models/shared/supplierprototype.md +++ b/sync-for-payables/docs/sdk/models/shared/supplierprototype.md @@ -14,13 +14,13 @@ let value: SupplierPrototype = { ## Fields -| Field | Type | Required | Description | Example | -| -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -| `supplierName` | *string* | :heavy_check_mark: | Name of the supplier as recorded in the accounting system, typically the company name. | | -| `contactName` | *string* | :heavy_minus_sign: | Name of the main contact for the supplier. | | -| `emailAddress` | *string* | :heavy_minus_sign: | Email address that the supplier may be contacted on. | | -| `phone` | *string* | :heavy_minus_sign: | Phone number that the supplier may be contacted on. | +44 25691 154789 | -| `addresses` | [shared.Address](../../../sdk/models/shared/address.md)[] | :heavy_minus_sign: | An array of Addresses. | | -| `status` | [shared.SupplierStatus](../../../sdk/models/shared/supplierstatus.md) | :heavy_check_mark: | Status of the supplier. | | -| `balance` | *Decimal* | :heavy_minus_sign: | Amount outstanding against the supplier. | | -| `defaultCurrency` | *string* | :heavy_minus_sign: | Default currency the supplier's transactional data is recorded in. | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | +| `supplierName` | *string* | :heavy_check_mark: | Name of the supplier as recorded in the accounting system, typically the company name. | | +| `contactName` | *string* | :heavy_minus_sign: | Name of the main contact for the supplier. | | +| `emailAddress` | *string* | :heavy_minus_sign: | Email address that the supplier may be contacted on. | | +| `phone` | *string* | :heavy_minus_sign: | Phone number that the supplier may be contacted on. | **Example 1:** +44 25691 154789
**Example 2:** (877) 492-8687
**Example 3:** 01224 658 999 | +| `addresses` | [shared.Address](../../../sdk/models/shared/address.md)[] | :heavy_minus_sign: | An array of Addresses. | | +| `status` | [shared.SupplierStatus](../../../sdk/models/shared/supplierstatus.md) | :heavy_check_mark: | Status of the supplier. | | +| `balance` | *Decimal* | :heavy_minus_sign: | Amount outstanding against the supplier. | | +| `defaultCurrency` | *string* | :heavy_minus_sign: | Default currency the supplier's transactional data is recorded in. | | \ No newline at end of file diff --git a/sync-for-payables/docs/sdks/bankaccounts/README.md b/sync-for-payables/docs/sdks/bankaccounts/README.md index 3fc4582ed..db9df7c37 100644 --- a/sync-for-payables/docs/sdks/bankaccounts/README.md +++ b/sync-for-payables/docs/sdks/bankaccounts/README.md @@ -14,9 +14,9 @@ The *Create bank account* endpoint creates a new [bank account](https://docs.cod [Bank accounts](https://docs.codat.io/sync-for-payables-api#/schemas/BankAccount) are financial accounts maintained by a bank or other financial institution. -### Example Usage +### Example Usage: Bank account example - + ```typescript import { CodatSyncPayables } from "@codat/sync-for-payables"; @@ -79,6 +79,69 @@ async function run() { } } +run(); +``` +### Example Usage: Malformed query + + +```typescript +import { CodatSyncPayables } from "@codat/sync-for-payables"; + +const codatSyncPayables = new CodatSyncPayables({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatSyncPayables.bankAccounts.create({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + bankAccountPrototype: { + name: "", + accountType: "Debit", + accountNumber: "", + currency: "GBP", + }, + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatSyncPayablesCore } from "@codat/sync-for-payables/core.js"; +import { bankAccountsCreate } from "@codat/sync-for-payables/funcs/bankAccountsCreate.js"; + +// Use `CodatSyncPayablesCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatSyncPayables = new CodatSyncPayablesCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await bankAccountsCreate(codatSyncPayables, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + bankAccountPrototype: { + name: "", + accountType: "Debit", + accountNumber: "", + currency: "GBP", + }, + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("bankAccountsCreate failed:", res.error); + } +} + run(); ``` diff --git a/sync-for-payables/docs/sdks/billpayments/README.md b/sync-for-payables/docs/sdks/billpayments/README.md index cfba7b6af..c0ce8a6c8 100644 --- a/sync-for-payables/docs/sdks/billpayments/README.md +++ b/sync-for-payables/docs/sdks/billpayments/README.md @@ -19,7 +19,7 @@ Mapping options are a set of bank accounts used to configure the SMB's payables ### Example Usage - + ```typescript import { CodatSyncPayables } from "@codat/sync-for-payables"; @@ -100,9 +100,80 @@ The *Create bill payment* endpoint creates a new [bill payment](https://docs.cod [Bill payments](https://docs.codat.io/sync-for-payables-api#/schemas/BillPayment) are an allocation of money within any Accounts Payable account. -### Example Usage +### Example Usage: Bill payment + + +```typescript +import { CodatSyncPayables } from "@codat/sync-for-payables"; +import { Decimal } from "@codat/sync-for-payables/sdk/types"; + +const codatSyncPayables = new CodatSyncPayables({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatSyncPayables.billPayments.create({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + billId: "13d946f0-c5d5-42bc-b092-97ece17923ab", + billPaymentPrototype: { + amount: new Decimal("1329.54"), + date: "2022-10-23T00:00:00Z", + reference: "Bill Payment against bill c13e37b6-dfaa-4894-b3be-9fe97bda9f44", + accountRef: { + id: "", + }, + }, + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatSyncPayablesCore } from "@codat/sync-for-payables/core.js"; +import { billPaymentsCreate } from "@codat/sync-for-payables/funcs/billPaymentsCreate.js"; +import { Decimal } from "@codat/sync-for-payables/sdk/types"; + +// Use `CodatSyncPayablesCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatSyncPayables = new CodatSyncPayablesCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await billPaymentsCreate(codatSyncPayables, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + billId: "13d946f0-c5d5-42bc-b092-97ece17923ab", + billPaymentPrototype: { + amount: new Decimal("1329.54"), + date: "2022-10-23T00:00:00Z", + reference: "Bill Payment against bill c13e37b6-dfaa-4894-b3be-9fe97bda9f44", + accountRef: { + id: "", + }, + }, + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("billPaymentsCreate failed:", res.error); + } +} + +run(); +``` +### Example Usage: Bill payment example - + ```typescript import { CodatSyncPayables } from "@codat/sync-for-payables"; import { Decimal } from "@codat/sync-for-payables/sdk/types"; @@ -171,6 +242,77 @@ async function run() { } } +run(); +``` +### Example Usage: Malformed query + + +```typescript +import { CodatSyncPayables } from "@codat/sync-for-payables"; +import { Decimal } from "@codat/sync-for-payables/sdk/types"; + +const codatSyncPayables = new CodatSyncPayables({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatSyncPayables.billPayments.create({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + billId: "13d946f0-c5d5-42bc-b092-97ece17923ab", + billPaymentPrototype: { + amount: new Decimal("1329.54"), + date: "2022-10-23T00:00:00Z", + reference: "Bill Payment against bill c13e37b6-dfaa-4894-b3be-9fe97bda9f44", + accountRef: { + id: "", + }, + }, + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatSyncPayablesCore } from "@codat/sync-for-payables/core.js"; +import { billPaymentsCreate } from "@codat/sync-for-payables/funcs/billPaymentsCreate.js"; +import { Decimal } from "@codat/sync-for-payables/sdk/types"; + +// Use `CodatSyncPayablesCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatSyncPayables = new CodatSyncPayablesCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await billPaymentsCreate(codatSyncPayables, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + billId: "13d946f0-c5d5-42bc-b092-97ece17923ab", + billPaymentPrototype: { + amount: new Decimal("1329.54"), + date: "2022-10-23T00:00:00Z", + reference: "Bill Payment against bill c13e37b6-dfaa-4894-b3be-9fe97bda9f44", + accountRef: { + id: "", + }, + }, + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("billPaymentsCreate failed:", res.error); + } +} + run(); ``` diff --git a/sync-for-payables/docs/sdks/bills/README.md b/sync-for-payables/docs/sdks/bills/README.md index 937d36fd0..545aa7c43 100644 --- a/sync-for-payables/docs/sdks/bills/README.md +++ b/sync-for-payables/docs/sdks/bills/README.md @@ -9,6 +9,7 @@ Get, create, and update Bills. * [getBillOptions](#getbilloptions) - Get bill mapping options * [list](#list) - List bills * [create](#create) - Create bill +* [update](#update) - Update bill * [uploadAttachment](#uploadattachment) - Upload bill attachment * [listAttachments](#listattachments) - List bill attachments * [downloadAttachment](#downloadattachment) - Download bill attachment @@ -23,7 +24,7 @@ Mapping options are a set of accounts and tax rates used to configure the SMB's ### Example Usage - + ```typescript import { CodatSyncPayables } from "@codat/sync-for-payables"; @@ -106,9 +107,607 @@ The *List bills* endpoint returns a list of [bills](https://docs.codat.io/sync-f By default, the endpoint will return all bills with a status of 'Open' & 'PartiallyPaid' to show all oustanding bills. -### Example Usage +### Example Usage: Bills + + +```typescript +import { CodatSyncPayables } from "@codat/sync-for-payables"; + +const codatSyncPayables = new CodatSyncPayables({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatSyncPayables.bills.list({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + continuationToken: "continuationToken=eyJwYWdlIjoyLCJwYWdlU2l6ZSI6MTAwLCJwYWdlQ291bnQiOjExfQ==", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatSyncPayablesCore } from "@codat/sync-for-payables/core.js"; +import { billsList } from "@codat/sync-for-payables/funcs/billsList.js"; + +// Use `CodatSyncPayablesCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatSyncPayables = new CodatSyncPayablesCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await billsList(codatSyncPayables, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + continuationToken: "continuationToken=eyJwYWdlIjoyLCJwYWdlU2l6ZSI6MTAwLCJwYWdlQ291bnQiOjExfQ==", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("billsList failed:", res.error); + } +} + +run(); +``` +### Example Usage: Source modified date + + +```typescript +import { CodatSyncPayables } from "@codat/sync-for-payables"; + +const codatSyncPayables = new CodatSyncPayables({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatSyncPayables.bills.list({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + continuationToken: "continuationToken=eyJwYWdlIjoyLCJwYWdlU2l6ZSI6MTAwLCJwYWdlQ291bnQiOjExfQ==", + query: "sourceModifiedDate>2023-12-15T00:00:00.000Z", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatSyncPayablesCore } from "@codat/sync-for-payables/core.js"; +import { billsList } from "@codat/sync-for-payables/funcs/billsList.js"; + +// Use `CodatSyncPayablesCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatSyncPayables = new CodatSyncPayablesCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await billsList(codatSyncPayables, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + continuationToken: "continuationToken=eyJwYWdlIjoyLCJwYWdlU2l6ZSI6MTAwLCJwYWdlQ291bnQiOjExfQ==", + query: "sourceModifiedDate>2023-12-15T00:00:00.000Z", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("billsList failed:", res.error); + } +} + +run(); +``` +### Example Usage: Status (open) + + +```typescript +import { CodatSyncPayables } from "@codat/sync-for-payables"; + +const codatSyncPayables = new CodatSyncPayables({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatSyncPayables.bills.list({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + continuationToken: "continuationToken=eyJwYWdlIjoyLCJwYWdlU2l6ZSI6MTAwLCJwYWdlQ291bnQiOjExfQ==", + query: "status=Open", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatSyncPayablesCore } from "@codat/sync-for-payables/core.js"; +import { billsList } from "@codat/sync-for-payables/funcs/billsList.js"; + +// Use `CodatSyncPayablesCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatSyncPayables = new CodatSyncPayablesCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await billsList(codatSyncPayables, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + continuationToken: "continuationToken=eyJwYWdlIjoyLCJwYWdlU2l6ZSI6MTAwLCJwYWdlQ291bnQiOjExfQ==", + query: "status=Open", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("billsList failed:", res.error); + } +} + +run(); +``` +### Example Usage: Status (open) & source modified date + + +```typescript +import { CodatSyncPayables } from "@codat/sync-for-payables"; + +const codatSyncPayables = new CodatSyncPayables({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatSyncPayables.bills.list({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + continuationToken: "continuationToken=eyJwYWdlIjoyLCJwYWdlU2l6ZSI6MTAwLCJwYWdlQ291bnQiOjExfQ==", + query: "sourceModifiedDate>2023-12-15T00:00:00.000Z&&status=Open", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatSyncPayablesCore } from "@codat/sync-for-payables/core.js"; +import { billsList } from "@codat/sync-for-payables/funcs/billsList.js"; + +// Use `CodatSyncPayablesCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatSyncPayables = new CodatSyncPayablesCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await billsList(codatSyncPayables, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + continuationToken: "continuationToken=eyJwYWdlIjoyLCJwYWdlU2l6ZSI6MTAwLCJwYWdlQ291bnQiOjExfQ==", + query: "sourceModifiedDate>2023-12-15T00:00:00.000Z&&status=Open", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("billsList failed:", res.error); + } +} + +run(); +``` +### Example Usage: Status (partially paid) + + +```typescript +import { CodatSyncPayables } from "@codat/sync-for-payables"; + +const codatSyncPayables = new CodatSyncPayables({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatSyncPayables.bills.list({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + continuationToken: "continuationToken=eyJwYWdlIjoyLCJwYWdlU2l6ZSI6MTAwLCJwYWdlQ291bnQiOjExfQ==", + query: "status=PartiallyPaid", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatSyncPayablesCore } from "@codat/sync-for-payables/core.js"; +import { billsList } from "@codat/sync-for-payables/funcs/billsList.js"; + +// Use `CodatSyncPayablesCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatSyncPayables = new CodatSyncPayablesCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await billsList(codatSyncPayables, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + continuationToken: "continuationToken=eyJwYWdlIjoyLCJwYWdlU2l6ZSI6MTAwLCJwYWdlQ291bnQiOjExfQ==", + query: "status=PartiallyPaid", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("billsList failed:", res.error); + } +} + +run(); +``` +### Example Usage: Status (partially paid) & source modified date + + +```typescript +import { CodatSyncPayables } from "@codat/sync-for-payables"; + +const codatSyncPayables = new CodatSyncPayables({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatSyncPayables.bills.list({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + continuationToken: "continuationToken=eyJwYWdlIjoyLCJwYWdlU2l6ZSI6MTAwLCJwYWdlQ291bnQiOjExfQ==", + query: "sourceModifiedDate>2023-12-15T00:00:00.000Z&&status=PartiallyPaid", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatSyncPayablesCore } from "@codat/sync-for-payables/core.js"; +import { billsList } from "@codat/sync-for-payables/funcs/billsList.js"; + +// Use `CodatSyncPayablesCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatSyncPayables = new CodatSyncPayablesCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await billsList(codatSyncPayables, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + continuationToken: "continuationToken=eyJwYWdlIjoyLCJwYWdlU2l6ZSI6MTAwLCJwYWdlQ291bnQiOjExfQ==", + query: "sourceModifiedDate>2023-12-15T00:00:00.000Z&&status=PartiallyPaid", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("billsList failed:", res.error); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.ListBillsRequest](../../sdk/models/operations/listbillsrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[shared.Bills](../../sdk/models/shared/bills.md)\>** + +### Errors + +| Error Type | Status Code | Content Type | +| --------------------------------- | --------------------------------- | --------------------------------- | +| errors.ErrorMessage | 400, 401, 402, 403, 404, 409, 429 | application/json | +| errors.ErrorMessage | 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## create + +The *Create bill* endpoint creates a new [bill](https://docs.codat.io/sync-for-payables-api#/schemas/Bill) for a given company's connection. + +[Bills](https://docs.codat.io/sync-for-payables-api#/schemas/Bill) are invoices that represent the SMB's financial obligations to their supplier for a purchase of goods or services. + +### Example Usage: Create bill + + +```typescript +import { CodatSyncPayables } from "@codat/sync-for-payables"; +import { Decimal } from "@codat/sync-for-payables/sdk/types"; + +const codatSyncPayables = new CodatSyncPayables({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatSyncPayables.bills.create({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + billPrototype: { + reference: "bill_b8qmmj4ksf1suax", + supplierRef: { + id: "1262c350-fe0f-40ec-aeff-41c95b4a45af", + supplierName: "DIISR - Small Business Services", + }, + issueDate: "2023-04-23T00:00:00", + dueDate: "2023-04-23T00:00:00", + currency: "GBP", + currencyRate: new Decimal("1"), + lineItems: [ + { + description: "Half day training - Microsoft Office", + unitAmount: new Decimal("1800"), + quantity: new Decimal("1"), + taxAmount: new Decimal("360"), + accountRef: { + id: "46f9461e-788b-4906-8b74-d1ea17f6dc10", + }, + totalAmount: new Decimal("2160"), + taxRateRef: { + id: "INPUT2", + }, + }, + { + description: "Desktop/network support via email & phone.Per month fixed fee for minimum 20 hours/month.", + unitAmount: new Decimal("4000"), + quantity: new Decimal("1"), + taxAmount: new Decimal("800"), + accountRef: { + id: "f96c9458-d724-47bf-8f74-a9d5726465ce", + }, + totalAmount: new Decimal("4800"), + taxRateRef: { + id: "INPUT2", + }, + }, + { + description: "Stationery charges", + unitAmount: new Decimal("32"), + quantity: new Decimal("8"), + taxAmount: new Decimal("51.2"), + accountRef: { + id: "cba6527d-f102-4538-b421-e483233e9d5a", + }, + totalAmount: new Decimal("307.2"), + taxRateRef: { + id: "INPUT2", + }, + trackingRefs: [ + { + id: "dba3d4da-f9ed-4eee-8e0b-452d11fdb1fa", + dataType: "trackingCategories", + }, + ], + }, + ], + status: "Open", + }, + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatSyncPayablesCore } from "@codat/sync-for-payables/core.js"; +import { billsCreate } from "@codat/sync-for-payables/funcs/billsCreate.js"; +import { Decimal } from "@codat/sync-for-payables/sdk/types"; + +// Use `CodatSyncPayablesCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatSyncPayables = new CodatSyncPayablesCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await billsCreate(codatSyncPayables, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + billPrototype: { + reference: "bill_b8qmmj4ksf1suax", + supplierRef: { + id: "1262c350-fe0f-40ec-aeff-41c95b4a45af", + supplierName: "DIISR - Small Business Services", + }, + issueDate: "2023-04-23T00:00:00", + dueDate: "2023-04-23T00:00:00", + currency: "GBP", + currencyRate: new Decimal("1"), + lineItems: [ + { + description: "Half day training - Microsoft Office", + unitAmount: new Decimal("1800"), + quantity: new Decimal("1"), + taxAmount: new Decimal("360"), + accountRef: { + id: "46f9461e-788b-4906-8b74-d1ea17f6dc10", + }, + totalAmount: new Decimal("2160"), + taxRateRef: { + id: "INPUT2", + }, + }, + { + description: "Desktop/network support via email & phone.Per month fixed fee for minimum 20 hours/month.", + unitAmount: new Decimal("4000"), + quantity: new Decimal("1"), + taxAmount: new Decimal("800"), + accountRef: { + id: "f96c9458-d724-47bf-8f74-a9d5726465ce", + }, + totalAmount: new Decimal("4800"), + taxRateRef: { + id: "INPUT2", + }, + }, + { + description: "Stationery charges", + unitAmount: new Decimal("32"), + quantity: new Decimal("8"), + taxAmount: new Decimal("51.2"), + accountRef: { + id: "cba6527d-f102-4538-b421-e483233e9d5a", + }, + totalAmount: new Decimal("307.2"), + taxRateRef: { + id: "INPUT2", + }, + trackingRefs: [ + { + id: "dba3d4da-f9ed-4eee-8e0b-452d11fdb1fa", + dataType: "trackingCategories", + }, + ], + }, + ], + status: "Open", + }, + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("billsCreate failed:", res.error); + } +} + +run(); +``` +### Example Usage: Created bill + + +```typescript +import { CodatSyncPayables } from "@codat/sync-for-payables"; + +const codatSyncPayables = new CodatSyncPayables({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatSyncPayables.bills.create({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + billPrototype: { + supplierRef: { + id: "", + }, + issueDate: "2022-10-23T00:00:00Z", + dueDate: "2022-10-23T00:00:00Z", + currency: "GBP", + lineItems: null, + status: "Open", + }, + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatSyncPayablesCore } from "@codat/sync-for-payables/core.js"; +import { billsCreate } from "@codat/sync-for-payables/funcs/billsCreate.js"; + +// Use `CodatSyncPayablesCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatSyncPayables = new CodatSyncPayablesCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await billsCreate(codatSyncPayables, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + billPrototype: { + supplierRef: { + id: "", + }, + issueDate: "2022-10-23T00:00:00Z", + dueDate: "2022-10-23T00:00:00Z", + currency: "GBP", + lineItems: null, + status: "Open", + }, + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("billsCreate failed:", res.error); + } +} - +run(); +``` +### Example Usage: Malformed query + + ```typescript import { CodatSyncPayables } from "@codat/sync-for-payables"; @@ -117,11 +716,19 @@ const codatSyncPayables = new CodatSyncPayables({ }); async function run() { - const result = await codatSyncPayables.bills.list({ + const result = await codatSyncPayables.bills.create({ companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - continuationToken: "continuationToken=eyJwYWdlIjoyLCJwYWdlU2l6ZSI6MTAwLCJwYWdlQ291bnQiOjExfQ==", - query: "status=Open", + billPrototype: { + supplierRef: { + id: "", + }, + issueDate: "2022-10-23T00:00:00Z", + dueDate: "2022-10-23T00:00:00Z", + currency: "GBP", + lineItems: null, + status: "Open", + }, }); console.log(result); @@ -136,7 +743,7 @@ The standalone function version of this method: ```typescript import { CodatSyncPayablesCore } from "@codat/sync-for-payables/core.js"; -import { billsList } from "@codat/sync-for-payables/funcs/billsList.js"; +import { billsCreate } from "@codat/sync-for-payables/funcs/billsCreate.js"; // Use `CodatSyncPayablesCore` for best tree-shaking performance. // You can create one instance of it to use across an application. @@ -145,17 +752,25 @@ const codatSyncPayables = new CodatSyncPayablesCore({ }); async function run() { - const res = await billsList(codatSyncPayables, { + const res = await billsCreate(codatSyncPayables, { companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - continuationToken: "continuationToken=eyJwYWdlIjoyLCJwYWdlU2l6ZSI6MTAwLCJwYWdlQ291bnQiOjExfQ==", - query: "status=Open", + billPrototype: { + supplierRef: { + id: "", + }, + issueDate: "2022-10-23T00:00:00Z", + dueDate: "2022-10-23T00:00:00Z", + currency: "GBP", + lineItems: null, + status: "Open", + }, }); if (res.ok) { const { value: result } = res; console.log(result); } else { - console.log("billsList failed:", res.error); + console.log("billsCreate failed:", res.error); } } @@ -166,14 +781,14 @@ run(); | Parameter | Type | Required | Description | | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `request` | [operations.ListBillsRequest](../../sdk/models/operations/listbillsrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `request` | [operations.CreateBillRequest](../../sdk/models/operations/createbillrequest.md) | :heavy_check_mark: | The request object to use for the request. | | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | ### Response -**Promise\<[shared.Bills](../../sdk/models/shared/bills.md)\>** +**Promise\<[shared.Bill](../../sdk/models/shared/bill.md)\>** ### Errors @@ -183,15 +798,118 @@ run(); | errors.ErrorMessage | 500, 503 | application/json | | errors.SDKError | 4XX, 5XX | \*/\* | -## create +## update -The *Create bill* endpoint creates a new [bill](https://docs.codat.io/sync-for-payables-api#/schemas/Bill) for a given company's connection. +The *Update bill* endpoint updates an existing [bill](https://docs.codat.io/sync-for-payables-api#/schemas/Bill) for a given company's connection. [Bills](https://docs.codat.io/sync-for-payables-api#/schemas/Bill) are invoices that represent the SMB's financial obligations to their supplier for a purchase of goods or services. -### Example Usage +### Supported Integrations + +| Integration | Supported | +|-------------------------------|-----------| +| FreeAgent | Yes | +| QuickBooks Online | Yes | +| Xero | Yes | +| Oracle NetSuite | No | +| Sage Intacct | No | +| Zoho Books | No | + + +### Example Usage: Malformed query + + +```typescript +import { CodatSyncPayables } from "@codat/sync-for-payables"; + +const codatSyncPayables = new CodatSyncPayables({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatSyncPayables.bills.update({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + billId: "13d946f0-c5d5-42bc-b092-97ece17923ab", + billPrototype: { + supplierRef: { + id: "", + }, + issueDate: "2022-10-23T00:00:00Z", + dueDate: "2022-10-23T00:00:00Z", + currency: "GBP", + lineItems: [ + { + trackingRefs: [ + { + id: "e9a1b63d-9ff0-40e7-8038-016354b987e6", + dataType: "trackingCategories", + }, + ], + }, + ], + status: "Open", + }, + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatSyncPayablesCore } from "@codat/sync-for-payables/core.js"; +import { billsUpdate } from "@codat/sync-for-payables/funcs/billsUpdate.js"; + +// Use `CodatSyncPayablesCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatSyncPayables = new CodatSyncPayablesCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); - +async function run() { + const res = await billsUpdate(codatSyncPayables, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + billId: "13d946f0-c5d5-42bc-b092-97ece17923ab", + billPrototype: { + supplierRef: { + id: "", + }, + issueDate: "2022-10-23T00:00:00Z", + dueDate: "2022-10-23T00:00:00Z", + currency: "GBP", + lineItems: [ + { + trackingRefs: [ + { + id: "e9a1b63d-9ff0-40e7-8038-016354b987e6", + dataType: "trackingCategories", + }, + ], + }, + ], + status: "Open", + }, + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("billsUpdate failed:", res.error); + } +} + +run(); +``` +### Example Usage: Update bill + + ```typescript import { CodatSyncPayables } from "@codat/sync-for-payables"; import { Decimal } from "@codat/sync-for-payables/sdk/types"; @@ -201,55 +919,42 @@ const codatSyncPayables = new CodatSyncPayables({ }); async function run() { - const result = await codatSyncPayables.bills.create({ + const result = await codatSyncPayables.bills.update({ companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + billId: "13d946f0-c5d5-42bc-b092-97ece17923ab", billPrototype: { - reference: "bill_b8qmmj4ksf1suax", + reference: "bill_updated_ref", supplierRef: { id: "1262c350-fe0f-40ec-aeff-41c95b4a45af", - supplierName: "DIISR - Small Business Services", }, issueDate: "2023-04-23T00:00:00", - dueDate: "2023-04-23T00:00:00", + dueDate: "2023-05-23T00:00:00", currency: "GBP", currencyRate: new Decimal("1"), lineItems: [ { - description: "Half day training - Microsoft Office", - unitAmount: new Decimal("1800"), + description: "Updated line item - Microsoft Office training", + unitAmount: new Decimal("2000"), quantity: new Decimal("1"), - taxAmount: new Decimal("360"), + taxAmount: new Decimal("400"), accountRef: { id: "46f9461e-788b-4906-8b74-d1ea17f6dc10", }, - totalAmount: new Decimal("2160"), + totalAmount: new Decimal("2400"), taxRateRef: { id: "INPUT2", }, }, { - description: "Desktop/network support via email & phone.Per month fixed fee for minimum 20 hours/month.", - unitAmount: new Decimal("4000"), + description: "Desktop/network support via email & phone - updated rate", + unitAmount: new Decimal("4500"), quantity: new Decimal("1"), - taxAmount: new Decimal("800"), + taxAmount: new Decimal("900"), accountRef: { id: "f96c9458-d724-47bf-8f74-a9d5726465ce", }, - totalAmount: new Decimal("4800"), - taxRateRef: { - id: "INPUT2", - }, - }, - { - description: "Stationery charges", - unitAmount: new Decimal("32"), - quantity: new Decimal("8"), - taxAmount: new Decimal("51.2"), - accountRef: { - id: "cba6527d-f102-4538-b421-e483233e9d5a", - }, - totalAmount: new Decimal("307.2"), + totalAmount: new Decimal("5400"), taxRateRef: { id: "INPUT2", }, @@ -277,7 +982,7 @@ The standalone function version of this method: ```typescript import { CodatSyncPayablesCore } from "@codat/sync-for-payables/core.js"; -import { billsCreate } from "@codat/sync-for-payables/funcs/billsCreate.js"; +import { billsUpdate } from "@codat/sync-for-payables/funcs/billsUpdate.js"; import { Decimal } from "@codat/sync-for-payables/sdk/types"; // Use `CodatSyncPayablesCore` for best tree-shaking performance. @@ -287,61 +992,139 @@ const codatSyncPayables = new CodatSyncPayablesCore({ }); async function run() { - const res = await billsCreate(codatSyncPayables, { + const res = await billsUpdate(codatSyncPayables, { companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + billId: "13d946f0-c5d5-42bc-b092-97ece17923ab", billPrototype: { - reference: "bill_b8qmmj4ksf1suax", + reference: "bill_updated_ref", supplierRef: { id: "1262c350-fe0f-40ec-aeff-41c95b4a45af", - supplierName: "DIISR - Small Business Services", }, issueDate: "2023-04-23T00:00:00", - dueDate: "2023-04-23T00:00:00", + dueDate: "2023-05-23T00:00:00", currency: "GBP", currencyRate: new Decimal("1"), lineItems: [ { - description: "Half day training - Microsoft Office", - unitAmount: new Decimal("1800"), + description: "Updated line item - Microsoft Office training", + unitAmount: new Decimal("2000"), quantity: new Decimal("1"), - taxAmount: new Decimal("360"), + taxAmount: new Decimal("400"), accountRef: { id: "46f9461e-788b-4906-8b74-d1ea17f6dc10", }, - totalAmount: new Decimal("2160"), + totalAmount: new Decimal("2400"), taxRateRef: { id: "INPUT2", }, }, { - description: "Desktop/network support via email & phone.Per month fixed fee for minimum 20 hours/month.", - unitAmount: new Decimal("4000"), + description: "Desktop/network support via email & phone - updated rate", + unitAmount: new Decimal("4500"), quantity: new Decimal("1"), - taxAmount: new Decimal("800"), + taxAmount: new Decimal("900"), accountRef: { id: "f96c9458-d724-47bf-8f74-a9d5726465ce", }, - totalAmount: new Decimal("4800"), + totalAmount: new Decimal("5400"), taxRateRef: { id: "INPUT2", }, + trackingRefs: [ + { + id: "dba3d4da-f9ed-4eee-8e0b-452d11fdb1fa", + dataType: "trackingCategories", + }, + ], + }, + ], + status: "Open", + }, + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("billsUpdate failed:", res.error); + } +} + +run(); +``` +### Example Usage: Updated bill + + +```typescript +import { CodatSyncPayables } from "@codat/sync-for-payables"; + +const codatSyncPayables = new CodatSyncPayables({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatSyncPayables.bills.update({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + billId: "13d946f0-c5d5-42bc-b092-97ece17923ab", + billPrototype: { + supplierRef: { + id: "", + }, + issueDate: "2022-10-23T00:00:00Z", + dueDate: "2022-10-23T00:00:00Z", + currency: "GBP", + lineItems: [ + { + trackingRefs: [ + { + id: "e9a1b63d-9ff0-40e7-8038-016354b987e6", + dataType: "trackingCategories", + }, + ], }, + ], + status: "Open", + }, + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatSyncPayablesCore } from "@codat/sync-for-payables/core.js"; +import { billsUpdate } from "@codat/sync-for-payables/funcs/billsUpdate.js"; + +// Use `CodatSyncPayablesCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatSyncPayables = new CodatSyncPayablesCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await billsUpdate(codatSyncPayables, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + billId: "13d946f0-c5d5-42bc-b092-97ece17923ab", + billPrototype: { + supplierRef: { + id: "", + }, + issueDate: "2022-10-23T00:00:00Z", + dueDate: "2022-10-23T00:00:00Z", + currency: "GBP", + lineItems: [ { - description: "Stationery charges", - unitAmount: new Decimal("32"), - quantity: new Decimal("8"), - taxAmount: new Decimal("51.2"), - accountRef: { - id: "cba6527d-f102-4538-b421-e483233e9d5a", - }, - totalAmount: new Decimal("307.2"), - taxRateRef: { - id: "INPUT2", - }, trackingRefs: [ { - id: "dba3d4da-f9ed-4eee-8e0b-452d11fdb1fa", + id: "e9a1b63d-9ff0-40e7-8038-016354b987e6", dataType: "trackingCategories", }, ], @@ -354,7 +1137,7 @@ async function run() { const { value: result } = res; console.log(result); } else { - console.log("billsCreate failed:", res.error); + console.log("billsUpdate failed:", res.error); } } @@ -365,7 +1148,7 @@ run(); | Parameter | Type | Required | Description | | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `request` | [operations.CreateBillRequest](../../sdk/models/operations/createbillrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `request` | [operations.UpdateBillRequest](../../sdk/models/operations/updatebillrequest.md) | :heavy_check_mark: | The request object to use for the request. | | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | @@ -390,7 +1173,7 @@ The *Upload bill attachment* endpoint uploads an attachment and assigns it again ### Example Usage - + ```typescript import { CodatSyncPayables } from "@codat/sync-for-payables"; @@ -471,7 +1254,7 @@ The *List bill attachments* endpoint returns a list of attachments available to ### Example Usage - + ```typescript import { CodatSyncPayables } from "@codat/sync-for-payables"; @@ -620,7 +1403,7 @@ run(); ### Response -**Promise\<[ReadableStream](../../models/.md)\>** +**Promise\<[ReadableStream](../../models/data.md)\>** ### Errors diff --git a/sync-for-payables/docs/sdks/companies/README.md b/sync-for-payables/docs/sdks/companies/README.md index 33217f2fb..86f656c14 100644 --- a/sync-for-payables/docs/sdks/companies/README.md +++ b/sync-for-payables/docs/sdks/companies/README.md @@ -33,9 +33,62 @@ For example, you can use the querying to filter companies tagged with a specific - Region: `region != uk` - Owning team and region: `region = uk && owningTeam = invoice-finance` -### Example Usage +### Example Usage: List of Companies + + +```typescript +import { CodatSyncPayables } from "@codat/sync-for-payables"; + +const codatSyncPayables = new CodatSyncPayables({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatSyncPayables.companies.list({ + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", + orderBy: "-modifiedDate", + tags: "region=uk && team=invoice-finance", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatSyncPayablesCore } from "@codat/sync-for-payables/core.js"; +import { companiesList } from "@codat/sync-for-payables/funcs/companiesList.js"; + +// Use `CodatSyncPayablesCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatSyncPayables = new CodatSyncPayablesCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); - +async function run() { + const res = await companiesList(codatSyncPayables, { + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", + orderBy: "-modifiedDate", + tags: "region=uk && team=invoice-finance", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("companiesList failed:", res.error); + } +} + +run(); +``` +### Example Usage: One company + + ```typescript import { CodatSyncPayables } from "@codat/sync-for-payables"; @@ -117,9 +170,162 @@ Each company can have multiple [connections](https://docs.codat.io/sync-for-paya If forbidden characters (see `name` pattern) are present in the request, a company will be created with the forbidden characters removed. For example, `Company (Codat[1])` with be created as `Company Codat1`. -### Example Usage +### Example Usage: Malformed query + + +```typescript +import { CodatSyncPayables } from "@codat/sync-for-payables"; + +const codatSyncPayables = new CodatSyncPayables({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatSyncPayables.companies.create({ + name: "Bank of Dave", + description: "Requested early access to the new financing scheme.", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatSyncPayablesCore } from "@codat/sync-for-payables/core.js"; +import { companiesCreate } from "@codat/sync-for-payables/funcs/companiesCreate.js"; + +// Use `CodatSyncPayablesCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatSyncPayables = new CodatSyncPayablesCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await companiesCreate(codatSyncPayables, { + name: "Bank of Dave", + description: "Requested early access to the new financing scheme.", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("companiesCreate failed:", res.error); + } +} + +run(); +``` +### Example Usage: With a description - + +```typescript +import { CodatSyncPayables } from "@codat/sync-for-payables"; + +const codatSyncPayables = new CodatSyncPayables({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatSyncPayables.companies.create({ + name: "Technicalium", + description: "Technology services, including web and app design and development", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatSyncPayablesCore } from "@codat/sync-for-payables/core.js"; +import { companiesCreate } from "@codat/sync-for-payables/funcs/companiesCreate.js"; + +// Use `CodatSyncPayablesCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatSyncPayables = new CodatSyncPayablesCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await companiesCreate(codatSyncPayables, { + name: "Technicalium", + description: "Technology services, including web and app design and development", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("companiesCreate failed:", res.error); + } +} + +run(); +``` +### Example Usage: With a tag + + +```typescript +import { CodatSyncPayables } from "@codat/sync-for-payables"; + +const codatSyncPayables = new CodatSyncPayables({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatSyncPayables.companies.create({ + name: "Bank of Dave", + description: "Requested early access to the new financing scheme.", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatSyncPayablesCore } from "@codat/sync-for-payables/core.js"; +import { companiesCreate } from "@codat/sync-for-payables/funcs/companiesCreate.js"; + +// Use `CodatSyncPayablesCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatSyncPayables = new CodatSyncPayablesCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await companiesCreate(codatSyncPayables, { + name: "Bank of Dave", + description: "Requested early access to the new financing scheme.", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("companiesCreate failed:", res.error); + } +} + +run(); +``` +### Example Usage: With no description + + ```typescript import { CodatSyncPayables } from "@codat/sync-for-payables"; @@ -195,9 +401,123 @@ run(); A [company](https://docs.codat.io/sync-for-payables-api#/schemas/Company) represents a business sharing access to their data. Each company can have multiple [connections](https://docs.codat.io/sync-for-payables-api#/schemas/Connection) to different data sources, such as one connection to Xero for accounting data, two connections to Plaid for two bank accounts, and a connection to Zettle for POS data. -### Example Usage +### Example Usage: Unauthorized - + +```typescript +import { CodatSyncPayables } from "@codat/sync-for-payables"; + +const codatSyncPayables = new CodatSyncPayables({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatSyncPayables.companies.replace({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + companyRequestBody: { + name: "Bank of Dave", + description: "Requested early access to the new financing scheme.", + }, + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatSyncPayablesCore } from "@codat/sync-for-payables/core.js"; +import { companiesReplace } from "@codat/sync-for-payables/funcs/companiesReplace.js"; + +// Use `CodatSyncPayablesCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatSyncPayables = new CodatSyncPayablesCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await companiesReplace(codatSyncPayables, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + companyRequestBody: { + name: "Bank of Dave", + description: "Requested early access to the new financing scheme.", + }, + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("companiesReplace failed:", res.error); + } +} + +run(); +``` +### Example Usage: Update description + + +```typescript +import { CodatSyncPayables } from "@codat/sync-for-payables"; + +const codatSyncPayables = new CodatSyncPayables({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatSyncPayables.companies.replace({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + companyRequestBody: { + name: "Same name", + description: "Additional documents required", + }, + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatSyncPayablesCore } from "@codat/sync-for-payables/core.js"; +import { companiesReplace } from "@codat/sync-for-payables/funcs/companiesReplace.js"; + +// Use `CodatSyncPayablesCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatSyncPayables = new CodatSyncPayablesCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await companiesReplace(codatSyncPayables, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + companyRequestBody: { + name: "Same name", + description: "Additional documents required", + }, + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("companiesReplace failed:", res.error); + } +} + +run(); +``` +### Example Usage: Update name + + ```typescript import { CodatSyncPayables } from "@codat/sync-for-payables"; @@ -280,9 +600,121 @@ The *Update company* endpoint doesn't have any required fields. If any of the fi A [company](https://docs.codat.io/sync-for-payables-api#/schemas/Company) represents a business sharing access to their data. -### Example Usage +### Example Usage: Unauthorized + + +```typescript +import { CodatSyncPayables } from "@codat/sync-for-payables"; + +const codatSyncPayables = new CodatSyncPayables({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatSyncPayables.companies.update({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + companyUpdateRequest: { + name: "Bank of Dave", + description: "Requested early access to the new financing scheme.", + }, + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatSyncPayablesCore } from "@codat/sync-for-payables/core.js"; +import { companiesUpdate } from "@codat/sync-for-payables/funcs/companiesUpdate.js"; + +// Use `CodatSyncPayablesCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatSyncPayables = new CodatSyncPayablesCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await companiesUpdate(codatSyncPayables, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + companyUpdateRequest: { + name: "Bank of Dave", + description: "Requested early access to the new financing scheme.", + }, + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("companiesUpdate failed:", res.error); + } +} + +run(); +``` +### Example Usage: Update name + + +```typescript +import { CodatSyncPayables } from "@codat/sync-for-payables"; + +const codatSyncPayables = new CodatSyncPayables({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatSyncPayables.companies.update({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + companyUpdateRequest: { + name: "New Name", + }, + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: - +```typescript +import { CodatSyncPayablesCore } from "@codat/sync-for-payables/core.js"; +import { companiesUpdate } from "@codat/sync-for-payables/funcs/companiesUpdate.js"; + +// Use `CodatSyncPayablesCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatSyncPayables = new CodatSyncPayablesCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await companiesUpdate(codatSyncPayables, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + companyUpdateRequest: { + name: "New Name", + }, + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("companiesUpdate failed:", res.error); + } +} + +run(); +``` +### Example Usage: Update tags + + ```typescript import { CodatSyncPayables } from "@codat/sync-for-payables"; @@ -448,9 +880,107 @@ A [company](https://docs.codat.io/sync-for-payables-api#/schemas/Company) repres Each company can have multiple [connections](https://docs.codat.io/sync-for-payables-api#/schemas/Connection) to different data sources, such as one connection to Xero for accounting data, two connections to Plaid for two bank accounts, and a connection to Zettle for POS data. -### Example Usage +### Example Usage: Parent multi-entity company + + +```typescript +import { CodatSyncPayables } from "@codat/sync-for-payables"; + +const codatSyncPayables = new CodatSyncPayables({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatSyncPayables.companies.get({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatSyncPayablesCore } from "@codat/sync-for-payables/core.js"; +import { companiesGet } from "@codat/sync-for-payables/funcs/companiesGet.js"; + +// Use `CodatSyncPayablesCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatSyncPayables = new CodatSyncPayablesCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await companiesGet(codatSyncPayables, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("companiesGet failed:", res.error); + } +} + +run(); +``` +### Example Usage: Simple company + + +```typescript +import { CodatSyncPayables } from "@codat/sync-for-payables"; + +const codatSyncPayables = new CodatSyncPayables({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatSyncPayables.companies.get({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatSyncPayablesCore } from "@codat/sync-for-payables/core.js"; +import { companiesGet } from "@codat/sync-for-payables/funcs/companiesGet.js"; + +// Use `CodatSyncPayablesCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatSyncPayables = new CodatSyncPayablesCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await companiesGet(codatSyncPayables, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("companiesGet failed:", res.error); + } +} + +run(); +``` +### Example Usage: Subsidiary multi-entity company - + ```typescript import { CodatSyncPayables } from "@codat/sync-for-payables"; diff --git a/sync-for-payables/docs/sdks/companyinformation/README.md b/sync-for-payables/docs/sdks/companyinformation/README.md index bf1bdf7f3..69ba5168f 100644 --- a/sync-for-payables/docs/sdks/companyinformation/README.md +++ b/sync-for-payables/docs/sdks/companyinformation/README.md @@ -16,7 +16,7 @@ Use the *Get company information* endpoint to return information about the compa ### Example Usage - + ```typescript import { CodatSyncPayables } from "@codat/sync-for-payables"; diff --git a/sync-for-payables/docs/sdks/connections/README.md b/sync-for-payables/docs/sdks/connections/README.md index 4f09f80c0..452a258b5 100644 --- a/sync-for-payables/docs/sdks/connections/README.md +++ b/sync-for-payables/docs/sdks/connections/README.md @@ -18,7 +18,7 @@ Create new and manage existing data connections for a company. ### Example Usage - + ```typescript import { CodatSyncPayables } from "@codat/sync-for-payables"; @@ -97,9 +97,64 @@ run(); Use the [List Integrations](https://docs.codat.io/platform-api#/operations/list-integrations) endpoint to access valid platform keys. -### Example Usage +### Example Usage: Connection + + +```typescript +import { CodatSyncPayables } from "@codat/sync-for-payables"; + +const codatSyncPayables = new CodatSyncPayables({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatSyncPayables.connections.create({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + requestBody: { + platformKey: "gbol", + }, + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatSyncPayablesCore } from "@codat/sync-for-payables/core.js"; +import { connectionsCreate } from "@codat/sync-for-payables/funcs/connectionsCreate.js"; + +// Use `CodatSyncPayablesCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatSyncPayables = new CodatSyncPayablesCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await connectionsCreate(codatSyncPayables, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + requestBody: { + platformKey: "gbol", + }, + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("connectionsCreate failed:", res.error); + } +} + +run(); +``` +### Example Usage: Unauthorized - + ```typescript import { CodatSyncPayables } from "@codat/sync-for-payables"; @@ -180,7 +235,7 @@ run(); ### Example Usage - + ```typescript import { CodatSyncPayables } from "@codat/sync-for-payables"; @@ -335,7 +390,7 @@ run(); ### Example Usage - + ```typescript import { CodatSyncPayables } from "@codat/sync-for-payables"; diff --git a/sync-for-payables/docs/sdks/suppliers/README.md b/sync-for-payables/docs/sdks/suppliers/README.md index dec70519e..dfc03ec53 100644 --- a/sync-for-payables/docs/sdks/suppliers/README.md +++ b/sync-for-payables/docs/sdks/suppliers/README.md @@ -19,9 +19,9 @@ By default, this endpoint returns a list of active and archived suppliers. You c For example, to retrieve only active suppliers (i.e. `status=Active`) or suppliers created within the specified number of days (e.g. `sourceModifiedDate>2023-12-15T00:00:00.000Z`), query the endpoint as follows: `/payables/suppliers?query=sourceModifiedDate>2023-12-15T00:00:00.000Z&&status=Active`.For example, to retrieve active suppliers modified after a particular date use `query=sourceModifiedDate>2023-12-15T00:00:00.000Z&&status=Active`. -### Example Usage +### Example Usage: Source modified date - + ```typescript import { CodatSyncPayables } from "@codat/sync-for-payables"; @@ -72,6 +72,279 @@ async function run() { } } +run(); +``` +### Example Usage: Status (active) + + +```typescript +import { CodatSyncPayables } from "@codat/sync-for-payables"; + +const codatSyncPayables = new CodatSyncPayables({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatSyncPayables.suppliers.list({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + continuationToken: "continuationToken=eyJwYWdlIjoyLCJwYWdlU2l6ZSI6MTAwLCJwYWdlQ291bnQiOjExfQ==", + query: "status=Active", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatSyncPayablesCore } from "@codat/sync-for-payables/core.js"; +import { suppliersList } from "@codat/sync-for-payables/funcs/suppliersList.js"; + +// Use `CodatSyncPayablesCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatSyncPayables = new CodatSyncPayablesCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await suppliersList(codatSyncPayables, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + continuationToken: "continuationToken=eyJwYWdlIjoyLCJwYWdlU2l6ZSI6MTAwLCJwYWdlQ291bnQiOjExfQ==", + query: "status=Active", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("suppliersList failed:", res.error); + } +} + +run(); +``` +### Example Usage: Status (active) & source modified date + + +```typescript +import { CodatSyncPayables } from "@codat/sync-for-payables"; + +const codatSyncPayables = new CodatSyncPayables({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatSyncPayables.suppliers.list({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + continuationToken: "continuationToken=eyJwYWdlIjoyLCJwYWdlU2l6ZSI6MTAwLCJwYWdlQ291bnQiOjExfQ==", + query: "sourceModifiedDate>2023-12-15T00:00:00.000Z&&status=Active", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatSyncPayablesCore } from "@codat/sync-for-payables/core.js"; +import { suppliersList } from "@codat/sync-for-payables/funcs/suppliersList.js"; + +// Use `CodatSyncPayablesCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatSyncPayables = new CodatSyncPayablesCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await suppliersList(codatSyncPayables, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + continuationToken: "continuationToken=eyJwYWdlIjoyLCJwYWdlU2l6ZSI6MTAwLCJwYWdlQ291bnQiOjExfQ==", + query: "sourceModifiedDate>2023-12-15T00:00:00.000Z&&status=Active", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("suppliersList failed:", res.error); + } +} + +run(); +``` +### Example Usage: Status (archived) + + +```typescript +import { CodatSyncPayables } from "@codat/sync-for-payables"; + +const codatSyncPayables = new CodatSyncPayables({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatSyncPayables.suppliers.list({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + continuationToken: "continuationToken=eyJwYWdlIjoyLCJwYWdlU2l6ZSI6MTAwLCJwYWdlQ291bnQiOjExfQ==", + query: "status=Archived", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatSyncPayablesCore } from "@codat/sync-for-payables/core.js"; +import { suppliersList } from "@codat/sync-for-payables/funcs/suppliersList.js"; + +// Use `CodatSyncPayablesCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatSyncPayables = new CodatSyncPayablesCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await suppliersList(codatSyncPayables, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + continuationToken: "continuationToken=eyJwYWdlIjoyLCJwYWdlU2l6ZSI6MTAwLCJwYWdlQ291bnQiOjExfQ==", + query: "status=Archived", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("suppliersList failed:", res.error); + } +} + +run(); +``` +### Example Usage: Status (archived) & source modified date + + +```typescript +import { CodatSyncPayables } from "@codat/sync-for-payables"; + +const codatSyncPayables = new CodatSyncPayables({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatSyncPayables.suppliers.list({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + continuationToken: "continuationToken=eyJwYWdlIjoyLCJwYWdlU2l6ZSI6MTAwLCJwYWdlQ291bnQiOjExfQ==", + query: "sourceModifiedDate>2023-12-15T00:00:00.000Z&&status=Archived", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatSyncPayablesCore } from "@codat/sync-for-payables/core.js"; +import { suppliersList } from "@codat/sync-for-payables/funcs/suppliersList.js"; + +// Use `CodatSyncPayablesCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatSyncPayables = new CodatSyncPayablesCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await suppliersList(codatSyncPayables, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + continuationToken: "continuationToken=eyJwYWdlIjoyLCJwYWdlU2l6ZSI6MTAwLCJwYWdlQ291bnQiOjExfQ==", + query: "sourceModifiedDate>2023-12-15T00:00:00.000Z&&status=Archived", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("suppliersList failed:", res.error); + } +} + +run(); +``` +### Example Usage: Suppliers + + +```typescript +import { CodatSyncPayables } from "@codat/sync-for-payables"; + +const codatSyncPayables = new CodatSyncPayables({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatSyncPayables.suppliers.list({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + continuationToken: "continuationToken=eyJwYWdlIjoyLCJwYWdlU2l6ZSI6MTAwLCJwYWdlQ291bnQiOjExfQ==", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatSyncPayablesCore } from "@codat/sync-for-payables/core.js"; +import { suppliersList } from "@codat/sync-for-payables/funcs/suppliersList.js"; + +// Use `CodatSyncPayablesCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatSyncPayables = new CodatSyncPayablesCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await suppliersList(codatSyncPayables, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + continuationToken: "continuationToken=eyJwYWdlIjoyLCJwYWdlU2l6ZSI6MTAwLCJwYWdlQ291bnQiOjExfQ==", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("suppliersList failed:", res.error); + } +} + run(); ``` @@ -103,9 +376,70 @@ The *Create supplier* endpoint creates a new [supplier](https://docs.codat.io/sy [Suppliers](https://docs.codat.io/sync-for-payables-api#/schemas/Supplier) are people or organizations that provide something, such as a product or service. -### Example Usage +### Example Usage: Malformed query + + +```typescript +import { CodatSyncPayables } from "@codat/sync-for-payables"; + +const codatSyncPayables = new CodatSyncPayables({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatSyncPayables.suppliers.create({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + supplierPrototype: { + supplierName: "", + phone: "+44 25691 154789", + status: "Unknown", + }, + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatSyncPayablesCore } from "@codat/sync-for-payables/core.js"; +import { suppliersCreate } from "@codat/sync-for-payables/funcs/suppliersCreate.js"; + +// Use `CodatSyncPayablesCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatSyncPayables = new CodatSyncPayablesCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await suppliersCreate(codatSyncPayables, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + supplierPrototype: { + supplierName: "", + phone: "+44 25691 154789", + status: "Unknown", + }, + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("suppliersCreate failed:", res.error); + } +} + +run(); +``` +### Example Usage: Suppliers - + ```typescript import { CodatSyncPayables } from "@codat/sync-for-payables"; diff --git a/sync-for-payables/examples/package-lock.json b/sync-for-payables/examples/package-lock.json index c5ab12cc9..4cc1a4543 100644 --- a/sync-for-payables/examples/package-lock.json +++ b/sync-for-payables/examples/package-lock.json @@ -18,14 +18,14 @@ }, "..": { "name": "@codat/sync-for-payables", - "version": "9.2.0", + "version": "9.3.0", "dependencies": { "decimal.js": "^10.4.3", "zod": "^3.25.0 || ^4.0.0" }, "devDependencies": { - "@eslint/js": "^9.19.0", - "eslint": "^9.19.0", + "@eslint/js": "^9.26.0", + "eslint": "^9.26.0", "globals": "^15.14.0", "typescript": "~5.8.3", "typescript-eslint": "^8.26.0" diff --git a/sync-for-payables/jsr.json b/sync-for-payables/jsr.json index a3b100df6..0cb5b5775 100644 --- a/sync-for-payables/jsr.json +++ b/sync-for-payables/jsr.json @@ -2,7 +2,7 @@ { "name": "@codat/sync-for-payables", - "version": "9.2.0", + "version": "9.3.0", "exports": { ".": "./src/index.ts", "./sdk/models/errors": "./src/sdk/models/errors/index.ts", diff --git a/sync-for-payables/package-lock.json b/sync-for-payables/package-lock.json index aefccee3f..c5f74611c 100644 --- a/sync-for-payables/package-lock.json +++ b/sync-for-payables/package-lock.json @@ -1,19 +1,19 @@ { "name": "@codat/sync-for-payables", - "version": "9.2.0", + "version": "9.3.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@codat/sync-for-payables", - "version": "9.2.0", + "version": "9.3.0", "dependencies": { "decimal.js": "^10.4.3", "zod": "^3.25.0 || ^4.0.0" }, "devDependencies": { - "@eslint/js": "^9.19.0", - "eslint": "^9.19.0", + "@eslint/js": "^9.26.0", + "eslint": "^9.26.0", "globals": "^15.14.0", "typescript": "~5.8.3", "typescript-eslint": "^8.26.0" diff --git a/sync-for-payables/package.json b/sync-for-payables/package.json index aa0fea63a..7b0eb141c 100644 --- a/sync-for-payables/package.json +++ b/sync-for-payables/package.json @@ -1,6 +1,6 @@ { "name": "@codat/sync-for-payables", - "version": "9.2.0", + "version": "9.3.0", "author": "Codat", "main": "./index.js", "sideEffects": false, @@ -18,8 +18,8 @@ }, "devDependencies": { - "@eslint/js": "^9.19.0", - "eslint": "^9.19.0", + "@eslint/js": "^9.26.0", + "eslint": "^9.26.0", "globals": "^15.14.0", "typescript": "~5.8.3", "typescript-eslint": "^8.26.0" diff --git a/sync-for-payables/src/funcs/billsUpdate.ts b/sync-for-payables/src/funcs/billsUpdate.ts new file mode 100644 index 000000000..bcf544841 --- /dev/null +++ b/sync-for-payables/src/funcs/billsUpdate.ts @@ -0,0 +1,231 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { CodatSyncPayablesCore } from "../core.js"; +import { encodeJSON, encodeSimple } from "../lib/encodings.js"; +import * as M from "../lib/matchers.js"; +import { compactMap } from "../lib/primitives.js"; +import { safeParse } from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; +import { pathToFunc } from "../lib/url.js"; +import { CodatSyncPayablesError } from "../sdk/models/errors/codatsyncpayableserror.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../sdk/models/errors/httpclienterrors.js"; +import * as errors from "../sdk/models/errors/index.js"; +import { ResponseValidationError } from "../sdk/models/errors/responsevalidationerror.js"; +import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; +import * as operations from "../sdk/models/operations/index.js"; +import * as shared from "../sdk/models/shared/index.js"; +import { APICall, APIPromise } from "../sdk/types/async.js"; +import { Result } from "../sdk/types/fp.js"; + +/** + * Update bill + * + * @remarks + * The *Update bill* endpoint updates an existing [bill](https://docs.codat.io/sync-for-payables-api#/schemas/Bill) for a given company's connection. + * + * [Bills](https://docs.codat.io/sync-for-payables-api#/schemas/Bill) are invoices that represent the SMB's financial obligations to their supplier for a purchase of goods or services. + * + * ### Supported Integrations + * + * | Integration | Supported | + * |-------------------------------|-----------| + * | FreeAgent | Yes | + * | QuickBooks Online | Yes | + * | Xero | Yes | + * | Oracle NetSuite | No | + * | Sage Intacct | No | + * | Zoho Books | No | + */ +export function billsUpdate( + client: CodatSyncPayablesCore, + request: operations.UpdateBillRequest, + options?: RequestOptions, +): APIPromise< + Result< + shared.Bill, + | errors.ErrorMessage + | CodatSyncPayablesError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError + > +> { + return new APIPromise($do( + client, + request, + options, + )); +} + +async function $do( + client: CodatSyncPayablesCore, + request: operations.UpdateBillRequest, + options?: RequestOptions, +): Promise< + [ + Result< + shared.Bill, + | errors.ErrorMessage + | CodatSyncPayablesError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError + >, + APICall, + ] +> { + const parsed = safeParse( + request, + (value) => operations.UpdateBillRequest$outboundSchema.parse(value), + "Input validation failed", + ); + if (!parsed.ok) { + return [parsed, { status: "invalid" }]; + } + const payload = parsed.value; + const body = encodeJSON("body", payload.billPrototype, { explode: true }); + + const pathParams = { + billId: encodeSimple("billId", payload.billId, { + explode: false, + charEncoding: "percent", + }), + companyId: encodeSimple("companyId", payload.companyId, { + explode: false, + charEncoding: "percent", + }), + connectionId: encodeSimple("connectionId", payload.connectionId, { + explode: false, + charEncoding: "percent", + }), + }; + + const path = pathToFunc( + "/companies/{companyId}/connections/{connectionId}/payables/bills/{billId}", + )(pathParams); + + const headers = new Headers(compactMap({ + "Content-Type": "application/json", + Accept: "application/json", + "Idempotency-Key": encodeSimple( + "Idempotency-Key", + payload["Idempotency-Key"], + { explode: false, charEncoding: "none" }, + ), + })); + + const secConfig = await extractSecurity(client._options.authHeader); + const securityInput = secConfig == null ? {} : { authHeader: secConfig }; + const requestSecurity = resolveGlobalSecurity(securityInput); + + const context = { + options: client._options, + baseURL: options?.serverURL ?? client._baseURL ?? "", + operationID: "update-bill", + oAuth2Scopes: null, + + resolvedSecurity: requestSecurity, + + securitySource: client._options.authHeader, + retryConfig: options?.retries + || client._options.retryConfig + || { + strategy: "backoff", + backoff: { + initialInterval: 500, + maxInterval: 60000, + exponent: 1.5, + maxElapsedTime: 3600000, + }, + retryConnectionErrors: true, + } + || { strategy: "none" }, + retryCodes: options?.retryCodes || ["408", "429", "5XX"], + }; + + const requestRes = client._createRequest(context, { + security: requestSecurity, + method: "PUT", + baseURL: options?.serverURL, + path: path, + headers: headers, + body: body, + userAgent: client._options.userAgent, + timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, + }, options); + if (!requestRes.ok) { + return [requestRes, { status: "invalid" }]; + } + const req = requestRes.value; + + const doResult = await client._do(req, { + context, + errorCodes: [ + "400", + "401", + "402", + "403", + "404", + "409", + "429", + "4XX", + "500", + "503", + "5XX", + ], + retryConfig: context.retryConfig, + retryCodes: context.retryCodes, + }); + if (!doResult.ok) { + return [doResult, { status: "request-error", request: req }]; + } + const response = doResult.value; + + const responseFields = { + HttpMeta: { Response: response, Request: req }, + }; + + const [result] = await M.match< + shared.Bill, + | errors.ErrorMessage + | CodatSyncPayablesError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError + >( + M.json(200, shared.Bill$inboundSchema), + M.jsonErr( + [400, 401, 402, 403, 404, 409, 429], + errors.ErrorMessage$inboundSchema, + ), + M.jsonErr([500, 503], errors.ErrorMessage$inboundSchema), + M.fail("4XX"), + M.fail("5XX"), + )(response, req, { extraFields: responseFields }); + if (!result.ok) { + return [result, { status: "complete", request: req, response }]; + } + + return [result, { status: "complete", request: req, response }]; +} diff --git a/sync-for-payables/src/lib/config.ts b/sync-for-payables/src/lib/config.ts index 24d5a0cf0..fd701a606 100644 --- a/sync-for-payables/src/lib/config.ts +++ b/sync-for-payables/src/lib/config.ts @@ -61,8 +61,8 @@ export function serverURLFromOptions(options: SDKOptions): URL | null { export const SDK_METADATA = { language: "typescript", openapiDocVersion: "3.0.0", - sdkVersion: "9.2.0", - genVersion: "2.792.2", + sdkVersion: "9.3.0", + genVersion: "2.812.2", userAgent: - "speakeasy-sdk/typescript 9.2.0 2.792.2 3.0.0 @codat/sync-for-payables", + "speakeasy-sdk/typescript 9.3.0 2.812.2 3.0.0 @codat/sync-for-payables", } as const; diff --git a/sync-for-payables/src/lib/sdks.ts b/sync-for-payables/src/lib/sdks.ts index b1d7b5c07..126029ae9 100644 --- a/sync-for-payables/src/lib/sdks.ts +++ b/sync-for-payables/src/lib/sdks.ts @@ -304,9 +304,9 @@ export class ClientSDK { } } -const jsonLikeContentTypeRE = /(application|text)\/([^+]+\+)*json.*/; +const jsonLikeContentTypeRE = /^(application|text)\/([^+]+\+)*json.*/; const jsonlLikeContentTypeRE = - /(application|text)\/(([^+]+\+)*jsonl\b.*|([^+]+\+)*x-ndjson\b.*)/; + /^(application|text)\/([^+]+\+)*(jsonl|x-ndjson)\b.*/; async function logRequest(logger: Logger | undefined, req: Request) { if (!logger) { return; diff --git a/sync-for-payables/src/sdk/bills.ts b/sync-for-payables/src/sdk/bills.ts index 9b074ec52..37c217d48 100644 --- a/sync-for-payables/src/sdk/bills.ts +++ b/sync-for-payables/src/sdk/bills.ts @@ -7,6 +7,7 @@ import { billsDownloadAttachment } from "../funcs/billsDownloadAttachment.js"; import { billsGetBillOptions } from "../funcs/billsGetBillOptions.js"; import { billsList } from "../funcs/billsList.js"; import { billsListAttachments } from "../funcs/billsListAttachments.js"; +import { billsUpdate } from "../funcs/billsUpdate.js"; import { billsUploadAttachment } from "../funcs/billsUploadAttachment.js"; import { ClientSDK, RequestOptions } from "../lib/sdks.js"; import * as operations from "./models/operations/index.js"; @@ -75,6 +76,36 @@ export class Bills extends ClientSDK { )); } + /** + * Update bill + * + * @remarks + * The *Update bill* endpoint updates an existing [bill](https://docs.codat.io/sync-for-payables-api#/schemas/Bill) for a given company's connection. + * + * [Bills](https://docs.codat.io/sync-for-payables-api#/schemas/Bill) are invoices that represent the SMB's financial obligations to their supplier for a purchase of goods or services. + * + * ### Supported Integrations + * + * | Integration | Supported | + * |-------------------------------|-----------| + * | FreeAgent | Yes | + * | QuickBooks Online | Yes | + * | Xero | Yes | + * | Oracle NetSuite | No | + * | Sage Intacct | No | + * | Zoho Books | No | + */ + async update( + request: operations.UpdateBillRequest, + options?: RequestOptions, + ): Promise { + return unwrapAsync(billsUpdate( + this, + request, + options, + )); + } + /** * Upload bill attachment * diff --git a/sync-for-payables/src/sdk/models/operations/index.ts b/sync-for-payables/src/sdk/models/operations/index.ts index 581b2008d..12cda2c10 100644 --- a/sync-for-payables/src/sdk/models/operations/index.ts +++ b/sync-for-payables/src/sdk/models/operations/index.ts @@ -22,5 +22,6 @@ export * from "./listconnections.js"; export * from "./listsuppliers.js"; export * from "./replacecompany.js"; export * from "./unlinkconnection.js"; +export * from "./updatebill.js"; export * from "./updatecompany.js"; export * from "./uploadbillattachment.js"; diff --git a/sync-for-payables/src/sdk/models/operations/updatebill.ts b/sync-for-payables/src/sdk/models/operations/updatebill.ts new file mode 100644 index 000000000..2ccc0c5a8 --- /dev/null +++ b/sync-for-payables/src/sdk/models/operations/updatebill.ts @@ -0,0 +1,61 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import * as z from "zod/v3"; +import { remap as remap$ } from "../../../lib/primitives.js"; +import * as shared from "../shared/index.js"; + +export type UpdateBillRequest = { + /** + * Unique identifier for a company. + */ + companyId: string; + /** + * Unique identifier for a connection. + */ + connectionId: string; + /** + * Unique identifier for a bill. + */ + billId: string; + /** + * A unique identifier to ensure idempotent behaviour for subsequent requests. + */ + idempotencyKey?: string | undefined; + billPrototype?: shared.BillPrototype | undefined; +}; + +/** @internal */ +export type UpdateBillRequest$Outbound = { + companyId: string; + connectionId: string; + billId: string; + "Idempotency-Key"?: string | undefined; + billPrototype?: shared.BillPrototype$Outbound | undefined; +}; + +/** @internal */ +export const UpdateBillRequest$outboundSchema: z.ZodType< + UpdateBillRequest$Outbound, + z.ZodTypeDef, + UpdateBillRequest +> = z.object({ + companyId: z.string(), + connectionId: z.string(), + billId: z.string(), + idempotencyKey: z.string().optional(), + billPrototype: shared.BillPrototype$outboundSchema.optional(), +}).transform((v) => { + return remap$(v, { + idempotencyKey: "Idempotency-Key", + }); +}); + +export function updateBillRequestToJSON( + updateBillRequest: UpdateBillRequest, +): string { + return JSON.stringify( + UpdateBillRequest$outboundSchema.parse(updateBillRequest), + ); +}