From 96e986396e8b18505c230e990a6a702ee3651584 Mon Sep 17 00:00:00 2001 From: speakeasybot Date: Tue, 26 Nov 2024 15:20:53 +0000 Subject: [PATCH] ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.446.1 --- .speakeasy/workflow.lock | 13 +- bank-feeds/.speakeasy/gen.lock | 139 ++++++-- bank-feeds/.speakeasy/gen.yaml | 3 +- bank-feeds/README.md | 228 ++++++-------- bank-feeds/RELEASES.md | 12 +- bank-feeds/USAGE.md | 38 +-- .../operations/createbatchsourceaccount1.md | 23 ++ .../createbatchsourceaccountrequest.md | 10 + .../createbatchsourceaccountrequestbody.md | 17 + .../createbatchsourceaccountresponse.md | 17 + .../createbatchsourceaccountresponsebody.md | 13 + ...sourceaccountsourceaccountsresponsebody.md | 13 + .../getcompanyaccesstokenrequest.md | 8 + .../getcreatebanktransactionsmodelrequest.md | 10 + bank-feeds/docs/models/operations/one.md | 17 + .../docs/models/shared/banktransactions.md | 6 +- bank-feeds/docs/models/shared/company.md | 2 + .../docs/models/shared/companyaccesstoken.md | 12 + bank-feeds/docs/models/shared/result.md | 9 + .../sourceaccountbatchcreateresponse.md | 11 + .../shared/sourceaccountbatcherrorresponse.md | 11 + .../sourceaccountv2batchcreateresponse.md | 11 + bank-feeds/docs/sdks/accountmapping/README.md | 71 +++-- bank-feeds/docs/sdks/bankaccounts/README.md | 77 +++-- bank-feeds/docs/sdks/codatbankfeeds/README.md | 4 +- bank-feeds/docs/sdks/companies/README.md | 146 +++++---- .../docs/sdks/companyinformation/README.md | 21 +- bank-feeds/docs/sdks/configuration/README.md | 40 ++- bank-feeds/docs/sdks/connections/README.md | 113 ++++--- bank-feeds/docs/sdks/sourceaccounts/README.md | 274 +++++++++------- bank-feeds/docs/sdks/sync/README.md | 19 +- bank-feeds/docs/sdks/transactions/README.md | 201 +++++++----- bank-feeds/poetry.lock | 70 ++-- bank-feeds/pyproject.toml | 6 +- bank-feeds/src/codat_bankfeeds/_version.py | 2 +- .../src/codat_bankfeeds/account_mapping.py | 42 +++ bank-feeds/src/codat_bankfeeds/companies.py | 216 +++++++++++++ bank-feeds/src/codat_bankfeeds/httpclient.py | 6 + .../models/operations/__init__.py | 42 +++ .../operations/create_batch_source_account.py | 136 ++++++++ .../operations/create_source_account.py | 38 ++- .../operations/get_company_access_token.py | 21 ++ .../get_create_bank_transactions_model.py | 39 +++ .../models/operations/list_source_accounts.py | 24 +- .../codat_bankfeeds/models/shared/__init__.py | 25 ++ .../models/shared/banktransactions.py | 51 +-- .../codat_bankfeeds/models/shared/company.py | 16 + .../models/shared/companyaccesstoken.py | 30 ++ .../sourceaccountbatchcreateresponse.py | 29 ++ .../shared/sourceaccountbatcherrorresponse.py | 41 +++ .../sourceaccountv2batchcreateresponse.py | 29 ++ bank-feeds/src/codat_bankfeeds/sdk.py | 14 + .../src/codat_bankfeeds/sdkconfiguration.py | 6 +- .../src/codat_bankfeeds/source_accounts.py | 298 +++++++++++++++--- .../src/codat_bankfeeds/transactions.py | 234 +++++++++++++- .../src/codat_bankfeeds/utils/annotations.py | 59 +++- .../codat_bankfeeds/utils/eventstreaming.py | 62 +++- 57 files changed, 2366 insertions(+), 759 deletions(-) create mode 100644 bank-feeds/docs/models/operations/createbatchsourceaccount1.md create mode 100644 bank-feeds/docs/models/operations/createbatchsourceaccountrequest.md create mode 100644 bank-feeds/docs/models/operations/createbatchsourceaccountrequestbody.md create mode 100644 bank-feeds/docs/models/operations/createbatchsourceaccountresponse.md create mode 100644 bank-feeds/docs/models/operations/createbatchsourceaccountresponsebody.md create mode 100644 bank-feeds/docs/models/operations/createbatchsourceaccountsourceaccountsresponsebody.md create mode 100644 bank-feeds/docs/models/operations/getcompanyaccesstokenrequest.md create mode 100644 bank-feeds/docs/models/operations/getcreatebanktransactionsmodelrequest.md create mode 100644 bank-feeds/docs/models/operations/one.md create mode 100644 bank-feeds/docs/models/shared/companyaccesstoken.md create mode 100644 bank-feeds/docs/models/shared/result.md create mode 100644 bank-feeds/docs/models/shared/sourceaccountbatchcreateresponse.md create mode 100644 bank-feeds/docs/models/shared/sourceaccountbatcherrorresponse.md create mode 100644 bank-feeds/docs/models/shared/sourceaccountv2batchcreateresponse.md create mode 100644 bank-feeds/src/codat_bankfeeds/models/operations/create_batch_source_account.py create mode 100644 bank-feeds/src/codat_bankfeeds/models/operations/get_company_access_token.py create mode 100644 bank-feeds/src/codat_bankfeeds/models/operations/get_create_bank_transactions_model.py create mode 100644 bank-feeds/src/codat_bankfeeds/models/shared/companyaccesstoken.py create mode 100644 bank-feeds/src/codat_bankfeeds/models/shared/sourceaccountbatchcreateresponse.py create mode 100644 bank-feeds/src/codat_bankfeeds/models/shared/sourceaccountbatcherrorresponse.py create mode 100644 bank-feeds/src/codat_bankfeeds/models/shared/sourceaccountv2batchcreateresponse.py diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock index 07776b27e..3ffd0ebad 100644 --- a/.speakeasy/workflow.lock +++ b/.speakeasy/workflow.lock @@ -16,11 +16,12 @@ sources: - main bank-feeds-source: sourceNamespace: bank-feeds-source - sourceRevisionDigest: sha256:61bdc8d4d47ab3a9f4e19f3426350875586b4f0faecd7d9f5e8bdac3d1f0eb02 - sourceBlobDigest: sha256:a490b555d6f186cd37f72a06e06ba49293a0f371d145db2d9913d5081ecfc5a2 + sourceRevisionDigest: sha256:6ad044c90156a66bca28da8235c9ef07939d07cabbc86575e47259fec2af1409 + sourceBlobDigest: sha256:b5233f0bab180b8aae271a0d5ab149316931ec9e84a140e1c073a2025305eb7d tags: - latest - - main + - speakeasy-sdk-regen-1732634399 + - 3.0.0 banking-source: sourceNamespace: banking-source sourceRevisionDigest: sha256:b2683698c6afe88bf4ca96bb8a6d598c19410794ef4f6bc027c755fb59e1434f @@ -99,8 +100,10 @@ targets: bank-feeds-library: source: bank-feeds-source sourceNamespace: bank-feeds-source - sourceRevisionDigest: sha256:61bdc8d4d47ab3a9f4e19f3426350875586b4f0faecd7d9f5e8bdac3d1f0eb02 - sourceBlobDigest: sha256:a490b555d6f186cd37f72a06e06ba49293a0f371d145db2d9913d5081ecfc5a2 + sourceRevisionDigest: sha256:6ad044c90156a66bca28da8235c9ef07939d07cabbc86575e47259fec2af1409 + sourceBlobDigest: sha256:b5233f0bab180b8aae271a0d5ab149316931ec9e84a140e1c073a2025305eb7d + codeSamplesNamespace: bank-feeds-source-code-samples + codeSamplesRevisionDigest: sha256:474e77328fc049baa81c1fba73c58e0160d01cb3594417261e980046e4f00dfa banking-library: source: banking-source sourceNamespace: banking-source diff --git a/bank-feeds/.speakeasy/gen.lock b/bank-feeds/.speakeasy/gen.lock index 58fb6e87b..41ca9c5c6 100755 --- a/bank-feeds/.speakeasy/gen.lock +++ b/bank-feeds/.speakeasy/gen.lock @@ -1,12 +1,12 @@ lockVersion: 2.0.0 id: 07093ad1-99d8-4bbd-a29c-a624e1b0e25a management: - docChecksum: c57bceaa5f2d5b6d55426976a49ec69d + docChecksum: af010093774a298b2b6a17e641f9cd1b docVersion: 3.0.0 - speakeasyVersion: 1.431.0 - generationVersion: 2.451.0 - releaseVersion: 8.0.0 - configChecksum: 1be61a9a1365628d8a0599a1e0a826fc + speakeasyVersion: 1.446.1 + generationVersion: 2.462.1 + releaseVersion: 9.0.0 + configChecksum: a1263ee2debf9d8e8034a743cd18f050 repoURL: https://github.com/codatio/client-sdk-python.git repoSubDirectory: bank-feeds installationURL: https://github.com/codatio/client-sdk-python.git#subdirectory=bank-feeds @@ -14,8 +14,8 @@ management: features: python: additionalDependencies: 1.0.0 - constsAndDefaults: 1.0.4 - core: 5.6.4 + constsAndDefaults: 1.0.5 + core: 5.6.8 decimal: 1.0.0 defaultEnabledRetries: 0.2.0 deprecations: 3.0.0 @@ -33,8 +33,7 @@ features: retries: 3.0.2 sdkHooks: 1.0.0 serverEventsSentinels: 0.1.0 - tests: 1.6.0 - unions: 3.0.3 + unions: 3.0.4 uploadStreams: 1.0.0 webhooks: 2.0.0 generatedFiles: @@ -47,6 +46,12 @@ generatedFiles: - docs/models/operations/createbankaccountmappingrequest.md - docs/models/operations/createbankaccountrequest.md - docs/models/operations/createbanktransactionsrequest.md + - docs/models/operations/createbatchsourceaccount1.md + - docs/models/operations/createbatchsourceaccountrequest.md + - docs/models/operations/createbatchsourceaccountrequestbody.md + - docs/models/operations/createbatchsourceaccountresponse.md + - docs/models/operations/createbatchsourceaccountresponsebody.md + - docs/models/operations/createbatchsourceaccountsourceaccountsresponsebody.md - docs/models/operations/createconnectionrequest.md - docs/models/operations/createconnectionrequestbody.md - docs/models/operations/createsourceaccountrequest.md @@ -58,11 +63,13 @@ generatedFiles: - docs/models/operations/deletesourceaccountrequest.md - docs/models/operations/generatecredentialsrequest.md - docs/models/operations/getbankaccountmappingrequest.md + - docs/models/operations/getcompanyaccesstokenrequest.md - docs/models/operations/getcompanyinformationrequest.md - docs/models/operations/getcompanyrequest.md - docs/models/operations/getconfigurationrequest.md - docs/models/operations/getconnectionrequest.md - docs/models/operations/getcreatebankaccountsmodelrequest.md + - docs/models/operations/getcreatebanktransactionsmodelrequest.md - docs/models/operations/getcreateoperationrequest.md - docs/models/operations/getlastsuccessfulrequest.md - docs/models/operations/listbankaccountsrequest.md @@ -71,6 +78,7 @@ generatedFiles: - docs/models/operations/listcreateoperationsrequest.md - docs/models/operations/listsourceaccountsrequest.md - docs/models/operations/listsourceaccountsresponsebody.md + - docs/models/operations/one.md - docs/models/operations/setconfigurationrequest.md - docs/models/operations/unlinkconnectionrequest.md - docs/models/operations/unlinkconnectionupdateconnection.md @@ -104,6 +112,7 @@ generatedFiles: - docs/models/shared/clientratelimitwebhookpayload.md - docs/models/shared/companies.md - docs/models/shared/company.md + - docs/models/shared/companyaccesstoken.md - docs/models/shared/companyinformation.md - docs/models/shared/companyreference.md - docs/models/shared/companyreferencelinks.md @@ -139,10 +148,14 @@ generatedFiles: - docs/models/shared/pushoptionproperty.md - docs/models/shared/pushoptiontype.md - docs/models/shared/pushvalidationinfo.md + - docs/models/shared/result.md - docs/models/shared/routinginfo.md - docs/models/shared/security.md - docs/models/shared/sourceaccount.md + - docs/models/shared/sourceaccountbatchcreateresponse.md + - docs/models/shared/sourceaccountbatcherrorresponse.md - docs/models/shared/sourceaccountv2.md + - docs/models/shared/sourceaccountv2batchcreateresponse.md - docs/models/shared/sourceaccountv2status.md - docs/models/shared/sourceaccountwebhook.md - docs/models/shared/sourceaccountwebhookpayload.md @@ -193,6 +206,7 @@ generatedFiles: - src/codat_bankfeeds/models/operations/create_bank_account.py - src/codat_bankfeeds/models/operations/create_bank_account_mapping.py - src/codat_bankfeeds/models/operations/create_bank_transactions.py + - src/codat_bankfeeds/models/operations/create_batch_source_account.py - src/codat_bankfeeds/models/operations/create_connection.py - src/codat_bankfeeds/models/operations/create_source_account.py - src/codat_bankfeeds/models/operations/delete_bank_feed_credentials.py @@ -202,9 +216,11 @@ generatedFiles: - src/codat_bankfeeds/models/operations/generate_credentials.py - src/codat_bankfeeds/models/operations/get_bank_account_mapping.py - src/codat_bankfeeds/models/operations/get_company.py + - src/codat_bankfeeds/models/operations/get_company_access_token.py - src/codat_bankfeeds/models/operations/get_company_information.py - src/codat_bankfeeds/models/operations/get_configuration.py - src/codat_bankfeeds/models/operations/get_connection.py + - src/codat_bankfeeds/models/operations/get_create_bank_transactions_model.py - src/codat_bankfeeds/models/operations/get_create_bankaccounts_model.py - src/codat_bankfeeds/models/operations/get_create_operation.py - src/codat_bankfeeds/models/operations/get_last_successful.py @@ -237,6 +253,7 @@ generatedFiles: - src/codat_bankfeeds/models/shared/clientratelimitwebhookpayload.py - src/codat_bankfeeds/models/shared/companies.py - src/codat_bankfeeds/models/shared/company.py + - src/codat_bankfeeds/models/shared/companyaccesstoken.py - src/codat_bankfeeds/models/shared/companyinformation.py - src/codat_bankfeeds/models/shared/companyreference.py - src/codat_bankfeeds/models/shared/companyrequestbody.py @@ -272,7 +289,10 @@ generatedFiles: - src/codat_bankfeeds/models/shared/routinginfo.py - src/codat_bankfeeds/models/shared/security.py - src/codat_bankfeeds/models/shared/sourceaccount.py + - src/codat_bankfeeds/models/shared/sourceaccountbatchcreateresponse.py + - src/codat_bankfeeds/models/shared/sourceaccountbatcherrorresponse.py - src/codat_bankfeeds/models/shared/sourceaccountv2.py + - src/codat_bankfeeds/models/shared/sourceaccountv2batchcreateresponse.py - src/codat_bankfeeds/models/shared/sourceaccountwebhook.py - src/codat_bankfeeds/models/shared/sourceaccountwebhookpayload.py - src/codat_bankfeeds/models/shared/syncasbankfeeds.py @@ -311,14 +331,14 @@ examples: application/json: {"description": "Requested early access to the new financing scheme.", "name": "Technicalium"} responses: "200": - application/json: {"created": "2022-11-10T10:45:18.1950523Z", "createdByUserName": "Dan Tzabar", "dataConnections": [], "description": "", "id": "ab12c58d-a678-4ebf-a159-ae99e1807bd0", "lastSync": "2022-10-23T00:00:00Z", "name": "Technicalium", "redirect": "https://link.codat.io/company/ab12c58d-a678-4ebf-a159-ae99e1807bd0"} + application/json: {"created": "2022-11-10T10:45:18.1950523Z", "createdByUserName": "Dan Tzabar", "dataConnections": [], "description": "", "id": "ab12c58d-a678-4ebf-a159-ae99e1807bd0", "lastSync": "2022-10-23T00:00:00Z", "name": "Technicalium", "redirect": "https://link.codat.io/company/ab12c58d-a678-4ebf-a159-ae99e1807bd0", "referenceSubsidiaryCompanies": []} "400": {} With a description: requestBody: application/json: {"description": "Technology services, including web and app design and development", "name": "Technicalium"} responses: "200": - application/json: {"created": "2022-11-10T10:45:18.1950523Z", "createdByUserName": "Dan Tzabar", "dataConnections": [], "description": "Technology services, including web and app design and development", "id": "ab12c58d-a678-4ebf-a159-ae99e1807bd0", "lastSync": "2022-10-23T00:00:00Z", "name": "Technicalium", "redirect": "https://link.codat.io/company/ab12c58d-a678-4ebf-a159-ae99e1807bd0"} + application/json: {"created": "2022-11-10T10:45:18.1950523Z", "createdByUserName": "Dan Tzabar", "dataConnections": [], "description": "Technology services, including web and app design and development", "id": "ab12c58d-a678-4ebf-a159-ae99e1807bd0", "lastSync": "2022-10-23T00:00:00Z", "name": "Technicalium", "redirect": "https://link.codat.io/company/ab12c58d-a678-4ebf-a159-ae99e1807bd0", "referenceSubsidiaryCompanies": []} "400": {} With a group: requestBody: @@ -338,7 +358,7 @@ examples: application/json: {"description": "Requested early access to the new financing scheme.", "name": "Bank of Dave"} responses: "200": - application/json: {"created": "2022-11-10T10:45:18.1950523Z", "createdByUserName": "Dan Tzabar", "dataConnections": [], "description": "", "id": "ab12c58d-a678-4ebf-a159-ae99e1807bd0", "lastSync": "2022-10-23T00:00:00Z", "name": "Technicalium", "redirect": "https://link.codat.io/company/ab12c58d-a678-4ebf-a159-ae99e1807bd0", "tags": {"region": "us"}} + application/json: {"created": "2022-11-10T10:45:18.1950523Z", "createdByUserName": "Dan Tzabar", "dataConnections": [], "description": "", "id": "ab12c58d-a678-4ebf-a159-ae99e1807bd0", "lastSync": "2022-10-23T00:00:00Z", "name": "Technicalium", "redirect": "https://link.codat.io/company/ab12c58d-a678-4ebf-a159-ae99e1807bd0", "referenceSubsidiaryCompanies": [], "tags": {"region": "us"}} delete-company: Unauthorized: parameters: @@ -354,7 +374,7 @@ examples: companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" responses: "200": - application/json: {"created": "2022-11-10T10:45:18Z", "createdByUserName": "Dan Tzabar", "dataConnections": [], "description": "", "id": "ab12c58d-a678-4ebf-a159-ae99e1807bd0", "lastSync": "2022-10-23T00:00:00Z", "name": "My First Company", "redirect": "https://link.codat.io/company/ab12c58d-a678-4ebf-a159-ae99e1807bd0"} + application/json: {"created": "2022-11-10T10:45:18Z", "createdByUserName": "Dan Tzabar", "dataConnections": [], "description": "", "id": "ab12c58d-a678-4ebf-a159-ae99e1807bd0", "lastSync": "2022-10-23T00:00:00Z", "name": "Toft stores holdings", "redirect": "https://link.codat.io/company/ab12c58d-a678-4ebf-a159-ae99e1807bd0", "referenceSubsidiaryCompanies": []} With groups: parameters: path: @@ -369,6 +389,20 @@ examples: responses: "401": application/json: {"canBeRetried": "Unknown", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "detailedErrorCode": 0, "error": "Unauthorized", "service": "PublicApi", "statusCode": 401} + Parent multi-entity company: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + responses: + "200": + application/json: {"created": "2022-11-10T10:45:18Z", "createdByUserName": "Dan Tzabar", "dataConnections": [], "description": "", "id": "ab12c58d-a678-4ebf-a159-ae99e1807bd0", "name": "Toft stores", "redirect": "https://link.codat.io/company/ab12c58d-a678-4ebf-a159-ae99e1807bd0", "referenceSubsidiaryCompanies": [{"id": "c8d3af58-7011-47ce-b3f2-89faf300ef6d", "links": {"portal": "https://app.codat.io/companies/c8d3af58-7011-47ce-b3f2-89faf300ef6d/summary"}, "name": "Toft stores UK"}, {"id": "db94eddc-9212-4568-9b5c-3eab0e325913", "links": {"portal": "https://app.codat.io/companies/db94eddc-9212-4568-9b5c-3eab0e325913/summary"}, "name": "Toft stores US"}]} + Subsidiary multi-entity company: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + responses: + "200": + application/json: {"created": "2022-11-10T10:45:18Z", "createdByUserName": "Dan Tzabar", "dataConnections": [{"created": "2022-01-01T11:30:00Z", "id": "d5ab61b7-1ad0-46fd-9f9f-b6761047941e", "integrationId": "cc750323-5a47-4f28-8d8e-30fbbf2ce137", "integrationKey": "akxx", "lastSync": "2022-01-01T12:30:00.000Z", "linkUrl": "https://link-api.codat.io/companies/c8d3af58-7011-47ce-b3f2-89faf300ef6d/connections/d5ab61b7-1ad0-46fd-9f9f-b6761047941e/start", "platformName": "Oracle NetSuite", "sourceId": "9815b998-024d-4415-a40b-89903b2cad6f", "sourceType": "Accounting", "status": "Linked"}], "description": "", "id": "c8d3af58-7011-47ce-b3f2-89faf300ef6d", "name": "Toft stores UK", "redirect": "https://link.codat.io/company/c8d3af58-7011-47ce-b3f2-89faf300ef6d", "referenceParentCompany": {"id": "ab12c58d-a678-4ebf-a159-ae99e1807bd0", "links": {"portal": "https://app.codat.io/companies/ab12c58d-a678-4ebf-a159-ae99e1807bd0/summary"}, "name": "Toft stores"}, "referenceSubsidiaryCompanies": []} list-companies: "": parameters: @@ -390,7 +424,7 @@ examples: orderBy: "-modifiedDate" responses: "200": - application/json: {"_links": {"current": {"href": "/companies?page=1&pageSize=100"}, "self": {"href": "/companies"}}, "pageNumber": 1, "pageSize": 100, "results": [{"created": "2022-01-01T11:30:00Z", "createdByUserName": "Mike Smith", "dataConnections": [{"created": "2022-01-01T11:30:00Z", "dataConnectionErrors": [{"erroredOnUtc": "2022-10-23T00:00:00Z", "resolvedOnUtc": "2022-10-23T00:00:00Z"}, {"erroredOnUtc": "2022-10-23T00:00:00Z", "resolvedOnUtc": "2022-10-23T00:00:00Z"}, {"erroredOnUtc": "2022-10-23T00:00:00Z", "resolvedOnUtc": "2022-10-23T00:00:00Z"}], "id": "51baa045-4836-4317-a42e-3542e991e581", "integrationId": "1c312d69-e638-46d4-ad31-72e6c3ba8390", "integrationKey": "vjms", "lastSync": "2022-01-01T12:30:00.000Z", "linkUrl": "https://link-api.codat.io/companies/3fa85f64-5717-4562-b3fc-2c963f66afa6/connections/51baa045-4836-4317-a42e-3542e991e581/start", "platformName": "Pandle", "sourceId": "396c3158-5dd7-481b-a7c4-a795ca31792b", "sourceType": "Accounting", "status": "Linked"}], "description": "My Test Company make testing software", "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "lastSync": "2022-01-01T12:30:00.000Z", "name": "My Test Company", "redirect": "https://link.codat.io/company/3fa85f64-5717-4562-b3fc-2c963f66afa6"}], "totalResults": 1} + application/json: {"_links": {"current": {"href": "/companies?page=1&pageSize=100"}, "self": {"href": "/companies"}}, "pageNumber": 1, "pageSize": 100, "results": [{"created": "2022-01-01T11:30:00Z", "createdByUserName": "Mike Smith", "dataConnections": [{"created": "2022-01-01T11:30:00Z", "id": "51baa045-4836-4317-a42e-3542e991e581", "integrationId": "1c312d69-e638-46d4-ad31-72e6c3ba8390", "integrationKey": "vjms", "lastSync": "2022-01-01T12:30:00.000Z", "linkUrl": "https://link-api.codat.io/companies/3fa85f64-5717-4562-b3fc-2c963f66afa6/connections/51baa045-4836-4317-a42e-3542e991e581/start", "platformName": "Pandle", "sourceId": "396c3158-5dd7-481b-a7c4-a795ca31792b", "sourceType": "Accounting", "status": "Linked"}], "description": "My Test Company make testing software", "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "lastSync": "2022-01-01T12:30:00.000Z", "name": "My Test Company", "redirect": "https://link.codat.io/company/3fa85f64-5717-4562-b3fc-2c963f66afa6", "referenceSubsidiaryCompanies": []}], "totalResults": 1} List of Companies: parameters: query: @@ -400,7 +434,7 @@ examples: orderBy: "-modifiedDate" responses: "200": - application/json: {"_links": {"current": {"href": "/companies?page=1&pageSize=100"}, "self": {"href": "/companies"}}, "pageNumber": 1, "pageSize": 100, "results": [{"created": "2022-01-01T11:30:00Z", "createdByUserName": "Joe Bloggs", "dataConnections": [{"created": "2022-01-01T11:30:00Z", "dataConnectionErrors": [{"erroredOnUtc": "2022-10-23T00:00:00Z", "resolvedOnUtc": "2022-10-23T00:00:00Z"}, {"erroredOnUtc": "2022-10-23T00:00:00Z", "resolvedOnUtc": "2022-10-23T00:00:00Z"}], "id": "51baa045-4836-4317-a42e-3542e991e581", "integrationId": "1c312d69-e638-46d4-ad31-72e6c3ba8390", "integrationKey": "vjms", "lastSync": "2022-01-01T12:30:00.000Z", "linkUrl": "https://link-api.codat.io/companies/d1568dde-adf6-11ed-afa1-0242ac120002/connections/51baa045-4836-4317-a42e-3542e991e581/start", "platformName": "Pandle", "sourceId": "396c3158-5dd7-481b-a7c4-a795ca31792b", "sourceType": "Accounting", "status": "Linked"}], "description": "Technology services, including web and app design and development", "id": "d1568dde-adf6-11ed-afa1-0242ac120002", "lastSync": "2022-01-01T12:30:00.000Z", "name": "Technicalium", "redirect": "https://link.codat.io/company/d1568dde-adf6-11ed-afa1-0242ac120002"}, {"created": "2022-01-01T11:30:00Z", "createdByUserName": "Mike Smith", "dataConnections": [{"created": "2022-01-01T11:30:00Z", "dataConnectionErrors": [{"erroredOnUtc": "2022-10-23T00:00:00Z", "resolvedOnUtc": "2022-10-23T00:00:00Z"}, {"erroredOnUtc": "2022-10-23T00:00:00Z", "resolvedOnUtc": "2022-10-23T00:00:00Z"}], "id": "a70bc148-dc21-46b2-a257-d9c58ac15cbb", "integrationId": "1c312d69-e638-46d4-ad31-72e6c3ba8390", "integrationKey": "vjms", "lastSync": "2022-01-01T12:30:00.000Z", "linkUrl": "https://link-api.codat.io/companies/096db70b-78de-4ff0-aa98-299cb5fe17a0/connections/a70bc148-dc21-46b2-a257-d9c58ac15cbb/start", "platformName": "Pandle", "sourceId": "396c3158-5dd7-481b-a7c4-a795ca31792b", "sourceType": "Accounting", "status": "Linked"}], "description": "A new digital agency with a passion for creating amazing digital experiences", "id": "096db70b-78de-4ff0-aa98-299cb5fe17a0", "lastSync": "2022-01-01T12:30:00.000Z", "name": "Godata", "redirect": "https://link.codat.io/company/096db70b-78de-4ff0-aa98-299cb5fe17a0"}], "totalResults": 2} + application/json: {"_links": {"current": {"href": "/companies?page=1&pageSize=100"}, "self": {"href": "/companies"}}, "pageNumber": 1, "pageSize": 100, "results": [{"created": "2022-01-01T11:30:00Z", "createdByUserName": "Joe Bloggs", "dataConnections": [{"created": "2022-01-01T11:30:00Z", "id": "51baa045-4836-4317-a42e-3542e991e581", "integrationId": "1c312d69-e638-46d4-ad31-72e6c3ba8390", "integrationKey": "vjms", "lastSync": "2022-01-01T12:30:00.000Z", "linkUrl": "https://link-api.codat.io/companies/d1568dde-adf6-11ed-afa1-0242ac120002/connections/51baa045-4836-4317-a42e-3542e991e581/start", "platformName": "Pandle", "sourceId": "396c3158-5dd7-481b-a7c4-a795ca31792b", "sourceType": "Accounting", "status": "Linked"}], "description": "Technology services, including web and app design and development", "id": "d1568dde-adf6-11ed-afa1-0242ac120002", "lastSync": "2022-01-01T12:30:00.000Z", "name": "Technicalium", "redirect": "https://link.codat.io/company/d1568dde-adf6-11ed-afa1-0242ac120002", "referenceSubsidiaryCompanies": []}, {"created": "2022-11-10T10:45:18Z", "createdByUserName": "Dan Tzabar", "dataConnections": [], "id": "ab12c58d-a678-4ebf-a159-ae99e1807bd0", "name": "Toft stores", "redirect": "https://link.codat.io/company/ab12c58d-a678-4ebf-a159-ae99e1807bd0", "referenceSubsidiaryCompanies": [{"id": "c8d3af58-7011-47ce-b3f2-89faf300ef6d", "links": {"portal": "https://app.codat.io/companies/c8d3af58-7011-47ce-b3f2-89faf300ef6d/summary"}, "name": "Toft stores UK"}, {"id": "db94eddc-9212-4568-9b5c-3eab0e325913", "links": {"portal": "https://app.codat.io/companies/db94eddc-9212-4568-9b5c-3eab0e325913/summary"}, "name": "Toft stores US"}]}, {"created": "2022-11-10T10:45:18Z", "createdByUserName": "Dan Tzabar", "dataConnections": [{"created": "2022-01-01T11:30:00Z", "id": "d5ab61b7-1ad0-46fd-9f9f-b6761047941e", "integrationId": "cc750323-5a47-4f28-8d8e-30fbbf2ce137", "integrationKey": "akxx", "lastSync": "2022-01-01T12:30:00.000Z", "linkUrl": "https://link-api.codat.io/companies/c8d3af58-7011-47ce-b3f2-89faf300ef6d/connections/d5ab61b7-1ad0-46fd-9f9f-b6761047941e/start", "platformName": "Oracle NetSuite", "sourceId": "9815b998-024d-4415-a40b-89903b2cad6f", "sourceType": "Accounting", "status": "Linked"}], "id": "c8d3af58-7011-47ce-b3f2-89faf300ef6d", "name": "Toft stores UK", "redirect": "https://link.codat.io/company/c8d3af58-7011-47ce-b3f2-89faf300ef6d", "referenceParentCompany": {"id": "ab12c58d-a678-4ebf-a159-ae99e1807bd0", "links": {"portal": "https://app.codat.io/companies/ab12c58d-a678-4ebf-a159-ae99e1807bd0/summary"}, "name": "Toft stores"}, "referenceSubsidiaryCompanies": []}, {"created": "2022-11-10T10:45:18Z", "createdByUserName": "Dan Tzabar", "dataConnections": [{"created": "2022-01-01T11:30:00Z", "id": "1e5c8c9e-27fd-4ba9-9a2a-d02ba65bc2fb", "integrationId": "cc750323-5a47-4f28-8d8e-30fbbf2ce137", "integrationKey": "akxx", "lastSync": "2022-01-01T12:30:00.000Z", "linkUrl": "https://link-api.codat.io/companies/db94eddc-9212-4568-9b5c-3eab0e325913/connections/1e5c8c9e-27fd-4ba9-9a2a-d02ba65bc2fb/start", "platformName": "Oracle NetSuite", "sourceId": "9815b998-024d-4415-a40b-89903b2cad6f", "sourceType": "Accounting", "status": "Linked"}], "id": "db94eddc-9212-4568-9b5c-3eab0e325913", "name": "Toft stores US", "redirect": "https://link.codat.io/company/db94eddc-9212-4568-9b5c-3eab0e325913", "referenceParentCompany": {"id": "ab12c58d-a678-4ebf-a159-ae99e1807bd0", "links": {"portal": "https://app.codat.io/companies/ab12c58d-a678-4ebf-a159-ae99e1807bd0/summary"}, "name": "Toft stores"}, "referenceSubsidiaryCompanies": []}], "totalResults": 3} Malformed query: parameters: query: @@ -430,7 +464,7 @@ examples: application/json: {"description": "Requested early access to the new financing scheme.", "name": "New Name"} responses: "200": - application/json: {"created": "2022-01-01T12:00:00.000Z", "createdByUserName": "string", "dataConnections": [{"created": "2022-10-27T09:53:29Z", "dataConnectionErrors": [{"erroredOnUtc": "2022-10-23T00:00:00Z", "resolvedOnUtc": "2022-10-23T00:00:00Z"}, {"erroredOnUtc": "2022-10-23T00:00:00Z", "resolvedOnUtc": "2022-10-23T00:00:00Z"}, {"erroredOnUtc": "2022-10-23T00:00:00Z", "resolvedOnUtc": "2022-10-23T00:00:00Z"}], "id": "ee2eb431-c0fa-4dc9-93fa-d29781c12bcd", "integrationId": "bf083d72-62c7-493e-aec9-81b4dbba7e2c", "integrationKey": "dfxm", "lastSync": "2022-10-27T10:22:43.6464237Z", "linkUrl": "https://link-api.codat.io/companies/86bd88cb-44ab-4dfb-b32f-87b19b14287f/connections/ee2eb431-c0fa-4dc9-93fa-d29781c12bcd/start", "platformName": "Basiq", "sourceId": "bdd831ce-eebd-4896-89a7-20e5ee8989ee", "sourceType": "Banking", "status": "Linked"}], "description": "Requested early access to the new financing scheme.", "id": "0498e921-9b53-4396-a412-4f2f5983b0a2", "lastSync": "2022-01-01T12:00:00.000Z", "name": "string", "redirect": "https://link.codat.io/company/27628208-459c-46a2-a705-5641ce25f739", "tags": {"region": "us", "uid": "f6b0c253-16c7-4da1-a0c5-9c871e9c9d6c"}} + application/json: {"created": "2022-01-01T12:00:00.000Z", "createdByUserName": "string", "dataConnections": [{"created": "2022-10-27T09:53:29Z", "id": "ee2eb431-c0fa-4dc9-93fa-d29781c12bcd", "integrationId": "bf083d72-62c7-493e-aec9-81b4dbba7e2c", "integrationKey": "dfxm", "lastSync": "2022-10-27T10:22:43.6464237Z", "linkUrl": "https://link-api.codat.io/companies/86bd88cb-44ab-4dfb-b32f-87b19b14287f/connections/ee2eb431-c0fa-4dc9-93fa-d29781c12bcd/start", "platformName": "Basiq", "sourceId": "bdd831ce-eebd-4896-89a7-20e5ee8989ee", "sourceType": "Banking", "status": "Linked"}], "description": "Requested early access to the new financing scheme.", "id": "0498e921-9b53-4396-a412-4f2f5983b0a2", "lastSync": "2022-01-01T12:00:00.000Z", "name": "string", "redirect": "https://link.codat.io/company/27628208-459c-46a2-a705-5641ce25f739", "tags": {"region": "us", "uid": "f6b0c253-16c7-4da1-a0c5-9c871e9c9d6c"}} "401": {} Update description: parameters: @@ -440,7 +474,7 @@ examples: application/json: {"description": "Additional documents required", "name": "Same name"} responses: "200": - application/json: {"created": "2022-01-01T12:00:00.000Z", "createdByUserName": "string", "dataConnections": [{"created": "2022-10-27T09:53:29Z", "dataConnectionErrors": [], "id": "ee2eb431-c0fa-4dc9-93fa-d29781c12bcd", "integrationId": "bf083d72-62c7-493e-aec9-81b4dbba7e2c", "integrationKey": "dfxm", "lastSync": "2022-10-27T10:22:43.6464237Z", "linkUrl": "https://link-api.codat.io/companies/86bd88cb-44ab-4dfb-b32f-87b19b14287f/connections/ee2eb431-c0fa-4dc9-93fa-d29781c12bcd/start", "platformName": "Basiq", "sourceId": "bdd831ce-eebd-4896-89a7-20e5ee8989ee", "sourceType": "Banking", "status": "Linked"}], "description": "Requested early access to the new financing scheme.", "id": "0498e921-9b53-4396-a412-4f2f5983b0a2", "lastSync": "2022-01-01T12:00:00.000Z", "name": "string", "redirect": "https://link.codat.io/company/27628208-459c-46a2-a705-5641ce25f739", "tags": {"region": "us", "uid": "f6b0c253-16c7-4da1-a0c5-9c871e9c9d6c"}} + application/json: {"created": "2022-01-01T12:00:00.000Z", "createdByUserName": "string", "dataConnections": [{"created": "2022-10-27T09:53:29Z", "id": "ee2eb431-c0fa-4dc9-93fa-d29781c12bcd", "integrationId": "bf083d72-62c7-493e-aec9-81b4dbba7e2c", "integrationKey": "dfxm", "lastSync": "2022-10-27T10:22:43.6464237Z", "linkUrl": "https://link-api.codat.io/companies/86bd88cb-44ab-4dfb-b32f-87b19b14287f/connections/ee2eb431-c0fa-4dc9-93fa-d29781c12bcd/start", "platformName": "Basiq", "sourceId": "bdd831ce-eebd-4896-89a7-20e5ee8989ee", "sourceType": "Banking", "status": "Linked"}], "description": "Requested early access to the new financing scheme.", "id": "0498e921-9b53-4396-a412-4f2f5983b0a2", "lastSync": "2022-01-01T12:00:00.000Z", "name": "string", "redirect": "https://link.codat.io/company/27628208-459c-46a2-a705-5641ce25f739", "tags": {"region": "us", "uid": "f6b0c253-16c7-4da1-a0c5-9c871e9c9d6c"}} "401": {} Unauthorized: parameters: @@ -521,7 +555,7 @@ examples: orderBy: "-modifiedDate" responses: "200": - application/json: {"_links": {"current": {"href": "string"}, "next": {"href": "string"}, "previous": {"href": "string"}, "self": {"href": "string"}}, "pageNumber": 0, "pageSize": 0, "results": [{"created": "2022-10-27T09:53:29Z", "dataConnectionErrors": [{"erroredOnUtc": "2022-10-23T00:00:00Z", "resolvedOnUtc": "2022-10-23T00:00:00Z"}, {"erroredOnUtc": "2022-10-23T00:00:00Z", "resolvedOnUtc": "2022-10-23T00:00:00Z"}, {"erroredOnUtc": "2022-10-23T00:00:00Z", "resolvedOnUtc": "2022-10-23T00:00:00Z"}], "id": "ee2eb431-c0fa-4dc9-93fa-d29781c12bcd", "integrationId": "bf083d72-62c7-493e-aec9-81b4dbba7e2c", "integrationKey": "dfxm", "lastSync": "2022-10-27T10:22:43.6464237Z", "linkUrl": "https://link-api.codat.io/companies/86bd88cb-44ab-4dfb-b32f-87b19b14287f/connections/ee2eb431-c0fa-4dc9-93fa-d29781c12bcd/start", "platformName": "Basiq", "sourceId": "bdd831ce-eebd-4896-89a7-20e5ee8989ee", "sourceType": "Banking", "status": "Linked"}], "totalResults": 0} + application/json: {"_links": {"current": {"href": "string"}, "next": {"href": "string"}, "previous": {"href": "string"}, "self": {"href": "string"}}, "pageNumber": 0, "pageSize": 0, "results": [{"created": "2022-10-27T09:53:29Z", "id": "ee2eb431-c0fa-4dc9-93fa-d29781c12bcd", "integrationId": "bf083d72-62c7-493e-aec9-81b4dbba7e2c", "integrationKey": "dfxm", "lastSync": "2022-10-27T10:22:43.6464237Z", "linkUrl": "https://link-api.codat.io/companies/86bd88cb-44ab-4dfb-b32f-87b19b14287f/connections/ee2eb431-c0fa-4dc9-93fa-d29781c12bcd/start", "platformName": "Basiq", "sourceId": "bdd831ce-eebd-4896-89a7-20e5ee8989ee", "sourceType": "Banking", "status": "Linked"}], "totalResults": 0} Malformed query: parameters: path: @@ -604,7 +638,7 @@ examples: connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" responses: "200": - application/json: [{"feedStartDate": "2022-10-23T00:00:00Z", "sourceAccountId": "account-001", "sourceAccountName": "account-001", "sourceAccountNumber": "12345670", "sourceBalance": "99.99", "sourceCurrency": "GBP", "status": "pending", "targetAccountOptions": [{"accountNumber": "789", "id": "d21e25d6-98c5-4bfb-b469-105833bea3c8", "name": "Money Bank account", "sortCode": "123456"}, {"accountNumber": "99887766", "id": "d06ff4b2-e4f2-4681-9841-014bd008cdab", "name": "Bank of Dave account", "sortCode": "998866"}, {"accountNumber": "123456789", "id": "c8f252fc-84f3-4a8b-ace8-ae99f41a81ae", "name": "LuxLend account", "sortCode": "123456"}]}] + application/json: [{"sourceAccountId": "account-001", "sourceAccountName": "account-001", "sourceAccountNumber": "12345670", "sourceBalance": "99.99", "sourceCurrency": "GBP", "status": "pending", "targetAccountOptions": [{"accountNumber": "789", "id": "d21e25d6-98c5-4bfb-b469-105833bea3c8", "name": "Money Bank account", "sortCode": "123456"}, {"accountNumber": "99887766", "id": "d06ff4b2-e4f2-4681-9841-014bd008cdab", "name": "Bank of Dave account", "sortCode": "998866"}, {"accountNumber": "123456789", "id": "c8f252fc-84f3-4a8b-ace8-ae99f41a81ae", "name": "LuxLend account", "sortCode": "123456"}]}] get-company-information: Malformed query: parameters: @@ -794,7 +828,7 @@ examples: orderBy: "-modifiedDate" responses: "200": - application/json: {"_links": {"current": {"href": "/companies/d6849caf-c146-41be-8335-b73346e3bd84/connections/60acb117-5cf5-4745-b069-491551da4066/data/bankAccounts?page=1&pageSize=2"}, "next": {"href": "/companies/d6849caf-c146-41be-8335-b73346e3bd84/connections/60acb117-5cf5-4745-b069-491551da4066/data/bankAccounts?page=2&pageSize=2"}, "self": {"href": "/companies/d6849caf-c146-41be-8335-b73346e3bd84/connections/60acb117-5cf5-4745-b069-491551da4066/data/bankAccounts"}}, "pageNumber": 1, "pageSize": 2, "results": [{"accountName": "55", "accountNumber": "", "accountType": "Unknown", "balance": -352.03, "currency": "GBP", "iBan": "", "id": "c9a41bc7-6e5b-ed11-8c34-0022481b8b5b", "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-27T14:21:10Z", "nominalCode": "10500", "overdraftLimit": 0, "sortCode": "", "sourceModifiedDate": "2023-02-07T00:00:00", "status": "Active"}, {"accountName": "555", "accountNumber": "", "accountType": "Unknown", "balance": 661.79, "currency": "PLN", "iBan": "", "id": "47020f80-60e6-ec11-82f8-0022481a77f0", "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-27T14:21:10Z", "nominalCode": "40300", "overdraftLimit": 0, "sortCode": "", "sourceModifiedDate": "2022-06-07T00:00:00", "status": "Active"}], "totalResults": 28} + application/json: {"_links": {"current": {"href": "/companies/d6849caf-c146-41be-8335-b73346e3bd84/connections/60acb117-5cf5-4745-b069-491551da4066/data/bankAccounts?page=1&pageSize=2"}, "next": {"href": "/companies/d6849caf-c146-41be-8335-b73346e3bd84/connections/60acb117-5cf5-4745-b069-491551da4066/data/bankAccounts?page=2&pageSize=2"}, "self": {"href": "/companies/d6849caf-c146-41be-8335-b73346e3bd84/connections/60acb117-5cf5-4745-b069-491551da4066/data/bankAccounts"}}, "pageNumber": 1, "pageSize": 2, "results": [{"accountName": "55", "accountNumber": "", "accountType": "Unknown", "balance": -352.03, "currency": "GBP", "iBan": "", "id": "c9a41bc7-6e5b-ed11-8c34-0022481b8b5b", "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-27T14:21:10Z", "nominalCode": "10500", "overdraftLimit": 0, "sortCode": "", "sourceModifiedDate": "2023-02-07T00:00:00"}, {"accountName": "555", "accountNumber": "", "accountType": "Unknown", "balance": 661.79, "currency": "PLN", "iBan": "", "id": "47020f80-60e6-ec11-82f8-0022481a77f0", "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-27T14:21:10Z", "nominalCode": "40300", "overdraftLimit": 0, "sortCode": "", "sourceModifiedDate": "2022-06-07T00:00:00"}], "totalResults": 28} FreeAgent: parameters: path: @@ -807,7 +841,7 @@ examples: orderBy: "-modifiedDate" responses: "200": - application/json: {"_links": {"current": {"href": "/companies/071ad738-68f3-4561-afd0-69bab9df0803/connections/4fd7c69f-ecc1-45f5-83f2-42ed3391e386/data/bankAccounts?page=1&pageSize=2"}, "next": {"href": "/companies/071ad738-68f3-4561-afd0-69bab9df0803/connections/4fd7c69f-ecc1-45f5-83f2-42ed3391e386/data/bankAccounts?page=2&pageSize=2"}, "self": {"href": "/companies/071ad738-68f3-4561-afd0-69bab9df0803/connections/4fd7c69f-ecc1-45f5-83f2-42ed3391e386/data/bankAccounts"}}, "pageNumber": 1, "pageSize": 2, "results": [{"accountName": "\\w3fw", "accountNumber": "A06268209", "accountType": "Debit", "availableBalance": -10484.65, "balance": -10484.65, "currency": "GBP", "id": "738783", "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-25T14:19:12Z", "sortCode": "236972", "sourceModifiedDate": "2022-10-23T00:00:00Z", "status": "Active"}, {"accountName": "2e2bna45hy\\", "accountNumber": "D01825250", "accountType": "Debit", "availableBalance": -114.4, "balance": -114.4, "currency": "GBP", "id": "738778", "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-25T14:19:12Z", "sortCode": "236972", "sourceModifiedDate": "2022-10-23T00:00:00Z", "status": "Active"}], "totalResults": 82} + application/json: {"_links": {"current": {"href": "/companies/071ad738-68f3-4561-afd0-69bab9df0803/connections/4fd7c69f-ecc1-45f5-83f2-42ed3391e386/data/bankAccounts?page=1&pageSize=2"}, "next": {"href": "/companies/071ad738-68f3-4561-afd0-69bab9df0803/connections/4fd7c69f-ecc1-45f5-83f2-42ed3391e386/data/bankAccounts?page=2&pageSize=2"}, "self": {"href": "/companies/071ad738-68f3-4561-afd0-69bab9df0803/connections/4fd7c69f-ecc1-45f5-83f2-42ed3391e386/data/bankAccounts"}}, "pageNumber": 1, "pageSize": 2, "results": [{"accountName": "\\w3fw", "accountNumber": "A06268209", "accountType": "Debit", "availableBalance": -10484.65, "balance": -10484.65, "currency": "GBP", "id": "738783", "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-25T14:19:12Z", "sortCode": "236972"}, {"accountName": "2e2bna45hy\\", "accountNumber": "D01825250", "accountType": "Debit", "availableBalance": -114.4, "balance": -114.4, "currency": "GBP", "id": "738778", "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-25T14:19:12Z", "sortCode": "236972"}], "totalResults": 82} KashFlow: parameters: path: @@ -820,7 +854,7 @@ examples: orderBy: "-modifiedDate" responses: "200": - application/json: {"_links": {"current": {"href": "/companies/3a707a99-89da-4b16-a5d6-595333a16352/connections/ecab4f64-1a04-4c53-a343-bfd879f41f67/data/bankAccounts?page=1&pageSize=2"}, "next": {"href": "/companies/3a707a99-89da-4b16-a5d6-595333a16352/connections/ecab4f64-1a04-4c53-a343-bfd879f41f67/data/bankAccounts?page=2&pageSize=2"}, "self": {"href": "/companies/3a707a99-89da-4b16-a5d6-595333a16352/connections/ecab4f64-1a04-4c53-a343-bfd879f41f67/data/bankAccounts"}}, "pageNumber": 1, "pageSize": 2, "results": [{"accountName": "16th Account", "accountType": "Unknown", "availableBalance": 326, "balance": 326, "currency": "GBP", "id": "765768", "modifiedDate": "2022-09-30T10:29:16Z", "nominalCode": "70700", "sourceModifiedDate": "2022-10-23T00:00:00Z", "status": "Active"}, {"accountName": "1a1a", "accountType": "Unknown", "availableBalance": 0, "balance": 0, "currency": "GBP", "id": "765766", "modifiedDate": "2022-09-30T10:29:16Z", "nominalCode": "70600", "sourceModifiedDate": "2022-10-23T00:00:00Z", "status": "Active"}], "totalResults": 56} + application/json: {"_links": {"current": {"href": "/companies/3a707a99-89da-4b16-a5d6-595333a16352/connections/ecab4f64-1a04-4c53-a343-bfd879f41f67/data/bankAccounts?page=1&pageSize=2"}, "next": {"href": "/companies/3a707a99-89da-4b16-a5d6-595333a16352/connections/ecab4f64-1a04-4c53-a343-bfd879f41f67/data/bankAccounts?page=2&pageSize=2"}, "self": {"href": "/companies/3a707a99-89da-4b16-a5d6-595333a16352/connections/ecab4f64-1a04-4c53-a343-bfd879f41f67/data/bankAccounts"}}, "pageNumber": 1, "pageSize": 2, "results": [{"accountName": "16th Account", "accountType": "Unknown", "availableBalance": 326, "balance": 326, "currency": "GBP", "id": "765768", "modifiedDate": "2022-09-30T10:29:16Z", "nominalCode": "70700"}, {"accountName": "1a1a", "accountType": "Unknown", "availableBalance": 0, "balance": 0, "currency": "GBP", "id": "765766", "modifiedDate": "2022-09-30T10:29:16Z", "nominalCode": "70600"}], "totalResults": 56} Oracle NetSuite: parameters: path: @@ -833,7 +867,7 @@ examples: orderBy: "-modifiedDate" responses: "200": - application/json: {"_links": {"current": {"href": "/companies/d5074b08-6a34-4b06-a742-236edf5dc4f1/connections/79f8313e-210a-4dc8-b69f-ba7e5004dda7/data/bankAccounts?page=1&pageSize=2"}, "next": {"href": "/companies/d5074b08-6a34-4b06-a742-236edf5dc4f1/connections/79f8313e-210a-4dc8-b69f-ba7e5004dda7/data/bankAccounts?page=2&pageSize=2"}, "self": {"href": "/companies/d5074b08-6a34-4b06-a742-236edf5dc4f1/connections/79f8313e-210a-4dc8-b69f-ba7e5004dda7/data/bankAccounts"}}, "pageNumber": 1, "pageSize": 2, "results": [{"accountName": "Codat Europe Bank", "accountType": "Debit", "balance": 558.22, "currency": "GBP", "id": "825", "metadata": {"isDeleted": false}, "modifiedDate": "2023-05-02T13:24:36Z", "nominalCode": "111111122222111", "sourceModifiedDate": "2022-07-15T11:34:02", "status": "Active"}, {"accountName": "Codat Europe Bank USD", "accountType": "Debit", "currency": "USD", "id": "826", "metadata": {"isDeleted": false}, "modifiedDate": "2023-05-02T13:24:36Z", "nominalCode": "1133221133", "sourceModifiedDate": "2021-03-26T10:31:40", "status": "Active"}], "totalResults": 4} + application/json: {"_links": {"current": {"href": "/companies/d5074b08-6a34-4b06-a742-236edf5dc4f1/connections/79f8313e-210a-4dc8-b69f-ba7e5004dda7/data/bankAccounts?page=1&pageSize=2"}, "next": {"href": "/companies/d5074b08-6a34-4b06-a742-236edf5dc4f1/connections/79f8313e-210a-4dc8-b69f-ba7e5004dda7/data/bankAccounts?page=2&pageSize=2"}, "self": {"href": "/companies/d5074b08-6a34-4b06-a742-236edf5dc4f1/connections/79f8313e-210a-4dc8-b69f-ba7e5004dda7/data/bankAccounts"}}, "pageNumber": 1, "pageSize": 2, "results": [{"accountName": "Codat Europe Bank", "accountType": "Debit", "balance": 558.22, "currency": "GBP", "id": "825", "metadata": {"isDeleted": false}, "modifiedDate": "2023-05-02T13:24:36Z", "nominalCode": "111111122222111", "sourceModifiedDate": "2022-07-15T11:34:02"}, {"accountName": "Codat Europe Bank USD", "accountType": "Debit", "currency": "USD", "id": "826", "metadata": {"isDeleted": false}, "modifiedDate": "2023-05-02T13:24:36Z", "nominalCode": "1133221133", "sourceModifiedDate": "2021-03-26T10:31:40"}], "totalResults": 4} QuickBooks Desktop: parameters: path: @@ -846,7 +880,7 @@ examples: orderBy: "-modifiedDate" responses: "200": - application/json: {"_links": {"current": {"href": "/companies/fc72ba08-af13-4474-b28a-01dcfa6cfb51/connections/2c26b4da-97d4-4ba9-baad-1e18b49b96ac/data/bankAccounts?page=1&pageSize=2"}, "next": {"href": "/companies/fc72ba08-af13-4474-b28a-01dcfa6cfb51/connections/2c26b4da-97d4-4ba9-baad-1e18b49b96ac/data/bankAccounts?page=2&pageSize=2"}, "self": {"href": "/companies/fc72ba08-af13-4474-b28a-01dcfa6cfb51/connections/2c26b4da-97d4-4ba9-baad-1e18b49b96ac/data/bankAccounts"}}, "pageNumber": 1, "pageSize": 2, "results": [{"accountName": "Checking", "accountType": "Unknown", "availableBalance": 46954.1, "balance": 46954.1, "currency": "GBP", "id": "20000-933270541", "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-26T09:12:37Z", "nominalCode": "10100", "sourceModifiedDate": "2023-12-16T05:06:45", "status": "Active"}, {"accountName": "Petty Cash", "accountType": "Unknown", "availableBalance": 500, "balance": 500, "currency": "GBP", "id": "550001-1071509830", "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-26T09:12:37Z", "nominalCode": "10400", "sourceModifiedDate": "2023-12-16T05:06:45", "status": "Active"}], "totalResults": 3} + application/json: {"_links": {"current": {"href": "/companies/fc72ba08-af13-4474-b28a-01dcfa6cfb51/connections/2c26b4da-97d4-4ba9-baad-1e18b49b96ac/data/bankAccounts?page=1&pageSize=2"}, "next": {"href": "/companies/fc72ba08-af13-4474-b28a-01dcfa6cfb51/connections/2c26b4da-97d4-4ba9-baad-1e18b49b96ac/data/bankAccounts?page=2&pageSize=2"}, "self": {"href": "/companies/fc72ba08-af13-4474-b28a-01dcfa6cfb51/connections/2c26b4da-97d4-4ba9-baad-1e18b49b96ac/data/bankAccounts"}}, "pageNumber": 1, "pageSize": 2, "results": [{"accountName": "Checking", "accountType": "Unknown", "availableBalance": 46954.1, "balance": 46954.1, "currency": "GBP", "id": "20000-933270541", "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-26T09:12:37Z", "nominalCode": "10100", "sourceModifiedDate": "2023-12-16T05:06:45"}, {"accountName": "Petty Cash", "accountType": "Unknown", "availableBalance": 500, "balance": 500, "currency": "GBP", "id": "550001-1071509830", "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-26T09:12:37Z", "nominalCode": "10400", "sourceModifiedDate": "2023-12-16T05:06:45"}], "totalResults": 3} QuickBooks Online Sandbox: parameters: path: @@ -859,7 +893,7 @@ examples: orderBy: "-modifiedDate" responses: "200": - application/json: {"_links": {"current": {"href": "/companies/5a7f3597-36e1-4216-86fe-289ad36088a6/connections/1f9f6013-f8a5-4278-8a47-3ab7fdb6c24c/data/bankAccounts?page=1&pageSize=2"}, "next": {"href": "/companies/5a7f3597-36e1-4216-86fe-289ad36088a6/connections/1f9f6013-f8a5-4278-8a47-3ab7fdb6c24c/data/bankAccounts?page=2&pageSize=2"}, "self": {"href": "/companies/5a7f3597-36e1-4216-86fe-289ad36088a6/connections/1f9f6013-f8a5-4278-8a47-3ab7fdb6c24c/data/bankAccounts"}}, "pageNumber": 1, "pageSize": 2, "results": [{"accountName": "00", "accountType": "Debit", "availableBalance": 0, "balance": 0, "currency": "GBP", "id": "164", "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-26T09:35:57Z", "nominalCode": "123567", "sourceModifiedDate": "2022-07-20T14:11:28Z", "status": "Active"}, {"accountName": "11", "accountType": "Debit", "availableBalance": 0, "balance": 0, "currency": "GBP", "id": "163", "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-26T09:35:57Z", "sourceModifiedDate": "2022-07-20T14:11:28Z", "status": "Active"}], "totalResults": 57} + application/json: {"_links": {"current": {"href": "/companies/5a7f3597-36e1-4216-86fe-289ad36088a6/connections/1f9f6013-f8a5-4278-8a47-3ab7fdb6c24c/data/bankAccounts?page=1&pageSize=2"}, "next": {"href": "/companies/5a7f3597-36e1-4216-86fe-289ad36088a6/connections/1f9f6013-f8a5-4278-8a47-3ab7fdb6c24c/data/bankAccounts?page=2&pageSize=2"}, "self": {"href": "/companies/5a7f3597-36e1-4216-86fe-289ad36088a6/connections/1f9f6013-f8a5-4278-8a47-3ab7fdb6c24c/data/bankAccounts"}}, "pageNumber": 1, "pageSize": 2, "results": [{"accountName": "00", "accountType": "Debit", "availableBalance": 0, "balance": 0, "currency": "GBP", "id": "164", "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-26T09:35:57Z", "nominalCode": "123567", "sourceModifiedDate": "2022-07-20T14:11:28Z"}, {"accountName": "11", "accountType": "Debit", "availableBalance": 0, "balance": 0, "currency": "GBP", "id": "163", "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-26T09:35:57Z", "sourceModifiedDate": "2022-07-20T14:11:28Z"}], "totalResults": 57} QuickBooks Online: parameters: path: @@ -872,7 +906,7 @@ examples: orderBy: "-modifiedDate" responses: "200": - application/json: {"_links": {"current": {"href": "/companies/10818b5e-6e6a-4ed4-a1c5-3e3efe626e87/connections/9e28a776-f4be-425b-8a3d-ad49956de2c9/data/bankAccounts?page=1&pageSize=2"}, "next": {"href": "/companies/10818b5e-6e6a-4ed4-a1c5-3e3efe626e87/connections/9e28a776-f4be-425b-8a3d-ad49956de2c9/data/bankAccounts?page=2&pageSize=2"}, "self": {"href": "/companies/10818b5e-6e6a-4ed4-a1c5-3e3efe626e87/connections/9e28a776-f4be-425b-8a3d-ad49956de2c9/data/bankAccounts"}}, "pageNumber": 1, "pageSize": 2, "results": [{"accountName": "\\aa", "accountType": "Debit", "availableBalance": 123, "balance": 123, "currency": "GBP", "id": "202", "modifiedDate": "2023-01-18T11:02:37Z", "sourceModifiedDate": "2022-11-11T14:15:13Z", "status": "Active"}, {"accountName": "1 year ago", "accountType": "Debit", "availableBalance": 5300.02, "balance": 5300.02, "currency": "GBP", "id": "193", "modifiedDate": "2023-01-18T11:02:37Z", "sourceModifiedDate": "2023-01-18T06:05:12Z", "status": "Active"}], "totalResults": 140} + application/json: {"_links": {"current": {"href": "/companies/10818b5e-6e6a-4ed4-a1c5-3e3efe626e87/connections/9e28a776-f4be-425b-8a3d-ad49956de2c9/data/bankAccounts?page=1&pageSize=2"}, "next": {"href": "/companies/10818b5e-6e6a-4ed4-a1c5-3e3efe626e87/connections/9e28a776-f4be-425b-8a3d-ad49956de2c9/data/bankAccounts?page=2&pageSize=2"}, "self": {"href": "/companies/10818b5e-6e6a-4ed4-a1c5-3e3efe626e87/connections/9e28a776-f4be-425b-8a3d-ad49956de2c9/data/bankAccounts"}}, "pageNumber": 1, "pageSize": 2, "results": [{"accountName": "\\aa", "accountType": "Debit", "availableBalance": 123, "balance": 123, "currency": "GBP", "id": "202", "modifiedDate": "2023-01-18T11:02:37Z", "sourceModifiedDate": "2022-11-11T14:15:13Z"}, {"accountName": "1 year ago", "accountType": "Debit", "availableBalance": 5300.02, "balance": 5300.02, "currency": "GBP", "id": "193", "modifiedDate": "2023-01-18T11:02:37Z", "sourceModifiedDate": "2023-01-18T06:05:12Z"}], "totalResults": 140} Sage 50 (UK): parameters: path: @@ -885,7 +919,7 @@ examples: orderBy: "-modifiedDate" responses: "200": - application/json: {"_links": {"current": {"href": "/companies/cf5f2a47-2990-4221-bae6-0c19c86ac304/connections/8ee4910f-4fc1-47e6-89b1-5931fb33d8f7/data/bankAccounts?page=1&pageSize=2"}, "next": {"href": "/companies/cf5f2a47-2990-4221-bae6-0c19c86ac304/connections/8ee4910f-4fc1-47e6-89b1-5931fb33d8f7/data/bankAccounts?page=2&pageSize=2"}, "self": {"href": "/companies/cf5f2a47-2990-4221-bae6-0c19c86ac304/connections/8ee4910f-4fc1-47e6-89b1-5931fb33d8f7/data/bankAccounts"}}, "pageNumber": 1, "pageSize": 2, "results": [{"accountName": "Bank Current Account", "accountNumber": "003234234", "accountType": "Unknown", "availableBalance": -20091.04, "balance": -20091.04, "currency": "GBP", "iBan": "", "id": "1200", "institution": "Lloyds Bank PLC", "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-30T14:42:37Z", "nominalCode": "1200", "overdraftLimit": 120000, "sortCode": "23-34-34", "sourceModifiedDate": "2022-11-25T09:25:48", "status": "Active"}, {"accountName": "Bank Deposit Account", "accountNumber": "9/00474345", "accountType": "Unknown", "availableBalance": 3510, "balance": 3510, "currency": "GBP", "iBan": "", "id": "1210", "institution": "Halifax Building Society", "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-30T14:42:37Z", "nominalCode": "1210", "overdraftLimit": 0, "sortCode": "45-45-45", "sourceModifiedDate": "2022-11-25T09:25:48", "status": "Active"}], "totalResults": 6} + application/json: {"_links": {"current": {"href": "/companies/cf5f2a47-2990-4221-bae6-0c19c86ac304/connections/8ee4910f-4fc1-47e6-89b1-5931fb33d8f7/data/bankAccounts?page=1&pageSize=2"}, "next": {"href": "/companies/cf5f2a47-2990-4221-bae6-0c19c86ac304/connections/8ee4910f-4fc1-47e6-89b1-5931fb33d8f7/data/bankAccounts?page=2&pageSize=2"}, "self": {"href": "/companies/cf5f2a47-2990-4221-bae6-0c19c86ac304/connections/8ee4910f-4fc1-47e6-89b1-5931fb33d8f7/data/bankAccounts"}}, "pageNumber": 1, "pageSize": 2, "results": [{"accountName": "Bank Current Account", "accountNumber": "003234234", "accountType": "Unknown", "availableBalance": -20091.04, "balance": -20091.04, "currency": "GBP", "iBan": "", "id": "1200", "institution": "Lloyds Bank PLC", "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-30T14:42:37Z", "nominalCode": "1200", "overdraftLimit": 120000, "sortCode": "23-34-34", "sourceModifiedDate": "2022-11-25T09:25:48"}, {"accountName": "Bank Deposit Account", "accountNumber": "9/00474345", "accountType": "Unknown", "availableBalance": 3510, "balance": 3510, "currency": "GBP", "iBan": "", "id": "1210", "institution": "Halifax Building Society", "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-30T14:42:37Z", "nominalCode": "1210", "overdraftLimit": 0, "sortCode": "45-45-45", "sourceModifiedDate": "2022-11-25T09:25:48"}], "totalResults": 6} Sage Business Cloud Accounting: parameters: path: @@ -898,7 +932,7 @@ examples: orderBy: "-modifiedDate" responses: "200": - application/json: {"_links": {"current": {"href": "/companies/390083e2-351b-407c-a3be-55081c36c182/connections/37916fb7-b4b8-4a78-8872-1751e20ee0cd/data/bankAccounts?page=1&pageSize=2"}, "next": {"href": "/companies/390083e2-351b-407c-a3be-55081c36c182/connections/37916fb7-b4b8-4a78-8872-1751e20ee0cd/data/bankAccounts?page=2&pageSize=2"}, "self": {"href": "/companies/390083e2-351b-407c-a3be-55081c36c182/connections/37916fb7-b4b8-4a78-8872-1751e20ee0cd/data/bankAccounts"}}, "pageNumber": 1, "pageSize": 2, "results": [{"accountName": "Abdi Internet Bank", "accountNumber": "11111", "accountType": "Unknown", "availableBalance": 49.61, "balance": 49.61, "currency": "GBP", "id": "154d05abe9f24c4babe0f6a741dec1b9", "modifiedDate": "2022-10-24T14:52:53Z", "nominalCode": "1560", "sortCode": "010101", "sourceModifiedDate": "2020-01-27T10:53:26Z", "status": "Active"}, {"accountName": "Abdi Live Test", "accountNumber": "1234567", "accountType": "Unknown", "availableBalance": -225830.75, "balance": -225830.75, "currency": "GBP", "id": "565ce07212bc492c8c2d04f43f9f67e3", "modifiedDate": "2022-10-24T14:52:53Z", "nominalCode": "147852", "sortCode": "123456", "sourceModifiedDate": "2020-01-28T14:00:20Z", "status": "Active"}], "totalResults": 45} + application/json: {"_links": {"current": {"href": "/companies/390083e2-351b-407c-a3be-55081c36c182/connections/37916fb7-b4b8-4a78-8872-1751e20ee0cd/data/bankAccounts?page=1&pageSize=2"}, "next": {"href": "/companies/390083e2-351b-407c-a3be-55081c36c182/connections/37916fb7-b4b8-4a78-8872-1751e20ee0cd/data/bankAccounts?page=2&pageSize=2"}, "self": {"href": "/companies/390083e2-351b-407c-a3be-55081c36c182/connections/37916fb7-b4b8-4a78-8872-1751e20ee0cd/data/bankAccounts"}}, "pageNumber": 1, "pageSize": 2, "results": [{"accountName": "Abdi Internet Bank", "accountNumber": "11111", "accountType": "Unknown", "availableBalance": 49.61, "balance": 49.61, "currency": "GBP", "id": "154d05abe9f24c4babe0f6a741dec1b9", "modifiedDate": "2022-10-24T14:52:53Z", "nominalCode": "1560", "sortCode": "010101", "sourceModifiedDate": "2020-01-27T10:53:26Z"}, {"accountName": "Abdi Live Test", "accountNumber": "1234567", "accountType": "Unknown", "availableBalance": -225830.75, "balance": -225830.75, "currency": "GBP", "id": "565ce07212bc492c8c2d04f43f9f67e3", "modifiedDate": "2022-10-24T14:52:53Z", "nominalCode": "147852", "sortCode": "123456", "sourceModifiedDate": "2020-01-28T14:00:20Z"}], "totalResults": 45} Sage Intacct: parameters: path: @@ -911,7 +945,7 @@ examples: orderBy: "-modifiedDate" responses: "200": - application/json: {"_links": {"current": {"href": "/companies/df02b289-cb16-4964-ac4d-9fd60b04538e/connections/8f457d9c-1142-4241-a07e-71d1ee2e3052/data/bankAccounts?page=1&pageSize=2"}, "next": {"href": "/companies/df02b289-cb16-4964-ac4d-9fd60b04538e/connections/8f457d9c-1142-4241-a07e-71d1ee2e3052/data/bankAccounts?page=2&pageSize=2"}, "self": {"href": "/companies/df02b289-cb16-4964-ac4d-9fd60b04538e/connections/8f457d9c-1142-4241-a07e-71d1ee2e3052/data/bankAccounts"}}, "pageNumber": 1, "pageSize": 2, "results": [{"accountName": "CoT Credit Card", "accountType": "Credit", "currency": "GBP", "id": "CREDITCARD:55", "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-04T16:31:46Z", "nominalCode": "10021", "sourceModifiedDate": "2023-03-27T14:11:48", "status": "Active"}, {"accountName": "Cot Credit Card 2", "accountType": "Credit", "currency": "GBP", "id": "CREDITCARD:58", "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-04T16:31:46Z", "nominalCode": "11112", "sourceModifiedDate": "2023-03-27T14:15:11", "status": "Active"}], "totalResults": 14} + application/json: {"_links": {"current": {"href": "/companies/df02b289-cb16-4964-ac4d-9fd60b04538e/connections/8f457d9c-1142-4241-a07e-71d1ee2e3052/data/bankAccounts?page=1&pageSize=2"}, "next": {"href": "/companies/df02b289-cb16-4964-ac4d-9fd60b04538e/connections/8f457d9c-1142-4241-a07e-71d1ee2e3052/data/bankAccounts?page=2&pageSize=2"}, "self": {"href": "/companies/df02b289-cb16-4964-ac4d-9fd60b04538e/connections/8f457d9c-1142-4241-a07e-71d1ee2e3052/data/bankAccounts"}}, "pageNumber": 1, "pageSize": 2, "results": [{"accountName": "CoT Credit Card", "accountType": "Credit", "currency": "GBP", "id": "CREDITCARD:55", "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-04T16:31:46Z", "nominalCode": "10021", "sourceModifiedDate": "2023-03-27T14:11:48"}, {"accountName": "Cot Credit Card 2", "accountType": "Credit", "currency": "GBP", "id": "CREDITCARD:58", "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-04T16:31:46Z", "nominalCode": "11112", "sourceModifiedDate": "2023-03-27T14:15:11"}], "totalResults": 14} Xero: parameters: path: @@ -924,7 +958,7 @@ examples: orderBy: "-modifiedDate" responses: "200": - application/json: {"_links": {"current": {"href": "/companies/5ced9667-a310-443a-a711-958d36377141/connections/6a4bcf97-e46a-465c-abf6-c42cec8e48c0/data/bankAccounts?page=1&pageSize=2"}, "self": {"href": "/companies/5ced9667-a310-443a-a711-958d36377141/connections/6a4bcf97-e46a-465c-abf6-c42cec8e48c0/data/bankAccounts"}}, "pageNumber": 1, "pageSize": 2, "results": [{"accountName": "Business Bank Account", "accountNumber": "987654321", "accountType": "Debit", "balance": 6681.79, "currency": "GBP", "id": "bd9e85e0-0478-433d-ae9f-0b3c4f04bfe4", "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-15T20:36:09Z", "sortCode": "990404", "sourceModifiedDate": "2023-03-15T20:35:07", "status": "Active"}, {"accountName": "Business Savings Account", "accountNumber": "876543210", "accountType": "Debit", "balance": 0, "currency": "GBP", "id": "a8d6fb1a-8c5d-4683-90ce-bf9d28fc62ba", "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-15T20:36:09Z", "sortCode": "890303", "sourceModifiedDate": "2023-03-15T20:36:06", "status": "Active"}], "totalResults": 2} + application/json: {"_links": {"current": {"href": "/companies/5ced9667-a310-443a-a711-958d36377141/connections/6a4bcf97-e46a-465c-abf6-c42cec8e48c0/data/bankAccounts?page=1&pageSize=2"}, "self": {"href": "/companies/5ced9667-a310-443a-a711-958d36377141/connections/6a4bcf97-e46a-465c-abf6-c42cec8e48c0/data/bankAccounts"}}, "pageNumber": 1, "pageSize": 2, "results": [{"accountName": "Business Bank Account", "accountNumber": "987654321", "accountType": "Debit", "balance": 6681.79, "currency": "GBP", "id": "bd9e85e0-0478-433d-ae9f-0b3c4f04bfe4", "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-15T20:36:09Z", "sortCode": "990404", "sourceModifiedDate": "2023-03-15T20:35:07"}, {"accountName": "Business Savings Account", "accountNumber": "876543210", "accountType": "Debit", "balance": 0, "currency": "GBP", "id": "a8d6fb1a-8c5d-4683-90ce-bf9d28fc62ba", "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-15T20:36:09Z", "sortCode": "890303", "sourceModifiedDate": "2023-03-15T20:36:06"}], "totalResults": 2} Zoho Books: parameters: path: @@ -937,7 +971,7 @@ examples: orderBy: "-modifiedDate" responses: "200": - application/json: {"_links": {"current": {"href": "/companies/d0b68840-db50-4bc3-b88c-96e225333fea/connections/a2324b8e-60e9-451d-8eb1-0fdc8e8224df/data/bankAccounts?page=1&pageSize=2"}, "next": {"href": "/companies/d0b68840-db50-4bc3-b88c-96e225333fea/connections/a2324b8e-60e9-451d-8eb1-0fdc8e8224df/data/bankAccounts?page=2&pageSize=2"}, "self": {"href": "/companies/d0b68840-db50-4bc3-b88c-96e225333fea/connections/a2324b8e-60e9-451d-8eb1-0fdc8e8224df/data/bankAccounts"}}, "pageNumber": 1, "pageSize": 2, "results": [{"accountName": "Abdi Test", "accountNumber": "xxxx5678", "accountType": "Unknown", "balance": 69858.44, "currency": "GBP", "id": "104957000000060010", "institution": "Test Bank", "modifiedDate": "2022-10-03T08:40:38Z", "sortCode": "112233", "sourceModifiedDate": "2022-10-23T00:00:00Z", "status": "Active"}, {"accountName": "Abdi Test 2", "accountNumber": "", "accountType": "Unknown", "balance": 98.03, "currency": "AED", "id": "104957000000065002", "institution": "", "modifiedDate": "2022-10-03T08:40:38Z", "sortCode": "", "sourceModifiedDate": "2022-10-23T00:00:00Z", "status": "Active"}], "totalResults": 4} + application/json: {"_links": {"current": {"href": "/companies/d0b68840-db50-4bc3-b88c-96e225333fea/connections/a2324b8e-60e9-451d-8eb1-0fdc8e8224df/data/bankAccounts?page=1&pageSize=2"}, "next": {"href": "/companies/d0b68840-db50-4bc3-b88c-96e225333fea/connections/a2324b8e-60e9-451d-8eb1-0fdc8e8224df/data/bankAccounts?page=2&pageSize=2"}, "self": {"href": "/companies/d0b68840-db50-4bc3-b88c-96e225333fea/connections/a2324b8e-60e9-451d-8eb1-0fdc8e8224df/data/bankAccounts"}}, "pageNumber": 1, "pageSize": 2, "results": [{"accountName": "Abdi Test", "accountNumber": "xxxx5678", "accountType": "Unknown", "balance": 69858.44, "currency": "GBP", "id": "104957000000060010", "institution": "Test Bank", "modifiedDate": "2022-10-03T08:40:38Z", "sortCode": "112233"}, {"accountName": "Abdi Test 2", "accountNumber": "", "accountType": "Unknown", "balance": 98.03, "currency": "AED", "id": "104957000000065002", "institution": "", "modifiedDate": "2022-10-03T08:40:38Z", "sortCode": ""}], "totalResults": 4} Malformed query: parameters: path: @@ -986,7 +1020,7 @@ examples: accountId: "7110701885" query: {} requestBody: - application/json: {"accountId": "49cd5a42-b311-4750-9361-52e2ed1d4653", "transactions": [{"amount": 100, "balance": 100, "counterparty": "ACME INC", "date": "2023-08-22T10:21:00Z", "description": "Repayment of Credit Card", "id": "716422529", "reconciled": false, "reference": "reference for transaction", "transactionType": "Credit"}, {"amount": -100, "balance": 0, "counterparty": "ACME INC", "date": "2023-08-22T10:22:00Z", "description": "Amazon Purchase", "id": "716422530", "reconciled": false, "reference": "reference for transaction", "transactionType": "Debit"}, {"amount": -60, "balance": -60, "counterparty": "ACME INC", "date": "2023-08-22T10:23:00Z", "description": "Office Supplies", "id": "716422531", "reconciled": false, "reference": "reference for transaction", "transactionType": "Debit"}]} + application/json: {"accountId": "49cd5a42-b311-4750-9361-52e2ed1d4653", "transactions": [{"amount": 100, "balance": 100, "date": "2023-08-22T10:21:00Z", "description": "Repayment of Credit Card", "id": "716422529", "transactionType": "Credit"}, {"amount": -100, "balance": 0, "date": "2023-08-22T10:22:00Z", "description": "Amazon Purchase", "id": "716422530", "transactionType": "Debit"}, {"amount": -60, "balance": -60, "date": "2023-08-22T10:23:00Z", "description": "Office Supplies", "id": "716422531", "transactionType": "Debit"}]} responses: "200": application/json: {"changes": [], "companyId": "8a210b68-6988-11ed-a1eb-0242ac120002", "completedOnUtc": "2022-10-23T00:00:00Z", "data": {"accountId": "Checking 0202", "transactions": []}, "dataConnectionKey": "2e9d2c44-f675-40ba-8049-353bfcb5e171", "dataType": "invoices", "pushOperationKey": "261915a2-5d0d-49ea-9320-e8504aa8ce67", "requestedOnUtc": "2022-10-23T00:00:00Z", "status": "Failed", "statusCode": 775787} @@ -999,7 +1033,7 @@ examples: accountId: "9wg4lep4ush5cxs79pl8sozmsndbaukll3ind4g7buqbm1h2" query: {} requestBody: - application/json: {"accountId": "49cd5a42-b311-4750-9361-52e2ed1d4653", "transactions": [{"amount": 100, "balance": -999.99, "counterparty": "ACME INC", "date": "2023-08-22T10:21:00Z", "description": "Repayment of Credit Card", "id": "716422529", "reconciled": false, "reference": "reference for transaction", "transactionType": "Credit"}, {"amount": -100, "balance": -999.99, "counterparty": "ACME INC", "date": "2023-08-22T10:22:00Z", "description": "Amazon Purchase", "id": "716422530", "reconciled": false, "reference": "reference for transaction", "transactionType": "Debit"}, {"amount": -60, "balance": -999.99, "counterparty": "ACME INC", "date": "2023-08-22T10:23:00Z", "description": "Office Supplies", "id": "716422531", "reconciled": false, "reference": "reference for transaction", "transactionType": "Debit"}]} + application/json: {"accountId": "49cd5a42-b311-4750-9361-52e2ed1d4653", "transactions": [{"amount": 100, "date": "2023-08-22T10:21:00Z", "description": "Repayment of Credit Card", "id": "716422529", "transactionType": "Credit"}, {"amount": -100, "date": "2023-08-22T10:22:00Z", "description": "Amazon Purchase", "id": "716422530", "transactionType": "Debit"}, {"amount": -60, "date": "2023-08-22T10:23:00Z", "description": "Office Supplies", "id": "716422531", "transactionType": "Debit"}]} responses: "200": application/json: {"changes": [], "companyId": "8a210b68-6988-11ed-a1eb-0242ac120002", "completedOnUtc": "2022-10-23T00:00:00Z", "data": {"accountId": "EILBDVJVNUAGVKRQ", "transactions": []}, "dataConnectionKey": "2e9d2c44-f675-40ba-8049-353bfcb5e171", "dataType": "invoices", "pushOperationKey": "cf24bdeb-cfc2-43e7-96f9-415747251ef0", "requestedOnUtc": "2022-10-23T00:00:00Z", "status": "Pending", "statusCode": 363328} @@ -1012,7 +1046,7 @@ examples: accountId: "13d946f0-c5d5-42bc-b092-97ece17923ab" query: {} requestBody: - application/json: {"accountId": "49cd5a42-b311-4750-9361-52e2ed1d4653", "transactions": [{"amount": 100, "balance": 100, "counterparty": "Bank of Example", "date": "2023-08-22T10:21:00Z", "description": "Repayment of Credit Card", "id": "716422529", "reconciled": false, "reference": "Ref-12345", "transactionType": "Credit"}, {"amount": -100, "balance": 0, "counterparty": "Amazon", "date": "2023-08-22T10:22:00Z", "description": "Amazon Purchase", "id": "716422530", "reconciled": false, "reference": "Ref-12346", "transactionType": "Debit"}, {"amount": -60, "balance": -60, "counterparty": "Office Mart", "date": "2023-08-22T10:23:00Z", "description": "Office Supplies", "id": "716422531", "reconciled": false, "reference": "Ref-12347", "transactionType": "Debit"}]} + application/json: {"accountId": "49cd5a42-b311-4750-9361-52e2ed1d4653", "transactions": [{"amount": 100, "balance": 100, "counterparty": "Bank of Example", "date": "2023-08-22T10:21:00Z", "description": "Repayment of Credit Card", "id": "716422529", "reference": "Ref-12345", "transactionType": "Credit"}, {"amount": -100, "balance": 0, "counterparty": "Amazon", "date": "2023-08-22T10:22:00Z", "description": "Amazon Purchase", "id": "716422530", "reference": "Ref-12346", "transactionType": "Debit"}, {"amount": -60, "balance": -60, "counterparty": "Office Mart", "date": "2023-08-22T10:23:00Z", "description": "Office Supplies", "id": "716422531", "reference": "Ref-12347", "transactionType": "Debit"}]} responses: "200": application/json: {"changes": [], "companyId": "8a210b68-6988-11ed-a1eb-0242ac120002", "completedOnUtc": "2022-10-23T00:00:00Z", "data": {"accountId": "7110701885", "transactions": []}, "dataConnectionKey": "2e9d2c44-f675-40ba-8049-353bfcb5e171", "dataType": "invoices", "pushOperationKey": "95835d6b-1b39-4d7e-a0de-fed8d063eda5", "requestedOnUtc": "2022-10-23T00:00:00Z", "status": "Failed", "statusCode": 121860} @@ -1102,3 +1136,40 @@ examples: responses: "401": application/json: {"canBeRetried": "Unknown", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "detailedErrorCode": 0, "error": "Unauthorized", "service": "PublicApi", "statusCode": 401} + get-company-access-token: + Simple company: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + responses: + "200": + application/json: {"accessToken": "string", "expiresIn": 86400, "tokenType": "Bearer"} + Unauthorized: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + responses: + "401": + application/json: {"canBeRetried": "Unknown", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "detailedErrorCode": 0, "error": "Unauthorized", "service": "PublicApi", "statusCode": 401} + create-batch-source-account: + Malformed query: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + requestBody: + application/json: [{"accountName": "account-081", "accountNumber": "12345670", "accountType": "Credit", "balance": 99.99, "currency": "GBP", "id": "acc-002", "modifiedDate": "2023-01-09T14:14:14.1057478Z", "sortCode": "123456", "status": "pending"}, {"accountName": "account-095", "accountNumber": "12345671", "accountType": "Credit", "balance": 0, "currency": "USD", "id": "acc-003", "modifiedDate": "2023-01-09T14:14:14.1057478Z", "sortCode": "123456", "status": "pending"}] + responses: + "400": + application/json: {"canBeRetried": "Unknown", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "detailedErrorCode": 0, "error": "Error processing request - not valid.", "service": "PublicApi", "statusCode": 400} + get-create-bank-transactions-model: + Unauthorized: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + accountId: "13d946f0-c5d5-42bc-b092-97ece17923ab" + responses: + "401": + application/json: {"canBeRetried": "Unknown", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "detailedErrorCode": 0, "error": "Unauthorized", "service": "PublicApi", "statusCode": 401} +generatedTests: {} diff --git a/bank-feeds/.speakeasy/gen.yaml b/bank-feeds/.speakeasy/gen.yaml index 1ec14e9b1..2ef3acff1 100644 --- a/bank-feeds/.speakeasy/gen.yaml +++ b/bank-feeds/.speakeasy/gen.yaml @@ -12,7 +12,7 @@ generation: oAuth2PasswordEnabled: false telemetryEnabled: true python: - version: 8.0.0 + version: 9.0.0 additionalDependencies: dev: {} main: {} @@ -20,6 +20,7 @@ python: authors: - Speakeasy clientServerStatusCodesAsErrors: true + defaultErrorName: SDKError description: Set up bank feeds from accounts in your application to supported accounting software. enumFormat: enum fixFlags: diff --git a/bank-feeds/README.md b/bank-feeds/README.md index 05696bd5d..8c55d95cf 100755 --- a/bank-feeds/README.md +++ b/bank-feeds/README.md @@ -87,20 +87,19 @@ Generally, the SDK will work well with most IDEs out of the box. However, when u from codat_bankfeeds import CodatBankFeeds from codat_bankfeeds.models import shared -s = CodatBankFeeds( +with CodatBankFeeds( security=shared.Security( auth_header="Basic BASE_64_ENCODED(API_KEY)", ), -) - -res = s.companies.create(request={ - "name": "Technicalium", - "description": "Requested early access to the new financing scheme.", -}) +) as s: + res = s.companies.create(request={ + "name": "Technicalium", + "description": "Requested early access to the new financing scheme.", + }) -if res is not None: - # handle response - pass + if res is not None: + # handle response + pass ```
@@ -113,18 +112,19 @@ from codat_bankfeeds import CodatBankFeeds from codat_bankfeeds.models import shared async def main(): - s = CodatBankFeeds( + async with CodatBankFeeds( security=shared.Security( auth_header="Basic BASE_64_ENCODED(API_KEY)", ), - ) - res = await s.companies.create_async(request={ - "name": "Technicalium", - "description": "Requested early access to the new financing scheme.", - }) - if res is not None: - # handle response - pass + ) as s: + res = await s.companies.create_async(request={ + "name": "Technicalium", + "description": "Requested early access to the new financing scheme.", + }) + + if res is not None: + # handle response + pass asyncio.run(main()) ``` @@ -153,6 +153,7 @@ asyncio.run(main()) * [create](docs/sdks/companies/README.md#create) - Create company * [delete](docs/sdks/companies/README.md#delete) - Delete a company * [get](docs/sdks/companies/README.md#get) - Get company +* [get_access_token](docs/sdks/companies/README.md#get_access_token) - Get company access token * [list](docs/sdks/companies/README.md#list) - List companies * [update](docs/sdks/companies/README.md#update) - Update company @@ -175,7 +176,8 @@ asyncio.run(main()) ### [source_accounts](docs/sdks/sourceaccounts/README.md) -* [create](docs/sdks/sourceaccounts/README.md#create) - Create source account +* [create](docs/sdks/sourceaccounts/README.md#create) - Create single source account +* [create_batch](docs/sdks/sourceaccounts/README.md#create_batch) - Create source accounts * [delete](docs/sdks/sourceaccounts/README.md#delete) - Delete source account * [delete_credentials](docs/sdks/sourceaccounts/README.md#delete_credentials) - Delete all source account credentials * [generate_credentials](docs/sdks/sourceaccounts/README.md#generate_credentials) - Generate source account credentials @@ -189,6 +191,7 @@ asyncio.run(main()) ### [transactions](docs/sdks/transactions/README.md) * [create](docs/sdks/transactions/README.md#create) - Create bank transactions +* [get_create_model](docs/sdks/transactions/README.md#get_create_model) - Get create bank transactions model * [get_create_operation](docs/sdks/transactions/README.md#get_create_operation) - Get create operation * [list_create_operations](docs/sdks/transactions/README.md#list_create_operations) - List create operations @@ -213,21 +216,20 @@ Certain SDK methods accept file objects as part of a request body or multi-part from codat_bankfeeds import CodatBankFeeds from codat_bankfeeds.models import shared -s = CodatBankFeeds( +with CodatBankFeeds( security=shared.Security( auth_header="Basic BASE_64_ENCODED(API_KEY)", ), -) - -res = s.source_accounts.generate_credentials(request={ - "request_body": open("example.file", "rb"), - "company_id": "8a210b68-6988-11ed-a1eb-0242ac120002", - "connection_id": "2e9d2c44-f675-40ba-8049-353bfcb5e171", -}) +) as s: + res = s.source_accounts.generate_credentials(request={ + "request_body": open("example.file", "rb"), + "company_id": "8a210b68-6988-11ed-a1eb-0242ac120002", + "connection_id": "2e9d2c44-f675-40ba-8049-353bfcb5e171", + }) -if res is not None: - # handle response - pass + if res is not None: + # handle response + pass ``` @@ -243,21 +245,20 @@ from codat_bankfeeds import CodatBankFeeds from codat_bankfeeds.models import shared from codatbankfeeds.utils import BackoffStrategy, RetryConfig -s = CodatBankFeeds( +with CodatBankFeeds( security=shared.Security( auth_header="Basic BASE_64_ENCODED(API_KEY)", ), -) - -res = s.companies.create(request={ - "name": "Technicalium", - "description": "Requested early access to the new financing scheme.", -}, - RetryConfig("backoff", BackoffStrategy(1, 50, 1.1, 100), False)) +) as s: + res = s.companies.create(request={ + "name": "Technicalium", + "description": "Requested early access to the new financing scheme.", + }, + RetryConfig("backoff", BackoffStrategy(1, 50, 1.1, 100), False)) -if res is not None: - # handle response - pass + if res is not None: + # handle response + pass ``` @@ -267,21 +268,20 @@ from codat_bankfeeds import CodatBankFeeds from codat_bankfeeds.models import shared from codatbankfeeds.utils import BackoffStrategy, RetryConfig -s = CodatBankFeeds( +with CodatBankFeeds( retry_config=RetryConfig("backoff", BackoffStrategy(1, 50, 1.1, 100), False), security=shared.Security( auth_header="Basic BASE_64_ENCODED(API_KEY)", ), -) - -res = s.companies.create(request={ - "name": "Technicalium", - "description": "Requested early access to the new financing scheme.", -}) +) as s: + res = s.companies.create(request={ + "name": "Technicalium", + "description": "Requested early access to the new financing scheme.", + }) -if res is not None: - # handle response - pass + if res is not None: + # handle response + pass ``` @@ -304,10 +304,10 @@ By default, an API error will raise a errors.SDKError exception, which has the f When custom error responses are specified for an operation, the SDK may also raise their associated exceptions. You can refer to respective *Errors* tables in SDK docs for more details on possible exception types for each operation. For example, the `create_async` method may raise the following exceptions: -| Error Type | Status Code | Content Type | -| --------------------------------- | --------------------------------- | --------------------------------- | -| errors.ErrorMessage | 400, 401, 402, 403, 429, 500, 503 | application/json | -| errors.SDKError | 4XX, 5XX | \*/\* | +| Error Type | Status Code | Content Type | +| ------------------- | --------------------------------- | ---------------- | +| errors.ErrorMessage | 400, 401, 402, 403, 429, 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | ### Example @@ -315,29 +315,28 @@ When custom error responses are specified for an operation, the SDK may also rai from codat_bankfeeds import CodatBankFeeds from codat_bankfeeds.models import errors, shared -s = CodatBankFeeds( +with CodatBankFeeds( security=shared.Security( auth_header="Basic BASE_64_ENCODED(API_KEY)", ), -) - -res = None -try: - res = s.companies.create(request={ - "name": "Technicalium", - "description": "Requested early access to the new financing scheme.", - }) - - if res is not None: - # handle response - pass - -except errors.ErrorMessage as e: - # handle e.data: errors.ErrorMessageData - raise(e) -except errors.SDKError as e: - # handle exception - raise(e) +) as s: + res = None + try: + res = s.companies.create(request={ + "name": "Technicalium", + "description": "Requested early access to the new financing scheme.", + }) + + if res is not None: + # handle response + pass + + except errors.ErrorMessage as e: + # handle e.data: errors.ErrorMessageData + raise(e) + except errors.SDKError as e: + # handle exception + raise(e) ``` @@ -346,39 +345,6 @@ except errors.SDKError as e: ## Server Selection -### Select Server by Index - -You can override the default server globally by passing a server index to the `server_idx: int` optional parameter when initializing the SDK client instance. The selected server will then be used as the default on the operations that use it. This table lists the indexes associated with the available servers: - -| # | Server | Variables | -| - | ------ | --------- | -| 0 | `https://api.codat.io` | None | - -#### Example - -```python -from codat_bankfeeds import CodatBankFeeds -from codat_bankfeeds.models import shared - -s = CodatBankFeeds( - server_idx=0, - security=shared.Security( - auth_header="Basic BASE_64_ENCODED(API_KEY)", - ), -) - -res = s.companies.create(request={ - "name": "Technicalium", - "description": "Requested early access to the new financing scheme.", -}) - -if res is not None: - # handle response - pass - -``` - - ### Override Server URL Per-Client The default server can also be overridden globally by passing a URL to the `server_url: str` optional parameter when initializing the SDK client instance. For example: @@ -386,21 +352,20 @@ The default server can also be overridden globally by passing a URL to the `serv from codat_bankfeeds import CodatBankFeeds from codat_bankfeeds.models import shared -s = CodatBankFeeds( +with CodatBankFeeds( server_url="https://api.codat.io", security=shared.Security( auth_header="Basic BASE_64_ENCODED(API_KEY)", ), -) - -res = s.companies.create(request={ - "name": "Technicalium", - "description": "Requested early access to the new financing scheme.", -}) +) as s: + res = s.companies.create(request={ + "name": "Technicalium", + "description": "Requested early access to the new financing scheme.", + }) -if res is not None: - # handle response - pass + if res is not None: + # handle response + pass ``` @@ -497,29 +462,28 @@ s = CodatBankFeeds(async_client=CustomClient(httpx.AsyncClient())) This SDK supports the following security scheme globally: -| Name | Type | Scheme | -| ------------- | ------------- | ------------- | -| `auth_header` | apiKey | API key | +| Name | Type | Scheme | +| ------------- | ------ | ------- | +| `auth_header` | apiKey | API key | You can set the security parameters through the `security` optional parameter when initializing the SDK client instance. For example: ```python from codat_bankfeeds import CodatBankFeeds from codat_bankfeeds.models import shared -s = CodatBankFeeds( +with CodatBankFeeds( security=shared.Security( auth_header="Basic BASE_64_ENCODED(API_KEY)", ), -) - -res = s.companies.create(request={ - "name": "Technicalium", - "description": "Requested early access to the new financing scheme.", -}) +) as s: + res = s.companies.create(request={ + "name": "Technicalium", + "description": "Requested early access to the new financing scheme.", + }) -if res is not None: - # handle response - pass + if res is not None: + # handle response + pass ``` diff --git a/bank-feeds/RELEASES.md b/bank-feeds/RELEASES.md index 1ae1d0ee2..51b8fdc75 100644 --- a/bank-feeds/RELEASES.md +++ b/bank-feeds/RELEASES.md @@ -808,4 +808,14 @@ Based on: ### Generated - [python v8.0.0] bank-feeds ### Releases -- [PyPI v8.0.0] https://pypi.org/project/codat-bankfeeds/8.0.0 - bank-feeds \ No newline at end of file +- [PyPI v8.0.0] https://pypi.org/project/codat-bankfeeds/8.0.0 - bank-feeds + +## 2024-11-26 15:19:49 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.446.1 (2.462.1) https://github.com/speakeasy-api/speakeasy +### Generated +- [python v9.0.0] bank-feeds +### Releases +- [PyPI v9.0.0] https://pypi.org/project/codat-bankfeeds/9.0.0 - bank-feeds \ No newline at end of file diff --git a/bank-feeds/USAGE.md b/bank-feeds/USAGE.md index 390c88283..c4bc878e3 100644 --- a/bank-feeds/USAGE.md +++ b/bank-feeds/USAGE.md @@ -4,20 +4,19 @@ from codat_bankfeeds import CodatBankFeeds from codat_bankfeeds.models import shared -s = CodatBankFeeds( +with CodatBankFeeds( security=shared.Security( auth_header="Basic BASE_64_ENCODED(API_KEY)", ), -) - -res = s.companies.create(request={ - "name": "Technicalium", - "description": "Requested early access to the new financing scheme.", -}) +) as s: + res = s.companies.create(request={ + "name": "Technicalium", + "description": "Requested early access to the new financing scheme.", + }) -if res is not None: - # handle response - pass + if res is not None: + # handle response + pass ```
@@ -30,18 +29,19 @@ from codat_bankfeeds import CodatBankFeeds from codat_bankfeeds.models import shared async def main(): - s = CodatBankFeeds( + async with CodatBankFeeds( security=shared.Security( auth_header="Basic BASE_64_ENCODED(API_KEY)", ), - ) - res = await s.companies.create_async(request={ - "name": "Technicalium", - "description": "Requested early access to the new financing scheme.", - }) - if res is not None: - # handle response - pass + ) as s: + res = await s.companies.create_async(request={ + "name": "Technicalium", + "description": "Requested early access to the new financing scheme.", + }) + + if res is not None: + # handle response + pass asyncio.run(main()) ``` diff --git a/bank-feeds/docs/models/operations/createbatchsourceaccount1.md b/bank-feeds/docs/models/operations/createbatchsourceaccount1.md new file mode 100644 index 000000000..e4089ed93 --- /dev/null +++ b/bank-feeds/docs/models/operations/createbatchsourceaccount1.md @@ -0,0 +1,23 @@ +# CreateBatchSourceAccount1 + + +## Supported Types + +### `shared.SourceAccountV2BatchCreateResponse` + +```python +value: shared.SourceAccountV2BatchCreateResponse = /* values here */ +``` + +### `shared.SourceAccountBatchCreateResponse` + +```python +value: shared.SourceAccountBatchCreateResponse = /* values here */ +``` + +### `shared.SourceAccountBatchErrorResponse` + +```python +value: shared.SourceAccountBatchErrorResponse = /* values here */ +``` + diff --git a/bank-feeds/docs/models/operations/createbatchsourceaccountrequest.md b/bank-feeds/docs/models/operations/createbatchsourceaccountrequest.md new file mode 100644 index 000000000..c37b42551 --- /dev/null +++ b/bank-feeds/docs/models/operations/createbatchsourceaccountrequest.md @@ -0,0 +1,10 @@ +# CreateBatchSourceAccountRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- | +| `company_id` | *str* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `connection_id` | *str* | :heavy_check_mark: | Unique identifier for a connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | +| `request_body` | [Optional[operations.CreateBatchSourceAccountRequestBody]](../../models/operations/createbatchsourceaccountrequestbody.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/bank-feeds/docs/models/operations/createbatchsourceaccountrequestbody.md b/bank-feeds/docs/models/operations/createbatchsourceaccountrequestbody.md new file mode 100644 index 000000000..1eaf4f4be --- /dev/null +++ b/bank-feeds/docs/models/operations/createbatchsourceaccountrequestbody.md @@ -0,0 +1,17 @@ +# CreateBatchSourceAccountRequestBody + + +## Supported Types + +### `List[shared.SourceAccountV2]` + +```python +value: List[shared.SourceAccountV2] = /* values here */ +``` + +### `List[shared.SourceAccount]` + +```python +value: List[shared.SourceAccount] = /* values here */ +``` + diff --git a/bank-feeds/docs/models/operations/createbatchsourceaccountresponse.md b/bank-feeds/docs/models/operations/createbatchsourceaccountresponse.md new file mode 100644 index 000000000..84382d82c --- /dev/null +++ b/bank-feeds/docs/models/operations/createbatchsourceaccountresponse.md @@ -0,0 +1,17 @@ +# CreateBatchSourceAccountResponse + + +## Supported Types + +### `operations.CreateBatchSourceAccountResponseBody` + +```python +value: operations.CreateBatchSourceAccountResponseBody = /* values here */ +``` + +### `operations.CreateBatchSourceAccountSourceAccountsResponseBody` + +```python +value: operations.CreateBatchSourceAccountSourceAccountsResponseBody = /* values here */ +``` + diff --git a/bank-feeds/docs/models/operations/createbatchsourceaccountresponsebody.md b/bank-feeds/docs/models/operations/createbatchsourceaccountresponsebody.md new file mode 100644 index 000000000..d6703cea0 --- /dev/null +++ b/bank-feeds/docs/models/operations/createbatchsourceaccountresponsebody.md @@ -0,0 +1,13 @@ +# CreateBatchSourceAccountResponseBody + +Success + + +## Supported Types + +### `List[operations.One]` + +```python +value: List[operations.One] = /* values here */ +``` + diff --git a/bank-feeds/docs/models/operations/createbatchsourceaccountsourceaccountsresponsebody.md b/bank-feeds/docs/models/operations/createbatchsourceaccountsourceaccountsresponsebody.md new file mode 100644 index 000000000..f6f205ca0 --- /dev/null +++ b/bank-feeds/docs/models/operations/createbatchsourceaccountsourceaccountsresponsebody.md @@ -0,0 +1,13 @@ +# CreateBatchSourceAccountSourceAccountsResponseBody + +Multi-Status + + +## Supported Types + +### `List[operations.CreateBatchSourceAccount1]` + +```python +value: List[operations.CreateBatchSourceAccount1] = /* values here */ +``` + diff --git a/bank-feeds/docs/models/operations/getcompanyaccesstokenrequest.md b/bank-feeds/docs/models/operations/getcompanyaccesstokenrequest.md new file mode 100644 index 000000000..255289cd1 --- /dev/null +++ b/bank-feeds/docs/models/operations/getcompanyaccesstokenrequest.md @@ -0,0 +1,8 @@ +# GetCompanyAccessTokenRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | +| `company_id` | *str* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | \ No newline at end of file diff --git a/bank-feeds/docs/models/operations/getcreatebanktransactionsmodelrequest.md b/bank-feeds/docs/models/operations/getcreatebanktransactionsmodelrequest.md new file mode 100644 index 000000000..4d0a5d6a8 --- /dev/null +++ b/bank-feeds/docs/models/operations/getcreatebanktransactionsmodelrequest.md @@ -0,0 +1,10 @@ +# GetCreateBankTransactionsModelRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | +| `account_id` | *str* | :heavy_check_mark: | Unique identifier for an account. | 13d946f0-c5d5-42bc-b092-97ece17923ab | +| `company_id` | *str* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `connection_id` | *str* | :heavy_check_mark: | Unique identifier for a connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | \ No newline at end of file diff --git a/bank-feeds/docs/models/operations/one.md b/bank-feeds/docs/models/operations/one.md new file mode 100644 index 000000000..1ae630b86 --- /dev/null +++ b/bank-feeds/docs/models/operations/one.md @@ -0,0 +1,17 @@ +# One + + +## Supported Types + +### `shared.SourceAccountV2BatchCreateResponse` + +```python +value: shared.SourceAccountV2BatchCreateResponse = /* values here */ +``` + +### `shared.SourceAccountBatchCreateResponse` + +```python +value: shared.SourceAccountBatchCreateResponse = /* values here */ +``` + diff --git a/bank-feeds/docs/models/shared/banktransactions.md b/bank-feeds/docs/models/shared/banktransactions.md index 8b602bee7..be72a76ed 100644 --- a/bank-feeds/docs/models/shared/banktransactions.md +++ b/bank-feeds/docs/models/shared/banktransactions.md @@ -5,12 +5,12 @@ | Field | Type | Required | Description | Example | | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `amount` | *Decimal* | :heavy_check_mark: | The amount transacted in the bank transaction. | 999.99 | -| `date_` | *str* | :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-23 00:00:00 +0000 UTC | -| `id` | *str* | :heavy_check_mark: | Identifier for the bank account transaction, unique for the company in the accounting software. | 716422529 | +| `amount` | *Optional[Decimal]* | :heavy_minus_sign: | The amount transacted in the bank transaction. | 999.99 | | `balance` | *Optional[Decimal]* | :heavy_minus_sign: | The remaining balance in the account with ID `accountId`. This field is optional for QuickBooks Online but is required for Xero, Sage, NetSuite, Exact, and FreeAgent. | -999.99 | | `counterparty` | *OptionalNullable[str]* | :heavy_minus_sign: | The giving or receiving party such as a person or organization. | ACME INC | +| `date_` | *Optional[str]* | :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-23 00:00:00 +0000 UTC | | `description` | *OptionalNullable[str]* | :heavy_minus_sign: | Description of the bank transaction. | Debit for Payment Id sdp-1-57379a43-c4b8-49f5-bd7c-699189ee7a60 | +| `id` | *Optional[str]* | :heavy_minus_sign: | Identifier for the bank account transaction, unique for the company in the accounting software. | 716422529 | | `reconciled` | *OptionalNullable[bool]* | :heavy_minus_sign: | `True` if the bank transaction has been [reconciled](https://www.xero.com/uk/guides/what-is-bank-reconciliation/) in the accounting software. | false | | `reference` | *OptionalNullable[str]* | :heavy_minus_sign: | An optional reference to the bank transaction. | reference for transaction | | `transaction_type` | [OptionalNullable[shared.BankTransactionType]](../../models/shared/banktransactiontype.md) | :heavy_minus_sign: | Type of transaction for the bank statement line. | | \ No newline at end of file diff --git a/bank-feeds/docs/models/shared/company.md b/bank-feeds/docs/models/shared/company.md index 51998485c..0da188d28 100644 --- a/bank-feeds/docs/models/shared/company.md +++ b/bank-feeds/docs/models/shared/company.md @@ -20,4 +20,6 @@ When you create a company, you can specify a `name` and we will automatically ge | `description` | *Optional[str]* | :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. | | `last_sync` | *Optional[str]* | :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-23 00:00:00 +0000 UTC | | `products` | List[*str*] | :heavy_minus_sign: | An array of products that are currently enabled for the company. | | +| `reference_parent_company` | [Optional[shared.CompanyReference]](../../models/shared/companyreference.md) | :heavy_minus_sign: | N/A | | +| `reference_subsidiary_companies` | List[[shared.CompanyReference](../../models/shared/companyreference.md)] | :heavy_minus_sign: | A list of subsidiary companies owned or controlled by this entity. Empty if the company has no children. | | | `tags` | Dict[str, *str*] | :heavy_minus_sign: | A collection of user-defined key-value pairs that store custom metadata against the company. | | \ No newline at end of file diff --git a/bank-feeds/docs/models/shared/companyaccesstoken.md b/bank-feeds/docs/models/shared/companyaccesstoken.md new file mode 100644 index 000000000..a6304c6d3 --- /dev/null +++ b/bank-feeds/docs/models/shared/companyaccesstoken.md @@ -0,0 +1,12 @@ +# CompanyAccessToken + +Details of the access token provisioned for a company. + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | +| `access_token` | *str* | :heavy_check_mark: | The access token for the company. | | +| `expires_in` | *int* | :heavy_check_mark: | The number of seconds until the access token expires. | 86400 | +| `token_type` | *str* | :heavy_check_mark: | The type of token. | Bearer | \ No newline at end of file diff --git a/bank-feeds/docs/models/shared/result.md b/bank-feeds/docs/models/shared/result.md new file mode 100644 index 000000000..b279abf71 --- /dev/null +++ b/bank-feeds/docs/models/shared/result.md @@ -0,0 +1,9 @@ +# Result + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | +| `error` | *Optional[str]* | :heavy_minus_sign: | The error description for the attempted creation of the source account. | A bank account already exists with the same Id | +| `status_code` | *Optional[str]* | :heavy_minus_sign: | The error status code for the attempted creation of the source account. | 409 | \ No newline at end of file diff --git a/bank-feeds/docs/models/shared/sourceaccountbatchcreateresponse.md b/bank-feeds/docs/models/shared/sourceaccountbatchcreateresponse.md new file mode 100644 index 000000000..0ed65bf9b --- /dev/null +++ b/bank-feeds/docs/models/shared/sourceaccountbatchcreateresponse.md @@ -0,0 +1,11 @@ +# SourceAccountBatchCreateResponse + +The account ID and source account object of the successfully created source account. + + +## Fields + +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `result` | [Optional[shared.SourceAccount]](../../models/shared/sourceaccount.md) | :heavy_minus_sign: | The target bank account in a supported accounting software for ingestion into a bank feed. | {
"id": "acc-002",
"accountName": "account-081",
"sortCode": "123456",
"accountType": "Credit",
"accountNumber": "12345670",
"currency": "GBP",
"balance": 99.99,
"modifiedDate": "2023-01-09T14:14:14.1057478Z",
"status": "pending"
} | +| `source_account_id` | *Optional[str]* | :heavy_minus_sign: | Unique ID for the source account. | 12345 | \ No newline at end of file diff --git a/bank-feeds/docs/models/shared/sourceaccountbatcherrorresponse.md b/bank-feeds/docs/models/shared/sourceaccountbatcherrorresponse.md new file mode 100644 index 000000000..e53dc360f --- /dev/null +++ b/bank-feeds/docs/models/shared/sourceaccountbatcherrorresponse.md @@ -0,0 +1,11 @@ +# SourceAccountBatchErrorResponse + +Describes the error that occured when trying to create the specified source account. + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | +| `result` | [Optional[shared.Result]](../../models/shared/result.md) | :heavy_minus_sign: | N/A | | +| `source_account_id` | *Optional[str]* | :heavy_minus_sign: | Unique ID for the source account. | 12345 | \ No newline at end of file diff --git a/bank-feeds/docs/models/shared/sourceaccountv2batchcreateresponse.md b/bank-feeds/docs/models/shared/sourceaccountv2batchcreateresponse.md new file mode 100644 index 000000000..77bc6c481 --- /dev/null +++ b/bank-feeds/docs/models/shared/sourceaccountv2batchcreateresponse.md @@ -0,0 +1,11 @@ +# SourceAccountV2BatchCreateResponse + +The account ID and source account object of the successfully created source account. + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `result` | [Optional[shared.SourceAccountV2]](../../models/shared/sourceaccountv2.md) | :heavy_minus_sign: | The target bank account in a supported accounting software for ingestion into a bank feed. | {
"id": "acc-001",
"accountName": "account-081",
"accountType": "checking",
"accountNumber": "12345670",
"routingInfo": {
"bankCode": 21001088,
"type": "bankcode"
},
"currency": "GBP",
"balance": 99.99,
"accountInfo": {
"description": "account description 1",
"nickname": "account 123",
"accountOpenDate": "2023-05-06T00:00:00Z",
"availableBalance": 10
},
"modifiedDate": "2024-08-02T00:00:00.000Z",
"status": "pending",
"feedStartDate": "2024-05-01T00:00:00Z"
} | +| `source_account_id` | *Optional[str]* | :heavy_minus_sign: | Unique ID for the source account. | 12345 | \ No newline at end of file diff --git a/bank-feeds/docs/sdks/accountmapping/README.md b/bank-feeds/docs/sdks/accountmapping/README.md index a7c74ed34..06b7b397e 100644 --- a/bank-feeds/docs/sdks/accountmapping/README.md +++ b/bank-feeds/docs/sdks/accountmapping/README.md @@ -22,30 +22,50 @@ To find valid target account options, first call the [List bank feed account map > > Only use this endpoint if you are building your own account management UI. +#### Account mapping variability + +The method of mapping the source account to the target account varies depending on the accounting software your company uses. + +#### Mapping options: + +1. **API Mapping**: Integrate the mapping journey directly into your application for a seamless user experience. +2. **Codat UI Mapping**: If you prefer a quicker setup, you can utilize Codat's provided user interface for mapping. +3. **Accounting Platform Mapping**: For some accounting software, the mapping process must be conducted within the software itself. + +### Integration-specific behaviour + +| Bank Feed Integration | API Mapping | Codat UI Mapping | Accounting Platform Mapping | +| --------------------- | ----------- | ---------------- | --------------------------- | +| Xero | ✅ | ✅ | | +| FreeAgent | ✅ | ✅ | | +| Oracle NetSuite | ✅ | ✅ | | +| Exact Online (NL) | ✅ | ✅ | | +| QuickBooks Online | | | ✅ | +| Sage | | | ✅ | + ### Example Usage ```python from codat_bankfeeds import CodatBankFeeds from codat_bankfeeds.models import shared -s = CodatBankFeeds( +with CodatBankFeeds( security=shared.Security( auth_header="Basic BASE_64_ENCODED(API_KEY)", ), -) - -res = s.account_mapping.create(request={ - "company_id": "8a210b68-6988-11ed-a1eb-0242ac120002", - "connection_id": "2e9d2c44-f675-40ba-8049-353bfcb5e171", - "bank_feed_account_mapping": { - "source_account_id": "acc-002", - "target_account_id": "account-081", - }, -}) - -if res is not None: - # handle response - pass +) as s: + res = s.account_mapping.create(request={ + "company_id": "8a210b68-6988-11ed-a1eb-0242ac120002", + "connection_id": "2e9d2c44-f675-40ba-8049-353bfcb5e171", + "bank_feed_account_mapping": { + "source_account_id": "acc-002", + "target_account_id": "account-081", + }, + }) + + if res is not None: + # handle response + pass ``` @@ -83,20 +103,19 @@ A bank feed account mapping is a specified link between the source account (prov from codat_bankfeeds import CodatBankFeeds from codat_bankfeeds.models import shared -s = CodatBankFeeds( +with CodatBankFeeds( security=shared.Security( auth_header="Basic BASE_64_ENCODED(API_KEY)", ), -) - -res = s.account_mapping.get(request={ - "company_id": "8a210b68-6988-11ed-a1eb-0242ac120002", - "connection_id": "2e9d2c44-f675-40ba-8049-353bfcb5e171", -}) - -if res is not None: - # handle response - pass +) as s: + res = s.account_mapping.get(request={ + "company_id": "8a210b68-6988-11ed-a1eb-0242ac120002", + "connection_id": "2e9d2c44-f675-40ba-8049-353bfcb5e171", + }) + + if res is not None: + # handle response + pass ``` diff --git a/bank-feeds/docs/sdks/bankaccounts/README.md b/bank-feeds/docs/sdks/bankaccounts/README.md index a48ee1f1c..b91ab299a 100644 --- a/bank-feeds/docs/sdks/bankaccounts/README.md +++ b/bank-feeds/docs/sdks/bankaccounts/README.md @@ -27,24 +27,23 @@ Required data may vary by integration. To see what data to post, first call [Get from codat_bankfeeds import CodatBankFeeds from codat_bankfeeds.models import shared -s = CodatBankFeeds( +with CodatBankFeeds( security=shared.Security( auth_header="Basic BASE_64_ENCODED(API_KEY)", ), -) - -res = s.bank_accounts.create(request={ - "company_id": "8a210b68-6988-11ed-a1eb-0242ac120002", - "connection_id": "2e9d2c44-f675-40ba-8049-353bfcb5e171", - "bank_account_prototype": { - "currency": "USD", - "status": shared.BankAccountStatus.ACTIVE, - }, -}) - -if res is not None: - # handle response - pass +) as s: + res = s.bank_accounts.create(request={ + "company_id": "8a210b68-6988-11ed-a1eb-0242ac120002", + "connection_id": "2e9d2c44-f675-40ba-8049-353bfcb5e171", + "bank_account_prototype": { + "currency": "USD", + "status": shared.BankAccountStatus.ACTIVE, + }, + }) + + if res is not None: + # handle response + pass ``` @@ -83,20 +82,19 @@ See the *response examples* for integration-specific indicative models. from codat_bankfeeds import CodatBankFeeds from codat_bankfeeds.models import shared -s = CodatBankFeeds( +with CodatBankFeeds( security=shared.Security( auth_header="Basic BASE_64_ENCODED(API_KEY)", ), -) - -res = s.bank_accounts.get_create_model(request={ - "company_id": "8a210b68-6988-11ed-a1eb-0242ac120002", - "connection_id": "2e9d2c44-f675-40ba-8049-353bfcb5e171", -}) +) as s: + res = s.bank_accounts.get_create_model(request={ + "company_id": "8a210b68-6988-11ed-a1eb-0242ac120002", + "connection_id": "2e9d2c44-f675-40ba-8049-353bfcb5e171", + }) -if res is not None: - # handle response - pass + if res is not None: + # handle response + pass ``` @@ -133,24 +131,23 @@ Before using this endpoint, you must have [retrieved data for the company](https from codat_bankfeeds import CodatBankFeeds from codat_bankfeeds.models import shared -s = CodatBankFeeds( +with CodatBankFeeds( security=shared.Security( auth_header="Basic BASE_64_ENCODED(API_KEY)", ), -) - -res = s.bank_accounts.list(request={ - "company_id": "8a210b68-6988-11ed-a1eb-0242ac120002", - "connection_id": "2e9d2c44-f675-40ba-8049-353bfcb5e171", - "order_by": "-modifiedDate", - "page": 1, - "page_size": 100, - "query": "id=e3334455-1aed-4e71-ab43-6bccf12092ee", -}) - -if res is not None: - # handle response - pass +) as s: + res = s.bank_accounts.list(request={ + "company_id": "8a210b68-6988-11ed-a1eb-0242ac120002", + "connection_id": "2e9d2c44-f675-40ba-8049-353bfcb5e171", + "order_by": "-modifiedDate", + "page": 1, + "page_size": 100, + "query": "id=e3334455-1aed-4e71-ab43-6bccf12092ee", + }) + + if res is not None: + # handle response + pass ``` diff --git a/bank-feeds/docs/sdks/codatbankfeeds/README.md b/bank-feeds/docs/sdks/codatbankfeeds/README.md index 9c63c2510..4a82c27d1 100644 --- a/bank-feeds/docs/sdks/codatbankfeeds/README.md +++ b/bank-feeds/docs/sdks/codatbankfeeds/README.md @@ -20,4 +20,6 @@ A bank feed is a connection between a source bank account in your application an | Account mapping | Extra functionality for building an account management UI. | | Company information | Get detailed information about a company from the underlying platform. | | Transactions | Create new bank account transactions for a company's connections, and see previous operations. | - \ No newline at end of file + + +### Available Operations diff --git a/bank-feeds/docs/sdks/companies/README.md b/bank-feeds/docs/sdks/companies/README.md index cc922cff2..ca081e7f8 100644 --- a/bank-feeds/docs/sdks/companies/README.md +++ b/bank-feeds/docs/sdks/companies/README.md @@ -10,6 +10,7 @@ Create and manage your SMB users' companies. * [create](#create) - Create company * [delete](#delete) - Delete a company * [get](#get) - Get company +* [get_access_token](#get_access_token) - Get company access token * [list](#list) - List companies * [update](#update) - Update company @@ -28,20 +29,19 @@ If forbidden characters (see `name` pattern) are present in the request, a compa from codat_bankfeeds import CodatBankFeeds from codat_bankfeeds.models import shared -s = CodatBankFeeds( +with CodatBankFeeds( security=shared.Security( auth_header="Basic BASE_64_ENCODED(API_KEY)", ), -) - -res = s.companies.create(request={ - "name": "Technicalium", - "description": "Requested early access to the new financing scheme.", -}) +) as s: + res = s.companies.create(request={ + "name": "Technicalium", + "description": "Requested early access to the new financing scheme.", + }) -if res is not None: - # handle response - pass + if res is not None: + # handle response + pass ``` @@ -77,17 +77,16 @@ Each company can have multiple [connections](https://docs.codat.io/bank-feeds-ap from codat_bankfeeds import CodatBankFeeds from codat_bankfeeds.models import shared -s = CodatBankFeeds( +with CodatBankFeeds( security=shared.Security( auth_header="Basic BASE_64_ENCODED(API_KEY)", ), -) - -s.companies.delete(request={ - "company_id": "8a210b68-6988-11ed-a1eb-0242ac120002", -}) +) as s: + s.companies.delete(request={ + "company_id": "8a210b68-6988-11ed-a1eb-0242ac120002", + }) -# Use the SDK ... + # Use the SDK ... ``` @@ -119,19 +118,18 @@ Each company can have multiple [connections](https://docs.codat.io/bank-feeds-ap from codat_bankfeeds import CodatBankFeeds from codat_bankfeeds.models import shared -s = CodatBankFeeds( +with CodatBankFeeds( security=shared.Security( auth_header="Basic BASE_64_ENCODED(API_KEY)", ), -) +) as s: + res = s.companies.get(request={ + "company_id": "8a210b68-6988-11ed-a1eb-0242ac120002", + }) -res = s.companies.get(request={ - "company_id": "8a210b68-6988-11ed-a1eb-0242ac120002", -}) - -if res is not None: - # handle response - pass + if res is not None: + # handle response + pass ``` @@ -153,6 +151,50 @@ if res is not None: | errors.ErrorMessage | 401, 402, 403, 404, 429, 500, 503 | application/json | | errors.SDKError | 4XX, 5XX | \*/\* | +## get_access_token + +Use the _Get company access token_ endpoint to return an access token for the specified company ID to use in Codat's embedded UI products. + + +### Example Usage + +```python +from codat_bankfeeds import CodatBankFeeds +from codat_bankfeeds.models import shared + +with CodatBankFeeds( + security=shared.Security( + auth_header="Basic BASE_64_ENCODED(API_KEY)", + ), +) as s: + res = s.companies.get_access_token(request={ + "company_id": "8a210b68-6988-11ed-a1eb-0242ac120002", + }) + + if res is not None: + # handle response + pass + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | +| `request` | [operations.GetCompanyAccessTokenRequest](../../models/operations/getcompanyaccesstokenrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +### Response + +**[shared.CompanyAccessToken](../../models/shared/companyaccesstoken.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| --------------------------------- | --------------------------------- | --------------------------------- | +| errors.ErrorMessage | 401, 402, 403, 404, 429, 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + ## list The *List companies* endpoint returns a list of [companies](https://docs.codat.io/bank-feeds-api#/schemas/Company) associated to your instances. @@ -166,22 +208,21 @@ Each company can have multiple [connections](https://docs.codat.io/bank-feeds-ap from codat_bankfeeds import CodatBankFeeds from codat_bankfeeds.models import shared -s = CodatBankFeeds( +with CodatBankFeeds( security=shared.Security( auth_header="Basic BASE_64_ENCODED(API_KEY)", ), -) - -res = s.companies.list(request={ - "order_by": "-modifiedDate", - "page": 1, - "page_size": 100, - "query": "id=e3334455-1aed-4e71-ab43-6bccf12092ee", -}) - -if res is not None: - # handle response - pass +) as s: + res = s.companies.list(request={ + "order_by": "-modifiedDate", + "page": 1, + "page_size": 100, + "query": "id=e3334455-1aed-4e71-ab43-6bccf12092ee", + }) + + if res is not None: + # handle response + pass ``` @@ -216,23 +257,22 @@ Each company can have multiple [connections](https://docs.codat.io/bank-feeds-ap from codat_bankfeeds import CodatBankFeeds from codat_bankfeeds.models import shared -s = CodatBankFeeds( +with CodatBankFeeds( security=shared.Security( auth_header="Basic BASE_64_ENCODED(API_KEY)", ), -) - -res = s.companies.update(request={ - "company_id": "8a210b68-6988-11ed-a1eb-0242ac120002", - "company_request_body": { - "name": "New Name", - "description": "Requested early access to the new financing scheme.", - }, -}) - -if res is not None: - # handle response - pass +) as s: + res = s.companies.update(request={ + "company_id": "8a210b68-6988-11ed-a1eb-0242ac120002", + "company_request_body": { + "name": "New Name", + "description": "Requested early access to the new financing scheme.", + }, + }) + + if res is not None: + # handle response + pass ``` diff --git a/bank-feeds/docs/sdks/companyinformation/README.md b/bank-feeds/docs/sdks/companyinformation/README.md index 8e1ab9aa7..a9d7ecd00 100644 --- a/bank-feeds/docs/sdks/companyinformation/README.md +++ b/bank-feeds/docs/sdks/companyinformation/README.md @@ -21,20 +21,19 @@ Use the *Get company information* endpoint to return information about the compa from codat_bankfeeds import CodatBankFeeds from codat_bankfeeds.models import shared -s = CodatBankFeeds( +with CodatBankFeeds( security=shared.Security( auth_header="Basic BASE_64_ENCODED(API_KEY)", ), -) - -res = s.company_information.get(request={ - "company_id": "8a210b68-6988-11ed-a1eb-0242ac120002", - "connection_id": "2e9d2c44-f675-40ba-8049-353bfcb5e171", -}) - -if res is not None: - # handle response - pass +) as s: + res = s.company_information.get(request={ + "company_id": "8a210b68-6988-11ed-a1eb-0242ac120002", + "connection_id": "2e9d2c44-f675-40ba-8049-353bfcb5e171", + }) + + if res is not None: + # handle response + pass ``` diff --git a/bank-feeds/docs/sdks/configuration/README.md b/bank-feeds/docs/sdks/configuration/README.md index 3ad15d0dd..949fbe17e 100644 --- a/bank-feeds/docs/sdks/configuration/README.md +++ b/bank-feeds/docs/sdks/configuration/README.md @@ -20,19 +20,18 @@ Configure bank feeds for a company. from codat_bankfeeds import CodatBankFeeds from codat_bankfeeds.models import shared -s = CodatBankFeeds( +with CodatBankFeeds( security=shared.Security( auth_header="Basic BASE_64_ENCODED(API_KEY)", ), -) - -res = s.configuration.get(request={ - "company_id": "8a210b68-6988-11ed-a1eb-0242ac120002", -}) +) as s: + res = s.configuration.get(request={ + "company_id": "8a210b68-6988-11ed-a1eb-0242ac120002", + }) -if res is not None: - # handle response - pass + if res is not None: + # handle response + pass ``` @@ -64,22 +63,21 @@ if res is not None: from codat_bankfeeds import CodatBankFeeds from codat_bankfeeds.models import shared -s = CodatBankFeeds( +with CodatBankFeeds( security=shared.Security( auth_header="Basic BASE_64_ENCODED(API_KEY)", ), -) - -res = s.configuration.set(request={ - "company_id": "8a210b68-6988-11ed-a1eb-0242ac120002", - "configuration": { +) as s: + res = s.configuration.set(request={ "company_id": "8a210b68-6988-11ed-a1eb-0242ac120002", - }, -}) - -if res is not None: - # handle response - pass + "configuration": { + "company_id": "8a210b68-6988-11ed-a1eb-0242ac120002", + }, + }) + + if res is not None: + # handle response + pass ``` diff --git a/bank-feeds/docs/sdks/connections/README.md b/bank-feeds/docs/sdks/connections/README.md index afa018878..5f5667264 100644 --- a/bank-feeds/docs/sdks/connections/README.md +++ b/bank-feeds/docs/sdks/connections/README.md @@ -25,22 +25,21 @@ Use the [List Integrations](https://docs.codat.io/platform-api#/operations/list- from codat_bankfeeds import CodatBankFeeds from codat_bankfeeds.models import shared -s = CodatBankFeeds( +with CodatBankFeeds( security=shared.Security( auth_header="Basic BASE_64_ENCODED(API_KEY)", ), -) - -res = s.connections.create(request={ - "company_id": "8a210b68-6988-11ed-a1eb-0242ac120002", - "request_body": { - "platform_key": "gbol", - }, -}) - -if res is not None: - # handle response - pass +) as s: + res = s.connections.create(request={ + "company_id": "8a210b68-6988-11ed-a1eb-0242ac120002", + "request_body": { + "platform_key": "gbol", + }, + }) + + if res is not None: + # handle response + pass ``` @@ -73,18 +72,17 @@ This operation is not reversible. The end user would need to reauthorize a new d from codat_bankfeeds import CodatBankFeeds from codat_bankfeeds.models import shared -s = CodatBankFeeds( +with CodatBankFeeds( security=shared.Security( auth_header="Basic BASE_64_ENCODED(API_KEY)", ), -) - -s.connections.delete(request={ - "company_id": "8a210b68-6988-11ed-a1eb-0242ac120002", - "connection_id": "2e9d2c44-f675-40ba-8049-353bfcb5e171", -}) +) as s: + s.connections.delete(request={ + "company_id": "8a210b68-6988-11ed-a1eb-0242ac120002", + "connection_id": "2e9d2c44-f675-40ba-8049-353bfcb5e171", + }) -# Use the SDK ... + # Use the SDK ... ``` @@ -112,20 +110,19 @@ s.connections.delete(request={ from codat_bankfeeds import CodatBankFeeds from codat_bankfeeds.models import shared -s = CodatBankFeeds( +with CodatBankFeeds( security=shared.Security( auth_header="Basic BASE_64_ENCODED(API_KEY)", ), -) +) as s: + res = s.connections.get(request={ + "company_id": "8a210b68-6988-11ed-a1eb-0242ac120002", + "connection_id": "2e9d2c44-f675-40ba-8049-353bfcb5e171", + }) -res = s.connections.get(request={ - "company_id": "8a210b68-6988-11ed-a1eb-0242ac120002", - "connection_id": "2e9d2c44-f675-40ba-8049-353bfcb5e171", -}) - -if res is not None: - # handle response - pass + if res is not None: + # handle response + pass ``` @@ -157,23 +154,22 @@ if res is not None: from codat_bankfeeds import CodatBankFeeds from codat_bankfeeds.models import shared -s = CodatBankFeeds( +with CodatBankFeeds( security=shared.Security( auth_header="Basic BASE_64_ENCODED(API_KEY)", ), -) - -res = s.connections.list(request={ - "company_id": "8a210b68-6988-11ed-a1eb-0242ac120002", - "order_by": "-modifiedDate", - "page": 1, - "page_size": 100, - "query": "id=e3334455-1aed-4e71-ab43-6bccf12092ee", -}) - -if res is not None: - # handle response - pass +) as s: + res = s.connections.list(request={ + "company_id": "8a210b68-6988-11ed-a1eb-0242ac120002", + "order_by": "-modifiedDate", + "page": 1, + "page_size": 100, + "query": "id=e3334455-1aed-4e71-ab43-6bccf12092ee", + }) + + if res is not None: + # handle response + pass ``` @@ -205,23 +201,22 @@ if res is not None: from codat_bankfeeds import CodatBankFeeds from codat_bankfeeds.models import shared -s = CodatBankFeeds( +with CodatBankFeeds( security=shared.Security( auth_header="Basic BASE_64_ENCODED(API_KEY)", ), -) - -res = s.connections.unlink(request={ - "company_id": "8a210b68-6988-11ed-a1eb-0242ac120002", - "connection_id": "2e9d2c44-f675-40ba-8049-353bfcb5e171", - "request_body": { - "status": shared.DataConnectionStatus.UNLINKED, - }, -}) - -if res is not None: - # handle response - pass +) as s: + res = s.connections.unlink(request={ + "company_id": "8a210b68-6988-11ed-a1eb-0242ac120002", + "connection_id": "2e9d2c44-f675-40ba-8049-353bfcb5e171", + "request_body": { + "status": shared.DataConnectionStatus.UNLINKED, + }, + }) + + if res is not None: + # handle response + pass ``` diff --git a/bank-feeds/docs/sdks/sourceaccounts/README.md b/bank-feeds/docs/sdks/sourceaccounts/README.md index c048aa1de..d1cec5765 100644 --- a/bank-feeds/docs/sdks/sourceaccounts/README.md +++ b/bank-feeds/docs/sdks/sourceaccounts/README.md @@ -7,7 +7,8 @@ Provide and manage lists of source bank accounts. ### Available Operations -* [create](#create) - Create source account +* [create](#create) - Create single source account +* [create_batch](#create_batch) - Create source accounts * [delete](#delete) - Delete source account * [delete_credentials](#delete_credentials) - Delete all source account credentials * [generate_credentials](#generate_credentials) - Generate source account credentials @@ -18,27 +19,6 @@ Provide and manage lists of source bank accounts. The _Create Source Account_ endpoint allows you to create a representation of a bank account within Codat's domain. The company can then map the source account to an existing or new target account in their accounting software. -#### Account mapping variability - -The method of mapping the source account to the target account varies depending on the accounting software your company uses. - -#### Mapping options: - -1. **API Mapping**: Integrate the mapping journey directly into your application for a seamless user experience. -2. **Codat UI Mapping**: If you prefer a quicker setup, you can utilize Codat's provided user interface for mapping. -3. **Accounting Platform Mapping**: For some accounting software, the mapping process must be conducted within the software itself. - -### Integration-specific behaviour - -| Bank Feed Integration | API Mapping | Codat UI Mapping | Accounting Platform Mapping | -| --------------------- | ----------- | ---------------- | --------------------------- | -| Xero | ✅ | ✅ | | -| FreeAgent | ✅ | ✅ | | -| Oracle NetSuite | ✅ | ✅ | | -| Exact Online (NL) | ✅ | ✅ | | -| QuickBooks Online | | | ✅ | -| Sage | | | ✅ | - > ### Versioning > If you are integrating the Bank Feeds API with Codat after August 1, 2024, please use the v2 version of the API, as detailed in the schema below. For integrations completed before August 1, 2024, select the v1 version from the schema dropdown below. @@ -49,41 +29,40 @@ from codat_bankfeeds import CodatBankFeeds from codat_bankfeeds.models import shared from decimal import Decimal -s = CodatBankFeeds( +with CodatBankFeeds( security=shared.Security( auth_header="Basic BASE_64_ENCODED(API_KEY)", ), -) - -res = s.source_accounts.create(request={ - "company_id": "8a210b68-6988-11ed-a1eb-0242ac120002", - "connection_id": "2e9d2c44-f675-40ba-8049-353bfcb5e171", - "request_body": { - "account_name": "account-081", - "account_number": "12345670", - "account_type": shared.AccountType.CHECKING, - "balance": Decimal("99.99"), - "currency": "GBP", - "id": "acc-001", - "account_info": { - "account_open_date": "2023-05-06T00:00:00Z", - "available_balance": Decimal("10"), - "description": "account description 1", - "nickname": "account 123", - }, - "feed_start_date": "2024-05-01T00:00:00Z", - "modified_date": "2024-08-02T00:00:00.000Z", - "routing_info": { - "bank_code": "21001088", - "type": shared.Type.BANKCODE, +) as s: + res = s.source_accounts.create(request={ + "company_id": "8a210b68-6988-11ed-a1eb-0242ac120002", + "connection_id": "2e9d2c44-f675-40ba-8049-353bfcb5e171", + "request_body": { + "account_name": "account-081", + "account_number": "12345670", + "account_type": shared.AccountType.CHECKING, + "balance": Decimal("99.99"), + "currency": "GBP", + "id": "acc-001", + "account_info": { + "account_open_date": "2023-05-06T00:00:00Z", + "available_balance": Decimal("10"), + "description": "account description 1", + "nickname": "account 123", + }, + "feed_start_date": "2024-05-01T00:00:00Z", + "modified_date": "2024-08-02T00:00:00.000Z", + "routing_info": { + "bank_code": "21001088", + "type": shared.Type.BANKCODE, + }, + "status": shared.SourceAccountV2Status.PENDING, }, - "status": shared.SourceAccountV2Status.PENDING, - }, -}) + }) -if res is not None: - # handle response - pass + if res is not None: + # handle response + pass ``` @@ -105,6 +84,78 @@ if res is not None: | errors.ErrorMessage | 400, 401, 402, 403, 404, 429, 500, 503 | application/json | | errors.SDKError | 4XX, 5XX | \*/\* | +## create_batch + +The _Batch create source accounts_ endpoint allows you to create multiple representations of your SMB's bank accounts within Codat's domain. The company can then map the source account to an existing or new target account in their accounting software. + +> ### Versioning +> If you are integrating the Bank Feeds API with Codat after August 1, 2024, please use the v2 version of the API, as detailed in the schema below. For integrations completed before August 1, 2024, select the v1 version from the schema dropdown below. + +### Example Usage + +```python +from codat_bankfeeds import CodatBankFeeds +from codat_bankfeeds.models import shared +from decimal import Decimal + +with CodatBankFeeds( + security=shared.Security( + auth_header="Basic BASE_64_ENCODED(API_KEY)", + ), +) as s: + res = s.source_accounts.create_batch(request={ + "company_id": "8a210b68-6988-11ed-a1eb-0242ac120002", + "connection_id": "2e9d2c44-f675-40ba-8049-353bfcb5e171", + "request_body": [ + { + "id": "acc-002", + "account_name": "account-081", + "account_number": "12345670", + "account_type": "Credit", + "balance": Decimal("99.99"), + "currency": "GBP", + "modified_date": "2023-01-09T14:14:14.1057478Z", + "sort_code": "123456", + "status": shared.Status.PENDING, + }, + { + "id": "acc-003", + "account_name": "account-095", + "account_number": "12345671", + "account_type": "Credit", + "balance": Decimal("0"), + "currency": "USD", + "modified_date": "2023-01-09T14:14:14.1057478Z", + "sort_code": "123456", + "status": shared.Status.PENDING, + }, + ], + }) + + if res is not None: + # handle response + pass + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | +| `request` | [operations.CreateBatchSourceAccountRequest](../../models/operations/createbatchsourceaccountrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +### Response + +**[operations.CreateBatchSourceAccountResponse](../../models/operations/createbatchsourceaccountresponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------------------------------- | ------------------------------------------- | ------------------------------------------- | +| errors.ErrorMessage | 400, 401, 402, 403, 404, 409, 429, 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + ## delete The _Delete source account_ endpoint enables you to remove a source account. @@ -118,19 +169,18 @@ Removing a source account will also remove any mapping between the source bank f from codat_bankfeeds import CodatBankFeeds from codat_bankfeeds.models import shared -s = CodatBankFeeds( +with CodatBankFeeds( security=shared.Security( auth_header="Basic BASE_64_ENCODED(API_KEY)", ), -) - -s.source_accounts.delete(request={ - "account_id": "7110701885", - "company_id": "8a210b68-6988-11ed-a1eb-0242ac120002", - "connection_id": "2e9d2c44-f675-40ba-8049-353bfcb5e171", -}) +) as s: + s.source_accounts.delete(request={ + "account_id": "7110701885", + "company_id": "8a210b68-6988-11ed-a1eb-0242ac120002", + "connection_id": "2e9d2c44-f675-40ba-8049-353bfcb5e171", + }) -# Use the SDK ... + # Use the SDK ... ``` @@ -160,18 +210,17 @@ In cases where multiple credential sets have been generated, a single API call t from codat_bankfeeds import CodatBankFeeds from codat_bankfeeds.models import shared -s = CodatBankFeeds( +with CodatBankFeeds( security=shared.Security( auth_header="Basic BASE_64_ENCODED(API_KEY)", ), -) +) as s: + s.source_accounts.delete_credentials(request={ + "company_id": "8a210b68-6988-11ed-a1eb-0242ac120002", + "connection_id": "2e9d2c44-f675-40ba-8049-353bfcb5e171", + }) -s.source_accounts.delete_credentials(request={ - "company_id": "8a210b68-6988-11ed-a1eb-0242ac120002", - "connection_id": "2e9d2c44-f675-40ba-8049-353bfcb5e171", -}) - -# Use the SDK ... + # Use the SDK ... ``` @@ -205,21 +254,20 @@ The old credentials will still be valid until the revoke credentials endpoint is from codat_bankfeeds import CodatBankFeeds from codat_bankfeeds.models import shared -s = CodatBankFeeds( +with CodatBankFeeds( security=shared.Security( auth_header="Basic BASE_64_ENCODED(API_KEY)", ), -) - -res = s.source_accounts.generate_credentials(request={ - "request_body": open("example.file", "rb"), - "company_id": "8a210b68-6988-11ed-a1eb-0242ac120002", - "connection_id": "2e9d2c44-f675-40ba-8049-353bfcb5e171", -}) +) as s: + res = s.source_accounts.generate_credentials(request={ + "request_body": open("example.file", "rb"), + "company_id": "8a210b68-6988-11ed-a1eb-0242ac120002", + "connection_id": "2e9d2c44-f675-40ba-8049-353bfcb5e171", + }) -if res is not None: - # handle response - pass + if res is not None: + # handle response + pass ``` @@ -256,20 +304,19 @@ if res is not None: from codat_bankfeeds import CodatBankFeeds from codat_bankfeeds.models import shared -s = CodatBankFeeds( +with CodatBankFeeds( security=shared.Security( auth_header="Basic BASE_64_ENCODED(API_KEY)", ), -) - -res = s.source_accounts.list(request={ - "company_id": "8a210b68-6988-11ed-a1eb-0242ac120002", - "connection_id": "2e9d2c44-f675-40ba-8049-353bfcb5e171", -}) +) as s: + res = s.source_accounts.list(request={ + "company_id": "8a210b68-6988-11ed-a1eb-0242ac120002", + "connection_id": "2e9d2c44-f675-40ba-8049-353bfcb5e171", + }) -if res is not None: - # handle response - pass + if res is not None: + # handle response + pass ``` @@ -307,33 +354,32 @@ from codat_bankfeeds import CodatBankFeeds from codat_bankfeeds.models import shared from decimal import Decimal -s = CodatBankFeeds( +with CodatBankFeeds( security=shared.Security( auth_header="Basic BASE_64_ENCODED(API_KEY)", ), -) - -res = s.source_accounts.update(request={ - "account_id": "7110701885", - "company_id": "8a210b68-6988-11ed-a1eb-0242ac120002", - "connection_id": "2e9d2c44-f675-40ba-8049-353bfcb5e171", - "source_account": { - "id": "acc-003", - "account_name": "account-095", - "account_number": "12345671", - "account_type": "Credit", - "balance": Decimal("0"), - "currency": "USD", - "feed_start_date": "2022-10-23T00:00:00Z", - "modified_date": "2023-01-09T14:14:14.1057478Z", - "sort_code": "123456", - "status": shared.Status.PENDING, - }, -}) - -if res is not None: - # handle response - pass +) as s: + res = s.source_accounts.update(request={ + "account_id": "7110701885", + "company_id": "8a210b68-6988-11ed-a1eb-0242ac120002", + "connection_id": "2e9d2c44-f675-40ba-8049-353bfcb5e171", + "source_account": { + "id": "acc-003", + "account_name": "account-095", + "account_number": "12345671", + "account_type": "Credit", + "balance": Decimal("0"), + "currency": "USD", + "feed_start_date": "2022-10-23T00:00:00Z", + "modified_date": "2023-01-09T14:14:14.1057478Z", + "sort_code": "123456", + "status": shared.Status.PENDING, + }, + }) + + if res is not None: + # handle response + pass ``` diff --git a/bank-feeds/docs/sdks/sync/README.md b/bank-feeds/docs/sdks/sync/README.md index 7cf3de0e1..dcb50c828 100644 --- a/bank-feeds/docs/sdks/sync/README.md +++ b/bank-feeds/docs/sdks/sync/README.md @@ -19,19 +19,18 @@ Use the _Get last successful sync_ endpoint to obtain the status information for from codat_bankfeeds import CodatBankFeeds from codat_bankfeeds.models import shared -s = CodatBankFeeds( +with CodatBankFeeds( security=shared.Security( auth_header="Basic BASE_64_ENCODED(API_KEY)", ), -) - -res = s.sync.get_last_successful_sync(request={ - "company_id": "8a210b68-6988-11ed-a1eb-0242ac120002", -}) - -if res is not None: - # handle response - pass +) as s: + res = s.sync.get_last_successful_sync(request={ + "company_id": "8a210b68-6988-11ed-a1eb-0242ac120002", + }) + + if res is not None: + # handle response + pass ``` diff --git a/bank-feeds/docs/sdks/transactions/README.md b/bank-feeds/docs/sdks/transactions/README.md index 7dca8ec53..9249f2ee5 100644 --- a/bank-feeds/docs/sdks/transactions/README.md +++ b/bank-feeds/docs/sdks/transactions/README.md @@ -8,6 +8,7 @@ Create new bank account transactions for a company's connections, and see previo ### Available Operations * [create](#create) - Create bank transactions +* [get_create_model](#get_create_model) - Get create bank transactions model * [get_create_operation](#get_create_operation) - Get create operation * [list_create_operations](#list_create_operations) - List create operations @@ -19,8 +20,8 @@ Create new bank account transactions for a company's connections, and see previo **Integration-specific behaviour** -Required data may vary by integration. To see what data to post, first call [Get create bank transaction model](https://docs.codat.io/bank-feeds-api#/operations/get-create-bankTransactions-model). - +The required properties may vary based on the integration. For detailed requirements specific to each accounting software, refer to the API reference examples. +Alternatively, you can view the [Get create bank transaction model](https://docs.codat.io/bank-feeds-api#/operations/get-create-bank-transactions-model) for more information. ### Example Usage @@ -29,59 +30,58 @@ from codat_bankfeeds import CodatBankFeeds from codat_bankfeeds.models import shared from decimal import Decimal -s = CodatBankFeeds( +with CodatBankFeeds( security=shared.Security( auth_header="Basic BASE_64_ENCODED(API_KEY)", ), -) - -res = s.transactions.create(request={ - "account_id": "9wg4lep4ush5cxs79pl8sozmsndbaukll3ind4g7buqbm1h2", - "company_id": "8a210b68-6988-11ed-a1eb-0242ac120002", - "connection_id": "2e9d2c44-f675-40ba-8049-353bfcb5e171", - "create_bank_transactions": { - "account_id": "49cd5a42-b311-4750-9361-52e2ed1d4653", - "transactions": [ - { - "amount": Decimal("100"), - "date_": "2023-08-22T10:21:00Z", - "id": "716422529", - "balance": Decimal("100"), - "counterparty": "Bank of Example", - "description": "Repayment of Credit Card", - "reconciled": True, - "reference": "Ref-12345", - "transaction_type": shared.BankTransactionType.CREDIT, - }, - { - "amount": Decimal("-100"), - "date_": "2023-08-22T10:22:00Z", - "id": "716422530", - "balance": Decimal("0"), - "counterparty": "Amazon", - "description": "Amazon Purchase", - "reconciled": False, - "reference": "Ref-12346", - "transaction_type": shared.BankTransactionType.DEBIT, - }, - { - "amount": Decimal("-60"), - "date_": "2023-08-22T10:23:00Z", - "id": "716422531", - "balance": Decimal("-60"), - "counterparty": "Office Mart", - "description": "Office Supplies", - "reconciled": False, - "reference": "Ref-12347", - "transaction_type": shared.BankTransactionType.DEBIT, - }, - ], - }, -}) - -if res is not None: - # handle response - pass +) as s: + res = s.transactions.create(request={ + "account_id": "9wg4lep4ush5cxs79pl8sozmsndbaukll3ind4g7buqbm1h2", + "company_id": "8a210b68-6988-11ed-a1eb-0242ac120002", + "connection_id": "2e9d2c44-f675-40ba-8049-353bfcb5e171", + "create_bank_transactions": { + "account_id": "49cd5a42-b311-4750-9361-52e2ed1d4653", + "transactions": [ + { + "amount": Decimal("100"), + "balance": Decimal("100"), + "counterparty": "Bank of Example", + "date_": "2023-08-22T10:21:00Z", + "description": "Repayment of Credit Card", + "id": "716422529", + "reconciled": True, + "reference": "Ref-12345", + "transaction_type": shared.BankTransactionType.CREDIT, + }, + { + "amount": Decimal("-100"), + "balance": Decimal("0"), + "counterparty": "Amazon", + "date_": "2023-08-22T10:22:00Z", + "description": "Amazon Purchase", + "id": "716422530", + "reconciled": False, + "reference": "Ref-12346", + "transaction_type": shared.BankTransactionType.DEBIT, + }, + { + "amount": Decimal("-60"), + "balance": Decimal("-60"), + "counterparty": "Office Mart", + "date_": "2023-08-22T10:23:00Z", + "description": "Office Supplies", + "id": "716422531", + "reconciled": False, + "reference": "Ref-12347", + "transaction_type": shared.BankTransactionType.DEBIT, + }, + ], + }, + }) + + if res is not None: + # handle response + pass ``` @@ -103,6 +103,57 @@ if res is not None: | errors.ErrorMessage | 400, 401, 402, 403, 404, 429, 500, 503 | application/json | | errors.SDKError | 4XX, 5XX | \*/\* | +## get_create_model + +The *Get create bank account transactions model* endpoint returns the expected data for the request payload when creating [bank account transactions](https://docs.codat.io/bank-feeds-api#/schemas/BankTransactions) for a given company and integration. + +[Bank account transactions](https://docs.codat.io/bank-feeds-api#/schemas/BankTransactions) are records of money that has moved in and out of an SMB's bank account. + +**Integration-specific behaviour** + +See the *response examples* for integration-specific indicative models. + +### Example Usage + +```python +from codat_bankfeeds import CodatBankFeeds +from codat_bankfeeds.models import shared + +with CodatBankFeeds( + security=shared.Security( + auth_header="Basic BASE_64_ENCODED(API_KEY)", + ), +) as s: + res = s.transactions.get_create_model(request={ + "account_id": "13d946f0-c5d5-42bc-b092-97ece17923ab", + "company_id": "8a210b68-6988-11ed-a1eb-0242ac120002", + "connection_id": "2e9d2c44-f675-40ba-8049-353bfcb5e171", + }) + + if res is not None: + # handle response + pass + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `request` | [operations.GetCreateBankTransactionsModelRequest](../../models/operations/getcreatebanktransactionsmodelrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +### Response + +**[shared.PushOption](../../models/shared/pushoption.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| --------------------------------- | --------------------------------- | --------------------------------- | +| errors.ErrorMessage | 401, 402, 403, 404, 429, 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + ## get_create_operation The **Get create operation** endpoint returns a specific [write operation](/using-the-api/push) identified by the `pushOperationKey` that was performed on the company. @@ -117,20 +168,19 @@ For bank feeds, your push operations will only relate to the `bankTransactions` from codat_bankfeeds import CodatBankFeeds from codat_bankfeeds.models import shared -s = CodatBankFeeds( +with CodatBankFeeds( security=shared.Security( auth_header="Basic BASE_64_ENCODED(API_KEY)", ), -) - -res = s.transactions.get_create_operation(request={ - "company_id": "8a210b68-6988-11ed-a1eb-0242ac120002", - "push_operation_key": "1fb73c31-a851-46c2-ab8a-5ce6e25b57b8", -}) +) as s: + res = s.transactions.get_create_operation(request={ + "company_id": "8a210b68-6988-11ed-a1eb-0242ac120002", + "push_operation_key": "1fb73c31-a851-46c2-ab8a-5ce6e25b57b8", + }) -if res is not None: - # handle response - pass + if res is not None: + # handle response + pass ``` @@ -166,23 +216,22 @@ For bank feeds, use this endpoint to view write operations related to the `bankT from codat_bankfeeds import CodatBankFeeds from codat_bankfeeds.models import shared -s = CodatBankFeeds( +with CodatBankFeeds( security=shared.Security( auth_header="Basic BASE_64_ENCODED(API_KEY)", ), -) - -res = s.transactions.list_create_operations(request={ - "company_id": "8a210b68-6988-11ed-a1eb-0242ac120002", - "order_by": "-modifiedDate", - "page": 1, - "page_size": 100, - "query": "id=e3334455-1aed-4e71-ab43-6bccf12092ee", -}) - -if res is not None: - # handle response - pass +) as s: + res = s.transactions.list_create_operations(request={ + "company_id": "8a210b68-6988-11ed-a1eb-0242ac120002", + "order_by": "-modifiedDate", + "page": 1, + "page_size": 100, + "query": "id=e3334455-1aed-4e71-ab43-6bccf12092ee", + }) + + if res is not None: + # handle response + pass ``` diff --git a/bank-feeds/poetry.lock b/bank-feeds/poetry.lock index 14c95acf7..df3b16445 100644 --- a/bank-feeds/poetry.lock +++ b/bank-feeds/poetry.lock @@ -221,47 +221,53 @@ files = [ [[package]] name = "mypy" -version = "1.10.1" +version = "1.13.0" description = "Optional static typing for Python" optional = false python-versions = ">=3.8" files = [ - {file = "mypy-1.10.1-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:e36f229acfe250dc660790840916eb49726c928e8ce10fbdf90715090fe4ae02"}, - {file = "mypy-1.10.1-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:51a46974340baaa4145363b9e051812a2446cf583dfaeba124af966fa44593f7"}, - {file = "mypy-1.10.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:901c89c2d67bba57aaaca91ccdb659aa3a312de67f23b9dfb059727cce2e2e0a"}, - {file = "mypy-1.10.1-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:0cd62192a4a32b77ceb31272d9e74d23cd88c8060c34d1d3622db3267679a5d9"}, - {file = "mypy-1.10.1-cp310-cp310-win_amd64.whl", hash = "sha256:a2cbc68cb9e943ac0814c13e2452d2046c2f2b23ff0278e26599224cf164e78d"}, - {file = "mypy-1.10.1-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:bd6f629b67bb43dc0d9211ee98b96d8dabc97b1ad38b9b25f5e4c4d7569a0c6a"}, - {file = "mypy-1.10.1-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:a1bbb3a6f5ff319d2b9d40b4080d46cd639abe3516d5a62c070cf0114a457d84"}, - {file = "mypy-1.10.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:b8edd4e9bbbc9d7b79502eb9592cab808585516ae1bcc1446eb9122656c6066f"}, - {file = "mypy-1.10.1-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:6166a88b15f1759f94a46fa474c7b1b05d134b1b61fca627dd7335454cc9aa6b"}, - {file = "mypy-1.10.1-cp311-cp311-win_amd64.whl", hash = "sha256:5bb9cd11c01c8606a9d0b83ffa91d0b236a0e91bc4126d9ba9ce62906ada868e"}, - {file = "mypy-1.10.1-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:d8681909f7b44d0b7b86e653ca152d6dff0eb5eb41694e163c6092124f8246d7"}, - {file = "mypy-1.10.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:378c03f53f10bbdd55ca94e46ec3ba255279706a6aacaecac52ad248f98205d3"}, - {file = "mypy-1.10.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6bacf8f3a3d7d849f40ca6caea5c055122efe70e81480c8328ad29c55c69e93e"}, - {file = "mypy-1.10.1-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:701b5f71413f1e9855566a34d6e9d12624e9e0a8818a5704d74d6b0402e66c04"}, - {file = "mypy-1.10.1-cp312-cp312-win_amd64.whl", hash = "sha256:3c4c2992f6ea46ff7fce0072642cfb62af7a2484efe69017ed8b095f7b39ef31"}, - {file = "mypy-1.10.1-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:604282c886497645ffb87b8f35a57ec773a4a2721161e709a4422c1636ddde5c"}, - {file = "mypy-1.10.1-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:37fd87cab83f09842653f08de066ee68f1182b9b5282e4634cdb4b407266bade"}, - {file = "mypy-1.10.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8addf6313777dbb92e9564c5d32ec122bf2c6c39d683ea64de6a1fd98b90fe37"}, - {file = "mypy-1.10.1-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:5cc3ca0a244eb9a5249c7c583ad9a7e881aa5d7b73c35652296ddcdb33b2b9c7"}, - {file = "mypy-1.10.1-cp38-cp38-win_amd64.whl", hash = "sha256:1b3a2ffce52cc4dbaeee4df762f20a2905aa171ef157b82192f2e2f368eec05d"}, - {file = "mypy-1.10.1-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:fe85ed6836165d52ae8b88f99527d3d1b2362e0cb90b005409b8bed90e9059b3"}, - {file = "mypy-1.10.1-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:c2ae450d60d7d020d67ab440c6e3fae375809988119817214440033f26ddf7bf"}, - {file = "mypy-1.10.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6be84c06e6abd72f960ba9a71561c14137a583093ffcf9bbfaf5e613d63fa531"}, - {file = "mypy-1.10.1-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:2189ff1e39db399f08205e22a797383613ce1cb0cb3b13d8bcf0170e45b96cc3"}, - {file = "mypy-1.10.1-cp39-cp39-win_amd64.whl", hash = "sha256:97a131ee36ac37ce9581f4220311247ab6cba896b4395b9c87af0675a13a755f"}, - {file = "mypy-1.10.1-py3-none-any.whl", hash = "sha256:71d8ac0b906354ebda8ef1673e5fde785936ac1f29ff6987c7483cfbd5a4235a"}, - {file = "mypy-1.10.1.tar.gz", hash = "sha256:1f8f492d7db9e3593ef42d4f115f04e556130f2819ad33ab84551403e97dd4c0"}, + {file = "mypy-1.13.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:6607e0f1dd1fb7f0aca14d936d13fd19eba5e17e1cd2a14f808fa5f8f6d8f60a"}, + {file = "mypy-1.13.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:8a21be69bd26fa81b1f80a61ee7ab05b076c674d9b18fb56239d72e21d9f4c80"}, + {file = "mypy-1.13.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:7b2353a44d2179846a096e25691d54d59904559f4232519d420d64da6828a3a7"}, + {file = "mypy-1.13.0-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:0730d1c6a2739d4511dc4253f8274cdd140c55c32dfb0a4cf8b7a43f40abfa6f"}, + {file = "mypy-1.13.0-cp310-cp310-win_amd64.whl", hash = "sha256:c5fc54dbb712ff5e5a0fca797e6e0aa25726c7e72c6a5850cfd2adbc1eb0a372"}, + {file = "mypy-1.13.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:581665e6f3a8a9078f28d5502f4c334c0c8d802ef55ea0e7276a6e409bc0d82d"}, + {file = "mypy-1.13.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:3ddb5b9bf82e05cc9a627e84707b528e5c7caaa1c55c69e175abb15a761cec2d"}, + {file = "mypy-1.13.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:20c7ee0bc0d5a9595c46f38beb04201f2620065a93755704e141fcac9f59db2b"}, + {file = "mypy-1.13.0-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:3790ded76f0b34bc9c8ba4def8f919dd6a46db0f5a6610fb994fe8efdd447f73"}, + {file = "mypy-1.13.0-cp311-cp311-win_amd64.whl", hash = "sha256:51f869f4b6b538229c1d1bcc1dd7d119817206e2bc54e8e374b3dfa202defcca"}, + {file = "mypy-1.13.0-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:5c7051a3461ae84dfb5dd15eff5094640c61c5f22257c8b766794e6dd85e72d5"}, + {file = "mypy-1.13.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:39bb21c69a5d6342f4ce526e4584bc5c197fd20a60d14a8624d8743fffb9472e"}, + {file = "mypy-1.13.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:164f28cb9d6367439031f4c81e84d3ccaa1e19232d9d05d37cb0bd880d3f93c2"}, + {file = "mypy-1.13.0-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:a4c1bfcdbce96ff5d96fc9b08e3831acb30dc44ab02671eca5953eadad07d6d0"}, + {file = "mypy-1.13.0-cp312-cp312-win_amd64.whl", hash = "sha256:a0affb3a79a256b4183ba09811e3577c5163ed06685e4d4b46429a271ba174d2"}, + {file = "mypy-1.13.0-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:a7b44178c9760ce1a43f544e595d35ed61ac2c3de306599fa59b38a6048e1aa7"}, + {file = "mypy-1.13.0-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:5d5092efb8516d08440e36626f0153b5006d4088c1d663d88bf79625af3d1d62"}, + {file = "mypy-1.13.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:de2904956dac40ced10931ac967ae63c5089bd498542194b436eb097a9f77bc8"}, + {file = "mypy-1.13.0-cp313-cp313-musllinux_1_1_x86_64.whl", hash = "sha256:7bfd8836970d33c2105562650656b6846149374dc8ed77d98424b40b09340ba7"}, + {file = "mypy-1.13.0-cp313-cp313-win_amd64.whl", hash = "sha256:9f73dba9ec77acb86457a8fc04b5239822df0c14a082564737833d2963677dbc"}, + {file = "mypy-1.13.0-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:100fac22ce82925f676a734af0db922ecfea991e1d7ec0ceb1e115ebe501301a"}, + {file = "mypy-1.13.0-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:7bcb0bb7f42a978bb323a7c88f1081d1b5dee77ca86f4100735a6f541299d8fb"}, + {file = "mypy-1.13.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:bde31fc887c213e223bbfc34328070996061b0833b0a4cfec53745ed61f3519b"}, + {file = "mypy-1.13.0-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:07de989f89786f62b937851295ed62e51774722e5444a27cecca993fc3f9cd74"}, + {file = "mypy-1.13.0-cp38-cp38-win_amd64.whl", hash = "sha256:4bde84334fbe19bad704b3f5b78c4abd35ff1026f8ba72b29de70dda0916beb6"}, + {file = "mypy-1.13.0-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:0246bcb1b5de7f08f2826451abd947bf656945209b140d16ed317f65a17dc7dc"}, + {file = "mypy-1.13.0-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:7f5b7deae912cf8b77e990b9280f170381fdfbddf61b4ef80927edd813163732"}, + {file = "mypy-1.13.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:7029881ec6ffb8bc233a4fa364736789582c738217b133f1b55967115288a2bc"}, + {file = "mypy-1.13.0-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:3e38b980e5681f28f033f3be86b099a247b13c491f14bb8b1e1e134d23bb599d"}, + {file = "mypy-1.13.0-cp39-cp39-win_amd64.whl", hash = "sha256:a6789be98a2017c912ae6ccb77ea553bbaf13d27605d2ca20a76dfbced631b24"}, + {file = "mypy-1.13.0-py3-none-any.whl", hash = "sha256:9c250883f9fd81d212e0952c92dbfcc96fc237f4b7c92f56ac81fd48460b3e5a"}, + {file = "mypy-1.13.0.tar.gz", hash = "sha256:0291a61b6fbf3e6673e3405cfcc0e7650bebc7939659fdca2702958038bd835e"}, ] [package.dependencies] mypy-extensions = ">=1.0.0" tomli = {version = ">=1.1.0", markers = "python_version < \"3.11\""} -typing-extensions = ">=4.1.0" +typing-extensions = ">=4.6.0" [package.extras] dmypy = ["psutil (>=4.0)"] +faster-cache = ["orjson"] install-types = ["pip"] mypyc = ["setuptools (>=50)"] reports = ["lxml"] @@ -308,8 +314,8 @@ files = [ annotated-types = ">=0.6.0" pydantic-core = "2.23.4" typing-extensions = [ - {version = ">=4.12.2", markers = "python_version >= \"3.13\""}, {version = ">=4.6.1", markers = "python_version < \"3.13\""}, + {version = ">=4.12.2", markers = "python_version >= \"3.13\""}, ] [package.extras] @@ -432,8 +438,8 @@ files = [ astroid = ">=3.2.2,<=3.3.0-dev0" colorama = {version = ">=0.4.5", markers = "sys_platform == \"win32\""} dill = [ - {version = ">=0.3.7", markers = "python_version >= \"3.12\""}, {version = ">=0.2", markers = "python_version < \"3.11\""}, + {version = ">=0.3.7", markers = "python_version >= \"3.12\""}, {version = ">=0.3.6", markers = "python_version >= \"3.11\" and python_version < \"3.12\""}, ] isort = ">=4.2.5,<5.13.0 || >5.13.0,<6" @@ -545,4 +551,4 @@ typing-extensions = ">=3.7.4" [metadata] lock-version = "2.0" python-versions = "^3.8" -content-hash = "9e57d395164aeb8637702f9d37b29cff9bdc5ebcbd44305b91808c122428bacb" +content-hash = "634a1e2581f680cde0149401ee60f1a571cfb482ce541acd8d0fa9a558cadf9d" diff --git a/bank-feeds/pyproject.toml b/bank-feeds/pyproject.toml index f93ec5f89..91a581133 100644 --- a/bank-feeds/pyproject.toml +++ b/bank-feeds/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "codat-bankfeeds" -version = "8.0.0" +version = "9.0.0" description = "Set up bank feeds from accounts in your application to supported accounting software." authors = ["Speakeasy",] readme = "README-PYPI.md" @@ -22,11 +22,11 @@ eval-type-backport = "^0.2.0" httpx = "^0.27.0" jsonpath-python = "^1.0.6" pydantic = "~2.9.2" -python-dateutil = "2.8.2" +python-dateutil = "^2.8.2" typing-inspect = "^0.9.0" [tool.poetry.group.dev.dependencies] -mypy = "==1.10.1" +mypy = "==1.13.0" pylint = "==3.2.3" types-python-dateutil = "^2.9.0.20240316" diff --git a/bank-feeds/src/codat_bankfeeds/_version.py b/bank-feeds/src/codat_bankfeeds/_version.py index 9579a8484..d8a55972e 100644 --- a/bank-feeds/src/codat_bankfeeds/_version.py +++ b/bank-feeds/src/codat_bankfeeds/_version.py @@ -3,7 +3,7 @@ import importlib.metadata __title__: str = "codat-bankfeeds" -__version__: str = "8.0.0" +__version__: str = "9.0.0" try: if __package__ is not None: diff --git a/bank-feeds/src/codat_bankfeeds/account_mapping.py b/bank-feeds/src/codat_bankfeeds/account_mapping.py index 93668b67c..1277557c9 100644 --- a/bank-feeds/src/codat_bankfeeds/account_mapping.py +++ b/bank-feeds/src/codat_bankfeeds/account_mapping.py @@ -34,6 +34,27 @@ def create( > > Only use this endpoint if you are building your own account management UI. + #### Account mapping variability + + The method of mapping the source account to the target account varies depending on the accounting software your company uses. + + #### Mapping options: + + 1. **API Mapping**: Integrate the mapping journey directly into your application for a seamless user experience. + 2. **Codat UI Mapping**: If you prefer a quicker setup, you can utilize Codat's provided user interface for mapping. + 3. **Accounting Platform Mapping**: For some accounting software, the mapping process must be conducted within the software itself. + + ### Integration-specific behaviour + + | Bank Feed Integration | API Mapping | Codat UI Mapping | Accounting Platform Mapping | + | --------------------- | ----------- | ---------------- | --------------------------- | + | Xero | ✅ | ✅ | | + | FreeAgent | ✅ | ✅ | | + | Oracle NetSuite | ✅ | ✅ | | + | Exact Online (NL) | ✅ | ✅ | | + | QuickBooks Online | | | ✅ | + | Sage | | | ✅ | + :param request: The request object to send. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method @@ -159,6 +180,27 @@ async def create_async( > > Only use this endpoint if you are building your own account management UI. + #### Account mapping variability + + The method of mapping the source account to the target account varies depending on the accounting software your company uses. + + #### Mapping options: + + 1. **API Mapping**: Integrate the mapping journey directly into your application for a seamless user experience. + 2. **Codat UI Mapping**: If you prefer a quicker setup, you can utilize Codat's provided user interface for mapping. + 3. **Accounting Platform Mapping**: For some accounting software, the mapping process must be conducted within the software itself. + + ### Integration-specific behaviour + + | Bank Feed Integration | API Mapping | Codat UI Mapping | Accounting Platform Mapping | + | --------------------- | ----------- | ---------------- | --------------------------- | + | Xero | ✅ | ✅ | | + | FreeAgent | ✅ | ✅ | | + | Oracle NetSuite | ✅ | ✅ | | + | Exact Online (NL) | ✅ | ✅ | | + | QuickBooks Online | | | ✅ | + | Sage | | | ✅ | + :param request: The request object to send. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method diff --git a/bank-feeds/src/codat_bankfeeds/companies.py b/bank-feeds/src/codat_bankfeeds/companies.py index 7d46fa403..768f69163 100644 --- a/bank-feeds/src/codat_bankfeeds/companies.py +++ b/bank-feeds/src/codat_bankfeeds/companies.py @@ -667,6 +667,222 @@ async def get_async( http_res, ) + def get_access_token( + self, + *, + request: Union[ + operations.GetCompanyAccessTokenRequest, + operations.GetCompanyAccessTokenRequestTypedDict, + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.CompanyAccessToken]: + r"""Get company access token + + Use the _Get company access token_ endpoint to return an access token for the specified company ID to use in Codat's embedded UI products. + + + :param request: The request object to send. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + + if not isinstance(request, BaseModel): + request = utils.unmarshal(request, operations.GetCompanyAccessTokenRequest) + request = cast(operations.GetCompanyAccessTokenRequest, request) + + req = self.build_request( + method="GET", + path="/companies/{companyId}/accessToken", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + security=self.sdk_configuration.security, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + else: + retries = utils.RetryConfig( + "backoff", utils.BackoffStrategy(500, 60000, 1.5, 3600000), True + ) + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["408", "429", "5XX"]) + + http_res = self.do_request( + hook_ctx=HookContext( + operation_id="get-company-access-token", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=[ + "401", + "402", + "403", + "404", + "429", + "4XX", + "500", + "503", + "5XX", + ], + retry_config=retry_config, + ) + + data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return utils.unmarshal_json( + http_res.text, Optional[shared.CompanyAccessToken] + ) + if utils.match_response( + http_res, + ["401", "402", "403", "404", "429", "500", "503"], + "application/json", + ): + data = utils.unmarshal_json(http_res.text, errors.ErrorMessageData) + raise errors.ErrorMessage(data=data) + if utils.match_response(http_res, ["4XX", "5XX"], "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + + content_type = http_res.headers.get("Content-Type") + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError( + f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", + http_res.status_code, + http_res_text, + http_res, + ) + + async def get_access_token_async( + self, + *, + request: Union[ + operations.GetCompanyAccessTokenRequest, + operations.GetCompanyAccessTokenRequestTypedDict, + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.CompanyAccessToken]: + r"""Get company access token + + Use the _Get company access token_ endpoint to return an access token for the specified company ID to use in Codat's embedded UI products. + + + :param request: The request object to send. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + + if not isinstance(request, BaseModel): + request = utils.unmarshal(request, operations.GetCompanyAccessTokenRequest) + request = cast(operations.GetCompanyAccessTokenRequest, request) + + req = self.build_request_async( + method="GET", + path="/companies/{companyId}/accessToken", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + security=self.sdk_configuration.security, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + else: + retries = utils.RetryConfig( + "backoff", utils.BackoffStrategy(500, 60000, 1.5, 3600000), True + ) + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["408", "429", "5XX"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + operation_id="get-company-access-token", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=[ + "401", + "402", + "403", + "404", + "429", + "4XX", + "500", + "503", + "5XX", + ], + retry_config=retry_config, + ) + + data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return utils.unmarshal_json( + http_res.text, Optional[shared.CompanyAccessToken] + ) + if utils.match_response( + http_res, + ["401", "402", "403", "404", "429", "500", "503"], + "application/json", + ): + data = utils.unmarshal_json(http_res.text, errors.ErrorMessageData) + raise errors.ErrorMessage(data=data) + if utils.match_response(http_res, ["4XX", "5XX"], "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + + content_type = http_res.headers.get("Content-Type") + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError( + f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", + http_res.status_code, + http_res_text, + http_res, + ) + def list( self, *, diff --git a/bank-feeds/src/codat_bankfeeds/httpclient.py b/bank-feeds/src/codat_bankfeeds/httpclient.py index 36b642a0e..167cea4ef 100644 --- a/bank-feeds/src/codat_bankfeeds/httpclient.py +++ b/bank-feeds/src/codat_bankfeeds/httpclient.py @@ -41,6 +41,9 @@ def build_request( ) -> httpx.Request: pass + def close(self) -> None: + pass + @runtime_checkable class AsyncHttpClient(Protocol): @@ -76,3 +79,6 @@ def build_request( extensions: Optional[httpx._types.RequestExtensions] = None, ) -> httpx.Request: pass + + async def aclose(self) -> None: + pass diff --git a/bank-feeds/src/codat_bankfeeds/models/operations/__init__.py b/bank-feeds/src/codat_bankfeeds/models/operations/__init__.py index 2689d53ba..b5ec3472e 100644 --- a/bank-feeds/src/codat_bankfeeds/models/operations/__init__.py +++ b/bank-feeds/src/codat_bankfeeds/models/operations/__init__.py @@ -12,6 +12,22 @@ CreateBankTransactionsRequest, CreateBankTransactionsRequestTypedDict, ) +from .create_batch_source_account import ( + CreateBatchSourceAccount1, + CreateBatchSourceAccount1TypedDict, + CreateBatchSourceAccountRequest, + CreateBatchSourceAccountRequestBody, + CreateBatchSourceAccountRequestBodyTypedDict, + CreateBatchSourceAccountRequestTypedDict, + CreateBatchSourceAccountResponse, + CreateBatchSourceAccountResponseBody, + CreateBatchSourceAccountResponseBodyTypedDict, + CreateBatchSourceAccountResponseTypedDict, + CreateBatchSourceAccountSourceAccountsResponseBody, + CreateBatchSourceAccountSourceAccountsResponseBodyTypedDict, + One, + OneTypedDict, +) from .create_connection import ( CreateConnectionRequest, CreateConnectionRequestBody, @@ -45,12 +61,20 @@ GetBankAccountMappingRequestTypedDict, ) from .get_company import GetCompanyRequest, GetCompanyRequestTypedDict +from .get_company_access_token import ( + GetCompanyAccessTokenRequest, + GetCompanyAccessTokenRequestTypedDict, +) from .get_company_information import ( GetCompanyInformationRequest, GetCompanyInformationRequestTypedDict, ) from .get_configuration import GetConfigurationRequest, GetConfigurationRequestTypedDict from .get_connection import GetConnectionRequest, GetConnectionRequestTypedDict +from .get_create_bank_transactions_model import ( + GetCreateBankTransactionsModelRequest, + GetCreateBankTransactionsModelRequestTypedDict, +) from .get_create_bankaccounts_model import ( GetCreateBankAccountsModelRequest, GetCreateBankAccountsModelRequestTypedDict, @@ -99,6 +123,18 @@ "CreateBankAccountRequestTypedDict", "CreateBankTransactionsRequest", "CreateBankTransactionsRequestTypedDict", + "CreateBatchSourceAccount1", + "CreateBatchSourceAccount1TypedDict", + "CreateBatchSourceAccountRequest", + "CreateBatchSourceAccountRequestBody", + "CreateBatchSourceAccountRequestBodyTypedDict", + "CreateBatchSourceAccountRequestTypedDict", + "CreateBatchSourceAccountResponse", + "CreateBatchSourceAccountResponseBody", + "CreateBatchSourceAccountResponseBodyTypedDict", + "CreateBatchSourceAccountResponseTypedDict", + "CreateBatchSourceAccountSourceAccountsResponseBody", + "CreateBatchSourceAccountSourceAccountsResponseBodyTypedDict", "CreateConnectionRequest", "CreateConnectionRequestBody", "CreateConnectionRequestBodyTypedDict", @@ -121,6 +157,8 @@ "GenerateCredentialsRequestTypedDict", "GetBankAccountMappingRequest", "GetBankAccountMappingRequestTypedDict", + "GetCompanyAccessTokenRequest", + "GetCompanyAccessTokenRequestTypedDict", "GetCompanyInformationRequest", "GetCompanyInformationRequestTypedDict", "GetCompanyRequest", @@ -131,6 +169,8 @@ "GetConnectionRequestTypedDict", "GetCreateBankAccountsModelRequest", "GetCreateBankAccountsModelRequestTypedDict", + "GetCreateBankTransactionsModelRequest", + "GetCreateBankTransactionsModelRequestTypedDict", "GetCreateOperationRequest", "GetCreateOperationRequestTypedDict", "GetLastSuccessfulRequest", @@ -147,6 +187,8 @@ "ListSourceAccountsRequestTypedDict", "ListSourceAccountsResponseBody", "ListSourceAccountsResponseBodyTypedDict", + "One", + "OneTypedDict", "SetConfigurationRequest", "SetConfigurationRequestTypedDict", "UnlinkConnectionRequest", diff --git a/bank-feeds/src/codat_bankfeeds/models/operations/create_batch_source_account.py b/bank-feeds/src/codat_bankfeeds/models/operations/create_batch_source_account.py new file mode 100644 index 000000000..3c1825926 --- /dev/null +++ b/bank-feeds/src/codat_bankfeeds/models/operations/create_batch_source_account.py @@ -0,0 +1,136 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from codat_bankfeeds.models.shared import ( + sourceaccount as shared_sourceaccount, + sourceaccountbatchcreateresponse as shared_sourceaccountbatchcreateresponse, + sourceaccountbatcherrorresponse as shared_sourceaccountbatcherrorresponse, + sourceaccountv2 as shared_sourceaccountv2, + sourceaccountv2batchcreateresponse as shared_sourceaccountv2batchcreateresponse, +) +from codat_bankfeeds.types import BaseModel +from codat_bankfeeds.utils import FieldMetadata, PathParamMetadata, RequestMetadata +import pydantic +from typing import List, Optional, Union +from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict + + +CreateBatchSourceAccountRequestBodyTypedDict = TypeAliasType( + "CreateBatchSourceAccountRequestBodyTypedDict", + Union[ + List[shared_sourceaccountv2.SourceAccountV2TypedDict], + List[shared_sourceaccount.SourceAccountTypedDict], + ], +) + + +CreateBatchSourceAccountRequestBody = TypeAliasType( + "CreateBatchSourceAccountRequestBody", + Union[ + List[shared_sourceaccountv2.SourceAccountV2], + List[shared_sourceaccount.SourceAccount], + ], +) + + +class CreateBatchSourceAccountRequestTypedDict(TypedDict): + company_id: str + r"""Unique identifier for a company.""" + connection_id: str + r"""Unique identifier for a connection.""" + request_body: NotRequired[CreateBatchSourceAccountRequestBodyTypedDict] + + +class CreateBatchSourceAccountRequest(BaseModel): + company_id: Annotated[ + str, + pydantic.Field(alias="companyId"), + FieldMetadata(path=PathParamMetadata(style="simple", explode=False)), + ] + r"""Unique identifier for a company.""" + + connection_id: Annotated[ + str, + pydantic.Field(alias="connectionId"), + FieldMetadata(path=PathParamMetadata(style="simple", explode=False)), + ] + r"""Unique identifier for a connection.""" + + request_body: Annotated[ + Optional[CreateBatchSourceAccountRequestBody], + FieldMetadata(request=RequestMetadata(media_type="application/json")), + ] = None + + +CreateBatchSourceAccount1TypedDict = TypeAliasType( + "CreateBatchSourceAccount1TypedDict", + Union[ + shared_sourceaccountv2batchcreateresponse.SourceAccountV2BatchCreateResponseTypedDict, + shared_sourceaccountbatchcreateresponse.SourceAccountBatchCreateResponseTypedDict, + shared_sourceaccountbatcherrorresponse.SourceAccountBatchErrorResponseTypedDict, + ], +) + + +CreateBatchSourceAccount1 = TypeAliasType( + "CreateBatchSourceAccount1", + Union[ + shared_sourceaccountv2batchcreateresponse.SourceAccountV2BatchCreateResponse, + shared_sourceaccountbatchcreateresponse.SourceAccountBatchCreateResponse, + shared_sourceaccountbatcherrorresponse.SourceAccountBatchErrorResponse, + ], +) + + +CreateBatchSourceAccountSourceAccountsResponseBodyTypedDict = List[ + CreateBatchSourceAccount1TypedDict +] +r"""Multi-Status""" + + +CreateBatchSourceAccountSourceAccountsResponseBody = List[CreateBatchSourceAccount1] +r"""Multi-Status""" + + +OneTypedDict = TypeAliasType( + "OneTypedDict", + Union[ + shared_sourceaccountv2batchcreateresponse.SourceAccountV2BatchCreateResponseTypedDict, + shared_sourceaccountbatchcreateresponse.SourceAccountBatchCreateResponseTypedDict, + ], +) + + +One = TypeAliasType( + "One", + Union[ + shared_sourceaccountv2batchcreateresponse.SourceAccountV2BatchCreateResponse, + shared_sourceaccountbatchcreateresponse.SourceAccountBatchCreateResponse, + ], +) + + +CreateBatchSourceAccountResponseBodyTypedDict = List[OneTypedDict] +r"""Success""" + + +CreateBatchSourceAccountResponseBody = List[One] +r"""Success""" + + +CreateBatchSourceAccountResponseTypedDict = TypeAliasType( + "CreateBatchSourceAccountResponseTypedDict", + Union[ + CreateBatchSourceAccountResponseBodyTypedDict, + CreateBatchSourceAccountSourceAccountsResponseBodyTypedDict, + ], +) + + +CreateBatchSourceAccountResponse = TypeAliasType( + "CreateBatchSourceAccountResponse", + Union[ + CreateBatchSourceAccountResponseBody, + CreateBatchSourceAccountSourceAccountsResponseBody, + ], +) diff --git a/bank-feeds/src/codat_bankfeeds/models/operations/create_source_account.py b/bank-feeds/src/codat_bankfeeds/models/operations/create_source_account.py index 70d4c0d78..66a47be93 100644 --- a/bank-feeds/src/codat_bankfeeds/models/operations/create_source_account.py +++ b/bank-feeds/src/codat_bankfeeds/models/operations/create_source_account.py @@ -9,18 +9,22 @@ from codat_bankfeeds.utils import FieldMetadata, PathParamMetadata, RequestMetadata import pydantic from typing import Optional, Union -from typing_extensions import Annotated, NotRequired, TypedDict +from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict -CreateSourceAccountRequestBodyTypedDict = Union[ - shared_sourceaccount.SourceAccountTypedDict, - shared_sourceaccountv2.SourceAccountV2TypedDict, -] +CreateSourceAccountRequestBodyTypedDict = TypeAliasType( + "CreateSourceAccountRequestBodyTypedDict", + Union[ + shared_sourceaccount.SourceAccountTypedDict, + shared_sourceaccountv2.SourceAccountV2TypedDict, + ], +) -CreateSourceAccountRequestBody = Union[ - shared_sourceaccount.SourceAccount, shared_sourceaccountv2.SourceAccountV2 -] +CreateSourceAccountRequestBody = TypeAliasType( + "CreateSourceAccountRequestBody", + Union[shared_sourceaccount.SourceAccount, shared_sourceaccountv2.SourceAccountV2], +) class CreateSourceAccountRequestTypedDict(TypedDict): @@ -52,14 +56,18 @@ class CreateSourceAccountRequest(BaseModel): ] = None -CreateSourceAccountResponseBodyTypedDict = Union[ - shared_sourceaccount.SourceAccountTypedDict, - shared_sourceaccountv2.SourceAccountV2TypedDict, -] +CreateSourceAccountResponseBodyTypedDict = TypeAliasType( + "CreateSourceAccountResponseBodyTypedDict", + Union[ + shared_sourceaccount.SourceAccountTypedDict, + shared_sourceaccountv2.SourceAccountV2TypedDict, + ], +) r"""Success""" -CreateSourceAccountResponseBody = Union[ - shared_sourceaccount.SourceAccount, shared_sourceaccountv2.SourceAccountV2 -] +CreateSourceAccountResponseBody = TypeAliasType( + "CreateSourceAccountResponseBody", + Union[shared_sourceaccount.SourceAccount, shared_sourceaccountv2.SourceAccountV2], +) r"""Success""" diff --git a/bank-feeds/src/codat_bankfeeds/models/operations/get_company_access_token.py b/bank-feeds/src/codat_bankfeeds/models/operations/get_company_access_token.py new file mode 100644 index 000000000..5e77aaef8 --- /dev/null +++ b/bank-feeds/src/codat_bankfeeds/models/operations/get_company_access_token.py @@ -0,0 +1,21 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from codat_bankfeeds.types import BaseModel +from codat_bankfeeds.utils import FieldMetadata, PathParamMetadata +import pydantic +from typing_extensions import Annotated, TypedDict + + +class GetCompanyAccessTokenRequestTypedDict(TypedDict): + company_id: str + r"""Unique identifier for a company.""" + + +class GetCompanyAccessTokenRequest(BaseModel): + company_id: Annotated[ + str, + pydantic.Field(alias="companyId"), + FieldMetadata(path=PathParamMetadata(style="simple", explode=False)), + ] + r"""Unique identifier for a company.""" diff --git a/bank-feeds/src/codat_bankfeeds/models/operations/get_create_bank_transactions_model.py b/bank-feeds/src/codat_bankfeeds/models/operations/get_create_bank_transactions_model.py new file mode 100644 index 000000000..5c726dd9e --- /dev/null +++ b/bank-feeds/src/codat_bankfeeds/models/operations/get_create_bank_transactions_model.py @@ -0,0 +1,39 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from codat_bankfeeds.types import BaseModel +from codat_bankfeeds.utils import FieldMetadata, PathParamMetadata +import pydantic +from typing_extensions import Annotated, TypedDict + + +class GetCreateBankTransactionsModelRequestTypedDict(TypedDict): + account_id: str + r"""Unique identifier for an account.""" + company_id: str + r"""Unique identifier for a company.""" + connection_id: str + r"""Unique identifier for a connection.""" + + +class GetCreateBankTransactionsModelRequest(BaseModel): + account_id: Annotated[ + str, + pydantic.Field(alias="accountId"), + FieldMetadata(path=PathParamMetadata(style="simple", explode=False)), + ] + r"""Unique identifier for an account.""" + + company_id: Annotated[ + str, + pydantic.Field(alias="companyId"), + FieldMetadata(path=PathParamMetadata(style="simple", explode=False)), + ] + r"""Unique identifier for a company.""" + + connection_id: Annotated[ + str, + pydantic.Field(alias="connectionId"), + FieldMetadata(path=PathParamMetadata(style="simple", explode=False)), + ] + r"""Unique identifier for a connection.""" diff --git a/bank-feeds/src/codat_bankfeeds/models/operations/list_source_accounts.py b/bank-feeds/src/codat_bankfeeds/models/operations/list_source_accounts.py index f59a3ea86..0381b397a 100644 --- a/bank-feeds/src/codat_bankfeeds/models/operations/list_source_accounts.py +++ b/bank-feeds/src/codat_bankfeeds/models/operations/list_source_accounts.py @@ -9,7 +9,7 @@ from codat_bankfeeds.utils import FieldMetadata, PathParamMetadata import pydantic from typing import List, Union -from typing_extensions import Annotated, TypedDict +from typing_extensions import Annotated, TypeAliasType, TypedDict class ListSourceAccountsRequestTypedDict(TypedDict): @@ -35,15 +35,21 @@ class ListSourceAccountsRequest(BaseModel): r"""Unique identifier for a connection.""" -ListSourceAccountsResponseBodyTypedDict = Union[ - List[shared_sourceaccountv2.SourceAccountV2TypedDict], - List[shared_sourceaccount.SourceAccountTypedDict], -] +ListSourceAccountsResponseBodyTypedDict = TypeAliasType( + "ListSourceAccountsResponseBodyTypedDict", + Union[ + List[shared_sourceaccountv2.SourceAccountV2TypedDict], + List[shared_sourceaccount.SourceAccountTypedDict], + ], +) r"""Success""" -ListSourceAccountsResponseBody = Union[ - List[shared_sourceaccountv2.SourceAccountV2], - List[shared_sourceaccount.SourceAccount], -] +ListSourceAccountsResponseBody = TypeAliasType( + "ListSourceAccountsResponseBody", + Union[ + List[shared_sourceaccountv2.SourceAccountV2], + List[shared_sourceaccount.SourceAccount], + ], +) r"""Success""" diff --git a/bank-feeds/src/codat_bankfeeds/models/shared/__init__.py b/bank-feeds/src/codat_bankfeeds/models/shared/__init__.py index 0b224f156..4d7ea6d52 100644 --- a/bank-feeds/src/codat_bankfeeds/models/shared/__init__.py +++ b/bank-feeds/src/codat_bankfeeds/models/shared/__init__.py @@ -74,6 +74,7 @@ ) from .companies import Companies, CompaniesTypedDict from .company import Company, CompanyTypedDict +from .companyaccesstoken import CompanyAccessToken, CompanyAccessTokenTypedDict from .companyinformation import CompanyInformation, CompanyInformationTypedDict from .companyreference import ( CompanyReference, @@ -127,12 +128,26 @@ from .routinginfo import RoutingInfo, RoutingInfoTypedDict, Type from .security import Security, SecurityTypedDict from .sourceaccount import SourceAccount, SourceAccountTypedDict, Status +from .sourceaccountbatchcreateresponse import ( + SourceAccountBatchCreateResponse, + SourceAccountBatchCreateResponseTypedDict, +) +from .sourceaccountbatcherrorresponse import ( + Result, + ResultTypedDict, + SourceAccountBatchErrorResponse, + SourceAccountBatchErrorResponseTypedDict, +) from .sourceaccountv2 import ( AccountType, SourceAccountV2, SourceAccountV2Status, SourceAccountV2TypedDict, ) +from .sourceaccountv2batchcreateresponse import ( + SourceAccountV2BatchCreateResponse, + SourceAccountV2BatchCreateResponseTypedDict, +) from .sourceaccountwebhook import SourceAccountWebhook, SourceAccountWebhookTypedDict from .sourceaccountwebhookpayload import ( SourceAccountWebhookPayload, @@ -195,6 +210,8 @@ "Companies", "CompaniesTypedDict", "Company", + "CompanyAccessToken", + "CompanyAccessTokenTypedDict", "CompanyInformation", "CompanyInformationTypedDict", "CompanyReference", @@ -260,13 +277,21 @@ "PushOptionTypedDict", "PushValidationInfo", "PushValidationInfoTypedDict", + "Result", + "ResultTypedDict", "RoutingInfo", "RoutingInfoTypedDict", "Security", "SecurityTypedDict", "SourceAccount", + "SourceAccountBatchCreateResponse", + "SourceAccountBatchCreateResponseTypedDict", + "SourceAccountBatchErrorResponse", + "SourceAccountBatchErrorResponseTypedDict", "SourceAccountTypedDict", "SourceAccountV2", + "SourceAccountV2BatchCreateResponse", + "SourceAccountV2BatchCreateResponseTypedDict", "SourceAccountV2Status", "SourceAccountV2TypedDict", "SourceAccountWebhook", diff --git a/bank-feeds/src/codat_bankfeeds/models/shared/banktransactions.py b/bank-feeds/src/codat_bankfeeds/models/shared/banktransactions.py index 62e2bc44e..449b8a9f6 100644 --- a/bank-feeds/src/codat_bankfeeds/models/shared/banktransactions.py +++ b/bank-feeds/src/codat_bankfeeds/models/shared/banktransactions.py @@ -43,9 +43,13 @@ class BankTransactionType(str, Enum): class BankTransactionsTypedDict(TypedDict): - amount: Decimal + amount: NotRequired[Decimal] r"""The amount transacted in the bank transaction.""" - date_: str + balance: NotRequired[Decimal] + r"""The remaining balance in the account with ID `accountId`. This field is optional for QuickBooks Online but is required for Xero, Sage, NetSuite, Exact, and FreeAgent.""" + counterparty: NotRequired[Nullable[str]] + r"""The giving or receiving party such as a person or organization.""" + date_: NotRequired[str] r"""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: ``` @@ -66,14 +70,10 @@ class BankTransactionsTypedDict(TypedDict): > 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. """ - id: str - r"""Identifier for the bank account transaction, unique for the company in the accounting software.""" - balance: NotRequired[Decimal] - r"""The remaining balance in the account with ID `accountId`. This field is optional for QuickBooks Online but is required for Xero, Sage, NetSuite, Exact, and FreeAgent.""" - counterparty: NotRequired[Nullable[str]] - r"""The giving or receiving party such as a person or organization.""" description: NotRequired[Nullable[str]] r"""Description of the bank transaction.""" + id: NotRequired[str] + r"""Identifier for the bank account transaction, unique for the company in the accounting software.""" reconciled: NotRequired[Nullable[bool]] r"""`True` if the bank transaction has been [reconciled](https://www.xero.com/uk/guides/what-is-bank-reconciliation/) in the accounting software.""" reference: NotRequired[Nullable[str]] @@ -84,13 +84,23 @@ class BankTransactionsTypedDict(TypedDict): class BankTransactions(BaseModel): amount: Annotated[ - Decimal, + Optional[Decimal], BeforeValidator(validate_decimal), PlainSerializer(serialize_decimal(False)), - ] + ] = None r"""The amount transacted in the bank transaction.""" - date_: Annotated[str, pydantic.Field(alias="date")] + balance: Annotated[ + Optional[Decimal], + BeforeValidator(validate_decimal), + PlainSerializer(serialize_decimal(False)), + ] = None + r"""The remaining balance in the account with ID `accountId`. This field is optional for QuickBooks Online but is required for Xero, Sage, NetSuite, Exact, and FreeAgent.""" + + counterparty: OptionalNullable[str] = UNSET + r"""The giving or receiving party such as a person or organization.""" + + date_: Annotated[Optional[str], pydantic.Field(alias="date")] = None r"""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: ``` @@ -112,22 +122,12 @@ class BankTransactions(BaseModel): > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. """ - id: str - r"""Identifier for the bank account transaction, unique for the company in the accounting software.""" - - balance: Annotated[ - Optional[Decimal], - BeforeValidator(validate_decimal), - PlainSerializer(serialize_decimal(False)), - ] = None - r"""The remaining balance in the account with ID `accountId`. This field is optional for QuickBooks Online but is required for Xero, Sage, NetSuite, Exact, and FreeAgent.""" - - counterparty: OptionalNullable[str] = UNSET - r"""The giving or receiving party such as a person or organization.""" - description: OptionalNullable[str] = UNSET r"""Description of the bank transaction.""" + id: Optional[str] = None + r"""Identifier for the bank account transaction, unique for the company in the accounting software.""" + reconciled: OptionalNullable[bool] = UNSET r"""`True` if the bank transaction has been [reconciled](https://www.xero.com/uk/guides/what-is-bank-reconciliation/) in the accounting software.""" @@ -142,9 +142,12 @@ class BankTransactions(BaseModel): @model_serializer(mode="wrap") def serialize_model(self, handler): optional_fields = [ + "amount", "balance", "counterparty", + "date", "description", + "id", "reconciled", "reference", "transactionType", diff --git a/bank-feeds/src/codat_bankfeeds/models/shared/company.py b/bank-feeds/src/codat_bankfeeds/models/shared/company.py index d9de9c08c..d158008b4 100644 --- a/bank-feeds/src/codat_bankfeeds/models/shared/company.py +++ b/bank-feeds/src/codat_bankfeeds/models/shared/company.py @@ -1,6 +1,7 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" from __future__ import annotations +from .companyreference import CompanyReference, CompanyReferenceTypedDict from .connection import Connection, ConnectionTypedDict from codat_bankfeeds.types import ( BaseModel, @@ -78,6 +79,9 @@ class CompanyTypedDict(TypedDict): """ products: NotRequired[List[str]] r"""An array of products that are currently enabled for the company.""" + reference_parent_company: NotRequired[CompanyReferenceTypedDict] + reference_subsidiary_companies: NotRequired[List[CompanyReferenceTypedDict]] + r"""A list of subsidiary companies owned or controlled by this entity. Empty if the company has no children.""" tags: NotRequired[Dict[str, str]] r"""A collection of user-defined key-value pairs that store custom metadata against the company.""" @@ -158,6 +162,16 @@ class Company(BaseModel): products: Optional[List[str]] = None r"""An array of products that are currently enabled for the company.""" + reference_parent_company: Annotated[ + Optional[CompanyReference], pydantic.Field(alias="referenceParentCompany") + ] = None + + reference_subsidiary_companies: Annotated[ + Optional[List[CompanyReference]], + pydantic.Field(alias="referenceSubsidiaryCompanies"), + ] = None + r"""A list of subsidiary companies owned or controlled by this entity. Empty if the company has no children.""" + tags: Optional[Dict[str, str]] = None r"""A collection of user-defined key-value pairs that store custom metadata against the company.""" @@ -170,6 +184,8 @@ def serialize_model(self, handler): "description", "lastSync", "products", + "referenceParentCompany", + "referenceSubsidiaryCompanies", "tags", ] nullable_fields = ["createdByUserName"] diff --git a/bank-feeds/src/codat_bankfeeds/models/shared/companyaccesstoken.py b/bank-feeds/src/codat_bankfeeds/models/shared/companyaccesstoken.py new file mode 100644 index 000000000..5b6ea4d4b --- /dev/null +++ b/bank-feeds/src/codat_bankfeeds/models/shared/companyaccesstoken.py @@ -0,0 +1,30 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from codat_bankfeeds.types import BaseModel +import pydantic +from typing_extensions import Annotated, TypedDict + + +class CompanyAccessTokenTypedDict(TypedDict): + r"""Details of the access token provisioned for a company.""" + + access_token: str + r"""The access token for the company.""" + expires_in: int + r"""The number of seconds until the access token expires.""" + token_type: str + r"""The type of token.""" + + +class CompanyAccessToken(BaseModel): + r"""Details of the access token provisioned for a company.""" + + access_token: Annotated[str, pydantic.Field(alias="accessToken")] + r"""The access token for the company.""" + + expires_in: Annotated[int, pydantic.Field(alias="expiresIn")] + r"""The number of seconds until the access token expires.""" + + token_type: Annotated[str, pydantic.Field(alias="tokenType")] + r"""The type of token.""" diff --git a/bank-feeds/src/codat_bankfeeds/models/shared/sourceaccountbatchcreateresponse.py b/bank-feeds/src/codat_bankfeeds/models/shared/sourceaccountbatchcreateresponse.py new file mode 100644 index 000000000..486bc1b0a --- /dev/null +++ b/bank-feeds/src/codat_bankfeeds/models/shared/sourceaccountbatchcreateresponse.py @@ -0,0 +1,29 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .sourceaccount import SourceAccount, SourceAccountTypedDict +from codat_bankfeeds.types import BaseModel +import pydantic +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class SourceAccountBatchCreateResponseTypedDict(TypedDict): + r"""The account ID and source account object of the successfully created source account.""" + + result: NotRequired[SourceAccountTypedDict] + r"""The target bank account in a supported accounting software for ingestion into a bank feed.""" + source_account_id: NotRequired[str] + r"""Unique ID for the source account.""" + + +class SourceAccountBatchCreateResponse(BaseModel): + r"""The account ID and source account object of the successfully created source account.""" + + result: Optional[SourceAccount] = None + r"""The target bank account in a supported accounting software for ingestion into a bank feed.""" + + source_account_id: Annotated[ + Optional[str], pydantic.Field(alias="sourceAccountId") + ] = None + r"""Unique ID for the source account.""" diff --git a/bank-feeds/src/codat_bankfeeds/models/shared/sourceaccountbatcherrorresponse.py b/bank-feeds/src/codat_bankfeeds/models/shared/sourceaccountbatcherrorresponse.py new file mode 100644 index 000000000..3d15f2993 --- /dev/null +++ b/bank-feeds/src/codat_bankfeeds/models/shared/sourceaccountbatcherrorresponse.py @@ -0,0 +1,41 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from codat_bankfeeds.types import BaseModel +import pydantic +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class ResultTypedDict(TypedDict): + error: NotRequired[str] + r"""The error description for the attempted creation of the source account.""" + status_code: NotRequired[str] + r"""The error status code for the attempted creation of the source account.""" + + +class Result(BaseModel): + error: Optional[str] = None + r"""The error description for the attempted creation of the source account.""" + + status_code: Annotated[Optional[str], pydantic.Field(alias="statusCode")] = None + r"""The error status code for the attempted creation of the source account.""" + + +class SourceAccountBatchErrorResponseTypedDict(TypedDict): + r"""Describes the error that occured when trying to create the specified source account.""" + + result: NotRequired[ResultTypedDict] + source_account_id: NotRequired[str] + r"""Unique ID for the source account.""" + + +class SourceAccountBatchErrorResponse(BaseModel): + r"""Describes the error that occured when trying to create the specified source account.""" + + result: Optional[Result] = None + + source_account_id: Annotated[ + Optional[str], pydantic.Field(alias="sourceAccountId") + ] = None + r"""Unique ID for the source account.""" diff --git a/bank-feeds/src/codat_bankfeeds/models/shared/sourceaccountv2batchcreateresponse.py b/bank-feeds/src/codat_bankfeeds/models/shared/sourceaccountv2batchcreateresponse.py new file mode 100644 index 000000000..7becbe9e2 --- /dev/null +++ b/bank-feeds/src/codat_bankfeeds/models/shared/sourceaccountv2batchcreateresponse.py @@ -0,0 +1,29 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .sourceaccountv2 import SourceAccountV2, SourceAccountV2TypedDict +from codat_bankfeeds.types import BaseModel +import pydantic +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class SourceAccountV2BatchCreateResponseTypedDict(TypedDict): + r"""The account ID and source account object of the successfully created source account.""" + + result: NotRequired[SourceAccountV2TypedDict] + r"""The target bank account in a supported accounting software for ingestion into a bank feed.""" + source_account_id: NotRequired[str] + r"""Unique ID for the source account.""" + + +class SourceAccountV2BatchCreateResponse(BaseModel): + r"""The account ID and source account object of the successfully created source account.""" + + result: Optional[SourceAccountV2] = None + r"""The target bank account in a supported accounting software for ingestion into a bank feed.""" + + source_account_id: Annotated[ + Optional[str], pydantic.Field(alias="sourceAccountId") + ] = None + r"""Unique ID for the source account.""" diff --git a/bank-feeds/src/codat_bankfeeds/sdk.py b/bank-feeds/src/codat_bankfeeds/sdk.py index 1bc2e6120..cee45d442 100644 --- a/bank-feeds/src/codat_bankfeeds/sdk.py +++ b/bank-feeds/src/codat_bankfeeds/sdk.py @@ -145,3 +145,17 @@ def _init_sdks(self): self.transactions = Transactions(self.sdk_configuration) self.configuration = Configuration(self.sdk_configuration) self.sync = Sync(self.sdk_configuration) + + def __enter__(self): + return self + + async def __aenter__(self): + return self + + def __exit__(self, exc_type, exc_val, exc_tb): + if self.sdk_configuration.client is not None: + self.sdk_configuration.client.close() + + async def __aexit__(self, exc_type, exc_val, exc_tb): + if self.sdk_configuration.async_client is not None: + await self.sdk_configuration.async_client.aclose() diff --git a/bank-feeds/src/codat_bankfeeds/sdkconfiguration.py b/bank-feeds/src/codat_bankfeeds/sdkconfiguration.py index 882c43bbe..38c14222c 100644 --- a/bank-feeds/src/codat_bankfeeds/sdkconfiguration.py +++ b/bank-feeds/src/codat_bankfeeds/sdkconfiguration.py @@ -27,9 +27,9 @@ class SDKConfiguration: server_idx: Optional[int] = 0 language: str = "python" openapi_doc_version: str = "3.0.0" - sdk_version: str = "8.0.0" - gen_version: str = "2.451.0" - user_agent: str = "speakeasy-sdk/python 8.0.0 2.451.0 3.0.0 codat-bankfeeds" + sdk_version: str = "9.0.0" + gen_version: str = "2.462.1" + user_agent: str = "speakeasy-sdk/python 9.0.0 2.462.1 3.0.0 codat-bankfeeds" retry_config: OptionalNullable[RetryConfig] = Field(default_factory=lambda: UNSET) timeout_ms: Optional[int] = None diff --git a/bank-feeds/src/codat_bankfeeds/source_accounts.py b/bank-feeds/src/codat_bankfeeds/source_accounts.py index 54b6c74ee..19555399f 100644 --- a/bank-feeds/src/codat_bankfeeds/source_accounts.py +++ b/bank-feeds/src/codat_bankfeeds/source_accounts.py @@ -23,31 +23,10 @@ def create( server_url: Optional[str] = None, timeout_ms: Optional[int] = None, ) -> Optional[operations.CreateSourceAccountResponseBody]: - r"""Create source account + r"""Create single source account The _Create Source Account_ endpoint allows you to create a representation of a bank account within Codat's domain. The company can then map the source account to an existing or new target account in their accounting software. - #### Account mapping variability - - The method of mapping the source account to the target account varies depending on the accounting software your company uses. - - #### Mapping options: - - 1. **API Mapping**: Integrate the mapping journey directly into your application for a seamless user experience. - 2. **Codat UI Mapping**: If you prefer a quicker setup, you can utilize Codat's provided user interface for mapping. - 3. **Accounting Platform Mapping**: For some accounting software, the mapping process must be conducted within the software itself. - - ### Integration-specific behaviour - - | Bank Feed Integration | API Mapping | Codat UI Mapping | Accounting Platform Mapping | - | --------------------- | ----------- | ---------------- | --------------------------- | - | Xero | ✅ | ✅ | | - | FreeAgent | ✅ | ✅ | | - | Oracle NetSuite | ✅ | ✅ | | - | Exact Online (NL) | ✅ | ✅ | | - | QuickBooks Online | | | ✅ | - | Sage | | | ✅ | - > ### Versioning > If you are integrating the Bank Feeds API with Codat after August 1, 2024, please use the v2 version of the API, as detailed in the schema below. For integrations completed before August 1, 2024, select the v1 version from the schema dropdown below. @@ -162,31 +141,10 @@ async def create_async( server_url: Optional[str] = None, timeout_ms: Optional[int] = None, ) -> Optional[operations.CreateSourceAccountResponseBody]: - r"""Create source account + r"""Create single source account The _Create Source Account_ endpoint allows you to create a representation of a bank account within Codat's domain. The company can then map the source account to an existing or new target account in their accounting software. - #### Account mapping variability - - The method of mapping the source account to the target account varies depending on the accounting software your company uses. - - #### Mapping options: - - 1. **API Mapping**: Integrate the mapping journey directly into your application for a seamless user experience. - 2. **Codat UI Mapping**: If you prefer a quicker setup, you can utilize Codat's provided user interface for mapping. - 3. **Accounting Platform Mapping**: For some accounting software, the mapping process must be conducted within the software itself. - - ### Integration-specific behaviour - - | Bank Feed Integration | API Mapping | Codat UI Mapping | Accounting Platform Mapping | - | --------------------- | ----------- | ---------------- | --------------------------- | - | Xero | ✅ | ✅ | | - | FreeAgent | ✅ | ✅ | | - | Oracle NetSuite | ✅ | ✅ | | - | Exact Online (NL) | ✅ | ✅ | | - | QuickBooks Online | | | ✅ | - | Sage | | | ✅ | - > ### Versioning > If you are integrating the Bank Feeds API with Codat after August 1, 2024, please use the v2 version of the API, as detailed in the schema below. For integrations completed before August 1, 2024, select the v1 version from the schema dropdown below. @@ -290,6 +248,258 @@ async def create_async( http_res, ) + def create_batch( + self, + *, + request: Union[ + operations.CreateBatchSourceAccountRequest, + operations.CreateBatchSourceAccountRequestTypedDict, + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[operations.CreateBatchSourceAccountResponse]: + r"""Create source accounts + + The _Batch create source accounts_ endpoint allows you to create multiple representations of your SMB's bank accounts within Codat's domain. The company can then map the source account to an existing or new target account in their accounting software. + + > ### Versioning + > If you are integrating the Bank Feeds API with Codat after August 1, 2024, please use the v2 version of the API, as detailed in the schema below. For integrations completed before August 1, 2024, select the v1 version from the schema dropdown below. + + :param request: The request object to send. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + + if not isinstance(request, BaseModel): + request = utils.unmarshal( + request, operations.CreateBatchSourceAccountRequest + ) + request = cast(operations.CreateBatchSourceAccountRequest, request) + + req = self.build_request( + method="POST", + path="/companies/{companyId}/connections/{connectionId}/connectionInfo/bankFeedAccounts/batch", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request.request_body, + False, + True, + "json", + Optional[operations.CreateBatchSourceAccountRequestBody], + ), + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + else: + retries = utils.RetryConfig( + "backoff", utils.BackoffStrategy(500, 60000, 1.5, 3600000), True + ) + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["408", "429", "5XX"]) + + http_res = self.do_request( + hook_ctx=HookContext( + operation_id="create-batch-source-account", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=[ + "400", + "401", + "402", + "403", + "404", + "409", + "429", + "4XX", + "500", + "503", + "5XX", + ], + retry_config=retry_config, + ) + + data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return utils.unmarshal_json( + http_res.text, Optional[operations.CreateBatchSourceAccountResponseBody] + ) + if utils.match_response(http_res, "207", "application/json"): + return utils.unmarshal_json( + http_res.text, + Optional[operations.CreateBatchSourceAccountSourceAccountsResponseBody], + ) + if utils.match_response( + http_res, + ["400", "401", "402", "403", "404", "409", "429", "500", "503"], + "application/json", + ): + data = utils.unmarshal_json(http_res.text, errors.ErrorMessageData) + raise errors.ErrorMessage(data=data) + if utils.match_response(http_res, ["4XX", "5XX"], "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + + content_type = http_res.headers.get("Content-Type") + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError( + f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", + http_res.status_code, + http_res_text, + http_res, + ) + + async def create_batch_async( + self, + *, + request: Union[ + operations.CreateBatchSourceAccountRequest, + operations.CreateBatchSourceAccountRequestTypedDict, + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[operations.CreateBatchSourceAccountResponse]: + r"""Create source accounts + + The _Batch create source accounts_ endpoint allows you to create multiple representations of your SMB's bank accounts within Codat's domain. The company can then map the source account to an existing or new target account in their accounting software. + + > ### Versioning + > If you are integrating the Bank Feeds API with Codat after August 1, 2024, please use the v2 version of the API, as detailed in the schema below. For integrations completed before August 1, 2024, select the v1 version from the schema dropdown below. + + :param request: The request object to send. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + + if not isinstance(request, BaseModel): + request = utils.unmarshal( + request, operations.CreateBatchSourceAccountRequest + ) + request = cast(operations.CreateBatchSourceAccountRequest, request) + + req = self.build_request_async( + method="POST", + path="/companies/{companyId}/connections/{connectionId}/connectionInfo/bankFeedAccounts/batch", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request.request_body, + False, + True, + "json", + Optional[operations.CreateBatchSourceAccountRequestBody], + ), + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + else: + retries = utils.RetryConfig( + "backoff", utils.BackoffStrategy(500, 60000, 1.5, 3600000), True + ) + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["408", "429", "5XX"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + operation_id="create-batch-source-account", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=[ + "400", + "401", + "402", + "403", + "404", + "409", + "429", + "4XX", + "500", + "503", + "5XX", + ], + retry_config=retry_config, + ) + + data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return utils.unmarshal_json( + http_res.text, Optional[operations.CreateBatchSourceAccountResponseBody] + ) + if utils.match_response(http_res, "207", "application/json"): + return utils.unmarshal_json( + http_res.text, + Optional[operations.CreateBatchSourceAccountSourceAccountsResponseBody], + ) + if utils.match_response( + http_res, + ["400", "401", "402", "403", "404", "409", "429", "500", "503"], + "application/json", + ): + data = utils.unmarshal_json(http_res.text, errors.ErrorMessageData) + raise errors.ErrorMessage(data=data) + if utils.match_response(http_res, ["4XX", "5XX"], "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + + content_type = http_res.headers.get("Content-Type") + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError( + f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", + http_res.status_code, + http_res_text, + http_res, + ) + def delete( self, *, diff --git a/bank-feeds/src/codat_bankfeeds/transactions.py b/bank-feeds/src/codat_bankfeeds/transactions.py index bc861a051..c13576650 100644 --- a/bank-feeds/src/codat_bankfeeds/transactions.py +++ b/bank-feeds/src/codat_bankfeeds/transactions.py @@ -30,8 +30,8 @@ def create( **Integration-specific behaviour** - Required data may vary by integration. To see what data to post, first call [Get create bank transaction model](https://docs.codat.io/bank-feeds-api#/operations/get-create-bankTransactions-model). - + The required properties may vary based on the integration. For detailed requirements specific to each accounting software, refer to the API reference examples. + Alternatively, you can view the [Get create bank transaction model](https://docs.codat.io/bank-feeds-api#/operations/get-create-bank-transactions-model) for more information. :param request: The request object to send. :param retries: Override the default retry configuration for this method @@ -152,8 +152,8 @@ async def create_async( **Integration-specific behaviour** - Required data may vary by integration. To see what data to post, first call [Get create bank transaction model](https://docs.codat.io/bank-feeds-api#/operations/get-create-bankTransactions-model). - + The required properties may vary based on the integration. For detailed requirements specific to each accounting software, refer to the API reference examples. + Alternatively, you can view the [Get create bank transaction model](https://docs.codat.io/bank-feeds-api#/operations/get-create-bank-transactions-model) for more information. :param request: The request object to send. :param retries: Override the default retry configuration for this method @@ -255,6 +255,232 @@ async def create_async( http_res, ) + def get_create_model( + self, + *, + request: Union[ + operations.GetCreateBankTransactionsModelRequest, + operations.GetCreateBankTransactionsModelRequestTypedDict, + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.PushOption]: + r"""Get create bank transactions model + + The *Get create bank account transactions model* endpoint returns the expected data for the request payload when creating [bank account transactions](https://docs.codat.io/bank-feeds-api#/schemas/BankTransactions) for a given company and integration. + + [Bank account transactions](https://docs.codat.io/bank-feeds-api#/schemas/BankTransactions) are records of money that has moved in and out of an SMB's bank account. + + **Integration-specific behaviour** + + See the *response examples* for integration-specific indicative models. + + :param request: The request object to send. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + + if not isinstance(request, BaseModel): + request = utils.unmarshal( + request, operations.GetCreateBankTransactionsModelRequest + ) + request = cast(operations.GetCreateBankTransactionsModelRequest, request) + + req = self.build_request( + method="GET", + path="/companies/{companyId}/connections/{connectionId}/options/bankAccounts/{accountId}/bankTransactions", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + security=self.sdk_configuration.security, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + else: + retries = utils.RetryConfig( + "backoff", utils.BackoffStrategy(500, 60000, 1.5, 3600000), True + ) + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["408", "429", "5XX"]) + + http_res = self.do_request( + hook_ctx=HookContext( + operation_id="get-create-bank-transactions-model", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=[ + "401", + "402", + "403", + "404", + "429", + "4XX", + "500", + "503", + "5XX", + ], + retry_config=retry_config, + ) + + data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return utils.unmarshal_json(http_res.text, Optional[shared.PushOption]) + if utils.match_response( + http_res, + ["401", "402", "403", "404", "429", "500", "503"], + "application/json", + ): + data = utils.unmarshal_json(http_res.text, errors.ErrorMessageData) + raise errors.ErrorMessage(data=data) + if utils.match_response(http_res, ["4XX", "5XX"], "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + + content_type = http_res.headers.get("Content-Type") + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError( + f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", + http_res.status_code, + http_res_text, + http_res, + ) + + async def get_create_model_async( + self, + *, + request: Union[ + operations.GetCreateBankTransactionsModelRequest, + operations.GetCreateBankTransactionsModelRequestTypedDict, + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.PushOption]: + r"""Get create bank transactions model + + The *Get create bank account transactions model* endpoint returns the expected data for the request payload when creating [bank account transactions](https://docs.codat.io/bank-feeds-api#/schemas/BankTransactions) for a given company and integration. + + [Bank account transactions](https://docs.codat.io/bank-feeds-api#/schemas/BankTransactions) are records of money that has moved in and out of an SMB's bank account. + + **Integration-specific behaviour** + + See the *response examples* for integration-specific indicative models. + + :param request: The request object to send. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + + if not isinstance(request, BaseModel): + request = utils.unmarshal( + request, operations.GetCreateBankTransactionsModelRequest + ) + request = cast(operations.GetCreateBankTransactionsModelRequest, request) + + req = self.build_request_async( + method="GET", + path="/companies/{companyId}/connections/{connectionId}/options/bankAccounts/{accountId}/bankTransactions", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + security=self.sdk_configuration.security, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + else: + retries = utils.RetryConfig( + "backoff", utils.BackoffStrategy(500, 60000, 1.5, 3600000), True + ) + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["408", "429", "5XX"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + operation_id="get-create-bank-transactions-model", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=[ + "401", + "402", + "403", + "404", + "429", + "4XX", + "500", + "503", + "5XX", + ], + retry_config=retry_config, + ) + + data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return utils.unmarshal_json(http_res.text, Optional[shared.PushOption]) + if utils.match_response( + http_res, + ["401", "402", "403", "404", "429", "500", "503"], + "application/json", + ): + data = utils.unmarshal_json(http_res.text, errors.ErrorMessageData) + raise errors.ErrorMessage(data=data) + if utils.match_response(http_res, ["4XX", "5XX"], "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + + content_type = http_res.headers.get("Content-Type") + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError( + f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", + http_res.status_code, + http_res_text, + http_res, + ) + def get_create_operation( self, *, diff --git a/bank-feeds/src/codat_bankfeeds/utils/annotations.py b/bank-feeds/src/codat_bankfeeds/utils/annotations.py index 5b3bbb027..387874edd 100644 --- a/bank-feeds/src/codat_bankfeeds/utils/annotations.py +++ b/bank-feeds/src/codat_bankfeeds/utils/annotations.py @@ -1,30 +1,55 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" from enum import Enum -from typing import Any +from typing import Any, Optional def get_discriminator(model: Any, fieldname: str, key: str) -> str: - if isinstance(model, dict): - try: - return f'{model.get(key)}' - except AttributeError as e: - raise ValueError(f'Could not find discriminator key {key} in {model}') from e + """ + Recursively search for the discriminator attribute in a model. - if hasattr(model, fieldname): - attr = getattr(model, fieldname) + Args: + model (Any): The model to search within. + fieldname (str): The name of the field to search for. + key (str): The key to search for in dictionaries. - if isinstance(attr, Enum): - return f'{attr.value}' + Returns: + str: The name of the discriminator attribute. - return f'{attr}' + Raises: + ValueError: If the discriminator attribute is not found. + """ + upper_fieldname = fieldname.upper() - fieldname = fieldname.upper() - if hasattr(model, fieldname): - attr = getattr(model, fieldname) + def get_field_discriminator(field: Any) -> Optional[str]: + """Search for the discriminator attribute in a given field.""" - if isinstance(attr, Enum): - return f'{attr.value}' + if isinstance(field, dict): + if key in field: + return f'{field[key]}' - return f'{attr}' + if hasattr(field, fieldname): + attr = getattr(field, fieldname) + if isinstance(attr, Enum): + return f'{attr.value}' + return f'{attr}' + + if hasattr(field, upper_fieldname): + attr = getattr(field, upper_fieldname) + if isinstance(attr, Enum): + return f'{attr.value}' + return f'{attr}' + + return None + + + if isinstance(model, list): + for field in model: + discriminator = get_field_discriminator(field) + if discriminator is not None: + return discriminator + + discriminator = get_field_discriminator(model) + if discriminator is not None: + return discriminator raise ValueError(f'Could not find discriminator field {fieldname} in {model}') diff --git a/bank-feeds/src/codat_bankfeeds/utils/eventstreaming.py b/bank-feeds/src/codat_bankfeeds/utils/eventstreaming.py index 553b386b3..74a63f757 100644 --- a/bank-feeds/src/codat_bankfeeds/utils/eventstreaming.py +++ b/bank-feeds/src/codat_bankfeeds/utils/eventstreaming.py @@ -2,12 +2,72 @@ import re import json -from typing import Callable, TypeVar, Optional, Generator, AsyncGenerator, Tuple +from typing import ( + Callable, + Generic, + TypeVar, + Optional, + Generator, + AsyncGenerator, + Tuple, +) import httpx T = TypeVar("T") +class EventStream(Generic[T]): + response: httpx.Response + generator: Generator[T, None, None] + + def __init__( + self, + response: httpx.Response, + decoder: Callable[[str], T], + sentinel: Optional[str] = None, + ): + self.response = response + self.generator = stream_events(response, decoder, sentinel) + + def __iter__(self): + return self + + def __next__(self): + return next(self.generator) + + def __enter__(self): + return self + + def __exit__(self, exc_type, exc_val, exc_tb): + self.response.close() + + +class EventStreamAsync(Generic[T]): + response: httpx.Response + generator: AsyncGenerator[T, None] + + def __init__( + self, + response: httpx.Response, + decoder: Callable[[str], T], + sentinel: Optional[str] = None, + ): + self.response = response + self.generator = stream_events_async(response, decoder, sentinel) + + def __aiter__(self): + return self + + async def __anext__(self): + return await self.generator.__anext__() + + async def __aenter__(self): + return self + + async def __aexit__(self, exc_type, exc_val, exc_tb): + await self.response.aclose() + + class ServerEvent: id: Optional[str] = None event: Optional[str] = None