From d55aa63390789525001dcff12c742adeafc63775 Mon Sep 17 00:00:00 2001 From: speakeasybot Date: Mon, 9 Feb 2026 13:59:09 +0000 Subject: [PATCH] ## Typescript SDK Changes: * `codatsyncpayables.bills.update()`: **Added** --- .speakeasy/logs/changes/changes.html | 104 + .speakeasy/logs/changes/changes.md | 2 + .speakeasy/logs/changes/new.openapi.yaml | 3770 +++++++++++++++++ .speakeasy/logs/changes/old.openapi.yaml | 3485 +++++++++++++++ .speakeasy/workflow.lock | 14 +- sync-for-payables/.speakeasy/gen.lock | 297 +- sync-for-payables/.speakeasy/gen.yaml | 5 +- sync-for-payables/README.md | 2 + sync-for-payables/RELEASES.md | 12 +- .../operations/createbillpaymentrequest.md | 14 +- .../downloadbillattachmentrequest.md | 12 +- .../operations/listbillattachmentsrequest.md | 10 +- .../models/operations/updatebillrequest.md | 23 + .../operations/uploadbillattachmentrequest.md | 12 +- .../sdk/models/shared/accountmappingoption.md | 4 +- .../docs/sdk/models/shared/attachment.md | 4 +- .../docs/sdk/models/shared/bankaccount.md | 4 +- .../models/shared/bankaccountmappingoption.md | 2 +- .../sdk/models/shared/bankaccountprototype.md | 2 +- .../docs/sdk/models/shared/bill.md | 8 +- .../docs/sdk/models/shared/billpayment.md | 2 +- .../sdk/models/shared/billpaymentprototype.md | 2 +- .../docs/sdk/models/shared/billprototype.md | 6 +- .../models/shared/clientratelimitwebhook.md | 4 +- .../shared/clientratelimitwebhookpayload.md | 2 +- .../docs/sdk/models/shared/company.md | 4 +- .../docs/sdk/models/shared/connection.md | 4 +- .../sdk/models/shared/dataconnectionerror.md | 4 +- .../docs/sdk/models/shared/supplier.md | 24 +- .../sdk/models/shared/supplierprototype.md | 20 +- .../docs/sdks/bankaccounts/README.md | 67 +- .../docs/sdks/billpayments/README.md | 148 +- sync-for-payables/docs/sdks/bills/README.md | 927 +++- .../docs/sdks/companies/README.md | 550 ++- .../docs/sdks/companyinformation/README.md | 2 +- .../docs/sdks/connections/README.md | 65 +- .../docs/sdks/suppliers/README.md | 342 +- sync-for-payables/examples/package-lock.json | 6 +- sync-for-payables/jsr.json | 2 +- sync-for-payables/package-lock.json | 8 +- sync-for-payables/package.json | 6 +- sync-for-payables/src/funcs/billsUpdate.ts | 231 + sync-for-payables/src/lib/config.ts | 6 +- sync-for-payables/src/lib/sdks.ts | 4 +- sync-for-payables/src/sdk/bills.ts | 31 + .../src/sdk/models/operations/index.ts | 1 + .../src/sdk/models/operations/updatebill.ts | 61 + 47 files changed, 10042 insertions(+), 273 deletions(-) create mode 100644 .speakeasy/logs/changes/changes.html create mode 100644 .speakeasy/logs/changes/changes.md create mode 100644 .speakeasy/logs/changes/new.openapi.yaml create mode 100644 .speakeasy/logs/changes/old.openapi.yaml create mode 100644 sync-for-payables/docs/sdk/models/operations/updatebillrequest.md create mode 100644 sync-for-payables/src/funcs/billsUpdate.ts create mode 100644 sync-for-payables/src/sdk/models/operations/updatebill.ts diff --git a/.speakeasy/logs/changes/changes.html b/.speakeasy/logs/changes/changes.html new file mode 100644 index 000000000..133757eb0 --- /dev/null +++ b/.speakeasy/logs/changes/changes.html @@ -0,0 +1,104 @@ + + + + + + + SDK Changelog - typescript + + +

Typescript SDK Changes:

+ + + + \ No newline at end of file diff --git a/.speakeasy/logs/changes/changes.md b/.speakeasy/logs/changes/changes.md new file mode 100644 index 000000000..51c8ce152 --- /dev/null +++ b/.speakeasy/logs/changes/changes.md @@ -0,0 +1,2 @@ +## Typescript SDK Changes: +* `codatsyncpayables.bills.update()`: **Added** diff --git a/.speakeasy/logs/changes/new.openapi.yaml b/.speakeasy/logs/changes/new.openapi.yaml new file mode 100644 index 000000000..3a0ae335d --- /dev/null +++ b/.speakeasy/logs/changes/new.openapi.yaml @@ -0,0 +1,3770 @@ +openapi: 3.1.0 +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 | + + --- + + ## Endpoints + + | Endpoints | Description | + | :- |:- | + | 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. | + + version: 3.0.0 + contact: + name: Codat + email: support@codat.io + termsOfService: 'https://www.codat.io/legals/' +security: + - auth_header: [] +x-speakeasy-retries: + strategy: backoff + backoff: + initialInterval: 500 + maxInterval: 60000 + maxElapsedTime: 3600000 + exponent: 1.5 + statusCodes: + - 408 + - 429 + - 5XX + retryConnectionErrors: true +x-speakeasy-name-override: + - operationId: ^list-.*? + methodNameOverride: list + - operationId: ^list-.*?-attachments + methodNameOverride: list-attachments + - operationId: ^get-.*? + methodNameOverride: get + - operationId: ^get-create-.*?-model + methodNameOverride: get-create-model + - operationId: ^get-create-update.*?-model + methodNameOverride: get-create-update-model + - operationId: ^get-.*?-attachment + methodNameOverride: get-attachment + - operationId: ^update-.*? + methodNameOverride: update + - operationId: ^create-.*? + methodNameOverride: create + - operationId: ^delete-.*? + methodNameOverride: delete + - operationId: ^delete-.*?-attachment + methodNameOverride: delete-attachment + - operationId: ^download-.*?-attachment + methodNameOverride: download-attachment + - operationId: ^upload-.*?-attachment + methodNameOverride: upload-attachment +x-codat-docs-path: sync-for-payables-api +x-codat-keep-docs-paths-local: true +x-codat-speakeasy-pagination: + type: offsetLimit + inputs: + - name: page + in: parameters + type: page + outputs: + results: $.results +tags: + - name: Companies + 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. +paths: + /companies: + get: + summary: List companies + tags: + - Companies + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/Companies' + examples: + One company: + value: + results: + - id: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + name: My Test Company + description: My Test Company make testing software + platform: '' + redirect: 'https://link.codat.io/company/3fa85f64-5717-4562-b3fc-2c963f66afa6' + lastSync: '2022-01-01T12:30:00.000Z' + dataConnections: + - id: 51baa045-4836-4317-a42e-3542e991e581 + integrationId: 1c312d69-e638-46d4-ad31-72e6c3ba8390 + integrationKey: vjms + sourceId: 396c3158-5dd7-481b-a7c4-a795ca31792b + platformName: Pandle + linkUrl: 'https://link-api.codat.io/companies/3fa85f64-5717-4562-b3fc-2c963f66afa6/connections/51baa045-4836-4317-a42e-3542e991e581/start' + status: Linked + lastSync: '2022-01-01T12:30:00.000Z' + created: '2022-01-01T11:30:00Z' + sourceType: Accounting + created: '2022-01-01T11:30:00Z' + createdByUserName: Mike Smith + products: + - spend-insights + - lending + - expenses-v1 + - commerce + referenceSubsidiaryCompanies: [] + pageNumber: 1 + pageSize: 100 + totalResults: 1 + _links: + current: + href: /companies?page=1&pageSize=100 + self: + href: /companies + List of Companies: + value: + results: + - id: d1568dde-adf6-11ed-afa1-0242ac120002 + name: Technicalium + description: 'Technology services, including web and app design and development' + platform: '' + redirect: 'https://link.codat.io/company/d1568dde-adf6-11ed-afa1-0242ac120002' + lastSync: '2022-01-01T12:30:00.000Z' + dataConnections: + - id: 51baa045-4836-4317-a42e-3542e991e581 + integrationId: 1c312d69-e638-46d4-ad31-72e6c3ba8390 + integrationKey: vjms + sourceId: 396c3158-5dd7-481b-a7c4-a795ca31792b + platformName: Pandle + linkUrl: 'https://link-api.codat.io/companies/d1568dde-adf6-11ed-afa1-0242ac120002/connections/51baa045-4836-4317-a42e-3542e991e581/start' + status: Linked + lastSync: '2022-01-01T12:30:00.000Z' + created: '2022-01-01T11:30:00Z' + sourceType: Accounting + created: '2022-01-01T11:30:00Z' + createdByUserName: Joe Bloggs + products: + - spend-insights + - lending + - payables-v2 + referenceSubsidiaryCompanies: [] + - id: ab12c58d-a678-4ebf-a159-ae99e1807bd0 + name: Toft stores + redirect: 'https://link.codat.io/company/ab12c58d-a678-4ebf-a159-ae99e1807bd0' + dataConnections: [] + created: '2022-11-10T10:45:18Z' + createdByUserName: Dan Tzabar + products: + - spend-insights + referenceSubsidiaryCompanies: + - id: c8d3af58-7011-47ce-b3f2-89faf300ef6d + name: Toft stores UK + links: + portal: 'https://app.codat.io/companies/c8d3af58-7011-47ce-b3f2-89faf300ef6d/summary' + - id: db94eddc-9212-4568-9b5c-3eab0e325913 + name: Toft stores US + links: + portal: 'https://app.codat.io/companies/db94eddc-9212-4568-9b5c-3eab0e325913/summary' + - id: c8d3af58-7011-47ce-b3f2-89faf300ef6d + name: Toft stores UK + redirect: 'https://link.codat.io/company/c8d3af58-7011-47ce-b3f2-89faf300ef6d' + dataConnections: + - id: d5ab61b7-1ad0-46fd-9f9f-b6761047941e + integrationId: cc750323-5a47-4f28-8d8e-30fbbf2ce137 + integrationKey: akxx + sourceId: 9815b998-024d-4415-a40b-89903b2cad6f + platformName: Oracle NetSuite + linkUrl: 'https://link-api.codat.io/companies/c8d3af58-7011-47ce-b3f2-89faf300ef6d/connections/d5ab61b7-1ad0-46fd-9f9f-b6761047941e/start' + status: Linked + lastSync: '2022-01-01T12:30:00.000Z' + created: '2022-01-01T11:30:00Z' + sourceType: Accounting + created: '2022-11-10T10:45:18Z' + createdByUserName: Dan Tzabar + products: + - lending + - spend-insights + - payables + referenceParentCompany: + id: ab12c58d-a678-4ebf-a159-ae99e1807bd0 + name: Toft stores + links: + portal: 'https://app.codat.io/companies/ab12c58d-a678-4ebf-a159-ae99e1807bd0/summary' + referenceSubsidiaryCompanies: [] + - id: db94eddc-9212-4568-9b5c-3eab0e325913 + name: Toft stores US + redirect: 'https://link.codat.io/company/db94eddc-9212-4568-9b5c-3eab0e325913' + dataConnections: + - id: 1e5c8c9e-27fd-4ba9-9a2a-d02ba65bc2fb + integrationId: cc750323-5a47-4f28-8d8e-30fbbf2ce137 + integrationKey: akxx + sourceId: 9815b998-024d-4415-a40b-89903b2cad6f + platformName: Oracle NetSuite + linkUrl: 'https://link-api.codat.io/companies/db94eddc-9212-4568-9b5c-3eab0e325913/connections/1e5c8c9e-27fd-4ba9-9a2a-d02ba65bc2fb/start' + status: Linked + lastSync: '2022-01-01T12:30:00.000Z' + created: '2022-01-01T11:30:00Z' + sourceType: Accounting + created: '2022-11-10T10:45:18Z' + createdByUserName: Dan Tzabar + products: + - spend-insights + referenceParentCompany: + id: ab12c58d-a678-4ebf-a159-ae99e1807bd0 + name: Toft stores + links: + portal: 'https://app.codat.io/companies/ab12c58d-a678-4ebf-a159-ae99e1807bd0/summary' + referenceSubsidiaryCompanies: [] + pageNumber: 1 + pageSize: 100 + totalResults: 3 + _links: + current: + href: /companies?page=1&pageSize=100 + self: + href: /companies + '400': + $ref: '#/components/responses/Malformed-Query' + '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' + 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`" + parameters: + - $ref: '#/components/parameters/page' + - $ref: '#/components/parameters/pageSize' + - $ref: '#/components/parameters/query' + - $ref: '#/components/parameters/orderBy' + - name: tags + in: query + schema: + type: string + example: region=uk && team=invoice-finance + description: 'Filter companies by tags using the "equals" (=), "not equals" (!=), and "contains" (~) operators with [Codat’s query language](https://docs.codat.io/using-the-api/querying).' + post: + summary: Create company + tags: + - Companies + operationId: create-company + responses: + '200': + description: OK + content: + application/json: + x-speakeasy-usage-example: true + schema: + $ref: '#/components/schemas/Company' + examples: + With no description: + value: + id: ab12c58d-a678-4ebf-a159-ae99e1807bd0 + name: Technicalium + description: '' + platform: '' + redirect: 'https://link.codat.io/company/ab12c58d-a678-4ebf-a159-ae99e1807bd0' + dataConnections: [] + created: '2022-11-10T10:45:18.1950523Z' + createdByUserName: Dan Tzabar + products: + - spend-insights + referenceSubsidiaryCompanies: [] + With a description: + value: + id: ab12c58d-a678-4ebf-a159-ae99e1807bd0 + name: Technicalium + description: 'Technology services, including web and app design and development' + platform: '' + redirect: 'https://link.codat.io/company/ab12c58d-a678-4ebf-a159-ae99e1807bd0' + dataConnections: [] + created: '2022-11-10T10:45:18.1950523Z' + createdByUserName: Dan Tzabar + products: + - spend-insights + referenceSubsidiaryCompanies: [] + With a tag: + value: + id: ab12c58d-a678-4ebf-a159-ae99e1807bd0 + name: Technicalium + description: '' + platform: '' + redirect: 'https://link.codat.io/company/ab12c58d-a678-4ebf-a159-ae99e1807bd0' + dataConnections: [] + created: '2022-11-10T10:45:18.1950523Z' + createdByUserName: Dan Tzabar + products: + - spend-insights + tags: + region: us + referenceSubsidiaryCompanies: [] + '400': + $ref: '#/components/responses/BadRequest' + '401': + $ref: '#/components/responses/Unauthorized' + '402': + $ref: '#/components/responses/Payment-Required' + '403': + $ref: '#/components/responses/Forbidden' + '429': + $ref: '#/components/responses/Too-Many-Requests' + '500': + $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`." + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/CompanyRequestBody' + examples: + With no description: + value: + name: Technicalium + With a description: + value: + name: Technicalium + description: 'Technology services, including web and app design and development' + '/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." + operationId: replace-company + x-speakeasy-name-override: replace + parameters: + - $ref: '#/components/parameters/companyId' + tags: + - Companies + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/Company' + '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' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/CompanyRequestBody' + examples: + Update name: + value: + name: New Name + Update description: + value: + name: Same name + 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." + operationId: update-company + parameters: + - $ref: '#/components/parameters/companyId' + tags: + - Companies + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/Company' + '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' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/CompanyUpdateRequest' + examples: + Update tags: + value: + tags: + refrence: new reference + Update name: + value: + name: New Name + delete: + summary: Delete a company + 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" + tags: + - Companies + responses: + '204': + description: No Content + '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: 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" + parameters: + - $ref: '#/components/parameters/companyId' + tags: + - Companies + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/Company' + examples: + Simple company: + value: + id: ab12c58d-a678-4ebf-a159-ae99e1807bd0 + name: Toft stores holdings + description: '' + platform: '' + redirect: 'https://link.codat.io/company/ab12c58d-a678-4ebf-a159-ae99e1807bd0' + dataConnections: [] + created: '2022-11-10T10:45:18Z' + createdByUserName: Dan Tzabar + products: + - spend-insights + - lending + - expenses-v1 + - commerce + referenceSubsidiaryCompanies: [] + Parent multi-entity company: + value: + id: ab12c58d-a678-4ebf-a159-ae99e1807bd0 + name: Toft stores + description: '' + platform: '' + redirect: 'https://link.codat.io/company/ab12c58d-a678-4ebf-a159-ae99e1807bd0' + dataConnections: [] + created: '2022-11-10T10:45:18Z' + createdByUserName: Dan Tzabar + products: + - spend-insights + - lending + - expenses-v1 + - commerce + referenceSubsidiaryCompanies: + - id: c8d3af58-7011-47ce-b3f2-89faf300ef6d + name: Toft stores UK + links: + portal: 'https://app.codat.io/companies/c8d3af58-7011-47ce-b3f2-89faf300ef6d/summary' + - id: db94eddc-9212-4568-9b5c-3eab0e325913 + name: Toft stores US + links: + portal: 'https://app.codat.io/companies/db94eddc-9212-4568-9b5c-3eab0e325913/summary' + Subsidiary multi-entity company: + value: + id: c8d3af58-7011-47ce-b3f2-89faf300ef6d + name: Toft stores UK + description: '' + platform: '' + redirect: 'https://link.codat.io/company/c8d3af58-7011-47ce-b3f2-89faf300ef6d' + dataConnections: + - id: d5ab61b7-1ad0-46fd-9f9f-b6761047941e + integrationId: cc750323-5a47-4f28-8d8e-30fbbf2ce137 + integrationKey: akxx + sourceId: 9815b998-024d-4415-a40b-89903b2cad6f + platformName: Oracle NetSuite + linkUrl: 'https://link-api.codat.io/companies/c8d3af58-7011-47ce-b3f2-89faf300ef6d/connections/d5ab61b7-1ad0-46fd-9f9f-b6761047941e/start' + status: Linked + lastSync: '2022-01-01T12:30:00.000Z' + created: '2022-01-01T11:30:00Z' + sourceType: Accounting + created: '2022-11-10T10:45:18Z' + createdByUserName: Dan Tzabar + products: + - spend-insights + - lending + - expenses-v1 + - commerce + referenceParentCompany: + id: ab12c58d-a678-4ebf-a159-ae99e1807bd0 + name: Toft stores + links: + portal: 'https://app.codat.io/companies/ab12c58d-a678-4ebf-a159-ae99e1807bd0/summary' + referenceSubsidiaryCompanies: [] + '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': + get: + summary: List connections + description: "\uFEFFList the connections for a company." + operationId: list-connections + tags: + - Connections + parameters: + - $ref: '#/components/parameters/companyId' + - $ref: '#/components/parameters/page' + - $ref: '#/components/parameters/pageSize' + - $ref: '#/components/parameters/query' + - $ref: '#/components/parameters/orderBy' + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/Connections' + examples: + Connections: + value: + results: + - id: ee2eb431-c0fa-4dc9-93fa-d29781c12bcd + integrationId: bf083d72-62c7-493e-aec9-81b4dbba7e2c + integrationKey: dfxm + sourceId: bdd831ce-eebd-4896-89a7-20e5ee8989ee + 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' + sourceType: Banking + pageNumber: 0 + pageSize: 0 + totalResults: 0 + _links: + self: + href: string + current: + href: string + next: + href: string + previous: + href: string + '400': + $ref: '#/components/responses/Malformed-Query' + '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' + post: + summary: Create connection + description: "\uFEFFCreates a connection for the company by providing a valid `platformKey`. \n\nUse the [List Integrations](https://docs.codat.io/platform-api#/operations/list-integrations) endpoint to access valid platform keys. " + parameters: + - $ref: '#/components/parameters/companyId' + tags: + - Connections + operationId: create-connection + requestBody: + content: + application/json: + schema: + type: object + properties: + platformKey: + type: string + minLength: 4 + maxLength: 4 + pattern: '[a-z]{4}' + example: gbol + description: 'A unique 4-letter key to represent a platform in each integration. View [accounting](https://docs.codat.io/integrations/accounting/overview#platform-keys), [banking](https://docs.codat.io/integrations/banking/overview#platform-keys), and [commerce](https://docs.codat.io/integrations/commerce/overview#platform-keys) platform keys.' + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/Connection' + examples: + Connection: + value: + id: ee2eb431-c0fa-4dc9-93fa-d29781c12bcd + integrationId: bf083d72-62c7-493e-aec9-81b4dbba7e2c + integrationKey: dfxm + sourceId: bdd831ce-eebd-4896-89a7-20e5ee8989ee + 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' + sourceType: Banking + '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}': + get: + summary: Get connection + operationId: get-connection + description: "\uFEFFReturns a specific connection for a company when valid identifiers are provided. If the identifiers are for a deleted company and/or connection, a not found response is returned." + tags: + - Connections + parameters: + - $ref: '#/components/parameters/companyId' + - $ref: '#/components/parameters/connectionId' + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/Connection' + examples: + Connection: + value: + id: ee2eb431-c0fa-4dc9-93fa-d29781c12bcd + integrationId: bf083d72-62c7-493e-aec9-81b4dbba7e2c + integrationKey: dfxm + sourceId: bdd831ce-eebd-4896-89a7-20e5ee8989ee + 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' + sourceType: Banking + '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' + delete: + summary: Delete connection + operationId: delete-connection + description: "\uFEFFRevoke and remove a connection from a company.\nThis operation is not reversible. The end user would need to reauthorize a new data connection if you wish to view new data for this company." + parameters: + - $ref: '#/components/parameters/companyId' + - $ref: '#/components/parameters/connectionId' + tags: + - Connections + responses: + '200': + description: OK + '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' + patch: + summary: Unlink connection + description: "\uFEFFThis allows you to deauthorize a connection, without deleting it from Codat. This means you can still view any data that has previously been pulled into Codat, and also lets you re-authorize in future if your customer wishes to resume sharing their data." + operationId: unlink-connection + x-speakeasy-name-override: unlink + tags: + - Connections + parameters: + - $ref: '#/components/parameters/companyId' + - $ref: '#/components/parameters/connectionId' + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/Connection' + '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' + requestBody: + content: + application/json: + schema: + title: Update connection + x-internal: true + type: object + properties: + status: + $ref: '#/components/schemas/Connection/definitions/dataConnectionStatus' + description: The current authorization status of the data connection. + nullable: true + additionalProperties: false + examples: + Example: + 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' + '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/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== + '400': + $ref: '#/components/responses/Malformed-Query' + '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/Conflict' + '429': + $ref: '#/components/responses/Too-Many-Requests' + '500': + $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 + responses: + '200': + description: Success + 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' + '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/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/{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 + responses: + '200': + description: Success + content: + application/octet-stream: + schema: + title: Data + type: string + format: binary + '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/{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).' + responses: + '200': + description: Success + 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== + '400': + $ref: '#/components/responses/Malformed-Query' + '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/Conflict' + '429': + $ref: '#/components/responses/Too-Many-Requests' + '500': + $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 + '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/bankAccounts': + parameters: + - $ref: '#/components/parameters/companyId' + - $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 + requestBody: + 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' + examples: {} + '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' + 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: + client.rateLimit.reached: + post: + description: Called when your client’s request count to Codat's API surpasses the allocated quota. + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ClientRateLimitWebhook' + examples: + Reached: + value: + id: 743ec94a-8aa4-44bb-8bd4-e1855ee0e74b + eventType: client.rateLimit.reached + generatedDate: '2024-09-01T00:00:00Z' + payload: + dailyQuota: 12000 + quotaRemaining: 0 + expiryDate: '2024-09-01T12:14:14Z' + responses: + '200': + description: Return a 200 status to indicate that the webhook was received successfully. + client.rateLimit.reset: + post: + description: 'Called when your client''s rate limit quota is reset, allowing additional requests to Codat''s API.' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ClientRateLimitWebhook' + examples: + Reset: + value: + id: 743ec94a-8aa4-44bb-8bd4-e1855ee0e74b + eventType: client.rateLimit.reset + generatedDate: '2024-09-01T00:00:00Z' + payload: + dailyQuota: 12000 + quotaRemaining: 11993 + expiryDate: '2024-09-01T23:59:99Z' + responses: + '200': + description: Return a 200 status to indicate that the webhook was received successfully. +components: + schemas: + Address: + title: Address + x-internal: true + type: object + properties: + type: + $ref: '#/components/schemas/Address/definitions/addressType' + line1: + type: string + nullable: true + description: Line 1 of the customer address. + line2: + type: string + nullable: true + description: Line 2 of the customer address. + city: + type: string + nullable: true + description: City of the customer address. + region: + type: string + nullable: true + description: Region of the customer address. + 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.' + postalCode: + type: string + nullable: true + description: Postal code or zip code. + definitions: + addressType: + description: The type of the address + type: string + enum: + - 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: + id: + type: string + description: 'Identifier for the attachment, unique for the company in the accounting software.' + name: + type: string + nullable: true + description: Name of the attachment file. + 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' + fileSize: + type: integer + format: int32 + nullable: true + description: 'File size in bytes. For example, if this reads **46153**, then the file size is 46kb.' + 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 + type: object + allOf: + - 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. + + 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: + title: Bank Account Type + x-internal: true + enum: + - Unknown + - Credit + - Debit + type: string + description: |- + 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`. + type: string + enum: + - Unknown + - Open + - PartiallyPaid + - Paid + - Void + - Draft + example: Open + billLineItem: + title: Bill line item + type: object + properties: + description: + type: string + nullable: true + description: Friendly name of the goods or services received. + unitAmount: + type: number + format: decimal + description: Unit price of the goods or service. + 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' + totalAmount: + type: number + 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. + - `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. + type: object + 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 + ClientRateLimitWebhook: + title: Client rate limit webhook + type: object + properties: + id: + type: string + format: uuid + example: 743ec94a-8aa4-44bb-8bd4-e1855ee0e74b + description: Unique identifier of the event. + eventType: + type: string + description: The type of event. + examples: + - client.rateLimit.reset + - client.rateLimit.reached + generatedDate: + $ref: '#/components/schemas/Connection/properties/created' + description: The date time in UTC the event was generated in Codat. + payload: + $ref: '#/components/schemas/ClientRateLimitWebhook/definitions/clientRateLimitWebhookPayload' + definitions: + clientRateLimitWebhookPayload: + title: Client rate limit webhook payload + type: object + properties: + dailyQuota: + type: integer + description: The number of available requests per day. + quotaRemaining: + 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. + Companies: + title: Companies + x-internal: true + allOf: + - type: object + properties: + results: + type: array + items: + $ref: '#/components/schemas/Company' + - $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." + type: object + allOf: + - $ref: '#/components/schemas/Company/definitions/companyDetails' + - type: object + properties: + dataConnections: + type: array + items: + $ref: '#/components/schemas/Connection' + definitions: + companyDetails: + title: Company details + type: object + properties: + id: + $ref: '#/components/parameters/companyId/schema' + name: + type: string + description: The name of the company + example: Codat Ltd. + description: + $ref: '#/components/schemas/CompanyRequestBody/properties/description' + nullable: true + redirect: + type: string + format: uri + 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' + createdByUserName: + type: string + description: Name of user that created the company in Codat. + nullable: true + products: + type: array + items: + type: string + description: An array of products that are currently enabled for the company. + tags: + title: Tags + type: object + maxProperties: 10 + propertyNames: + pattern: '^.{1,27}$' + additionalProperties: + type: string + maxLength: 100 + description: A collection of user-defined key-value pairs that store custom metadata against the company. + referenceParentCompany: + $ref: '#/components/schemas/Company/definitions/companyReference' + nullable: true + description: The parent entity or controlling organization of this company. Null if the company has no parent. + referenceSubsidiaryCompanies: + type: array + nullable: false + description: A list of subsidiary companies owned or controlled by this entity. Empty if the company has no children. + minItems: 0 + items: + $ref: '#/components/schemas/Company/definitions/companyReference' + required: + - id + - name + - redirect + companyReference: + title: Company reference + type: object + properties: + id: + $ref: '#/components/parameters/companyId/schema' + name: + $ref: '#/components/schemas/Company/definitions/companyDetails/properties/name' + description: + $ref: '#/components/schemas/Company/definitions/companyDetails/properties/description' + links: + type: object + description: A collection of links for the company. + properties: + portal: + type: string + format: uri + description: Link to the company page in the portal. + tags: + $ref: '#/components/schemas/Company/definitions/companyDetails/properties/tags' + examples: + - 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 + 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 + 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' + sourceType: Banking + 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 + type: object + properties: + name: + type: string + description: Name of company being connected. + pattern: '^[A-Za-z0-9\s\-'',&@.,?!\s]+$' + minLength: 1 + example: Bank of Dave + description: + type: string + example: Requested early access to the new financing scheme. + description: 'Additional information about the company. This can be used to store foreign IDs, references, etc.' + tags: + $ref: '#/components/schemas/Company/definitions/companyDetails/properties/tags' + required: + - name + CompanyUpdateRequest: + title: Update company request + x-internal: true + type: object + properties: + name: + type: string + description: Name of company being connected. + pattern: '^[A-Za-z0-9\s\-'',&@.,?!\s]+$' + minLength: 1 + example: Bank of Dave + description: + $ref: '#/components/schemas/CompanyRequestBody/properties/description' + tags: + $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)." + type: object + properties: + id: + $ref: '#/components/parameters/connectionId/schema' + integrationId: + type: string + format: uuid + example: fd321cb6-7963-4506-b873-e99593a45e30 + description: A Codat ID representing the integration. + integrationKey: + type: string + description: A unique four-character ID that identifies the platform of the company's data connection. This ensures continuity if the platform changes its name in the future. + sourceId: + type: string + format: uuid + example: 35b92968-9851-4095-ad60-395c95cbcba4 + description: 'A source-specific ID used to distinguish between different sources originating from the same data connection. In general, a data connection is a single data source. However, for TrueLayer, `sourceId` is associated with a specific bank and has a many-to-one relationship with the `integrationId`.' + sourceType: + title: Source Type + description: The type of platform of the connection. + type: string + enum: + - Accounting + - Banking + - BankFeed + - Commerce + - Expense + - Other + - Unknown + example: Accounting + platformName: + type: string + description: Name of integration connected to company. + linkUrl: + type: string + format: uri + description: The link URL your customers can use to authorize access to their business application. + example: 'https://link-api.codat.io/companies/86bd88cb-44ab-4dfb-b32f-87b19b14287f/connections/2e2eb431-c1fa-4dc9-93fa-d29781c12bcd/start' + 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. + dataConnectionErrors: + type: array + nullable: true + items: + $ref: '#/components/schemas/Connection/definitions/dataConnectionError' + connectionInfo: + type: object + nullable: true + additionalProperties: true + additionalProperties: false + required: + - id + - integrationId + - integrationKey + - sourceId + - platformName + - linkUrl + - status + - created + - sourceType + definitions: + dataConnectionStatus: + title: Data connection status + description: The current authorization status of the data connection. + type: string + enum: + - PendingAuth + - Linked + - Unlinked + - Deauthorized + dataConnectionError: + title: Data connection error + type: object + properties: + statusCode: + type: string + description: The HTTP status code returned by the source platform when the error occurred. + statusText: + type: string + description: A non-numeric status code/text returned by the source platform when the error occurred. + errorMessage: + type: string + description: A message about a error returned by Codat. + erroredOnUtc: + $ref: '#/components/schemas/Connection/properties/created' + status: + title: Error status + description: The current status of a transient error. Null statuses indicate that the error is not transient. + type: string + nullable: true + enum: + - Active + - Resolved + resolvedOnUtc: + description: The datetime in Utc that the error was resolved. + nullable: true + $ref: '#/components/schemas/Connection/properties/created' + dataConnectionSourceType: + title: Source Type + description: The type of platform of the connection. + type: string + enum: + - Accounting + - Banking + - BankFeed + - Commerce + - Expense + - Other + - Unknown + example: Accounting + example: + id: ee2eb431-c0fa-4dc9-93fa-d29781c12bcd + integrationId: bf083d72-62c7-493e-aec9-81b4dbba7e2c + integrationKey: dfxm + sourceId: bdd831ce-eebd-4896-89a7-20e5ee8989ee + 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' + sourceType: Banking + Connections: + title: Connections + x-internal: true + allOf: + - type: object + properties: + results: + type: array + items: + $ref: '#/components/schemas/Connection' + - $ref: '#/components/schemas/PagingInfo' + DataStatus: + title: Data status + description: Describes the state of data in the Codat cache for a company and data type + type: object + required: + - dataType + - currentStatus + properties: + dataType: + title: Data types + x-internal: true + type: string + description: Available data types + enum: + - accountTransactions + - balanceSheet + - bankAccounts + - bankTransactions + - billCreditNotes + - billPayments + - bills + - cashFlowStatement + - chartOfAccounts + - company + - creditNotes + - customers + - directCosts + - directIncomes + - invoices + - itemReceipts + - items + - journalEntries + - journals + - paymentMethods + - payments + - profitAndLoss + - purchaseOrders + - salesOrders + - suppliers + - taxRates + - trackingCategories + - transfers + - banking-accountBalances + - banking-accounts + - banking-transactionCategories + - banking-transactions + - commerce-companyInfo + - commerce-customers + - commerce-disputes + - commerce-locations + - commerce-orders + - commerce-paymentMethods + - commerce-payments + - commerce-productCategories + - commerce-products + - commerce-taxComponents + - commerce-transactions + example: invoices + lastSuccessfulSync: + $ref: '#/components/schemas/Connection/properties/created' + currentStatus: + $ref: '#/components/schemas/PullOperation/properties/status' + latestSyncId: + type: string + description: Unique identifier for most recent sync of data type. + format: uuid + example: ad474a37-2003-478e-baee-9af9f1ec2fe3 + latestSuccessfulSyncId: + type: string + description: Unique identifier for the most recent successful sync of data type. + format: uuid + example: 8220fc90-55b6-47bc-9417-48ac6ea93101 + examples: + - dataType: string + lastSuccessfulSync: '2022-01-01T13:00:00.000Z' + currentStatus: string + latestSyncId: ad474a37-2003-478e-baee-9af9f1ec2fe3 + latestSuccessfulSyncId: 8220fc90-55b6-47bc-9417-48ac6ea93101 + DataType: + x-internal: true + $ref: '#/components/schemas/DataStatus/properties/dataType' + ErrorMessage: + title: Error message + type: object + x-internal: true + properties: + statusCode: + type: integer + description: The HTTP status code returned by the error. + service: + type: string + description: Codat's service the returned the error. + error: + type: string + description: A brief description of the error. + correlationId: + type: string + description: Unique identifier used to propagate to all downstream services and determine the source of the error. + validation: + $ref: '#/components/schemas/ErrorMessage/definitions/errorValidation' + canBeRetried: + type: string + description: '`True` if the error occurred transiently and can be retried.' + detailedErrorCode: + type: integer + description: Machine readable error code used to automate processes based on the code returned. + definitions: + errorValidation: + title: Validation error + type: object + nullable: true + description: 'A human-readable object describing validation decisions Codat has made. If an operation has failed because of validation errors, they will be detailed here.' + properties: + errors: + type: array + nullable: true + items: + $ref: '#/components/schemas/ErrorMessage/definitions/errorValidationItem' + warnings: + type: array + nullable: true + items: + $ref: '#/components/schemas/ErrorMessage/definitions/errorValidationItem' + errorValidationItem: + title: Validation error item + type: object + properties: + itemId: + type: string + nullable: true + description: Unique identifier for a validation item. + message: + type: string + nullable: true + description: A message outlining validation item's issue. + validatorName: + 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.' + PagingInfo: + type: object + title: Pagination information + x-internal: true + properties: + pageNumber: + type: integer + description: Current page number. + pageSize: + type: integer + description: Number of items to return in results array. + maximum: 2000 + totalResults: + type: integer + description: Total number of items. + _links: + $ref: '#/components/schemas/PagingInfo/definitions/links' + definitions: + links: + title: Hal Links + type: object + required: + - self + - current + properties: + self: + $ref: '#/components/schemas/PagingInfo/definitions/halRef' + current: + $ref: '#/components/schemas/PagingInfo/definitions/halRef' + next: + $ref: '#/components/schemas/PagingInfo/definitions/halRef' + previous: + $ref: '#/components/schemas/PagingInfo/definitions/halRef' + examples: + - self: + href: /companies + current: + href: /companies?page=1&pageSize=10 + halRef: + title: Hypertext reference + type: object + properties: + href: + type: string + format: uri-reference + description: Uri hypertext reference. + required: + - pageNumber + - pageSize + - totalResults + - _links + examples: + - pageNumber: 1 + pageSize: 10 + totalResults: 1 + _links: + self: + 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 + PullOperation: + title: Pull operation + description: |- + Information about a queued, in progress or completed pull operation. + *Formally called `dataset`* + type: object + properties: + id: + type: string + format: uuid + description: Unique identifier of the pull operation. + example: 943accd0-4247-42d8-865b-363c8629e1da + companyId: + type: string + format: uuid + description: Unique identifier of the company associated to this pull operation. + example: 22ece347-e5f6-4896-95e0-35a4c7f17023 + connectionId: + type: string + format: uuid + description: Unique identifier of the connection associated to this pull operation. + example: 50830828-7d39-4367-b0eb-5ddb2de5faa5 + dataType: + title: Data types + x-internal: true + type: string + description: The data type you are requesting in a pull operation. + status: + title: Dataset status + type: string + description: The current status of the dataset. + enum: + - Initial + - Queued + - Fetching + - MapQueued + - Mapping + - Complete + - FetchError + - MapError + - InternalError + - ProcessingQueued + - Processing + - ProcessingError + - ValidationQueued + - Validating + - ValidationError + - AuthError + - Cancelled + - NotSupported + - RateLimitError + - PermissionsError + - PrerequisiteNotMet + statusDescription: + type: string + nullable: true + description: Additional information about the dataset status. + example: 'Paused until 2022-10-23T00:00:00.000Z' + errorMessage: + type: string + 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' + progress: + type: integer + description: An integer signifying the progress of the pull operation. + isCompleted: + type: boolean + description: '`True` if the pull operation is completed successfully. The `isCompleted` property is not queryable. To filter failed pull operations, query by `status!=Complete&&status!=NotSupported` instead.' + isErrored: + type: boolean + description: '`True` if the pull operation entered an error state.' + required: + - id + - companyId + - connectionId + - dataType + - status + - requested + - progress + - isCompleted + - isErrored + examples: + - id: 97d60846-f07a-4d42-b5a0-0bdcc6ebf56b + companyId: 4645bd78-8988-45bc-ac9e-67ba5df6e4e5 + connectionId: 51baa045-4836-4317-a42e-3542e991e581 + dataType: invoices + status: Initial + statusDescription: 'Paused until 2022-10-23T00:00:00.000Z' + requested: '2022-11-14T11:18:37.2798351Z' + progress: 10 + isCompleted: false + isErrored: false + PullOperations: + title: Pull operations + x-internal: true + allOf: + - type: object + properties: + results: + type: array + items: + $ref: '#/components/schemas/PullOperation' + - $ref: '#/components/schemas/PagingInfo' + PushOperation: + title: Push operation + type: object + x-internal: true + properties: + changes: + type: array + nullable: true + description: 'Contains a single entry that communicates which record has changed and the manner in which it changed. ' + items: + $ref: '#/components/schemas/PushOperation/definitions/pushOperationChange' + dataType: + $ref: '#/components/schemas/DataStatus/properties/dataType' + description: 'The type of data being pushed, eg invoices, customers.' + companyId: + $ref: '#/components/parameters/companyId/schema' + pushOperationKey: + type: string + format: uuid + description: 'A unique identifier generated by Codat to represent this single push operation. This identifier can be used to track the status of the push, and should be persisted.' + 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' + description: 'The datetime when the push was completed, null if Pending.' + timeoutInMinutes: + type: integer + format: int32 + nullable: true + description: Number of minutes the push operation must complete within before it times out. + timeoutInSeconds: + type: integer + format: int32 + nullable: true + deprecated: true + description: Number of seconds the push operation must complete within before it times out. + status: + $ref: '#/components/schemas/PushOperation/definitions/pushOperationStatus' + errorMessage: + type: string + nullable: true + description: A message about the error. + validation: + $ref: '#/components/schemas/PushOperation/definitions/validation' + statusCode: + type: integer + description: Push status code. + required: + - companyId + - pushOperationKey + - dataConnectionKey + - requestedOnUtc + - status + - statusCode + definitions: + validation: + type: object + title: Validation + description: 'A human-readable object describing validation decisions Codat has made when pushing data into the platform. If a push has failed because of validation errors, they will be detailed here.' + properties: + errors: + type: array + nullable: true + items: + $ref: '#/components/schemas/PushOperation/definitions/validationItem' + warnings: + type: array + nullable: true + items: + $ref: '#/components/schemas/PushOperation/definitions/validationItem' + validationItem: + title: Validation item + type: object + properties: + itemId: + type: string + nullable: true + description: Unique identifier for a validation item. + message: + type: string + nullable: true + description: A message outlining validation item's issue. + validatorName: + type: string + nullable: true + description: Name of validator. + additionalProperties: false + pushChangeType: + title: Push change type + description: Type of change being applied to record in third party platform. + type: string + enum: + - Unknown + - Created + - Modified + - Deleted + - AttachmentUploaded + pushOperationRef: + title: Push operation reference + x-internal: true + type: object + properties: + id: + type: string + description: Unique identifier for a push operation. + dataType: + $ref: '#/components/schemas/DataStatus/properties/dataType' + nullable: true + additionalProperties: false + pushOperationStatus: + title: Push operation status + type: string + enum: + - Pending + - Failed + - Success + - TimedOut + description: The current status of the push operation. + pushOperationChange: + type: object + properties: + type: + $ref: '#/components/schemas/PushOperation/definitions/pushChangeType' + recordRef: + $ref: '#/components/schemas/PushOperation/definitions/pushOperationRef' + attachmentId: + type: string + description: Unique identifier for the attachment created otherwise null. + nullable: true + PushOperations: + title: Push operations + x-internal: true + allOf: + - type: object + properties: + results: + type: array + 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 " + type: object + 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' + balance: + 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. + page: + name: page + in: query + schema: + type: integer + format: int32 + minimum: 1 + example: 1 + default: 1 + description: 'Page number. [Read more](https://docs.codat.io/using-the-api/paging).' + pageSize: + name: pageSize + in: query + schema: + type: integer + format: int32 + default: 100 + example: 100 + minimum: 1 + maximum: 5000 + description: 'Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging).' + query: + name: query + in: query + required: false + schema: + type: string + example: id=e3334455-1aed-4e71-ab43-6bccf12092ee + description: 'Codat query string. [Read more](https://docs.codat.io/using-the-api/querying).' + orderBy: + name: orderBy + in: query + required: false + schema: + 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 + required: true + schema: + type: string + format: uuid + example: 8a210b68-6988-11ed-a1eb-0242ac120002 + description: Unique identifier for your SMB in Codat. + description: Unique identifier for a company. + connectionId: + name: connectionId + in: path + required: true + schema: + type: string + format: uuid + example: 2e9d2c44-f675-40ba-8049-353bfcb5e171 + description: Unique identifier for a company's data connection. + description: Unique identifier for a connection. + continuationToken: + name: continuationToken + in: query + 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.' + responses: + BadRequest: + description: The request made is not valid. + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorMessage' + examples: + Malformed query: + value: + statusCode: 400 + service: PublicApi + error: Error processing request - not valid. + correlationId: bc997528a9d7abb9161ef45f05d38599 + canBeRetried: Unknown + detailedErrorCode: 0 + Malformed-Query: + description: Your `query` parameter was not correctly formed + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorMessage' + examples: + Malformed query: + value: + statusCode: 400 + service: ClientsApi + error: Error parsing query - Malformed query. + correlationId: bc997528a9d7abb9161ef45f05d38599 + canBeRetried: Unknown + detailedErrorCode: 0 + Unresolved property: + value: + statusCode: 400 + service: PullApi + error: Error parsing query - Could not resolve property isCompleted on Dataset + correlationId: 98457fb9956b7f9b4b2fd4f6e23bb5c8 + canBeRetried: Unknown + detailedErrorCode: 0 + Unauthorized: + description: Your API request was not properly authorized. + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorMessage' + examples: + Unauthorized: + value: + statusCode: 401 + service: PublicApi + error: Unauthorized + correlationId: 7eb40d6b415d7bcd99ce658268284056 + canBeRetried: Unknown + detailedErrorCode: 0 + Payment-Required: + description: | + An account limit has been exceeded. The type of limit is described in the error property: + + - You have exceeded the 50-company limit that applies to a Free plan. Delete any companies you no longer need and retry the request. + - The requested sync schedule is not allowed. You requested an hourly sync schedule but this functionality is not included in the Free plan. + - Your Free account is older than 365 days and has expired. Contact support@codat.io. + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorMessage' + examples: + Conflict: + value: + statusCode: 429 + service: PublicApi + error: You have exceeded the 50-company limit that applies to a Free plan. We recommend that you delete any companies you no longer need and retry the request. + correlationId: bc997528a9d7abb9161ef45f05d38599 + canBeRetried: Unknown + detailedErrorCode: 0 + Forbidden: + description: You are using an outdated API key or a key not associated with that resource. + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorMessage' + examples: + Conflict: + value: + statusCode: 403 + service: PublicApi + error: You are using an outdated API key or a key not associated with that resource. + correlationId: bc997528a9d7abb9161ef45f05d38599 + canBeRetried: Unknown + detailedErrorCode: 0 + Not-Found: + description: |- + One or more of the resources you referenced could not be found. + This might be because your company or data connection id is wrong, or was already deleted. + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorMessage' + examples: + Data connection not found: + value: + statusCode: 404 + service: PublicApi + error: Data connection a22dd66b-564a-4832-9b37-7b3ce4aeb7de not found + correlationId: 8fa2b5f4794970a4ee73758f612e8df0 + canBeRetried: Unknown + detailedErrorCode: 0 + Company not found: + value: + statusCode: 404 + service: ClientsApi + error: No company was found with ID 846ed55c-974b-4392-a1f1-87b6fdbf3c5e + correlationId: 0a40c2f31fc8f992fb88b0853e4166f3 + canBeRetried: Unknown + detailedErrorCode: 0 + No data available: + value: + statusCode: 404 + service: PublicApi + error: No data available for accounts for ID e5889b459f544926ac5b8e6756df2s + correlationId: 0a40c2f31fc8f992fb88b0853e4166f3 + canBeRetried: Unknown + detailedErrorCode: 0 + Conflict: + description: The data type's dataset has not been requested or is still syncing. + 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 + 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: + application/json: + schema: + $ref: '#/components/schemas/ErrorMessage' + examples: + Conflict: + value: + statusCode: 429 + service: PublicApi + error: You have made too many requests in a given amount of time; please retry later. + correlationId: bc997528a9d7abb9161ef45f05d38599 + canBeRetried: Unknown + detailedErrorCode: 0 + Internal-Server-Error: + description: There is a problem with our server. Please try again later. + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorMessage' + examples: + Conflict: + value: + statusCode: 500 + service: PublicApi + error: There is a problem with our server. Please try again later. + correlationId: bc997528a9d7abb9161ef45f05d38599 + canBeRetried: Unknown + detailedErrorCode: 0 + Service-Unavailable: + description: The Codat API is temporarily offline for maintenance. Please try again later. + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorMessage' + examples: + Conflict: + value: + statusCode: 500 + service: PublicApi + error: The Codat API is temporarily offline for maintenance. Please try again later. + correlationId: bc997528a9d7abb9161ef45f05d38599 + canBeRetried: Unknown + detailedErrorCode: 0 + securitySchemes: + auth_header: + name: Authorization + description: 'The word "Basic" followed by a space and your API key. [API keys](https://docs.codat.io/platform-api#/schemas/ApiKeyDetails) are tokens used to control access to the API. You can get an API key via [the Codat Portal](https://app.codat.io/developers/api-keys), via [the API](https://docs.codat.io/platform-api#/operations/list-api-keys), or [read more](https://docs.codat.io/using-the-api/authentication) about authentication at Codat.' + type: apiKey + in: header + x-speakeasy-example: Basic BASE_64_ENCODED(API_KEY) diff --git a/.speakeasy/logs/changes/old.openapi.yaml b/.speakeasy/logs/changes/old.openapi.yaml new file mode 100644 index 000000000..eab0fc225 --- /dev/null +++ b/.speakeasy/logs/changes/old.openapi.yaml @@ -0,0 +1,3485 @@ +openapi: 3.1.0 +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" + version: 3.0.0 + contact: + name: Codat + email: support@codat.io + termsOfService: 'https://www.codat.io/legals/' +security: + - auth_header: [] +x-speakeasy-retries: + strategy: backoff + backoff: + initialInterval: 500 + maxInterval: 60000 + maxElapsedTime: 3600000 + exponent: 1.5 + statusCodes: + - 408 + - 429 + - 5XX + retryConnectionErrors: true +x-speakeasy-name-override: + - operationId: ^list-.*? + methodNameOverride: list + - operationId: ^list-.*?-attachments + methodNameOverride: list-attachments + - operationId: ^get-.*? + methodNameOverride: get + - operationId: ^get-create-.*?-model + methodNameOverride: get-create-model + - operationId: ^get-create-update.*?-model + methodNameOverride: get-create-update-model + - operationId: ^get-.*?-attachment + methodNameOverride: get-attachment + - operationId: ^update-.*? + methodNameOverride: update + - operationId: ^create-.*? + methodNameOverride: create + - operationId: ^delete-.*? + methodNameOverride: delete + - operationId: ^delete-.*?-attachment + methodNameOverride: delete-attachment + - operationId: ^download-.*?-attachment + methodNameOverride: download-attachment + - operationId: ^upload-.*?-attachment + methodNameOverride: upload-attachment +x-codat-docs-path: sync-for-payables-api +x-codat-keep-docs-paths-local: true +x-codat-speakeasy-pagination: + type: offsetLimit + inputs: + - name: page + in: parameters + type: page + outputs: + results: $.results +tags: + - name: Companies + 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. +paths: + /companies: + get: + summary: List companies + tags: + - Companies + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/Companies' + examples: + One company: + value: + results: + - id: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + name: My Test Company + description: My Test Company make testing software + platform: '' + redirect: 'https://link.codat.io/company/3fa85f64-5717-4562-b3fc-2c963f66afa6' + lastSync: '2022-01-01T12:30:00.000Z' + dataConnections: + - id: 51baa045-4836-4317-a42e-3542e991e581 + integrationId: 1c312d69-e638-46d4-ad31-72e6c3ba8390 + integrationKey: vjms + sourceId: 396c3158-5dd7-481b-a7c4-a795ca31792b + platformName: Pandle + linkUrl: 'https://link-api.codat.io/companies/3fa85f64-5717-4562-b3fc-2c963f66afa6/connections/51baa045-4836-4317-a42e-3542e991e581/start' + status: Linked + lastSync: '2022-01-01T12:30:00.000Z' + created: '2022-01-01T11:30:00Z' + sourceType: Accounting + created: '2022-01-01T11:30:00Z' + createdByUserName: Mike Smith + products: + - spend-insights + - lending + - expenses-v1 + - commerce + referenceSubsidiaryCompanies: [] + pageNumber: 1 + pageSize: 100 + totalResults: 1 + _links: + current: + href: /companies?page=1&pageSize=100 + self: + href: /companies + List of Companies: + value: + results: + - id: d1568dde-adf6-11ed-afa1-0242ac120002 + name: Technicalium + description: 'Technology services, including web and app design and development' + platform: '' + redirect: 'https://link.codat.io/company/d1568dde-adf6-11ed-afa1-0242ac120002' + lastSync: '2022-01-01T12:30:00.000Z' + dataConnections: + - id: 51baa045-4836-4317-a42e-3542e991e581 + integrationId: 1c312d69-e638-46d4-ad31-72e6c3ba8390 + integrationKey: vjms + sourceId: 396c3158-5dd7-481b-a7c4-a795ca31792b + platformName: Pandle + linkUrl: 'https://link-api.codat.io/companies/d1568dde-adf6-11ed-afa1-0242ac120002/connections/51baa045-4836-4317-a42e-3542e991e581/start' + status: Linked + lastSync: '2022-01-01T12:30:00.000Z' + created: '2022-01-01T11:30:00Z' + sourceType: Accounting + created: '2022-01-01T11:30:00Z' + createdByUserName: Joe Bloggs + products: + - spend-insights + - lending + - payables-v2 + referenceSubsidiaryCompanies: [] + - id: ab12c58d-a678-4ebf-a159-ae99e1807bd0 + name: Toft stores + redirect: 'https://link.codat.io/company/ab12c58d-a678-4ebf-a159-ae99e1807bd0' + dataConnections: [] + created: '2022-11-10T10:45:18Z' + createdByUserName: Dan Tzabar + products: + - spend-insights + referenceSubsidiaryCompanies: + - id: c8d3af58-7011-47ce-b3f2-89faf300ef6d + name: Toft stores UK + links: + portal: 'https://app.codat.io/companies/c8d3af58-7011-47ce-b3f2-89faf300ef6d/summary' + - id: db94eddc-9212-4568-9b5c-3eab0e325913 + name: Toft stores US + links: + portal: 'https://app.codat.io/companies/db94eddc-9212-4568-9b5c-3eab0e325913/summary' + - id: c8d3af58-7011-47ce-b3f2-89faf300ef6d + name: Toft stores UK + redirect: 'https://link.codat.io/company/c8d3af58-7011-47ce-b3f2-89faf300ef6d' + dataConnections: + - id: d5ab61b7-1ad0-46fd-9f9f-b6761047941e + integrationId: cc750323-5a47-4f28-8d8e-30fbbf2ce137 + integrationKey: akxx + sourceId: 9815b998-024d-4415-a40b-89903b2cad6f + platformName: Oracle NetSuite + linkUrl: 'https://link-api.codat.io/companies/c8d3af58-7011-47ce-b3f2-89faf300ef6d/connections/d5ab61b7-1ad0-46fd-9f9f-b6761047941e/start' + status: Linked + lastSync: '2022-01-01T12:30:00.000Z' + created: '2022-01-01T11:30:00Z' + sourceType: Accounting + created: '2022-11-10T10:45:18Z' + createdByUserName: Dan Tzabar + products: + - lending + - spend-insights + - payables + referenceParentCompany: + id: ab12c58d-a678-4ebf-a159-ae99e1807bd0 + name: Toft stores + links: + portal: 'https://app.codat.io/companies/ab12c58d-a678-4ebf-a159-ae99e1807bd0/summary' + referenceSubsidiaryCompanies: [] + - id: db94eddc-9212-4568-9b5c-3eab0e325913 + name: Toft stores US + redirect: 'https://link.codat.io/company/db94eddc-9212-4568-9b5c-3eab0e325913' + dataConnections: + - id: 1e5c8c9e-27fd-4ba9-9a2a-d02ba65bc2fb + integrationId: cc750323-5a47-4f28-8d8e-30fbbf2ce137 + integrationKey: akxx + sourceId: 9815b998-024d-4415-a40b-89903b2cad6f + platformName: Oracle NetSuite + linkUrl: 'https://link-api.codat.io/companies/db94eddc-9212-4568-9b5c-3eab0e325913/connections/1e5c8c9e-27fd-4ba9-9a2a-d02ba65bc2fb/start' + status: Linked + lastSync: '2022-01-01T12:30:00.000Z' + created: '2022-01-01T11:30:00Z' + sourceType: Accounting + created: '2022-11-10T10:45:18Z' + createdByUserName: Dan Tzabar + products: + - spend-insights + referenceParentCompany: + id: ab12c58d-a678-4ebf-a159-ae99e1807bd0 + name: Toft stores + links: + portal: 'https://app.codat.io/companies/ab12c58d-a678-4ebf-a159-ae99e1807bd0/summary' + referenceSubsidiaryCompanies: [] + pageNumber: 1 + pageSize: 100 + totalResults: 3 + _links: + current: + href: /companies?page=1&pageSize=100 + self: + href: /companies + '400': + $ref: '#/components/responses/Malformed-Query' + '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' + 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" + parameters: + - $ref: '#/components/parameters/page' + - $ref: '#/components/parameters/pageSize' + - $ref: '#/components/parameters/query' + - $ref: '#/components/parameters/orderBy' + - name: tags + in: query + schema: + type: string + example: region=uk && team=invoice-finance + description: 'Filter companies by tags using the "equals" (=), "not equals" (!=), and "contains" (~) operators with [Codat’s query language](https://docs.codat.io/using-the-api/querying).' + post: + summary: Create company + tags: + - Companies + operationId: create-company + responses: + '200': + description: OK + content: + application/json: + x-speakeasy-usage-example: true + schema: + $ref: '#/components/schemas/Company' + examples: + With no description: + value: + id: ab12c58d-a678-4ebf-a159-ae99e1807bd0 + name: Technicalium + description: '' + platform: '' + redirect: 'https://link.codat.io/company/ab12c58d-a678-4ebf-a159-ae99e1807bd0' + dataConnections: [] + created: '2022-11-10T10:45:18.1950523Z' + createdByUserName: Dan Tzabar + products: + - spend-insights + referenceSubsidiaryCompanies: [] + With a description: + value: + id: ab12c58d-a678-4ebf-a159-ae99e1807bd0 + name: Technicalium + description: 'Technology services, including web and app design and development' + platform: '' + redirect: 'https://link.codat.io/company/ab12c58d-a678-4ebf-a159-ae99e1807bd0' + dataConnections: [] + created: '2022-11-10T10:45:18.1950523Z' + createdByUserName: Dan Tzabar + products: + - spend-insights + referenceSubsidiaryCompanies: [] + With a tag: + value: + id: ab12c58d-a678-4ebf-a159-ae99e1807bd0 + name: Technicalium + description: '' + platform: '' + redirect: 'https://link.codat.io/company/ab12c58d-a678-4ebf-a159-ae99e1807bd0' + dataConnections: [] + created: '2022-11-10T10:45:18.1950523Z' + createdByUserName: Dan Tzabar + products: + - spend-insights + tags: + region: us + referenceSubsidiaryCompanies: [] + '400': + $ref: '#/components/responses/BadRequest' + '401': + $ref: '#/components/responses/Unauthorized' + '402': + $ref: '#/components/responses/Payment-Required' + '403': + $ref: '#/components/responses/Forbidden' + '429': + $ref: '#/components/responses/Too-Many-Requests' + '500': + $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" + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/CompanyRequestBody' + examples: + With no description: + value: + name: Technicalium + With a description: + value: + name: Technicalium + description: 'Technology services, including web and app design and development' + '/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" + operationId: replace-company + x-speakeasy-name-override: replace + parameters: + - $ref: '#/components/parameters/companyId' + tags: + - Companies + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/Company' + '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' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/CompanyRequestBody' + examples: + Update name: + value: + name: New Name + Update description: + value: + name: Same name + 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" + operationId: update-company + parameters: + - $ref: '#/components/parameters/companyId' + tags: + - Companies + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/Company' + '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' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/CompanyUpdateRequest' + examples: + Update tags: + value: + tags: + refrence: new reference + Update name: + value: + name: New Name + delete: + summary: Delete a company + 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" + tags: + - Companies + responses: + '204': + description: No Content + '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: 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" + parameters: + - $ref: '#/components/parameters/companyId' + tags: + - Companies + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/Company' + examples: + Simple company: + value: + id: ab12c58d-a678-4ebf-a159-ae99e1807bd0 + name: Toft stores holdings + description: '' + platform: '' + redirect: 'https://link.codat.io/company/ab12c58d-a678-4ebf-a159-ae99e1807bd0' + dataConnections: [] + created: '2022-11-10T10:45:18Z' + createdByUserName: Dan Tzabar + products: + - spend-insights + - lending + - expenses-v1 + - commerce + referenceSubsidiaryCompanies: [] + Parent multi-entity company: + value: + id: ab12c58d-a678-4ebf-a159-ae99e1807bd0 + name: Toft stores + description: '' + platform: '' + redirect: 'https://link.codat.io/company/ab12c58d-a678-4ebf-a159-ae99e1807bd0' + dataConnections: [] + created: '2022-11-10T10:45:18Z' + createdByUserName: Dan Tzabar + products: + - spend-insights + - lending + - expenses-v1 + - commerce + referenceSubsidiaryCompanies: + - id: c8d3af58-7011-47ce-b3f2-89faf300ef6d + name: Toft stores UK + links: + portal: 'https://app.codat.io/companies/c8d3af58-7011-47ce-b3f2-89faf300ef6d/summary' + - id: db94eddc-9212-4568-9b5c-3eab0e325913 + name: Toft stores US + links: + portal: 'https://app.codat.io/companies/db94eddc-9212-4568-9b5c-3eab0e325913/summary' + Subsidiary multi-entity company: + value: + id: c8d3af58-7011-47ce-b3f2-89faf300ef6d + name: Toft stores UK + description: '' + platform: '' + redirect: 'https://link.codat.io/company/c8d3af58-7011-47ce-b3f2-89faf300ef6d' + dataConnections: + - id: d5ab61b7-1ad0-46fd-9f9f-b6761047941e + integrationId: cc750323-5a47-4f28-8d8e-30fbbf2ce137 + integrationKey: akxx + sourceId: 9815b998-024d-4415-a40b-89903b2cad6f + platformName: Oracle NetSuite + linkUrl: 'https://link-api.codat.io/companies/c8d3af58-7011-47ce-b3f2-89faf300ef6d/connections/d5ab61b7-1ad0-46fd-9f9f-b6761047941e/start' + status: Linked + lastSync: '2022-01-01T12:30:00.000Z' + created: '2022-01-01T11:30:00Z' + sourceType: Accounting + created: '2022-11-10T10:45:18Z' + createdByUserName: Dan Tzabar + products: + - spend-insights + - lending + - expenses-v1 + - commerce + referenceParentCompany: + id: ab12c58d-a678-4ebf-a159-ae99e1807bd0 + name: Toft stores + links: + portal: 'https://app.codat.io/companies/ab12c58d-a678-4ebf-a159-ae99e1807bd0/summary' + referenceSubsidiaryCompanies: [] + '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': + get: + summary: List connections + description: "\uFEFF\x4C\x69\x73\x74\x20\x74\x68\x65\x20\x63\x6F\x6E\x6E\x65\x63\x74\x69\x6F\x6E\x73\x20\x66\x6F\x72\x20\x61\x20\x63\x6F\x6D\x70\x61\x6E\x79\x2E" + operationId: list-connections + tags: + - Connections + parameters: + - $ref: '#/components/parameters/companyId' + - $ref: '#/components/parameters/page' + - $ref: '#/components/parameters/pageSize' + - $ref: '#/components/parameters/query' + - $ref: '#/components/parameters/orderBy' + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/Connections' + examples: + Connections: + value: + results: + - id: ee2eb431-c0fa-4dc9-93fa-d29781c12bcd + integrationId: bf083d72-62c7-493e-aec9-81b4dbba7e2c + integrationKey: dfxm + sourceId: bdd831ce-eebd-4896-89a7-20e5ee8989ee + 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' + sourceType: Banking + pageNumber: 0 + pageSize: 0 + totalResults: 0 + _links: + self: + href: string + current: + href: string + next: + href: string + previous: + href: string + '400': + $ref: '#/components/responses/Malformed-Query' + '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' + post: + summary: Create connection + description: "\uFEFF\x43\x72\x65\x61\x74\x65\x73\x20\x61\x20\x63\x6F\x6E\x6E\x65\x63\x74\x69\x6F\x6E\x20\x66\x6F\x72\x20\x74\x68\x65\x20\x63\x6F\x6D\x70\x61\x6E\x79\x20\x62\x79\x20\x70\x72\x6F\x76\x69\x64\x69\x6E\x67\x20\x61\x20\x76\x61\x6C\x69\x64\x20\x60\x70\x6C\x61\x74\x66\x6F\x72\x6D\x4B\x65\x79\x60\x2E\x20\n\n\x55\x73\x65\x20\x74\x68\x65\x20\x5B\x4C\x69\x73\x74\x20\x49\x6E\x74\x65\x67\x72\x61\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\x70\x6C\x61\x74\x66\x6F\x72\x6D\x2D\x61\x70\x69\x23\x2F\x6F\x70\x65\x72\x61\x74\x69\x6F\x6E\x73\x2F\x6C\x69\x73\x74\x2D\x69\x6E\x74\x65\x67\x72\x61\x74\x69\x6F\x6E\x73\x29\x20\x65\x6E\x64\x70\x6F\x69\x6E\x74\x20\x74\x6F\x20\x61\x63\x63\x65\x73\x73\x20\x76\x61\x6C\x69\x64\x20\x70\x6C\x61\x74\x66\x6F\x72\x6D\x20\x6B\x65\x79\x73\x2E\x20" + parameters: + - $ref: '#/components/parameters/companyId' + tags: + - Connections + operationId: create-connection + requestBody: + content: + application/json: + schema: + type: object + properties: + platformKey: + type: string + minLength: 4 + maxLength: 4 + pattern: '[a-z]{4}' + example: gbol + description: 'A unique 4-letter key to represent a platform in each integration. View [accounting](https://docs.codat.io/integrations/accounting/overview#platform-keys), [banking](https://docs.codat.io/integrations/banking/overview#platform-keys), and [commerce](https://docs.codat.io/integrations/commerce/overview#platform-keys) platform keys.' + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/Connection' + examples: + Connection: + value: + id: ee2eb431-c0fa-4dc9-93fa-d29781c12bcd + integrationId: bf083d72-62c7-493e-aec9-81b4dbba7e2c + integrationKey: dfxm + sourceId: bdd831ce-eebd-4896-89a7-20e5ee8989ee + 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' + sourceType: Banking + '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}': + get: + summary: Get connection + operationId: get-connection + description: "\uFEFF\x52\x65\x74\x75\x72\x6E\x73\x20\x61\x20\x73\x70\x65\x63\x69\x66\x69\x63\x20\x63\x6F\x6E\x6E\x65\x63\x74\x69\x6F\x6E\x20\x66\x6F\x72\x20\x61\x20\x63\x6F\x6D\x70\x61\x6E\x79\x20\x77\x68\x65\x6E\x20\x76\x61\x6C\x69\x64\x20\x69\x64\x65\x6E\x74\x69\x66\x69\x65\x72\x73\x20\x61\x72\x65\x20\x70\x72\x6F\x76\x69\x64\x65\x64\x2E\x20\x49\x66\x20\x74\x68\x65\x20\x69\x64\x65\x6E\x74\x69\x66\x69\x65\x72\x73\x20\x61\x72\x65\x20\x66\x6F\x72\x20\x61\x20\x64\x65\x6C\x65\x74\x65\x64\x20\x63\x6F\x6D\x70\x61\x6E\x79\x20\x61\x6E\x64\x2F\x6F\x72\x20\x63\x6F\x6E\x6E\x65\x63\x74\x69\x6F\x6E\x2C\x20\x61\x20\x6E\x6F\x74\x20\x66\x6F\x75\x6E\x64\x20\x72\x65\x73\x70\x6F\x6E\x73\x65\x20\x69\x73\x20\x72\x65\x74\x75\x72\x6E\x65\x64\x2E" + tags: + - Connections + parameters: + - $ref: '#/components/parameters/companyId' + - $ref: '#/components/parameters/connectionId' + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/Connection' + examples: + Connection: + value: + id: ee2eb431-c0fa-4dc9-93fa-d29781c12bcd + integrationId: bf083d72-62c7-493e-aec9-81b4dbba7e2c + integrationKey: dfxm + sourceId: bdd831ce-eebd-4896-89a7-20e5ee8989ee + 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' + sourceType: Banking + '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' + delete: + summary: Delete connection + operationId: delete-connection + description: "\uFEFF\x52\x65\x76\x6F\x6B\x65\x20\x61\x6E\x64\x20\x72\x65\x6D\x6F\x76\x65\x20\x61\x20\x63\x6F\x6E\x6E\x65\x63\x74\x69\x6F\x6E\x20\x66\x72\x6F\x6D\x20\x61\x20\x63\x6F\x6D\x70\x61\x6E\x79\x2E\n\x54\x68\x69\x73\x20\x6F\x70\x65\x72\x61\x74\x69\x6F\x6E\x20\x69\x73\x20\x6E\x6F\x74\x20\x72\x65\x76\x65\x72\x73\x69\x62\x6C\x65\x2E\x20\x54\x68\x65\x20\x65\x6E\x64\x20\x75\x73\x65\x72\x20\x77\x6F\x75\x6C\x64\x20\x6E\x65\x65\x64\x20\x74\x6F\x20\x72\x65\x61\x75\x74\x68\x6F\x72\x69\x7A\x65\x20\x61\x20\x6E\x65\x77\x20\x64\x61\x74\x61\x20\x63\x6F\x6E\x6E\x65\x63\x74\x69\x6F\x6E\x20\x69\x66\x20\x79\x6F\x75\x20\x77\x69\x73\x68\x20\x74\x6F\x20\x76\x69\x65\x77\x20\x6E\x65\x77\x20\x64\x61\x74\x61\x20\x66\x6F\x72\x20\x74\x68\x69\x73\x20\x63\x6F\x6D\x70\x61\x6E\x79\x2E" + parameters: + - $ref: '#/components/parameters/companyId' + - $ref: '#/components/parameters/connectionId' + tags: + - Connections + responses: + '200': + description: OK + '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' + patch: + summary: Unlink connection + description: "\uFEFF\x54\x68\x69\x73\x20\x61\x6C\x6C\x6F\x77\x73\x20\x79\x6F\x75\x20\x74\x6F\x20\x64\x65\x61\x75\x74\x68\x6F\x72\x69\x7A\x65\x20\x61\x20\x63\x6F\x6E\x6E\x65\x63\x74\x69\x6F\x6E\x2C\x20\x77\x69\x74\x68\x6F\x75\x74\x20\x64\x65\x6C\x65\x74\x69\x6E\x67\x20\x69\x74\x20\x66\x72\x6F\x6D\x20\x43\x6F\x64\x61\x74\x2E\x20\x54\x68\x69\x73\x20\x6D\x65\x61\x6E\x73\x20\x79\x6F\x75\x20\x63\x61\x6E\x20\x73\x74\x69\x6C\x6C\x20\x76\x69\x65\x77\x20\x61\x6E\x79\x20\x64\x61\x74\x61\x20\x74\x68\x61\x74\x20\x68\x61\x73\x20\x70\x72\x65\x76\x69\x6F\x75\x73\x6C\x79\x20\x62\x65\x65\x6E\x20\x70\x75\x6C\x6C\x65\x64\x20\x69\x6E\x74\x6F\x20\x43\x6F\x64\x61\x74\x2C\x20\x61\x6E\x64\x20\x61\x6C\x73\x6F\x20\x6C\x65\x74\x73\x20\x79\x6F\x75\x20\x72\x65\x2D\x61\x75\x74\x68\x6F\x72\x69\x7A\x65\x20\x69\x6E\x20\x66\x75\x74\x75\x72\x65\x20\x69\x66\x20\x79\x6F\x75\x72\x20\x63\x75\x73\x74\x6F\x6D\x65\x72\x20\x77\x69\x73\x68\x65\x73\x20\x74\x6F\x20\x72\x65\x73\x75\x6D\x65\x20\x73\x68\x61\x72\x69\x6E\x67\x20\x74\x68\x65\x69\x72\x20\x64\x61\x74\x61\x2E" + operationId: unlink-connection + x-speakeasy-name-override: unlink + tags: + - Connections + parameters: + - $ref: '#/components/parameters/companyId' + - $ref: '#/components/parameters/connectionId' + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/Connection' + '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' + requestBody: + content: + application/json: + schema: + title: Update connection + x-internal: true + type: object + properties: + status: + $ref: '#/components/schemas/Connection/definitions/dataConnectionStatus' + description: The current authorization status of the data connection. + nullable: true + additionalProperties: false + examples: + Example: + 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' + '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/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== + '400': + $ref: '#/components/responses/Malformed-Query' + '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/Conflict' + '429': + $ref: '#/components/responses/Too-Many-Requests' + '500': + $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 + responses: + '200': + description: Success + 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' + '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/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/{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 + responses: + '200': + description: Success + content: + application/octet-stream: + schema: + title: Data + type: string + format: binary + '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/{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).' + responses: + '200': + description: Success + 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== + '400': + $ref: '#/components/responses/Malformed-Query' + '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/Conflict' + '429': + $ref: '#/components/responses/Too-Many-Requests' + '500': + $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 + '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/bankAccounts': + parameters: + - $ref: '#/components/parameters/companyId' + - $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 + requestBody: + 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' + examples: {} + '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' + 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: + client.rateLimit.reached: + post: + description: Called when your client’s request count to Codat's API surpasses the allocated quota. + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ClientRateLimitWebhook' + examples: + Reached: + value: + id: 743ec94a-8aa4-44bb-8bd4-e1855ee0e74b + eventType: client.rateLimit.reached + generatedDate: '2024-09-01T00:00:00Z' + payload: + dailyQuota: 12000 + quotaRemaining: 0 + expiryDate: '2024-09-01T12:14:14Z' + responses: + '200': + description: Return a 200 status to indicate that the webhook was received successfully. + client.rateLimit.reset: + post: + description: 'Called when your client''s rate limit quota is reset, allowing additional requests to Codat''s API.' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ClientRateLimitWebhook' + examples: + Reset: + value: + id: 743ec94a-8aa4-44bb-8bd4-e1855ee0e74b + eventType: client.rateLimit.reset + generatedDate: '2024-09-01T00:00:00Z' + payload: + dailyQuota: 12000 + quotaRemaining: 11993 + expiryDate: '2024-09-01T23:59:99Z' + responses: + '200': + description: Return a 200 status to indicate that the webhook was received successfully. +components: + schemas: + Address: + title: Address + x-internal: true + type: object + properties: + type: + $ref: '#/components/schemas/Address/definitions/addressType' + line1: + type: string + nullable: true + description: Line 1 of the customer address. + line2: + type: string + nullable: true + description: Line 2 of the customer address. + city: + type: string + nullable: true + description: City of the customer address. + region: + type: string + nullable: true + description: Region of the customer address. + 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.' + postalCode: + type: string + nullable: true + description: Postal code or zip code. + definitions: + addressType: + description: The type of the address + type: string + enum: + - 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: + id: + type: string + description: 'Identifier for the attachment, unique for the company in the accounting software.' + name: + type: string + nullable: true + description: Name of the attachment file. + 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' + fileSize: + type: integer + format: int32 + nullable: true + description: 'File size in bytes. For example, if this reads **46153**, then the file size is 46kb.' + 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 + type: object + allOf: + - 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 + 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: + title: Bank Account Type + x-internal: true + enum: + - Unknown + - Credit + - 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`. + type: string + enum: + - Unknown + - Open + - PartiallyPaid + - Paid + - Void + - Draft + example: Open + billLineItem: + title: Bill line item + type: object + properties: + description: + type: string + nullable: true + description: Friendly name of the goods or services received. + unitAmount: + type: number + format: decimal + description: Unit price of the goods or service. + 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' + totalAmount: + type: number + 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. + type: object + 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 + ClientRateLimitWebhook: + title: Client rate limit webhook + type: object + properties: + id: + type: string + format: uuid + example: 743ec94a-8aa4-44bb-8bd4-e1855ee0e74b + description: Unique identifier of the event. + eventType: + type: string + description: The type of event. + examples: + - client.rateLimit.reset + - client.rateLimit.reached + generatedDate: + $ref: '#/components/schemas/Connection/properties/created' + description: The date time in UTC the event was generated in Codat. + payload: + $ref: '#/components/schemas/ClientRateLimitWebhook/definitions/clientRateLimitWebhookPayload' + definitions: + clientRateLimitWebhookPayload: + title: Client rate limit webhook payload + type: object + properties: + dailyQuota: + type: integer + description: The number of available requests per day. + quotaRemaining: + 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. + Companies: + title: Companies + x-internal: true + allOf: + - type: object + properties: + results: + type: array + items: + $ref: '#/components/schemas/Company' + - $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" + type: object + allOf: + - $ref: '#/components/schemas/Company/definitions/companyDetails' + - type: object + properties: + dataConnections: + type: array + items: + $ref: '#/components/schemas/Connection' + definitions: + companyDetails: + title: Company details + type: object + properties: + id: + $ref: '#/components/parameters/companyId/schema' + name: + type: string + description: The name of the company + example: Codat Ltd. + description: + $ref: '#/components/schemas/CompanyRequestBody/properties/description' + nullable: true + redirect: + type: string + format: uri + 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' + createdByUserName: + type: string + description: Name of user that created the company in Codat. + nullable: true + products: + type: array + items: + type: string + description: An array of products that are currently enabled for the company. + tags: + title: Tags + type: object + maxProperties: 10 + propertyNames: + pattern: '^.{1,27}$' + additionalProperties: + type: string + maxLength: 100 + description: A collection of user-defined key-value pairs that store custom metadata against the company. + referenceParentCompany: + $ref: '#/components/schemas/Company/definitions/companyReference' + nullable: true + description: The parent entity or controlling organization of this company. Null if the company has no parent. + referenceSubsidiaryCompanies: + type: array + nullable: false + description: A list of subsidiary companies owned or controlled by this entity. Empty if the company has no children. + minItems: 0 + items: + $ref: '#/components/schemas/Company/definitions/companyReference' + required: + - id + - name + - redirect + companyReference: + title: Company reference + type: object + properties: + id: + $ref: '#/components/parameters/companyId/schema' + name: + $ref: '#/components/schemas/Company/definitions/companyDetails/properties/name' + description: + $ref: '#/components/schemas/Company/definitions/companyDetails/properties/description' + links: + type: object + description: A collection of links for the company. + properties: + portal: + type: string + format: uri + description: Link to the company page in the portal. + tags: + $ref: '#/components/schemas/Company/definitions/companyDetails/properties/tags' + examples: + - 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 + 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 + 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' + sourceType: Banking + 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 + type: object + properties: + name: + type: string + description: Name of company being connected. + pattern: '^[A-Za-z0-9\s\-'',&@.,?!\s]+$' + minLength: 1 + example: Bank of Dave + description: + type: string + example: Requested early access to the new financing scheme. + description: 'Additional information about the company. This can be used to store foreign IDs, references, etc.' + tags: + $ref: '#/components/schemas/Company/definitions/companyDetails/properties/tags' + required: + - name + CompanyUpdateRequest: + title: Update company request + x-internal: true + type: object + properties: + name: + type: string + description: Name of company being connected. + pattern: '^[A-Za-z0-9\s\-'',&@.,?!\s]+$' + minLength: 1 + example: Bank of Dave + description: + $ref: '#/components/schemas/CompanyRequestBody/properties/description' + tags: + $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" + type: object + properties: + id: + $ref: '#/components/parameters/connectionId/schema' + integrationId: + type: string + format: uuid + example: fd321cb6-7963-4506-b873-e99593a45e30 + description: A Codat ID representing the integration. + integrationKey: + type: string + description: A unique four-character ID that identifies the platform of the company's data connection. This ensures continuity if the platform changes its name in the future. + sourceId: + type: string + format: uuid + example: 35b92968-9851-4095-ad60-395c95cbcba4 + description: 'A source-specific ID used to distinguish between different sources originating from the same data connection. In general, a data connection is a single data source. However, for TrueLayer, `sourceId` is associated with a specific bank and has a many-to-one relationship with the `integrationId`.' + sourceType: + title: Source Type + description: The type of platform of the connection. + type: string + enum: + - Accounting + - Banking + - BankFeed + - Commerce + - Expense + - Other + - Unknown + example: Accounting + platformName: + type: string + description: Name of integration connected to company. + linkUrl: + type: string + format: uri + description: The link URL your customers can use to authorize access to their business application. + example: 'https://link-api.codat.io/companies/86bd88cb-44ab-4dfb-b32f-87b19b14287f/connections/2e2eb431-c1fa-4dc9-93fa-d29781c12bcd/start' + 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." + dataConnectionErrors: + type: array + nullable: true + items: + $ref: '#/components/schemas/Connection/definitions/dataConnectionError' + connectionInfo: + type: object + nullable: true + additionalProperties: true + additionalProperties: false + required: + - id + - integrationId + - integrationKey + - sourceId + - platformName + - linkUrl + - status + - created + - sourceType + definitions: + dataConnectionStatus: + title: Data connection status + description: The current authorization status of the data connection. + type: string + enum: + - PendingAuth + - Linked + - Unlinked + - Deauthorized + dataConnectionError: + title: Data connection error + type: object + properties: + statusCode: + type: string + description: The HTTP status code returned by the source platform when the error occurred. + statusText: + type: string + description: A non-numeric status code/text returned by the source platform when the error occurred. + errorMessage: + type: string + description: A message about a error returned by Codat. + erroredOnUtc: + $ref: '#/components/schemas/Connection/properties/created' + status: + title: Error status + description: The current status of a transient error. Null statuses indicate that the error is not transient. + type: string + nullable: true + enum: + - Active + - Resolved + resolvedOnUtc: + description: The datetime in Utc that the error was resolved. + nullable: true + $ref: '#/components/schemas/Connection/properties/created' + dataConnectionSourceType: + title: Source Type + description: The type of platform of the connection. + type: string + enum: + - Accounting + - Banking + - BankFeed + - Commerce + - Expense + - Other + - Unknown + example: Accounting + example: + id: ee2eb431-c0fa-4dc9-93fa-d29781c12bcd + integrationId: bf083d72-62c7-493e-aec9-81b4dbba7e2c + integrationKey: dfxm + sourceId: bdd831ce-eebd-4896-89a7-20e5ee8989ee + 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' + sourceType: Banking + Connections: + title: Connections + x-internal: true + allOf: + - type: object + properties: + results: + type: array + items: + $ref: '#/components/schemas/Connection' + - $ref: '#/components/schemas/PagingInfo' + DataStatus: + title: Data status + description: Describes the state of data in the Codat cache for a company and data type + type: object + required: + - dataType + - currentStatus + properties: + dataType: + title: Data types + x-internal: true + type: string + description: Available data types + enum: + - accountTransactions + - balanceSheet + - bankAccounts + - bankTransactions + - billCreditNotes + - billPayments + - bills + - cashFlowStatement + - chartOfAccounts + - company + - creditNotes + - customers + - directCosts + - directIncomes + - invoices + - itemReceipts + - items + - journalEntries + - journals + - paymentMethods + - payments + - profitAndLoss + - purchaseOrders + - salesOrders + - suppliers + - taxRates + - trackingCategories + - transfers + - banking-accountBalances + - banking-accounts + - banking-transactionCategories + - banking-transactions + - commerce-companyInfo + - commerce-customers + - commerce-disputes + - commerce-locations + - commerce-orders + - commerce-paymentMethods + - commerce-payments + - commerce-productCategories + - commerce-products + - commerce-taxComponents + - commerce-transactions + example: invoices + lastSuccessfulSync: + $ref: '#/components/schemas/Connection/properties/created' + currentStatus: + $ref: '#/components/schemas/PullOperation/properties/status' + latestSyncId: + type: string + description: Unique identifier for most recent sync of data type. + format: uuid + example: ad474a37-2003-478e-baee-9af9f1ec2fe3 + latestSuccessfulSyncId: + type: string + description: Unique identifier for the most recent successful sync of data type. + format: uuid + example: 8220fc90-55b6-47bc-9417-48ac6ea93101 + examples: + - dataType: string + lastSuccessfulSync: '2022-01-01T13:00:00.000Z' + currentStatus: string + latestSyncId: ad474a37-2003-478e-baee-9af9f1ec2fe3 + latestSuccessfulSyncId: 8220fc90-55b6-47bc-9417-48ac6ea93101 + DataType: + x-internal: true + $ref: '#/components/schemas/DataStatus/properties/dataType' + ErrorMessage: + title: Error message + type: object + x-internal: true + properties: + statusCode: + type: integer + description: The HTTP status code returned by the error. + service: + type: string + description: Codat's service the returned the error. + error: + type: string + description: A brief description of the error. + correlationId: + type: string + description: Unique identifier used to propagate to all downstream services and determine the source of the error. + validation: + $ref: '#/components/schemas/ErrorMessage/definitions/errorValidation' + canBeRetried: + type: string + description: '`True` if the error occurred transiently and can be retried.' + detailedErrorCode: + type: integer + description: Machine readable error code used to automate processes based on the code returned. + definitions: + errorValidation: + title: Validation error + type: object + nullable: true + description: 'A human-readable object describing validation decisions Codat has made. If an operation has failed because of validation errors, they will be detailed here.' + properties: + errors: + type: array + nullable: true + items: + $ref: '#/components/schemas/ErrorMessage/definitions/errorValidationItem' + warnings: + type: array + nullable: true + items: + $ref: '#/components/schemas/ErrorMessage/definitions/errorValidationItem' + errorValidationItem: + title: Validation error item + type: object + properties: + itemId: + type: string + nullable: true + description: Unique identifier for a validation item. + message: + type: string + nullable: true + description: A message outlining validation item's issue. + validatorName: + 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.' + PagingInfo: + type: object + title: Pagination information + x-internal: true + properties: + pageNumber: + type: integer + description: Current page number. + pageSize: + type: integer + description: Number of items to return in results array. + maximum: 2000 + totalResults: + type: integer + description: Total number of items. + _links: + $ref: '#/components/schemas/PagingInfo/definitions/links' + definitions: + links: + title: Hal Links + type: object + required: + - self + - current + properties: + self: + $ref: '#/components/schemas/PagingInfo/definitions/halRef' + current: + $ref: '#/components/schemas/PagingInfo/definitions/halRef' + next: + $ref: '#/components/schemas/PagingInfo/definitions/halRef' + previous: + $ref: '#/components/schemas/PagingInfo/definitions/halRef' + examples: + - self: + href: /companies + current: + href: /companies?page=1&pageSize=10 + halRef: + title: Hypertext reference + type: object + properties: + href: + type: string + format: uri-reference + description: Uri hypertext reference. + required: + - pageNumber + - pageSize + - totalResults + - _links + examples: + - pageNumber: 1 + pageSize: 10 + totalResults: 1 + _links: + self: + 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 + PullOperation: + title: Pull operation + description: |- + Information about a queued, in progress or completed pull operation. + *Formally called `dataset`* + type: object + properties: + id: + type: string + format: uuid + description: Unique identifier of the pull operation. + example: 943accd0-4247-42d8-865b-363c8629e1da + companyId: + type: string + format: uuid + description: Unique identifier of the company associated to this pull operation. + example: 22ece347-e5f6-4896-95e0-35a4c7f17023 + connectionId: + type: string + format: uuid + description: Unique identifier of the connection associated to this pull operation. + example: 50830828-7d39-4367-b0eb-5ddb2de5faa5 + dataType: + title: Data types + x-internal: true + type: string + description: The data type you are requesting in a pull operation. + status: + title: Dataset status + type: string + description: The current status of the dataset. + enum: + - Initial + - Queued + - Fetching + - MapQueued + - Mapping + - Complete + - FetchError + - MapError + - InternalError + - ProcessingQueued + - Processing + - ProcessingError + - ValidationQueued + - Validating + - ValidationError + - AuthError + - Cancelled + - NotSupported + - RateLimitError + - PermissionsError + - PrerequisiteNotMet + statusDescription: + type: string + nullable: true + description: Additional information about the dataset status. + example: 'Paused until 2022-10-23T00:00:00.000Z' + errorMessage: + type: string + 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' + progress: + type: integer + description: An integer signifying the progress of the pull operation. + isCompleted: + type: boolean + description: '`True` if the pull operation is completed successfully. The `isCompleted` property is not queryable. To filter failed pull operations, query by `status!=Complete&&status!=NotSupported` instead.' + isErrored: + type: boolean + description: '`True` if the pull operation entered an error state.' + required: + - id + - companyId + - connectionId + - dataType + - status + - requested + - progress + - isCompleted + - isErrored + examples: + - id: 97d60846-f07a-4d42-b5a0-0bdcc6ebf56b + companyId: 4645bd78-8988-45bc-ac9e-67ba5df6e4e5 + connectionId: 51baa045-4836-4317-a42e-3542e991e581 + dataType: invoices + status: Initial + statusDescription: 'Paused until 2022-10-23T00:00:00.000Z' + requested: '2022-11-14T11:18:37.2798351Z' + progress: 10 + isCompleted: false + isErrored: false + PullOperations: + title: Pull operations + x-internal: true + allOf: + - type: object + properties: + results: + type: array + items: + $ref: '#/components/schemas/PullOperation' + - $ref: '#/components/schemas/PagingInfo' + PushOperation: + title: Push operation + type: object + x-internal: true + properties: + changes: + type: array + nullable: true + description: 'Contains a single entry that communicates which record has changed and the manner in which it changed. ' + items: + $ref: '#/components/schemas/PushOperation/definitions/pushOperationChange' + dataType: + $ref: '#/components/schemas/DataStatus/properties/dataType' + description: 'The type of data being pushed, eg invoices, customers.' + companyId: + $ref: '#/components/parameters/companyId/schema' + pushOperationKey: + type: string + format: uuid + description: 'A unique identifier generated by Codat to represent this single push operation. This identifier can be used to track the status of the push, and should be persisted.' + 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' + description: 'The datetime when the push was completed, null if Pending.' + timeoutInMinutes: + type: integer + format: int32 + nullable: true + description: Number of minutes the push operation must complete within before it times out. + timeoutInSeconds: + type: integer + format: int32 + nullable: true + deprecated: true + description: Number of seconds the push operation must complete within before it times out. + status: + $ref: '#/components/schemas/PushOperation/definitions/pushOperationStatus' + errorMessage: + type: string + nullable: true + description: A message about the error. + validation: + $ref: '#/components/schemas/PushOperation/definitions/validation' + statusCode: + type: integer + description: Push status code. + required: + - companyId + - pushOperationKey + - dataConnectionKey + - requestedOnUtc + - status + - statusCode + definitions: + validation: + type: object + title: Validation + description: 'A human-readable object describing validation decisions Codat has made when pushing data into the platform. If a push has failed because of validation errors, they will be detailed here.' + properties: + errors: + type: array + nullable: true + items: + $ref: '#/components/schemas/PushOperation/definitions/validationItem' + warnings: + type: array + nullable: true + items: + $ref: '#/components/schemas/PushOperation/definitions/validationItem' + validationItem: + title: Validation item + type: object + properties: + itemId: + type: string + nullable: true + description: Unique identifier for a validation item. + message: + type: string + nullable: true + description: A message outlining validation item's issue. + validatorName: + type: string + nullable: true + description: Name of validator. + additionalProperties: false + pushChangeType: + title: Push change type + description: Type of change being applied to record in third party platform. + type: string + enum: + - Unknown + - Created + - Modified + - Deleted + - AttachmentUploaded + pushOperationRef: + title: Push operation reference + x-internal: true + type: object + properties: + id: + type: string + description: Unique identifier for a push operation. + dataType: + $ref: '#/components/schemas/DataStatus/properties/dataType' + nullable: true + additionalProperties: false + pushOperationStatus: + title: Push operation status + type: string + enum: + - Pending + - Failed + - Success + - TimedOut + description: The current status of the push operation. + pushOperationChange: + type: object + properties: + type: + $ref: '#/components/schemas/PushOperation/definitions/pushChangeType' + recordRef: + $ref: '#/components/schemas/PushOperation/definitions/pushOperationRef' + attachmentId: + type: string + description: Unique identifier for the attachment created otherwise null. + nullable: true + PushOperations: + title: Push operations + x-internal: true + allOf: + - type: object + properties: + results: + type: array + 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" + type: object + 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' + balance: + 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. + page: + name: page + in: query + schema: + type: integer + format: int32 + minimum: 1 + example: 1 + default: 1 + description: 'Page number. [Read more](https://docs.codat.io/using-the-api/paging).' + pageSize: + name: pageSize + in: query + schema: + type: integer + format: int32 + default: 100 + example: 100 + minimum: 1 + maximum: 5000 + description: 'Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging).' + query: + name: query + in: query + required: false + schema: + type: string + example: id=e3334455-1aed-4e71-ab43-6bccf12092ee + description: 'Codat query string. [Read more](https://docs.codat.io/using-the-api/querying).' + orderBy: + name: orderBy + in: query + required: false + schema: + 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 + required: true + schema: + type: string + format: uuid + example: 8a210b68-6988-11ed-a1eb-0242ac120002 + description: Unique identifier for your SMB in Codat. + description: Unique identifier for a company. + connectionId: + name: connectionId + in: path + required: true + schema: + type: string + format: uuid + example: 2e9d2c44-f675-40ba-8049-353bfcb5e171 + description: Unique identifier for a company's data connection. + description: Unique identifier for a connection. + continuationToken: + name: continuationToken + in: query + 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.' + responses: + BadRequest: + description: The request made is not valid. + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorMessage' + examples: + Malformed query: + value: + statusCode: 400 + service: PublicApi + error: Error processing request - not valid. + correlationId: bc997528a9d7abb9161ef45f05d38599 + canBeRetried: Unknown + detailedErrorCode: 0 + Malformed-Query: + description: Your `query` parameter was not correctly formed + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorMessage' + examples: + Malformed query: + value: + statusCode: 400 + service: ClientsApi + error: Error parsing query - Malformed query. + correlationId: bc997528a9d7abb9161ef45f05d38599 + canBeRetried: Unknown + detailedErrorCode: 0 + Unresolved property: + value: + statusCode: 400 + service: PullApi + error: Error parsing query - Could not resolve property isCompleted on Dataset + correlationId: 98457fb9956b7f9b4b2fd4f6e23bb5c8 + canBeRetried: Unknown + detailedErrorCode: 0 + Unauthorized: + description: Your API request was not properly authorized. + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorMessage' + examples: + Unauthorized: + value: + statusCode: 401 + service: PublicApi + error: Unauthorized + correlationId: 7eb40d6b415d7bcd99ce658268284056 + canBeRetried: Unknown + detailedErrorCode: 0 + Payment-Required: + description: | + An account limit has been exceeded. The type of limit is described in the error property: + + - You have exceeded the 50-company limit that applies to a Free plan. Delete any companies you no longer need and retry the request. + - The requested sync schedule is not allowed. You requested an hourly sync schedule but this functionality is not included in the Free plan. + - Your Free account is older than 365 days and has expired. Contact support@codat.io. + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorMessage' + examples: + Conflict: + value: + statusCode: 429 + service: PublicApi + error: You have exceeded the 50-company limit that applies to a Free plan. We recommend that you delete any companies you no longer need and retry the request. + correlationId: bc997528a9d7abb9161ef45f05d38599 + canBeRetried: Unknown + detailedErrorCode: 0 + Forbidden: + description: You are using an outdated API key or a key not associated with that resource. + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorMessage' + examples: + Conflict: + value: + statusCode: 403 + service: PublicApi + error: You are using an outdated API key or a key not associated with that resource. + correlationId: bc997528a9d7abb9161ef45f05d38599 + canBeRetried: Unknown + detailedErrorCode: 0 + Not-Found: + description: |- + One or more of the resources you referenced could not be found. + This might be because your company or data connection id is wrong, or was already deleted. + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorMessage' + examples: + Data connection not found: + value: + statusCode: 404 + service: PublicApi + error: Data connection a22dd66b-564a-4832-9b37-7b3ce4aeb7de not found + correlationId: 8fa2b5f4794970a4ee73758f612e8df0 + canBeRetried: Unknown + detailedErrorCode: 0 + Company not found: + value: + statusCode: 404 + service: ClientsApi + error: No company was found with ID 846ed55c-974b-4392-a1f1-87b6fdbf3c5e + correlationId: 0a40c2f31fc8f992fb88b0853e4166f3 + canBeRetried: Unknown + detailedErrorCode: 0 + No data available: + value: + statusCode: 404 + service: PublicApi + error: No data available for accounts for ID e5889b459f544926ac5b8e6756df2s + correlationId: 0a40c2f31fc8f992fb88b0853e4166f3 + canBeRetried: Unknown + detailedErrorCode: 0 + Conflict: + description: The data type's dataset has not been requested or is still syncing. + 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 + 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: + application/json: + schema: + $ref: '#/components/schemas/ErrorMessage' + examples: + Conflict: + value: + statusCode: 429 + service: PublicApi + error: You have made too many requests in a given amount of time; please retry later. + correlationId: bc997528a9d7abb9161ef45f05d38599 + canBeRetried: Unknown + detailedErrorCode: 0 + Internal-Server-Error: + description: There is a problem with our server. Please try again later. + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorMessage' + examples: + Conflict: + value: + statusCode: 500 + service: PublicApi + error: There is a problem with our server. Please try again later. + correlationId: bc997528a9d7abb9161ef45f05d38599 + canBeRetried: Unknown + detailedErrorCode: 0 + Service-Unavailable: + description: The Codat API is temporarily offline for maintenance. Please try again later. + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorMessage' + examples: + Conflict: + value: + statusCode: 500 + service: PublicApi + error: The Codat API is temporarily offline for maintenance. Please try again later. + correlationId: bc997528a9d7abb9161ef45f05d38599 + canBeRetried: Unknown + detailedErrorCode: 0 + securitySchemes: + auth_header: + name: Authorization + description: 'The word "Basic" followed by a space and your API key. [API keys](https://docs.codat.io/platform-api#/schemas/ApiKeyDetails) are tokens used to control access to the API. You can get an API key via [the Codat Portal](https://app.codat.io/developers/api-keys), via [the API](https://docs.codat.io/platform-api#/operations/list-api-keys), or [read more](https://docs.codat.io/using-the-api/authentication) about authentication at Codat.' + type: apiKey + in: header + x-speakeasy-example: Basic BASE_64_ENCODED(API_KEY) diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock index 38f4d379e..d40c2dee6 100644 --- a/.speakeasy/workflow.lock +++ b/.speakeasy/workflow.lock @@ -1,4 +1,4 @@ -speakeasyVersion: 1.696.0 +speakeasyVersion: 1.709.1 sources: bank-feeds-source: sourceNamespace: bank-feeds-source @@ -42,11 +42,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 +102,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), + ); +}