diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock index 9516d059f..adc7423b7 100644 --- a/.speakeasy/workflow.lock +++ b/.speakeasy/workflow.lock @@ -1,4 +1,4 @@ -speakeasyVersion: 1.403.2 +speakeasyVersion: 1.420.0 sources: accounting-source: sourceNamespace: accounting-source @@ -63,6 +63,13 @@ sources: tags: - latest - main + sync-for-payables-version-1-source: + sourceNamespace: sync-for-payables-version-1-source + sourceRevisionDigest: sha256:ab9717c986622b855c68e2ef2fb6e08f3a7ae563776e008d8bd9ab73ebe19508 + sourceBlobDigest: sha256:b5315c8afa06d894adc545f61272bd3e52b92d379f9b4d5928c6393c3e21dfa1 + tags: + - latest + - main targets: accounting-library: source: accounting-source @@ -109,6 +116,11 @@ targets: sourceNamespace: sync-for-commerce-source sourceRevisionDigest: sha256:6a62a3d9d65254b83a8e6afa5ea2e9d287076520c057bf8a1b60e42ebbdc815e sourceBlobDigest: sha256:2e0d6f59d01a5896709430e1e05d725b88ca088e959502f216a39b23ccab77ec + sync-for-payables-version-1-library: + source: sync-for-payables-version-1-source + sourceNamespace: sync-for-payables-version-1-source + sourceRevisionDigest: sha256:ab9717c986622b855c68e2ef2fb6e08f3a7ae563776e008d8bd9ab73ebe19508 + sourceBlobDigest: sha256:b5315c8afa06d894adc545f61272bd3e52b92d379f9b4d5928c6393c3e21dfa1 workflow: workflowVersion: 1.0.0 speakeasyVersion: latest @@ -180,6 +192,8 @@ workflow: sync-for-payables-version-1-source: inputs: - location: https://raw.githubusercontent.com/codatio/oas/main/yaml/Codat-Sync-Payables-v1.yaml + registry: + location: registry.speakeasyapi.dev/codat/codat/sync-for-payables-version-1-source sync-for-payroll-source: inputs: - location: https://raw.githubusercontent.com/codatio/oas/main/yaml/Codat-Sync-Payroll.yaml diff --git a/.speakeasy/workflow.yaml b/.speakeasy/workflow.yaml index 96df90533..e188f6681 100644 --- a/.speakeasy/workflow.yaml +++ b/.speakeasy/workflow.yaml @@ -68,6 +68,8 @@ sources: sync-for-payables-version-1-source: inputs: - location: https://raw.githubusercontent.com/codatio/oas/main/yaml/Codat-Sync-Payables-v1.yaml + registry: + location: registry.speakeasyapi.dev/codat/codat/sync-for-payables-version-1-source sync-for-payroll-source: inputs: - location: https://raw.githubusercontent.com/codatio/oas/main/yaml/Codat-Sync-Payroll.yaml diff --git a/previous-versions/sync-for-payables-version-1/.gitignore b/previous-versions/sync-for-payables-version-1/.gitignore index 3cdf33802..49491792f 100755 --- a/previous-versions/sync-for-payables-version-1/.gitignore +++ b/previous-versions/sync-for-payables-version-1/.gitignore @@ -1,3 +1,6 @@ +.venv/ +pyrightconfig.json +README-PYPI.md venv/ src/*.egg-info/ __pycache__/ diff --git a/previous-versions/sync-for-payables-version-1/.speakeasy/gen.lock b/previous-versions/sync-for-payables-version-1/.speakeasy/gen.lock index 6592044c9..3462ac899 100755 --- a/previous-versions/sync-for-payables-version-1/.speakeasy/gen.lock +++ b/previous-versions/sync-for-payables-version-1/.speakeasy/gen.lock @@ -1,148 +1,4819 @@ lockVersion: 2.0.0 id: 75f7ac26-bce6-4db5-85a1-c67d938c4735 management: - docChecksum: 681f585653736aeb9009765e989c7e73 + docChecksum: 85e7bfd731a7e431a3e1a6882516a465 docVersion: 3.0.0 - speakeasyVersion: internal - generationVersion: 2.257.2 - releaseVersion: 3.2.0 - configChecksum: 972e1dc61ff2bfa4ef179b5de8a4906b + speakeasyVersion: 1.420.0 + generationVersion: 2.438.15 + releaseVersion: 3.2.1 + configChecksum: d1f29974786b2223dc25428a47a99c22 repoURL: https://github.com/codatio/client-sdk-python.git - repoSubDirectory: sync-for-payables - installationURL: https://github.com/codatio/client-sdk-python.git#subdirectory=sync-for-payables + repoSubDirectory: previous-versions/sync-for-payables-version-1 + installationURL: https://github.com/codatio/client-sdk-python.git#subdirectory=previous-versions/sync-for-payables-version-1 published: true features: python: - constsAndDefaults: 0.1.2 - core: 4.4.6 - deprecations: 2.81.1 - examples: 2.81.3 - globalSecurity: 2.83.2 - globalServerURLs: 2.82.1 - ignores: 2.81.1 - nameOverrides: 2.81.1 - retries: 2.82.1 + additionalDependencies: 1.0.0 + constsAndDefaults: 1.0.4 + core: 5.6.0 + decimal: 1.0.0 + defaultEnabledRetries: 0.2.0 + deprecations: 3.0.0 + downloadStreams: 1.0.1 + enumUnions: 0.1.0 + envVarSecurityUsage: 0.3.1 + examples: 3.0.0 + globalSecurity: 3.0.2 + globalSecurityCallbacks: 1.0.0 + globalServerURLs: 3.0.0 + inputOutputModels: 3.0.0 + methodArguments: 1.0.2 + multipartFileContentType: 1.0.0 + nameOverrides: 3.0.0 + nullables: 1.0.0 + responseFormat: 1.0.1 + retries: 3.0.2 + sdkHooks: 1.0.0 + serverEventsSentinels: 0.1.0 + uploadStreams: 1.0.0 + webhooks: 2.0.0 generatedFiles: - - src/codatsyncpayables/sdkconfiguration.py - - src/codatsyncpayables/companies.py - - src/codatsyncpayables/bills.py - - src/codatsyncpayables/connections.py - - src/codatsyncpayables/sdk.py - - pylintrc - - setup.py - - src/codatsyncpayables/__init__.py - - src/codatsyncpayables/utils/__init__.py - - src/codatsyncpayables/utils/retries.py - - src/codatsyncpayables/utils/utils.py - - src/codatsyncpayables/models/errors/sdkerror.py - - tests/helpers.py - - src/codatsyncpayables/models/operations/create_company.py - - src/codatsyncpayables/models/operations/delete_company.py - - src/codatsyncpayables/models/operations/get_company.py - - src/codatsyncpayables/models/operations/list_companies.py - - src/codatsyncpayables/models/operations/update_company.py - - src/codatsyncpayables/models/operations/list_bills.py - - src/codatsyncpayables/models/operations/create_connection.py - - src/codatsyncpayables/models/operations/delete_connection.py - - src/codatsyncpayables/models/operations/get_connection.py - - src/codatsyncpayables/models/operations/list_connections.py - - src/codatsyncpayables/models/operations/unlink_connection.py - - src/codatsyncpayables/models/shared/company.py - - src/codatsyncpayables/models/shared/connection.py - - src/codatsyncpayables/models/shared/dataconnectionstatus.py - - src/codatsyncpayables/models/shared/dataconnectionerror.py - - src/codatsyncpayables/models/shared/errorvalidation.py - - src/codatsyncpayables/models/shared/errorvalidationitem.py - - src/codatsyncpayables/models/shared/companyrequestbody.py - - src/codatsyncpayables/models/shared/items.py - - src/codatsyncpayables/models/shared/companies.py - - src/codatsyncpayables/models/shared/links.py - - src/codatsyncpayables/models/shared/halref.py - - src/codatsyncpayables/models/shared/bills.py - - src/codatsyncpayables/models/shared/bill.py - - src/codatsyncpayables/models/shared/supplierref.py - - src/codatsyncpayables/models/shared/billstatus.py - - src/codatsyncpayables/models/shared/billlineitem.py - - src/codatsyncpayables/models/shared/connections.py - - src/codatsyncpayables/models/shared/security.py - - src/codatsyncpayables/models/shared/clientratelimitreachedwebhook.py - - src/codatsyncpayables/models/shared/clientratelimitreachedwebhookdata.py - - src/codatsyncpayables/models/shared/clientratelimitresetwebhook.py - - src/codatsyncpayables/models/shared/clientratelimitresetwebhookdata.py - - src/codatsyncpayables/models/shared/billeventwebhook.py - - src/codatsyncpayables/models/shared/billeventpayload.py - - src/codatsyncpayables/models/errors/errormessage.py - - src/codatsyncpayables/models/webhooks/client_rate_limit_reached.py - - src/codatsyncpayables/models/webhooks/client_rate_limit_reset.py - - src/codatsyncpayables/models/webhooks/payables_bill_created.py - - src/codatsyncpayables/models/webhooks/payables_bill_deleted.py - - src/codatsyncpayables/models/webhooks/payables_bill_updated.py - - src/codatsyncpayables/models/__init__.py - - src/codatsyncpayables/models/errors/__init__.py - - src/codatsyncpayables/models/operations/__init__.py - - src/codatsyncpayables/models/shared/__init__.py - - src/codatsyncpayables/models/webhooks/__init__.py - - docs/models/operations/createcompanyresponse.md - - docs/models/operations/deletecompanyrequest.md - - docs/models/operations/deletecompanyresponse.md - - docs/models/operations/getcompanyrequest.md - - docs/models/operations/getcompanyresponse.md - - docs/models/operations/listcompaniesrequest.md - - docs/models/operations/listcompaniesresponse.md - - docs/models/operations/updatecompanyrequest.md - - docs/models/operations/updatecompanyresponse.md - - docs/models/operations/listbillsrequest.md - - docs/models/operations/listbillsresponse.md - - docs/models/operations/createconnectionrequestbody.md + - .gitattributes + - .python-version + - .vscode/settings.json + - CONTRIBUTING.md + - USAGE.md + - docs/models/errors/errormessage.md + - docs/models/operations/createaccountrequest.md + - docs/models/operations/createbankaccountrequest.md + - docs/models/operations/createbillcreditnoterequest.md + - docs/models/operations/createbillpaymentrequest.md + - docs/models/operations/createbillrequest.md - docs/models/operations/createconnectionrequest.md - - docs/models/operations/createconnectionresponse.md + - docs/models/operations/createconnectionrequestbody.md + - docs/models/operations/createjournalentryrequest.md + - docs/models/operations/createjournalrequest.md + - docs/models/operations/createsupplierrequest.md + - docs/models/operations/deletebillattachmentrequest.md + - docs/models/operations/deletebillpaymentrequest.md + - docs/models/operations/deletebillrequest.md + - docs/models/operations/deletecompanyrequest.md - docs/models/operations/deleteconnectionrequest.md - - docs/models/operations/deleteconnectionresponse.md + - docs/models/operations/downloadbillattachmentrequest.md + - docs/models/operations/getaccountingprofilerequest.md + - docs/models/operations/getaccountrequest.md + - docs/models/operations/getbillattachmentrequest.md + - docs/models/operations/getbillcreditnoterequest.md + - docs/models/operations/getbillpaymentsrequest.md + - docs/models/operations/getbillrequest.md + - docs/models/operations/getcompanyrequest.md - docs/models/operations/getconnectionrequest.md - - docs/models/operations/getconnectionresponse.md + - docs/models/operations/getcreateaccountmodelrequest.md + - docs/models/operations/getcreatebankaccountsmodelrequest.md + - docs/models/operations/getcreatebillpaymentmodelrequest.md + - docs/models/operations/getcreatejournalentrymodelrequest.md + - docs/models/operations/getcreatejournalmodelrequest.md + - docs/models/operations/getcreateupdatebillcreditnotemodelrequest.md + - docs/models/operations/getcreateupdatebillmodelrequest.md + - docs/models/operations/getcreateupdatesuppliermodelrequest.md + - docs/models/operations/getdatastatusdatastatuses.md + - docs/models/operations/getdatastatusrequest.md + - docs/models/operations/getjournalrequest.md + - docs/models/operations/getpaymentmethodrequest.md + - docs/models/operations/getpulloperationrequest.md + - docs/models/operations/getpushoperationrequest.md + - docs/models/operations/getsupplierrequest.md + - docs/models/operations/gettaxraterequest.md + - docs/models/operations/gettrackingcategoryrequest.md + - docs/models/operations/listaccountsrequest.md + - docs/models/operations/listbillattachmentsrequest.md + - docs/models/operations/listbillcreditnotesrequest.md + - docs/models/operations/listbillpaymentsrequest.md + - docs/models/operations/listbillsrequest.md + - docs/models/operations/listcompaniesrequest.md - docs/models/operations/listconnectionsrequest.md - - docs/models/operations/listconnectionsresponse.md - - docs/models/operations/unlinkconnectionupdateconnection.md + - docs/models/operations/listjournalsrequest.md + - docs/models/operations/listpaymentmethodsrequest.md + - docs/models/operations/listpulloperationsrequest.md + - docs/models/operations/listpushoperationsrequest.md + - docs/models/operations/listsuppliersrequest.md + - docs/models/operations/listtaxratesrequest.md + - docs/models/operations/listtrackingcategoriesrequest.md + - docs/models/operations/refreshalldatatypesrequest.md + - docs/models/operations/refreshdatatyperequest.md - docs/models/operations/unlinkconnectionrequest.md - - docs/models/operations/unlinkconnectionresponse.md - - docs/models/shared/groupreference.md + - docs/models/operations/unlinkconnectionupdateconnection.md + - docs/models/operations/updatebillcreditnoterequest.md + - docs/models/operations/updatebillrequest.md + - docs/models/operations/updatecompanyrequest.md + - docs/models/operations/updatesupplierrequest.md + - docs/models/operations/uploadbillattachmentrequest.md + - docs/models/shared/account.md + - docs/models/shared/accountingaccount.md + - docs/models/shared/accountingaddresstype.md + - docs/models/shared/accountingbankaccount.md + - docs/models/shared/accountingbill.md + - docs/models/shared/accountingbillcreditnote.md + - docs/models/shared/accountingbillpayment.md + - docs/models/shared/accountingjournal.md + - docs/models/shared/accountingjournalentry.md + - docs/models/shared/accountingpaymentallocation.md + - docs/models/shared/accountingprojectreference.md + - docs/models/shared/accountingsupplier.md + - docs/models/shared/accountprototype.md + - docs/models/shared/accountref.md + - docs/models/shared/accounts.md + - docs/models/shared/accountstatus.md + - docs/models/shared/accounttype.md + - docs/models/shared/accountvaliddatatypelinks.md + - docs/models/shared/address.md + - docs/models/shared/allocation.md + - docs/models/shared/attachment.md + - docs/models/shared/attachments.md + - docs/models/shared/attachmentupload.md + - docs/models/shared/bankaccountcreateresponse.md + - docs/models/shared/bankaccountcreateresponsebankaccounttype.md + - docs/models/shared/bankaccountprototype.md + - docs/models/shared/bankaccountstatus.md + - docs/models/shared/bankaccounttype.md + - docs/models/shared/bill.md + - docs/models/shared/billallocation.md + - docs/models/shared/billcreditnote.md + - docs/models/shared/billcreditnotelineitem.md + - docs/models/shared/billcreditnotelineitemaccountingprojectreference.md + - docs/models/shared/billcreditnotelineitemcustomerref.md + - docs/models/shared/billcreditnotelineitemtracking.md + - docs/models/shared/billcreditnotes.md + - docs/models/shared/billcreditnotestatus.md + - docs/models/shared/billedtotype.md + - docs/models/shared/billlineitem.md + - docs/models/shared/billlineitemdatatype.md + - docs/models/shared/billpayment.md + - docs/models/shared/billpaymentline.md + - docs/models/shared/billpaymentlinelink.md + - docs/models/shared/billpaymentlinelinktype.md + - docs/models/shared/billpayments.md + - docs/models/shared/bills.md + - docs/models/shared/billstatus.md + - docs/models/shared/clientratelimitreachedwebhook.md + - docs/models/shared/clientratelimitreachedwebhookdata.md + - docs/models/shared/clientratelimitresetwebhook.md + - docs/models/shared/clientratelimitresetwebhookdata.md + - docs/models/shared/clientratelimitwebhook.md + - docs/models/shared/clientratelimitwebhookpayload.md + - docs/models/shared/codatfile.md + - docs/models/shared/companies.md - docs/models/shared/company.md - - docs/models/shared/sourcetype.md + - docs/models/shared/companyinfo.md + - docs/models/shared/companyrequestbody.md + - docs/models/shared/companytags.md - docs/models/shared/connection.md - - docs/models/shared/dataconnectionstatus.md + - docs/models/shared/connections.md + - docs/models/shared/contactreference.md + - docs/models/shared/createaccountresponse.md + - docs/models/shared/createaccountresponsevaliddatatypelinks.md + - docs/models/shared/createbillcreditnoteresponse.md + - docs/models/shared/createbillcreditnoteresponserecordreference.md + - docs/models/shared/createbillpaymentresponse.md + - docs/models/shared/createbillresponse.md + - docs/models/shared/createbillresponseaccountingpaymentallocation.md + - docs/models/shared/createbillresponseallocation.md + - docs/models/shared/createbillresponsepurchaseorderreference.md + - docs/models/shared/createbillresponsewithholdingtax.md + - docs/models/shared/createjournalentryresponse.md + - docs/models/shared/createjournalresponse.md + - docs/models/shared/createsupplierresponse.md + - docs/models/shared/customerref.md - docs/models/shared/dataconnectionerror.md + - docs/models/shared/dataconnectionstatus.md + - docs/models/shared/datasetstatus.md + - docs/models/shared/datastatus.md + - docs/models/shared/datatype.md + - docs/models/shared/datatypes.md + - docs/models/shared/errorstatus.md - docs/models/shared/errorvalidation.md - docs/models/shared/errorvalidationitem.md - - docs/models/shared/companyrequestbody.md + - docs/models/shared/halref.md + - docs/models/shared/itemref.md + - docs/models/shared/itemreference.md - docs/models/shared/items.md - - docs/models/shared/companies.md + - docs/models/shared/journal.md + - docs/models/shared/journalentry.md + - docs/models/shared/journalentryrecordref.md + - docs/models/shared/journalentryrecordrefdatatype.md + - docs/models/shared/journalline.md + - docs/models/shared/journallinedatatype.md + - docs/models/shared/journallinetracking.md + - docs/models/shared/journalprototype.md + - docs/models/shared/journalref.md + - docs/models/shared/journals.md + - docs/models/shared/journalstatus.md - docs/models/shared/links.md - - docs/models/shared/halref.md - - docs/models/shared/bills.md - - docs/models/shared/bill.md - - docs/models/shared/supplierref.md - - docs/models/shared/billstatus.md - - docs/models/shared/accountreference.md - - docs/models/shared/taxratereference.md - - docs/models/shared/billlineitem.md - - docs/models/shared/connections.md + - docs/models/shared/metadata.md + - docs/models/shared/paymentallocationpayment.md + - docs/models/shared/paymentmethod.md + - docs/models/shared/paymentmethodref.md + - docs/models/shared/paymentmethods.md + - docs/models/shared/paymentmethodstatus.md + - docs/models/shared/paymentmethodtype.md + - docs/models/shared/phonenumber.md + - docs/models/shared/phonenumbertype.md + - docs/models/shared/propertiestatus.md + - docs/models/shared/pulloperation.md + - docs/models/shared/pulloperations.md + - docs/models/shared/purchaseorderreference.md + - docs/models/shared/pushchangetype.md + - docs/models/shared/pushfieldvalidation.md + - docs/models/shared/pushoperation.md + - docs/models/shared/pushoperationchange.md + - docs/models/shared/pushoperationref.md + - docs/models/shared/pushoperations.md + - docs/models/shared/pushoperationstatus.md + - docs/models/shared/pushoption.md + - docs/models/shared/pushoptionchoice.md + - docs/models/shared/pushoptionproperty.md + - docs/models/shared/pushoptiontype.md + - docs/models/shared/pushvalidationinfo.md + - docs/models/shared/recordlinereference.md + - docs/models/shared/recordreference.md + - docs/models/shared/schemadatatype.md - docs/models/shared/security.md - - docs/models/shared/clientratelimitreachedwebhook.md - - docs/models/shared/clientratelimitreachedwebhookdata.md - - docs/models/shared/clientratelimitresetwebhook.md - - docs/models/shared/clientratelimitresetwebhookdata.md - - docs/models/shared/billeventwebhook.md - - docs/models/shared/billeventpayload.md - - docs/models/errors/errormessage.md - - docs/models/webhooks/clientratelimitreachedresponse.md - - docs/models/webhooks/clientratelimitresetresponse.md - - docs/models/webhooks/payablesbillcreatedresponse.md - - docs/models/webhooks/payablesbilldeletedresponse.md - - docs/models/webhooks/payablesbillupdatedresponse.md - - docs/sdks/codatsyncpayables/README.md + - docs/models/shared/sourcetype.md + - docs/models/shared/status.md + - docs/models/shared/supplementaldata.md + - docs/models/shared/supplier.md + - docs/models/shared/supplierref.md + - docs/models/shared/suppliers.md + - docs/models/shared/supplierstatus.md + - docs/models/shared/tags.md + - docs/models/shared/taxrate.md + - docs/models/shared/taxratecomponent.md + - docs/models/shared/taxrateref.md + - docs/models/shared/taxrates.md + - docs/models/shared/taxratestatus.md + - docs/models/shared/tracking.md + - docs/models/shared/trackingcategories.md + - docs/models/shared/trackingcategory.md + - docs/models/shared/trackingcategoryref.md + - docs/models/shared/trackingcategorytree.md + - docs/models/shared/trackingrecordref.md + - docs/models/shared/trackingrecordrefdatatype.md + - docs/models/shared/type.md + - docs/models/shared/updatebillcreditnoteresponse.md + - docs/models/shared/updatebillcreditnoteresponseaccountingbillcreditnote.md + - docs/models/shared/updatebillcreditnoteresponserecordreference.md + - docs/models/shared/updatebillresponse.md + - docs/models/shared/updatebillresponseaccountingbill.md + - docs/models/shared/updatebillresponseaccountingpaymentallocation.md + - docs/models/shared/updatebillresponseallocation.md + - docs/models/shared/updatebillresponsepurchaseorderreference.md + - docs/models/shared/updatebillresponsewithholdingtax.md + - docs/models/shared/updatesupplierresponse.md + - docs/models/shared/updatesupplierresponseaccountingsupplier.md + - docs/models/shared/validation.md + - docs/models/shared/validationitem.md + - docs/models/shared/validdatatypelinkitems.md + - docs/models/shared/validdatatypelinks.md + - docs/models/shared/weblink.md + - docs/models/shared/withholdingtax.md + - docs/models/shared/withholdingtaxitems.md + - docs/models/shared/zero.md + - docs/models/shared/zerodatatype.md - docs/models/utils/retryconfig.md - - docs/sdks/companies/README.md + - docs/sdks/accounts/README.md + - docs/sdks/bankaccounts/README.md + - docs/sdks/billcreditnotes/README.md + - docs/sdks/billpayments/README.md - docs/sdks/bills/README.md + - docs/sdks/codatsyncpayables/README.md + - docs/sdks/companies/README.md + - docs/sdks/companyinfo/README.md - docs/sdks/connections/README.md - - USAGE.md - - .gitattributes + - docs/sdks/journalentries/README.md + - docs/sdks/journals/README.md + - docs/sdks/managedata/README.md + - docs/sdks/paymentmethods/README.md + - docs/sdks/pushoperations/README.md + - docs/sdks/suppliers/README.md + - docs/sdks/taxrates/README.md + - docs/sdks/trackingcategories/README.md + - poetry.toml + - py.typed + - pylintrc + - pyproject.toml + - scripts/compile.sh + - scripts/prepare-readme.py + - scripts/publish.sh + - src/codat_sync_for_payables_version_1/__init__.py + - src/codat_sync_for_payables_version_1/_hooks/__init__.py + - src/codat_sync_for_payables_version_1/_hooks/sdkhooks.py + - src/codat_sync_for_payables_version_1/_hooks/types.py + - src/codat_sync_for_payables_version_1/_version.py + - src/codat_sync_for_payables_version_1/accounts.py + - src/codat_sync_for_payables_version_1/bank_accounts.py + - src/codat_sync_for_payables_version_1/basesdk.py + - src/codat_sync_for_payables_version_1/bill_credit_notes.py + - src/codat_sync_for_payables_version_1/bill_payments.py + - src/codat_sync_for_payables_version_1/bills.py + - src/codat_sync_for_payables_version_1/companies.py + - src/codat_sync_for_payables_version_1/company_info.py + - src/codat_sync_for_payables_version_1/connections.py + - src/codat_sync_for_payables_version_1/httpclient.py + - src/codat_sync_for_payables_version_1/journal_entries.py + - src/codat_sync_for_payables_version_1/journals.py + - src/codat_sync_for_payables_version_1/manage_data.py + - src/codat_sync_for_payables_version_1/models/errors/__init__.py + - src/codat_sync_for_payables_version_1/models/errors/errormessage.py + - src/codat_sync_for_payables_version_1/models/errors/sdkerror.py + - src/codat_sync_for_payables_version_1/models/operations/__init__.py + - src/codat_sync_for_payables_version_1/models/operations/create_account.py + - src/codat_sync_for_payables_version_1/models/operations/create_bank_account.py + - src/codat_sync_for_payables_version_1/models/operations/create_bill.py + - src/codat_sync_for_payables_version_1/models/operations/create_bill_credit_note.py + - src/codat_sync_for_payables_version_1/models/operations/create_bill_payment.py + - src/codat_sync_for_payables_version_1/models/operations/create_connection.py + - src/codat_sync_for_payables_version_1/models/operations/create_journal.py + - src/codat_sync_for_payables_version_1/models/operations/create_journal_entry.py + - src/codat_sync_for_payables_version_1/models/operations/create_supplier.py + - src/codat_sync_for_payables_version_1/models/operations/delete_bill.py + - src/codat_sync_for_payables_version_1/models/operations/delete_bill_attachment.py + - src/codat_sync_for_payables_version_1/models/operations/delete_billpayment.py + - src/codat_sync_for_payables_version_1/models/operations/delete_company.py + - src/codat_sync_for_payables_version_1/models/operations/delete_connection.py + - src/codat_sync_for_payables_version_1/models/operations/download_bill_attachment.py + - src/codat_sync_for_payables_version_1/models/operations/get_account.py + - src/codat_sync_for_payables_version_1/models/operations/get_accounting_profile.py + - src/codat_sync_for_payables_version_1/models/operations/get_bill.py + - src/codat_sync_for_payables_version_1/models/operations/get_bill_attachment.py + - src/codat_sync_for_payables_version_1/models/operations/get_bill_credit_note.py + - src/codat_sync_for_payables_version_1/models/operations/get_bill_payments.py + - src/codat_sync_for_payables_version_1/models/operations/get_company.py + - src/codat_sync_for_payables_version_1/models/operations/get_connection.py + - src/codat_sync_for_payables_version_1/models/operations/get_create_account_model.py + - src/codat_sync_for_payables_version_1/models/operations/get_create_bankaccounts_model.py + - src/codat_sync_for_payables_version_1/models/operations/get_create_billpayment_model.py + - src/codat_sync_for_payables_version_1/models/operations/get_create_journal_model.py + - src/codat_sync_for_payables_version_1/models/operations/get_create_journalentry_model.py + - src/codat_sync_for_payables_version_1/models/operations/get_create_update_bill_model.py + - src/codat_sync_for_payables_version_1/models/operations/get_create_update_billcreditnote_model.py + - src/codat_sync_for_payables_version_1/models/operations/get_create_update_supplier_model.py + - src/codat_sync_for_payables_version_1/models/operations/get_data_status.py + - src/codat_sync_for_payables_version_1/models/operations/get_journal.py + - src/codat_sync_for_payables_version_1/models/operations/get_payment_method.py + - src/codat_sync_for_payables_version_1/models/operations/get_pull_operation.py + - src/codat_sync_for_payables_version_1/models/operations/get_push_operation.py + - src/codat_sync_for_payables_version_1/models/operations/get_supplier.py + - src/codat_sync_for_payables_version_1/models/operations/get_tax_rate.py + - src/codat_sync_for_payables_version_1/models/operations/get_tracking_category.py + - src/codat_sync_for_payables_version_1/models/operations/list_accounts.py + - src/codat_sync_for_payables_version_1/models/operations/list_bill_attachments.py + - src/codat_sync_for_payables_version_1/models/operations/list_bill_credit_notes.py + - src/codat_sync_for_payables_version_1/models/operations/list_bill_payments.py + - src/codat_sync_for_payables_version_1/models/operations/list_bills.py + - src/codat_sync_for_payables_version_1/models/operations/list_companies.py + - src/codat_sync_for_payables_version_1/models/operations/list_connections.py + - src/codat_sync_for_payables_version_1/models/operations/list_journals.py + - src/codat_sync_for_payables_version_1/models/operations/list_payment_methods.py + - src/codat_sync_for_payables_version_1/models/operations/list_pull_operations.py + - src/codat_sync_for_payables_version_1/models/operations/list_push_operations.py + - src/codat_sync_for_payables_version_1/models/operations/list_suppliers.py + - src/codat_sync_for_payables_version_1/models/operations/list_tax_rates.py + - src/codat_sync_for_payables_version_1/models/operations/list_tracking_categories.py + - src/codat_sync_for_payables_version_1/models/operations/refresh_all_data_types.py + - src/codat_sync_for_payables_version_1/models/operations/refresh_data_type.py + - src/codat_sync_for_payables_version_1/models/operations/unlink_connection.py + - src/codat_sync_for_payables_version_1/models/operations/update_bill.py + - src/codat_sync_for_payables_version_1/models/operations/update_bill_credit_note.py + - src/codat_sync_for_payables_version_1/models/operations/update_company.py + - src/codat_sync_for_payables_version_1/models/operations/update_supplier.py + - src/codat_sync_for_payables_version_1/models/operations/upload_bill_attachment.py + - src/codat_sync_for_payables_version_1/models/shared/__init__.py + - src/codat_sync_for_payables_version_1/models/shared/account.py + - src/codat_sync_for_payables_version_1/models/shared/accountingaddresstype.py + - src/codat_sync_for_payables_version_1/models/shared/accountprototype.py + - src/codat_sync_for_payables_version_1/models/shared/accountref.py + - src/codat_sync_for_payables_version_1/models/shared/accounts.py + - src/codat_sync_for_payables_version_1/models/shared/accountstatus.py + - src/codat_sync_for_payables_version_1/models/shared/accounttype.py + - src/codat_sync_for_payables_version_1/models/shared/address.py + - src/codat_sync_for_payables_version_1/models/shared/attachment.py + - src/codat_sync_for_payables_version_1/models/shared/attachments.py + - src/codat_sync_for_payables_version_1/models/shared/attachmentupload.py + - src/codat_sync_for_payables_version_1/models/shared/bankaccountcreateresponse.py + - src/codat_sync_for_payables_version_1/models/shared/bankaccountprototype.py + - src/codat_sync_for_payables_version_1/models/shared/bankaccountstatus.py + - src/codat_sync_for_payables_version_1/models/shared/bill.py + - src/codat_sync_for_payables_version_1/models/shared/billcreditnote.py + - src/codat_sync_for_payables_version_1/models/shared/billcreditnotelineitem.py + - src/codat_sync_for_payables_version_1/models/shared/billcreditnotes.py + - src/codat_sync_for_payables_version_1/models/shared/billcreditnotestatus.py + - src/codat_sync_for_payables_version_1/models/shared/billedtotype.py + - src/codat_sync_for_payables_version_1/models/shared/billlineitem.py + - src/codat_sync_for_payables_version_1/models/shared/billpayment.py + - src/codat_sync_for_payables_version_1/models/shared/billpaymentline.py + - src/codat_sync_for_payables_version_1/models/shared/billpaymentlinelink.py + - src/codat_sync_for_payables_version_1/models/shared/billpaymentlinelinktype.py + - src/codat_sync_for_payables_version_1/models/shared/billpayments.py + - src/codat_sync_for_payables_version_1/models/shared/bills.py + - src/codat_sync_for_payables_version_1/models/shared/billstatus.py + - src/codat_sync_for_payables_version_1/models/shared/clientratelimitreachedwebhook.py + - src/codat_sync_for_payables_version_1/models/shared/clientratelimitreachedwebhookdata.py + - src/codat_sync_for_payables_version_1/models/shared/clientratelimitresetwebhook.py + - src/codat_sync_for_payables_version_1/models/shared/clientratelimitresetwebhookdata.py + - src/codat_sync_for_payables_version_1/models/shared/clientratelimitwebhook.py + - src/codat_sync_for_payables_version_1/models/shared/clientratelimitwebhookpayload.py + - src/codat_sync_for_payables_version_1/models/shared/codatfile.py + - src/codat_sync_for_payables_version_1/models/shared/companies.py + - src/codat_sync_for_payables_version_1/models/shared/company.py + - src/codat_sync_for_payables_version_1/models/shared/companyinfo.py + - src/codat_sync_for_payables_version_1/models/shared/companyrequestbody.py + - src/codat_sync_for_payables_version_1/models/shared/connection.py + - src/codat_sync_for_payables_version_1/models/shared/connections.py + - src/codat_sync_for_payables_version_1/models/shared/createaccountresponse.py + - src/codat_sync_for_payables_version_1/models/shared/createbillcreditnoteresponse.py + - src/codat_sync_for_payables_version_1/models/shared/createbillpaymentresponse.py + - src/codat_sync_for_payables_version_1/models/shared/createbillresponse.py + - src/codat_sync_for_payables_version_1/models/shared/createjournalentryresponse.py + - src/codat_sync_for_payables_version_1/models/shared/createjournalresponse.py + - src/codat_sync_for_payables_version_1/models/shared/createsupplierresponse.py + - src/codat_sync_for_payables_version_1/models/shared/dataconnectionerror.py + - src/codat_sync_for_payables_version_1/models/shared/dataconnectionstatus.py + - src/codat_sync_for_payables_version_1/models/shared/datastatus.py + - src/codat_sync_for_payables_version_1/models/shared/datatype.py + - src/codat_sync_for_payables_version_1/models/shared/errorvalidation.py + - src/codat_sync_for_payables_version_1/models/shared/errorvalidationitem.py + - src/codat_sync_for_payables_version_1/models/shared/halref.py + - src/codat_sync_for_payables_version_1/models/shared/itemref.py + - src/codat_sync_for_payables_version_1/models/shared/items.py + - src/codat_sync_for_payables_version_1/models/shared/journal.py + - src/codat_sync_for_payables_version_1/models/shared/journalentry.py + - src/codat_sync_for_payables_version_1/models/shared/journalentryrecordref.py + - src/codat_sync_for_payables_version_1/models/shared/journalline.py + - src/codat_sync_for_payables_version_1/models/shared/journalprototype.py + - src/codat_sync_for_payables_version_1/models/shared/journalref.py + - src/codat_sync_for_payables_version_1/models/shared/journals.py + - src/codat_sync_for_payables_version_1/models/shared/journalstatus.py + - src/codat_sync_for_payables_version_1/models/shared/links.py + - src/codat_sync_for_payables_version_1/models/shared/metadata.py + - src/codat_sync_for_payables_version_1/models/shared/paymentallocationpayment.py + - src/codat_sync_for_payables_version_1/models/shared/paymentmethod.py + - src/codat_sync_for_payables_version_1/models/shared/paymentmethodref.py + - src/codat_sync_for_payables_version_1/models/shared/paymentmethods.py + - src/codat_sync_for_payables_version_1/models/shared/paymentmethodtype.py + - src/codat_sync_for_payables_version_1/models/shared/phonenumber.py + - src/codat_sync_for_payables_version_1/models/shared/phonenumbertype.py + - src/codat_sync_for_payables_version_1/models/shared/propertie_status.py + - src/codat_sync_for_payables_version_1/models/shared/pulloperation.py + - src/codat_sync_for_payables_version_1/models/shared/pulloperations.py + - src/codat_sync_for_payables_version_1/models/shared/pushchangetype.py + - src/codat_sync_for_payables_version_1/models/shared/pushfieldvalidation.py + - src/codat_sync_for_payables_version_1/models/shared/pushoperation.py + - src/codat_sync_for_payables_version_1/models/shared/pushoperationchange.py + - src/codat_sync_for_payables_version_1/models/shared/pushoperationref.py + - src/codat_sync_for_payables_version_1/models/shared/pushoperations.py + - src/codat_sync_for_payables_version_1/models/shared/pushoperationstatus.py + - src/codat_sync_for_payables_version_1/models/shared/pushoption.py + - src/codat_sync_for_payables_version_1/models/shared/pushoptionchoice.py + - src/codat_sync_for_payables_version_1/models/shared/pushoptionproperty.py + - src/codat_sync_for_payables_version_1/models/shared/pushoptiontype.py + - src/codat_sync_for_payables_version_1/models/shared/pushvalidationinfo.py + - src/codat_sync_for_payables_version_1/models/shared/schema_datatype.py + - src/codat_sync_for_payables_version_1/models/shared/security.py + - src/codat_sync_for_payables_version_1/models/shared/status.py + - src/codat_sync_for_payables_version_1/models/shared/supplementaldata.py + - src/codat_sync_for_payables_version_1/models/shared/supplier.py + - src/codat_sync_for_payables_version_1/models/shared/supplierref.py + - src/codat_sync_for_payables_version_1/models/shared/suppliers.py + - src/codat_sync_for_payables_version_1/models/shared/supplierstatus.py + - src/codat_sync_for_payables_version_1/models/shared/tags.py + - src/codat_sync_for_payables_version_1/models/shared/taxrate.py + - src/codat_sync_for_payables_version_1/models/shared/taxratecomponent.py + - src/codat_sync_for_payables_version_1/models/shared/taxrateref.py + - src/codat_sync_for_payables_version_1/models/shared/taxrates.py + - src/codat_sync_for_payables_version_1/models/shared/taxratestatus.py + - src/codat_sync_for_payables_version_1/models/shared/tracking.py + - src/codat_sync_for_payables_version_1/models/shared/trackingcategories.py + - src/codat_sync_for_payables_version_1/models/shared/trackingcategory.py + - src/codat_sync_for_payables_version_1/models/shared/trackingcategoryref.py + - src/codat_sync_for_payables_version_1/models/shared/trackingcategorytree.py + - src/codat_sync_for_payables_version_1/models/shared/trackingrecordref.py + - src/codat_sync_for_payables_version_1/models/shared/updatebillcreditnoteresponse.py + - src/codat_sync_for_payables_version_1/models/shared/updatebillresponse.py + - src/codat_sync_for_payables_version_1/models/shared/updatesupplierresponse.py + - src/codat_sync_for_payables_version_1/models/shared/validation.py + - src/codat_sync_for_payables_version_1/models/shared/validationitem.py + - src/codat_sync_for_payables_version_1/models/shared/validdatatypelink_items.py + - src/codat_sync_for_payables_version_1/models/shared/weblink.py + - src/codat_sync_for_payables_version_1/models/shared/withholdingtax_items.py + - src/codat_sync_for_payables_version_1/models/shared/zero.py + - src/codat_sync_for_payables_version_1/payment_methods.py + - src/codat_sync_for_payables_version_1/push_operations.py + - src/codat_sync_for_payables_version_1/py.typed + - src/codat_sync_for_payables_version_1/sdk.py + - src/codat_sync_for_payables_version_1/sdkconfiguration.py + - src/codat_sync_for_payables_version_1/suppliers.py + - src/codat_sync_for_payables_version_1/tax_rates.py + - src/codat_sync_for_payables_version_1/tracking_categories.py + - src/codat_sync_for_payables_version_1/types/__init__.py + - src/codat_sync_for_payables_version_1/types/basemodel.py + - src/codat_sync_for_payables_version_1/utils/__init__.py + - src/codat_sync_for_payables_version_1/utils/annotations.py + - src/codat_sync_for_payables_version_1/utils/enums.py + - src/codat_sync_for_payables_version_1/utils/eventstreaming.py + - src/codat_sync_for_payables_version_1/utils/forms.py + - src/codat_sync_for_payables_version_1/utils/headers.py + - src/codat_sync_for_payables_version_1/utils/logger.py + - src/codat_sync_for_payables_version_1/utils/metadata.py + - src/codat_sync_for_payables_version_1/utils/queryparams.py + - src/codat_sync_for_payables_version_1/utils/requestbodies.py + - src/codat_sync_for_payables_version_1/utils/retries.py + - src/codat_sync_for_payables_version_1/utils/security.py + - src/codat_sync_for_payables_version_1/utils/serializers.py + - src/codat_sync_for_payables_version_1/utils/url.py + - src/codat_sync_for_payables_version_1/utils/values.py +examples: + create-company: + With no description: + requestBody: + 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"} + 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"} + With a tag: + requestBody: + 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"} + Malformed query: + requestBody: + application/json: {"description": "Requested early access to the new financing scheme.", "name": "Bank of Dave"} + responses: + "400": + application/json: {"canBeRetried": "Unknown", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "detailedErrorCode": 0, "error": "Error processing request - not valid.", "service": "PublicApi", "statusCode": 400} + delete-company: + 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} + get-company: + Simple 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", "lastSync": "2022-10-23T00:00:00Z", "name": "My First Company", "redirect": "https://link.codat.io/company/ab12c58d-a678-4ebf-a159-ae99e1807bd0"} + 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} + list-companies: + "": + parameters: + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/{id}/data/{dataType}?page=1&pageSize=10"}, "self": {"href": "/companies/{id}/data/{dataType}"}}, "pageNumber": 1, "pageSize": 10, "results": [{"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"}], "totalResults": 1} + "400": {} + One company: + parameters: + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + 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"}], "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} + List of Companies: + parameters: + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + 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"}], "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} + Malformed query: + parameters: + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "400": + application/json: {"canBeRetried": "Unknown", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "detailedErrorCode": 0, "error": "Error parsing query - Malformed query.", "service": "ClientsApi", "statusCode": 400} + Unresolved property: + parameters: + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "400": + application/json: {"canBeRetried": "Unknown", "correlationId": "98457fb9956b7f9b4b2fd4f6e23bb5c8", "detailedErrorCode": 0, "error": "Error parsing query - Could not resolve property isCompleted on Dataset", "service": "PullApi", "statusCode": 400} + update-company: + Update name: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + requestBody: + 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"} + "401": {} + Update description: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + requestBody: + 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"} + "401": {} + Unauthorized: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + requestBody: + application/json: {"description": "Requested early access to the new financing scheme.", "name": "Bank of Dave"} + responses: + "401": + application/json: {"canBeRetried": "Unknown", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "detailedErrorCode": 0, "error": "Unauthorized", "service": "PublicApi", "statusCode": 401} + create-connection: + Connection: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + requestBody: + application/json: {"platformKey": "gbol"} + responses: + "200": + application/json: {"created": "2022-10-27T09:53:29Z", "dataConnectionErrors": [{"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"} + Unauthorized: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + requestBody: + application/json: {"platformKey": "gbol"} + responses: + "401": + application/json: {"canBeRetried": "Unknown", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "detailedErrorCode": 0, "error": "Unauthorized", "service": "PublicApi", "statusCode": 401} + delete-connection: + Unauthorized: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + responses: + "401": + application/json: {"canBeRetried": "Unknown", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "detailedErrorCode": 0, "error": "Unauthorized", "service": "PublicApi", "statusCode": 401} + get-connection: + Connection: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + responses: + "200": + application/json: {"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"}], "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"} + Unauthorized: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + responses: + "401": + application/json: {"canBeRetried": "Unknown", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "detailedErrorCode": 0, "error": "Unauthorized", "service": "PublicApi", "statusCode": 401} + list-connections: + "": + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/{id}/data/{dataType}?page=1&pageSize=10"}, "self": {"href": "/companies/{id}/data/{dataType}"}}, "pageNumber": 1, "pageSize": 10, "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": 1} + "400": {} + Connections: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + 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"}], "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: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "400": + application/json: {"canBeRetried": "Unknown", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "detailedErrorCode": 0, "error": "Error parsing query - Malformed query.", "service": "ClientsApi", "statusCode": 400} + Unresolved property: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "400": + application/json: {"canBeRetried": "Unknown", "correlationId": "98457fb9956b7f9b4b2fd4f6e23bb5c8", "detailedErrorCode": 0, "error": "Error parsing query - Could not resolve property isCompleted on Dataset", "service": "PullApi", "statusCode": 400} + unlink-connection: + Example: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + requestBody: + application/json: {"status": "Unlinked"} + responses: + "200": + application/json: {"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"} + "401": {} + Unauthorized: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + responses: + "401": + application/json: {"canBeRetried": "Unknown", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "detailedErrorCode": 0, "error": "Unauthorized", "service": "PublicApi", "statusCode": 401} + create-bill: + QuickBooks Desktop: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + query: {} + requestBody: + application/json: {"amountDue": 115.899999984, "currency": "USD", "currencyRate": 1, "dueDate": "2023-03-14T09:21:18.558Z", "issueDate": "2023-03-08T09:21:18.558Z", "lineItems": [{"description": "line 1 description", "discountAmount": 0, "discountPercentage": 0, "isDirectCost": true, "itemRef": {"id": "80000001-1674566705", "name": "string"}, "quantity": 2, "subTotal": 3.25, "taxAmount": 0, "totalAmount": 3.25, "tracking": {"categoryRefs": [{"id": "80000001-1674553252", "name": "Class 1"}], "customerRef": {"companyName": "string", "id": "80000002-1674552702"}, "isBilledTo": "Unknown", "isRebilledTo": "Customer", "projectRef": {"id": "string", "name": "string"}}, "trackingCategoryRefs": [{"id": "80000003-1674553958", "name": "Class 2"}], "unitAmount": 1.625}], "modifiedDate": "2022-10-23T00:00:00Z", "note": "note", "paymentAllocations": [], "purchaseOrderRefs": [{"id": "string", "purchaseOrderNumber": "string"}], "reference": "20230308 15.16", "sourceModifiedDate": "2022-10-23T00:00:00Z", "status": "Open", "subTotal": 3.25, "supplierRef": {"id": "80000001-1671793885", "supplierName": "string"}, "taxAmount": 0, "totalAmount": 3.25, "withholdingTax": [{"amount": 0, "name": "string"}]} + responses: + "200": + application/json: {"changes": [{"recordRef": {"dataType": "invoices"}}], "companyId": "8a210b68-6988-11ed-a1eb-0242ac120002", "completedOnUtc": "2022-10-23T00:00:00Z", "dataConnectionKey": "2e9d2c44-f675-40ba-8049-353bfcb5e171", "dataType": "invoices", "pushOperationKey": "1cf021cd-9cf5-4403-a315-211a509a3080", "requestedOnUtc": "2022-10-23T00:00:00Z", "status": "TimedOut", "statusCode": 452224} + "400": {} + Sage 50 (UK): + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + query: {} + requestBody: + application/json: {"amountDue": 0, "currency": "GBP", "currencyRate": 1, "dueDate": "2023-05-05T10:44:56.884Z", "issueDate": "2023-03-14T10:44:56.884Z", "lineItems": [{"accountRef": {"id": "7401", "name": "string"}, "description": "SWRAILWAYSELFSERVE; 17068; General ; V. Shone; Transport fo", "discountAmount": 0, "discountPercentage": 0, "isDirectCost": true, "itemRef": {"id": "string", "name": "string"}, "quantity": 2, "subTotal": 30, "taxAmount": 6, "taxRateRef": {"effectiveTaxRate": 0, "id": "1", "name": "string"}, "totalAmount": 36, "tracking": {"categoryRefs": [{"id": "string", "name": "string"}], "customerRef": {"companyName": "string", "id": "string"}, "isBilledTo": "Unknown", "isRebilledTo": "Unknown", "projectRef": {"id": "string", "name": "string"}}, "trackingCategoryRefs": [{"id": "department_1", "name": "string"}], "unitAmount": 15}], "modifiedDate": "2022-10-23T00:00:00Z", "note": "SWRAILWAYSELFSERVE; 17068; General ; V. Shone; Transport fo", "paymentAllocations": [{"allocation": {"allocatedOnDate": "2023-01-05T10:44:56.884Z", "currency": "GBP", "totalAmount": 0}, "payment": {"accountRef": {"id": "A545"}, "currency": "EUR", "id": "12", "paidOnDate": "2023-01-05T10:44:56.884Z", "totalAmount": 0}}], "purchaseOrderRefs": [{"id": "string", "purchaseOrderNumber": "string"}], "reference": "20230314 11.38", "sourceModifiedDate": "2022-10-23T00:00:00Z", "status": "Open", "subTotal": 0, "supplierRef": {"id": "SUPP1", "supplierName": "string"}, "taxAmount": 0, "totalAmount": 0, "withholdingTax": [{"amount": 0, "name": "string"}]} + responses: + "200": + application/json: {"changes": [{"recordRef": {"dataType": "invoices"}}, {"recordRef": {"dataType": "invoices"}}], "companyId": "8a210b68-6988-11ed-a1eb-0242ac120002", "completedOnUtc": "2022-10-23T00:00:00Z", "dataConnectionKey": "2e9d2c44-f675-40ba-8049-353bfcb5e171", "dataType": "invoices", "pushOperationKey": "cc376917-75e0-4249-9856-13de0ee803d5", "requestedOnUtc": "2022-10-23T00:00:00Z", "status": "Pending", "statusCode": 860420} + "400": {} + Xero: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + query: {} + requestBody: + application/json: {"amountDue": 7267.2, "currency": "GBP", "currencyRate": 1, "dueDate": "2023-04-23T00:00:00", "issueDate": "2023-04-23T00:00:00", "lineItems": [{"accountRef": {"id": "46f9461e-788b-4906-8b74-d1ea17f6dc10"}, "description": "Half day training - Microsoft Office", "isDirectCost": false, "itemRef": {"id": "489558f5-27b7-4f37-ad9f-d84611c2e2ab"}, "quantity": 1, "subTotal": 1800, "taxAmount": 360, "taxRateRef": {"effectiveTaxRate": 20, "id": "INPUT2", "name": "20% (VAT on Expenses)"}, "totalAmount": 2160, "trackingCategoryRefs": [], "unitAmount": 1800}, {"accountRef": {"id": "f96c9458-d724-47bf-8f74-a9d5726465ce"}, "description": "Desktop/network support via email & phone.Per month fixed fee for minimum 20 hours/month.", "isDirectCost": false, "itemRef": {"id": "f8fb7e00-5e5d-466c-aef0-15861f73d04f"}, "quantity": 1, "subTotal": 4000, "taxAmount": 800, "taxRateRef": {"effectiveTaxRate": 20, "id": "INPUT2", "name": "20% (VAT on Expenses)"}, "totalAmount": 4800, "trackingCategoryRefs": [], "unitAmount": 4000}, {"accountRef": {"id": "cba6527d-f102-4538-b421-e483233e9d5a"}, "description": "Stationery charges", "isDirectCost": false, "quantity": 8, "subTotal": 256, "taxAmount": 51.2, "taxRateRef": {"effectiveTaxRate": 20, "id": "INPUT2", "name": "20% (VAT on Expenses)"}, "totalAmount": 307.2, "trackingCategoryRefs": [], "unitAmount": 32}], "modifiedDate": "2022-10-23T00:00:00Z", "paymentAllocations": [{"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP"}, "payment": {"currency": "USD", "paidOnDate": "2022-10-23T00:00:00Z"}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "EUR"}, "payment": {"currency": "GBP", "paidOnDate": "2022-10-23T00:00:00Z"}}], "purchaseOrderRefs": [], "reference": "", "sourceModifiedDate": "2022-10-23T00:00:00Z", "status": "Open", "subTotal": 6056, "supplierRef": {"id": "1262c350-fe0f-40ec-aeff-41c95b4a45af", "supplierName": "DIISR - Small Business Services"}, "taxAmount": 1211.2, "totalAmount": 7267.2, "withholdingTax": []} + responses: + "200": + application/json: {"changes": [{"recordRef": {"dataType": "invoices"}}, {"recordRef": {"dataType": "invoices"}}], "companyId": "8a210b68-6988-11ed-a1eb-0242ac120002", "completedOnUtc": "2022-10-23T00:00:00Z", "dataConnectionKey": "2e9d2c44-f675-40ba-8049-353bfcb5e171", "dataType": "invoices", "pushOperationKey": "798bc19d-4c51-4e99-9dff-42acbeff61bc", "requestedOnUtc": "2022-10-23T00:00:00Z", "status": "Failed", "statusCode": 190276} + "400": {} + Malformed query: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + query: {} + requestBody: + application/json: {"currency": "EUR", "dueDate": "2022-10-23T00:00:00Z", "issueDate": "2022-10-23T00:00:00Z", "modifiedDate": "2022-10-23T00:00:00Z", "paymentAllocations": [{"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "USD"}, "payment": {"currency": "EUR", "paidOnDate": "2022-10-23T00:00:00Z"}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "EUR"}, "payment": {"currency": "GBP", "paidOnDate": "2022-10-23T00:00:00Z"}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "EUR"}, "payment": {"currency": "USD", "paidOnDate": "2022-10-23T00:00:00Z"}}], "sourceModifiedDate": "2022-10-23T00:00:00Z", "status": "Void", "subTotal": "7399.49", "taxAmount": "8422.84", "totalAmount": "4662.61"} + responses: + "400": + application/json: {"canBeRetried": "Unknown", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "detailedErrorCode": 0, "error": "Error processing request - not valid.", "service": "PublicApi", "statusCode": 400} + delete-bill: + Unauthorized: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + billId: "7110701885" + responses: + "401": + application/json: {"canBeRetried": "Unknown", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "detailedErrorCode": 0, "error": "Unauthorized", "service": "PublicApi", "statusCode": 401} + delete-bill-attachment: + Unauthorized: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + billId: "9wg4lep4ush5cxs79pl8sozmsndbaukll3ind4g7buqbm1h2" + attachmentId: "8a210b68-6988-11ed-a1eb-0242ac120002" + responses: + "401": + application/json: {"canBeRetried": "Unknown", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "detailedErrorCode": 0, "error": "Unauthorized", "service": "PublicApi", "statusCode": 401} + download-bill-attachment: + Unauthorized: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + billId: "EILBDVJVNUAGVKRQ" + attachmentId: "8a210b68-6988-11ed-a1eb-0242ac120002" + responses: + "401": + application/json: {"canBeRetried": "Unknown", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "detailedErrorCode": 0, "error": "Unauthorized", "service": "PublicApi", "statusCode": 401} + get-bill: + Clear Books: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + billId: "7110701885" + responses: + "200": + application/json: {"amountDue": 0, "currency": "GBP", "currencyRate": 1, "dueDate": "2022-05-06T00:00:00", "id": "81539597-e681-40c9-a4dd-ec2fffcde572", "issueDate": "2022-04-29T00:00:00", "lineItems": [{"accountRef": {"id": "72df89d2-512b-4455-af51-a6b563733842", "name": "Sales"}, "description": "Grease Trap", "discountAmount": 0, "discountPercentage": 0, "isDirectCost": false, "itemRef": {"id": "22aee6bd-4767-48c4-8a13-fdf85b91fc80", "name": "600 Litre Grease Trap"}, "quantity": 5, "subTotal": 13909.7, "taxAmount": 1390.97, "taxRateRef": {"effectiveTaxRate": 10, "id": "6c88aff3-7cb9-4980-a3d3-443e72e02498", "name": "Sales Tax (10%)"}, "totalAmount": 15300.67, "trackingCategoryRefs": [], "unitAmount": 2781.94}, {"accountRef": {"id": "72df89d2-512b-4455-af51-a6b563733842", "name": "Sales"}, "description": "Grease Trap", "discountAmount": 0, "discountPercentage": 0, "isDirectCost": false, "itemRef": {"id": "9409d23d-1011-432e-98a4-591fcd8d5404", "name": "300 Litre Grease Trap"}, "quantity": 5, "subTotal": 6856.95, "taxAmount": 685.7, "taxRateRef": {"effectiveTaxRate": 10, "id": "6c88aff3-7cb9-4980-a3d3-443e72e02498", "name": "Sales Tax (10%)"}, "totalAmount": 7542.65, "trackingCategoryRefs": [], "unitAmount": 1371.39}, {"accountRef": {"id": "72df89d2-512b-4455-af51-a6b563733842", "name": "Sales"}, "description": "Grease Trap", "discountAmount": 0, "discountPercentage": 0, "isDirectCost": false, "itemRef": {"id": "9409d23d-1011-432e-98a4-591fcd8d5404", "name": "300 Litre Grease Trap"}, "quantity": 6, "subTotal": 8228.34, "taxAmount": 822.83, "taxRateRef": {"effectiveTaxRate": 10, "id": "6c88aff3-7cb9-4980-a3d3-443e72e02498", "name": "Sales Tax (10%)"}, "totalAmount": 9051.17, "trackingCategoryRefs": [], "unitAmount": 1371.39}, {"accountRef": {"id": "72df89d2-512b-4455-af51-a6b563733842", "name": "Sales"}, "description": "Grease Trap", "discountAmount": 0, "discountPercentage": 0, "isDirectCost": false, "itemRef": {"id": "22aee6bd-4767-48c4-8a13-fdf85b91fc80", "name": "600 Litre Grease Trap"}, "quantity": 3, "subTotal": 8345.82, "taxAmount": 834.58, "taxRateRef": {"effectiveTaxRate": 10, "id": "6c88aff3-7cb9-4980-a3d3-443e72e02498", "name": "Sales Tax (10%)"}, "totalAmount": 9180.4, "trackingCategoryRefs": [], "unitAmount": 2781.94}, {"accountRef": {"id": "72df89d2-512b-4455-af51-a6b563733842", "name": "Sales"}, "description": "Underground - Trapped Road Gully 450mm x 450mm", "discountAmount": 0, "discountPercentage": 0, "isDirectCost": false, "itemRef": {"id": "3abf0883-03f7-44c6-bc15-1372522d25e1", "name": "Heavy Duty Hinged Gully Grating"}, "quantity": 8, "subTotal": 3223.12, "taxAmount": 322.31, "taxRateRef": {"effectiveTaxRate": 10, "id": "6c88aff3-7cb9-4980-a3d3-443e72e02498", "name": "Sales Tax (10%)"}, "totalAmount": 3545.43, "trackingCategoryRefs": [], "unitAmount": 402.89}, {"accountRef": {"id": "72df89d2-512b-4455-af51-a6b563733842", "name": "Sales"}, "description": "Underground - Drain Bottle Gullies 90 degree Rectangular", "discountAmount": 0, "discountPercentage": 0, "isDirectCost": false, "itemRef": {"id": "6", "name": "Back Inlet Roddable Gully 90� Outlet Rectangular Grid"}, "quantity": 7, "subTotal": 665.56, "taxAmount": 66.56, "taxRateRef": {"effectiveTaxRate": 10, "id": "6c88aff3-7cb9-4980-a3d3-443e72e02498", "name": "Sales Tax (10%)"}, "totalAmount": 732.12, "trackingCategoryRefs": [], "unitAmount": 95.08}, {"accountRef": {"id": "72df89d2-512b-4455-af51-a6b563733842", "name": "Sales"}, "description": "Underground - Drain Bottle Gullies 90 degree Rectangular", "discountAmount": 0, "discountPercentage": 0, "isDirectCost": false, "itemRef": {"id": "6", "name": "Back Inlet Roddable Gully 90� Outlet Rectangular Grid"}, "quantity": 1, "subTotal": 95.08, "taxAmount": 9.51, "taxRateRef": {"effectiveTaxRate": 10, "id": "6c88aff3-7cb9-4980-a3d3-443e72e02498", "name": "Sales Tax (10%)"}, "totalAmount": 104.59, "trackingCategoryRefs": [], "unitAmount": 95.08}, {"accountRef": {"id": "72df89d2-512b-4455-af51-a6b563733842", "name": "Sales"}, "description": "Grease Trap", "discountAmount": 0, "discountPercentage": 0, "isDirectCost": false, "itemRef": {"id": "9409d23d-1011-432e-98a4-591fcd8d5404", "name": "300 Litre Grease Trap"}, "quantity": 2, "subTotal": 2742.78, "taxAmount": 274.28, "taxRateRef": {"effectiveTaxRate": 10, "id": "6c88aff3-7cb9-4980-a3d3-443e72e02498", "name": "Sales Tax (10%)"}, "totalAmount": 3017.06, "trackingCategoryRefs": [], "unitAmount": 1371.39}, {"accountRef": {"id": "72df89d2-512b-4455-af51-a6b563733842", "name": "Sales"}, "description": "Grease Trap", "discountAmount": 0, "discountPercentage": 0, "isDirectCost": false, "itemRef": {"id": "22aee6bd-4767-48c4-8a13-fdf85b91fc80", "name": "600 Litre Grease Trap"}, "quantity": 1, "subTotal": 2781.94, "taxAmount": 278.19, "taxRateRef": {"effectiveTaxRate": 10, "id": "6c88aff3-7cb9-4980-a3d3-443e72e02498", "name": "Sales Tax (10%)"}, "totalAmount": 3060.13, "trackingCategoryRefs": [], "unitAmount": 2781.94}, {"accountRef": {"id": "72df89d2-512b-4455-af51-a6b563733842", "name": "Sales"}, "description": "Underground - Drain Bottle Gullies 90 degree Rectangular", "discountAmount": 0, "discountPercentage": 0, "isDirectCost": false, "itemRef": {"id": "6", "name": "Back Inlet Roddable Gully 90� Outlet Rectangular Grid"}, "quantity": 7, "subTotal": 665.56, "taxAmount": 66.56, "taxRateRef": {"effectiveTaxRate": 10, "id": "6c88aff3-7cb9-4980-a3d3-443e72e02498", "name": "Sales Tax (10%)"}, "totalAmount": 732.12, "trackingCategoryRefs": [], "unitAmount": 95.08}, {"accountRef": {"id": "72df89d2-512b-4455-af51-a6b563733842", "name": "Sales"}, "description": "Grease Trap", "discountAmount": 0, "discountPercentage": 0, "isDirectCost": false, "itemRef": {"id": "51077072-d5c3-463b-9cb4-7da2e11886f9", "name": "150 Litre Grease Trap"}, "quantity": 4, "subTotal": 5007.56, "taxAmount": 500.76, "taxRateRef": {"effectiveTaxRate": 10, "id": "6c88aff3-7cb9-4980-a3d3-443e72e02498", "name": "Sales Tax (10%)"}, "totalAmount": 5508.32, "trackingCategoryRefs": [], "unitAmount": 1251.89}, {"accountRef": {"id": "72df89d2-512b-4455-af51-a6b563733842", "name": "Sales"}, "description": "Grease Trap", "discountAmount": 0, "discountPercentage": 0, "isDirectCost": false, "itemRef": {"id": "9409d23d-1011-432e-98a4-591fcd8d5404", "name": "300 Litre Grease Trap"}, "quantity": 9, "subTotal": 12342.51, "taxAmount": 1234.25, "taxRateRef": {"effectiveTaxRate": 10, "id": "6c88aff3-7cb9-4980-a3d3-443e72e02498", "name": "Sales Tax (10%)"}, "totalAmount": 13576.76, "trackingCategoryRefs": [], "unitAmount": 1371.39}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-26T12:38:16Z", "note": "Bill with 12 line items, totaling 71351.42", "paymentAllocations": [{"allocation": {"allocatedOnDate": "2022-05-06T00:00:00", "currency": "GBP", "currencyRate": 1, "totalAmount": -71351.42}, "payment": {"accountRef": {"id": "dbcaf288-2b39-4b95-8ab3-42202ab15918", "name": "Business Current Account"}, "currency": "GBP", "currencyRate": 1, "id": "dcb18480-8b69-44d8-aa26-268b6a80d170", "note": "Bill Payment against bill 81539597-e681-40c9-a4dd-ec2fffcde572", "paidOnDate": "2022-05-06T00:00:00", "totalAmount": 71351.42}}], "purchaseOrderRefs": [], "reference": "b465a2c9-3212-4620-889b-6328ba148215", "sourceModifiedDate": "2023-02-14T17:09:02", "status": "Paid", "subTotal": 64864.92, "supplierRef": {"id": "8GeHBdBZiZ", "supplierName": "DuBuque, Goyette and Franecki"}, "taxAmount": 6486.5, "totalAmount": 71351.42, "withholdingTax": []} + Dynamics 365 Business Central: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + billId: "7110701885" + responses: + "200": + application/json: {"amountDue": 2188.51, "currency": "GBP", "dueDate": "2019-01-01T00:00:00", "id": "4019ee2b-d05a-ed11-8c34-000d3a0d28a2-108276", "issueDate": "2019-01-01T00:00:00", "lineItems": [{"accountRef": {"id": "6a1217b3-89d1-ea11-bbaa-000d3a2b9185", "name": "Inventory"}, "description": "ATHENS Desk", "discountAmount": 202.64, "discountPercentage": 10, "isDirectCost": false, "itemRef": {"id": "ITEM-c81217b3-89d1-ea11-bbaa-000d3a2b9185-DOMESTIC-DOMESTIC", "name": "ATHENS Desk / General Business Posting Group: 'DOMESTIC' / VAT Business Posting Group: 'DOMESTIC'"}, "quantity": 4, "subTotal": 1823.76, "taxAmount": 364.75, "taxRateRef": {"effectiveTaxRate": 10, "id": "63bc0fb9-89d1-ea11-bbaa-000d3a2b9185", "name": "Setup for DOMESTIC / STANDARD"}, "totalAmount": 2188.51, "trackingCategoryRefs": [], "unitAmount": 506.6}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-27T14:21:25Z", "note": "129148", "paymentAllocations": [], "purchaseOrderRefs": [], "reference": "108276", "sourceModifiedDate": "2022-11-02T17:02:48Z", "status": "Open", "subTotal": 1823.76, "supplierRef": {"id": "c01217b3-89d1-ea11-bbaa-000d3a2b9185", "supplierName": "First Up Consultants"}, "taxAmount": 364.75, "totalAmount": 2188.51, "withholdingTax": []} + Exact (Netherlands): + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + billId: "7110701885" + responses: + "200": + application/json: {"amountDue": 0, "currency": "EUR", "currencyRate": 1, "dueDate": "2019-11-09T00:00:00Z", "id": "1c55118b-793e-4437-9c13-4f554b9ca989", "issueDate": "2019-12-16T00:00:00Z", "lineItems": [{"accountRef": {"id": "5f139759-b554-4314-862e-b9d88e5b2e1b", "name": "Af te dragen loonheffing"}, "description": "Cheesecake", "discountAmount": 0, "isDirectCost": false, "quantity": 1, "subTotal": 10, "taxAmount": 2.1, "taxRateRef": {"effectiveTaxRate": 21, "id": "84277189-ad16-456c-b501-ca31f0a483cc", "name": "BTW prive gebruik"}, "totalAmount": 12.1, "trackingCategoryRefs": [], "unitAmount": 10}], "modifiedDate": "2022-10-26T13:32:18Z", "paymentAllocations": [{"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "EUR", "currencyRate": 1, "totalAmount": -12.1}, "payment": {"accountRef": {"id": "d79d65bd-1d7d-4f55-95d3-76b3a7b7b823", "name": "Bank 1"}, "currency": "EUR", "currencyRate": 1, "id": "d9a2980b-2a43-46f2-9c7f-413d925b3cdd", "paidOnDate": "2021-03-22T00:00:00", "reference": "20200032", "totalAmount": 12.1}}], "purchaseOrderRefs": [], "reference": "19600006", "sourceModifiedDate": "2020-01-03T15:06:02Z", "status": "Paid", "subTotal": 10, "supplierRef": {"id": "5e6f49b9-6489-4b82-83e7-291d308919bb", "supplierName": "Mickey Mouse"}, "taxAmount": 2.1, "totalAmount": 12.1, "withholdingTax": []} + Exact (UK): + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + billId: "EILBDVJVNUAGVKRQ" + responses: + "200": + application/json: {"amountDue": 0, "currency": "GBP", "currencyRate": 1, "dueDate": "2017-10-26T00:00:00Z", "id": "e7a45898-2db3-424c-acb9-a51647740f26", "issueDate": "2017-09-26T00:00:00Z", "lineItems": [{"accountRef": {"id": "e5e9e994-0f14-4614-b162-7b5593b21276", "name": "Finished Goods Stock"}, "description": "Stationery", "discountAmount": 0, "isDirectCost": false, "itemRef": {"id": "001"}, "quantity": 2, "subTotal": 800, "taxAmount": 160, "taxRateRef": {"effectiveTaxRate": 20, "id": "63cd143a-66ab-4320-8a6d-ab6be85ed048", "name": "UK purchases standard rate � Excluding"}, "totalAmount": 960, "trackingCategoryRefs": [], "unitAmount": 400}], "modifiedDate": "2022-10-26T13:33:20Z", "paymentAllocations": [{"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -123}, "payment": {"accountRef": {"id": "4a4e34b5-7f62-4b64-a44a-073398b14b41", "name": "Bank"}, "currency": "GBP", "currencyRate": 1, "id": "7a5f621b-739f-4ed8-b738-2aae3ef886ac", "paidOnDate": "2017-10-11T00:00:00", "reference": "17200006", "totalAmount": 123}}], "purchaseOrderRefs": [], "reference": "17600002", "sourceModifiedDate": "2019-01-11T14:18:17Z", "status": "Paid", "subTotal": 800, "supplierRef": {"id": "a7cad20d-44db-442b-ac1f-90475802d6fb", "supplierName": "Pencils Pencils Pencils"}, "taxAmount": 160, "totalAmount": 960, "withholdingTax": []} + FreeAgent: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + billId: "9wg4lep4ush5cxs79pl8sozmsndbaukll3ind4g7buqbm1h2" + responses: + "200": + application/json: {"amountDue": 150, "currency": "GBP", "dueDate": "2018-09-20T00:00:00", "id": "16609552", "issueDate": "2014-08-21T00:00:00", "lineItems": [{"accountRef": {"id": "285", "name": "Accommodation and Meals"}, "isDirectCost": false, "quantity": 1, "taxAmount": 25, "totalAmount": 150, "trackingCategoryRefs": [], "unitAmount": 125}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-25T14:19:10Z", "paymentAllocations": [], "purchaseOrderRefs": [], "reference": "MATT - U", "sourceModifiedDate": "2020-11-11T12:48:55Z", "status": "Open", "subTotal": 125, "supplierRef": {"id": "7169654", "supplierName": "The Eagle"}, "taxAmount": 25, "totalAmount": 150, "withholdingTax": []} + FreshBooks: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + billId: "9wg4lep4ush5cxs79pl8sozmsndbaukll3ind4g7buqbm1h2" + responses: + "200": + application/json: {"amountDue": 50, "currency": "USD", "dueDate": "2021-05-26T00:00:00", "id": "27", "issueDate": "2021-04-26T00:00:00", "lineItems": [{"accountRef": {"id": "3384197", "name": "Advertising"}, "description": "Grocery", "isDirectCost": false, "quantity": 1, "subTotal": 50, "taxAmount": 0, "totalAmount": 50, "trackingCategoryRefs": [], "unitAmount": 50}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-24T16:07:23Z", "paymentAllocations": [], "purchaseOrderRefs": [], "sourceModifiedDate": "2021-04-26T19:34:22", "status": "Open", "subTotal": 50, "supplierRef": {"id": "87"}, "taxAmount": 0, "totalAmount": 50, "withholdingTax": []} + KashFlow: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + billId: "13d946f0-c5d5-42bc-b092-97ece17923ab" + responses: + "200": + application/json: {"amountDue": 0, "currency": "GBP", "currencyRate": 1, "dueDate": "2000-01-01T00:00:00", "id": "97615244", "issueDate": "2000-01-01T00:00:00", "lineItems": [{"accountRef": {"id": "21481884", "name": "Computer equipment cost"}, "description": "", "isDirectCost": false, "itemRef": {"id": "122990246"}, "quantity": 1, "subTotal": 8.33, "taxAmount": 1.67, "totalAmount": 10, "trackingCategoryRefs": [], "unitAmount": 8.33}], "modifiedDate": "2022-09-30T10:29:15Z", "paymentAllocations": [], "purchaseOrderRefs": [], "reference": "25", "sourceModifiedDate": "2022-10-23T00:00:00Z", "status": "Paid", "subTotal": 8.33, "supplierRef": {"id": "9272052", "supplierName": "Supplier man"}, "taxAmount": 1.67, "totalAmount": 10, "withholdingTax": []} + Oracle NetSuite: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + billId: "9wg4lep4ush5cxs79pl8sozmsndbaukll3ind4g7buqbm1h2" + responses: + "200": + application/json: {"amountDue": 24, "currency": "GBP", "currencyRate": 1, "dueDate": "2021-03-26T00:00:00", "id": "7", "issueDate": "2021-03-26T00:00:00", "lineItems": [{"accountRef": {"id": "716", "name": "Inventory In Transit"}, "isDirectCost": false, "quantity": 1, "subTotal": 120, "totalAmount": 120, "tracking": {"categoryRefs": [{"id": "location-4", "name": "Europe"}], "isBilledTo": "Unknown", "isRebilledTo": "Unknown"}, "trackingCategoryRefs": [{"id": "location-4", "name": "Europe"}], "unitAmount": 120, "unitOfMeasurement": "litre"}], "modifiedDate": "2023-01-30T14:47:34Z", "paymentAllocations": [{"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -120}, "payment": {"accountRef": {"id": "825", "name": "Codat Europe Bank"}, "currency": "GBP", "currencyRate": 1, "id": "112", "paidOnDate": "2021-03-26T00:00:00", "reference": "Bill Payment #1", "totalAmount": 120}}], "purchaseOrderRefs": [], "sourceModifiedDate": "2022-07-05T13:38:10", "status": "PartiallyPaid", "subTotal": 120, "supplierRef": {"id": "724", "supplierName": "Vendor A.A.A"}, "taxAmount": 24, "totalAmount": 144, "withholdingTax": []} + QuickBooks Desktop: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + billId: "13d946f0-c5d5-42bc-b092-97ece17923ab" + responses: + "200": + application/json: {"amountDue": 0, "currency": "GBP", "currencyRate": 1, "dueDate": "2024-01-01T00:00:00", "id": "3691-1071520776", "issueDate": "2022-12-02T00:00:00", "lineItems": [{"accountRef": {"id": "C0000-933270541", "name": "Accounts Payable"}, "description": "Cabinets:Light Pine - Light pine kitchen cabinet wall unit \n#CLD- 1235-p", "discountAmount": 0, "discountPercentage": 0, "isDirectCost": false, "itemRef": {"id": "110000-933272656", "name": "Cabinets:Light Pine"}, "quantity": 5, "subTotal": 7500, "taxAmount": 0, "totalAmount": 7500, "tracking": {"categoryRefs": [{"id": "10000-933272658", "name": "New Construction"}], "isBilledTo": "Unknown", "isRebilledTo": "Unknown"}, "trackingCategoryRefs": [{"id": "10000-933272658", "name": "New Construction"}], "unitAmount": 1500}, {"accountRef": {"id": "C0000-933270541", "name": "Accounts Payable"}, "description": "Hardware:Doorknobs Std - Doorknobs Part # DK 3704", "discountAmount": 0, "discountPercentage": 0, "isDirectCost": false, "itemRef": {"id": "130000-933272656", "name": "Hardware:Doorknobs Std"}, "quantity": 100, "subTotal": 2700, "taxAmount": 0, "totalAmount": 2700, "tracking": {"categoryRefs": [{"id": "10000-933272658", "name": "New Construction"}], "isBilledTo": "Unknown", "isRebilledTo": "Unknown"}, "trackingCategoryRefs": [{"id": "10000-933272658", "name": "New Construction"}], "unitAmount": 27}, {"accountRef": {"id": "C0000-933270541", "name": "Accounts Payable"}, "description": "Hardware:Lk Doorknobs - Locking interior doorknobs Part # DK415", "discountAmount": 0, "discountPercentage": 0, "isDirectCost": false, "itemRef": {"id": "140000-933272656", "name": "Hardware:Lk Doorknobs"}, "quantity": 100, "subTotal": 3495, "taxAmount": 0, "totalAmount": 3495, "tracking": {"categoryRefs": [{"id": "10000-933272658", "name": "New Construction"}], "isBilledTo": "Unknown", "isRebilledTo": "Unknown"}, "trackingCategoryRefs": [{"id": "10000-933272658", "name": "New Construction"}], "unitAmount": 34.95}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-26T09:06:42Z", "paymentAllocations": [{"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -5000}, "payment": {"accountRef": {"id": "20000-933270541", "name": "Checking"}, "currency": "GBP", "currencyRate": 1, "id": "36AD-1071520917", "note": "RC 93", "paidOnDate": "2024-12-05T00:00:00", "reference": "484", "totalAmount": 5325}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -8695}, "payment": {"accountRef": {"id": "20000-933270541", "name": "Checking"}, "currency": "GBP", "currencyRate": 1, "id": "9E4C-1182131999", "paidOnDate": "2023-01-31T00:00:00", "reference": "115", "totalAmount": 13759}}], "purchaseOrderRefs": [{"id": "3684-1071520443", "purchaseOrderNumber": "6225"}], "reference": "3847498", "sourceModifiedDate": "2023-12-16T05:06:30", "status": "Paid", "subTotal": 13695, "supplierRef": {"id": "B0000-933272656", "supplierName": "Patton Hardware Supplies"}, "taxAmount": 0, "totalAmount": 13695, "withholdingTax": []} + QuickBooks Online: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + billId: "13d946f0-c5d5-42bc-b092-97ece17923ab" + responses: + "200": + application/json: {"amountDue": 0, "currency": "GBP", "currencyRate": 1, "dueDate": "2019-05-13T00:00:00", "id": "18", "issueDate": "2019-05-13T00:00:00", "lineItems": [{"accountRef": {"id": "16", "name": "Advertising"}, "discountAmount": 0, "isDirectCost": false, "quantity": 1, "subTotal": 5, "taxAmount": 0, "taxRateRef": {"effectiveTaxRate": 0, "id": "NON", "name": "NON"}, "totalAmount": 5, "tracking": {"categoryRefs": [], "isBilledTo": "Unknown", "isRebilledTo": "NotApplicable"}, "trackingCategoryRefs": [], "unitAmount": 5}], "modifiedDate": "2023-01-18T11:02:41Z", "paymentAllocations": [{"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -5}, "payment": {"currency": "GBP", "currencyRate": 1, "id": "20", "paidOnDate": "2019-05-13T00:00:00", "totalAmount": 0}}], "purchaseOrderRefs": [], "reference": "12", "sourceModifiedDate": "2022-05-26T10:34:10Z", "status": "Paid", "subTotal": 5, "supplierRef": {"id": "4", "supplierName": "BILLy elliot"}, "taxAmount": 0, "totalAmount": 5, "withholdingTax": []} + QuickBooks Online Sandbox: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + billId: "EILBDVJVNUAGVKRQ" + responses: + "200": + application/json: {"amountDue": 0, "currency": "HKD", "currencyRate": 0.081142, "dueDate": "2016-01-16T00:00:00", "id": "157", "issueDate": "2016-01-06T00:00:00", "lineItems": [{"description": "Water bottles -- generic", "discountAmount": 0, "isDirectCost": false, "itemRef": {"id": "19", "name": "Water Bottles"}, "quantity": 100, "subTotal": 6617.17, "taxAmount": 1323.43, "taxRateRef": {"effectiveTaxRate": 20, "id": "3_Bills", "name": "20.0% S Bills"}, "totalAmount": 7940.6, "tracking": {"categoryRefs": [], "customerRef": {"companyName": "Oxon Insurance - Holiday Party", "id": "55"}, "isBilledTo": "Unknown", "isRebilledTo": "NotApplicable"}, "trackingCategoryRefs": [], "unitAmount": 66.1717023}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-26T09:35:58Z", "paymentAllocations": [{"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "HKD", "currencyRate": 1, "totalAmount": -7940.6}, "payment": {"accountRef": {"id": "81", "name": "Current"}, "currency": "HKD", "currencyRate": 0.078807, "id": "158", "paidOnDate": "2016-01-23T00:00:00", "reference": "1067", "totalAmount": 7940.6}}], "purchaseOrderRefs": [], "sourceModifiedDate": "2023-01-26T11:20:45Z", "status": "Paid", "subTotal": 6617.17, "supplierRef": {"id": "57", "supplierName": "Hall's Promo Items"}, "taxAmount": 1323.43, "totalAmount": 7940.6, "withholdingTax": []} + Sage 200cloud: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + billId: "7110701885" + responses: + "200": + application/json: {"amountDue": 120, "currency": "GBP", "currencyRate": 1, "dueDate": "2020-02-15T00:00:00Z", "id": "45121", "issueDate": "2020-07-22T00:00:00Z", "lineItems": [{"description": "Tax Summary - Tax Rate 1", "discountAmount": 0.5, "isDirectCost": false, "quantity": 0, "subTotal": 0, "taxAmount": 20, "taxRateRef": {"effectiveTaxRate": 20, "id": "1729", "name": "Standard rate"}, "totalAmount": 20, "trackingCategoryRefs": [], "unitAmount": 0}, {"description": "Goods Summary", "discountAmount": 2.5, "isDirectCost": false, "quantity": 0, "subTotal": 100, "taxAmount": 0, "totalAmount": 100, "trackingCategoryRefs": [], "unitAmount": 0}], "modifiedDate": "2022-10-14T09:36:01Z", "note": "No1", "paymentAllocations": [], "purchaseOrderRefs": [], "reference": "Order no 1", "sourceModifiedDate": "2020-02-28T14:23:46Z", "status": "Open", "subTotal": 100, "supplierRef": {"id": "CON001", "supplierName": "Concept Stationery Supplies"}, "taxAmount": 20, "totalAmount": 120, "withholdingTax": []} + Sage 50 (UK): + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + billId: "7110701885" + responses: + "200": + application/json: {"amountDue": 0, "currency": "GBP", "currencyRate": 1, "dueDate": "2022-01-31T00:00:00", "id": "92", "issueDate": "2021-01-01T00:00:00", "lineItems": [{"accountRef": {"id": "5000", "name": "Materials Purchased"}, "description": "Goods", "isDirectCost": false, "quantity": 1, "subTotal": 5000, "taxAmount": 875, "taxRateRef": {"effectiveTaxRate": 20, "id": "1", "name": "Standard rate"}, "totalAmount": 5875, "tracking": {"categoryRefs": [{"id": "department_7", "name": "Workshop"}], "isBilledTo": "Unknown", "isRebilledTo": "Unknown"}, "trackingCategoryRefs": [{"id": "department_7", "name": "Workshop"}], "unitAmount": 5875}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-30T14:42:44Z", "note": "Goods", "paymentAllocations": [{"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -5875}, "payment": {"currency": "GBP", "currencyRate": 1, "id": "260", "note": "Purchase payment 260 linked to, purchase invoice 11, purchase invoice 18, purchase invoice 92, purchase invoice 93.", "paidOnDate": "2022-01-29T00:00:00", "totalAmount": 7141.98}}], "purchaseOrderRefs": [], "reference": "2569", "sourceModifiedDate": "2022-11-25T09:43:54", "status": "Paid", "subTotal": 5000, "supplierRef": {"id": "THO001", "supplierName": "Thompsons Electricals"}, "taxAmount": 875, "totalAmount": 5875, "withholdingTax": []} + Sage Business Cloud Accounting: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + billId: "9wg4lep4ush5cxs79pl8sozmsndbaukll3ind4g7buqbm1h2" + responses: + "200": + application/json: {"amountDue": 405.6, "currency": "GBP", "currencyRate": 1, "dueDate": "2018-07-19T00:00:00", "id": "15a7a15773b011e8aaa5027d54329956", "issueDate": "2018-06-19T00:00:00", "lineItems": [{"accountRef": {"id": "9a995955267a11e797950a57719b2edb", "name": "Cost of sales - goods"}, "description": "Consulting services", "isDirectCost": false, "itemRef": {"id": "a87b922b33de11e797950a57719b2edb", "name": "Consulting services"}, "quantity": 33, "subTotal": 363, "taxAmount": 72.6, "taxRateRef": {"effectiveTaxRate": 20, "id": "GB_STANDARD", "name": "Standard 20.00%"}, "totalAmount": 435.6, "trackingCategoryRefs": [], "unitAmount": 11}], "modifiedDate": "2022-10-24T14:56:08Z", "paymentAllocations": [{"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -5}, "payment": {"accountRef": {"id": "92b80ba619d34cafbedd0eb2e69a82f7", "name": "ozzbtdynvoblhytjolxaiohrtrhtpvndiqncpjtcjzwcddpvzl"}, "currency": "GBP", "currencyRate": 1, "id": "332e402b9d4b4614af82594d186f5f29", "note": "Supplier payment using credit/debit card - string", "paidOnDate": "2020-02-05T00:00:00", "totalAmount": 5}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -5}, "payment": {"accountRef": {"id": "92b80ba619d34cafbedd0eb2e69a82f7", "name": "ozzbtdynvoblhytjolxaiohrtrhtpvndiqncpjtcjzwcddpvzl"}, "currency": "GBP", "currencyRate": 1, "id": "3c3ed62353cf4d148352a14027738dbe", "note": "Supplier payment using credit/debit card - string", "paidOnDate": "2020-02-05T00:00:00", "totalAmount": 5}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -5}, "payment": {"accountRef": {"id": "92b80ba619d34cafbedd0eb2e69a82f7", "name": "ozzbtdynvoblhytjolxaiohrtrhtpvndiqncpjtcjzwcddpvzl"}, "currency": "GBP", "currencyRate": 1, "id": "cbff2fed2f1641b7bee59f5dd68d29a1", "note": "Supplier payment using credit/debit card - string", "paidOnDate": "2020-02-05T00:00:00", "totalAmount": 5}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -5}, "payment": {"accountRef": {"id": "92b80ba619d34cafbedd0eb2e69a82f7", "name": "ozzbtdynvoblhytjolxaiohrtrhtpvndiqncpjtcjzwcddpvzl"}, "currency": "GBP", "currencyRate": 1, "id": "d9b643b9d6e149f4b443cbc6f22fe1dd", "note": "Supplier payment using credit/debit card - string", "paidOnDate": "2020-02-05T00:00:00", "totalAmount": 5}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -5}, "payment": {"accountRef": {"id": "92b80ba619d34cafbedd0eb2e69a82f7", "name": "ozzbtdynvoblhytjolxaiohrtrhtpvndiqncpjtcjzwcddpvzl"}, "currency": "GBP", "currencyRate": 1, "id": "e3e35dcda09642ca8880fc603b0a98e9", "note": "Supplier payment using credit/debit card - string", "paidOnDate": "2020-02-05T00:00:00", "totalAmount": 5}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -5}, "payment": {"accountRef": {"id": "92b80ba619d34cafbedd0eb2e69a82f7", "name": "ozzbtdynvoblhytjolxaiohrtrhtpvndiqncpjtcjzwcddpvzl"}, "currency": "GBP", "currencyRate": 1, "id": "f11134e299cb4456be096265136a7770", "note": "Supplier payment using credit/debit card - string", "paidOnDate": "2020-02-05T00:00:00", "totalAmount": 5}}], "purchaseOrderRefs": [], "reference": "19/06/2018 - 435.60", "sourceModifiedDate": "2020-02-05T15:19:28Z", "status": "PartiallyPaid", "subTotal": 363, "supplierRef": {"id": "ca430e0d156011e8b45c025132dab352", "supplierName": "Test Supplier"}, "taxAmount": 72.6, "totalAmount": 435.6, "withholdingTax": []} + Sage Intacct: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + billId: "EILBDVJVNUAGVKRQ" + responses: + "200": + application/json: {"amountDue": 0, "currency": "GBP", "dueDate": "2021-10-29T00:00:00", "id": "4470", "issueDate": "2021-10-19T00:00:00", "lineItems": [{"accountRef": {"id": "3", "name": "Accounts Payable"}, "isDirectCost": false, "quantity": 1, "subTotal": 25, "taxAmount": 0, "taxRateRef": {"effectiveTaxRate": 0, "id": "82", "name": "UK Purchase Goods Zero Rate"}, "totalAmount": 25, "tracking": {"categoryRefs": [{"id": "DEPARTMENT-3", "name": "Admin"}, {"id": "LOCATION-11", "name": "Codat Test Entity"}], "isBilledTo": "Unknown", "isRebilledTo": "Unknown"}, "trackingCategoryRefs": [{"id": "DEPARTMENT-3", "name": "Admin"}, {"id": "LOCATION-11", "name": "Codat Test Entity"}], "unitAmount": 25}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-04T16:31:37Z", "note": "", "paymentAllocations": [{"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -5}, "payment": {"accountRef": {"id": "353", "name": "Current Account"}, "currency": "GBP", "id": "4472", "note": "", "paidOnDate": "2022-01-06T00:00:00", "totalAmount": 5}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -20}, "payment": {"accountRef": {"id": "353", "name": "Current Account"}, "currency": "GBP", "id": "4471", "note": "", "paidOnDate": "2022-01-06T00:00:00", "totalAmount": 20}}], "purchaseOrderRefs": [], "reference": "test", "sourceModifiedDate": "2022-02-23T12:06:58", "status": "Paid", "subTotal": 25, "supplierRef": {"id": "3", "supplierName": "ADP"}, "taxAmount": 0, "totalAmount": 25, "withholdingTax": []} + Xero: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + billId: "9wg4lep4ush5cxs79pl8sozmsndbaukll3ind4g7buqbm1h2" + responses: + "200": + application/json: {"amountDue": 0, "currency": "GBP", "currencyRate": 1, "dueDate": "2021-12-20T00:00:00", "id": "3945273c-cc04-479f-a4b5-1e3dc7a55ed1", "issueDate": "2021-11-19T00:00:00", "lineItems": [{"accountRef": {"id": "46f9461e-788b-4906-8b74-d1ea17f6dc10", "name": "Consulting"}, "description": "Half day training - Microsoft Office", "discountAmount": 0, "discountPercentage": 0, "isDirectCost": false, "itemRef": {"id": "489558f5-27b7-4f37-ad9f-d84611c2e2ab", "name": "Half day training - Microsoft Office"}, "quantity": 1, "subTotal": 1800, "taxAmount": 360, "taxRateRef": {"effectiveTaxRate": 20, "id": "INPUT2", "name": "20% (VAT on Expenses)"}, "totalAmount": 2160, "trackingCategoryRefs": [], "unitAmount": 1800}, {"accountRef": {"id": "f96c9458-d724-47bf-8f74-a9d5726465ce", "name": "General Expenses"}, "description": "Desktop/network support via email & phone.Per month fixed fee for minimum 20 hours/month.", "discountAmount": 0, "discountPercentage": 0, "isDirectCost": false, "itemRef": {"id": "f8fb7e00-5e5d-466c-aef0-15861f73d04f", "name": "Desktop/network support via email & phone"}, "quantity": 1, "subTotal": 4000, "taxAmount": 800, "taxRateRef": {"effectiveTaxRate": 20, "id": "INPUT2", "name": "20% (VAT on Expenses)"}, "totalAmount": 4800, "trackingCategoryRefs": [], "unitAmount": 4000}, {"accountRef": {"id": "cba6527d-f102-4538-b421-e483233e9d5a", "name": "Printing & Stationery"}, "description": "Stationery charges", "discountAmount": 0, "discountPercentage": 0, "isDirectCost": false, "quantity": 8, "subTotal": 256, "taxAmount": 51.2, "taxRateRef": {"effectiveTaxRate": 20, "id": "INPUT2", "name": "20% (VAT on Expenses)"}, "totalAmount": 307.2, "trackingCategoryRefs": [], "unitAmount": 32}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-15T20:36:09Z", "paymentAllocations": [{"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -7267.2}, "payment": {"accountRef": {"id": "bd9e85e0-0478-433d-ae9f-0b3c4f04bfe4", "name": "Business Bank Account"}, "currency": "GBP", "currencyRate": 1, "id": "74004690-82a1-4810-aaca-6ce575af94b4", "paidOnDate": "2021-12-20T00:00:00", "totalAmount": 7267.2}}], "purchaseOrderRefs": [], "reference": "", "sourceModifiedDate": "2021-01-02T21:07:23", "status": "Paid", "subTotal": 6056, "supplierRef": {"id": "1262c350-fe0f-40ec-aeff-41c95b4a45af", "supplierName": "DIISR - Small Business Services"}, "taxAmount": 1211.2, "totalAmount": 7267.2, "withholdingTax": []} + Zoho Books: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + billId: "EILBDVJVNUAGVKRQ" + responses: + "200": + application/json: {"amountDue": 0, "currency": "GBP", "currencyRate": 1, "dueDate": "2020-06-23T00:00:00", "id": "104957000000152027", "issueDate": "2020-06-23T00:00:00", "lineItems": [], "modifiedDate": "2022-10-03T08:40:37Z", "paymentAllocations": [], "purchaseOrderRefs": [], "reference": "1", "sourceModifiedDate": "2020-06-23T13:47:17", "status": "Paid", "subTotal": 0, "supplierRef": {"id": "104957000000152001", "supplierName": "Mr. P N"}, "taxAmount": 0, "totalAmount": 10, "withholdingTax": []} + Unauthorized: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + billId: "9wg4lep4ush5cxs79pl8sozmsndbaukll3ind4g7buqbm1h2" + responses: + "401": + application/json: {"canBeRetried": "Unknown", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "detailedErrorCode": 0, "error": "Unauthorized", "service": "PublicApi", "statusCode": 401} + get-bill-attachment: + Unauthorized: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + billId: "EILBDVJVNUAGVKRQ" + attachmentId: "8a210b68-6988-11ed-a1eb-0242ac120002" + responses: + "401": + application/json: {"canBeRetried": "Unknown", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "detailedErrorCode": 0, "error": "Unauthorized", "service": "PublicApi", "statusCode": 401} + get-create-update-bill-model: + Dynamics 365 Business Central: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + responses: + "200": + application/json: {"description": "A bill is an itemised record of goods purchased from or services provided by a supplier", "displayName": "Bill", "properties": {"supplierRef": {"description": "Reference to the supplier the bill has been received from", "displayName": "Supplier Reference", "required": true, "type": "Object"}, "status": {"description": "The current state of the bill", "displayName": "Bill Status", "options": [{"displayName": "Draft", "required": false, "type": "Array", "value": "Draft"}, {"displayName": "Void", "required": false, "type": "Array", "value": "Void"}, {"displayName": "Open", "required": false, "type": "Array", "value": "Open"}], "required": true, "type": "String"}, "dueDate": {"description": "The date the bill is due to be paid by", "displayName": "Due Date", "required": true, "type": "DateTime"}, "issueDate": {"description": "The date of the bill as recorded in the originating system.", "displayName": "Issue Date", "required": true, "type": "DateTime"}, "note": {"description": "Note about the bill", "displayName": "Note", "required": true, "type": "String", "validation": {"information": [], "warnings": [{"details": "Supplier Invoice Number must be specified in this field", "field": "Note"}]}}, "lineItems": {"description": "A collection of lines that detail items related to the bill", "displayName": "Line Items", "required": true, "type": "Array"}}, "required": true, "type": "Object"} + FreeAgent: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + responses: + "200": + application/json: {"description": "A bill is an itemised record of goods purchased from or services provided by a supplier", "displayName": "Bill", "properties": {"reference": {"description": "User friendly reference for the bill", "displayName": "Reference", "required": true, "type": "String"}, "supplierRef": {"description": "Reference to the supplier the bill has been received from", "displayName": "Supplier Reference", "required": true, "type": "Object"}, "totalAmount": {"description": "The amount of the bill, inclusive of tax", "displayName": "Total Amount", "required": true, "type": "Number", "validation": {"information": [], "warnings": [{"details": "Must be greater than or equal to 0 and must be equal to the total value of the bill item total amounts.", "field": "TotalAmount"}]}}, "lineItems": {"description": "A collection of lines that detail items related to the bill", "displayName": "Line Items", "required": true, "type": "Array", "validation": {"information": [], "warnings": [{"details": "Must contain at least one line item and up to a maximum of 40 line items allowed.", "field": "LineItems"}]}}, "currency": {"description": "Currency of the bill", "displayName": "Currency", "options": [{"displayName": "AED", "required": false, "type": "String", "value": "AED"}, {"displayName": "AMD", "required": false, "type": "String", "value": "AMD"}, {"displayName": "AOA", "required": false, "type": "String", "value": "AOA"}, {"displayName": "ARS", "required": false, "type": "String", "value": "ARS"}, {"displayName": "AUD", "required": false, "type": "String", "value": "AUD"}, {"displayName": "AWG", "required": false, "type": "String", "value": "AWG"}, {"displayName": "AZN", "required": false, "type": "String", "value": "AZN"}, {"displayName": "BBD", "required": false, "type": "String", "value": "BBD"}, {"displayName": "BDT", "required": false, "type": "String", "value": "BDT"}, {"displayName": "BGN", "required": false, "type": "String", "value": "BGN"}, {"displayName": "BRL", "required": false, "type": "String", "value": "BRL"}, {"displayName": "BWP", "required": false, "type": "String", "value": "BWP"}, {"displayName": "CAD", "required": false, "type": "String", "value": "CAD"}, {"displayName": "CHF", "required": false, "type": "String", "value": "CHF"}, {"displayName": "CLP", "required": false, "type": "String", "value": "CLP"}, {"displayName": "CNY", "required": false, "type": "String", "value": "CNY"}, {"displayName": "COP", "required": false, "type": "String", "value": "COP"}, {"displayName": "CRC", "required": false, "type": "String", "value": "CRC"}, {"displayName": "CUC", "required": false, "type": "String", "value": "CUC"}, {"displayName": "CUP", "required": false, "type": "String", "value": "CUP"}, {"displayName": "CZK", "required": false, "type": "String", "value": "CZK"}, {"displayName": "DKK", "required": false, "type": "String", "value": "DKK"}, {"displayName": "DOP", "required": false, "type": "String", "value": "DOP"}, {"displayName": "EGP", "required": false, "type": "String", "value": "EGP"}, {"displayName": "EUR", "required": false, "type": "String", "value": "EUR"}, {"displayName": "FJD", "required": false, "type": "String", "value": "FJD"}, {"displayName": "GBP", "required": false, "type": "String", "value": "GBP"}, {"displayName": "GEL", "required": false, "type": "String", "value": "GEL"}, {"displayName": "GHS", "required": false, "type": "String", "value": "GHS"}, {"displayName": "GTQ", "required": false, "type": "String", "value": "GTQ"}, {"displayName": "GYD", "required": false, "type": "String", "value": "GYD"}, {"displayName": "HKD", "required": false, "type": "String", "value": "HKD"}, {"displayName": "HNL", "required": false, "type": "String", "value": "HNL"}, {"displayName": "HRK", "required": false, "type": "String", "value": "HRK"}, {"displayName": "HUF", "required": false, "type": "String", "value": "HUF"}, {"displayName": "IDR", "required": false, "type": "String", "value": "IDR"}, {"displayName": "ILS", "required": false, "type": "String", "value": "ILS"}, {"displayName": "INR", "required": false, "type": "String", "value": "INR"}, {"displayName": "ISK", "required": false, "type": "String", "value": "ISK"}, {"displayName": "JMD", "required": false, "type": "String", "value": "JMD"}, {"displayName": "JPY", "required": false, "type": "String", "value": "JPY"}, {"displayName": "KES", "required": false, "type": "String", "value": "KES"}, {"displayName": "KRW", "required": false, "type": "String", "value": "KRW"}, {"displayName": "KWD", "required": false, "type": "String", "value": "KWD"}, {"displayName": "KYD", "required": false, "type": "String", "value": "KYD"}, {"displayName": "KZT", "required": false, "type": "String", "value": "KZT"}, {"displayName": "LAK", "required": false, "type": "String", "value": "LAK"}, {"displayName": "LBP", "required": false, "type": "String", "value": "LBP"}, {"displayName": "LKR", "required": false, "type": "String", "value": "LKR"}, {"displayName": "LTL", "required": false, "type": "String", "value": "LTL"}, {"displayName": "LVL", "required": false, "type": "String", "value": "LVL"}, {"displayName": "MAD", "required": false, "type": "String", "value": "MAD"}, {"displayName": "MDL", "required": false, "type": "String", "value": "MDL"}, {"displayName": "MGA", "required": false, "type": "String", "value": "MGA"}, {"displayName": "MUR", "required": false, "type": "String", "value": "MUR"}, {"displayName": "MVR", "required": false, "type": "String", "value": "MVR"}, {"displayName": "MWK", "required": false, "type": "String", "value": "MWK"}, {"displayName": "MXN", "required": false, "type": "String", "value": "MXN"}, {"displayName": "MYR", "required": false, "type": "String", "value": "MYR"}, {"displayName": "MZN", "required": false, "type": "String", "value": "MZN"}, {"displayName": "NAD", "required": false, "type": "String", "value": "NAD"}, {"displayName": "NGN", "required": false, "type": "String", "value": "NGN"}, {"displayName": "NOK", "required": false, "type": "String", "value": "NOK"}, {"displayName": "NPR", "required": false, "type": "String", "value": "NPR"}, {"displayName": "NZD", "required": false, "type": "String", "value": "NZD"}, {"displayName": "OMR", "required": false, "type": "String", "value": "OMR"}, {"displayName": "PEN", "required": false, "type": "String", "value": "PEN"}, {"displayName": "PHP", "required": false, "type": "String", "value": "PHP"}, {"displayName": "PKR", "required": false, "type": "String", "value": "PKR"}, {"displayName": "PLN", "required": false, "type": "String", "value": "PLN"}, {"displayName": "QAR", "required": false, "type": "String", "value": "QAR"}, {"displayName": "RON", "required": false, "type": "String", "value": "RON"}, {"displayName": "RSD", "required": false, "type": "String", "value": "RSD"}, {"displayName": "RUB", "required": false, "type": "String", "value": "RUB"}, {"displayName": "RWF", "required": false, "type": "String", "value": "RWF"}, {"displayName": "SAR", "required": false, "type": "String", "value": "SAR"}, {"displayName": "SCR", "required": false, "type": "String", "value": "SCR"}, {"displayName": "SEK", "required": false, "type": "String", "value": "SEK"}, {"displayName": "SGD", "required": false, "type": "String", "value": "SGD"}, {"displayName": "THB", "required": false, "type": "String", "value": "THB"}, {"displayName": "TND", "required": false, "type": "String", "value": "TND"}, {"displayName": "TRY", "required": false, "type": "String", "value": "TRY"}, {"displayName": "TTD", "required": false, "type": "String", "value": "TTD"}, {"displayName": "TWD", "required": false, "type": "String", "value": "TWD"}, {"displayName": "TZS", "required": false, "type": "String", "value": "TZS"}, {"displayName": "UAH", "required": false, "type": "String", "value": "UAH"}, {"displayName": "UGX", "required": false, "type": "String", "value": "UGX"}, {"displayName": "USD", "required": false, "type": "String", "value": "USD"}, {"displayName": "UYU", "required": false, "type": "String", "value": "UYU"}, {"displayName": "VEF", "required": false, "type": "String", "value": "VEF"}, {"displayName": "VND", "required": false, "type": "String", "value": "VND"}, {"displayName": "VUV", "required": false, "type": "String", "value": "VUV"}, {"displayName": "XAF", "required": false, "type": "String", "value": "XAF"}, {"displayName": "XCD", "required": false, "type": "String", "value": "XCD"}, {"displayName": "XOF", "required": false, "type": "String", "value": "XOF"}, {"displayName": "ZAR", "required": false, "type": "String", "value": "ZAR"}, {"displayName": "ZMK", "required": false, "type": "String", "value": "ZMK"}], "required": false, "type": "String", "validation": {"information": [{"details": "If not specified, defaults to the company's native currency", "field": "Currency"}], "warnings": []}}, "currencyRate": {"description": "The exchange rate between the currency of the bill and the base currency of the company", "displayName": "Currency Exchange Rate", "required": false, "type": "Number"}, "taxAmount": {"description": "The total amount of tax on the bill", "displayName": "Tax Amount", "required": true, "type": "Number", "validation": {"information": [], "warnings": [{"details": "Must be greater than or equal to 0, less than or equal to the Bill.TotalAmount and equal to the total value of the bill item tax amounts.", "field": "TaxAmount"}]}}, "issueDate": {"description": "The date of the bill as recorded in the originating system.", "displayName": "Issue Date", "required": true, "type": "DateTime"}, "dueDate": {"description": "The date the bill is due to be paid by", "displayName": "Due Date", "required": true, "type": "DateTime"}}, "required": true, "type": "Object"} + MYOB AccountRight and Essentials: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + responses: + "200": + application/json: {"description": "A bill is an itemised record of goods purchased from or services provided by a supplier", "displayName": "Bill", "properties": {"totalAmount": {"description": "The amount of the bill, inclusive of tax", "displayName": "Total Amount", "required": true, "type": "Number", "validation": {"information": [{"details": "Must be provided.", "field": "TotalAmount"}], "warnings": [{"details": "Precision must be maximum of two decimal places.", "field": "TotalAmount"}, {"details": "Must be greater than zero.", "field": "TotalAmount"}]}}, "reference": {"description": "User friendly reference for the bill", "displayName": "Reference", "required": false, "type": "String", "validation": {"information": [{"details": "Must not be greater than 8 characters long.", "field": "Reference"}], "warnings": []}}, "subTotal": {"description": "The total amount of the bill excluding any taxes", "displayName": "Sub Total Amount", "required": false, "type": "Number", "validation": {"information": [], "warnings": [{"details": "Precision must be maximum of two decimal places.", "field": "SubTotal"}]}}, "taxAmount": {"description": "The total amount of tax on the bill", "displayName": "Tax Amount", "required": false, "type": "Number", "validation": {"information": [], "warnings": [{"details": "Precision must be maximum of two decimal places.", "field": "TaxAmount"}]}}, "currency": {"description": "Currency of the bill", "displayName": "Currency", "options": [{"displayName": "Australian Dollar", "required": false, "type": "String", "value": "AUD"}], "required": true, "type": "String", "validation": {"information": [{"details": "Must be provided.", "field": "Currency"}], "warnings": []}}, "issueDate": {"description": "The date of the bill as recorded in the originating system.", "displayName": "Issue Date", "required": true, "type": "DateTime", "validation": {"information": [{"details": "Must not be before the due date.", "field": "IssueDate"}], "warnings": []}}, "dueDate": {"description": "The date the bill is due to be paid by", "displayName": "Due Date", "required": true, "type": "DateTime", "validation": {"information": [{"details": "Must be provided.", "field": "DueDate"}], "warnings": []}}, "supplierRef": {"description": "Reference to the supplier the bill has been received from", "displayName": "Supplier Reference", "required": true, "type": "Object", "validation": {"information": [{"details": "Must be provided.", "field": "SupplierRef"}], "warnings": []}}, "amountDue": {"description": "The amount outstanding on the bill", "displayName": "Amount Due", "required": false, "type": "Number", "validation": {"information": [{"details": "Must be at least zero and no more than that the total amount.", "field": "AmountDue"}], "warnings": [{"details": "Precision must be maximum of two decimal places.", "field": "AmountDue"}]}}, "lineItems": {"description": "A collection of lines that detail items related to the bill", "displayName": "Line Items", "required": true, "type": "Array", "validation": {"information": [{"details": "Must be provided.", "field": "LineItems"}], "warnings": []}}}, "required": true, "type": "Object"} + Oracle NetSuite: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + responses: + "200": + application/json: {"description": "A bill is an itemised record of goods purchased from or services provided by a supplier", "displayName": "Bill", "options": [{"displayName": "Open", "required": false, "type": "String", "value": "Open"}], "properties": {"reference": {"description": "User friendly reference for the bill", "displayName": "Reference", "required": false, "type": "String"}, "supplierRef": {"description": "Reference to the supplier the bill has been received from", "displayName": "Supplier Reference", "required": true, "type": "Object"}, "issueDate": {"description": "The date of the bill as recorded in the originating system.", "displayName": "Issue Date", "required": false, "type": "DateTime"}, "dueDate": {"description": "The date the bill is due to be paid by", "displayName": "Due Date", "required": false, "type": "DateTime"}, "currency": {"description": "Currency of the bill", "displayName": "Currency", "required": true, "type": "String"}, "currencyRate": {"description": "The exchange rate between the currency of the bill and the base currency of the company", "displayName": "Currency Exchange Rate", "required": true, "type": "Number"}, "status": {"description": "The current state of the bill", "displayName": "Bill Status", "required": true, "type": "String"}, "note": {"description": "Note about the bill", "displayName": "Note", "required": false, "type": "String"}, "lineItems": {"description": "A collection of lines that detail items related to the bill", "displayName": "Line Items", "required": true, "type": "Array"}}, "required": true, "type": "Object"} + QuickBooks Desktop: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + responses: + "200": + application/json: {"description": "A bill is an itemised record of goods purchased from or services provided by a supplier", "displayName": "Bill", "properties": {"supplierRef": {"description": "Reference to the supplier the bill has been received from", "displayName": "Supplier Reference", "required": true, "type": "Object"}, "issueDate": {"description": "The date of the bill as recorded in the originating system.", "displayName": "Issue Date", "required": true, "type": "DateTime"}, "dueDate": {"description": "The date the bill is due to be paid by", "displayName": "Due Date", "required": false, "type": "DateTime"}, "reference": {"description": "User friendly reference for the bill", "displayName": "Reference", "required": false, "type": "String", "validation": {"information": [], "warnings": [{"details": "Max length of 20 characters.", "field": "Reference"}]}}, "currency": {"description": "Currency of the bill", "displayName": "Currency", "required": false, "type": "String", "validation": {"information": [{"details": "If not set, will default to the default currency of the supplier", "field": "Currency"}], "warnings": [{"details": "Must be a three letter ISO code that matches the currency of the supplier", "field": "Currency"}, {"details": "Can only be set if the QuickBooks Desktop company has Multicurrency enabled.", "field": "Currency"}]}}, "note": {"description": "Note about the bill", "displayName": "Note", "required": false, "type": "String", "validation": {"information": [], "warnings": [{"details": "Max length of 4000 characters.", "field": "Note"}]}}, "currencyRate": {"description": "The exchange rate between the currency of the bill and the base currency of the company", "displayName": "Currency Exchange Rate", "required": false, "type": "Number", "validation": {"information": [{"details": "If not set, will default to the rate set within QuickBooks Desktop, if no rate is set in QuickBooks Desktop, it will default to 1.", "field": "CurrencyRate"}, {"details": "Can only be set if the Quickbooks Desktop company has Multicurrency enabled.", "field": "CurrencyRate"}], "warnings": []}}, "status": {"description": "The current state of the bill", "displayName": "Bill Status", "options": [{"displayName": "Open", "required": false, "type": "String", "value": "Open"}, {"displayName": "Paid", "required": false, "type": "String", "value": "Paid"}, {"displayName": "Void", "required": false, "type": "String", "value": "Void"}], "required": true, "type": "String", "validation": {"information": [{"details": "If a bill is pushed with a status of void, then all the amounts in the bill must be 0", "field": "Status"}, {"details": "If a bill is pushed without payment allocations, then the status must be Open, if pushed with payment allocations, then the status must be paid", "field": "Status"}], "warnings": [{"details": "If a bill is pushed with a total amount of 0, then the status must be Paid or Void", "field": "Status"}]}}, "taxAmount": {"description": "The total amount of tax on the bill", "displayName": "Tax Amount", "required": true, "type": "Number", "validation": {"information": [], "warnings": [{"details": "Cannot be mapped directly into QuickBooks Desktop and will only be used for validation purposes", "field": "TaxAmount"}, {"details": "Must match sum of total of tax from the line items", "field": "TaxAmount"}]}}, "subTotal": {"description": "The total amount of the bill excluding any taxes", "displayName": "Sub Total Amount", "required": true, "type": "Number", "validation": {"information": [], "warnings": [{"details": "Must match the totalAmount - taxAmount", "field": "SubTotal"}]}}, "totalAmount": {"description": "The amount of the bill, inclusive of tax", "displayName": "Total Amount", "required": true, "type": "Number", "validation": {"information": [{"details": "If a bill is pushed with a total amount of 0, it will automatically be marked as paid in QuickBooks Desktop", "field": "TotalAmount"}], "warnings": [{"details": "Must match the sum of line items ((quantity * unit price) - discount + tax)", "field": "TotalAmount"}]}}, "lineItems": {"description": "A collection of lines that detail items related to the bill", "displayName": "Line Items", "required": true, "type": "Array"}, "paymentAllocations": {"description": "A collection of payments allocated to the bill", "displayName": "Payment Allocations", "required": false, "type": "Array", "validation": {"information": [{"details": "If a payment allocation is provided, a credit card charge will created in QuickBooksDesktop, if left as null or empty, a {topLevelItem} will be created", "field": "PaymentAllocations"}], "warnings": [{"details": "A maximum of one payment allocation may be provided per bill", "field": "PaymentAllocations"}]}}}, "required": true, "type": "Object"} + QuickBooks Online Sandbox: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + responses: + "200": + application/json: {"description": "A bill is an itemised record of goods purchased from or services provided by a supplier", "displayName": "Bill", "properties": {"dueDate": {"description": "The date the bill is due to be paid by", "displayName": "Due Date", "required": true, "type": "DateTime"}, "reference": {"description": "User friendly reference for the bill", "displayName": "Reference", "required": false, "type": "String", "validation": {"information": [{"details": "Should be unique if WarnDuplicateBillNumber setting is On.", "field": "Reference"}, {"details": "Should not be longer than 21 characters.", "field": "Reference"}], "warnings": []}}, "currency": {"description": "Currency of the bill", "displayName": "Currency", "options": [{"displayName": "USD", "required": false, "type": "String", "value": "USD"}], "required": true, "type": "String", "validation": {"information": [{"details": "Required if multi-currency is enabled for the company.", "field": "Currency"}], "warnings": []}}, "currencyRate": {"description": "The exchange rate between the currency of the bill and the base currency of the company", "displayName": "Currency Exchange Rate", "required": false, "type": "Number", "validation": {"information": [{"details": "Required if Currency is not the base currency.", "field": "CurrencyRate"}], "warnings": []}}, "supplierRef": {"description": "Reference to the supplier the bill has been received from", "displayName": "Supplier Reference", "required": true, "type": "Object"}, "issueDate": {"description": "The date of the bill as recorded in the originating system.", "displayName": "Issue Date", "required": false, "type": "DateTime", "validation": {"information": [{"details": "If the issue date is not supplied, the current date on the server is used.", "field": "IssueDate"}], "warnings": []}}, "totalAmount": {"description": "The amount of the bill, inclusive of tax", "displayName": "Total Amount", "required": false, "type": "Number"}, "subTotal": {"description": "The total amount of the bill excluding any taxes", "displayName": "Sub Total Amount", "required": false, "type": "Number"}, "paymentAllocations": {"description": "A collection of payments allocated to the bill", "displayName": "Payment Allocations", "required": false, "type": "Array", "validation": {"information": [], "warnings": [{"details": "Payment Allocations are no longer valid for Bills and must not be provided, use the DirectCost data type to push Expenses.", "field": "PaymentAllocations"}]}}, "note": {"description": "Note about the bill", "displayName": "Note", "required": false, "type": "String"}, "lineItems": {"description": "A collection of lines that detail items related to the bill", "displayName": "Line Items", "required": true, "type": "Array"}}, "required": true, "type": "Object"} + Sage 50 (UK): + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + responses: + "200": + application/json: {"description": "A bill is an itemised record of goods purchased from or services provided by a supplier", "displayName": "Bill", "properties": {"issueDate": {"description": "Date when the bill was issued.", "displayName": "Date", "required": true, "type": "DateTime"}, "dueDate": {"description": "Date when the bill is due.", "displayName": "Due Date", "required": true, "type": "DateTime"}, "currency": {"description": "The currency in which the bill is issued in.", "displayName": "Currency", "required": true, "type": "String", "validation": {"information": [], "warnings": [{"details": "This must match the supplier's default currency.", "field": "currency"}]}}, "status": {"description": "The status of the bill", "displayName": "Status", "options": [{"displayName": "Open", "required": false, "type": "String", "value": "Open"}], "required": false, "type": "String", "validation": {"information": [{"details": "If this is not set, it will default to 'Open'.", "field": "status"}], "warnings": []}}, "supplierRef": {"description": "Supplier on the bill.", "displayName": "Supplier", "required": true, "type": "Object"}, "reference": {"description": "The reference to the bill.", "displayName": "Bill Reference", "required": false, "type": "String", "validation": {"information": [], "warnings": [{"details": "Max length of 30 characters.", "field": "reference"}]}}, "note": {"description": "To be used for any additional information associated with the Bill line item.", "displayName": "Note", "required": false, "type": "String", "validation": {"information": [], "warnings": [{"details": "Maximum 60 characters", "field": "note"}]}}, "lineItems": {"description": "Line items of the bill.", "displayName": "Line Items", "required": true, "type": "Array"}}, "required": true, "type": "Object", "validation": {"information": [{"details": "Pushing to Sage 50 2015 (v21) or below is not supported. To enable push, please upgrade to at least Sage 50 2016 (v22) and re-sync the company."}], "warnings": []}} + Sage Business Cloud Accounting: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + responses: + "200": + application/json: {"description": "A bill is an itemised record of goods purchased from or services provided by a supplier", "displayName": "Bill", "properties": {"issueDate": {"description": "The date of the bill as recorded in the originating system.", "displayName": "Issue Date", "required": true, "type": "DateTime", "validation": {"information": [{"details": "Must be provided.", "field": "IssueDate"}], "warnings": []}}, "dueDate": {"description": "The date the bill is due to be paid by", "displayName": "Due Date", "required": true, "type": "DateTime", "validation": {"information": [{"details": "Must be provided.", "field": "DueDate"}], "warnings": []}}, "supplierRef": {"description": "Reference to the supplier the bill has been received from", "displayName": "Supplier Reference", "required": true, "type": "Object"}, "currency": {"description": "Currency of the bill", "displayName": "Currency", "required": false, "type": "String", "validation": {"information": [{"details": "If supplied, must match the currency of the supplier.", "field": "Currency"}], "warnings": []}}, "currencyRate": {"description": "The exchange rate between the currency of the bill and the base currency of the company", "displayName": "Currency Exchange Rate", "required": false, "type": "Number"}, "reference": {"description": "User friendly reference for the bill", "displayName": "Reference", "required": false, "type": "String", "validation": {"information": [], "warnings": [{"details": "Should not be longer than 25 characters.", "field": "Reference"}]}}, "note": {"description": "Note about the bill", "displayName": "Note", "required": false, "type": "String", "validation": {"information": [], "warnings": [{"details": "Should not be longer than 2000 characters.", "field": "Note"}]}}, "lineItems": {"description": "A collection of lines that detail items related to the bill", "displayName": "Line Items", "required": true, "type": "Array"}}, "required": true, "type": "Object"} + Sage Intacct: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + responses: + "200": + application/json: {"description": "A bill is an itemised record of goods purchased from or services provided by a supplier", "displayName": "Bill", "properties": {"id": {"description": "The identifier for the bill, unique for the company", "displayName": "Identifier", "required": false, "type": "String", "validation": {"information": [], "warnings": [{"details": "Not supported for account based line items. Required for item based line items. A unique number for the bill will be appended to the value supplied, to ensure the ID is unique.", "field": "Id"}]}}, "reference": {"description": "User friendly reference for the bill", "displayName": "Reference", "required": true, "type": "String", "validation": {"information": [], "warnings": [{"details": "For account based line items, must be between 1 and 100 characters. For item based line items, must be between 1 and 45 characters.", "field": "Reference"}]}}, "supplierRef": {"description": "Reference to the supplier the bill has been received from", "displayName": "Supplier Reference", "required": true, "type": "Object"}, "issueDate": {"description": "The date of the bill as recorded in the originating system.", "displayName": "Issue Date", "required": true, "type": "DateTime"}, "dueDate": {"description": "The date the bill is due to be paid by", "displayName": "Due Date", "required": false, "type": "DateTime", "validation": {"information": [], "warnings": [{"details": "For item based line items, must be provided and must not be earlier than IssueDate.", "field": "DueDate"}]}}, "currency": {"description": "Currency of the bill", "displayName": "Currency", "options": [{"displayName": "Australian Dollar", "required": false, "type": "String", "value": "AUD"}, {"displayName": "Canadian Dollar", "required": false, "type": "String", "value": "CAD"}, {"displayName": "Pound Sterling", "required": false, "type": "String", "value": "GBP"}, {"displayName": "US Dollar", "required": false, "type": "String", "value": "USD"}, {"displayName": "Rand", "required": false, "type": "String", "value": "ZAR"}], "required": false, "type": "String", "validation": {"information": [], "warnings": [{"details": "Must be provided if CurrencyRate is set.", "field": "Currency"}]}}, "currencyRate": {"description": "The exchange rate between the currency of the bill and the base currency of the company", "displayName": "Currency Exchange Rate", "required": false, "type": "Number", "validation": {"information": [], "warnings": [{"details": "Must be greater than 0.", "field": "CurrencyRate"}]}}, "note": {"description": "Note about the bill", "displayName": "Note", "required": false, "type": "String", "validation": {"information": [], "warnings": [{"details": "Is not supported for item based line items.", "field": "Note"}]}}, "status": {"description": "The current state of the bill", "displayName": "Bill Status", "required": false, "type": "String", "validation": {"information": [], "warnings": [{"details": "Must be provided for item based line items.", "field": "Status"}]}}, "lineItems": {"description": "A collection of lines that detail items related to the bill", "displayName": "Line Items", "required": true, "type": "Array", "validation": {"information": [], "warnings": [{"details": "Must either all be account based or all be item based.", "field": "LineItems"}]}}}, "required": true, "type": "Object"} + Sandbox: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + responses: + "200": + application/json: {"description": "A bill is an itemised record of goods purchased from or services provided by a supplier", "displayName": "Bill", "properties": {"reference": {"description": "User friendly reference for the bill", "displayName": "Reference", "required": true, "type": "String"}, "supplierRef": {"description": "Reference to the supplier the bill has been received from", "displayName": "Supplier Reference", "required": true, "type": "Object"}, "purchaseOrderRefs": {"description": "List of References to the purchase order the bill was created from.", "displayName": "Purchase Order References", "required": true, "type": "Array"}, "issueDate": {"description": "The date of the bill as recorded in the originating system.", "displayName": "Issue Date", "required": true, "type": "DateTime"}, "dueDate": {"description": "The date the bill is due to be paid by", "displayName": "Due Date", "required": true, "type": "DateTime"}, "currency": {"description": "Currency of the bill", "displayName": "Currency", "required": true, "type": "String"}, "currencyRate": {"description": "The exchange rate between the currency of the bill and the base currency of the company", "displayName": "Currency Exchange Rate", "required": true, "type": "Number"}, "lineItems": {"description": "A collection of lines that detail items related to the bill", "displayName": "Line Items", "required": true, "type": "Array"}, "withholdingTax": {"description": "A collection of tax deductions", "displayName": "Withholding Tax", "required": true, "type": "Array"}, "status": {"description": "The current state of the bill", "displayName": "Bill Status", "required": true, "type": "String"}, "subTotal": {"description": "The total amount of the bill excluding any taxes", "displayName": "Sub Total Amount", "required": true, "type": "Number"}, "taxAmount": {"description": "The total amount of tax on the bill", "displayName": "Tax Amount", "required": true, "type": "Number"}, "totalAmount": {"description": "The amount of the bill, inclusive of tax", "displayName": "Total Amount", "required": true, "type": "Number"}, "amountDue": {"description": "The amount outstanding on the bill", "displayName": "Amount Due", "required": true, "type": "Number"}, "note": {"description": "Note about the bill", "displayName": "Note", "required": true, "type": "String"}, "paymentAllocations": {"description": "A collection of payments allocated to the bill", "displayName": "Payment Allocations", "required": true, "type": "Array"}, "metadata": {"description": "Miscellaneous data about the item", "displayName": "Metadata", "required": true, "type": "Object"}}, "required": true, "type": "Object"} + Xero: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + responses: + "200": + application/json: {"description": "A bill is an itemised record of goods purchased from or services provided by a supplier", "displayName": "Bill", "properties": {"issueDate": {"description": "The date of the bill as recorded in the originating system.", "displayName": "Issue Date", "required": true, "type": "DateTime", "validation": {"information": [{"details": "Must be provided.", "field": "IssueDate"}], "warnings": []}}, "dueDate": {"description": "The date the bill is due to be paid by", "displayName": "Due Date", "required": true, "type": "DateTime", "validation": {"information": [{"details": "Must be provided.", "field": "DueDate"}], "warnings": []}}, "currency": {"description": "Currency of the bill", "displayName": "Currency", "required": false, "type": "String"}, "reference": {"description": "User friendly reference for the bill", "displayName": "Reference", "required": false, "type": "String", "validation": {"information": [{"details": "Must not exceed 255 charaters long.", "field": "Reference"}], "warnings": []}}, "currencyRate": {"description": "The exchange rate between the currency of the bill and the base currency of the company", "displayName": "Currency Exchange Rate", "required": false, "type": "Number", "validation": {"information": [{"details": "If no rate is specified, the Xero day rate will be applied.", "field": "CurrencyRate", "ref": "https://central.xero.com/s/#CurrencySettings$Rates"}], "warnings": []}}, "supplierRef": {"description": "Reference to the supplier the bill has been received from", "displayName": "Supplier Reference", "required": true, "type": "Object", "validation": {"information": [{"details": "Must be provided.", "field": "SupplierRef"}], "warnings": []}}, "status": {"description": "The current state of the bill", "displayName": "Bill Status", "options": [{"displayName": "Open", "required": false, "type": "String", "value": "Open"}, {"displayName": "Draft", "required": false, "type": "String", "value": "Draft"}], "required": true, "type": "String", "validation": {"information": [{"details": "Must be provided.", "field": "Status"}], "warnings": []}}, "lineItems": {"description": "A collection of lines that detail items related to the bill", "displayName": "Line Items", "required": true, "type": "Array", "validation": {"information": [{"details": "Must be provided.", "field": "LineItems"}], "warnings": []}}}, "required": true, "type": "Object"} + Zoho Books: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + responses: + "200": + application/json: {"description": "A bill is an itemised record of goods purchased from or services provided by a supplier", "displayName": "Bill", "properties": {"supplierRef": {"description": "Reference to the supplier the bill has been received from", "displayName": "Supplier Reference", "required": true, "type": "Object"}, "reference": {"description": "User friendly reference for the bill", "displayName": "Reference", "required": true, "type": "String"}, "issueDate": {"description": "The date of the bill as recorded in the originating system.", "displayName": "Issue Date", "required": true, "type": "DateTime"}, "dueDate": {"description": "The date the bill is due to be paid by", "displayName": "Due Date", "required": true, "type": "DateTime"}, "currency": {"description": "Currency of the bill", "displayName": "Currency", "required": true, "type": "String", "validation": {"information": [], "warnings": [{"details": "Must match the supplier's currency", "field": "Currency"}]}}, "currencyRate": {"description": "The exchange rate between the currency of the bill and the base currency of the company", "displayName": "Currency Exchange Rate", "required": false, "type": "Number", "validation": {"information": [], "warnings": [{"details": "Must be greater than or equal to 0", "field": "CurrencyRate"}]}}, "note": {"description": "Note about the bill", "displayName": "Note", "required": false, "type": "String"}, "lineItems": {"description": "A collection of lines that detail items related to the bill", "displayName": "Line Items", "required": true, "type": "Array", "validation": {"information": [], "warnings": [{"details": "The sum of subtotals over all the line items must be greater than or equal to 0", "field": "LineItems"}, {"details": "Must not be empty", "field": "LineItems"}]}}, "status": {"description": "The current state of the bill", "displayName": "Bill Status", "options": [{"displayName": "Open", "required": false, "type": "String", "value": "Open"}, {"displayName": "Void", "required": false, "type": "String", "value": "Void"}], "required": true, "type": "String"}}, "required": true, "type": "Object"} + Unauthorized: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + responses: + "401": + application/json: {"canBeRetried": "Unknown", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "detailedErrorCode": 0, "error": "Unauthorized", "service": "PublicApi", "statusCode": 401} + list-bills: + "": + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/{id}/data/{dataType}?page=1&pageSize=10"}, "self": {"href": "/companies/{id}/data/{dataType}"}}, "pageNumber": 1, "pageSize": 10, "results": [{"currency": "USD", "dueDate": "2022-10-23T00:00:00Z", "issueDate": "2022-10-23T00:00:00Z", "modifiedDate": "2022-10-23T00:00:00Z", "paymentAllocations": [], "sourceModifiedDate": "2022-10-23T00:00:00Z", "status": "Paid", "subTotal": "175.77", "taxAmount": "7183.03", "totalAmount": "861.40"}, {"currency": "GBP", "dueDate": "2022-10-23T00:00:00Z", "issueDate": "2022-10-23T00:00:00Z", "modifiedDate": "2022-10-23T00:00:00Z", "paymentAllocations": [], "sourceModifiedDate": "2022-10-23T00:00:00Z", "status": "PartiallyPaid", "subTotal": "4857.29", "taxAmount": "732.28", "totalAmount": "9311.64"}, {"currency": "USD", "dueDate": "2022-10-23T00:00:00Z", "issueDate": "2022-10-23T00:00:00Z", "modifiedDate": "2022-10-23T00:00:00Z", "paymentAllocations": [{"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP"}, "payment": {"currency": "EUR", "paidOnDate": "2022-10-23T00:00:00Z"}}], "sourceModifiedDate": "2022-10-23T00:00:00Z", "status": "Open", "subTotal": "750.58", "taxAmount": "8970.69", "totalAmount": "1355.72"}], "totalResults": 1} + "400": {} + Clear Books: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/354a121b-855f-4d25-90ad-0905b498c1c0/data/bills?page=1&pageSize=2"}, "next": {"href": "/companies/354a121b-855f-4d25-90ad-0905b498c1c0/data/bills?page=2&pageSize=2"}, "self": {"href": "/companies/354a121b-855f-4d25-90ad-0905b498c1c0/data/bills"}}, "pageNumber": 1, "pageSize": 2, "results": [{"amountDue": 0, "currency": "GBP", "currencyRate": 1, "dueDate": "2022-05-06T00:00:00", "id": "81539597-e681-40c9-a4dd-ec2fffcde572", "issueDate": "2022-04-29T00:00:00", "lineItems": [{"accountRef": {"id": "72df89d2-512b-4455-af51-a6b563733842", "name": "Sales"}, "description": "Grease Trap", "discountAmount": 0, "discountPercentage": 0, "isDirectCost": false, "itemRef": {"id": "22aee6bd-4767-48c4-8a13-fdf85b91fc80", "name": "600 Litre Grease Trap"}, "quantity": 5, "subTotal": 13909.7, "taxAmount": 1390.97, "taxRateRef": {"effectiveTaxRate": 10, "id": "6c88aff3-7cb9-4980-a3d3-443e72e02498", "name": "Sales Tax (10%)"}, "totalAmount": 15300.67, "trackingCategoryRefs": [], "unitAmount": 2781.94}, {"accountRef": {"id": "72df89d2-512b-4455-af51-a6b563733842", "name": "Sales"}, "description": "Grease Trap", "discountAmount": 0, "discountPercentage": 0, "isDirectCost": false, "itemRef": {"id": "9409d23d-1011-432e-98a4-591fcd8d5404", "name": "300 Litre Grease Trap"}, "quantity": 5, "subTotal": 6856.95, "taxAmount": 685.7, "taxRateRef": {"effectiveTaxRate": 10, "id": "6c88aff3-7cb9-4980-a3d3-443e72e02498", "name": "Sales Tax (10%)"}, "totalAmount": 7542.65, "trackingCategoryRefs": [], "unitAmount": 1371.39}, {"accountRef": {"id": "72df89d2-512b-4455-af51-a6b563733842", "name": "Sales"}, "description": "Grease Trap", "discountAmount": 0, "discountPercentage": 0, "isDirectCost": false, "itemRef": {"id": "9409d23d-1011-432e-98a4-591fcd8d5404", "name": "300 Litre Grease Trap"}, "quantity": 6, "subTotal": 8228.34, "taxAmount": 822.83, "taxRateRef": {"effectiveTaxRate": 10, "id": "6c88aff3-7cb9-4980-a3d3-443e72e02498", "name": "Sales Tax (10%)"}, "totalAmount": 9051.17, "trackingCategoryRefs": [], "unitAmount": 1371.39}, {"accountRef": {"id": "72df89d2-512b-4455-af51-a6b563733842", "name": "Sales"}, "description": "Grease Trap", "discountAmount": 0, "discountPercentage": 0, "isDirectCost": false, "itemRef": {"id": "22aee6bd-4767-48c4-8a13-fdf85b91fc80", "name": "600 Litre Grease Trap"}, "quantity": 3, "subTotal": 8345.82, "taxAmount": 834.58, "taxRateRef": {"effectiveTaxRate": 10, "id": "6c88aff3-7cb9-4980-a3d3-443e72e02498", "name": "Sales Tax (10%)"}, "totalAmount": 9180.4, "trackingCategoryRefs": [], "unitAmount": 2781.94}, {"accountRef": {"id": "72df89d2-512b-4455-af51-a6b563733842", "name": "Sales"}, "description": "Underground - Trapped Road Gully 450mm x 450mm", "discountAmount": 0, "discountPercentage": 0, "isDirectCost": false, "itemRef": {"id": "3abf0883-03f7-44c6-bc15-1372522d25e1", "name": "Heavy Duty Hinged Gully Grating"}, "quantity": 8, "subTotal": 3223.12, "taxAmount": 322.31, "taxRateRef": {"effectiveTaxRate": 10, "id": "6c88aff3-7cb9-4980-a3d3-443e72e02498", "name": "Sales Tax (10%)"}, "totalAmount": 3545.43, "trackingCategoryRefs": [], "unitAmount": 402.89}, {"accountRef": {"id": "72df89d2-512b-4455-af51-a6b563733842", "name": "Sales"}, "description": "Underground - Drain Bottle Gullies 90 degree Rectangular", "discountAmount": 0, "discountPercentage": 0, "isDirectCost": false, "itemRef": {"id": "6", "name": "Back Inlet Roddable Gully 90� Outlet Rectangular Grid"}, "quantity": 7, "subTotal": 665.56, "taxAmount": 66.56, "taxRateRef": {"effectiveTaxRate": 10, "id": "6c88aff3-7cb9-4980-a3d3-443e72e02498", "name": "Sales Tax (10%)"}, "totalAmount": 732.12, "trackingCategoryRefs": [], "unitAmount": 95.08}, {"accountRef": {"id": "72df89d2-512b-4455-af51-a6b563733842", "name": "Sales"}, "description": "Underground - Drain Bottle Gullies 90 degree Rectangular", "discountAmount": 0, "discountPercentage": 0, "isDirectCost": false, "itemRef": {"id": "6", "name": "Back Inlet Roddable Gully 90� Outlet Rectangular Grid"}, "quantity": 1, "subTotal": 95.08, "taxAmount": 9.51, "taxRateRef": {"effectiveTaxRate": 10, "id": "6c88aff3-7cb9-4980-a3d3-443e72e02498", "name": "Sales Tax (10%)"}, "totalAmount": 104.59, "trackingCategoryRefs": [], "unitAmount": 95.08}, {"accountRef": {"id": "72df89d2-512b-4455-af51-a6b563733842", "name": "Sales"}, "description": "Grease Trap", "discountAmount": 0, "discountPercentage": 0, "isDirectCost": false, "itemRef": {"id": "9409d23d-1011-432e-98a4-591fcd8d5404", "name": "300 Litre Grease Trap"}, "quantity": 2, "subTotal": 2742.78, "taxAmount": 274.28, "taxRateRef": {"effectiveTaxRate": 10, "id": "6c88aff3-7cb9-4980-a3d3-443e72e02498", "name": "Sales Tax (10%)"}, "totalAmount": 3017.06, "trackingCategoryRefs": [], "unitAmount": 1371.39}, {"accountRef": {"id": "72df89d2-512b-4455-af51-a6b563733842", "name": "Sales"}, "description": "Grease Trap", "discountAmount": 0, "discountPercentage": 0, "isDirectCost": false, "itemRef": {"id": "22aee6bd-4767-48c4-8a13-fdf85b91fc80", "name": "600 Litre Grease Trap"}, "quantity": 1, "subTotal": 2781.94, "taxAmount": 278.19, "taxRateRef": {"effectiveTaxRate": 10, "id": "6c88aff3-7cb9-4980-a3d3-443e72e02498", "name": "Sales Tax (10%)"}, "totalAmount": 3060.13, "trackingCategoryRefs": [], "unitAmount": 2781.94}, {"accountRef": {"id": "72df89d2-512b-4455-af51-a6b563733842", "name": "Sales"}, "description": "Underground - Drain Bottle Gullies 90 degree Rectangular", "discountAmount": 0, "discountPercentage": 0, "isDirectCost": false, "itemRef": {"id": "6", "name": "Back Inlet Roddable Gully 90� Outlet Rectangular Grid"}, "quantity": 7, "subTotal": 665.56, "taxAmount": 66.56, "taxRateRef": {"effectiveTaxRate": 10, "id": "6c88aff3-7cb9-4980-a3d3-443e72e02498", "name": "Sales Tax (10%)"}, "totalAmount": 732.12, "trackingCategoryRefs": [], "unitAmount": 95.08}, {"accountRef": {"id": "72df89d2-512b-4455-af51-a6b563733842", "name": "Sales"}, "description": "Grease Trap", "discountAmount": 0, "discountPercentage": 0, "isDirectCost": false, "itemRef": {"id": "51077072-d5c3-463b-9cb4-7da2e11886f9", "name": "150 Litre Grease Trap"}, "quantity": 4, "subTotal": 5007.56, "taxAmount": 500.76, "taxRateRef": {"effectiveTaxRate": 10, "id": "6c88aff3-7cb9-4980-a3d3-443e72e02498", "name": "Sales Tax (10%)"}, "totalAmount": 5508.32, "trackingCategoryRefs": [], "unitAmount": 1251.89}, {"accountRef": {"id": "72df89d2-512b-4455-af51-a6b563733842", "name": "Sales"}, "description": "Grease Trap", "discountAmount": 0, "discountPercentage": 0, "isDirectCost": false, "itemRef": {"id": "9409d23d-1011-432e-98a4-591fcd8d5404", "name": "300 Litre Grease Trap"}, "quantity": 9, "subTotal": 12342.51, "taxAmount": 1234.25, "taxRateRef": {"effectiveTaxRate": 10, "id": "6c88aff3-7cb9-4980-a3d3-443e72e02498", "name": "Sales Tax (10%)"}, "totalAmount": 13576.76, "trackingCategoryRefs": [], "unitAmount": 1371.39}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-26T12:38:16Z", "note": "Bill with 12 line items, totaling 71351.42", "paymentAllocations": [{"allocation": {"allocatedOnDate": "2022-05-06T00:00:00", "currency": "GBP", "currencyRate": 1, "totalAmount": -71351.42}, "payment": {"accountRef": {"id": "dbcaf288-2b39-4b95-8ab3-42202ab15918", "name": "Business Current Account"}, "currency": "GBP", "currencyRate": 1, "id": "dcb18480-8b69-44d8-aa26-268b6a80d170", "note": "Bill Payment against bill 81539597-e681-40c9-a4dd-ec2fffcde572", "paidOnDate": "2022-05-06T00:00:00", "totalAmount": 71351.42}}], "purchaseOrderRefs": [], "reference": "b465a2c9-3212-4620-889b-6328ba148215", "sourceModifiedDate": "2023-02-14T17:09:02", "status": "Paid", "subTotal": 64864.92, "supplierRef": {"id": "8GeHBdBZiZ", "supplierName": "DuBuque, Goyette and Franecki"}, "taxAmount": 6486.5, "totalAmount": 71351.42, "withholdingTax": []}, {"amountDue": 0, "currency": "GBP", "currencyRate": 1, "dueDate": "2022-05-15T00:00:00", "id": "acc1dc9d-a21a-41b8-953e-73da4afab6e6", "issueDate": "2022-04-30T00:00:00", "lineItems": [{"accountRef": {"id": "72df89d2-512b-4455-af51-a6b563733842", "name": "Sales"}, "description": "Underground - Drain Bottle Gullies 90 degree Rectangular", "discountAmount": 0, "discountPercentage": 0, "isDirectCost": false, "itemRef": {"id": "6", "name": "Back Inlet Roddable Gully 90� Outlet Rectangular Grid"}, "quantity": 4, "subTotal": 380.32, "taxAmount": 38.03, "taxRateRef": {"effectiveTaxRate": 10, "id": "6c88aff3-7cb9-4980-a3d3-443e72e02498", "name": "Sales Tax (10%)"}, "totalAmount": 418.35, "trackingCategoryRefs": [], "unitAmount": 95.08}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-26T12:38:16Z", "note": "Bill for purchase order ee9b8e00-49a2-4d83-bc33-e2eee59a1c36", "paymentAllocations": [{"allocation": {"allocatedOnDate": "2022-05-15T00:00:00", "currency": "GBP", "currencyRate": 1, "totalAmount": -418.35}, "payment": {"accountRef": {"id": "dbcaf288-2b39-4b95-8ab3-42202ab15918", "name": "Business Current Account"}, "currency": "GBP", "currencyRate": 1, "id": "a4fa017a-3911-4eb0-aaf9-b002c446c8c3", "note": "Bill Payment against bill acc1dc9d-a21a-41b8-953e-73da4afab6e6", "paidOnDate": "2022-05-15T00:00:00", "totalAmount": 418.35}}], "purchaseOrderRefs": [{"id": "7f07b584-bebe-450f-aa9e-1d7aed630b66", "purchaseOrderNumber": "ee9b8e00-49a2-4d83-bc33-e2eee59a1c36"}], "reference": "d88e83b8-a5cc-4578-815d-afa263df4beb", "sourceModifiedDate": "2023-04-14T01:56:02", "status": "Paid", "subTotal": 380.32, "supplierRef": {"id": "7GObELDcsE", "supplierName": "Lakin, Schmeler and Kihn"}, "taxAmount": 38.03, "totalAmount": 418.35, "withholdingTax": []}], "totalResults": 183} + Dynamics 365 Business Central: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/d6849caf-c146-41be-8335-b73346e3bd84/data/bills?page=1&pageSize=2"}, "next": {"href": "/companies/d6849caf-c146-41be-8335-b73346e3bd84/data/bills?page=2&pageSize=2"}, "self": {"href": "/companies/d6849caf-c146-41be-8335-b73346e3bd84/data/bills"}}, "pageNumber": 1, "pageSize": 2, "results": [{"amountDue": 2188.51, "currency": "GBP", "dueDate": "2019-01-01T00:00:00", "id": "4019ee2b-d05a-ed11-8c34-000d3a0d28a2-108276", "issueDate": "2019-01-01T00:00:00", "lineItems": [{"accountRef": {"id": "6a1217b3-89d1-ea11-bbaa-000d3a2b9185", "name": "Inventory"}, "description": "ATHENS Desk", "discountAmount": 202.64, "discountPercentage": 10, "isDirectCost": false, "itemRef": {"id": "ITEM-c81217b3-89d1-ea11-bbaa-000d3a2b9185-DOMESTIC-DOMESTIC", "name": "ATHENS Desk / General Business Posting Group: 'DOMESTIC' / VAT Business Posting Group: 'DOMESTIC'"}, "quantity": 4, "subTotal": 1823.76, "taxAmount": 364.75, "taxRateRef": {"effectiveTaxRate": 10, "id": "63bc0fb9-89d1-ea11-bbaa-000d3a2b9185", "name": "Setup for DOMESTIC / STANDARD"}, "totalAmount": 2188.51, "trackingCategoryRefs": [], "unitAmount": 506.6}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-27T14:21:25Z", "note": "129148", "paymentAllocations": [], "purchaseOrderRefs": [], "reference": "108276", "sourceModifiedDate": "2022-11-02T17:02:48Z", "status": "Open", "subTotal": 1823.76, "supplierRef": {"id": "c01217b3-89d1-ea11-bbaa-000d3a2b9185", "supplierName": "First Up Consultants"}, "taxAmount": 364.75, "totalAmount": 2188.51, "withholdingTax": []}, {"amountDue": 0, "currency": "GBP", "dueDate": "2019-01-01T00:00:00", "id": "b9cb06bf-89d1-ea11-bbaa-000d3a2b9185-108001", "issueDate": "2019-01-01T00:00:00", "lineItems": [{"accountRef": {"id": "6a1217b3-89d1-ea11-bbaa-000d3a2b9185", "name": "Inventory"}, "description": "ATHENS Desk", "discountAmount": 0, "discountPercentage": 0, "isDirectCost": false, "itemRef": {"id": "ITEM-c81217b3-89d1-ea11-bbaa-000d3a2b9185-DOMESTIC-DOMESTIC", "name": "ATHENS Desk / General Business Posting Group: 'DOMESTIC' / VAT Business Posting Group: 'DOMESTIC'"}, "quantity": 4, "subTotal": 2026.4, "taxAmount": 405.28, "taxRateRef": {"effectiveTaxRate": 10, "id": "63bc0fb9-89d1-ea11-bbaa-000d3a2b9185", "name": "Setup for DOMESTIC / STANDARD"}, "totalAmount": 2431.68, "trackingCategoryRefs": [], "unitAmount": 506.6}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-27T14:21:25Z", "note": "107001", "paymentAllocations": [{"allocation": {"allocatedOnDate": "2019-01-01T00:00:00", "currency": "GBP", "currencyRate": 1, "totalAmount": -2431.68}, "payment": {"accountRef": {"id": "621217b3-89d1-ea11-bbaa-000d3a2b9185", "name": "Petty Cash"}, "currency": "GBP", "currencyRate": 1, "id": "57377f05-8ad1-ea11-bbaa-000d3a2b9185", "note": "Invoice 107001", "paidOnDate": "2019-01-01T00:00:00", "reference": "108001", "totalAmount": 2431.68}}], "purchaseOrderRefs": [], "reference": "108001", "sourceModifiedDate": "2022-05-17T16:29:02Z", "status": "Paid", "subTotal": 2026.4, "supplierRef": {"id": "c01217b3-89d1-ea11-bbaa-000d3a2b9185", "supplierName": "First Up Consultants"}, "taxAmount": 405.28, "totalAmount": 2431.68, "withholdingTax": []}], "totalResults": 294} + Exact (Netherlands): + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/b83b1923-4db6-45a8-a779-b4e320c15979/data/bills?page=1&pageSize=2"}, "next": {"href": "/companies/b83b1923-4db6-45a8-a779-b4e320c15979/data/bills?page=2&pageSize=2"}, "self": {"href": "/companies/b83b1923-4db6-45a8-a779-b4e320c15979/data/bills"}}, "pageNumber": 1, "pageSize": 2, "results": [{"amountDue": 0, "currency": "EUR", "currencyRate": 1, "dueDate": "2019-11-09T00:00:00Z", "id": "1c55118b-793e-4437-9c13-4f554b9ca989", "issueDate": "2019-12-16T00:00:00Z", "lineItems": [{"accountRef": {"id": "5f139759-b554-4314-862e-b9d88e5b2e1b", "name": "Af te dragen loonheffing"}, "description": "Cheesecake", "discountAmount": 0, "isDirectCost": false, "quantity": 1, "subTotal": 10, "taxAmount": 2.1, "taxRateRef": {"effectiveTaxRate": 21, "id": "84277189-ad16-456c-b501-ca31f0a483cc", "name": "BTW prive gebruik"}, "totalAmount": 12.1, "trackingCategoryRefs": [], "unitAmount": 10}], "modifiedDate": "2022-10-26T13:32:18Z", "paymentAllocations": [{"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "EUR", "currencyRate": 1, "totalAmount": -12.1}, "payment": {"accountRef": {"id": "d79d65bd-1d7d-4f55-95d3-76b3a7b7b823", "name": "Bank 1"}, "currency": "EUR", "currencyRate": 1, "id": "d9a2980b-2a43-46f2-9c7f-413d925b3cdd", "paidOnDate": "2021-03-22T00:00:00", "reference": "20200032", "totalAmount": 12.1}}], "purchaseOrderRefs": [], "reference": "19600006", "sourceModifiedDate": "2020-01-03T15:06:02Z", "status": "Paid", "subTotal": 10, "supplierRef": {"id": "5e6f49b9-6489-4b82-83e7-291d308919bb", "supplierName": "Mickey Mouse"}, "taxAmount": 2.1, "totalAmount": 12.1, "withholdingTax": []}, {"amountDue": 12.1, "currency": "EUR", "currencyRate": 1, "dueDate": "2019-11-09T00:00:00Z", "id": "ec0c61a1-deb6-4496-b9ee-feb29b16019c", "issueDate": "2019-12-16T00:00:00Z", "lineItems": [{"accountRef": {"id": "5f139759-b554-4314-862e-b9d88e5b2e1b", "name": "Af te dragen loonheffing"}, "description": "Cheesecake", "discountAmount": 0, "isDirectCost": false, "quantity": 1, "subTotal": 10, "taxAmount": 2.1, "taxRateRef": {"effectiveTaxRate": 21, "id": "84277189-ad16-456c-b501-ca31f0a483cc", "name": "BTW prive gebruik"}, "totalAmount": 12.1, "trackingCategoryRefs": [], "unitAmount": 10}], "modifiedDate": "2022-10-26T13:32:18Z", "paymentAllocations": [{"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "EUR", "currencyRate": 1, "totalAmount": -0.21}, "payment": {"accountRef": {"id": "a2d51b6f-677d-4bbf-ad0c-b45fd6231546", "name": "Activa herwaarderingen"}, "currency": "EUR", "currencyRate": 1, "id": "ef5d140b-16da-4fd2-a0c8-d5bfb89a13ee", "paidOnDate": "2019-11-07T00:00:00", "reference": "19900056", "totalAmount": 0.21}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "EUR", "currencyRate": 1, "totalAmount": -0.2}, "payment": {"accountRef": {"id": "a2d51b6f-677d-4bbf-ad0c-b45fd6231546", "name": "Activa herwaarderingen"}, "currency": "EUR", "currencyRate": 1, "id": "b69e7ad4-2b90-4a5f-a8a0-67418ac95531", "paidOnDate": "2019-11-07T00:00:00", "reference": "19900053", "totalAmount": 0.2}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "EUR", "currencyRate": 1, "totalAmount": -12.1}, "payment": {"accountRef": {"id": "d79d65bd-1d7d-4f55-95d3-76b3a7b7b823", "name": "Bank 1"}, "currency": "EUR", "currencyRate": 1, "id": "6ccd1256-6073-4bfc-8d88-700417685e72", "paidOnDate": "2021-10-05T00:00:00", "reference": "21200028", "totalAmount": 12.1}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "EUR", "currencyRate": 1, "totalAmount": -0.21}, "payment": {"accountRef": {"id": "a2d51b6f-677d-4bbf-ad0c-b45fd6231546", "name": "Activa herwaarderingen"}, "currency": "EUR", "currencyRate": 1, "id": "69a8533b-3e59-4d2d-9bca-bc37bc0f7984", "paidOnDate": "2019-11-07T00:00:00", "reference": "19900055", "totalAmount": 0.21}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "EUR", "currencyRate": 1, "totalAmount": -0.21}, "payment": {"accountRef": {"id": "a2d51b6f-677d-4bbf-ad0c-b45fd6231546", "name": "Activa herwaarderingen"}, "currency": "EUR", "currencyRate": 1, "id": "2dae3548-ff11-4ad8-886c-eb5cb7965024", "paidOnDate": "2019-11-07T00:00:00", "reference": "19900054", "totalAmount": 0.21}}], "purchaseOrderRefs": [], "reference": "19600008", "sourceModifiedDate": "2020-01-03T15:06:39Z", "status": "Open", "subTotal": 10, "supplierRef": {"id": "fc189bfa-f083-438c-bf09-379a0631d4a1", "supplierName": "Mickey Mouse"}, "taxAmount": 2.1, "totalAmount": 12.1, "withholdingTax": []}], "totalResults": 80} + Exact (UK): + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/d95030cd-22b2-482b-9c7b-2980dcc2b1ce/data/bills?page=1&pageSize=2"}, "next": {"href": "/companies/d95030cd-22b2-482b-9c7b-2980dcc2b1ce/data/bills?page=2&pageSize=2"}, "self": {"href": "/companies/d95030cd-22b2-482b-9c7b-2980dcc2b1ce/data/bills"}}, "pageNumber": 1, "pageSize": 2, "results": [{"amountDue": 0, "currency": "GBP", "currencyRate": 1, "dueDate": "2017-10-26T00:00:00Z", "id": "e7a45898-2db3-424c-acb9-a51647740f26", "issueDate": "2017-09-26T00:00:00Z", "lineItems": [{"accountRef": {"id": "e5e9e994-0f14-4614-b162-7b5593b21276", "name": "Finished Goods Stock"}, "description": "Stationery", "discountAmount": 0, "isDirectCost": false, "itemRef": {"id": "001"}, "quantity": 2, "subTotal": 800, "taxAmount": 160, "taxRateRef": {"effectiveTaxRate": 20, "id": "63cd143a-66ab-4320-8a6d-ab6be85ed048", "name": "UK purchases standard rate � Excluding"}, "totalAmount": 960, "trackingCategoryRefs": [], "unitAmount": 400}], "modifiedDate": "2022-10-26T13:33:20Z", "paymentAllocations": [{"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -123}, "payment": {"accountRef": {"id": "4a4e34b5-7f62-4b64-a44a-073398b14b41", "name": "Bank"}, "currency": "GBP", "currencyRate": 1, "id": "7a5f621b-739f-4ed8-b738-2aae3ef886ac", "paidOnDate": "2017-10-11T00:00:00", "reference": "17200006", "totalAmount": 123}}], "purchaseOrderRefs": [], "reference": "17600002", "sourceModifiedDate": "2019-01-11T14:18:17Z", "status": "Paid", "subTotal": 800, "supplierRef": {"id": "a7cad20d-44db-442b-ac1f-90475802d6fb", "supplierName": "Pencils Pencils Pencils"}, "taxAmount": 160, "totalAmount": 960, "withholdingTax": []}, {"amountDue": 0, "currency": "GBP", "currencyRate": 1, "dueDate": "2019-02-10T00:00:00Z", "id": "064fbab9-9b4d-4e83-b2df-0f4ce12bc2bf", "issueDate": "2019-01-11T00:00:00Z", "lineItems": [{"accountRef": {"id": "885ff551-664d-451b-995b-cb114c9877d0", "name": "Unallocated Cash"}, "description": "Basket balls", "discountAmount": 0, "isDirectCost": false, "itemRef": {"id": "23"}, "quantity": 1, "subTotal": 20, "taxAmount": 0, "totalAmount": 20, "trackingCategoryRefs": [], "unitAmount": 20}], "modifiedDate": "2022-10-26T13:33:20Z", "paymentAllocations": [{"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -20}, "payment": {"accountRef": {"id": "4a4e34b5-7f62-4b64-a44a-073398b14b41", "name": "Bank"}, "currency": "GBP", "currencyRate": 1, "id": "d871f677-c2df-4069-bda0-c6804a46b71b", "paidOnDate": "2019-02-10T00:00:00", "reference": "19200001", "totalAmount": 20}}], "purchaseOrderRefs": [], "reference": "19600001", "sourceModifiedDate": "2019-01-11T12:03:31Z", "status": "Paid", "subTotal": 20, "supplierRef": {"id": "a4d5d739-c979-4819-b0ce-666db1ec3a7d", "supplierName": "Exact Software (UK) Ltd � Exact Online"}, "taxAmount": 0, "totalAmount": 20, "withholdingTax": []}], "totalResults": 83} + FreeAgent: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/071ad738-68f3-4561-afd0-69bab9df0803/data/bills?page=1&pageSize=2"}, "next": {"href": "/companies/071ad738-68f3-4561-afd0-69bab9df0803/data/bills?page=2&pageSize=2"}, "self": {"href": "/companies/071ad738-68f3-4561-afd0-69bab9df0803/data/bills"}}, "pageNumber": 1, "pageSize": 2, "results": [{"amountDue": 150, "currency": "GBP", "dueDate": "2018-09-20T00:00:00", "id": "16609552", "issueDate": "2014-08-21T00:00:00", "lineItems": [{"accountRef": {"id": "285", "name": "Accommodation and Meals"}, "isDirectCost": false, "quantity": 1, "taxAmount": 25, "totalAmount": 150, "trackingCategoryRefs": [], "unitAmount": 125}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-25T14:19:10Z", "paymentAllocations": [], "purchaseOrderRefs": [], "reference": "MATT - U", "sourceModifiedDate": "2020-11-11T12:48:55Z", "status": "Open", "subTotal": 125, "supplierRef": {"id": "7169654", "supplierName": "The Eagle"}, "taxAmount": 25, "totalAmount": 150, "withholdingTax": []}, {"amountDue": 150, "currency": "GBP", "dueDate": "2018-09-20T00:00:00", "id": "16609589", "issueDate": "2014-08-21T00:00:00", "lineItems": [{"accountRef": {"id": "285", "name": "Accommodation and Meals"}, "isDirectCost": false, "quantity": 1, "taxAmount": 25, "totalAmount": 150, "trackingCategoryRefs": [], "unitAmount": 125}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-25T14:19:10Z", "paymentAllocations": [], "purchaseOrderRefs": [], "reference": "MATT - U", "sourceModifiedDate": "2020-11-11T12:50:41Z", "status": "Open", "subTotal": 125, "supplierRef": {"id": "7169654", "supplierName": "The Eagle"}, "taxAmount": 25, "totalAmount": 150, "withholdingTax": []}], "totalResults": 137} + FreshBooks: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/3691c49e-0db4-4172-b3ab-e4084c365013/data/bills?page=1&pageSize=2"}, "next": {"href": "/companies/3691c49e-0db4-4172-b3ab-e4084c365013/data/bills?page=2&pageSize=2"}, "self": {"href": "/companies/3691c49e-0db4-4172-b3ab-e4084c365013/data/bills"}}, "pageNumber": 1, "pageSize": 2, "results": [{"amountDue": 50, "currency": "USD", "dueDate": "2021-05-26T00:00:00", "id": "27", "issueDate": "2021-04-26T00:00:00", "lineItems": [{"accountRef": {"id": "3384197", "name": "Advertising"}, "description": "Grocery", "isDirectCost": false, "quantity": 1, "subTotal": 50, "taxAmount": 0, "totalAmount": 50, "trackingCategoryRefs": [], "unitAmount": 50}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-24T16:07:23Z", "paymentAllocations": [], "purchaseOrderRefs": [], "sourceModifiedDate": "2021-04-26T19:34:22", "status": "Open", "subTotal": 50, "supplierRef": {"id": "87"}, "taxAmount": 0, "totalAmount": 50, "withholdingTax": []}, {"amountDue": 0, "currency": "GBP", "dueDate": "2021-05-28T00:00:00", "id": "29", "issueDate": "2021-04-28T00:00:00", "lineItems": [{"accountRef": {"id": "3384197", "name": "Advertising"}, "description": "Advertising refund", "isDirectCost": false, "quantity": 1, "subTotal": 10, "taxAmount": 0, "totalAmount": 10, "trackingCategoryRefs": [], "unitAmount": 10}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-24T16:07:23Z", "paymentAllocations": [], "purchaseOrderRefs": [], "sourceModifiedDate": "2021-08-18T13:52:33", "status": "Paid", "subTotal": 10, "supplierRef": {"id": "89"}, "taxAmount": 0, "totalAmount": 10, "withholdingTax": []}], "totalResults": 16} + KashFlow: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/3a707a99-89da-4b16-a5d6-595333a16352/data/bills?page=1&pageSize=2"}, "next": {"href": "/companies/3a707a99-89da-4b16-a5d6-595333a16352/data/bills?page=2&pageSize=2"}, "self": {"href": "/companies/3a707a99-89da-4b16-a5d6-595333a16352/data/bills"}}, "pageNumber": 1, "pageSize": 2, "results": [{"amountDue": 0, "currency": "GBP", "currencyRate": 1, "dueDate": "2000-01-01T00:00:00", "id": "97615244", "issueDate": "2000-01-01T00:00:00", "lineItems": [{"accountRef": {"id": "21481884", "name": "Computer equipment cost"}, "description": "", "isDirectCost": false, "itemRef": {"id": "122990246"}, "quantity": 1, "subTotal": 8.33, "taxAmount": 1.67, "totalAmount": 10, "trackingCategoryRefs": [], "unitAmount": 8.33}], "modifiedDate": "2022-09-30T10:29:15Z", "paymentAllocations": [], "purchaseOrderRefs": [], "reference": "25", "sourceModifiedDate": "2022-10-23T00:00:00Z", "status": "Paid", "subTotal": 8.33, "supplierRef": {"id": "9272052", "supplierName": "Supplier man"}, "taxAmount": 1.67, "totalAmount": 10, "withholdingTax": []}, {"amountDue": 0, "currency": "GBP", "currencyRate": 1, "dueDate": "2019-02-27T00:00:00", "id": "76144089", "issueDate": "2019-01-28T00:00:00", "lineItems": [{"accountRef": {"id": "21481820", "name": "Materials purchased"}, "description": "", "isDirectCost": false, "itemRef": {"id": "95293985"}, "quantity": 5, "subTotal": 600, "taxAmount": 0, "totalAmount": 600, "trackingCategoryRefs": [], "unitAmount": 120}], "modifiedDate": "2022-09-30T10:29:15Z", "paymentAllocations": [], "purchaseOrderRefs": [], "reference": "1", "sourceModifiedDate": "2022-10-23T00:00:00Z", "status": "Paid", "subTotal": 600, "supplierRef": {"id": "6202387", "supplierName": "Dell"}, "taxAmount": 0, "totalAmount": 600, "withholdingTax": []}], "totalResults": 19} + Oracle NetSuite: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/d5074b08-6a34-4b06-a742-236edf5dc4f1/data/bills?page=1&pageSize=2"}, "next": {"href": "/companies/d5074b08-6a34-4b06-a742-236edf5dc4f1/data/bills?page=2&pageSize=2"}, "self": {"href": "/companies/d5074b08-6a34-4b06-a742-236edf5dc4f1/data/bills"}}, "pageNumber": 1, "pageSize": 2, "results": [{"amountDue": 24, "currency": "GBP", "currencyRate": 1, "dueDate": "2021-03-26T00:00:00", "id": "7", "issueDate": "2021-03-26T00:00:00", "lineItems": [{"accountRef": {"id": "716", "name": "Inventory In Transit"}, "isDirectCost": false, "quantity": 1, "subTotal": 120, "totalAmount": 120, "tracking": {"categoryRefs": [{"id": "location-4", "name": "Europe"}], "isBilledTo": "Unknown", "isRebilledTo": "Unknown"}, "trackingCategoryRefs": [{"id": "location-4", "name": "Europe"}], "unitAmount": 120, "unitOfMeasurement": "litre"}], "modifiedDate": "2023-01-30T14:47:34Z", "paymentAllocations": [{"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -120}, "payment": {"accountRef": {"id": "825", "name": "Codat Europe Bank"}, "currency": "GBP", "currencyRate": 1, "id": "112", "paidOnDate": "2021-03-26T00:00:00", "reference": "Bill Payment #1", "totalAmount": 120}}], "purchaseOrderRefs": [], "sourceModifiedDate": "2022-07-05T13:38:10", "status": "PartiallyPaid", "subTotal": 120, "supplierRef": {"id": "724", "supplierName": "Vendor A.A.A"}, "taxAmount": 24, "totalAmount": 144, "withholdingTax": []}, {"amountDue": 500, "currency": "GBP", "currencyRate": 1, "dueDate": "2022-07-15T00:00:00", "id": "165372", "issueDate": "2022-07-15T00:00:00", "lineItems": [{"accountRef": {"id": "844", "name": "Asset account test 2"}, "isDirectCost": false, "quantity": 1, "subTotal": 555.78, "totalAmount": 555.78, "tracking": {"categoryRefs": [{"id": "location-4", "name": "Europe"}], "isBilledTo": "Unknown", "isRebilledTo": "Unknown"}, "trackingCategoryRefs": [{"id": "location-4", "name": "Europe"}], "unitAmount": 555.78}], "modifiedDate": "2023-01-30T14:47:34Z", "paymentAllocations": [{"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -55.78}, "payment": {"accountRef": {"id": "825", "name": "Codat Europe Bank"}, "currency": "GBP", "currencyRate": 1, "id": "165373", "paidOnDate": "2022-07-15T00:00:00", "reference": "Bill Payment #2", "totalAmount": 555.78}}], "purchaseOrderRefs": [], "sourceModifiedDate": "2022-07-15T11:35:47", "status": "PartiallyPaid", "subTotal": 555.78, "supplierRef": {"id": "724", "supplierName": "Vendor A.A.A"}, "taxAmount": 0, "totalAmount": 555.78, "withholdingTax": []}], "totalResults": 3} + QuickBooks Desktop: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/fc72ba08-af13-4474-b28a-01dcfa6cfb51/data/bills?page=1&pageSize=2"}, "next": {"href": "/companies/fc72ba08-af13-4474-b28a-01dcfa6cfb51/data/bills?page=2&pageSize=2"}, "self": {"href": "/companies/fc72ba08-af13-4474-b28a-01dcfa6cfb51/data/bills"}}, "pageNumber": 1, "pageSize": 2, "results": [{"amountDue": 0, "currency": "GBP", "currencyRate": 1, "dueDate": "2024-01-01T00:00:00", "id": "3691-1071520776", "issueDate": "2022-12-02T00:00:00", "lineItems": [{"accountRef": {"id": "C0000-933270541", "name": "Accounts Payable"}, "description": "Cabinets:Light Pine - Light pine kitchen cabinet wall unit \n#CLD- 1235-p", "discountAmount": 0, "discountPercentage": 0, "isDirectCost": false, "itemRef": {"id": "110000-933272656", "name": "Cabinets:Light Pine"}, "quantity": 5, "subTotal": 7500, "taxAmount": 0, "totalAmount": 7500, "tracking": {"categoryRefs": [{"id": "10000-933272658", "name": "New Construction"}], "isBilledTo": "Unknown", "isRebilledTo": "Unknown"}, "trackingCategoryRefs": [{"id": "10000-933272658", "name": "New Construction"}], "unitAmount": 1500}, {"accountRef": {"id": "C0000-933270541", "name": "Accounts Payable"}, "description": "Hardware:Doorknobs Std - Doorknobs Part # DK 3704", "discountAmount": 0, "discountPercentage": 0, "isDirectCost": false, "itemRef": {"id": "130000-933272656", "name": "Hardware:Doorknobs Std"}, "quantity": 100, "subTotal": 2700, "taxAmount": 0, "totalAmount": 2700, "tracking": {"categoryRefs": [{"id": "10000-933272658", "name": "New Construction"}], "isBilledTo": "Unknown", "isRebilledTo": "Unknown"}, "trackingCategoryRefs": [{"id": "10000-933272658", "name": "New Construction"}], "unitAmount": 27}, {"accountRef": {"id": "C0000-933270541", "name": "Accounts Payable"}, "description": "Hardware:Lk Doorknobs - Locking interior doorknobs Part # DK415", "discountAmount": 0, "discountPercentage": 0, "isDirectCost": false, "itemRef": {"id": "140000-933272656", "name": "Hardware:Lk Doorknobs"}, "quantity": 100, "subTotal": 3495, "taxAmount": 0, "totalAmount": 3495, "tracking": {"categoryRefs": [{"id": "10000-933272658", "name": "New Construction"}], "isBilledTo": "Unknown", "isRebilledTo": "Unknown"}, "trackingCategoryRefs": [{"id": "10000-933272658", "name": "New Construction"}], "unitAmount": 34.95}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-26T09:06:42Z", "paymentAllocations": [{"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -8695}, "payment": {"accountRef": {"id": "20000-933270541", "name": "Checking"}, "currency": "GBP", "currencyRate": 1, "id": "9E4C-1182131999", "paidOnDate": "2023-01-31T00:00:00", "reference": "115", "totalAmount": 13759}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -5000}, "payment": {"accountRef": {"id": "20000-933270541", "name": "Checking"}, "currency": "GBP", "currencyRate": 1, "id": "36AD-1071520917", "note": "RC 93", "paidOnDate": "2024-12-05T00:00:00", "reference": "484", "totalAmount": 5325}}], "purchaseOrderRefs": [{"id": "3684-1071520443", "purchaseOrderNumber": "6225"}], "reference": "3847498", "sourceModifiedDate": "2023-12-16T05:06:30", "status": "Paid", "subTotal": 13695, "supplierRef": {"id": "B0000-933272656", "supplierName": "Patton Hardware Supplies"}, "taxAmount": 0, "totalAmount": 13695, "withholdingTax": []}, {"amountDue": 0, "currency": "GBP", "currencyRate": 1, "dueDate": "2024-01-14T00:00:00", "id": "5CAB-1197713763", "issueDate": "2022-12-15T00:00:00", "lineItems": [{"accountRef": {"id": "490000-933270542", "name": "Gas and Electric"}, "discountAmount": 0, "discountPercentage": 0, "isDirectCost": false, "quantity": 1, "subTotal": 532, "taxAmount": 0, "totalAmount": 532, "tracking": {"categoryRefs": [{"id": "80000007-1197713802", "name": "Overhead"}], "isBilledTo": "Unknown", "isRebilledTo": "Unknown"}, "trackingCategoryRefs": [{"id": "80000007-1197713802", "name": "Overhead"}], "unitAmount": 532}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-26T09:06:42Z", "paymentAllocations": [{"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -532}, "payment": {"accountRef": {"id": "20000-933270541", "name": "Checking"}, "currency": "GBP", "currencyRate": 1, "id": "9E42-1182131999", "paidOnDate": "2023-01-31T00:00:00", "reference": "113", "totalAmount": 532}}], "purchaseOrderRefs": [], "reference": "8374892", "sourceModifiedDate": "2023-12-16T05:06:30", "status": "Paid", "subTotal": 532, "supplierRef": {"id": "30000-933272656", "supplierName": "C. U. Electric"}, "taxAmount": 0, "totalAmount": 532, "withholdingTax": []}], "totalResults": 239} + QuickBooks Online: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/10818b5e-6e6a-4ed4-a1c5-3e3efe626e87/data/bills?page=1&pageSize=2"}, "next": {"href": "/companies/10818b5e-6e6a-4ed4-a1c5-3e3efe626e87/data/bills?page=2&pageSize=2"}, "self": {"href": "/companies/10818b5e-6e6a-4ed4-a1c5-3e3efe626e87/data/bills"}}, "pageNumber": 1, "pageSize": 2, "results": [{"amountDue": 0, "currency": "GBP", "currencyRate": 1, "dueDate": "2019-05-13T00:00:00", "id": "18", "issueDate": "2019-05-13T00:00:00", "lineItems": [{"accountRef": {"id": "16", "name": "Advertising"}, "discountAmount": 0, "isDirectCost": false, "quantity": 1, "subTotal": 5, "taxAmount": 0, "taxRateRef": {"effectiveTaxRate": 0, "id": "NON", "name": "NON"}, "totalAmount": 5, "tracking": {"categoryRefs": [], "isBilledTo": "Unknown", "isRebilledTo": "NotApplicable"}, "trackingCategoryRefs": [], "unitAmount": 5}], "modifiedDate": "2023-01-18T11:02:41Z", "paymentAllocations": [{"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -5}, "payment": {"currency": "GBP", "currencyRate": 1, "id": "20", "paidOnDate": "2019-05-13T00:00:00", "totalAmount": 0}}], "purchaseOrderRefs": [], "reference": "12", "sourceModifiedDate": "2022-05-26T10:34:10Z", "status": "Paid", "subTotal": 5, "supplierRef": {"id": "4", "supplierName": "BILLy elliot"}, "taxAmount": 0, "totalAmount": 5, "withholdingTax": []}, {"amountDue": 0, "currency": "GBP", "currencyRate": 1, "dueDate": "2019-05-13T00:00:00", "id": "22", "issueDate": "2019-05-13T00:00:00", "lineItems": [{"accountRef": {"id": "16", "name": "Advertising"}, "discountAmount": 0, "isDirectCost": false, "quantity": 1, "subTotal": 5, "taxAmount": 0, "taxRateRef": {"effectiveTaxRate": 0, "id": "NON", "name": "NON"}, "totalAmount": 5, "tracking": {"categoryRefs": [], "isBilledTo": "Unknown", "isRebilledTo": "NotApplicable"}, "trackingCategoryRefs": [], "unitAmount": 5}], "modifiedDate": "2023-01-18T11:02:41Z", "paymentAllocations": [{"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -5}, "payment": {"currency": "GBP", "currencyRate": 1, "id": "678", "note": "payment note test", "paidOnDate": "2020-03-23T00:00:00", "totalAmount": 0}}], "purchaseOrderRefs": [], "reference": "12", "sourceModifiedDate": "2020-03-23T10:44:06Z", "status": "Paid", "subTotal": 5, "supplierRef": {"id": "4", "supplierName": "BILLy elliot"}, "taxAmount": 0, "totalAmount": 5, "withholdingTax": []}], "totalResults": 147} + QuickBooks Online Sandbox: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/5a7f3597-36e1-4216-86fe-289ad36088a6/data/bills?page=1&pageSize=2"}, "next": {"href": "/companies/5a7f3597-36e1-4216-86fe-289ad36088a6/data/bills?page=2&pageSize=2"}, "self": {"href": "/companies/5a7f3597-36e1-4216-86fe-289ad36088a6/data/bills"}}, "pageNumber": 1, "pageSize": 2, "results": [{"amountDue": 0, "currency": "HKD", "currencyRate": 0.081142, "dueDate": "2016-01-16T00:00:00", "id": "157", "issueDate": "2016-01-06T00:00:00", "lineItems": [{"description": "Water bottles -- generic", "discountAmount": 0, "isDirectCost": false, "itemRef": {"id": "19", "name": "Water Bottles"}, "quantity": 100, "subTotal": 6617.17, "taxAmount": 1323.43, "taxRateRef": {"effectiveTaxRate": 20, "id": "3_Bills", "name": "20.0% S Bills"}, "totalAmount": 7940.6, "tracking": {"categoryRefs": [], "customerRef": {"companyName": "Oxon Insurance - Holiday Party", "id": "55"}, "isBilledTo": "Unknown", "isRebilledTo": "NotApplicable"}, "trackingCategoryRefs": [], "unitAmount": 66.1717023}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-26T09:35:58Z", "paymentAllocations": [{"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "HKD", "currencyRate": 1, "totalAmount": -7940.6}, "payment": {"accountRef": {"id": "81", "name": "Current"}, "currency": "HKD", "currencyRate": 0.078807, "id": "158", "paidOnDate": "2016-01-23T00:00:00", "reference": "1067", "totalAmount": 7940.6}}], "purchaseOrderRefs": [], "sourceModifiedDate": "2023-01-26T11:20:45Z", "status": "Paid", "subTotal": 6617.17, "supplierRef": {"id": "57", "supplierName": "Hall's Promo Items"}, "taxAmount": 1323.43, "totalAmount": 7940.6, "withholdingTax": []}, {"amountDue": 0, "currency": "HKD", "currencyRate": 0.081142, "dueDate": "2016-01-06T00:00:00", "id": "28", "issueDate": "2016-01-06T00:00:00", "lineItems": [{"description": "promotional items -- misc engraved items", "discountAmount": 0, "isDirectCost": false, "itemRef": {"id": "12", "name": "Misc"}, "quantity": 75, "subTotal": 618.75, "taxAmount": 123.75, "taxRateRef": {"effectiveTaxRate": 20, "id": "3_Bills", "name": "20.0% S Bills"}, "totalAmount": 742.5, "tracking": {"categoryRefs": [], "customerRef": {"companyName": "Ecker Holiday event", "id": "59"}, "isBilledTo": "Unknown", "isRebilledTo": "NotApplicable"}, "trackingCategoryRefs": [], "unitAmount": 8.25}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-26T09:35:58Z", "paymentAllocations": [{"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "HKD", "currencyRate": 1, "totalAmount": -742.5}, "payment": {"accountRef": {"id": "81", "name": "Current"}, "currency": "HKD", "currencyRate": 0.078807, "id": "159", "paidOnDate": "2016-01-23T00:00:00", "reference": "1068", "totalAmount": 742.5}}], "purchaseOrderRefs": [], "sourceModifiedDate": "2016-09-13T21:19:49Z", "status": "Paid", "subTotal": 618.75, "supplierRef": {"id": "57", "supplierName": "Hall's Promo Items"}, "taxAmount": 123.75, "totalAmount": 742.5, "withholdingTax": []}], "totalResults": 711} + Sage 200cloud: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/93c21e2d-049c-4d24-b41b-57e61c30b69e/data/bills?page=1&pageSize=2"}, "next": {"href": "/companies/93c21e2d-049c-4d24-b41b-57e61c30b69e/data/bills?page=2&pageSize=2"}, "self": {"href": "/companies/93c21e2d-049c-4d24-b41b-57e61c30b69e/data/bills"}}, "pageNumber": 1, "pageSize": 2, "results": [{"amountDue": 120, "currency": "GBP", "currencyRate": 1, "dueDate": "2020-02-15T00:00:00Z", "id": "45121", "issueDate": "2020-07-22T00:00:00Z", "lineItems": [{"description": "Tax Summary - Tax Rate 1", "discountAmount": 0.5, "isDirectCost": false, "quantity": 0, "subTotal": 0, "taxAmount": 20, "taxRateRef": {"effectiveTaxRate": 20, "id": "1729", "name": "Standard rate"}, "totalAmount": 20, "trackingCategoryRefs": [], "unitAmount": 0}, {"description": "Goods Summary", "discountAmount": 2.5, "isDirectCost": false, "quantity": 0, "subTotal": 100, "taxAmount": 0, "totalAmount": 100, "trackingCategoryRefs": [], "unitAmount": 0}], "modifiedDate": "2022-10-14T09:36:01Z", "note": "No1", "paymentAllocations": [], "purchaseOrderRefs": [], "reference": "Order no 1", "sourceModifiedDate": "2020-02-28T14:23:46Z", "status": "Open", "subTotal": 100, "supplierRef": {"id": "CON001", "supplierName": "Concept Stationery Supplies"}, "taxAmount": 20, "totalAmount": 120, "withholdingTax": []}, {"amountDue": 179.1, "currency": "GBP", "currencyRate": 1, "dueDate": "2020-03-01T00:00:00Z", "id": "45131", "issueDate": "2020-07-22T00:00:00Z", "lineItems": [{"description": "Tax Summary - Tax Rate 1", "discountAmount": 0, "isDirectCost": false, "quantity": 0, "subTotal": 0, "taxAmount": 31.6, "taxRateRef": {"effectiveTaxRate": 20, "id": "1729", "name": "Standard rate"}, "totalAmount": 31.6, "trackingCategoryRefs": [], "unitAmount": 0}, {"description": "Goods Summary", "discountAmount": 0, "isDirectCost": false, "quantity": 0, "subTotal": 158, "taxAmount": 0, "totalAmount": 158, "trackingCategoryRefs": [], "unitAmount": 0}], "modifiedDate": "2022-10-14T09:36:01Z", "note": "No2", "paymentAllocations": [{"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": 10.5}, "payment": {"currency": "GBP", "currencyRate": 1, "id": "45391", "note": "ret1", "paidOnDate": "2020-01-20T00:00:00", "reference": "Return 1", "totalAmount": 0}}], "purchaseOrderRefs": [], "reference": "Order 2", "sourceModifiedDate": "2020-02-28T14:23:46Z", "status": "PartiallyPaid", "subTotal": 158, "supplierRef": {"id": "CON001", "supplierName": "Concept Stationery Supplies"}, "taxAmount": 31.6, "totalAmount": 189.6, "withholdingTax": []}], "totalResults": 162} + Sage 50 (UK): + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/cf5f2a47-2990-4221-bae6-0c19c86ac304/data/bills?page=1&pageSize=2"}, "next": {"href": "/companies/cf5f2a47-2990-4221-bae6-0c19c86ac304/data/bills?page=2&pageSize=2"}, "self": {"href": "/companies/cf5f2a47-2990-4221-bae6-0c19c86ac304/data/bills"}}, "pageNumber": 1, "pageSize": 2, "results": [{"amountDue": 0, "currency": "GBP", "currencyRate": 1, "dueDate": "2022-01-31T00:00:00", "id": "92", "issueDate": "2021-01-01T00:00:00", "lineItems": [{"accountRef": {"id": "5000", "name": "Materials Purchased"}, "description": "Goods", "isDirectCost": false, "quantity": 1, "subTotal": 5000, "taxAmount": 875, "taxRateRef": {"effectiveTaxRate": 20, "id": "1", "name": "Standard rate"}, "totalAmount": 5875, "tracking": {"categoryRefs": [{"id": "department_7", "name": "Workshop"}], "isBilledTo": "Unknown", "isRebilledTo": "Unknown"}, "trackingCategoryRefs": [{"id": "department_7", "name": "Workshop"}], "unitAmount": 5875}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-30T14:42:44Z", "note": "Goods", "paymentAllocations": [{"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -5875}, "payment": {"currency": "GBP", "currencyRate": 1, "id": "260", "note": "Purchase payment 260 linked to, purchase invoice 11, purchase invoice 18, purchase invoice 92, purchase invoice 93.", "paidOnDate": "2022-01-29T00:00:00", "totalAmount": 7141.98}}], "purchaseOrderRefs": [], "reference": "2569", "sourceModifiedDate": "2022-11-25T09:43:54", "status": "Paid", "subTotal": 5000, "supplierRef": {"id": "THO001", "supplierName": "Thompsons Electricals"}, "taxAmount": 875, "totalAmount": 5875, "withholdingTax": []}, {"amountDue": 0, "currency": "GBP", "currencyRate": 1, "dueDate": "2022-02-14T00:00:00", "id": "93", "issueDate": "2021-01-15T00:00:00", "lineItems": [{"accountRef": {"id": "5000", "name": "Materials Purchased"}, "description": "Goods", "isDirectCost": false, "quantity": 1, "subTotal": 1000, "taxAmount": 175, "taxRateRef": {"effectiveTaxRate": 20, "id": "1", "name": "Standard rate"}, "totalAmount": 1175, "tracking": {"categoryRefs": [{"id": "department_7", "name": "Workshop"}], "isBilledTo": "Unknown", "isRebilledTo": "Unknown"}, "trackingCategoryRefs": [{"id": "department_7", "name": "Workshop"}], "unitAmount": 1175}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-30T14:42:44Z", "note": "Goods", "paymentAllocations": [{"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -1175}, "payment": {"currency": "GBP", "currencyRate": 1, "id": "260", "note": "Purchase payment 260 linked to, purchase invoice 11, purchase invoice 18, purchase invoice 92, purchase invoice 93.", "paidOnDate": "2022-01-29T00:00:00", "totalAmount": 7141.98}}], "purchaseOrderRefs": [], "reference": "2570", "sourceModifiedDate": "2022-11-25T09:43:54", "status": "Paid", "subTotal": 1000, "supplierRef": {"id": "THO001", "supplierName": "Thompsons Electricals"}, "taxAmount": 175, "totalAmount": 1175, "withholdingTax": []}], "totalResults": 95} + Sage Business Cloud Accounting: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/390083e2-351b-407c-a3be-55081c36c182/data/bills?page=1&pageSize=2"}, "next": {"href": "/companies/390083e2-351b-407c-a3be-55081c36c182/data/bills?page=2&pageSize=2"}, "self": {"href": "/companies/390083e2-351b-407c-a3be-55081c36c182/data/bills"}}, "pageNumber": 1, "pageSize": 2, "results": [{"amountDue": 405.6, "currency": "GBP", "currencyRate": 1, "dueDate": "2018-07-19T00:00:00", "id": "15a7a15773b011e8aaa5027d54329956", "issueDate": "2018-06-19T00:00:00", "lineItems": [{"accountRef": {"id": "9a995955267a11e797950a57719b2edb", "name": "Cost of sales - goods"}, "description": "Consulting services", "isDirectCost": false, "itemRef": {"id": "a87b922b33de11e797950a57719b2edb", "name": "Consulting services"}, "quantity": 33, "subTotal": 363, "taxAmount": 72.6, "taxRateRef": {"effectiveTaxRate": 20, "id": "GB_STANDARD", "name": "Standard 20.00%"}, "totalAmount": 435.6, "trackingCategoryRefs": [], "unitAmount": 11}], "modifiedDate": "2022-10-24T14:56:08Z", "paymentAllocations": [{"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -5}, "payment": {"accountRef": {"id": "92b80ba619d34cafbedd0eb2e69a82f7", "name": "ozzbtdynvoblhytjolxaiohrtrhtpvndiqncpjtcjzwcddpvzl"}, "currency": "GBP", "currencyRate": 1, "id": "f11134e299cb4456be096265136a7770", "note": "Supplier payment using credit/debit card - string", "paidOnDate": "2020-02-05T00:00:00", "totalAmount": 5}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -5}, "payment": {"accountRef": {"id": "92b80ba619d34cafbedd0eb2e69a82f7", "name": "ozzbtdynvoblhytjolxaiohrtrhtpvndiqncpjtcjzwcddpvzl"}, "currency": "GBP", "currencyRate": 1, "id": "e3e35dcda09642ca8880fc603b0a98e9", "note": "Supplier payment using credit/debit card - string", "paidOnDate": "2020-02-05T00:00:00", "totalAmount": 5}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -5}, "payment": {"accountRef": {"id": "92b80ba619d34cafbedd0eb2e69a82f7", "name": "ozzbtdynvoblhytjolxaiohrtrhtpvndiqncpjtcjzwcddpvzl"}, "currency": "GBP", "currencyRate": 1, "id": "d9b643b9d6e149f4b443cbc6f22fe1dd", "note": "Supplier payment using credit/debit card - string", "paidOnDate": "2020-02-05T00:00:00", "totalAmount": 5}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -5}, "payment": {"accountRef": {"id": "92b80ba619d34cafbedd0eb2e69a82f7", "name": "ozzbtdynvoblhytjolxaiohrtrhtpvndiqncpjtcjzwcddpvzl"}, "currency": "GBP", "currencyRate": 1, "id": "cbff2fed2f1641b7bee59f5dd68d29a1", "note": "Supplier payment using credit/debit card - string", "paidOnDate": "2020-02-05T00:00:00", "totalAmount": 5}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -5}, "payment": {"accountRef": {"id": "92b80ba619d34cafbedd0eb2e69a82f7", "name": "ozzbtdynvoblhytjolxaiohrtrhtpvndiqncpjtcjzwcddpvzl"}, "currency": "GBP", "currencyRate": 1, "id": "3c3ed62353cf4d148352a14027738dbe", "note": "Supplier payment using credit/debit card - string", "paidOnDate": "2020-02-05T00:00:00", "totalAmount": 5}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -5}, "payment": {"accountRef": {"id": "92b80ba619d34cafbedd0eb2e69a82f7", "name": "ozzbtdynvoblhytjolxaiohrtrhtpvndiqncpjtcjzwcddpvzl"}, "currency": "GBP", "currencyRate": 1, "id": "332e402b9d4b4614af82594d186f5f29", "note": "Supplier payment using credit/debit card - string", "paidOnDate": "2020-02-05T00:00:00", "totalAmount": 5}}], "purchaseOrderRefs": [], "reference": "19/06/2018 - 435.60", "sourceModifiedDate": "2020-02-05T15:19:28Z", "status": "PartiallyPaid", "subTotal": 363, "supplierRef": {"id": "ca430e0d156011e8b45c025132dab352", "supplierName": "Test Supplier"}, "taxAmount": 72.6, "totalAmount": 435.6, "withholdingTax": []}, {"amountDue": 0, "currency": "USD", "currencyRate": 0.752601305, "dueDate": "2018-07-25T00:00:00", "id": "09034445789211e8aaa5027d54329956", "issueDate": "2018-06-25T00:00:00", "lineItems": [{"accountRef": {"id": "9a995955267a11e797950a57719b2edb", "name": "Cost of sales - goods"}, "description": "Bagels", "isDirectCost": false, "quantity": 1, "subTotal": 1000, "taxAmount": 0, "taxRateRef": {"effectiveTaxRate": 0, "id": "GB_ZERO", "name": "Zero Rated 0.00%"}, "totalAmount": 1000, "trackingCategoryRefs": [], "unitAmount": 1000}], "modifiedDate": "2022-10-24T14:56:08Z", "paymentAllocations": [{"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "USD", "currencyRate": 1, "totalAmount": -1000}, "payment": {"accountRef": {"id": "9a25937b267a11e797950a57719b2edb", "name": "Current"}, "currency": "USD", "currencyRate": 0.734679838, "id": "66d010243e3441ba89a793446eb9c74b", "note": "Supplier payment using credit/debit card - Test note", "paidOnDate": "2022-02-16T00:00:00", "totalAmount": 1000}}], "purchaseOrderRefs": [], "reference": "25/06/2018 - 1,000.00", "sourceModifiedDate": "2022-02-22T13:48:56Z", "status": "Paid", "subTotal": 1000, "supplierRef": {"id": "ec716559789111e8aaa5027d54329956", "supplierName": "Bagels Limited"}, "taxAmount": 0, "totalAmount": 1000, "withholdingTax": []}], "totalResults": 4658} + Sage Intacct: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/df02b289-cb16-4964-ac4d-9fd60b04538e/data/bills?page=1&pageSize=2"}, "next": {"href": "/companies/df02b289-cb16-4964-ac4d-9fd60b04538e/data/bills?page=2&pageSize=2"}, "self": {"href": "/companies/df02b289-cb16-4964-ac4d-9fd60b04538e/data/bills"}}, "pageNumber": 1, "pageSize": 2, "results": [{"amountDue": 0, "currency": "GBP", "dueDate": "2021-10-29T00:00:00", "id": "4470", "issueDate": "2021-10-19T00:00:00", "lineItems": [{"accountRef": {"id": "3", "name": "Accounts Payable"}, "isDirectCost": false, "quantity": 1, "subTotal": 25, "taxAmount": 0, "taxRateRef": {"effectiveTaxRate": 0, "id": "82", "name": "UK Purchase Goods Zero Rate"}, "totalAmount": 25, "tracking": {"categoryRefs": [{"id": "DEPARTMENT-3", "name": "Admin"}, {"id": "LOCATION-11", "name": "Codat Test Entity"}], "isBilledTo": "Unknown", "isRebilledTo": "Unknown"}, "trackingCategoryRefs": [{"id": "DEPARTMENT-3", "name": "Admin"}, {"id": "LOCATION-11", "name": "Codat Test Entity"}], "unitAmount": 25}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-04T16:31:37Z", "note": "", "paymentAllocations": [{"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -20}, "payment": {"accountRef": {"id": "353", "name": "Current Account"}, "currency": "GBP", "id": "4471", "note": "", "paidOnDate": "2022-01-06T00:00:00", "totalAmount": 20}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -5}, "payment": {"accountRef": {"id": "353", "name": "Current Account"}, "currency": "GBP", "id": "4472", "note": "", "paidOnDate": "2022-01-06T00:00:00", "totalAmount": 5}}], "purchaseOrderRefs": [], "reference": "test", "sourceModifiedDate": "2022-02-23T12:06:58", "status": "Paid", "subTotal": 25, "supplierRef": {"id": "3", "supplierName": "ADP"}, "taxAmount": 0, "totalAmount": 25, "withholdingTax": []}, {"amountDue": 10, "currency": "USD", "currencyRate": 14, "dueDate": "2022-02-19T00:00:00", "id": "4705", "issueDate": "2022-02-04T00:00:00", "lineItems": [{"accountRef": {"id": "3", "name": "Accounts Payable"}, "description": "Some text for a description", "isDirectCost": false, "quantity": 1, "subTotal": 10, "taxAmount": 0, "taxRateRef": {"effectiveTaxRate": 0, "id": "49", "name": "EC Purchase Goods Zero Rate"}, "totalAmount": 10, "tracking": {"categoryRefs": [{"id": "DEPARTMENT-3", "name": "Admin"}, {"id": "LOCATION-11", "name": "Codat Test Entity"}], "isBilledTo": "Unknown", "isRebilledTo": "Unknown"}, "trackingCategoryRefs": [{"id": "DEPARTMENT-3", "name": "Admin"}, {"id": "LOCATION-11", "name": "Codat Test Entity"}], "unitAmount": 10}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-04T16:31:37Z", "note": "Some note on my bill", "paymentAllocations": [], "purchaseOrderRefs": [], "reference": "JohnAndRob", "sourceModifiedDate": "2022-04-22T12:24:59", "status": "Open", "subTotal": 10, "supplierRef": {"id": "8", "supplierName": "Worldwide Commercial"}, "taxAmount": 0, "totalAmount": 10, "withholdingTax": []}], "totalResults": 17} + Xero: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/5ced9667-a310-443a-a711-958d36377141/data/bills?page=1&pageSize=2"}, "next": {"href": "/companies/5ced9667-a310-443a-a711-958d36377141/data/bills?page=2&pageSize=2"}, "self": {"href": "/companies/5ced9667-a310-443a-a711-958d36377141/data/bills"}}, "pageNumber": 1, "pageSize": 2, "results": [{"amountDue": 0, "currency": "GBP", "currencyRate": 1, "dueDate": "2021-12-20T00:00:00", "id": "3945273c-cc04-479f-a4b5-1e3dc7a55ed1", "issueDate": "2021-11-19T00:00:00", "lineItems": [{"accountRef": {"id": "46f9461e-788b-4906-8b74-d1ea17f6dc10", "name": "Consulting"}, "description": "Half day training - Microsoft Office", "discountAmount": 0, "discountPercentage": 0, "isDirectCost": false, "itemRef": {"id": "489558f5-27b7-4f37-ad9f-d84611c2e2ab", "name": "Half day training - Microsoft Office"}, "quantity": 1, "subTotal": 1800, "taxAmount": 360, "taxRateRef": {"effectiveTaxRate": 20, "id": "INPUT2", "name": "20% (VAT on Expenses)"}, "totalAmount": 2160, "trackingCategoryRefs": [], "unitAmount": 1800}, {"accountRef": {"id": "f96c9458-d724-47bf-8f74-a9d5726465ce", "name": "General Expenses"}, "description": "Desktop/network support via email & phone.Per month fixed fee for minimum 20 hours/month.", "discountAmount": 0, "discountPercentage": 0, "isDirectCost": false, "itemRef": {"id": "f8fb7e00-5e5d-466c-aef0-15861f73d04f", "name": "Desktop/network support via email & phone"}, "quantity": 1, "subTotal": 4000, "taxAmount": 800, "taxRateRef": {"effectiveTaxRate": 20, "id": "INPUT2", "name": "20% (VAT on Expenses)"}, "totalAmount": 4800, "trackingCategoryRefs": [], "unitAmount": 4000}, {"accountRef": {"id": "cba6527d-f102-4538-b421-e483233e9d5a", "name": "Printing & Stationery"}, "description": "Stationery charges", "discountAmount": 0, "discountPercentage": 0, "isDirectCost": false, "quantity": 8, "subTotal": 256, "taxAmount": 51.2, "taxRateRef": {"effectiveTaxRate": 20, "id": "INPUT2", "name": "20% (VAT on Expenses)"}, "totalAmount": 307.2, "trackingCategoryRefs": [], "unitAmount": 32}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-15T20:36:09Z", "paymentAllocations": [{"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -7267.2}, "payment": {"accountRef": {"id": "bd9e85e0-0478-433d-ae9f-0b3c4f04bfe4", "name": "Business Bank Account"}, "currency": "GBP", "currencyRate": 1, "id": "74004690-82a1-4810-aaca-6ce575af94b4", "paidOnDate": "2021-12-20T00:00:00", "totalAmount": 7267.2}}], "purchaseOrderRefs": [], "reference": "", "sourceModifiedDate": "2021-01-02T21:07:23", "status": "Paid", "subTotal": 6056, "supplierRef": {"id": "1262c350-fe0f-40ec-aeff-41c95b4a45af", "supplierName": "DIISR - Small Business Services"}, "taxAmount": 1211.2, "totalAmount": 7267.2, "withholdingTax": []}, {"amountDue": 0, "currency": "GBP", "currencyRate": 1, "dueDate": "2022-02-17T00:00:00", "id": "09aa506f-cb81-4cd3-a1ea-6a0b91804d5a", "issueDate": "2022-01-17T00:00:00", "lineItems": [{"accountRef": {"id": "46f9461e-788b-4906-8b74-d1ea17f6dc10", "name": "Consulting"}, "description": "Half day training - Microsoft Office", "discountAmount": 0, "discountPercentage": 0, "isDirectCost": false, "itemRef": {"id": "489558f5-27b7-4f37-ad9f-d84611c2e2ab", "name": "Half day training - Microsoft Office"}, "quantity": 1, "subTotal": 1800, "taxAmount": 360, "taxRateRef": {"effectiveTaxRate": 20, "id": "INPUT2", "name": "20% (VAT on Expenses)"}, "totalAmount": 2160, "trackingCategoryRefs": [], "unitAmount": 1800}, {"accountRef": {"id": "f96c9458-d724-47bf-8f74-a9d5726465ce", "name": "General Expenses"}, "description": "Desktop/network support via email & phone.Per month fixed fee for minimum 20 hours/month.", "discountAmount": 0, "discountPercentage": 0, "isDirectCost": false, "itemRef": {"id": "f8fb7e00-5e5d-466c-aef0-15861f73d04f", "name": "Desktop/network support via email & phone"}, "quantity": 1, "subTotal": 4000, "taxAmount": 800, "taxRateRef": {"effectiveTaxRate": 20, "id": "INPUT2", "name": "20% (VAT on Expenses)"}, "totalAmount": 4800, "trackingCategoryRefs": [], "unitAmount": 4000}, {"accountRef": {"id": "cba6527d-f102-4538-b421-e483233e9d5a", "name": "Printing & Stationery"}, "description": "Stationery charges", "discountAmount": 0, "discountPercentage": 0, "isDirectCost": false, "quantity": 8, "subTotal": 256, "taxAmount": 51.2, "taxRateRef": {"effectiveTaxRate": 20, "id": "INPUT2", "name": "20% (VAT on Expenses)"}, "totalAmount": 307.2, "trackingCategoryRefs": [], "unitAmount": 32}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-15T20:36:09Z", "paymentAllocations": [{"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -7267.2}, "payment": {"accountRef": {"id": "bd9e85e0-0478-433d-ae9f-0b3c4f04bfe4", "name": "Business Bank Account"}, "currency": "GBP", "currencyRate": 1, "id": "f2062172-b444-4c8b-b797-9f4c7a4244c7", "paidOnDate": "2022-02-17T00:00:00", "totalAmount": 7267.2}}], "purchaseOrderRefs": [], "reference": "", "sourceModifiedDate": "2021-01-02T21:06:22", "status": "Paid", "subTotal": 6056, "supplierRef": {"id": "1262c350-fe0f-40ec-aeff-41c95b4a45af", "supplierName": "DIISR - Small Business Services"}, "taxAmount": 1211.2, "totalAmount": 7267.2, "withholdingTax": []}], "totalResults": 44} + Zoho Books: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/d0b68840-db50-4bc3-b88c-96e225333fea/data/bills?page=1&pageSize=2"}, "next": {"href": "/companies/d0b68840-db50-4bc3-b88c-96e225333fea/data/bills?page=2&pageSize=2"}, "self": {"href": "/companies/d0b68840-db50-4bc3-b88c-96e225333fea/data/bills"}}, "pageNumber": 1, "pageSize": 2, "results": [{"amountDue": 0, "currency": "GBP", "currencyRate": 1, "dueDate": "2020-06-23T00:00:00", "id": "104957000000152027", "issueDate": "2020-06-23T00:00:00", "lineItems": [], "modifiedDate": "2022-10-03T08:40:37Z", "paymentAllocations": [], "purchaseOrderRefs": [], "reference": "1", "sourceModifiedDate": "2020-06-23T13:47:17", "status": "Paid", "subTotal": 0, "supplierRef": {"id": "104957000000152001", "supplierName": "Mr. P N"}, "taxAmount": 0, "totalAmount": 10, "withholdingTax": []}, {"amountDue": 0, "currency": "GBP", "currencyRate": 1, "dueDate": "2020-06-23T00:00:00", "id": "104957000000152067", "issueDate": "2020-06-23T00:00:00", "lineItems": [], "modifiedDate": "2022-10-03T08:40:37Z", "paymentAllocations": [], "purchaseOrderRefs": [], "reference": "2", "sourceModifiedDate": "2020-11-04T13:07:23", "status": "Paid", "subTotal": 0, "supplierRef": {"id": "104957000000152001", "supplierName": "Mr. P N"}, "taxAmount": 0, "totalAmount": 12, "withholdingTax": []}], "totalResults": 36} + Malformed query: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "400": + application/json: {"canBeRetried": "Unknown", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "detailedErrorCode": 0, "error": "Error parsing query - Malformed query.", "service": "ClientsApi", "statusCode": 400} + Unresolved property: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "400": + application/json: {"canBeRetried": "Unknown", "correlationId": "98457fb9956b7f9b4b2fd4f6e23bb5c8", "detailedErrorCode": 0, "error": "Error parsing query - Could not resolve property isCompleted on Dataset", "service": "PullApi", "statusCode": 400} + list-bill-attachments: + Unauthorized: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + billId: "EILBDVJVNUAGVKRQ" + responses: + "401": + application/json: {"canBeRetried": "Unknown", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "detailedErrorCode": 0, "error": "Unauthorized", "service": "PublicApi", "statusCode": 401} + update-bill: + Malformed query: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + billId: "7110701885" + query: {} + requestBody: + application/json: {"currency": "EUR", "dueDate": "2022-10-23T00:00:00Z", "issueDate": "2022-10-23T00:00:00Z", "modifiedDate": "2022-10-23T00:00:00Z", "paymentAllocations": [{"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "EUR"}, "payment": {"currency": "GBP", "paidOnDate": "2022-10-23T00:00:00Z"}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP"}, "payment": {"currency": "GBP", "paidOnDate": "2022-10-23T00:00:00Z"}}], "sourceModifiedDate": "2022-10-23T00:00:00Z", "status": "Draft", "subTotal": "3024.61", "taxAmount": "4643.85", "totalAmount": "7712.03"} + responses: + "400": + application/json: {"canBeRetried": "Unknown", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "detailedErrorCode": 0, "error": "Error processing request - not valid.", "service": "PublicApi", "statusCode": 400} + upload-bill-attachment: + Malformed query: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + billId: "EILBDVJVNUAGVKRQ" + responses: + "400": + application/json: {"canBeRetried": "Unknown", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "detailedErrorCode": 0, "error": "Error processing request - not valid.", "service": "PublicApi", "statusCode": 400} + create-bank-account: + Malformed query: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + query: {} + requestBody: + application/json: {"currency": "USD", "status": "Active"} + responses: + "400": + application/json: {"canBeRetried": "Unknown", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "detailedErrorCode": 0, "error": "Error processing request - not valid.", "service": "PublicApi", "statusCode": 400} + get-create-bankAccounts-model: + Dynamics 365 Business Central: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + responses: + "200": + application/json: {"description": "An account that bank transactions may be recorded against", "displayName": "Bank Account", "properties": {"accountName": {"description": "The name of the bank account in the originating system", "displayName": "Name", "required": true, "type": "String", "validation": {"information": [{"details": "Needs to be of the format '{No.}-{Name}'", "field": "AccountName"}], "warnings": []}}, "currency": {"description": "The currency of the bank account", "displayName": "Currency", "required": true, "type": "String"}, "accountNumber": {"description": "The account number for the bank account", "displayName": "Account Number", "required": false, "type": "String"}, "nominalCode": {"description": "The external reference given to each nominal account for a business", "displayName": "Nominal Code", "required": false, "type": "String", "validation": {"information": [{"details": "Bank Account Posting Group with Nominal Account must exist", "field": "NominalCode"}], "warnings": []}}, "sortCode": {"description": "The sort code for the bank account", "displayName": "Sort Code", "required": false, "type": "String", "validation": {"information": [{"details": "Must have a length between 0 and 20 characters", "field": "SortCode"}], "warnings": []}}, "iBan": {"description": "The international bank account number of the account. Often used when making or receiving international payments", "displayName": "IBAN", "required": false, "type": "String"}, "overdraftLimit": {"description": "The pre-arranged overdraft limit of the account", "displayName": "Overdraft Limit", "required": false, "type": "Number", "validation": {"information": [{"details": "Default value is 0", "field": "OverdraftLimit"}], "warnings": []}}}, "required": true, "type": "Object"} + Exact (Netherlands): + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + responses: + "200": + application/json: {"description": "An account that bank transactions may be recorded against", "displayName": "Bank Account", "properties": {"accountName": {"description": "The name of the bank account in the originating system", "displayName": "Name", "required": true, "type": "String"}, "accountNumber": {"description": "The account number for the bank account", "displayName": "Account Number", "required": true, "type": "String", "validation": {"information": [], "warnings": [{"details": "Should not exceed the maximum length of 14 characters if the specified currency is GBP.", "field": "AccountNumber"}]}}, "sortCode": {"description": "The sort code for the bank account", "displayName": "Sort Code", "required": false, "type": "String", "validation": {"information": [], "warnings": [{"details": "Must be 6 characters long if the specified currency is GBP.", "field": "SortCode"}, {"details": "Must be provided if the specified currency is GBP.", "field": "SortCode"}]}}, "currency": {"description": "The currency of the bank account", "displayName": "Currency", "required": false, "type": "String"}, "nominalCode": {"description": "The external reference given to each nominal account for a business", "displayName": "Nominal Code", "required": false, "type": "String"}}, "required": true, "type": "Object"} + Exact (UK): + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + responses: + "200": + application/json: {"description": "An account that bank transactions may be recorded against", "displayName": "Bank Account", "properties": {"accountName": {"description": "The name of the bank account in the originating system", "displayName": "Name", "required": true, "type": "String"}, "accountNumber": {"description": "The account number for the bank account", "displayName": "Account Number", "required": true, "type": "String", "validation": {"information": [], "warnings": [{"details": "Should not exceed the maximum length of 14 characters if the specified currency is GBP.", "field": "AccountNumber"}]}}, "sortCode": {"description": "The sort code for the bank account", "displayName": "Sort Code", "required": false, "type": "String", "validation": {"information": [], "warnings": [{"details": "Must be 6 characters long if the specified currency is GBP.", "field": "SortCode"}, {"details": "Must be provided if the specified currency is GBP.", "field": "SortCode"}]}}, "currency": {"description": "The currency of the bank account", "displayName": "Currency", "required": false, "type": "String"}, "nominalCode": {"description": "The external reference given to each nominal account for a business", "displayName": "Nominal Code", "required": false, "type": "String"}}, "required": true, "type": "Object"} + FreeAgent: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + responses: + "200": + application/json: {"description": "An account that bank transactions may be recorded against", "displayName": "Bank Account", "properties": {"accountName": {"description": "The name of the bank account in the originating system", "displayName": "Name", "required": true, "type": "String"}, "sortCode": {"description": "The sort code for the bank account", "displayName": "Sort Code", "required": false, "type": "String", "validation": {"information": [], "warnings": [{"details": "Must have a length between 0 and 8 characters", "field": "SortCode"}]}}, "accountNumber": {"description": "The account number for the bank account", "displayName": "Account Number", "required": false, "type": "String"}, "iBan": {"description": "The international bank account number of the account. Often used when making or receiving international payments", "displayName": "IBAN", "required": false, "type": "String"}, "currency": {"description": "The currency of the bank account", "displayName": "Currency", "options": [{"displayName": "AED", "required": false, "type": "String", "value": "AED"}, {"displayName": "AMD", "required": false, "type": "String", "value": "AMD"}, {"displayName": "AOA", "required": false, "type": "String", "value": "AOA"}, {"displayName": "ARS", "required": false, "type": "String", "value": "ARS"}, {"displayName": "AUD", "required": false, "type": "String", "value": "AUD"}, {"displayName": "AWG", "required": false, "type": "String", "value": "AWG"}, {"displayName": "AZN", "required": false, "type": "String", "value": "AZN"}, {"displayName": "BBD", "required": false, "type": "String", "value": "BBD"}, {"displayName": "BDT", "required": false, "type": "String", "value": "BDT"}, {"displayName": "BGN", "required": false, "type": "String", "value": "BGN"}, {"displayName": "BRL", "required": false, "type": "String", "value": "BRL"}, {"displayName": "BWP", "required": false, "type": "String", "value": "BWP"}, {"displayName": "CAD", "required": false, "type": "String", "value": "CAD"}, {"displayName": "CHF", "required": false, "type": "String", "value": "CHF"}, {"displayName": "CLP", "required": false, "type": "String", "value": "CLP"}, {"displayName": "CNY", "required": false, "type": "String", "value": "CNY"}, {"displayName": "COP", "required": false, "type": "String", "value": "COP"}, {"displayName": "CRC", "required": false, "type": "String", "value": "CRC"}, {"displayName": "CUC", "required": false, "type": "String", "value": "CUC"}, {"displayName": "CUP", "required": false, "type": "String", "value": "CUP"}, {"displayName": "CZK", "required": false, "type": "String", "value": "CZK"}, {"displayName": "DKK", "required": false, "type": "String", "value": "DKK"}, {"displayName": "DOP", "required": false, "type": "String", "value": "DOP"}, {"displayName": "EGP", "required": false, "type": "String", "value": "EGP"}, {"displayName": "EUR", "required": false, "type": "String", "value": "EUR"}, {"displayName": "FJD", "required": false, "type": "String", "value": "FJD"}, {"displayName": "GBP", "required": false, "type": "String", "value": "GBP"}, {"displayName": "GEL", "required": false, "type": "String", "value": "GEL"}, {"displayName": "GHS", "required": false, "type": "String", "value": "GHS"}, {"displayName": "GTQ", "required": false, "type": "String", "value": "GTQ"}, {"displayName": "GYD", "required": false, "type": "String", "value": "GYD"}, {"displayName": "HKD", "required": false, "type": "String", "value": "HKD"}, {"displayName": "HNL", "required": false, "type": "String", "value": "HNL"}, {"displayName": "HRK", "required": false, "type": "String", "value": "HRK"}, {"displayName": "HUF", "required": false, "type": "String", "value": "HUF"}, {"displayName": "IDR", "required": false, "type": "String", "value": "IDR"}, {"displayName": "ILS", "required": false, "type": "String", "value": "ILS"}, {"displayName": "INR", "required": false, "type": "String", "value": "INR"}, {"displayName": "ISK", "required": false, "type": "String", "value": "ISK"}, {"displayName": "JMD", "required": false, "type": "String", "value": "JMD"}, {"displayName": "JPY", "required": false, "type": "String", "value": "JPY"}, {"displayName": "KES", "required": false, "type": "String", "value": "KES"}, {"displayName": "KRW", "required": false, "type": "String", "value": "KRW"}, {"displayName": "KWD", "required": false, "type": "String", "value": "KWD"}, {"displayName": "KYD", "required": false, "type": "String", "value": "KYD"}, {"displayName": "KZT", "required": false, "type": "String", "value": "KZT"}, {"displayName": "LAK", "required": false, "type": "String", "value": "LAK"}, {"displayName": "LBP", "required": false, "type": "String", "value": "LBP"}, {"displayName": "LKR", "required": false, "type": "String", "value": "LKR"}, {"displayName": "LTL", "required": false, "type": "String", "value": "LTL"}, {"displayName": "LVL", "required": false, "type": "String", "value": "LVL"}, {"displayName": "MAD", "required": false, "type": "String", "value": "MAD"}, {"displayName": "MDL", "required": false, "type": "String", "value": "MDL"}, {"displayName": "MGA", "required": false, "type": "String", "value": "MGA"}, {"displayName": "MUR", "required": false, "type": "String", "value": "MUR"}, {"displayName": "MVR", "required": false, "type": "String", "value": "MVR"}, {"displayName": "MWK", "required": false, "type": "String", "value": "MWK"}, {"displayName": "MXN", "required": false, "type": "String", "value": "MXN"}, {"displayName": "MYR", "required": false, "type": "String", "value": "MYR"}, {"displayName": "MZN", "required": false, "type": "String", "value": "MZN"}, {"displayName": "NAD", "required": false, "type": "String", "value": "NAD"}, {"displayName": "NGN", "required": false, "type": "String", "value": "NGN"}, {"displayName": "NOK", "required": false, "type": "String", "value": "NOK"}, {"displayName": "NPR", "required": false, "type": "String", "value": "NPR"}, {"displayName": "NZD", "required": false, "type": "String", "value": "NZD"}, {"displayName": "OMR", "required": false, "type": "String", "value": "OMR"}, {"displayName": "PEN", "required": false, "type": "String", "value": "PEN"}, {"displayName": "PHP", "required": false, "type": "String", "value": "PHP"}, {"displayName": "PKR", "required": false, "type": "String", "value": "PKR"}, {"displayName": "PLN", "required": false, "type": "String", "value": "PLN"}, {"displayName": "QAR", "required": false, "type": "String", "value": "QAR"}, {"displayName": "RON", "required": false, "type": "String", "value": "RON"}, {"displayName": "RSD", "required": false, "type": "String", "value": "RSD"}, {"displayName": "RUB", "required": false, "type": "String", "value": "RUB"}, {"displayName": "RWF", "required": false, "type": "String", "value": "RWF"}, {"displayName": "SAR", "required": false, "type": "String", "value": "SAR"}, {"displayName": "SCR", "required": false, "type": "String", "value": "SCR"}, {"displayName": "SEK", "required": false, "type": "String", "value": "SEK"}, {"displayName": "SGD", "required": false, "type": "String", "value": "SGD"}, {"displayName": "THB", "required": false, "type": "String", "value": "THB"}, {"displayName": "TND", "required": false, "type": "String", "value": "TND"}, {"displayName": "TRY", "required": false, "type": "String", "value": "TRY"}, {"displayName": "TTD", "required": false, "type": "String", "value": "TTD"}, {"displayName": "TWD", "required": false, "type": "String", "value": "TWD"}, {"displayName": "TZS", "required": false, "type": "String", "value": "TZS"}, {"displayName": "UAH", "required": false, "type": "String", "value": "UAH"}, {"displayName": "UGX", "required": false, "type": "String", "value": "UGX"}, {"displayName": "USD", "required": false, "type": "String", "value": "USD"}, {"displayName": "UYU", "required": false, "type": "String", "value": "UYU"}, {"displayName": "VEF", "required": false, "type": "String", "value": "VEF"}, {"displayName": "VND", "required": false, "type": "String", "value": "VND"}, {"displayName": "VUV", "required": false, "type": "String", "value": "VUV"}, {"displayName": "XAF", "required": false, "type": "String", "value": "XAF"}, {"displayName": "XCD", "required": false, "type": "String", "value": "XCD"}, {"displayName": "XOF", "required": false, "type": "String", "value": "XOF"}, {"displayName": "ZAR", "required": false, "type": "String", "value": "ZAR"}, {"displayName": "ZMK", "required": false, "type": "String", "value": "ZMK"}], "required": true, "type": "String"}, "balance": {"description": "The balance of the bank account", "displayName": "Balance", "required": false, "type": "Number", "validation": {"information": [{"details": "The opening balance, in the account currency", "field": "Balance"}], "warnings": []}}, "institution": {"description": "The institution of the bank account", "displayName": "Institution", "required": false, "type": "String"}}, "required": true, "type": "Object"} + KashFlow: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + responses: + "200": + application/json: {"description": "An account that bank transactions may be recorded against", "displayName": "Bank Account", "properties": {"accountName": {"description": "Name of the bank account as it appears in Kashflow.", "displayName": "Account Name", "required": true, "type": "String"}, "balance": {"description": "The opening balance, in the account currency.", "displayName": "Balance", "required": false, "type": "Number"}, "currency": {"description": "The currency of the bank account.", "displayName": "Currency", "required": true, "type": "String"}}, "required": true, "type": "Object"} + QuickBooks Desktop: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + responses: + "200": + application/json: {"description": "An account that bank transactions may be recorded against", "displayName": "Bank Account", "properties": {"nominalCode": {"description": "The external reference given to each nominal account for a business", "displayName": "Nominal Code", "required": true, "type": "String", "validation": {"information": [], "warnings": [{"details": "Max length of 7 characters.", "field": "NominalCode"}]}}, "accountName": {"description": "The name of the bank account in the originating system", "displayName": "Name", "required": true, "type": "String", "validation": {"information": [], "warnings": [{"details": "Max length of 31 characters.", "field": "AccountName"}]}}, "currency": {"description": "The currency of the bank account", "displayName": "Currency", "required": false, "type": "String", "validation": {"information": [{"details": "If not set, will default to the base currency of the QuickBooks Desktop company", "field": "Currency"}], "warnings": [{"details": "The currency must match the base currency of the QuickBooks Desktop company unless the FullyQualifiedCategory is 'Asset.AccountsReceivable','Liability.AccountsPayable' or 'Liability.CreditCard'", "field": "Currency"}, {"details": "Must be a three letter ISO code that matches an existing active currency in the QuickBooks Desktop company", "field": "Currency"}, {"details": "Can only be set if the Quickbooks Desktop company has Multicurrency enabled.", "field": "Currency"}]}}, "balance": {"description": "The balance of the bank account", "displayName": "Balance", "required": false, "type": "Number"}}, "required": true, "type": "Object"} + QuickBooks Online Sandbox: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + responses: + "200": + application/json: {"description": "An account that bank transactions may be recorded against", "displayName": "Bank Account", "properties": {"accountName": {"description": "Name of account as it appears in the chart of accounts or general ledger.", "displayName": "Account Name", "required": true, "type": "String"}, "accountNumber": {"description": "User-defined account number to help the user in identifying the account within the chart-of-accounts and in deciding what should be posted to the account.", "displayName": "Account Number", "required": true, "type": "String"}, "currency": {"description": "Currency of the bank account.", "displayName": "Currency", "required": true, "type": "String"}}, "required": true, "type": "Object"} + Sage Business Cloud Accounting: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + responses: + "200": + application/json: {"description": "An account that bank transactions may be recorded against", "displayName": "Bank Account", "properties": {"accountName": {"description": "The name of the bank account in the originating system", "displayName": "Name", "required": true, "type": "String", "validation": {"information": [{"details": "Must be provided.", "field": "AccountName"}, {"details": "Should not be longer than 50 characters.", "field": "AccountName"}], "warnings": []}}, "currency": {"description": "The currency of the bank account", "displayName": "Currency", "required": true, "type": "String", "validation": {"information": [{"details": "Must be provided.", "field": "Currency"}, {"details": "Must match the company's base currency.", "field": "Currency"}], "warnings": []}}, "sortCode": {"description": "The sort code for the bank account", "displayName": "Sort Code", "required": false, "type": "String", "validation": {"information": [{"details": "Should be a 6 digit number.", "field": "SortCode"}], "warnings": []}}, "accountNumber": {"description": "The account number for the bank account", "displayName": "Account Number", "required": false, "type": "String", "validation": {"information": [{"details": "Should not be longer than 25 characters.", "field": "AccountNumber"}], "warnings": []}}, "iBan": {"description": "The international bank account number of the account. Often used when making or receiving international payments", "displayName": "IBAN", "required": false, "type": "String", "validation": {"information": [{"details": "Should be in the international bank account number format.", "field": "IBan"}], "warnings": []}}, "nominalCode": {"description": "The external reference given to each nominal account for a business", "displayName": "Nominal Code", "required": false, "type": "String", "validation": {"information": [{"details": "Should be a number between 1 and 99999999.", "field": "NominalCode"}], "warnings": []}}}, "required": true, "type": "Object"} + Sandbox: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + responses: + "200": + application/json: {"description": "An account that bank transactions may be recorded against", "displayName": "Bank Account", "properties": {"accountName": {"description": "The name of the bank account in the originating system", "displayName": "Name", "required": true, "type": "String"}, "accountType": {"description": "The type of account", "displayName": "Account Type", "required": true, "type": "String"}, "nominalCode": {"description": "The external reference given to each nominal account for a business", "displayName": "Nominal Code", "required": true, "type": "String"}, "sortCode": {"description": "The sort code for the bank account", "displayName": "Sort Code", "required": true, "type": "String"}, "accountNumber": {"description": "The account number for the bank account", "displayName": "Account Number", "required": true, "type": "String"}, "iBan": {"description": "The international bank account number of the account. Often used when making or receiving international payments", "displayName": "IBAN", "required": true, "type": "String"}, "currency": {"description": "The currency of the bank account", "displayName": "Currency", "required": true, "type": "String"}, "balance": {"description": "The balance of the bank account", "displayName": "Balance", "required": true, "type": "Number"}, "availableBalance": {"description": "The available balance of the bank account", "displayName": "Available Balance", "required": true, "type": "Number"}, "overdraftLimit": {"description": "The pre-arranged overdraft limit of the account", "displayName": "Overdraft Limit", "required": true, "type": "Number"}, "institution": {"description": "The institution of the bank account", "displayName": "Institution", "required": true, "type": "String"}, "metadata": {"description": "Miscellaneous data about the item", "displayName": "Metadata", "required": true, "type": "Object"}}, "required": true, "type": "Object"} + Unauthorized: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + responses: + "401": + application/json: {"canBeRetried": "Unknown", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "detailedErrorCode": 0, "error": "Unauthorized", "service": "PublicApi", "statusCode": 401} + create-bill-credit-note: + QuickBooks Online: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + query: {} + requestBody: + application/json: {"allocatedOnDate": "2022-10-23T00:00:00Z", "billCreditNoteNumber": "309", "createdFromRefs": [{"dataType": "invoice"}, {"dataType": "journalEntry"}], "currency": "GBP", "currencyRate": 1.242097, "discountPercentage": 0, "id": "1509398f-98e2-436d-8a5d-c042e0c74ffc", "issueDate": "2023-04-20T00:00:00", "lineItems": [{"accountRef": {"id": "7"}, "description": "", "quantity": 1, "subTotal": 100, "taxAmount": 0, "taxRateRef": {"effectiveTaxRate": 0, "id": "NON", "name": "NON"}, "totalAmount": 100, "tracking": {"categoryRefs": [], "isBilledTo": "Unknown", "isRebilledTo": "NotApplicable"}, "trackingCategoryRefs": [], "unitAmount": 100}], "modifiedDate": "2022-10-23T00:00:00Z", "note": "Bill Credit Note with 1 line items, totaling 805.78", "paymentAllocations": [{"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP"}, "payment": {"currency": "GBP", "paidOnDate": "2022-10-23T00:00:00Z"}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "EUR"}, "payment": {"currency": "USD", "paidOnDate": "2022-10-23T00:00:00Z"}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "USD"}, "payment": {"currency": "GBP", "paidOnDate": "2022-10-23T00:00:00Z"}}], "remainingCredit": 100, "sourceModifiedDate": "2022-10-23T00:00:00Z", "status": "Submitted", "subTotal": 100, "supplierRef": {"id": "87", "supplierName": "Ankunding Inc"}, "totalAmount": 100, "totalDiscount": 0, "totalTaxAmount": 0, "withholdingTax": []} + responses: + "200": + application/json: {"changes": [], "companyId": "8a210b68-6988-11ed-a1eb-0242ac120002", "completedOnUtc": "2022-10-23T00:00:00Z", "dataConnectionKey": "2e9d2c44-f675-40ba-8049-353bfcb5e171", "dataType": "invoices", "pushOperationKey": "5211a509-a308-40a8-9e77-4c2becc37691", "requestedOnUtc": "2022-10-23T00:00:00Z", "status": "Failed", "statusCode": 924484} + "400": {} + Xero: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + query: {} + requestBody: + application/json: {"allocatedOnDate": "2022-10-23T00:00:00Z", "billCreditNoteNumber": "1234567", "createdFromRefs": [], "currency": "GBP", "currencyRate": 1, "discountPercentage": 0, "id": "1509398f-98e2-436d-8a5d-c042e0c74ffc", "issueDate": "2023-02-09T00:00:00", "lineItems": [{"accountRef": {"id": "f96c9458-d724-47bf-8f74-a9d5726465ce"}, "description": "Refund as agreed due to window break when guard absent", "discountAmount": 0, "discountPercentage": 0, "quantity": 1, "subTotal": 21.2, "taxAmount": 4.24, "taxRateRef": {"effectiveTaxRate": 20, "id": "INPUT2", "name": "20% (VAT on Expenses)"}, "totalAmount": 25.44, "trackingCategoryRefs": [], "unitAmount": 21.2}], "modifiedDate": "2022-10-23T00:00:00Z", "note": "Bill Credit Note with 1 line items, totaling 805.78", "paymentAllocations": [{"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP"}, "payment": {"currency": "USD", "paidOnDate": "2022-10-23T00:00:00Z"}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "EUR"}, "payment": {"currency": "EUR", "paidOnDate": "2022-10-23T00:00:00Z"}}], "remainingCredit": 0, "sourceModifiedDate": "2022-10-23T00:00:00Z", "status": "Submitted", "subTotal": 25.44, "supplierRef": {"id": "3a0d40a2-2698-4cf5-b7b2-30133c632ab6"}, "totalAmount": 25.44, "totalDiscount": 0, "totalTaxAmount": 4.24, "withholdingTax": []} + responses: + "200": + application/json: {"changes": [{"recordRef": {"dataType": "invoices"}}, {"recordRef": {"dataType": "invoices"}}, {"recordRef": {"dataType": "invoices"}}], "companyId": "8a210b68-6988-11ed-a1eb-0242ac120002", "completedOnUtc": "2022-10-23T00:00:00Z", "dataConnectionKey": "2e9d2c44-f675-40ba-8049-353bfcb5e171", "dataType": "invoices", "pushOperationKey": "03d56a1d-f943-46bf-bd39-494798bc19d4", "requestedOnUtc": "2022-10-23T00:00:00Z", "status": "Pending", "statusCode": 930830} + "400": {} + NetSuite: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + query: {} + requestBody: + application/json: {"allocatedOnDate": "2022-10-23T00:00:00Z", "billCreditNoteNumber": "VENDCRED1987", "createdFromRefs": [{"dataType": "transfer"}, {"dataType": "transfer"}], "currency": "GBP", "currencyRate": 1, "discountPercentage": 0, "id": "1509398f-98e2-436d-8a5d-c042e0c74ffc", "issueDate": "2023-04-20T00:00:00", "lineItems": [{"accountRef": {"id": "714"}, "description": "", "quantity": 1, "subTotal": 10, "totalAmount": 10, "tracking": {"categoryRefs": [{"id": "department-4", "name": "DP Department - incl children"}], "isBilledTo": "Unknown", "isRebilledTo": "Unknown"}, "trackingCategoryRefs": [{"id": "department-4", "name": "DP Department - incl children"}], "unitAmount": 10}], "modifiedDate": "2022-10-23T00:00:00Z", "note": "Bill Credit Note with 1 line items, totaling 805.78", "paymentAllocations": [{"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "EUR"}, "payment": {"currency": "EUR", "paidOnDate": "2022-10-23T00:00:00Z"}}], "remainingCredit": 0, "sourceModifiedDate": "2022-10-23T00:00:00Z", "status": "Submitted", "subTotal": 10, "supplierRef": {"id": "727"}, "totalAmount": 10, "totalDiscount": 0, "totalTaxAmount": 0, "withholdingTax": []} + responses: + "200": + application/json: {"changes": [{"recordRef": {"dataType": "invoices"}}, {"recordRef": {"dataType": "invoices"}}, {"recordRef": {"dataType": "invoices"}}], "companyId": "8a210b68-6988-11ed-a1eb-0242ac120002", "completedOnUtc": "2022-10-23T00:00:00Z", "dataConnectionKey": "2e9d2c44-f675-40ba-8049-353bfcb5e171", "dataType": "invoices", "pushOperationKey": "61bc5243-df3e-4f75-bc24-a16ac5e2bbd7", "requestedOnUtc": "2022-10-23T00:00:00Z", "status": "Failed", "statusCode": 982866} + "400": {} + Sage Intacct: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + query: {} + requestBody: + application/json: {"allocatedOnDate": "2022-10-23T00:00:00Z", "billCreditNoteNumber": "91fe2a83-e161-4c21-929d-c5c10c4b07e5", "createdFromRefs": [], "currency": "GBP", "currencyRate": 1, "discountPercentage": 0, "id": "1509398f-98e2-436d-8a5d-c042e0c74ffc", "issueDate": "2021-09-24T00:00:00", "lineItems": [{"accountRef": {"id": "197", "name": "Software and Licenses"}, "description": "No Description Provided", "quantity": 1, "subTotal": 300, "taxAmount": 60, "taxRateRef": {"effectiveTaxRate": 20, "id": "81", "name": "UK Purchase Goods Standard Rate"}, "totalAmount": 360, "tracking": {"categoryRefs": [{"id": "LOCATION-15"}, {"id": "SUPPLIER-3", "name": "ADP"}], "isBilledTo": "Unknown", "isRebilledTo": "Unknown"}, "trackingCategoryRefs": [{"id": "LOCATION-15", "name": "United Kingdom"}, {"id": "SUPPLIER-3", "name": "ADP"}], "unitAmount": 300}], "modifiedDate": "2022-10-23T00:00:00Z", "note": "Bill Credit Note with 1 line items, totaling 805.78", "paymentAllocations": [], "remainingCredit": 0, "sourceModifiedDate": "2022-10-23T00:00:00Z", "status": "Submitted", "subTotal": 300, "supplierRef": {"id": "3"}, "totalAmount": 360, "totalDiscount": 0, "totalTaxAmount": 60, "withholdingTax": []} + responses: + "200": + application/json: {"changes": [{"recordRef": {"dataType": "invoices"}}, {"recordRef": {"dataType": "invoices"}}], "companyId": "8a210b68-6988-11ed-a1eb-0242ac120002", "completedOnUtc": "2022-10-23T00:00:00Z", "dataConnectionKey": "2e9d2c44-f675-40ba-8049-353bfcb5e171", "dataType": "invoices", "pushOperationKey": "29f35dc9-3cdd-436d-af3b-ee39ab418fe7", "requestedOnUtc": "2022-10-23T00:00:00Z", "status": "Failed", "statusCode": 608435} + "400": {} + MYOB: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + query: {} + requestBody: + application/json: {"allocatedOnDate": "2022-10-23T00:00:00Z", "billCreditNoteNumber": "XYZ0012", "createdFromRefs": [{"dataType": "journalEntry"}], "currency": "AUD", "discountPercentage": 0, "id": "1509398f-98e2-436d-8a5d-c042e0c74ffc", "issueDate": "2023-04-20T00:00:00", "lineItems": [{"accountRef": {"id": "f04d046b-0137-4d95-8af7-ed9fef1a4ba3"}, "description": "Credit note for incorrect bill", "quantity": 1, "subTotal": 900, "taxAmount": 100, "taxRateRef": {"effectiveTaxRate": 10, "id": "ff083e95-de4e-4c56-87dd-32ad9cdac172", "name": "Capital Acquisitions"}, "totalAmount": 900, "unitAmount": 900}], "modifiedDate": "2022-10-23T00:00:00Z", "note": "Bill Credit Note with 1 line items, totaling 805.78", "paymentAllocations": [], "remainingCredit": 0, "sourceModifiedDate": "2022-10-23T00:00:00Z", "status": "Submitted", "subTotal": 1000, "supplierRef": {"id": "5c0664ca-6eb1-4085-9da4-37ef748bc65e", "supplierName": "Metropolitan Electricity"}, "totalAmount": 900, "totalDiscount": 0, "totalTaxAmount": 100, "withholdingTax": []} + responses: + "200": + application/json: {"changes": [{"recordRef": {"dataType": "invoices"}}, {"recordRef": {"dataType": "invoices"}}], "companyId": "8a210b68-6988-11ed-a1eb-0242ac120002", "completedOnUtc": "2022-10-23T00:00:00Z", "dataConnectionKey": "2e9d2c44-f675-40ba-8049-353bfcb5e171", "dataType": "invoices", "pushOperationKey": "08e55ee8-abc5-4b98-a837-0485ddcfa197", "requestedOnUtc": "2022-10-23T00:00:00Z", "status": "Failed", "statusCode": 320521} + "400": {} + Malformed query: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + query: {} + requestBody: + application/json: {"allocatedOnDate": "2022-10-23T00:00:00Z", "billCreditNoteNumber": "14763237", "createdFromRefs": [{"dataType": "accountTransaction"}, {"dataType": "journalEntry"}], "currency": "USD", "discountPercentage": 0, "id": "6a0e9dfb-87b0-47d3-aaaf-9753ae9e757d", "issueDate": "2019-02-18T16:03:07.268Z", "lineItems": [{"accountRef": {"id": "3f267b10-757d-44c0-bef9-20f70cc8fbe3"}, "description": "AcmeMagnet", "discountAmount": 0, "itemRef": {"id": "3"}, "quantity": 4, "subTotal": 100, "taxAmount": 10, "taxRateRef": {"id": "6c88aff3-7cb9-4980-a3d3-443e72e02498"}, "totalAmount": 110, "trackingCategoryRefs": [{"id": "department_1", "name": "ACMERockets"}, {"id": "costcode_2", "name": "ACM2-ACMESigns"}], "unitAmount": 25}, {"accountRef": {"id": "3f267b10-757d-44c0-bef9-20f70cc8fbe3"}, "description": "ACMEDisintegratingPistol", "discountAmount": 0, "itemRef": {"id": "3abf0883-03f7-44c6-bc15-1372522d25e1"}, "quantity": 3, "subTotal": 75, "taxAmount": 7.5, "taxRateRef": {"id": "6c88aff3-7cb9-4980-a3d3-443e72e02498"}, "totalAmount": 82.5, "unitAmount": 25}, {"accountRef": {"id": "3f267b10-757d-44c0-bef9-20f70cc8fbe3"}, "description": "ACMEWhippedCreamDispenser", "discountAmount": 0, "itemRef": {"id": "3691f3d9-0ff7-4358-8a93-bed31c1b4b03"}, "quantity": 6, "subTotal": 312, "taxAmount": 31.2, "taxRateRef": {"id": "6c88aff3-7cb9-4980-a3d3-443e72e02498"}, "totalAmount": 343.2, "unitAmount": 52}, {"accountRef": {"id": "3f267b10-757d-44c0-bef9-20f70cc8fbe3"}, "description": "ACMEJetPropelledPogoStick", "discountAmount": 0, "itemRef": {"id": "075410d4-7edc-4936-ba52-9e1e43cbe300"}, "quantity": 1, "subTotal": 130, "taxAmount": 27.3, "taxRateRef": {"id": "d606732b-db18-44d7-823b-7f15f42c32ea"}, "totalAmount": 157.3, "unitAmount": 130}], "modifiedDate": "2022-10-23T00:00:00Z", "note": "Track separately", "paymentAllocations": [{"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP"}, "payment": {"currency": "GBP", "paidOnDate": "2022-10-23T00:00:00Z"}}, {"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP"}, "payment": {"currency": "USD", "paidOnDate": "2022-10-23T00:00:00Z"}}], "remainingCredit": 693, "sourceModifiedDate": "2022-10-23T00:00:00Z", "status": "Submitted", "subTotal": 805.78, "supplierRef": {"id": "67C6A7A1-5E84-4AC4-B950-24A114E379D0", "supplierName": "Chin's Gas and Oil"}, "totalAmount": 693, "totalDiscount": 0, "totalTaxAmount": 0} + responses: + "400": + application/json: {"canBeRetried": "Unknown", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "detailedErrorCode": 0, "error": "Error processing request - not valid.", "service": "PublicApi", "statusCode": 400} + get-bill-credit-note: + Dynamics 365 Business Central: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + billCreditNoteId: "" + responses: + "200": + application/json: {"allocatedOnDate": "2022-10-23T00:00:00Z", "billCreditNoteNumber": "109001", "createdFromRefs": [{"dataType": "accountTransaction"}, {"dataType": "accountTransaction"}], "currency": "GBP", "discountPercentage": 0, "id": "0deaed0a-9f51-eb11-89f9-00224800af18", "issueDate": "2020-12-21T00:00:00", "lineItems": [{"accountRef": {"id": "6a1217b3-89d1-ea11-bbaa-000d3a2b9185", "name": "Inventory"}, "description": "Abdi Item No VAT", "discountAmount": 0, "discountPercentage": 0, "itemRef": {"id": "ITEM-dbc37b18-4209-eb11-bbf6-0022481ad2e8-EXPORT-EXPORT", "name": "Abdi Item No VAT / General Business Posting Group: 'EXPORT' / VAT Business Posting Group: 'EXPORT'"}, "quantity": 1, "subTotal": 8, "taxAmount": 0, "taxRateRef": {"effectiveTaxRate": 0, "id": "6bbc0fb9-89d1-ea11-bbaa-000d3a2b9185", "name": "Setup for EXPORT / ZERO"}, "totalAmount": 8, "trackingCategoryRefs": [], "unitAmount": 8}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-27T14:21:26Z", "note": "BCN001", "paymentAllocations": [], "remainingCredit": 8, "sourceModifiedDate": "2022-10-23T00:00:00Z", "status": "Submitted", "subTotal": 8, "supplierRef": {"id": "be1217b3-89d1-ea11-bbaa-000d3a2b9185", "supplierName": "Fabrikam, Inc."}, "totalAmount": 8, "totalDiscount": 0, "totalTaxAmount": 0, "withholdingTax": []} + Exact (Netherlands): + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + billCreditNoteId: "" + responses: + "200": + application/json: {"allocatedOnDate": "2022-10-23T00:00:00Z", "billCreditNoteNumber": "19600007", "createdFromRefs": [{"dataType": "invoice"}], "currency": "EUR", "currencyRate": 1, "discountPercentage": 0, "id": "443bd109-e1ed-4de2-b1ab-3b13e980d288", "issueDate": "2019-12-16T00:00:00Z", "lineItems": [{"accountRef": {"id": "5f139759-b554-4314-862e-b9d88e5b2e1b", "name": "Af te dragen loonheffing"}, "description": "Cheesecake", "discountAmount": 0, "quantity": 1, "subTotal": 10, "taxAmount": 2.1, "taxRateRef": {"effectiveTaxRate": 21, "id": "84277189-ad16-456c-b501-ca31f0a483cc", "name": "BTW prive gebruik"}, "totalAmount": 12.1, "trackingCategoryRefs": [], "unitAmount": 10}], "modifiedDate": "2022-10-26T13:32:18Z", "note": "Bill Credit Note with 1 line items, totaling 805.78", "paymentAllocations": [], "remainingCredit": 12.1, "sourceModifiedDate": "2020-01-03T15:06:19Z", "status": "Submitted", "subTotal": 10, "supplierRef": {"id": "5e6f49b9-6489-4b82-83e7-291d308919bb", "supplierName": "Mickey Mouse"}, "totalAmount": 12.1, "totalDiscount": 0, "totalTaxAmount": 2.1, "withholdingTax": []} + Exact (UK): + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + billCreditNoteId: "" + responses: + "200": + application/json: {"allocatedOnDate": "2022-10-23T00:00:00Z", "billCreditNoteNumber": "19600008", "createdFromRefs": [{"dataType": "invoice"}, {"dataType": "transfer"}, {"dataType": "journalEntry"}], "currency": "GBP", "currencyRate": 1, "discountPercentage": 0, "id": "f9083d38-40c7-4b5f-a693-f4670e3d85bc", "issueDate": "2019-10-30T00:00:00Z", "lineItems": [{"accountRef": {"id": "885ff551-664d-451b-995b-cb114c9877d0", "name": "Unallocated Cash"}, "description": "Oil Change", "discountAmount": 0, "itemRef": {"id": "3001"}, "quantity": 1000.5, "subTotal": -150075, "totalAmount": -150075, "trackingCategoryRefs": [], "unitAmount": -150}, {"accountRef": {"id": "885ff551-664d-451b-995b-cb114c9877d0", "name": "Unallocated Cash"}, "description": "description", "discountAmount": 0, "quantity": 1, "subTotal": 250074, "totalAmount": 250074, "trackingCategoryRefs": [], "unitAmount": 250074}], "modifiedDate": "2022-10-26T13:33:23Z", "note": "Bill Credit Note with 1 line items, totaling 805.78", "paymentAllocations": [], "remainingCredit": 99999, "sourceModifiedDate": "2019-10-30T13:12:56Z", "status": "Submitted", "subTotal": 99999, "supplierRef": {"id": "1c703cce-967c-4476-a86a-32e35341a8f5", "supplierName": "Customer Bill Supplier"}, "totalAmount": 99999, "totalDiscount": 0, "totalTaxAmount": 0, "withholdingTax": []} + FreeAgent: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + billCreditNoteId: "" + responses: + "200": + application/json: {"allocatedOnDate": "2022-10-23T00:00:00Z", "billCreditNoteNumber": "Bill Credit", "createdFromRefs": [{"dataType": "journalEntry"}], "currency": "GBP", "discountPercentage": 0, "id": "10665024", "issueDate": "2018-08-22T00:00:00", "lineItems": [{"accountRef": {"id": "285", "name": "Accommodation and Meals"}, "description": "A & J Fabtech Ltd - Bill Credit Note Bill Credit", "quantity": 1, "taxAmount": 250, "totalAmount": 1500, "trackingCategoryRefs": [], "unitAmount": 1250}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-25T14:19:10Z", "note": "Bill Credit Note with 1 line items, totaling 805.78", "paymentAllocations": [], "remainingCredit": 1500, "sourceModifiedDate": "2018-08-22T13:22:08Z", "status": "Submitted", "subTotal": 1250, "supplierRef": {"id": "6161941", "supplierName": "A & J Fabtech Ltd"}, "totalAmount": 1500, "totalDiscount": 0, "totalTaxAmount": 250, "withholdingTax": []} + KashFlow: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + billCreditNoteId: "" + responses: + "200": + application/json: {"allocatedOnDate": "2022-10-23T00:00:00Z", "billCreditNoteNumber": "5", "createdFromRefs": [{"dataType": "invoice"}, {"dataType": "accountTransaction"}, {"dataType": "accountTransaction"}], "currency": "GBP", "currencyRate": 1, "discountPercentage": 0, "id": "91339087", "issueDate": "2020-02-25T00:00:00", "lineItems": [{"accountRef": {"id": "21481832", "name": "Oil"}, "description": "Oil refund", "itemRef": {"id": "114817740"}, "quantity": 1, "subTotal": 10, "taxAmount": 0, "totalAmount": 10, "trackingCategoryRefs": [], "unitAmount": 10}], "modifiedDate": "2022-09-30T10:29:16Z", "note": "Bill Credit Note with 1 line items, totaling 805.78", "paymentAllocations": [], "remainingCredit": 0, "sourceModifiedDate": "2022-10-23T00:00:00Z", "status": "Paid", "subTotal": 0, "supplierRef": {"id": "6202387", "supplierName": "Dell"}, "totalAmount": 10, "totalDiscount": 0, "totalTaxAmount": 0, "withholdingTax": []} + Oracle NetSuite: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + billCreditNoteId: "" + responses: + "200": + application/json: {"allocatedOnDate": "2022-10-23T00:00:00Z", "billCreditNoteNumber": "VENDCRED1", "createdFromRefs": [{"dataType": "bills", "id": "1432"}], "currency": "GBP", "currencyRate": 1, "discountPercentage": 0, "id": "1781", "issueDate": "2021-11-02T00:00:00", "lineItems": [{"accountRef": {"id": "713", "name": "Inventory Asset"}, "createdFromLineRef": {"dataType": "bills", "id": "1432", "lineNumber": "1"}, "description": "billcredit_test", "quantity": 1, "subTotal": 145.5, "totalAmount": 145.5, "tracking": {"categoryRefs": [{"id": "department-1"}, {"id": "location-1"}], "isBilledTo": "Unknown", "isRebilledTo": "Unknown"}, "trackingCategoryRefs": [{"id": "department-1"}, {"id": "location-1"}], "unitAmount": 145.5, "unitOfMeasurement": "pack"}], "modifiedDate": "2022-09-20T08:16:22Z", "note": "Codat1", "paymentAllocations": [], "remainingCredit": 174.6, "sourceModifiedDate": "2021-11-02T19:58:58", "status": "Submitted", "subTotal": 145.5, "supplierRef": {"id": "749", "supplierName": "Jo's Cheese"}, "totalAmount": 174.6, "totalDiscount": 0, "totalTaxAmount": 29.1, "withholdingTax": []} + QuickBooks Desktop: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + billCreditNoteId: "" + responses: + "200": + application/json: {"allocatedOnDate": "2022-10-23T00:00:00Z", "billCreditNoteNumber": "Return", "createdFromRefs": [], "currency": "GBP", "currencyRate": 1, "discountPercentage": 0, "id": "6D2C-1197698059", "issueDate": "2024-10-30T00:00:00", "lineItems": [{"description": "Lumber:Rough - Rough lumber", "discountAmount": 0, "discountPercentage": 0, "itemRef": {"id": "1C0000-933272656", "name": "Lumber:Rough"}, "quantity": 0, "subTotal": 475, "taxAmount": 0, "totalAmount": 475, "tracking": {"categoryRefs": [{"id": "10000-933272658", "name": "New Construction"}], "isBilledTo": "Unknown", "isRebilledTo": "Unknown"}, "trackingCategoryRefs": [{"id": "10000-933272658", "name": "New Construction"}], "unitAmount": 475}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-26T09:12:30Z", "note": "Bill Credit Note with 1 line items, totaling 805.78", "paymentAllocations": [{"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": 475}, "payment": {"currency": "GBP", "currencyRate": 1, "id": "6D2C-1197698059", "paidOnDate": "2024-10-30T00:00:00", "reference": "Return", "totalAmount": 0}}], "remainingCredit": 475, "sourceModifiedDate": "2023-12-16T05:06:19", "status": "Submitted", "subTotal": 475, "supplierRef": {"id": "E0000-933272656", "supplierName": "Timberloft Lumber"}, "totalAmount": 475, "totalDiscount": 0, "totalTaxAmount": 0, "withholdingTax": []} + QuickBooks Online: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + billCreditNoteId: "" + responses: + "200": + application/json: {"allocatedOnDate": "2022-10-23T00:00:00Z", "billCreditNoteNumber": "19", "createdFromRefs": [{"dataType": "accountTransaction"}], "currency": "GBP", "currencyRate": 1, "discountPercentage": 0, "id": "19", "issueDate": "2019-05-13T00:00:00", "lineItems": [{"accountRef": {"id": "16", "name": "Advertising"}, "description": "", "quantity": 1, "subTotal": 5, "taxAmount": 0, "taxRateRef": {"effectiveTaxRate": 0, "id": "NON", "name": "NON"}, "totalAmount": 5, "tracking": {"categoryRefs": [], "isBilledTo": "Unknown", "isRebilledTo": "NotApplicable"}, "trackingCategoryRefs": [], "unitAmount": 5}], "modifiedDate": "2023-01-18T11:02:37Z", "note": "Bill Credit Note with 1 line items, totaling 805.78", "paymentAllocations": [{"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": 5}, "payment": {"currency": "GBP", "currencyRate": 1, "id": "20", "paidOnDate": "2019-05-13T00:00:00", "totalAmount": 0}}], "remainingCredit": 0, "sourceModifiedDate": "2019-05-13T13:14:06Z", "status": "Paid", "subTotal": 5, "supplierRef": {"id": "4", "supplierName": "BILLy elliot"}, "totalAmount": 5, "totalDiscount": 0, "totalTaxAmount": 0, "withholdingTax": []} + QuickBooks Online Sandbox: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + billCreditNoteId: "" + responses: + "200": + application/json: {"allocatedOnDate": "2022-10-23T00:00:00Z", "billCreditNoteNumber": "424", "createdFromRefs": [{"dataType": "invoice"}, {"dataType": "journalEntry"}, {"dataType": "transfer"}], "currency": "GBP", "currencyRate": 1, "discountPercentage": 0, "id": "424", "issueDate": "2019-06-20T00:00:00", "lineItems": [{"accountRef": {"id": "30", "name": "Janitorial Expense"}, "description": "Refund of iZettle Fees", "quantity": 1, "subTotal": 69, "taxAmount": 0, "taxRateRef": {"effectiveTaxRate": 0, "id": "20_Bills", "name": "5.0% RC CIS Bills"}, "totalAmount": 69, "tracking": {"categoryRefs": [], "isBilledTo": "Unknown", "isRebilledTo": "NotApplicable"}, "trackingCategoryRefs": [], "unitAmount": 69}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-26T09:35:58Z", "note": "Bill Credit Note with 1 line items, totaling 805.78", "paymentAllocations": [], "remainingCredit": 69, "sourceModifiedDate": "2019-06-20T15:48:50Z", "status": "Submitted", "subTotal": 69, "supplierRef": {"id": "24", "supplierName": "Brijesh Jain"}, "totalAmount": 69, "totalDiscount": 0, "totalTaxAmount": 0, "withholdingTax": []} + Sage 200cloud: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + billCreditNoteId: "" + responses: + "200": + application/json: {"allocatedOnDate": "2020-01-20T00:00:00Z", "billCreditNoteNumber": "Return 1", "createdFromRefs": [{"dataType": "invoice"}], "currency": "GBP", "currencyRate": 1, "discountPercentage": 2.5, "id": "45391", "issueDate": "2020-07-22T00:00:00Z", "lineItems": [{"description": "Tax Summary - Tax Rate 1", "discountAmount": 0.5, "quantity": 0, "subTotal": 0, "taxAmount": 20, "taxRateRef": {"effectiveTaxRate": 20, "id": "1729", "name": "Standard rate"}, "totalAmount": 20, "trackingCategoryRefs": [], "unitAmount": 0}, {"description": "Goods Summary", "discountAmount": 2.5, "quantity": 0, "subTotal": 100, "taxAmount": 0, "totalAmount": 100, "trackingCategoryRefs": [], "unitAmount": 0}], "modifiedDate": "2022-10-14T09:35:52Z", "note": "ret1", "paymentAllocations": [{"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -10.5}, "payment": {"currency": "GBP", "currencyRate": 1, "id": "45391", "note": "ret1", "paidOnDate": "2020-01-20T00:00:00", "reference": "Return 1", "totalAmount": 0}}], "remainingCredit": 109.5, "sourceModifiedDate": "2020-02-28T14:23:46Z", "status": "Submitted", "subTotal": 100, "supplierRef": {"id": "CON001", "supplierName": "Concept Stationery Supplies"}, "totalAmount": 120, "totalDiscount": 2.5, "totalTaxAmount": 20, "withholdingTax": []} + Sage 50 (UK): + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + billCreditNoteId: "" + responses: + "200": + application/json: {"allocatedOnDate": "2022-10-23T00:00:00Z", "billCreditNoteNumber": "O/BAL", "createdFromRefs": [{"dataType": "journalEntry"}, {"dataType": "transfer"}], "currency": "GBP", "currencyRate": 1, "discountPercentage": 0, "id": "20", "issueDate": "2021-12-31T00:00:00", "lineItems": [{"accountRef": {"id": "9998", "name": "Suspense Account"}, "description": "Opening Balance", "quantity": 1, "subTotal": 0.01, "taxAmount": 0, "taxRateRef": {"effectiveTaxRate": 0, "id": "9", "name": "Non-Vatable Tax Code"}, "totalAmount": 0.01, "tracking": {"categoryRefs": [{"id": "department_0", "name": "Default"}], "isBilledTo": "Unknown", "isRebilledTo": "Unknown"}, "trackingCategoryRefs": [{"id": "department_0", "name": "Default"}], "unitAmount": 0.01}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-30T14:42:37Z", "note": "Opening Balance", "paymentAllocations": [], "remainingCredit": 0.01, "sourceModifiedDate": "2022-11-25T09:43:54", "status": "Submitted", "subTotal": 0.01, "supplierRef": {"id": "NEW001", "supplierName": "Newtown Builders Ltd"}, "totalAmount": 0.01, "totalDiscount": 0, "totalTaxAmount": 0, "withholdingTax": []} + Sage Business Cloud Accounting: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + billCreditNoteId: "" + responses: + "200": + application/json: {"allocatedOnDate": "2022-10-23T00:00:00Z", "billCreditNoteNumber": "Supplier credit note", "createdFromRefs": [{"dataType": "invoice"}, {"dataType": "accountTransaction"}], "currency": "USD", "currencyRate": 0.776970973, "discountPercentage": 0, "id": "b6c6fce9866849b0b44cac99ab7dc579", "issueDate": "2018-11-23T00:00:00", "lineItems": [{"accountRef": {"id": "9a995955267a11e797950a57719b2edb", "name": "Cost of sales - goods"}, "description": "Consulting services", "discountAmount": 0, "discountPercentage": 0, "itemRef": {"id": "a87b922b33de11e797950a57719b2edb", "name": "Consulting services"}, "quantity": 1, "subTotal": 10, "taxAmount": 0, "taxRateRef": {"effectiveTaxRate": 0, "id": "GB_ZERO", "name": "Zero Rated 0.00%"}, "totalAmount": 10, "trackingCategoryRefs": [], "unitAmount": 10}], "modifiedDate": "2022-10-24T14:53:32Z", "note": "Bill Credit Note with 1 line items, totaling 805.78", "paymentAllocations": [{"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "USD", "currencyRate": 1, "totalAmount": 10}, "payment": {"accountRef": {"id": "9a25937b267a11e797950a57719b2edb", "name": "Current"}, "currency": "USD", "currencyRate": 0.771449236, "id": "bf6496aaf0294883b27c423ce8266113", "note": "Supplier refund using credit/debit card", "paidOnDate": "2019-11-19T00:00:00", "totalAmount": -10}}], "remainingCredit": 0, "sourceModifiedDate": "2019-11-19T14:17:32Z", "status": "Paid", "subTotal": 10, "supplierRef": {"id": "ec716559789111e8aaa5027d54329956", "supplierName": "Bagels Limited"}, "totalAmount": 10, "totalDiscount": 0, "totalTaxAmount": 0, "withholdingTax": []} + Sage Intacct: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + billCreditNoteId: "" + responses: + "200": + application/json: {"allocatedOnDate": "2022-10-23T00:00:00Z", "billCreditNoteNumber": "APADJ0001", "createdFromRefs": [{"dataType": "journalEntry"}], "currency": "USD", "currencyRate": 0.7283, "discountPercentage": 0, "id": "3359", "issueDate": "2021-09-20T00:00:00", "lineItems": [{"accountRef": {"id": "197", "name": "Software and Licenses"}, "description": "No Description Provided", "quantity": 1, "subTotal": 5, "taxAmount": 1, "taxRateRef": {"effectiveTaxRate": 20, "id": "47", "name": "EC Purchase Goods Standard Rate Input"}, "totalAmount": 6, "tracking": {"categoryRefs": [{"id": "LOCATION-8", "name": "United Kingdom"}, {"id": "SUPPLIER-3", "name": "ADP"}], "isBilledTo": "Unknown", "isRebilledTo": "Unknown"}, "trackingCategoryRefs": [{"id": "LOCATION-8", "name": "United Kingdom"}, {"id": "SUPPLIER-3", "name": "ADP"}], "unitAmount": 5}, {"accountRef": {"id": "197", "name": "Software and Licenses"}, "description": "No Description Provided", "quantity": 1, "subTotal": 5, "taxAmount": 1, "taxRateRef": {"effectiveTaxRate": 20, "id": "47", "name": "EC Purchase Goods Standard Rate Input"}, "totalAmount": 6, "tracking": {"categoryRefs": [{"id": "LOCATION-8", "name": "United Kingdom"}, {"id": "SUPPLIER-3", "name": "ADP"}], "isBilledTo": "Unknown", "isRebilledTo": "Unknown"}, "trackingCategoryRefs": [{"id": "LOCATION-8", "name": "United Kingdom"}, {"id": "SUPPLIER-3", "name": "ADP"}], "unitAmount": 5}], "modifiedDate": "2022-10-28T11:10:22Z", "note": "", "paymentAllocations": [], "remainingCredit": 12, "sourceModifiedDate": "2021-09-20T13:50:16", "status": "Submitted", "subTotal": 10, "supplierRef": {"id": "3", "supplierName": "ADP"}, "totalAmount": 12, "totalDiscount": 0, "totalTaxAmount": 2, "withholdingTax": []} + Xero: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + billCreditNoteId: "" + responses: + "200": + application/json: {"allocatedOnDate": "2022-10-23T00:00:00Z", "billCreditNoteNumber": "RPT429-1", "createdFromRefs": [{"dataType": "accountTransaction"}, {"dataType": "accountTransaction"}], "currency": "GBP", "currencyRate": 1, "discountPercentage": 0, "id": "ee8bec08-2be8-40ba-acd0-d53d5df11235", "issueDate": "2022-12-12T00:00:00", "lineItems": [{"accountRef": {"id": "f96c9458-d724-47bf-8f74-a9d5726465ce", "name": "General Expenses"}, "description": "Refund as agreed due to window break when guard absent", "discountAmount": 0, "discountPercentage": 0, "quantity": 1, "subTotal": 21.2, "taxAmount": 4.24, "taxRateRef": {"effectiveTaxRate": 20, "id": "INPUT2", "name": "20% (VAT on Expenses)"}, "totalAmount": 25.44, "trackingCategoryRefs": [], "unitAmount": 21.2}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-15T20:36:09Z", "note": "Bill Credit Note with 1 line items, totaling 805.78", "paymentAllocations": [{"allocation": {"allocatedOnDate": "2022-12-12T00:00:00", "currency": "GBP", "currencyRate": 1, "totalAmount": 25.44}, "payment": {"currency": "GBP", "currencyRate": 1, "id": "ee8bec08-2be8-40ba-acd0-d53d5df11235", "paidOnDate": "2022-12-12T00:00:00", "reference": "", "totalAmount": 0}}], "remainingCredit": 0, "sourceModifiedDate": "2011-04-07T07:26:30", "status": "Paid", "subTotal": 25.44, "supplierRef": {"id": "3a0d40a2-2698-4cf5-b7b2-30133c632ab6", "supplierName": "Swanston Security"}, "totalAmount": 25.44, "totalDiscount": 0, "totalTaxAmount": 4.24, "withholdingTax": []} + Unauthorized: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + billCreditNoteId: "" + responses: + "401": + application/json: {"canBeRetried": "Unknown", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "detailedErrorCode": 0, "error": "Unauthorized", "service": "PublicApi", "statusCode": 401} + get-create-update-billCreditNote-model: + Dynamics 365 Business Central: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + responses: + "200": + application/json: {"description": "A bill credit note can be thought of as a voucher issued by a supplier. It can be applied against one or multiple bills to reduce their balance.", "displayName": "Accounts Payable Credit Note", "properties": {"supplierRef": {"description": "Reference to the supplier the credit note has been issued by", "displayName": "Supplier Reference", "required": true, "type": "Object"}, "status": {"description": "The current state of a credit note", "displayName": "Credit Note Status", "options": [{"displayName": "Draft", "required": false, "type": "Array", "value": "Draft"}, {"displayName": "Submitted", "required": false, "type": "Array", "value": "Submitted"}, {"displayName": "Void", "required": false, "type": "Array", "value": "Void"}], "required": true, "type": "String"}, "issueDate": {"description": "The date the credit note was issued", "displayName": "Issue Date", "required": true, "type": "DateTime"}, "currency": {"description": "Currency of the credit note", "displayName": "Currency", "required": true, "type": "String", "validation": {"information": [], "warnings": [{"details": "Must be a valid currency code", "field": "Currency"}]}}, "note": {"description": "Note about the credit note", "displayName": "Note", "required": true, "type": "String", "validation": {"information": [], "warnings": [{"details": "Vendor Credit Memo Number must be specified in this field", "field": "Note"}]}}, "lineItems": {"description": "A collection of lines that detail items related to the credit note", "displayName": "Line items", "required": true, "type": "Array", "validation": {"information": [], "warnings": [{"details": "Must be positive", "field": "LineItems"}]}}}, "required": true, "type": "Object"} + FreeAgent: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + responses: + "200": + application/json: {"description": "A bill credit note can be thought of as a voucher issued by a supplier. It can be applied against one or multiple bills to reduce their balance.", "displayName": "Accounts Payable Credit Note", "properties": {"supplierRef": {"description": "Reference to the supplier the credit note has been issued by", "displayName": "Supplier Reference", "required": true, "type": "Object"}, "billCreditNoteNumber": {"description": "User friendly reference for the credit note", "displayName": "Credit Note Number", "required": true, "type": "String"}, "issueDate": {"description": "The date the credit note was issued", "displayName": "Issue Date", "required": true, "type": "DateTime"}, "allocatedOnDate": {"description": "The date the credit note was allocated", "displayName": "Allocated On Date", "required": true, "type": "DateTime"}, "totalAmount": {"description": "The total amount of the credit note, inclusive of discounts and tax", "displayName": "Total Amount", "required": true, "type": "Number", "validation": {"information": [], "warnings": [{"details": "Must be greater than 0 and must be equal to the sum of the line item total amounts.", "field": "TotalAmount"}]}}, "totalTaxAmount": {"description": "The amount of tax for the credit note", "displayName": "Tax Amount", "required": true, "type": "Number", "validation": {"information": [], "warnings": [{"details": "Must be greater than 0 and must be equal to the sum of the line item tax amounts.", "field": "TotalTaxAmount"}]}}, "currency": {"description": "Currency of the credit note", "displayName": "Currency", "options": [{"displayName": "AED", "required": false, "type": "String", "value": "AED"}, {"displayName": "AMD", "required": false, "type": "String", "value": "AMD"}, {"displayName": "AOA", "required": false, "type": "String", "value": "AOA"}, {"displayName": "ARS", "required": false, "type": "String", "value": "ARS"}, {"displayName": "AUD", "required": false, "type": "String", "value": "AUD"}, {"displayName": "AWG", "required": false, "type": "String", "value": "AWG"}, {"displayName": "AZN", "required": false, "type": "String", "value": "AZN"}, {"displayName": "BBD", "required": false, "type": "String", "value": "BBD"}, {"displayName": "BDT", "required": false, "type": "String", "value": "BDT"}, {"displayName": "BGN", "required": false, "type": "String", "value": "BGN"}, {"displayName": "BRL", "required": false, "type": "String", "value": "BRL"}, {"displayName": "BWP", "required": false, "type": "String", "value": "BWP"}, {"displayName": "CAD", "required": false, "type": "String", "value": "CAD"}, {"displayName": "CHF", "required": false, "type": "String", "value": "CHF"}, {"displayName": "CLP", "required": false, "type": "String", "value": "CLP"}, {"displayName": "CNY", "required": false, "type": "String", "value": "CNY"}, {"displayName": "COP", "required": false, "type": "String", "value": "COP"}, {"displayName": "CRC", "required": false, "type": "String", "value": "CRC"}, {"displayName": "CUC", "required": false, "type": "String", "value": "CUC"}, {"displayName": "CUP", "required": false, "type": "String", "value": "CUP"}, {"displayName": "CZK", "required": false, "type": "String", "value": "CZK"}, {"displayName": "DKK", "required": false, "type": "String", "value": "DKK"}, {"displayName": "DOP", "required": false, "type": "String", "value": "DOP"}, {"displayName": "EGP", "required": false, "type": "String", "value": "EGP"}, {"displayName": "EUR", "required": false, "type": "String", "value": "EUR"}, {"displayName": "FJD", "required": false, "type": "String", "value": "FJD"}, {"displayName": "GBP", "required": false, "type": "String", "value": "GBP"}, {"displayName": "GEL", "required": false, "type": "String", "value": "GEL"}, {"displayName": "GHS", "required": false, "type": "String", "value": "GHS"}, {"displayName": "GTQ", "required": false, "type": "String", "value": "GTQ"}, {"displayName": "GYD", "required": false, "type": "String", "value": "GYD"}, {"displayName": "HKD", "required": false, "type": "String", "value": "HKD"}, {"displayName": "HNL", "required": false, "type": "String", "value": "HNL"}, {"displayName": "HRK", "required": false, "type": "String", "value": "HRK"}, {"displayName": "HUF", "required": false, "type": "String", "value": "HUF"}, {"displayName": "IDR", "required": false, "type": "String", "value": "IDR"}, {"displayName": "ILS", "required": false, "type": "String", "value": "ILS"}, {"displayName": "INR", "required": false, "type": "String", "value": "INR"}, {"displayName": "ISK", "required": false, "type": "String", "value": "ISK"}, {"displayName": "JMD", "required": false, "type": "String", "value": "JMD"}, {"displayName": "JPY", "required": false, "type": "String", "value": "JPY"}, {"displayName": "KES", "required": false, "type": "String", "value": "KES"}, {"displayName": "KRW", "required": false, "type": "String", "value": "KRW"}, {"displayName": "KWD", "required": false, "type": "String", "value": "KWD"}, {"displayName": "KYD", "required": false, "type": "String", "value": "KYD"}, {"displayName": "KZT", "required": false, "type": "String", "value": "KZT"}, {"displayName": "LAK", "required": false, "type": "String", "value": "LAK"}, {"displayName": "LBP", "required": false, "type": "String", "value": "LBP"}, {"displayName": "LKR", "required": false, "type": "String", "value": "LKR"}, {"displayName": "LTL", "required": false, "type": "String", "value": "LTL"}, {"displayName": "LVL", "required": false, "type": "String", "value": "LVL"}, {"displayName": "MAD", "required": false, "type": "String", "value": "MAD"}, {"displayName": "MDL", "required": false, "type": "String", "value": "MDL"}, {"displayName": "MGA", "required": false, "type": "String", "value": "MGA"}, {"displayName": "MUR", "required": false, "type": "String", "value": "MUR"}, {"displayName": "MVR", "required": false, "type": "String", "value": "MVR"}, {"displayName": "MWK", "required": false, "type": "String", "value": "MWK"}, {"displayName": "MXN", "required": false, "type": "String", "value": "MXN"}, {"displayName": "MYR", "required": false, "type": "String", "value": "MYR"}, {"displayName": "MZN", "required": false, "type": "String", "value": "MZN"}, {"displayName": "NAD", "required": false, "type": "String", "value": "NAD"}, {"displayName": "NGN", "required": false, "type": "String", "value": "NGN"}, {"displayName": "NOK", "required": false, "type": "String", "value": "NOK"}, {"displayName": "NPR", "required": false, "type": "String", "value": "NPR"}, {"displayName": "NZD", "required": false, "type": "String", "value": "NZD"}, {"displayName": "OMR", "required": false, "type": "String", "value": "OMR"}, {"displayName": "PEN", "required": false, "type": "String", "value": "PEN"}, {"displayName": "PHP", "required": false, "type": "String", "value": "PHP"}, {"displayName": "PKR", "required": false, "type": "String", "value": "PKR"}, {"displayName": "PLN", "required": false, "type": "String", "value": "PLN"}, {"displayName": "QAR", "required": false, "type": "String", "value": "QAR"}, {"displayName": "RON", "required": false, "type": "String", "value": "RON"}, {"displayName": "RSD", "required": false, "type": "String", "value": "RSD"}, {"displayName": "RUB", "required": false, "type": "String", "value": "RUB"}, {"displayName": "RWF", "required": false, "type": "String", "value": "RWF"}, {"displayName": "SAR", "required": false, "type": "String", "value": "SAR"}, {"displayName": "SCR", "required": false, "type": "String", "value": "SCR"}, {"displayName": "SEK", "required": false, "type": "String", "value": "SEK"}, {"displayName": "SGD", "required": false, "type": "String", "value": "SGD"}, {"displayName": "THB", "required": false, "type": "String", "value": "THB"}, {"displayName": "TND", "required": false, "type": "String", "value": "TND"}, {"displayName": "TRY", "required": false, "type": "String", "value": "TRY"}, {"displayName": "TTD", "required": false, "type": "String", "value": "TTD"}, {"displayName": "TWD", "required": false, "type": "String", "value": "TWD"}, {"displayName": "TZS", "required": false, "type": "String", "value": "TZS"}, {"displayName": "UAH", "required": false, "type": "String", "value": "UAH"}, {"displayName": "UGX", "required": false, "type": "String", "value": "UGX"}, {"displayName": "USD", "required": false, "type": "String", "value": "USD"}, {"displayName": "UYU", "required": false, "type": "String", "value": "UYU"}, {"displayName": "VEF", "required": false, "type": "String", "value": "VEF"}, {"displayName": "VND", "required": false, "type": "String", "value": "VND"}, {"displayName": "VUV", "required": false, "type": "String", "value": "VUV"}, {"displayName": "XAF", "required": false, "type": "String", "value": "XAF"}, {"displayName": "XCD", "required": false, "type": "String", "value": "XCD"}, {"displayName": "XOF", "required": false, "type": "String", "value": "XOF"}, {"displayName": "ZAR", "required": false, "type": "String", "value": "ZAR"}, {"displayName": "ZMK", "required": false, "type": "String", "value": "ZMK"}], "required": false, "type": "String", "validation": {"information": [{"details": "If not specified, defaults to the company's native currency", "field": "Currency"}], "warnings": []}}, "lineItems": {"description": "A collection of lines that detail items related to the credit note", "displayName": "Line items", "required": true, "type": "Array", "validation": {"information": [], "warnings": [{"details": "Up to a maximum of 40 line items may be specified", "field": "LineItems"}]}}}, "required": true, "type": "Object"} + MYOB AccountRight and Essentials: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + responses: + "200": + application/json: {"description": "A bill credit note can be thought of as a voucher issued by a supplier. It can be applied against one or multiple bills to reduce their balance.", "displayName": "Accounts Payable Credit Note", "properties": {"totalAmount": {"description": "The total amount of the credit note, inclusive of discounts and tax", "displayName": "Total Amount", "required": true, "type": "Number", "validation": {"information": [{"details": "Must be provided.", "field": "TotalAmount"}], "warnings": [{"details": "Precision must be maximum of two decimal places.", "field": "TotalAmount"}, {"details": "Must be greater than zero.", "field": "TotalAmount"}]}}, "totalDiscount": {"description": "The value, in the given credit note currency, of any discounts applied", "displayName": "Discount Amount", "required": false, "type": "Number", "validation": {"information": [], "warnings": [{"details": "Precision must be maximum of two decimal places.", "field": "TotalDiscount"}]}}, "subTotal": {"description": "The amount of the credit note, inclusive of discounts but exclusive of tax", "displayName": "Sub Total Amount", "required": false, "type": "Number", "validation": {"information": [], "warnings": [{"details": "Precision must be maximum of two decimal places.", "field": "SubTotal"}]}}, "totalTaxAmount": {"description": "The amount of tax for the credit note", "displayName": "Tax Amount", "required": false, "type": "Number", "validation": {"information": [], "warnings": [{"details": "Precision must be maximum of two decimal places.", "field": "TotalTaxAmount"}]}}, "remainingCredit": {"description": "Unused balance of total amount originally raised", "displayName": "Remaining Credit", "required": false, "type": "Number", "validation": {"information": [], "warnings": [{"details": "Precision must be maximum of two decimal places.", "field": "RemainingCredit"}]}}, "issueDate": {"description": "The date the credit note was issued", "displayName": "Issue Date", "required": true, "type": "DateTime", "validation": {"information": [{"details": "Must be provided.", "field": "IssueDate"}], "warnings": []}}, "supplierRef": {"description": "Reference to the supplier the credit note has been issued by", "displayName": "Supplier Reference", "required": true, "type": "Object", "validation": {"information": [{"details": "Must be provided.", "field": "SupplierRef"}], "warnings": []}}, "lineItems": {"description": "A collection of lines that detail items related to the credit note", "displayName": "Line items", "required": true, "type": "Array", "validation": {"information": [{"details": "Must be provided.", "field": "LineItems"}], "warnings": []}}}, "required": true, "type": "Object"} + Oracle NetSuite: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + responses: + "200": + application/json: {"description": "A bill credit note can be thought of as a voucher issued by a supplier. It can be applied against one or multiple bills to reduce their balance.", "displayName": "Accounts Payable Credit Note", "properties": {"supplierRef": {"description": "Reference to the supplier the credit note has been issued by", "displayName": "Supplier Reference", "required": true, "type": "Object"}, "issueDate": {"description": "The date the credit note was issued", "displayName": "Issue Date", "required": true, "type": "DateTime"}, "currency": {"description": "Currency of the credit note", "displayName": "Currency", "required": true, "type": "String"}, "note": {"description": "Note about the credit note", "displayName": "Note", "required": false, "type": "String"}, "status": {"description": "The current state of a credit note", "displayName": "Credit Note Status", "options": [{"displayName": "Submitted", "required": false, "type": "String", "value": "Submitted"}], "required": true, "type": "String"}, "lineItems": {"description": "A collection of lines that detail items related to the credit note", "displayName": "Line items", "required": true, "type": "Array"}}, "required": true, "type": "Object"} + QuickBooks Desktop: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + responses: + "200": + application/json: {"description": "A bill credit note can be thought of as a voucher issued by a supplier. It can be applied against one or multiple bills to reduce their balance.", "displayName": "Accounts Payable Credit Note", "properties": {"supplierRef": {"description": "Reference to the supplier the credit note has been issued by", "displayName": "Supplier Reference", "required": true, "type": "Object"}, "issueDate": {"description": "The date the credit note was issued", "displayName": "Issue Date", "required": true, "type": "DateTime"}, "currency": {"description": "Currency of the credit note", "displayName": "Currency", "required": false, "type": "String", "validation": {"information": [{"details": "If not set, will default to the default currency of the supplier.", "field": "Currency"}], "warnings": [{"details": "Must be a three letter ISO code that matches the currency of the supplier.", "field": "Currency"}, {"details": "Can only be set if the QuickBooks Desktop company has Multicurrency enabled.", "field": "Currency"}]}}, "currencyRate": {"description": "The exchange rate between the currency of the credit note and the base currency of the company", "displayName": "Currency Exchange Rate", "required": false, "type": "Number", "validation": {"information": [{"details": "If not set, will default to the rate set within QuickBooks Desktop, if no rate is set in QuickBooks Desktop, it will default to 1.", "field": "CurrencyRate"}, {"details": "Can only be set if the Quickbooks Desktop company has Multicurrency enabled.", "field": "CurrencyRate"}], "warnings": []}}, "totalTaxAmount": {"description": "The amount of tax for the credit note", "displayName": "Tax Amount", "required": true, "type": "Number", "validation": {"information": [], "warnings": [{"details": "Cannot be mapped directly into QuickBooks Desktop and will only be used for validation purposes", "field": "TotalTaxAmount"}, {"details": "Must match sum of total of tax from the line items", "field": "TotalTaxAmount"}]}}, "subTotal": {"description": "The amount of the credit note, inclusive of discounts but exclusive of tax", "displayName": "Sub Total Amount", "required": true, "type": "Number", "validation": {"information": [], "warnings": [{"details": "Must match the totalAmount - taxAmount", "field": "SubTotal"}]}}, "totalAmount": {"description": "The total amount of the credit note, inclusive of discounts and tax", "displayName": "Total Amount", "required": true, "type": "Number", "validation": {"information": [{"details": "If a bill credit note is pushed with a total amount of 0, it will automatically be marked as paid in QuickBooks Desktop", "field": "TotalAmount"}], "warnings": [{"details": "Must match the sum of line items ((quantity * unit price) - discount + tax)", "field": "TotalAmount"}]}}, "note": {"description": "Note about the credit note", "displayName": "Note", "required": false, "type": "String", "validation": {"information": [], "warnings": [{"details": "Max length of 4000 characters.", "field": "Note"}]}}, "status": {"description": "The current state of a credit note", "displayName": "Credit Note Status", "options": [{"displayName": "Submitted", "required": false, "type": "String", "value": "Submitted"}, {"displayName": "Paid", "required": false, "type": "String", "value": "Paid"}, {"displayName": "Void", "required": false, "type": "String", "value": "Void"}], "required": true, "type": "String", "validation": {"information": [{"details": "If a bill credit note is pushed with a status of void, then all the amounts in the bill credit note must be 0", "field": "Status"}, {"details": "If a bill credit note is pushed without payment allocations, then the status must be Submitted, if pushed with payment allocations, then the status must be paid", "field": "Status"}], "warnings": [{"details": "If a bill credit note is pushed with a total amount of 0, then the status must be Paid or Void", "field": "Status"}]}}, "lineItems": {"description": "A collection of lines that detail items related to the credit note", "displayName": "Line items", "required": true, "type": "Array"}, "paymentAllocations": {"description": "A collection of payments that are allocated to (i.e. spend) the credit note", "displayName": "Payment Allocations", "required": false, "type": "Array", "validation": {"information": [{"details": "If a payment allocation is provided, a credit card credit will created in QuickBooksDesktop, if left as null or empty, a {topLevelItem} will be created", "field": "PaymentAllocations"}], "warnings": [{"details": "A maximum of one payment allocation may be provided per bill credit note", "field": "PaymentAllocations"}]}}}, "required": true, "type": "Object"} + QuickBooks Online Sandbox: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + responses: + "200": + application/json: {"description": "A bill credit note can be thought of as a voucher issued by a supplier. It can be applied against one or multiple bills to reduce their balance.", "displayName": "Accounts Payable Credit Note", "properties": {"billCreditNoteNumber": {"description": "User friendly reference for the credit note", "displayName": "Credit Note Number", "required": false, "type": "String"}, "supplierRef": {"description": "Reference to the supplier the credit note has been issued by", "displayName": "Supplier Reference", "required": true, "type": "Object"}, "currency": {"description": "Currency of the credit note", "displayName": "Currency", "required": false, "type": "String", "validation": {"information": [{"details": "Required if multi-currency is enabled for the company.", "field": "Currency"}], "warnings": []}}, "currencyRate": {"description": "The exchange rate between the currency of the credit note and the base currency of the company", "displayName": "Currency Exchange Rate", "required": false, "type": "Number", "validation": {"information": [{"details": "Required if Currency is not the base currency.", "field": "CurrencyRate"}], "warnings": []}}, "note": {"description": "Note about the credit note", "displayName": "Note", "required": false, "type": "String"}, "issueDate": {"description": "The date the credit note was issued", "displayName": "Issue Date", "required": false, "type": "DateTime", "validation": {"information": [{"details": "If the issue date is not supplied, the current date on the server is used", "field": "IssueDate"}], "warnings": []}}, "status": {"description": "The current state of a credit note", "displayName": "Credit Note Status", "options": [{"displayName": "Submitted", "required": false, "type": "String", "value": "Submitted"}, {"displayName": "Paid", "required": false, "type": "String", "value": "Paid"}], "required": true, "type": "String"}, "lineItems": {"description": "A collection of lines that detail items related to the credit note", "displayName": "Line items", "required": true, "type": "Array"}, "paymentAllocations": {"description": "A collection of payments that are allocated to (i.e. spend) the credit note", "displayName": "Payment Allocations", "required": false, "type": "Array", "validation": {"information": [], "warnings": [{"details": "Payment Allocations are no longer valid for BillCreditNotes and must not be provided, use the DirectCost data type to push credit card credits.", "field": "PaymentAllocations"}]}}}, "required": true, "type": "Object"} + QuickBooks Online: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + responses: + "200": + application/json: {"description": "A bill credit note can be thought of as a voucher issued by a supplier. It can be applied against one or multiple bills to reduce their balance.", "displayName": "Accounts Payable Credit Note", "properties": {"billCreditNoteNumber": {"description": "User friendly reference for the credit note", "displayName": "Credit Note Number", "required": false, "type": "String"}, "supplierRef": {"description": "Reference to the supplier the credit note has been issued by", "displayName": "Supplier Reference", "required": true, "type": "Object"}, "currency": {"description": "Currency of the credit note", "displayName": "Currency", "required": false, "type": "String", "validation": {"information": [{"details": "Required if multi-currency is enabled for the company.", "field": "Currency"}], "warnings": []}}, "currencyRate": {"description": "The exchange rate between the currency of the credit note and the base currency of the company", "displayName": "Currency Exchange Rate", "required": false, "type": "Number", "validation": {"information": [{"details": "Required if Currency is not the base currency.", "field": "CurrencyRate"}], "warnings": []}}, "note": {"description": "Note about the credit note", "displayName": "Note", "required": false, "type": "String"}, "issueDate": {"description": "The date the credit note was issued", "displayName": "Issue Date", "required": false, "type": "DateTime", "validation": {"information": [{"details": "If the issue date is not supplied, the current date on the server is used", "field": "IssueDate"}], "warnings": []}}, "status": {"description": "The current state of a credit note", "displayName": "Credit Note Status", "options": [{"displayName": "Submitted", "required": false, "type": "String", "value": "Submitted"}, {"displayName": "Paid", "required": false, "type": "String", "value": "Paid"}], "required": true, "type": "String"}, "lineItems": {"description": "A collection of lines that detail items related to the credit note", "displayName": "Line items", "required": true, "type": "Array"}, "paymentAllocations": {"description": "A collection of payments that are allocated to (i.e. spend) the credit note", "displayName": "Payment Allocations", "required": false, "type": "Array", "validation": {"information": [], "warnings": [{"details": "Payment Allocations are no longer valid for BillCreditNotes and must not be provided, use the DirectCost data type to push credit card credits.", "field": "PaymentAllocations"}]}}}, "required": true, "type": "Object"} + Sage 50 (UK): + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + responses: + "200": + application/json: {"description": "A bill credit note can be thought of as a voucher issued by a supplier. It can be applied against one or multiple bills to reduce their balance.", "displayName": "Accounts Payable Credit Note", "properties": {"supplierRef": {"description": "Supplier providing the bill credit note.", "displayName": "Supplier", "required": true, "type": "Object"}, "issueDate": {"description": "Date when the bill credit note was issued.", "displayName": "Date", "required": true, "type": "DateTime"}, "billCreditNoteNumber": {"description": "The reference number for this bill credit note", "displayName": "Bill Credit Note Number", "required": true, "type": "String"}, "currency": {"description": "The currency in which the bill credit note is issued.", "displayName": "Currency", "required": true, "type": "String", "validation": {"information": [], "warnings": [{"details": "This must match the supplier's default currency.", "field": "currency"}]}}, "status": {"description": "The status of the bill credit note", "displayName": "Status", "options": [{"displayName": "Submitted", "required": false, "type": "String", "value": "Submitted"}], "required": true, "type": "String"}, "note": {"description": "To be used for any additional information associated with the bill credit note line item.", "displayName": "Note", "required": false, "type": "String", "validation": {"information": [], "warnings": [{"details": "Maximum 60 characters", "field": "note"}]}}, "lineItems": {"description": "Line items of the bill credit note.", "displayName": "Line Items", "required": true, "type": "Array"}}, "required": true, "type": "Object", "validation": {"information": [{"details": "Pushing to Sage 50 2015 (v21) or below is not supported. To enable push, please upgrade to at least Sage 50 2016 (v22) and re-sync the company."}], "warnings": []}} + Sage Business Cloud Accounting: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + responses: + "200": + application/json: {"description": "A bill credit note can be thought of as a voucher issued by a supplier. It can be applied against one or multiple bills to reduce their balance.", "displayName": "Accounts Payable Credit Note", "properties": {"issueDate": {"description": "The date the credit note was issued", "displayName": "Issue Date", "required": true, "type": "DateTime", "validation": {"information": [{"details": "Must be provided.", "field": "IssueDate"}], "warnings": []}}, "currency": {"description": "Currency of the credit note", "displayName": "Currency", "required": false, "type": "String", "validation": {"information": [{"details": "If supplied, must match the currency of the supplier.", "field": "Currency"}], "warnings": []}}, "currencyRate": {"description": "The exchange rate between the currency of the credit note and the base currency of the company", "displayName": "Currency Exchange Rate", "required": false, "type": "Number"}, "supplierRef": {"description": "Reference to the supplier the credit note has been issued by", "displayName": "Supplier Reference", "required": true, "type": "Object"}, "totalAmount": {"description": "The total amount of the credit note, inclusive of discounts and tax", "displayName": "Total Amount", "required": false, "type": "Number", "validation": {"information": [{"details": "If supplied, must match the sum of all line item total amounts.", "field": "TotalAmount"}], "warnings": []}}, "billCreditNoteNumber": {"description": "User friendly reference for the credit note", "displayName": "Credit Note Number", "required": false, "type": "String", "validation": {"information": [{"details": "Should not be longer than 25 characters.", "field": "BillCreditNoteNumber"}], "warnings": []}}, "lineItems": {"description": "A collection of lines that detail items related to the credit note", "displayName": "Line items", "required": true, "type": "Array", "validation": {"information": [{"details": "Must be provided.", "field": "LineItems"}], "warnings": []}}}, "required": true, "type": "Object"} + Sage Intacct: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + responses: + "200": + application/json: {"description": "A bill credit note can be thought of as a voucher issued by a supplier. It can be applied against one or multiple bills to reduce their balance.", "displayName": "Accounts Payable Credit Note", "properties": {"status": {"description": "The current state of a credit note", "displayName": "Credit Note Status", "options": [{"displayName": "Draft", "required": false, "type": "String", "value": "Draft"}, {"displayName": "Submitted", "required": false, "type": "String", "value": "Submitted"}], "required": false, "type": "String", "validation": {"information": [{"details": "If not specified will default to Submitted.", "field": "Status"}], "warnings": []}}, "supplierRef": {"description": "Reference to the supplier the credit note has been issued by", "displayName": "Supplier Reference", "required": true, "type": "Object"}, "issueDate": {"description": "The date the credit note was issued", "displayName": "Issue Date", "required": true, "type": "DateTime"}, "allocatedOnDate": {"description": "The date the credit note was allocated", "displayName": "Allocated On Date", "required": false, "type": "DateTime"}, "currency": {"description": "Currency of the credit note", "displayName": "Currency", "options": [{"displayName": "Australian Dollar", "required": false, "type": "String", "value": "AUD"}, {"displayName": "Canadian Dollar", "required": false, "type": "String", "value": "CAD"}, {"displayName": "Pound Sterling", "required": false, "type": "String", "value": "GBP"}, {"displayName": "US Dollar", "required": false, "type": "String", "value": "USD"}, {"displayName": "Rand", "required": false, "type": "String", "value": "ZAR"}], "required": false, "type": "String", "validation": {"information": [{"details": "Must be provided if CurrencyRate is set.", "field": "Currency"}], "warnings": []}}, "currencyRate": {"description": "The exchange rate between the currency of the credit note and the base currency of the company", "displayName": "Currency Exchange Rate", "required": false, "type": "Number"}, "note": {"description": "Note about the credit note", "displayName": "Note", "required": false, "type": "String", "validation": {"information": [{"details": "Must contain no more than 1000 characters.", "field": "Note"}], "warnings": []}}, "lineItems": {"description": "A collection of lines that detail items related to the credit note", "displayName": "Line items", "required": true, "type": "Array", "validation": {"information": [{"details": "Must contain at least one line item.", "field": "LineItems"}], "warnings": []}}}, "required": true, "type": "Object"} + Sandbox: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + responses: + "200": + application/json: {"description": "A bill credit note can be thought of as a voucher issued by a supplier. It can be applied against one or multiple bills to reduce their balance.", "displayName": "Accounts Payable Credit Note", "properties": {"billCreditNoteNumber": {"description": "User friendly reference for the credit note", "displayName": "Credit Note Number", "required": true, "type": "String"}, "supplierRef": {"description": "Reference to the supplier the credit note has been issued by", "displayName": "Supplier Reference", "required": true, "type": "Object"}, "withholdingTax": {"description": "A collection of tax deductions", "displayName": "Withholding Tax", "required": true, "type": "Array"}, "totalAmount": {"description": "The total amount of the credit note, inclusive of discounts and tax", "displayName": "Total Amount", "required": true, "type": "Number"}, "totalDiscount": {"description": "The value, in the given credit note currency, of any discounts applied", "displayName": "Discount Amount", "required": true, "type": "Number"}, "subTotal": {"description": "The amount of the credit note, inclusive of discounts but exclusive of tax", "displayName": "Sub Total Amount", "required": true, "type": "Number"}, "totalTaxAmount": {"description": "The amount of tax for the credit note", "displayName": "Tax Amount", "required": true, "type": "Number"}, "discountPercentage": {"description": "The percentage rate of any discount that has been applied", "displayName": "Discount Percentage", "required": true, "type": "Number"}, "remainingCredit": {"description": "Unused balance of total amount originally raised", "displayName": "Remaining Credit", "required": true, "type": "Number"}, "status": {"description": "The current state of a credit note", "displayName": "Credit Note Status", "required": true, "type": "String"}, "issueDate": {"description": "The date the credit note was issued", "displayName": "Issue Date", "required": true, "type": "DateTime"}, "allocatedOnDate": {"description": "The date the credit note was allocated", "displayName": "Allocated On Date", "required": true, "type": "DateTime"}, "currency": {"description": "Currency of the credit note", "displayName": "Currency", "required": true, "type": "String"}, "currencyRate": {"description": "The exchange rate between the currency of the credit note and the base currency of the company", "displayName": "Currency Exchange Rate", "required": true, "type": "Number"}, "lineItems": {"description": "A collection of lines that detail items related to the credit note", "displayName": "Line items", "required": true, "type": "Array"}, "paymentAllocations": {"description": "A collection of payments that are allocated to (i.e. spend) the credit note", "displayName": "Payment Allocations", "required": true, "type": "Array"}, "metadata": {"description": "Miscellaneous data about the item", "displayName": "Metadata", "required": true, "type": "Object"}, "note": {"description": "Note about the credit note", "displayName": "Note", "required": true, "type": "String"}}, "required": true, "type": "Object"} + Xero: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + responses: + "200": + application/json: {"description": "A bill credit note can be thought of as a voucher issued by a supplier. It can be applied against one or multiple bills to reduce their balance.", "displayName": "Accounts Payable Credit Note", "properties": {"supplierRef": {"description": "Reference to the supplier the credit note has been issued by", "displayName": "Supplier Reference", "required": true, "type": "Object", "validation": {"information": [{"details": "Must be provided.", "field": "SupplierRef"}], "warnings": []}}, "totalAmount": {"description": "The total amount of the credit note, inclusive of discounts and tax", "displayName": "Total Amount", "required": true, "type": "Number", "validation": {"information": [{"details": "Must be provided and must equal the sum of the link items amount.", "field": "TotalAmount"}], "warnings": [{"details": "Must be greater than zero.", "field": "TotalAmount"}]}}, "issueDate": {"description": "The date the credit note was issued", "displayName": "Issue Date", "required": true, "type": "DateTime", "validation": {"information": [{"details": "Must be provided.", "field": "IssueDate"}], "warnings": []}}, "billCreditNoteNumber": {"description": "User friendly reference for the credit note", "displayName": "Credit Note Number", "required": false, "type": "String", "validation": {"information": [{"details": "Must not be longer than 225 characters long.", "field": "BillCreditNoteNumber"}], "warnings": []}}, "currency": {"description": "Currency of the credit note", "displayName": "Currency", "required": false, "type": "String"}, "currencyRate": {"description": "The exchange rate between the currency of the credit note and the base currency of the company", "displayName": "Currency Exchange Rate", "required": false, "type": "Number"}, "status": {"description": "The current state of a credit note", "displayName": "Credit Note Status", "options": [{"displayName": "Draft", "required": false, "type": "String", "value": "Draft"}, {"displayName": "Submitted", "required": false, "type": "String", "value": "Submitted"}, {"displayName": "Paid", "required": false, "type": "String", "value": "Paid"}], "required": true, "type": "String", "validation": {"information": [{"details": "Must be provided.", "field": "Status"}], "warnings": []}}, "lineItems": {"description": "A collection of lines that detail items related to the credit note", "displayName": "Line items", "required": true, "type": "Array", "validation": {"information": [{"details": "Must be provided.", "field": "LineItems"}], "warnings": []}}}, "required": true, "type": "Object"} + Unauthorized: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + responses: + "401": + application/json: {"canBeRetried": "Unknown", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "detailedErrorCode": 0, "error": "Unauthorized", "service": "PublicApi", "statusCode": 401} + list-bill-credit-notes: + "": + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/{id}/data/{dataType}?page=1&pageSize=10"}, "self": {"href": "/companies/{id}/data/{dataType}"}}, "pageNumber": 1, "pageSize": 10, "results": [{"allocatedOnDate": "2022-10-23T00:00:00Z", "billCreditNoteNumber": "14763237", "createdFromRefs": [{"dataType": "accountTransaction"}, {"dataType": "journalEntry"}], "currency": "USD", "discountPercentage": 0, "id": "6a0e9dfb-87b0-47d3-aaaf-9753ae9e757d", "issueDate": "2019-02-18T16:03:07.268Z", "lineItems": [{"accountRef": {"id": "3f267b10-757d-44c0-bef9-20f70cc8fbe3"}, "description": "AcmeMagnet", "discountAmount": 0, "itemRef": {"id": "3"}, "quantity": 4, "subTotal": 100, "taxAmount": 10, "taxRateRef": {"id": "6c88aff3-7cb9-4980-a3d3-443e72e02498"}, "totalAmount": 110, "trackingCategoryRefs": [{"id": "department_1", "name": "ACMERockets"}, {"id": "costcode_2", "name": "ACM2-ACMESigns"}], "unitAmount": 25}, {"accountRef": {"id": "3f267b10-757d-44c0-bef9-20f70cc8fbe3"}, "description": "ACMEDisintegratingPistol", "discountAmount": 0, "itemRef": {"id": "3abf0883-03f7-44c6-bc15-1372522d25e1"}, "quantity": 3, "subTotal": 75, "taxAmount": 7.5, "taxRateRef": {"id": "6c88aff3-7cb9-4980-a3d3-443e72e02498"}, "totalAmount": 82.5, "unitAmount": 25}, {"accountRef": {"id": "3f267b10-757d-44c0-bef9-20f70cc8fbe3"}, "description": "ACMEWhippedCreamDispenser", "discountAmount": 0, "itemRef": {"id": "3691f3d9-0ff7-4358-8a93-bed31c1b4b03"}, "quantity": 6, "subTotal": 312, "taxAmount": 31.2, "taxRateRef": {"id": "6c88aff3-7cb9-4980-a3d3-443e72e02498"}, "totalAmount": 343.2, "unitAmount": 52}, {"accountRef": {"id": "3f267b10-757d-44c0-bef9-20f70cc8fbe3"}, "description": "ACMEJetPropelledPogoStick", "discountAmount": 0, "itemRef": {"id": "075410d4-7edc-4936-ba52-9e1e43cbe300"}, "quantity": 1, "subTotal": 130, "taxAmount": 27.3, "taxRateRef": {"id": "d606732b-db18-44d7-823b-7f15f42c32ea"}, "totalAmount": 157.3, "unitAmount": 130}], "modifiedDate": "2022-10-23T00:00:00Z", "note": "Track separately", "paymentAllocations": [], "remainingCredit": 693, "sourceModifiedDate": "2022-10-23T00:00:00Z", "status": "Submitted", "subTotal": 805.78, "supplierRef": {"id": "67C6A7A1-5E84-4AC4-B950-24A114E379D0", "supplierName": "Chin's Gas and Oil"}, "totalAmount": 693, "totalDiscount": 0, "totalTaxAmount": 0}], "totalResults": 1} + "400": {} + Dynamics 365 Business Central: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/d6849caf-c146-41be-8335-b73346e3bd84/data/billCreditNotes?page=1&pageSize=2"}, "next": {"href": "/companies/d6849caf-c146-41be-8335-b73346e3bd84/data/billCreditNotes?page=2&pageSize=2"}, "self": {"href": "/companies/d6849caf-c146-41be-8335-b73346e3bd84/data/billCreditNotes"}}, "pageNumber": 1, "pageSize": 2, "results": [{"allocatedOnDate": "2022-10-23T00:00:00Z", "billCreditNoteNumber": "109001", "createdFromRefs": [], "currency": "GBP", "discountPercentage": 0, "id": "0deaed0a-9f51-eb11-89f9-00224800af18", "issueDate": "2020-12-21T00:00:00", "lineItems": [{"accountRef": {"id": "6a1217b3-89d1-ea11-bbaa-000d3a2b9185", "name": "Inventory"}, "description": "Abdi Item No VAT", "discountAmount": 0, "discountPercentage": 0, "itemRef": {"id": "ITEM-dbc37b18-4209-eb11-bbf6-0022481ad2e8-EXPORT-EXPORT", "name": "Abdi Item No VAT / General Business Posting Group: 'EXPORT' / VAT Business Posting Group: 'EXPORT'"}, "quantity": 1, "subTotal": 8, "taxAmount": 0, "taxRateRef": {"effectiveTaxRate": 0, "id": "6bbc0fb9-89d1-ea11-bbaa-000d3a2b9185", "name": "Setup for EXPORT / ZERO"}, "totalAmount": 8, "trackingCategoryRefs": [], "unitAmount": 8}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-27T14:21:26Z", "note": "BCN001", "paymentAllocations": [], "remainingCredit": 8, "sourceModifiedDate": "2022-10-23T00:00:00Z", "status": "Submitted", "subTotal": 8, "supplierRef": {"id": "be1217b3-89d1-ea11-bbaa-000d3a2b9185", "supplierName": "Fabrikam, Inc."}, "totalAmount": 8, "totalDiscount": 0, "totalTaxAmount": 0, "withholdingTax": []}, {"allocatedOnDate": "2022-10-23T00:00:00Z", "billCreditNoteNumber": "109002", "createdFromRefs": [], "currency": "GBP", "discountPercentage": 0, "id": "157c025f-a19e-eb11-8ce6-0022481a7bed", "issueDate": "2021-01-26T00:00:00", "lineItems": [{"accountRef": {"id": "6a1217b3-89d1-ea11-bbaa-000d3a2b9185", "name": "Inventory"}, "description": "Abdi Item No VAT", "discountAmount": 0, "discountPercentage": 0, "itemRef": {"id": "ITEM-dbc37b18-4209-eb11-bbf6-0022481ad2e8-EXPORT-EXPORT", "name": "Abdi Item No VAT / General Business Posting Group: 'EXPORT' / VAT Business Posting Group: 'EXPORT'"}, "quantity": 1, "subTotal": 20, "taxAmount": 0, "taxRateRef": {"effectiveTaxRate": 0, "id": "6bbc0fb9-89d1-ea11-bbaa-000d3a2b9185", "name": "Setup for EXPORT / ZERO"}, "totalAmount": 20, "trackingCategoryRefs": [], "unitAmount": 20}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-27T14:21:26Z", "note": "16042021", "paymentAllocations": [{"allocation": {"allocatedOnDate": "2021-04-16T00:00:00", "currency": "GBP", "currencyRate": 1, "totalAmount": 10}, "payment": {"currency": "GBP", "currencyRate": 1, "id": "257c025f-a19e-eb11-8ce6-0022481a7bed", "note": "Credit Memo 1002", "paidOnDate": "2021-01-26T00:00:00", "reference": "109002", "totalAmount": 0}}], "remainingCredit": 10, "sourceModifiedDate": "2022-10-23T00:00:00Z", "status": "PartiallyPaid", "subTotal": 20, "supplierRef": {"id": "be1217b3-89d1-ea11-bbaa-000d3a2b9185", "supplierName": "Fabrikam, Inc."}, "totalAmount": 20, "totalDiscount": 0, "totalTaxAmount": 0, "withholdingTax": []}], "totalResults": 224} + Exact (Netherlands): + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/b83b1923-4db6-45a8-a779-b4e320c15979/data/billCreditNotes?page=1&pageSize=2"}, "next": {"href": "/companies/b83b1923-4db6-45a8-a779-b4e320c15979/data/billCreditNotes?page=2&pageSize=2"}, "self": {"href": "/companies/b83b1923-4db6-45a8-a779-b4e320c15979/data/billCreditNotes"}}, "pageNumber": 1, "pageSize": 2, "results": [{"allocatedOnDate": "2022-10-23T00:00:00Z", "billCreditNoteNumber": "19600007", "createdFromRefs": [{"dataType": "journalEntry"}, {"dataType": "journalEntry"}], "currency": "EUR", "currencyRate": 1, "discountPercentage": 0, "id": "443bd109-e1ed-4de2-b1ab-3b13e980d288", "issueDate": "2019-12-16T00:00:00Z", "lineItems": [{"accountRef": {"id": "5f139759-b554-4314-862e-b9d88e5b2e1b", "name": "Af te dragen loonheffing"}, "description": "Cheesecake", "discountAmount": 0, "quantity": 1, "subTotal": 10, "taxAmount": 2.1, "taxRateRef": {"effectiveTaxRate": 21, "id": "84277189-ad16-456c-b501-ca31f0a483cc", "name": "BTW prive gebruik"}, "totalAmount": 12.1, "trackingCategoryRefs": [], "unitAmount": 10}], "modifiedDate": "2022-10-26T13:32:18Z", "note": "Bill Credit Note with 1 line items, totaling 805.78", "paymentAllocations": [], "remainingCredit": 12.1, "sourceModifiedDate": "2020-01-03T15:06:19Z", "status": "Submitted", "subTotal": 10, "supplierRef": {"id": "5e6f49b9-6489-4b82-83e7-291d308919bb", "supplierName": "Mickey Mouse"}, "totalAmount": 12.1, "totalDiscount": 0, "totalTaxAmount": 2.1, "withholdingTax": []}, {"allocatedOnDate": "2022-10-23T00:00:00Z", "billCreditNoteNumber": "20600003", "createdFromRefs": [{"dataType": "journalEntry"}], "currency": "EUR", "currencyRate": 1, "discountPercentage": 0, "id": "6643f559-d7e9-4cfe-802f-60beddbc4ed9", "issueDate": "2020-01-20T00:00:00Z", "lineItems": [{"accountRef": {"id": "f6c251f5-21d0-4164-9b8f-17789fd2fee9", "name": "Kosten werkgeverslasten vakantiegeld"}, "description": "1 transactions of type CARD_PAYMENT_FEE_REFUND", "discountAmount": 0, "quantity": 1, "subTotal": 13.57, "totalAmount": 13.57, "trackingCategoryRefs": [], "unitAmount": 13.57}], "modifiedDate": "2022-10-26T13:32:18Z", "note": "Bill Credit Note with 1 line items, totaling 805.78", "paymentAllocations": [], "remainingCredit": 13.57, "sourceModifiedDate": "2020-01-20T19:38:37Z", "status": "Submitted", "subTotal": 13.57, "supplierRef": {"id": "f87070e2-bbd7-4383-a7c9-824748c1d70e", "supplierName": "Exact Software Nederland B.V."}, "totalAmount": 13.57, "totalDiscount": 0, "totalTaxAmount": 0, "withholdingTax": []}], "totalResults": 42} + Exact (UK): + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/d95030cd-22b2-482b-9c7b-2980dcc2b1ce/data/billCreditNotes?page=1&pageSize=2"}, "next": {"href": "/companies/d95030cd-22b2-482b-9c7b-2980dcc2b1ce/data/billCreditNotes?page=2&pageSize=2"}, "self": {"href": "/companies/d95030cd-22b2-482b-9c7b-2980dcc2b1ce/data/billCreditNotes"}}, "pageNumber": 1, "pageSize": 2, "results": [{"allocatedOnDate": "2022-10-23T00:00:00Z", "billCreditNoteNumber": "19600008", "createdFromRefs": [{"dataType": "transfer"}, {"dataType": "invoice"}], "currency": "GBP", "currencyRate": 1, "discountPercentage": 0, "id": "f9083d38-40c7-4b5f-a693-f4670e3d85bc", "issueDate": "2019-10-30T00:00:00Z", "lineItems": [{"accountRef": {"id": "885ff551-664d-451b-995b-cb114c9877d0", "name": "Unallocated Cash"}, "description": "Oil Change", "discountAmount": 0, "itemRef": {"id": "3001"}, "quantity": 1000.5, "subTotal": -150075, "totalAmount": -150075, "trackingCategoryRefs": [], "unitAmount": -150}, {"accountRef": {"id": "885ff551-664d-451b-995b-cb114c9877d0", "name": "Unallocated Cash"}, "description": "description", "discountAmount": 0, "quantity": 1, "subTotal": 250074, "totalAmount": 250074, "trackingCategoryRefs": [], "unitAmount": 250074}], "modifiedDate": "2022-10-26T13:33:23Z", "note": "Bill Credit Note with 1 line items, totaling 805.78", "paymentAllocations": [], "remainingCredit": 99999, "sourceModifiedDate": "2019-10-30T13:12:56Z", "status": "Submitted", "subTotal": 99999, "supplierRef": {"id": "1c703cce-967c-4476-a86a-32e35341a8f5", "supplierName": "Customer Bill Supplier"}, "totalAmount": 99999, "totalDiscount": 0, "totalTaxAmount": 0, "withholdingTax": []}, {"allocatedOnDate": "2022-10-23T00:00:00Z", "billCreditNoteNumber": "19600009", "createdFromRefs": [{"dataType": "transfer"}], "currency": "GBP", "currencyRate": 1, "discountPercentage": 0, "id": "05023688-5bd5-4034-ae4c-5e3e5099bbfb", "issueDate": "2019-11-01T00:00:00Z", "lineItems": [{"accountRef": {"id": "62be6536-f4ea-49b8-9797-1adc23982334", "name": "Depreciation"}, "description": "Credit note line item #5", "discountAmount": 0, "quantity": 1, "subTotal": 10, "totalAmount": 10, "trackingCategoryRefs": [], "unitAmount": 10}], "modifiedDate": "2022-10-26T13:33:23Z", "note": "Bill Credit Note with 1 line items, totaling 805.78", "paymentAllocations": [], "remainingCredit": 10, "sourceModifiedDate": "2019-11-01T15:07:18Z", "status": "Submitted", "subTotal": 10, "supplierRef": {"id": "1c703cce-967c-4476-a86a-32e35341a8f5", "supplierName": "Customer Bill Supplier"}, "totalAmount": 10, "totalDiscount": 0, "totalTaxAmount": 0, "withholdingTax": []}], "totalResults": 40} + FreeAgent: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/071ad738-68f3-4561-afd0-69bab9df0803/data/billCreditNotes?page=1&pageSize=2"}, "next": {"href": "/companies/071ad738-68f3-4561-afd0-69bab9df0803/data/billCreditNotes?page=2&pageSize=2"}, "self": {"href": "/companies/071ad738-68f3-4561-afd0-69bab9df0803/data/billCreditNotes"}}, "pageNumber": 1, "pageSize": 2, "results": [{"allocatedOnDate": "2022-10-23T00:00:00Z", "billCreditNoteNumber": "Bill Credit", "createdFromRefs": [{"dataType": "invoice"}, {"dataType": "transfer"}, {"dataType": "journalEntry"}], "currency": "GBP", "discountPercentage": 0, "id": "10665024", "issueDate": "2018-08-22T00:00:00", "lineItems": [{"accountRef": {"id": "285", "name": "Accommodation and Meals"}, "description": "A & J Fabtech Ltd - Bill Credit Note Bill Credit", "quantity": 1, "taxAmount": 250, "totalAmount": 1500, "trackingCategoryRefs": [], "unitAmount": 1250}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-25T14:19:10Z", "note": "Bill Credit Note with 1 line items, totaling 805.78", "paymentAllocations": [], "remainingCredit": 1500, "sourceModifiedDate": "2018-08-22T13:22:08Z", "status": "Submitted", "subTotal": 1250, "supplierRef": {"id": "6161941", "supplierName": "A & J Fabtech Ltd"}, "totalAmount": 1500, "totalDiscount": 0, "totalTaxAmount": 250, "withholdingTax": []}, {"allocatedOnDate": "2022-10-23T00:00:00Z", "billCreditNoteNumber": "Draft test", "createdFromRefs": [{"dataType": "journalEntry"}, {"dataType": "invoice"}, {"dataType": "invoice"}], "currency": "GBP", "discountPercentage": 0, "id": "11007024", "issueDate": "2018-10-17T00:00:00", "lineItems": [{"accountRef": {"id": "285", "name": "Accommodation and Meals"}, "description": "ABB Ltd - Bill Credit Note Draft test", "quantity": 1, "taxAmount": 1.67, "totalAmount": 10, "trackingCategoryRefs": [], "unitAmount": 8.33}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-25T14:19:10Z", "note": "Bill Credit Note with 1 line items, totaling 805.78", "paymentAllocations": [], "remainingCredit": 10, "sourceModifiedDate": "2018-10-17T12:56:54Z", "status": "Submitted", "subTotal": 8.33, "supplierRef": {"id": "6161963", "supplierName": "ABB Ltd"}, "totalAmount": 10, "totalDiscount": 0, "totalTaxAmount": 1.67, "withholdingTax": []}], "totalResults": 45} + KashFlow: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/3a707a99-89da-4b16-a5d6-595333a16352/data/billCreditNotes?page=1&pageSize=2"}, "next": {"href": "/companies/3a707a99-89da-4b16-a5d6-595333a16352/data/billCreditNotes?page=2&pageSize=2"}, "self": {"href": "/companies/3a707a99-89da-4b16-a5d6-595333a16352/data/billCreditNotes"}}, "pageNumber": 1, "pageSize": 2, "results": [{"allocatedOnDate": "2022-10-23T00:00:00Z", "billCreditNoteNumber": "5", "createdFromRefs": [{"dataType": "journalEntry"}], "currency": "GBP", "currencyRate": 1, "discountPercentage": 0, "id": "91339087", "issueDate": "2020-02-25T00:00:00", "lineItems": [{"accountRef": {"id": "21481832", "name": "Oil"}, "description": "Oil refund", "itemRef": {"id": "114817740"}, "quantity": 1, "subTotal": 10, "taxAmount": 0, "totalAmount": 10, "trackingCategoryRefs": [], "unitAmount": 10}], "modifiedDate": "2022-09-30T10:29:16Z", "note": "Bill Credit Note with 1 line items, totaling 805.78", "paymentAllocations": [], "remainingCredit": 0, "sourceModifiedDate": "2022-10-23T00:00:00Z", "status": "Paid", "subTotal": 0, "supplierRef": {"id": "6202387", "supplierName": "Dell"}, "totalAmount": 10, "totalDiscount": 0, "totalTaxAmount": 0, "withholdingTax": []}, {"allocatedOnDate": "2022-10-23T00:00:00Z", "billCreditNoteNumber": "6", "createdFromRefs": [{"dataType": "transfer"}], "currency": "GBP", "currencyRate": 1, "discountPercentage": 0, "id": "91341939", "issueDate": "2020-02-25T00:00:00", "lineItems": [{"accountRef": {"id": "21481820", "name": "Materials purchased"}, "description": "", "itemRef": {"id": "114821376"}, "quantity": -1, "subTotal": 200, "taxAmount": -40, "totalAmount": 240, "trackingCategoryRefs": [], "unitAmount": -200}], "modifiedDate": "2022-09-30T10:29:16Z", "note": "Bill Credit Note with 1 line items, totaling 805.78", "paymentAllocations": [], "remainingCredit": 0, "sourceModifiedDate": "2022-10-23T00:00:00Z", "status": "Paid", "subTotal": 0, "supplierRef": {"id": "6202387", "supplierName": "Dell"}, "totalAmount": 240, "totalDiscount": 0, "totalTaxAmount": 0, "withholdingTax": []}], "totalResults": 8} + Oracle NetSuite: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/973341cc-ca0a-4a88-88de-e5954157818b/data/billCreditNotes?page=1&pageSize=2"}, "next": {"href": "/companies/973341cc-ca0a-4a88-88de-e5954157818b/data/billCreditNotes?page=2&pageSize=2"}, "self": {"href": "/companies/973341cc-ca0a-4a88-88de-e5954157818b/data/billCreditNotes"}}, "pageNumber": 1, "pageSize": 2, "results": [{"allocatedOnDate": "2022-10-23T00:00:00Z", "billCreditNoteNumber": "VENDCRED1", "createdFromRefs": [], "currency": "GBP", "currencyRate": 1, "discountPercentage": 0, "id": "1781", "issueDate": "2021-11-02T00:00:00", "lineItems": [{"accountRef": {"id": "713", "name": "Inventory Asset"}, "description": "billcredit_test", "quantity": 1, "subTotal": 145.5, "totalAmount": 145.5, "tracking": {"categoryRefs": [{"id": "department-1"}, {"id": "location-1"}], "isBilledTo": "Unknown", "isRebilledTo": "Unknown"}, "trackingCategoryRefs": [{"id": "department-1"}, {"id": "location-1"}], "unitAmount": 145.5, "unitOfMeasurement": "pack"}], "modifiedDate": "2022-09-20T08:16:22Z", "note": "Codat1", "paymentAllocations": [], "remainingCredit": 174.6, "sourceModifiedDate": "2021-11-02T19:58:58", "status": "Submitted", "subTotal": 145.5, "supplierRef": {"id": "749", "supplierName": "Jo's Cheese"}, "totalAmount": 174.6, "totalDiscount": 0, "totalTaxAmount": 29.1, "withholdingTax": []}, {"allocatedOnDate": "2022-10-23T00:00:00Z", "billCreditNoteNumber": "VENDCRED2", "createdFromRefs": [{"dataType": "bills", "id": "7462"}], "currency": "GBP", "currencyRate": 1, "discountPercentage": 0, "id": "1782", "issueDate": "2021-11-02T00:00:00", "lineItems": [{"accountRef": {"id": "714", "name": "Cost of Goods Sold"}, "createdFromLineRef": {"dataType": "bills", "id": "7462", "lineNumber": "1"}, "description": "Cheese", "quantity": 1, "subTotal": 400, "totalAmount": 400, "tracking": {"categoryRefs": [{"id": "location-1"}], "isBilledTo": "Unknown", "isRebilledTo": "Unknown"}, "trackingCategoryRefs": [{"id": "location-1"}], "unitAmount": 400, "unitOfMeasurement": "pack"}, {"accountRef": {"id": "714", "name": "Cost of Goods Sold"}, "description": "double cream", "quantity": 1, "subTotal": 100, "totalAmount": 100, "tracking": {"categoryRefs": [{"id": "location-1"}], "isBilledTo": "Unknown", "isRebilledTo": "Unknown"}, "trackingCategoryRefs": [{"id": "location-1"}], "unitAmount": 100}, {"accountRef": {"id": "54", "name": "Sales"}, "description": "", "itemRef": {"id": "128", "name": "Test Item"}, "quantity": 1, "subTotal": 35.25, "totalAmount": 35.25, "tracking": {"categoryRefs": [{"id": "location-1"}], "isBilledTo": "Unknown", "isRebilledTo": "Unknown"}, "trackingCategoryRefs": [{"id": "location-1"}], "unitAmount": 35.25}], "modifiedDate": "2022-09-20T08:16:22Z", "note": "Codat1", "paymentAllocations": [{"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": 300}, "payment": {"currency": "GBP", "currencyRate": 1, "id": "1782", "note": "Codat1", "paidOnDate": "2021-11-02T00:00:00", "reference": "Bill Credit 02/11/2021", "totalAmount": 0}}], "remainingCredit": 342.3, "sourceModifiedDate": "2021-11-03T18:27:14", "status": "PartiallyPaid", "subTotal": 535.25, "supplierRef": {"id": "749", "supplierName": "Jo's Cheese"}, "totalAmount": 642.3, "totalDiscount": 0, "totalTaxAmount": 107.05, "withholdingTax": []}], "totalResults": 16} + QuickBooks Desktop: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/fc72ba08-af13-4474-b28a-01dcfa6cfb51/data/billCreditNotes?page=1&pageSize=2"}, "next": {"href": "/companies/fc72ba08-af13-4474-b28a-01dcfa6cfb51/data/billCreditNotes?page=2&pageSize=2"}, "self": {"href": "/companies/fc72ba08-af13-4474-b28a-01dcfa6cfb51/data/billCreditNotes"}}, "pageNumber": 1, "pageSize": 2, "results": [{"allocatedOnDate": "2022-10-23T00:00:00Z", "billCreditNoteNumber": "Return", "createdFromRefs": [{"dataType": "transfer"}, {"dataType": "transfer"}], "currency": "GBP", "currencyRate": 1, "discountPercentage": 0, "id": "6D2C-1197698059", "issueDate": "2024-10-30T00:00:00", "lineItems": [{"description": "Lumber:Rough - Rough lumber", "discountAmount": 0, "discountPercentage": 0, "itemRef": {"id": "1C0000-933272656", "name": "Lumber:Rough"}, "quantity": 0, "subTotal": 475, "taxAmount": 0, "totalAmount": 475, "tracking": {"categoryRefs": [{"id": "10000-933272658", "name": "New Construction"}], "isBilledTo": "Unknown", "isRebilledTo": "Unknown"}, "trackingCategoryRefs": [{"id": "10000-933272658", "name": "New Construction"}], "unitAmount": 475}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-26T09:12:30Z", "note": "Bill Credit Note with 1 line items, totaling 805.78", "paymentAllocations": [{"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": 475}, "payment": {"currency": "GBP", "currencyRate": 1, "id": "6D2C-1197698059", "paidOnDate": "2024-10-30T00:00:00", "reference": "Return", "totalAmount": 0}}], "remainingCredit": 475, "sourceModifiedDate": "2023-12-16T05:06:19", "status": "Submitted", "subTotal": 475, "supplierRef": {"id": "E0000-933272656", "supplierName": "Timberloft Lumber"}, "totalAmount": 475, "totalDiscount": 0, "totalTaxAmount": 0, "withholdingTax": []}, {"allocatedOnDate": "2022-10-23T00:00:00Z", "billCreditNoteNumber": "CR-1098", "createdFromRefs": [{"dataType": "transfer"}, {"dataType": "transfer"}], "currency": "GBP", "currencyRate": 1, "discountPercentage": 0, "id": "F3A-933787869", "issueDate": "2024-12-12T00:00:00", "lineItems": [{"description": "Subs:Roofing - Roofing", "discountAmount": 0, "discountPercentage": 0, "itemRef": {"id": "D0000-933272656", "name": "Subs:Roofing"}, "quantity": 0, "subTotal": 850, "taxAmount": 0, "totalAmount": 850, "tracking": {"categoryRefs": [{"id": "10000-933272658", "name": "New Construction"}], "isBilledTo": "Unknown", "isRebilledTo": "Unknown"}, "trackingCategoryRefs": [{"id": "10000-933272658", "name": "New Construction"}], "unitAmount": 850}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-26T09:12:30Z", "note": "Bill Credit Note with 1 line items, totaling 805.78", "paymentAllocations": [{"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": 850}, "payment": {"currency": "GBP", "currencyRate": 1, "id": "F3A-933787869", "paidOnDate": "2024-12-12T00:00:00", "reference": "CR-1098", "totalAmount": 0}}], "remainingCredit": 850, "sourceModifiedDate": "2023-12-16T05:05:03", "status": "Submitted", "subTotal": 850, "supplierRef": {"id": "80000-933272656", "supplierName": "Sloan Roofing"}, "totalAmount": 850, "totalDiscount": 0, "totalTaxAmount": 0, "withholdingTax": []}], "totalResults": 3} + QuickBooks Online: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/10818b5e-6e6a-4ed4-a1c5-3e3efe626e87/data/billCreditNotes?page=1&pageSize=2"}, "next": {"href": "/companies/10818b5e-6e6a-4ed4-a1c5-3e3efe626e87/data/billCreditNotes?page=2&pageSize=2"}, "self": {"href": "/companies/10818b5e-6e6a-4ed4-a1c5-3e3efe626e87/data/billCreditNotes"}}, "pageNumber": 1, "pageSize": 2, "results": [{"allocatedOnDate": "2022-10-23T00:00:00Z", "billCreditNoteNumber": "19", "createdFromRefs": [], "currency": "GBP", "currencyRate": 1, "discountPercentage": 0, "id": "19", "issueDate": "2019-05-13T00:00:00", "lineItems": [{"accountRef": {"id": "16", "name": "Advertising"}, "description": "", "quantity": 1, "subTotal": 5, "taxAmount": 0, "taxRateRef": {"effectiveTaxRate": 0, "id": "NON", "name": "NON"}, "totalAmount": 5, "tracking": {"categoryRefs": [], "isBilledTo": "Unknown", "isRebilledTo": "NotApplicable"}, "trackingCategoryRefs": [], "unitAmount": 5}], "modifiedDate": "2023-01-18T11:02:37Z", "note": "Bill Credit Note with 1 line items, totaling 805.78", "paymentAllocations": [{"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": 5}, "payment": {"currency": "GBP", "currencyRate": 1, "id": "20", "paidOnDate": "2019-05-13T00:00:00", "totalAmount": 0}}], "remainingCredit": 0, "sourceModifiedDate": "2019-05-13T13:14:06Z", "status": "Paid", "subTotal": 5, "supplierRef": {"id": "4", "supplierName": "BILLy elliot"}, "totalAmount": 5, "totalDiscount": 0, "totalTaxAmount": 0, "withholdingTax": []}, {"allocatedOnDate": "2022-10-23T00:00:00Z", "billCreditNoteNumber": "677", "createdFromRefs": [{"dataType": "journalEntry"}, {"dataType": "accountTransaction"}, {"dataType": "invoice"}], "currency": "GBP", "currencyRate": 1, "discountPercentage": 0, "id": "677", "issueDate": "2020-03-20T00:00:00", "lineItems": [{"accountRef": {"id": "16", "name": "Advertising"}, "description": "", "quantity": 1, "subTotal": 5, "taxAmount": 0, "taxRateRef": {"effectiveTaxRate": 0, "id": "NON", "name": "NON"}, "totalAmount": 5, "tracking": {"categoryRefs": [], "isBilledTo": "Unknown", "isRebilledTo": "NotApplicable"}, "trackingCategoryRefs": [], "unitAmount": 5}], "modifiedDate": "2023-01-18T11:02:37Z", "note": "Codat Note field", "paymentAllocations": [{"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": 5}, "payment": {"currency": "GBP", "currencyRate": 1, "id": "678", "note": "payment note test", "paidOnDate": "2020-03-23T00:00:00", "totalAmount": 0}}], "remainingCredit": 0, "sourceModifiedDate": "2020-03-23T10:44:06Z", "status": "Paid", "subTotal": 5, "supplierRef": {"id": "4", "supplierName": "BILLy elliot"}, "totalAmount": 5, "totalDiscount": 0, "totalTaxAmount": 0, "withholdingTax": []}], "totalResults": 11} + QuickBooks Online Sandbox: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/5a7f3597-36e1-4216-86fe-289ad36088a6/data/billCreditNotes?page=1&pageSize=2"}, "next": {"href": "/companies/5a7f3597-36e1-4216-86fe-289ad36088a6/data/billCreditNotes?page=2&pageSize=2"}, "self": {"href": "/companies/5a7f3597-36e1-4216-86fe-289ad36088a6/data/billCreditNotes"}}, "pageNumber": 1, "pageSize": 2, "results": [{"allocatedOnDate": "2022-10-23T00:00:00Z", "billCreditNoteNumber": "424", "createdFromRefs": [], "currency": "GBP", "currencyRate": 1, "discountPercentage": 0, "id": "424", "issueDate": "2019-06-20T00:00:00", "lineItems": [{"accountRef": {"id": "30", "name": "Janitorial Expense"}, "description": "Refund of iZettle Fees", "quantity": 1, "subTotal": 69, "taxAmount": 0, "taxRateRef": {"effectiveTaxRate": 0, "id": "20_Bills", "name": "5.0% RC CIS Bills"}, "totalAmount": 69, "tracking": {"categoryRefs": [], "isBilledTo": "Unknown", "isRebilledTo": "NotApplicable"}, "trackingCategoryRefs": [], "unitAmount": 69}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-26T09:35:58Z", "note": "Bill Credit Note with 1 line items, totaling 805.78", "paymentAllocations": [], "remainingCredit": 69, "sourceModifiedDate": "2019-06-20T15:48:50Z", "status": "Submitted", "subTotal": 69, "supplierRef": {"id": "24", "supplierName": "Brijesh Jain"}, "totalAmount": 69, "totalDiscount": 0, "totalTaxAmount": 0, "withholdingTax": []}, {"allocatedOnDate": "2022-10-23T00:00:00Z", "billCreditNoteNumber": "455", "createdFromRefs": [{"dataType": "transfer"}], "currency": "GBP", "currencyRate": 1, "discountPercentage": 0, "id": "455", "issueDate": "2019-06-26T00:00:00", "lineItems": [{"accountRef": {"id": "11", "name": "Ask My Accountant"}, "description": "a", "quantity": 1, "subTotal": 10, "taxAmount": 0, "taxRateRef": {"effectiveTaxRate": 0, "id": "20_Bills", "name": "5.0% RC CIS Bills"}, "totalAmount": 10, "tracking": {"categoryRefs": [], "isBilledTo": "Unknown", "isRebilledTo": "NotApplicable"}, "trackingCategoryRefs": [], "unitAmount": 10}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-26T09:35:58Z", "note": "Bill Credit Note with 1 line items, totaling 805.78", "paymentAllocations": [{"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": 10}, "payment": {"accountRef": {"id": "100", "name": "Savings2"}, "currency": "GBP", "currencyRate": 1, "id": "530", "paidOnDate": "2019-07-16T00:00:00", "reference": "4", "totalAmount": 170}}], "remainingCredit": 0, "sourceModifiedDate": "2019-07-16T09:49:14Z", "status": "Paid", "subTotal": 10, "supplierRef": {"id": "53", "supplierName": "Bank of AnyCity"}, "totalAmount": 10, "totalDiscount": 0, "totalTaxAmount": 0, "withholdingTax": []}], "totalResults": 26} + Sage 200cloud: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/93c21e2d-049c-4d24-b41b-57e61c30b69e/data/billCreditNotes?page=1&pageSize=2"}, "next": {"href": "/companies/93c21e2d-049c-4d24-b41b-57e61c30b69e/data/billCreditNotes?page=2&pageSize=2"}, "self": {"href": "/companies/93c21e2d-049c-4d24-b41b-57e61c30b69e/data/billCreditNotes"}}, "pageNumber": 1, "pageSize": 2, "results": [{"allocatedOnDate": "2020-01-20T00:00:00Z", "billCreditNoteNumber": "Return 1", "createdFromRefs": [{"dataType": "invoice"}], "currency": "GBP", "currencyRate": 1, "discountPercentage": 2.5, "id": "45391", "issueDate": "2020-07-22T00:00:00Z", "lineItems": [{"description": "Tax Summary - Tax Rate 1", "discountAmount": 0.5, "quantity": 0, "subTotal": 0, "taxAmount": 20, "taxRateRef": {"effectiveTaxRate": 20, "id": "1729", "name": "Standard rate"}, "totalAmount": 20, "trackingCategoryRefs": [], "unitAmount": 0}, {"description": "Goods Summary", "discountAmount": 2.5, "quantity": 0, "subTotal": 100, "taxAmount": 0, "totalAmount": 100, "trackingCategoryRefs": [], "unitAmount": 0}], "modifiedDate": "2022-10-14T09:35:52Z", "note": "ret1", "paymentAllocations": [{"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP", "currencyRate": 1, "totalAmount": -10.5}, "payment": {"currency": "GBP", "currencyRate": 1, "id": "45391", "note": "ret1", "paidOnDate": "2020-01-20T00:00:00", "reference": "Return 1", "totalAmount": 0}}], "remainingCredit": 109.5, "sourceModifiedDate": "2020-02-28T14:23:46Z", "status": "Submitted", "subTotal": 100, "supplierRef": {"id": "CON001", "supplierName": "Concept Stationery Supplies"}, "totalAmount": 120, "totalDiscount": 2.5, "totalTaxAmount": 20, "withholdingTax": []}, {"allocatedOnDate": "2020-02-03T00:00:00Z", "billCreditNoteNumber": "Return 2", "createdFromRefs": [{"dataType": "invoice"}, {"dataType": "journalEntry"}], "currency": "GBP", "currencyRate": 1, "discountPercentage": 2.5, "id": "45421", "issueDate": "2020-07-22T00:00:00Z", "lineItems": [{"description": "Tax Summary - Tax Rate 1", "discountAmount": 0.25, "quantity": 0, "subTotal": 0, "taxAmount": 10, "taxRateRef": {"effectiveTaxRate": 20, "id": "1729", "name": "Standard rate"}, "totalAmount": 10, "trackingCategoryRefs": [], "unitAmount": 0}, {"description": "Goods Summary", "discountAmount": 1.25, "quantity": 0, "subTotal": 50, "taxAmount": 0, "totalAmount": 50, "trackingCategoryRefs": [], "unitAmount": 0}], "modifiedDate": "2022-10-14T09:35:52Z", "note": "ret2", "paymentAllocations": [], "remainingCredit": 60, "sourceModifiedDate": "2020-02-28T14:23:46Z", "status": "Submitted", "subTotal": 50, "supplierRef": {"id": "QUA001", "supplierName": "Quality Motors"}, "totalAmount": 60, "totalDiscount": 1.25, "totalTaxAmount": 10, "withholdingTax": []}], "totalResults": 21} + Sage 50 (UK): + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/cf5f2a47-2990-4221-bae6-0c19c86ac304/data/billCreditNotes?page=1&pageSize=2"}, "next": {"href": "/companies/cf5f2a47-2990-4221-bae6-0c19c86ac304/data/billCreditNotes?page=2&pageSize=2"}, "self": {"href": "/companies/cf5f2a47-2990-4221-bae6-0c19c86ac304/data/billCreditNotes"}}, "pageNumber": 1, "pageSize": 2, "results": [{"allocatedOnDate": "2022-10-23T00:00:00Z", "billCreditNoteNumber": "O/BAL", "createdFromRefs": [{"dataType": "transfer"}, {"dataType": "accountTransaction"}, {"dataType": "transfer"}], "currency": "GBP", "currencyRate": 1, "discountPercentage": 0, "id": "20", "issueDate": "2021-12-31T00:00:00", "lineItems": [{"accountRef": {"id": "9998", "name": "Suspense Account"}, "description": "Opening Balance", "quantity": 1, "subTotal": 0.01, "taxAmount": 0, "taxRateRef": {"effectiveTaxRate": 0, "id": "9", "name": "Non-Vatable Tax Code"}, "totalAmount": 0.01, "tracking": {"categoryRefs": [{"id": "department_0", "name": "Default"}], "isBilledTo": "Unknown", "isRebilledTo": "Unknown"}, "trackingCategoryRefs": [{"id": "department_0", "name": "Default"}], "unitAmount": 0.01}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-30T14:42:37Z", "note": "Opening Balance", "paymentAllocations": [], "remainingCredit": 0.01, "sourceModifiedDate": "2022-11-25T09:43:54", "status": "Submitted", "subTotal": 0.01, "supplierRef": {"id": "NEW001", "supplierName": "Newtown Builders Ltd"}, "totalAmount": 0.01, "totalDiscount": 0, "totalTaxAmount": 0, "withholdingTax": []}, {"allocatedOnDate": "2022-10-23T00:00:00Z", "billCreditNoteNumber": "Return", "createdFromRefs": [], "currency": "GBP", "currencyRate": 1, "discountPercentage": 0, "id": "323", "issueDate": "2022-02-28T00:00:00", "lineItems": [{"accountRef": {"id": "5000", "name": "Materials Purchased"}, "description": "Returned Goods, damaged", "quantity": 1, "subTotal": 88, "taxAmount": 15.4, "taxRateRef": {"effectiveTaxRate": 20, "id": "1", "name": "Standard rate"}, "totalAmount": 103.4, "tracking": {"categoryRefs": [{"id": "department_0", "name": "Default"}], "isBilledTo": "Unknown", "isRebilledTo": "Unknown"}, "trackingCategoryRefs": [{"id": "department_0", "name": "Default"}], "unitAmount": 103.4}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-30T14:42:37Z", "note": "Returned Goods, damaged", "paymentAllocations": [], "remainingCredit": 103.4, "sourceModifiedDate": "2022-11-25T09:43:54", "status": "Submitted", "subTotal": 88, "supplierRef": {"id": "UNI001", "supplierName": "Unique Systems"}, "totalAmount": 103.4, "totalDiscount": 0, "totalTaxAmount": 15.4, "withholdingTax": []}], "totalResults": 12} + Sage Business Cloud Accounting: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/390083e2-351b-407c-a3be-55081c36c182/data/billCreditNotes?page=1&pageSize=2"}, "next": {"href": "/companies/390083e2-351b-407c-a3be-55081c36c182/data/billCreditNotes?page=2&pageSize=2"}, "self": {"href": "/companies/390083e2-351b-407c-a3be-55081c36c182/data/billCreditNotes"}}, "pageNumber": 1, "pageSize": 2, "results": [{"allocatedOnDate": "2022-10-23T00:00:00Z", "billCreditNoteNumber": "Supplier credit note", "createdFromRefs": [{"dataType": "accountTransaction"}, {"dataType": "transfer"}, {"dataType": "invoice"}], "currency": "USD", "currencyRate": 0.776970973, "discountPercentage": 0, "id": "b6c6fce9866849b0b44cac99ab7dc579", "issueDate": "2018-11-23T00:00:00", "lineItems": [{"accountRef": {"id": "9a995955267a11e797950a57719b2edb", "name": "Cost of sales - goods"}, "description": "Consulting services", "discountAmount": 0, "discountPercentage": 0, "itemRef": {"id": "a87b922b33de11e797950a57719b2edb", "name": "Consulting services"}, "quantity": 1, "subTotal": 10, "taxAmount": 0, "taxRateRef": {"effectiveTaxRate": 0, "id": "GB_ZERO", "name": "Zero Rated 0.00%"}, "totalAmount": 10, "trackingCategoryRefs": [], "unitAmount": 10}], "modifiedDate": "2022-10-24T14:53:32Z", "note": "Bill Credit Note with 1 line items, totaling 805.78", "paymentAllocations": [{"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "USD", "currencyRate": 1, "totalAmount": 10}, "payment": {"accountRef": {"id": "9a25937b267a11e797950a57719b2edb", "name": "Current"}, "currency": "USD", "currencyRate": 0.771449236, "id": "bf6496aaf0294883b27c423ce8266113", "note": "Supplier refund using credit/debit card", "paidOnDate": "2019-11-19T00:00:00", "totalAmount": -10}}], "remainingCredit": 0, "sourceModifiedDate": "2019-11-19T14:17:32Z", "status": "Paid", "subTotal": 10, "supplierRef": {"id": "ec716559789111e8aaa5027d54329956", "supplierName": "Bagels Limited"}, "totalAmount": 10, "totalDiscount": 0, "totalTaxAmount": 0, "withholdingTax": []}, {"allocatedOnDate": "2022-10-23T00:00:00Z", "billCreditNoteNumber": "91fe2a83-e161-4c21-929d-c5c10c4b07e5", "createdFromRefs": [{"dataType": "accountTransaction"}, {"dataType": "invoice"}], "currency": "GBP", "currencyRate": 1, "discountPercentage": 0, "id": "23d866f6367d4f11956a36a71e47bc37", "issueDate": "2019-01-29T00:00:00", "lineItems": [{"accountRef": {"id": "9a995955267a11e797950a57719b2edb", "name": "Cost of sales - goods"}, "description": "Consulting services", "discountAmount": 0, "discountPercentage": 0, "itemRef": {"id": "a87b922b33de11e797950a57719b2edb", "name": "Consulting services"}, "quantity": 5, "subTotal": 50, "taxAmount": 10, "taxRateRef": {"effectiveTaxRate": 20, "id": "GB_STANDARD", "name": "Standard 20.00%"}, "totalAmount": 60, "trackingCategoryRefs": [], "unitAmount": 10}], "modifiedDate": "2022-10-24T14:53:32Z", "note": "Bill Credit Note with 1 line items, totaling 805.78", "paymentAllocations": [], "remainingCredit": 60, "sourceModifiedDate": "2020-07-16T15:00:36Z", "status": "Submitted", "subTotal": 50, "supplierRef": {"id": "ca430e0d156011e8b45c025132dab352", "supplierName": "Test Supplier"}, "totalAmount": 60, "totalDiscount": 0, "totalTaxAmount": 10, "withholdingTax": []}], "totalResults": 747} + Sage Intacct: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/71ca2b28-8e86-41e7-8c55-f681042b11a0/data/billCreditNotes?page=1&pageSize=2"}, "next": {"href": "/companies/71ca2b28-8e86-41e7-8c55-f681042b11a0/data/billCreditNotes?page=2&pageSize=2"}, "self": {"href": "/companies/71ca2b28-8e86-41e7-8c55-f681042b11a0/data/billCreditNotes"}}, "pageNumber": 1, "pageSize": 2, "results": [{"allocatedOnDate": "2022-10-23T00:00:00Z", "billCreditNoteNumber": "APADJ0001", "createdFromRefs": [{"dataType": "invoice"}, {"dataType": "invoice"}, {"dataType": "journalEntry"}], "currency": "USD", "currencyRate": 0.7283, "discountPercentage": 0, "id": "3359", "issueDate": "2021-09-20T00:00:00", "lineItems": [{"accountRef": {"id": "197", "name": "Software and Licenses"}, "description": "No Description Provided", "quantity": 1, "subTotal": 5, "taxAmount": 1, "taxRateRef": {"effectiveTaxRate": 20, "id": "47", "name": "EC Purchase Goods Standard Rate Input"}, "totalAmount": 6, "tracking": {"categoryRefs": [{"id": "LOCATION-8", "name": "United Kingdom"}, {"id": "SUPPLIER-3", "name": "ADP"}], "isBilledTo": "Unknown", "isRebilledTo": "Unknown"}, "trackingCategoryRefs": [{"id": "LOCATION-8", "name": "United Kingdom"}, {"id": "SUPPLIER-3", "name": "ADP"}], "unitAmount": 5}, {"accountRef": {"id": "197", "name": "Software and Licenses"}, "description": "No Description Provided", "quantity": 1, "subTotal": 5, "taxAmount": 1, "taxRateRef": {"effectiveTaxRate": 20, "id": "47", "name": "EC Purchase Goods Standard Rate Input"}, "totalAmount": 6, "tracking": {"categoryRefs": [{"id": "LOCATION-8", "name": "United Kingdom"}, {"id": "SUPPLIER-3", "name": "ADP"}], "isBilledTo": "Unknown", "isRebilledTo": "Unknown"}, "trackingCategoryRefs": [{"id": "LOCATION-8", "name": "United Kingdom"}, {"id": "SUPPLIER-3", "name": "ADP"}], "unitAmount": 5}], "modifiedDate": "2022-10-28T11:10:22Z", "note": "", "paymentAllocations": [], "remainingCredit": 12, "sourceModifiedDate": "2021-09-20T13:50:16", "status": "Submitted", "subTotal": 10, "supplierRef": {"id": "3", "supplierName": "ADP"}, "totalAmount": 12, "totalDiscount": 0, "totalTaxAmount": 2, "withholdingTax": []}, {"allocatedOnDate": "2021-09-29T00:00:00", "billCreditNoteNumber": "APADJ0002", "createdFromRefs": [], "currency": "GBP", "currencyRate": 1, "discountPercentage": 0, "id": "3399", "issueDate": "2021-09-24T00:00:00", "lineItems": [{"accountRef": {"id": "197", "name": "Software and Licenses"}, "description": "No Description Provided", "quantity": 1, "subTotal": 300, "taxAmount": 60, "taxRateRef": {"effectiveTaxRate": 20, "id": "81", "name": "UK Purchase Goods Standard Rate"}, "totalAmount": 360, "tracking": {"categoryRefs": [{"id": "LOCATION-8", "name": "United Kingdom"}, {"id": "SUPPLIER-3", "name": "ADP"}], "isBilledTo": "Unknown", "isRebilledTo": "Unknown"}, "trackingCategoryRefs": [{"id": "LOCATION-8", "name": "United Kingdom"}, {"id": "SUPPLIER-3", "name": "ADP"}], "unitAmount": 300}], "modifiedDate": "2022-10-28T11:10:22Z", "note": "", "paymentAllocations": [], "remainingCredit": 0, "sourceModifiedDate": "2021-09-29T13:34:47", "status": "Paid", "subTotal": 300, "supplierRef": {"id": "3", "supplierName": "ADP"}, "totalAmount": 360, "totalDiscount": 0, "totalTaxAmount": 60, "withholdingTax": []}], "totalResults": 82} + Xero: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/5ced9667-a310-443a-a711-958d36377141/data/billCreditNotes?page=1&pageSize=2"}, "self": {"href": "/companies/5ced9667-a310-443a-a711-958d36377141/data/billCreditNotes"}}, "pageNumber": 1, "pageSize": 2, "results": [{"allocatedOnDate": "2022-10-23T00:00:00Z", "billCreditNoteNumber": "RPT429-1", "createdFromRefs": [{"dataType": "invoice"}, {"dataType": "invoice"}, {"dataType": "invoice"}], "currency": "GBP", "currencyRate": 1, "discountPercentage": 0, "id": "ee8bec08-2be8-40ba-acd0-d53d5df11235", "issueDate": "2022-12-12T00:00:00", "lineItems": [{"accountRef": {"id": "f96c9458-d724-47bf-8f74-a9d5726465ce", "name": "General Expenses"}, "description": "Refund as agreed due to window break when guard absent", "discountAmount": 0, "discountPercentage": 0, "quantity": 1, "subTotal": 21.2, "taxAmount": 4.24, "taxRateRef": {"effectiveTaxRate": 20, "id": "INPUT2", "name": "20% (VAT on Expenses)"}, "totalAmount": 25.44, "trackingCategoryRefs": [], "unitAmount": 21.2}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-15T20:36:09Z", "note": "Bill Credit Note with 1 line items, totaling 805.78", "paymentAllocations": [{"allocation": {"allocatedOnDate": "2022-12-12T00:00:00", "currency": "GBP", "currencyRate": 1, "totalAmount": 25.44}, "payment": {"currency": "GBP", "currencyRate": 1, "id": "ee8bec08-2be8-40ba-acd0-d53d5df11235", "paidOnDate": "2022-12-12T00:00:00", "reference": "", "totalAmount": 0}}], "remainingCredit": 0, "sourceModifiedDate": "2011-04-07T07:26:30", "status": "Paid", "subTotal": 25.44, "supplierRef": {"id": "3a0d40a2-2698-4cf5-b7b2-30133c632ab6", "supplierName": "Swanston Security"}, "totalAmount": 25.44, "totalDiscount": 0, "totalTaxAmount": 4.24, "withholdingTax": []}, {"allocatedOnDate": "2022-10-23T00:00:00Z", "billCreditNoteNumber": "720-2", "createdFromRefs": [{"dataType": "journalEntry"}, {"dataType": "accountTransaction"}, {"dataType": "invoice"}], "currency": "GBP", "currencyRate": 1, "discountPercentage": 0, "id": "7d1f4e11-e909-43b0-901c-2c824dff1e82", "issueDate": "2022-12-16T00:00:00", "lineItems": [{"accountRef": {"id": "f96c9458-d724-47bf-8f74-a9d5726465ce", "name": "General Expenses"}, "description": "Unable to supply DVD writer for laptop", "discountAmount": 0, "discountPercentage": 0, "quantity": 1, "subTotal": 225.3, "taxAmount": 45.06, "taxRateRef": {"effectiveTaxRate": 20, "id": "INPUT2", "name": "20% (VAT on Expenses)"}, "totalAmount": 270.36, "trackingCategoryRefs": [], "unitAmount": 225.3}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-15T20:36:09Z", "note": "Bill Credit Note with 1 line items, totaling 805.78", "paymentAllocations": [{"allocation": {"allocatedOnDate": "2022-12-16T00:00:00", "currency": "GBP", "currencyRate": 1, "totalAmount": 270.36}, "payment": {"currency": "GBP", "currencyRate": 1, "id": "7d1f4e11-e909-43b0-901c-2c824dff1e82", "paidOnDate": "2022-12-16T00:00:00", "reference": "", "totalAmount": 0}}], "remainingCredit": 0, "sourceModifiedDate": "2011-04-06T21:00:33", "status": "Paid", "subTotal": 270.36, "supplierRef": {"id": "cf8fa320-a527-496c-823e-22dd069d29e6", "supplierName": "PC Complete"}, "totalAmount": 270.36, "totalDiscount": 0, "totalTaxAmount": 45.06, "withholdingTax": []}], "totalResults": 2} + Malformed query: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "400": + application/json: {"canBeRetried": "Unknown", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "detailedErrorCode": 0, "error": "Error parsing query - Malformed query.", "service": "ClientsApi", "statusCode": 400} + Unresolved property: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "400": + application/json: {"canBeRetried": "Unknown", "correlationId": "98457fb9956b7f9b4b2fd4f6e23bb5c8", "detailedErrorCode": 0, "error": "Error parsing query - Could not resolve property isCompleted on Dataset", "service": "PullApi", "statusCode": 400} + update-bill-credit-note: + Malformed query: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + billCreditNoteId: "" + query: {} + requestBody: + application/json: {"allocatedOnDate": "2022-10-23T00:00:00Z", "billCreditNoteNumber": "14763237", "createdFromRefs": [{"dataType": "invoice"}, {"dataType": "transfer"}], "currency": "USD", "discountPercentage": 0, "id": "6a0e9dfb-87b0-47d3-aaaf-9753ae9e757d", "issueDate": "2019-02-18T16:03:07.268Z", "lineItems": [{"accountRef": {"id": "3f267b10-757d-44c0-bef9-20f70cc8fbe3"}, "description": "AcmeMagnet", "discountAmount": 0, "itemRef": {"id": "3"}, "quantity": 4, "subTotal": 100, "taxAmount": 10, "taxRateRef": {"id": "6c88aff3-7cb9-4980-a3d3-443e72e02498"}, "totalAmount": 110, "trackingCategoryRefs": [{"id": "department_1", "name": "ACMERockets"}, {"id": "costcode_2", "name": "ACM2-ACMESigns"}], "unitAmount": 25}, {"accountRef": {"id": "3f267b10-757d-44c0-bef9-20f70cc8fbe3"}, "description": "ACMEDisintegratingPistol", "discountAmount": 0, "itemRef": {"id": "3abf0883-03f7-44c6-bc15-1372522d25e1"}, "quantity": 3, "subTotal": 75, "taxAmount": 7.5, "taxRateRef": {"id": "6c88aff3-7cb9-4980-a3d3-443e72e02498"}, "totalAmount": 82.5, "unitAmount": 25}, {"accountRef": {"id": "3f267b10-757d-44c0-bef9-20f70cc8fbe3"}, "description": "ACMEWhippedCreamDispenser", "discountAmount": 0, "itemRef": {"id": "3691f3d9-0ff7-4358-8a93-bed31c1b4b03"}, "quantity": 6, "subTotal": 312, "taxAmount": 31.2, "taxRateRef": {"id": "6c88aff3-7cb9-4980-a3d3-443e72e02498"}, "totalAmount": 343.2, "unitAmount": 52}, {"accountRef": {"id": "3f267b10-757d-44c0-bef9-20f70cc8fbe3"}, "description": "ACMEJetPropelledPogoStick", "discountAmount": 0, "itemRef": {"id": "075410d4-7edc-4936-ba52-9e1e43cbe300"}, "quantity": 1, "subTotal": 130, "taxAmount": 27.3, "taxRateRef": {"id": "d606732b-db18-44d7-823b-7f15f42c32ea"}, "totalAmount": 157.3, "unitAmount": 130}], "modifiedDate": "2022-10-23T00:00:00Z", "note": "Track separately", "paymentAllocations": [{"allocation": {"allocatedOnDate": "2022-10-23T00:00:00Z", "currency": "GBP"}, "payment": {"currency": "EUR", "paidOnDate": "2022-10-23T00:00:00Z"}}], "remainingCredit": 693, "sourceModifiedDate": "2022-10-23T00:00:00Z", "status": "Submitted", "subTotal": 805.78, "supplierRef": {"id": "67C6A7A1-5E84-4AC4-B950-24A114E379D0", "supplierName": "Chin's Gas and Oil"}, "totalAmount": 693, "totalDiscount": 0, "totalTaxAmount": 0} + responses: + "400": + application/json: {"canBeRetried": "Unknown", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "detailedErrorCode": 0, "error": "Error processing request - not valid.", "service": "PublicApi", "statusCode": 400} + create-bill-payment: + Sage 50 (UK): + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + query: {} + requestBody: + application/json: {"accountRef": {"id": "1200", "name": "string"}, "currency": "GBP", "currencyRate": 1, "date": "2023-01-05T12:33:25.339Z", "id": "3d5a8e00-d108-4045-8823-7f342676cffa", "lines": [{"allocatedOnDate": "2023-01-05T12:33:25.339Z", "amount": 15.38, "links": [{"amount": -15.38, "currencyRate": 1, "id": "3", "type": "Bill"}]}], "metadata": {"isDeleted": true}, "modifiedDate": "2023-01-05T12:33:25.339Z", "note": "note - billpayment on 20230220 of 15.38", "paymentMethodRef": {"id": "string", "name": "string"}, "reference": "reference 20230220 15.38", "sourceModifiedDate": "2023-01-05T12:33:25.339Z", "supplierRef": {"id": "SUPP1", "supplierName": "string"}, "totalAmount": 15.38} + responses: + "200": + application/json: {"changes": [{"recordRef": {"dataType": "invoices"}}], "companyId": "8a210b68-6988-11ed-a1eb-0242ac120002", "completedOnUtc": "2022-10-23T00:00:00Z", "dataConnectionKey": "2e9d2c44-f675-40ba-8049-353bfcb5e171", "dataType": "invoices", "pushOperationKey": "621cf021-cd9c-4f54-a033-15211a509a30", "requestedOnUtc": "2022-10-23T00:00:00Z", "status": "Success", "statusCode": 550483} + "400": {} + QuickBooks Online: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + query: {} + requestBody: + application/json: {"accountRef": {"id": "122"}, "currency": "USD", "currencyRate": 1, "date": "2023-04-17T00:00:00", "id": "3d5a8e00-d108-4045-8823-7f342676cffa", "lines": [{"allocatedOnDate": "2022-10-23T00:00:00Z", "amount": 2500, "links": [{"amount": -1200, "currencyRate": 1, "id": "302", "type": "Bill"}, {"amount": -1300, "currencyRate": 1, "id": "303", "type": "Bill"}]}], "modifiedDate": "2022-10-23T00:00:00Z", "note": "Bill Payment against bill c13e37b6-dfaa-4894-b3be-9fe97bda9f44", "paymentMethodRef": {"id": "EILBDVJVNUAGVKRQ", "name": "AliPay"}, "reference": "1", "sourceModifiedDate": "2022-10-23T00:00:00Z", "supplierRef": {"id": "77", "supplierName": "AtoB"}, "totalAmount": 2500} + responses: + "200": + application/json: {"changes": [{"recordRef": {"dataType": "invoices"}}], "companyId": "8a210b68-6988-11ed-a1eb-0242ac120002", "completedOnUtc": "2022-10-23T00:00:00Z", "dataConnectionKey": "2e9d2c44-f675-40ba-8049-353bfcb5e171", "dataType": "invoices", "pushOperationKey": "2becc376-9177-45e0-8249-85613de0ee80", "requestedOnUtc": "2022-10-23T00:00:00Z", "status": "Failed", "statusCode": 428745} + "400": {} + Xero: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + query: {} + requestBody: + application/json: {"accountRef": {"id": "bd9e85e0-0478-433d-ae9f-0b3c4f04bfe4"}, "currency": "GBP", "currencyRate": 1, "date": "2023-04-17T00:00:00", "id": "3d5a8e00-d108-4045-8823-7f342676cffa", "lines": [{"allocatedOnDate": "2022-10-23T00:00:00Z", "amount": 135.85, "links": [{"amount": -135.85, "currencyRate": 1, "id": "59978bef-af2f-4a7e-9728-4997597c0980", "type": "Bill"}]}, {"allocatedOnDate": "2022-10-23T00:00:00Z", "amount": 108.6, "links": [{"amount": -108.6, "currencyRate": 1, "id": "2175c381-d323-4e20-8c94-7680ea7f85d3", "type": "Bill"}]}], "modifiedDate": "2022-10-23T00:00:00Z", "note": "Bill Payment against bill c13e37b6-dfaa-4894-b3be-9fe97bda9f44", "paymentMethodRef": {"id": "EILBDVJVNUAGVKRQ", "name": "AliPay"}, "sourceModifiedDate": "2022-10-23T00:00:00Z", "supplierRef": {"id": "dec56ceb-65e9-43b3-ac98-7fe09eb37e31"}, "totalAmount": 244.45} + responses: + "200": + application/json: {"changes": [{"recordRef": {"dataType": "invoices"}}, {"recordRef": {"dataType": "invoices"}}], "companyId": "8a210b68-6988-11ed-a1eb-0242ac120002", "completedOnUtc": "2022-10-23T00:00:00Z", "dataConnectionKey": "2e9d2c44-f675-40ba-8049-353bfcb5e171", "dataType": "invoices", "pushOperationKey": "36bfd394-9479-48bc-a19d-4c51e99dff42", "requestedOnUtc": "2022-10-23T00:00:00Z", "status": "Success", "statusCode": 934959} + "400": {} + NetSuite: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + query: {} + requestBody: + application/json: {"accountRef": {"id": "854"}, "currency": "GBP", "date": "2023-05-09T00:00:00", "id": "3d5a8e00-d108-4045-8823-7f342676cffa", "lines": [{"allocatedOnDate": "2022-10-23T00:00:00Z", "amount": 110, "links": [{"amount": -120, "id": "8", "type": "Bill"}, {"amount": 10, "id": "462792", "type": "CreditNote"}]}], "modifiedDate": "2022-10-23T00:00:00Z", "note": "Bill Payment against bill c13e37b6-dfaa-4894-b3be-9fe97bda9f44", "paymentMethodRef": {"id": "EILBDVJVNUAGVKRQ", "name": "AliPay"}, "sourceModifiedDate": "2022-10-23T00:00:00Z", "supplierRef": {"id": "727"}, "totalAmount": 110} + responses: + "200": + application/json: {"changes": [], "companyId": "8a210b68-6988-11ed-a1eb-0242ac120002", "completedOnUtc": "2022-10-23T00:00:00Z", "dataConnectionKey": "2e9d2c44-f675-40ba-8049-353bfcb5e171", "dataType": "invoices", "pushOperationKey": "c5243df3-ef75-4c24-ba16-ac5e2bbd7e44", "requestedOnUtc": "2022-10-23T00:00:00Z", "status": "Pending", "statusCode": 749299} + "400": {} + Sage Intacct: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + query: {} + requestBody: + application/json: {"accountRef": {"id": "360"}, "currency": "USD", "date": "2023-04-25T00:00:00", "id": "3d5a8e00-d108-4045-8823-7f342676cffa", "lines": [{"allocatedOnDate": "2022-10-23T00:00:00Z", "amount": 45, "links": [{"amount": -405, "id": "26572", "type": "Bill"}, {"amount": 360, "id": "26573", "type": "CreditNote"}]}], "modifiedDate": "2022-10-23T00:00:00Z", "note": "Bill Payment against bill c13e37b6-dfaa-4894-b3be-9fe97bda9f44", "paymentMethodRef": {"id": "6", "name": "Cash"}, "sourceModifiedDate": "2022-10-23T00:00:00Z", "supplierRef": {"id": "3"}, "totalAmount": 45} + responses: + "200": + application/json: {"changes": [{"recordRef": {"dataType": "invoices"}}, {"recordRef": {"dataType": "invoices"}}, {"recordRef": {"dataType": "invoices"}}], "companyId": "8a210b68-6988-11ed-a1eb-0242ac120002", "completedOnUtc": "2022-10-23T00:00:00Z", "dataConnectionKey": "2e9d2c44-f675-40ba-8049-353bfcb5e171", "dataType": "invoices", "pushOperationKey": "9f35dc93-cdd3-46df-93be-e39ab418fe7b", "requestedOnUtc": "2022-10-23T00:00:00Z", "status": "Success", "statusCode": 400422} + "400": {} + Malformed query: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + query: {} + requestBody: + application/json: {"currency": "GBP", "date": "2022-10-23T00:00:00Z", "id": "3d5a8e00-d108-4045-8823-7f342676cffa", "lines": [{"allocatedOnDate": "2022-10-23T00:00:00Z", "amount": -1000, "links": [{"amount": 1000, "id": "y", "type": "CreditNote"}]}], "modifiedDate": "2022-10-23T00:00:00Z", "note": "Bill Payment against bill c13e37b6-dfaa-4894-b3be-9fe97bda9f44", "paymentMethodRef": {"id": "EILBDVJVNUAGVKRQ", "name": "AliPay"}, "sourceModifiedDate": "2022-10-23T00:00:00Z", "totalAmount": -1000} + responses: + "400": + application/json: {"canBeRetried": "Unknown", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "detailedErrorCode": 0, "error": "Error processing request - not valid.", "service": "PublicApi", "statusCode": 400} + delete-billPayment: + Unauthorized: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + billPaymentId: "" + responses: + "401": + application/json: {"canBeRetried": "Unknown", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "detailedErrorCode": 0, "error": "Unauthorized", "service": "PublicApi", "statusCode": 401} + get-bill-payments: + Clear Books: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + billPaymentId: "" + responses: + "200": + application/json: {"accountRef": {"id": "dbcaf288-2b39-4b95-8ab3-42202ab15918", "name": "Business Current Account"}, "currency": "GBP", "currencyRate": 1, "date": "2022-05-06T00:00:00", "id": "dcb18480-8b69-44d8-aa26-268b6a80d170", "lines": [{"allocatedOnDate": "2022-05-06T00:00:00", "amount": 71351.42, "links": [{"amount": -71351.42, "currencyRate": 1, "id": "81539597-e681-40c9-a4dd-ec2fffcde572", "type": "Bill"}]}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-26T12:38:17Z", "note": "Bill Payment against bill 81539597-e681-40c9-a4dd-ec2fffcde572", "paymentMethodRef": {"id": "cb4a5647-aa86-40ab-bb4f-158acaa99c12", "name": "Check payments-u4p"}, "sourceModifiedDate": "2022-05-06T00:00:00", "supplierRef": {"id": "8GeHBdBZiZ", "supplierName": "DuBuque, Goyette and Franecki"}, "totalAmount": 71351.42} + Dynamics 365 Business Central: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + billPaymentId: "" + responses: + "200": + application/json: {"accountRef": {"id": "621217b3-89d1-ea11-bbaa-000d3a2b9185", "name": "Petty Cash"}, "currency": "GBP", "currencyRate": 1, "date": "2019-01-01T00:00:00", "id": "19387f05-8ad1-ea11-bbaa-000d3a2b9185", "lines": [{"allocatedOnDate": "2019-01-01T00:00:00", "amount": 234, "links": [{"amount": -234, "currencyRate": 1, "id": "c8cb06bf-89d1-ea11-bbaa-000d3a2b9185-108006", "type": "Bill"}]}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-27T14:21:25Z", "note": "Invoice 107006", "paymentMethodRef": {"id": "EILBDVJVNUAGVKRQ", "name": "AliPay"}, "reference": "108006", "sourceModifiedDate": "2022-10-23T00:00:00Z", "supplierRef": {"id": "c41217b3-89d1-ea11-bbaa-000d3a2b9185", "supplierName": "Wide World Importers"}, "totalAmount": 234} + Exact (Netherlands): + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + billPaymentId: "" + responses: + "200": + application/json: {"accountRef": {"id": "d79d65bd-1d7d-4f55-95d3-76b3a7b7b823", "name": "Bank 1"}, "currency": "EUR", "currencyRate": 1, "date": "2019-11-05T00:00:00Z", "id": "da7e456f-76f7-42ac-8dad-d90a040f3afb", "lines": [{"allocatedOnDate": "2022-10-23T00:00:00Z", "amount": -5, "links": [{"amount": 5, "currencyRate": 1, "id": "63fadca8-4905-475a-b32a-b4341293bcf4", "type": "PaymentOnAccount"}]}], "modifiedDate": "2022-10-26T13:35:13Z", "note": "Bill Payment against bill c13e37b6-dfaa-4894-b3be-9fe97bda9f44", "paymentMethodRef": {"id": "EILBDVJVNUAGVKRQ", "name": "AliPay"}, "reference": "19200008", "sourceModifiedDate": "2019-11-05T14:26:22Z", "supplierRef": {"id": "63fadca8-4905-475a-b32a-b4341293bcf4", "supplierName": "Kelly's Industrial Supplies"}, "totalAmount": -5} + Exact (UK): + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + billPaymentId: "" + responses: + "200": + application/json: {"accountRef": {"id": "4a4e34b5-7f62-4b64-a44a-073398b14b41", "name": "Bank"}, "currency": "GBP", "currencyRate": 1, "date": "2017-10-11T00:00:00Z", "id": "7a5f621b-739f-4ed8-b738-2aae3ef886ac", "lines": [{"allocatedOnDate": "2022-10-23T00:00:00Z", "amount": 123, "links": [{"amount": -123, "currencyRate": 1, "id": "e7a45898-2db3-424c-acb9-a51647740f26", "type": "Bill"}]}], "modifiedDate": "2022-10-26T13:33:17Z", "note": "Bill Payment against bill c13e37b6-dfaa-4894-b3be-9fe97bda9f44", "paymentMethodRef": {"id": "EILBDVJVNUAGVKRQ", "name": "AliPay"}, "reference": "17200006", "sourceModifiedDate": "2017-10-11T10:12:29Z", "supplierRef": {"id": "a7cad20d-44db-442b-ac1f-90475802d6fb", "supplierName": "Pencils Pencils Pencils"}, "totalAmount": 123} + FreeAgent: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + billPaymentId: "" + responses: + "200": + application/json: {"currency": "GBP", "date": "2017-11-23T00:00:00", "id": "135234103", "lines": [{"allocatedOnDate": "2022-10-23T00:00:00Z", "amount": 14.3, "links": [{"amount": -14.3, "currencyRate": 1, "id": "10659723", "type": "Bill"}]}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-25T14:21:36Z", "note": "ATOMIC SOFTWARE LIMITE WELLINGTON,NZL OTHER �14.30 - Bill payment against Pints1 (The Eagle)", "paymentMethodRef": {"id": "EILBDVJVNUAGVKRQ", "name": "AliPay"}, "sourceModifiedDate": "2022-10-23T00:00:00Z", "supplierRef": {"id": "7169654", "supplierName": "The Eagle"}, "totalAmount": 14.3} + FreshBooks: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + billPaymentId: "" + responses: + "200": + application/json: {"accountRef": {"id": "167679", "name": "Cash"}, "currency": "GBP", "date": "2021-08-18T00:00:00", "id": "16", "lines": [{"allocatedOnDate": "2021-08-18T00:00:00", "amount": 10, "links": [{"amount": -10, "currencyRate": 1, "id": "16", "type": "Bill"}]}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-24T16:07:23Z", "note": "Bill payment", "paymentMethodRef": {"id": "EILBDVJVNUAGVKRQ", "name": "AliPay"}, "sourceModifiedDate": "2022-10-23T00:00:00Z", "supplierRef": {"id": "29"}, "totalAmount": 10} + Oracle NetSuite: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + billPaymentId: "" + responses: + "200": + application/json: {"accountRef": {"id": "825", "name": "Codat Europe Bank"}, "currency": "GBP", "currencyRate": 1, "date": "2021-03-26T00:00:00", "id": "112", "lines": [{"allocatedOnDate": "2022-10-23T00:00:00Z", "amount": 120, "links": [{"amount": -120, "currencyRate": 1, "id": "7", "type": "Bill"}]}], "modifiedDate": "2023-01-30T14:48:40Z", "note": "Bill Payment against bill c13e37b6-dfaa-4894-b3be-9fe97bda9f44", "paymentMethodRef": {"id": "EILBDVJVNUAGVKRQ", "name": "AliPay"}, "reference": "Bill Payment #1", "sourceModifiedDate": "2021-03-26T10:31:06", "supplierRef": {"id": "724", "supplierName": "Vendor A.A.A"}, "totalAmount": 120} + QuickBooks Desktop: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + billPaymentId: "" + responses: + "200": + application/json: {"accountRef": {"id": "20000-933270541", "name": "Checking"}, "currency": "GBP", "currencyRate": 1, "date": "2023-01-11T00:00:00", "id": "3A09-1071529982", "lines": [{"allocatedOnDate": "2022-10-23T00:00:00Z", "amount": 532.97, "links": [{"amount": -532.97, "currencyRate": 1, "id": "38AA-1071513625", "type": "Bill"}]}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-26T09:09:20Z", "note": "Monthly Truck Payment", "paymentMethodRef": {"id": "EILBDVJVNUAGVKRQ", "name": "AliPay"}, "reference": "101", "sourceModifiedDate": "2023-12-16T05:04:58", "supplierRef": {"id": "720000-1071512482", "supplierName": "Bayshore Auto Mall"}, "totalAmount": 532.97} + QuickBooks Online: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + billPaymentId: "" + responses: + "200": + application/json: {"currency": "GBP", "currencyRate": 1, "date": "2019-05-13T00:00:00", "id": "20", "lines": [{"allocatedOnDate": "2022-10-23T00:00:00Z", "amount": 0, "links": [{"amount": -5, "currencyRate": 1, "id": "18", "type": "Bill"}, {"amount": 5, "currencyRate": 1, "id": "19", "type": "CreditNote"}]}], "modifiedDate": "2023-01-18T11:02:47Z", "note": "Bill Payment against bill c13e37b6-dfaa-4894-b3be-9fe97bda9f44", "paymentMethodRef": {"id": "EILBDVJVNUAGVKRQ", "name": "AliPay"}, "sourceModifiedDate": "2019-05-13T13:14:26Z", "supplierRef": {"id": "4", "supplierName": "BILLy elliot"}, "totalAmount": 0} + QuickBooks Online Sandbox: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + billPaymentId: "" + responses: + "200": + application/json: {"accountRef": {"id": "81", "name": "Current"}, "currency": "HKD", "currencyRate": 0.078807, "date": "2016-01-23T00:00:00", "id": "158", "lines": [{"allocatedOnDate": "2022-10-23T00:00:00Z", "amount": 7940.6, "links": [{"amount": -7940.6, "currencyRate": 1, "id": "157", "type": "Bill"}]}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-26T09:36:42Z", "note": "Bill Payment against bill c13e37b6-dfaa-4894-b3be-9fe97bda9f44", "paymentMethodRef": {"id": "EILBDVJVNUAGVKRQ", "name": "AliPay"}, "reference": "1067", "sourceModifiedDate": "2016-09-13T21:19:36Z", "supplierRef": {"id": "57", "supplierName": "Hall's Promo Items"}, "totalAmount": 7940.6} + Sage 200cloud: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + billPaymentId: "" + responses: + "200": + application/json: {"currency": "GBP", "currencyRate": 1, "date": "2020-01-05T00:00:00Z", "id": "45462", "lines": [{"allocatedOnDate": "2022-10-23T00:00:00Z", "amount": 27, "links": [{"amount": -27, "currencyRate": 1, "id": "CON001", "type": "PaymentOnAccount"}]}], "modifiedDate": "2022-10-14T09:35:54Z", "note": "", "paymentMethodRef": {"id": "EILBDVJVNUAGVKRQ", "name": "AliPay"}, "reference": "Payment invoice 1", "sourceModifiedDate": "2020-02-28T14:23:46Z", "supplierRef": {"id": "CON001", "supplierName": "Concept Stationery Supplies"}, "totalAmount": 27} + Sage 50 (UK): + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + billPaymentId: "" + responses: + "200": + application/json: {"currency": "GBP", "currencyRate": 1, "date": "2022-01-29T00:00:00", "id": "255", "lines": [{"allocatedOnDate": "2022-10-23T00:00:00Z", "amount": 117.5, "links": [{"amount": -117.5, "currencyRate": 1, "id": "86", "type": "Bill"}]}, {"allocatedOnDate": "2022-10-23T00:00:00Z", "amount": 64.63, "links": [{"amount": -64.63, "currencyRate": 1, "id": "87", "type": "Bill"}]}, {"allocatedOnDate": "2022-10-23T00:00:00Z", "amount": 50.57, "links": [{"amount": -50.57, "currencyRate": 1, "id": "250", "type": "Bill"}]}, {"allocatedOnDate": "2022-10-23T00:00:00Z", "amount": 36.87, "links": [{"amount": -36.87, "currencyRate": 1, "id": "251", "type": "Bill"}]}, {"allocatedOnDate": "2022-10-23T00:00:00Z", "amount": 101.14, "links": [{"amount": -101.14, "currencyRate": 1, "id": "252", "type": "Bill"}]}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-30T14:42:37Z", "note": "Purchase payment 255 linked to, purchase invoice 86, purchase invoice 87, purchase invoice 250, purchase invoice 251, purchase invoice 252.", "paymentMethodRef": {"id": "EILBDVJVNUAGVKRQ", "name": "AliPay"}, "sourceModifiedDate": "2022-11-25T09:43:54", "supplierRef": {"id": "CON001", "supplierName": "Concept Stationery Supplies"}, "totalAmount": 370.71} + Sage Business Cloud Accounting: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + billPaymentId: "" + responses: + "200": + application/json: {"accountRef": {"id": "9a25937b267a11e797950a57719b2edb", "name": "Current"}, "currency": "GBP", "currencyRate": 1, "date": "2018-02-15T00:00:00", "id": "d953b45e156011e8b45c025132dab352", "lines": [{"allocatedOnDate": "2022-10-23T00:00:00Z", "amount": 52.02, "links": [{"amount": -52.02, "currencyRate": 1, "id": "ca430e0d156011e8b45c025132dab352", "type": "PaymentOnAccount"}]}], "modifiedDate": "2022-10-24T14:54:04Z", "note": "Supplier payment using credit/debit card - Cool stuff", "paymentMethodRef": {"id": "EILBDVJVNUAGVKRQ", "name": "AliPay"}, "sourceModifiedDate": "2019-11-20T09:30:03Z", "supplierRef": {"id": "ca430e0d156011e8b45c025132dab352", "supplierName": "Test Supplier"}, "totalAmount": 52.02} + Sage Intacct: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + billPaymentId: "" + responses: + "200": + application/json: {"accountRef": {"id": "353", "name": "Current Account"}, "currency": "GBP", "date": "2022-01-06T00:00:00", "id": "4471", "lines": [{"allocatedOnDate": "2022-10-23T00:00:00Z", "amount": 20, "links": [{"amount": -20, "currencyRate": 1, "id": "4470", "type": "Bill"}]}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-04T16:32:13Z", "note": "", "paymentMethodRef": {"id": "6", "name": "Cash"}, "sourceModifiedDate": "2022-02-23T12:03:30", "supplierRef": {"id": "3", "supplierName": "ADP"}, "totalAmount": 20} + Xero: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + billPaymentId: "" + responses: + "200": + application/json: {"accountRef": {"id": "bd9e85e0-0478-433d-ae9f-0b3c4f04bfe4", "name": "Business Bank Account"}, "currency": "GBP", "currencyRate": 1, "date": "2021-12-20T00:00:00", "id": "74004690-82a1-4810-aaca-6ce575af94b4", "lines": [{"allocatedOnDate": "2022-10-23T00:00:00Z", "amount": 7267.2, "links": [{"amount": -7267.2, "currencyRate": 1, "id": "3945273c-cc04-479f-a4b5-1e3dc7a55ed1", "type": "Bill"}]}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-15T20:37:10Z", "note": "Bill Payment against bill c13e37b6-dfaa-4894-b3be-9fe97bda9f44", "paymentMethodRef": {"id": "EILBDVJVNUAGVKRQ", "name": "AliPay"}, "sourceModifiedDate": "2021-01-02T22:51:40", "supplierRef": {"id": "1262c350-fe0f-40ec-aeff-41c95b4a45af", "supplierName": "DIISR - Small Business Services"}, "totalAmount": 7267.2} + Unauthorized: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + billPaymentId: "" + responses: + "401": + application/json: {"canBeRetried": "Unknown", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "detailedErrorCode": 0, "error": "Unauthorized", "service": "PublicApi", "statusCode": 401} + get-create-billPayment-model: + Dynamics 365 Business Central: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + responses: + "200": + application/json: {"description": "A bill payment represents an allocation of transactions across an 'accounts payable' account (supplier)", "displayName": "BillPayment", "properties": {"supplierRef": {"description": "Reference to the supplier the payment has been sent to", "displayName": "Supplier Reference", "required": true, "type": "Object"}, "accountRef": {"description": "Reference to the nominal account the payment is linked to", "displayName": "Nominal Account Reference", "required": false, "type": "Object"}, "currency": {"description": "Currency of the payment", "displayName": "Currency", "required": true, "type": "String", "validation": {"information": [], "warnings": [{"details": "Must be a valid currency code", "field": "Currency"}]}}, "note": {"description": "Any additional text based information associated with the payment", "displayName": "Note", "required": false, "type": "String"}, "lines": {"description": "A collection of payment lines", "displayName": "Lines", "required": true, "type": "Array"}}, "required": true, "type": "Object"} + FreeAgent: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + responses: + "200": + application/json: {"description": "A bill payment represents an allocation of transactions across an 'accounts payable' account (supplier)", "displayName": "BillPayment", "properties": {"accountRef": {"description": "Reference to the nominal account the payment is linked to", "displayName": "Nominal Account Reference", "required": true, "type": "Object"}, "date": {"description": "The date the payment was recorded", "displayName": "Date", "required": true, "type": "DateTime"}, "totalAmount": {"description": "The total amount of the payment, inclusive of discounts and tax", "displayName": "Total Amount", "required": true, "type": "Number", "validation": {"information": [], "warnings": [{"details": "Must match the sum of the line amounts.", "field": "TotalAmount"}]}}, "currency": {"description": "Currency of the payment", "displayName": "Currency", "required": true, "type": "String"}, "currencyRate": {"description": "The exchange rate between the currency of the payment and the base currency of the company", "displayName": "Currency Exchange Rate", "required": true, "type": "Number"}, "lines": {"description": "A collection of payment lines", "displayName": "Lines", "required": true, "type": "Array", "validation": {"information": [], "warnings": [{"details": "Only one line may be specified", "field": "Lines"}]}}}, "required": true, "type": "Object"} + MYOB AccountRight and Essentials: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + responses: + "200": + application/json: {"description": "A bill payment represents an allocation of transactions across an 'accounts payable' account (supplier)", "displayName": "BillPayment", "properties": {"supplierRef": {"description": "Reference to the supplier the payment has been sent to", "displayName": "Supplier Reference", "required": true, "type": "Object", "validation": {"information": [{"details": "Must be provided.", "field": "SupplierRef"}], "warnings": []}}, "accountRef": {"description": "Reference to the nominal account the payment is linked to", "displayName": "Nominal Account Reference", "required": true, "type": "Object", "validation": {"information": [{"details": "Must be provided.", "field": "AccountRef"}], "warnings": []}}, "totalAmount": {"description": "The total amount of the payment, inclusive of discounts and tax", "displayName": "Total Amount", "required": true, "type": "Number", "validation": {"information": [{"details": "Must be provided and must equal the sum of the link items amount.", "field": "TotalAmount"}], "warnings": [{"details": "Precision must be maximum of two decimal places.", "field": "TotalAmount"}, {"details": "Must be greater than zero.", "field": "TotalAmount"}]}}, "date": {"description": "The date the payment was recorded", "displayName": "Date", "required": true, "type": "DateTime", "validation": {"information": [{"details": "Must be provided.", "field": "Date"}], "warnings": []}}, "reference": {"description": "A user friendly reference for the payment", "displayName": "Reference", "required": false, "type": "String", "validation": {"information": [{"details": "Must not be greater than 8 characters long.", "field": "Reference"}], "warnings": []}}, "currency": {"description": "Currency of the payment", "displayName": "Currency", "options": [{"displayName": "Australian Dollar", "required": false, "type": "String", "value": "AUD"}], "required": true, "type": "String", "validation": {"information": [{"details": "Must be provided.", "field": "Currency"}], "warnings": []}}, "lines": {"description": "A collection of payment lines", "displayName": "Lines", "required": true, "type": "Array", "validation": {"information": [{"details": "Must be provided.", "field": "Lines"}], "warnings": []}}}, "required": true, "type": "Object"} + Oracle NetSuite: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + responses: + "200": + application/json: {"description": "A bill payment represents an allocation of transactions across an 'accounts payable' account (supplier)", "displayName": "BillPayment", "properties": {"supplierRef": {"description": "Reference to the supplier the payment has been sent to", "displayName": "Supplier Reference", "required": true, "type": "Object"}, "accountRef": {"description": "Reference to the nominal account the payment is linked to", "displayName": "Nominal Account Reference", "required": true, "type": "Object"}, "date": {"description": "The date the payment was recorded", "displayName": "Date", "required": true, "type": "DateTime"}, "currency": {"description": "Currency of the payment", "displayName": "Currency", "required": true, "type": "String", "validation": {"information": [], "warnings": [{"details": "If the currency is set make sure it's the same as the 'Bill' and/or 'VendorCredit' currency", "field": "Currency"}]}}, "note": {"description": "Any additional text based information associated with the payment", "displayName": "Note", "required": false, "type": "String"}, "reference": {"description": "A user friendly reference for the payment", "displayName": "Reference", "required": false, "type": "String", "validation": {"information": [{"details": "This field can be used to provide a tracking category id (Location only)", "field": "Reference"}], "warnings": [{"details": "The id format should be 'location-'", "field": "Reference"}]}}, "lines": {"description": "A collection of payment lines", "displayName": "Lines", "required": true, "type": "Array"}}, "required": true, "type": "Object"} + QuickBooks Desktop: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + responses: + "200": + application/json: {"description": "A bill payment represents an allocation of transactions across an 'accounts payable' account (supplier)", "displayName": "BillPayment", "properties": {"supplierRef": {"description": "Reference to the supplier the payment has been sent to", "displayName": "Supplier Reference", "required": true, "type": "Object"}, "accountRef": {"description": "Reference to the nominal account the payment is linked to", "displayName": "Nominal Account Reference", "required": true, "type": "Object"}, "date": {"description": "The date the payment was recorded", "displayName": "Date", "required": true, "type": "DateTime"}, "note": {"description": "Any additional text based information associated with the payment", "displayName": "Note", "required": false, "type": "String"}, "currency": {"description": "Currency of the payment", "displayName": "Currency", "required": false, "type": "String", "validation": {"information": [{"details": "If not set, will default to the default currency of the supplier", "field": "Currency"}], "warnings": [{"details": "Must be a three letter ISO code that matches the currency of the supplier", "field": "Currency"}, {"details": "Can only be set if the Quickbooks Desktop company has Multicurrency enabled.", "field": "Currency"}]}}, "currencyRate": {"description": "The exchange rate between the currency of the payment and the base currency of the company", "displayName": "Currency Exchange Rate", "required": false, "type": "Number", "validation": {"information": [{"details": "If not set, will default to the rate set within QuickBooks Desktop, if no rate is set in QuickBooks Desktop, it will default to 1.", "field": "CurrencyRate"}, {"details": "Can only be set if the Quickbooks Desktop company has Multicurrency enabled.", "field": "CurrencyRate"}], "warnings": []}}, "totalAmount": {"description": "The total amount of the payment, inclusive of discounts and tax", "displayName": "Total Amount", "required": true, "type": "Number", "validation": {"information": [], "warnings": [{"details": "Must match the sum of amounts in the lines", "field": "TotalAmount"}]}}, "lines": {"description": "A collection of payment lines", "displayName": "Lines", "required": true, "type": "Array"}}, "required": true, "type": "Object"} + QuickBooks Online Sandbox: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + responses: + "200": + application/json: {"description": "A bill payment represents an allocation of transactions across an 'accounts payable' account (supplier)", "displayName": "BillPayment", "properties": {"supplierRef": {"description": "Reference to the supplier the payment has been sent to", "displayName": "Supplier Reference", "required": true, "type": "Object", "validation": {"information": [{"details": "Must be the ID of the Supplier associated with the Bill or Credit Note.", "field": "SupplierRef"}], "warnings": []}}, "totalAmount": {"description": "The total amount of the payment, inclusive of discounts and tax", "displayName": "Total Amount", "required": true, "type": "Number"}, "accountRef": {"description": "Reference to the nominal account the payment is linked to", "displayName": "Nominal Account Reference", "required": false, "type": "Object", "validation": {"information": [{"details": "Required if TotalAmount is greater than zero.", "field": "AccountRef"}], "warnings": []}}, "currency": {"description": "Currency of the payment", "displayName": "Currency", "required": false, "type": "String", "validation": {"information": [{"details": "Required if multi-currency is enabled for the company.", "field": "Currency"}], "warnings": []}}, "currencyRate": {"description": "The exchange rate between the currency of the payment and the base currency of the company", "displayName": "Currency Exchange Rate", "required": false, "type": "Number", "validation": {"information": [{"details": "Required if Currency is not the base currency.", "field": "CurrencyRate"}], "warnings": []}}, "paymentMethodRef": {"description": "The method of payment", "displayName": "Payment Method Reference", "required": false, "type": "Object", "validation": {"information": [], "warnings": [{"details": "If provided it will be ignored.", "field": "PaymentMethodRef"}]}}, "date": {"description": "The date the payment was recorded", "displayName": "Date", "required": true, "type": "DateTime"}, "note": {"description": "Any additional text based information associated with the payment", "displayName": "Note", "required": false, "type": "String"}, "lines": {"description": "A collection of payment lines", "displayName": "Lines", "required": true, "type": "Array"}}, "required": true, "type": "Object"} + QuickBooks Online: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + responses: + "200": + application/json: {"description": "A bill payment represents an allocation of transactions across an 'accounts payable' account (supplier)", "displayName": "BillPayment", "properties": {"supplierRef": {"description": "Reference to the supplier the payment has been sent to", "displayName": "Supplier Reference", "required": true, "type": "Object", "validation": {"information": [{"details": "Must be the ID of the Supplier associated with the Bill or Credit Note.", "field": "SupplierRef"}], "warnings": []}}, "totalAmount": {"description": "The total amount of the payment, inclusive of discounts and tax", "displayName": "Total Amount", "required": true, "type": "Number"}, "accountRef": {"description": "Reference to the nominal account the payment is linked to", "displayName": "Nominal Account Reference", "required": false, "type": "Object", "validation": {"information": [{"details": "Required if TotalAmount is greater than zero.", "field": "AccountRef"}], "warnings": []}}, "currency": {"description": "Currency of the payment", "displayName": "Currency", "required": false, "type": "String", "validation": {"information": [{"details": "Required if multi-currency is enabled for the company.", "field": "Currency"}], "warnings": []}}, "currencyRate": {"description": "The exchange rate between the currency of the payment and the base currency of the company", "displayName": "Currency Exchange Rate", "required": false, "type": "Number", "validation": {"information": [{"details": "Required if Currency is not the base currency.", "field": "CurrencyRate"}], "warnings": []}}, "paymentMethodRef": {"description": "The method of payment", "displayName": "Payment Method Reference", "required": false, "type": "Object", "validation": {"information": [], "warnings": [{"details": "If provided it will be ignored.", "field": "PaymentMethodRef"}]}}, "date": {"description": "The date the payment was recorded", "displayName": "Date", "required": true, "type": "DateTime"}, "note": {"description": "Any additional text based information associated with the payment", "displayName": "Note", "required": false, "type": "String"}, "lines": {"description": "A collection of payment lines", "displayName": "Lines", "required": true, "type": "Array"}}, "required": true, "type": "Object"} + Sage 50 (UK): + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + responses: + "200": + application/json: {"description": "A bill payment represents an allocation of transactions across an 'accounts payable' account (supplier)", "displayName": "BillPayment", "properties": {"accountRef": {"description": "The bank account to pay this bill from.", "displayName": "Bank Account", "required": true, "type": "Object"}, "supplierRef": {"description": "Supplier to be paid.", "displayName": "Supplier", "required": true, "type": "Object"}, "totalAmount": {"description": "The total amount being paid to the supplier.", "displayName": "Total Amount", "required": true, "type": "Number", "validation": {"information": [{"details": "This must equal the sum of the line amounts"}], "warnings": []}}, "reference": {"description": "The user reference for this bill payment.", "displayName": "Reference", "required": false, "type": "Number"}, "date": {"description": "The date this payment was issued.", "displayName": "Issue Date", "required": true, "type": "Number"}, "note": {"description": "A description of the payment.", "displayName": "Note", "required": false, "type": "Number"}, "lines": {"description": "Line items of the payment.", "displayName": "Line Items", "required": true, "type": "Array", "validation": {"information": [{"details": "Sage 50 only supports one line item per bill payment so all lines will be merged together in the response."}], "warnings": []}}}, "required": true, "type": "Object", "validation": {"information": [{"details": "Pushing to Sage 50 2015 (v21) or below is not supported. To enable push, please upgrade to at least Sage 50 2016 (v22) and re-sync the company."}], "warnings": []}} + Sage Business Cloud Accounting: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + responses: + "200": + application/json: {"description": "A bill payment represents an allocation of transactions across an 'accounts payable' account (supplier)", "displayName": "BillPayment", "properties": {"accountRef": {"description": "Reference to the nominal account the payment is linked to", "displayName": "Nominal Account Reference", "required": false, "type": "Object", "validation": {"information": [], "warnings": [{"details": "Required unless the BillPayment is only allocating a Credit Note.", "field": "AccountRef"}]}}, "supplierRef": {"description": "Reference to the supplier the payment has been sent to", "displayName": "Supplier Reference", "required": true, "type": "Object"}, "date": {"description": "The date the payment was recorded", "displayName": "Date", "required": true, "type": "DateTime", "validation": {"information": [{"details": "Must be provided.", "field": "Date"}], "warnings": []}}, "totalAmount": {"description": "The total amount of the payment, inclusive of discounts and tax", "displayName": "Total Amount", "required": true, "type": "Number", "validation": {"information": [{"details": "Must be provided.", "field": "TotalAmount"}], "warnings": [{"details": "Must be zero when allocating against Bills using a Credit Note only.", "field": "TotalAmount"}, {"details": "Must equal the sum of the link items amount.", "field": "TotalAmount"}]}}, "note": {"description": "Any additional text based information associated with the payment", "displayName": "Note", "required": false, "type": "String", "validation": {"information": [{"details": "Should not be longer than 25 characters.", "field": "Note"}], "warnings": []}}, "currency": {"description": "Currency of the payment", "displayName": "Currency", "required": true, "type": "String", "validation": {"information": [{"details": "If supplied, must match the currency of the supplier.", "field": "Currency"}], "warnings": []}}, "currencyRate": {"description": "The exchange rate between the currency of the payment and the base currency of the company", "displayName": "Currency Exchange Rate", "required": false, "type": "Number"}, "lines": {"description": "A collection of payment lines", "displayName": "Lines", "required": true, "type": "Array"}}, "required": true, "type": "Object"} + Sage Intacct: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + responses: + "200": + application/json: {"description": "A bill payment represents an allocation of transactions across an 'accounts payable' account (supplier)", "displayName": "BillPayment", "properties": {"supplierRef": {"description": "Reference to the supplier the payment has been sent to", "displayName": "Supplier Reference", "required": true, "type": "Object"}, "accountRef": {"description": "Reference to the nominal account the payment is linked to", "displayName": "Nominal Account Reference", "required": true, "type": "Object"}, "totalAmount": {"description": "The total amount of the payment, inclusive of discounts and tax", "displayName": "Total Amount", "required": true, "type": "Number", "validation": {"information": [], "warnings": [{"details": "Must be a positive amount", "field": "TotalAmount"}]}}, "currency": {"description": "Currency of the payment", "displayName": "Currency", "options": [{"displayName": "Australian Dollar", "required": false, "type": "String", "value": "AUD"}, {"displayName": "Canadian Dollar", "required": false, "type": "String", "value": "CAD"}, {"displayName": "Pound Sterling", "required": false, "type": "String", "value": "GBP"}, {"displayName": "US Dollar", "required": false, "type": "String", "value": "USD"}, {"displayName": "Rand", "required": false, "type": "String", "value": "ZAR"}], "required": false, "type": "String"}, "date": {"description": "The date the payment was recorded", "displayName": "Date", "required": true, "type": "DateTime"}, "note": {"description": "Any additional text based information associated with the payment", "displayName": "Note", "required": false, "type": "String", "validation": {"information": [], "warnings": [{"details": "Must be no greater than 1000 characters", "field": "Note"}]}}, "paymentMethodRef": {"description": "The method of payment", "displayName": "Payment Method Reference", "required": true, "type": "Object"}, "lines": {"description": "A collection of payment lines", "displayName": "Lines", "required": true, "type": "Array"}}, "required": true, "type": "Object"} + Sandbox: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + responses: + "200": + application/json: {"description": "A bill payment represents an allocation of transactions across an 'accounts payable' account (supplier)", "displayName": "BillPayment", "properties": {"supplierRef": {"description": "Reference to the supplier the payment has been sent to", "displayName": "Supplier Reference", "required": true, "type": "Object"}, "accountRef": {"description": "Reference to the nominal account the payment is linked to", "displayName": "Nominal Account Reference", "required": true, "type": "Object"}, "totalAmount": {"description": "The total amount of the payment, inclusive of discounts and tax", "displayName": "Total Amount", "required": true, "type": "Number"}, "currency": {"description": "Currency of the payment", "displayName": "Currency", "required": true, "type": "String"}, "currencyRate": {"description": "The exchange rate between the currency of the payment and the base currency of the company", "displayName": "Currency Exchange Rate", "required": true, "type": "Number"}, "date": {"description": "The date the payment was recorded", "displayName": "Date", "required": true, "type": "DateTime"}, "note": {"description": "Any additional text based information associated with the payment", "displayName": "Note", "required": true, "type": "String"}, "paymentMethodRef": {"description": "The method of payment", "displayName": "Payment Method Reference", "required": true, "type": "Object"}, "lines": {"description": "A collection of payment lines", "displayName": "Lines", "required": true, "type": "Array"}, "reference": {"description": "A user friendly reference for the payment", "displayName": "Reference", "required": true, "type": "String"}, "metadata": {"description": "Miscellaneous data about the item", "displayName": "Metadata", "required": true, "type": "Object"}}, "required": true, "type": "Object"} + Xero: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + responses: + "200": + application/json: {"description": "A bill payment represents an allocation of transactions across an 'accounts payable' account (supplier)", "displayName": "BillPayment", "properties": {"date": {"description": "The date the payment was recorded", "displayName": "Date", "required": true, "type": "DateTime", "validation": {"information": [{"details": "Must be provided.", "field": "Date"}], "warnings": []}}, "totalAmount": {"description": "The total amount of the payment, inclusive of discounts and tax", "displayName": "Total Amount", "required": true, "type": "Number", "validation": {"information": [{"details": "Must be provided.", "field": "TotalAmount"}], "warnings": [{"details": "Must match the sum of line amounts.", "field": "TotalAmount"}]}}, "note": {"description": "Any additional text based information associated with the payment", "displayName": "Note", "required": false, "type": "String"}, "currency": {"description": "Currency of the payment", "displayName": "Currency", "required": true, "type": "String", "validation": {"information": [{"details": "Must be the company's base currency when pushing a batch payment.", "field": "Currency"}], "warnings": []}}, "accountRef": {"description": "Reference to the nominal account the payment is linked to", "displayName": "Nominal Account Reference", "required": false, "type": "Object", "validation": {"information": [{"details": "Must be provided if paying a bill from a Bank Account.", "field": "AccountRef"}], "warnings": []}}, "lines": {"description": "A collection of payment lines", "displayName": "Lines", "required": true, "type": "Array", "validation": {"information": [{"details": "When more than one line is provided, a batch payment will be created.", "field": "Lines"}], "warnings": []}}}, "required": true, "type": "Object"} + Zoho Books: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + responses: + "200": + application/json: {"description": "A bill payment represents an allocation of transactions across an 'accounts payable' account (supplier)", "displayName": "BillPayment", "properties": {"supplierRef": {"description": "Reference to the supplier the payment has been sent to", "displayName": "Supplier Reference", "required": true, "type": "Object"}, "accountRef": {"description": "Reference to the nominal account the payment is linked to", "displayName": "Nominal Account Reference", "required": false, "type": "Object", "validation": {"information": [], "warnings": [{"details": "Must be provided when making a payment to an invoice and/or a payment on account", "field": "AccountRef"}]}}, "currency": {"description": "Currency of the payment", "displayName": "Currency", "required": true, "type": "String", "validation": {"information": [], "warnings": [{"details": "Must match supplier's currency", "field": "Currency"}]}}, "currencyRate": {"description": "The exchange rate between the currency of the payment and the base currency of the company", "displayName": "Currency Exchange Rate", "required": false, "type": "Number", "validation": {"information": [], "warnings": [{"details": "Must be greater or equal to 0", "field": "CurrencyRate"}]}}, "date": {"description": "The date the payment was recorded", "displayName": "Date", "required": true, "type": "DateTime"}, "note": {"description": "Any additional text based information associated with the payment", "displayName": "Note", "required": false, "type": "String"}, "lines": {"description": "A collection of payment lines", "displayName": "Lines", "required": true, "type": "Array", "validation": {"information": [], "warnings": [{"details": "Must contain 1 bill payment line", "field": "Lines"}]}}}, "required": true, "type": "Object"} + Unauthorized: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + responses: + "401": + application/json: {"canBeRetried": "Unknown", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "detailedErrorCode": 0, "error": "Unauthorized", "service": "PublicApi", "statusCode": 401} + list-bill-payments: + "": + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/{id}/data/{dataType}?page=1&pageSize=10"}, "self": {"href": "/companies/{id}/data/{dataType}"}}, "pageNumber": 1, "pageSize": 10, "results": [{"currency": "EUR", "date": "2022-10-23T00:00:00Z", "id": "3d5a8e00-d108-4045-8823-7f342676cffa", "lines": [{"allocatedOnDate": "2022-10-23T00:00:00Z", "amount": 1000, "links": [{"amount": -1000, "id": "x", "type": "Bill"}]}], "modifiedDate": "2022-10-23T00:00:00Z", "note": "Bill Payment against bill c13e37b6-dfaa-4894-b3be-9fe97bda9f44", "paymentMethodRef": {"id": "EILBDVJVNUAGVKRQ", "name": "AliPay"}, "sourceModifiedDate": "2022-10-23T00:00:00Z", "totalAmount": 1000}, {"currency": "GBP", "date": "2022-10-23T00:00:00Z", "id": "3d5a8e00-d108-4045-8823-7f342676cffa", "lines": [{"allocatedOnDate": "2022-10-23T00:00:00Z", "amount": 0, "links": [{"amount": -1000, "id": "x", "type": "Bill"}, {"amount": 1000, "id": "y", "type": "CreditNote"}]}], "modifiedDate": "2022-10-23T00:00:00Z", "note": "Bill Payment against bill c13e37b6-dfaa-4894-b3be-9fe97bda9f44", "paymentMethodRef": {"id": "EILBDVJVNUAGVKRQ", "name": "AliPay"}, "sourceModifiedDate": "2022-10-23T00:00:00Z", "totalAmount": 0}, {"currency": "GBP", "date": "2022-10-23T00:00:00Z", "id": "3d5a8e00-d108-4045-8823-7f342676cffa", "lines": [{"allocatedOnDate": "2022-10-23T00:00:00Z", "amount": 1000, "links": [{"amount": -1000, "id": "x", "type": "Bill"}]}, {"allocatedOnDate": "2022-10-23T00:00:00Z", "amount": 1000, "links": [{"amount": -1000, "id": "y", "type": "PaymentOnAccount"}]}], "modifiedDate": "2022-10-23T00:00:00Z", "note": "Bill Payment against bill c13e37b6-dfaa-4894-b3be-9fe97bda9f44", "paymentMethodRef": {"id": "EILBDVJVNUAGVKRQ", "name": "AliPay"}, "sourceModifiedDate": "2022-10-23T00:00:00Z", "totalAmount": 2000}, {"currency": "GBP", "date": "2022-10-23T00:00:00Z", "id": "3d5a8e00-d108-4045-8823-7f342676cffa", "lines": [{"allocatedOnDate": "2022-10-23T00:00:00Z", "amount": -1000, "links": [{"amount": 1000, "id": "y", "type": "CreditNote"}]}], "modifiedDate": "2022-10-23T00:00:00Z", "note": "Bill Payment against bill c13e37b6-dfaa-4894-b3be-9fe97bda9f44", "paymentMethodRef": {"id": "EILBDVJVNUAGVKRQ", "name": "AliPay"}, "sourceModifiedDate": "2022-10-23T00:00:00Z", "totalAmount": -1000}, {"currency": "USD", "date": "2022-10-23T00:00:00Z", "id": "3d5a8e00-d108-4045-8823-7f342676cffa", "lines": [{"allocatedOnDate": "2022-10-23T00:00:00Z", "amount": -1000, "links": [{"amount": 1000, "id": "y", "type": "PaymentOnAccount"}]}], "modifiedDate": "2022-10-23T00:00:00Z", "note": "Bill Payment against bill c13e37b6-dfaa-4894-b3be-9fe97bda9f44", "paymentMethodRef": {"id": "EILBDVJVNUAGVKRQ", "name": "AliPay"}, "sourceModifiedDate": "2022-10-23T00:00:00Z", "totalAmount": -1000}, {"currency": "EUR", "date": "2022-10-23T00:00:00Z", "id": "3d5a8e00-d108-4045-8823-7f342676cffa", "lines": [{"allocatedOnDate": "2022-10-23T00:00:00Z", "amount": 0, "links": [{"amount": -750, "id": "x", "type": "Bill"}, {"amount": 750, "id": "y", "type": "CreditNote"}]}, {"allocatedOnDate": "2022-10-23T00:00:00Z", "amount": 250, "links": [{"amount": -250, "id": "x", "type": "Bill"}]}], "modifiedDate": "2022-10-23T00:00:00Z", "note": "Bill Payment against bill c13e37b6-dfaa-4894-b3be-9fe97bda9f44", "paymentMethodRef": {"id": "EILBDVJVNUAGVKRQ", "name": "AliPay"}, "sourceModifiedDate": "2022-10-23T00:00:00Z", "totalAmount": 250}, {"currency": "GBP", "date": "2022-10-23T00:00:00Z", "id": "3d5a8e00-d108-4045-8823-7f342676cffa", "lines": [{"allocatedOnDate": "2022-10-23T00:00:00Z", "amount": 1000, "links": [{"amount": -1000, "id": "x", "type": "Bill"}]}], "modifiedDate": "2022-10-23T00:00:00Z", "note": "Bill Payment against bill c13e37b6-dfaa-4894-b3be-9fe97bda9f44", "paymentMethodRef": {"id": "EILBDVJVNUAGVKRQ", "name": "AliPay"}, "sourceModifiedDate": "2022-10-23T00:00:00Z", "totalAmount": 1000}, {"currency": "USD", "date": "2022-10-23T00:00:00Z", "id": "3d5a8e00-d108-4045-8823-7f342676cffa", "lines": [{"allocatedOnDate": "2022-10-23T00:00:00Z", "amount": 0, "links": [{"amount": -1000, "id": "x", "type": "Bill"}, {"amount": 1000, "id": "y", "type": "CreditNote"}]}, {"allocatedOnDate": "2022-10-23T00:00:00Z", "amount": 0, "links": [{"amount": -1000, "id": "x", "type": "Bill"}, {"amount": 1000, "id": "z", "type": "CreditNote"}]}, {"allocatedOnDate": "2022-10-23T00:00:00Z", "amount": 1000, "links": [{"amount": -1000, "id": "x", "type": "Bill"}]}, {"allocatedOnDate": "2022-10-23T00:00:00Z", "amount": 1000, "links": [{"amount": -1000, "id": "customer-001", "type": "PaymentOnAccount"}]}], "modifiedDate": "2022-10-23T00:00:00Z", "note": "Bill Payment against bill c13e37b6-dfaa-4894-b3be-9fe97bda9f44", "paymentMethodRef": {"id": "EILBDVJVNUAGVKRQ", "name": "AliPay"}, "sourceModifiedDate": "2022-10-23T00:00:00Z", "totalAmount": 2000}, {"currency": "EUR", "date": "2022-10-23T00:00:00Z", "id": "3d5a8e00-d108-4045-8823-7f342676cffa", "lines": [{"allocatedOnDate": "2022-10-23T00:00:00Z", "amount": 0, "links": [{"amount": -1000, "id": "w", "type": "Bill"}, {"amount": -1000, "id": "x", "type": "Bill"}, {"amount": 1000, "id": "y", "type": "CreditNote"}, {"amount": 1000, "id": "z", "type": "CreditNote"}]}], "modifiedDate": "2022-10-23T00:00:00Z", "note": "Bill Payment against bill c13e37b6-dfaa-4894-b3be-9fe97bda9f44", "paymentMethodRef": {"id": "EILBDVJVNUAGVKRQ", "name": "AliPay"}, "sourceModifiedDate": "2022-10-23T00:00:00Z", "totalAmount": 0}, {"currency": "EUR", "date": "2022-10-23T00:00:00Z", "id": "3d5a8e00-d108-4045-8823-7f342676cffa", "lines": [{"allocatedOnDate": "2022-10-23T00:00:00Z", "amount": 1000, "links": [{"amount": -1000, "id": "x", "type": "Bill"}]}], "modifiedDate": "2022-10-23T00:00:00Z", "note": "Bill Payment against bill c13e37b6-dfaa-4894-b3be-9fe97bda9f44", "paymentMethodRef": {"id": "EILBDVJVNUAGVKRQ", "name": "AliPay"}, "sourceModifiedDate": "2022-10-23T00:00:00Z", "totalAmount": 1000}, {"currency": "EUR", "date": "1901-01-01", "id": "001", "lines": [{"allocatedOnDate": "2022-10-23T00:00:00Z", "amount": 1000, "links": [{"amount": -1000, "id": "x", "type": "Bill"}]}, {"allocatedOnDate": "2022-10-23T00:00:00Z", "amount": 4000, "links": [{"amount": -4000, "id": "y", "type": "PaymentOnAccount"}]}], "modifiedDate": "2022-10-23T00:00:00Z", "note": "Bill Payment against bill c13e37b6-dfaa-4894-b3be-9fe97bda9f44", "paymentMethodRef": {"id": "EILBDVJVNUAGVKRQ", "name": "AliPay"}, "sourceModifiedDate": "2022-10-23T00:00:00Z", "totalAmount": 5000}, {"currency": "EUR", "date": "1901-01-01", "id": "001", "lines": [{"allocatedOnDate": "2022-10-23T00:00:00Z", "amount": 1000, "links": [{"amount": -1000, "id": "x", "type": "Bill"}]}, {"allocatedOnDate": "2022-10-23T00:00:00Z", "amount": 1000, "links": [{"amount": -1000, "id": "y", "type": "Bill"}]}, {"allocatedOnDate": "2022-10-23T00:00:00Z", "amount": 3000, "links": [{"amount": -3000, "id": "y", "type": "PaymentOnAccount"}]}], "modifiedDate": "2022-10-23T00:00:00Z", "note": "Bill Payment against bill c13e37b6-dfaa-4894-b3be-9fe97bda9f44", "paymentMethodRef": {"id": "EILBDVJVNUAGVKRQ", "name": "AliPay"}, "sourceModifiedDate": "2022-10-23T00:00:00Z", "totalAmount": 5000}, {"currency": "EUR", "date": "2022-10-23T00:00:00Z", "id": "3d5a8e00-d108-4045-8823-7f342676cffa", "lines": [{"allocatedOnDate": "2022-10-23T00:00:00Z", "amount": 500, "links": [{"amount": -1000, "id": "a", "type": "Bill"}, {"amount": -1000, "id": "b", "type": "Bill"}, {"amount": 750, "id": "y", "type": "CreditNote"}, {"amount": 750, "id": "z", "type": "CreditNote"}]}], "modifiedDate": "2022-10-23T00:00:00Z", "note": "Bill Payment against bill c13e37b6-dfaa-4894-b3be-9fe97bda9f44", "paymentMethodRef": {"id": "EILBDVJVNUAGVKRQ", "name": "AliPay"}, "sourceModifiedDate": "2022-10-23T00:00:00Z", "totalAmount": 500}], "totalResults": 1} + "400": {} + Clear Books: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/354a121b-855f-4d25-90ad-0905b498c1c0/data/billPayments?page=1&pageSize=2"}, "next": {"href": "/companies/354a121b-855f-4d25-90ad-0905b498c1c0/data/billPayments?page=2&pageSize=2"}, "self": {"href": "/companies/354a121b-855f-4d25-90ad-0905b498c1c0/data/billPayments"}}, "pageNumber": 1, "pageSize": 2, "results": [{"accountRef": {"id": "dbcaf288-2b39-4b95-8ab3-42202ab15918", "name": "Business Current Account"}, "currency": "GBP", "currencyRate": 1, "date": "2022-05-06T00:00:00", "id": "dcb18480-8b69-44d8-aa26-268b6a80d170", "lines": [{"allocatedOnDate": "2022-05-06T00:00:00", "amount": 71351.42, "links": [{"amount": -71351.42, "currencyRate": 1, "id": "81539597-e681-40c9-a4dd-ec2fffcde572", "type": "Bill"}]}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-26T12:38:17Z", "note": "Bill Payment against bill 81539597-e681-40c9-a4dd-ec2fffcde572", "paymentMethodRef": {"id": "cb4a5647-aa86-40ab-bb4f-158acaa99c12", "name": "Check payments-u4p"}, "sourceModifiedDate": "2022-05-06T00:00:00", "supplierRef": {"id": "8GeHBdBZiZ", "supplierName": "DuBuque, Goyette and Franecki"}, "totalAmount": 71351.42}, {"accountRef": {"id": "dbcaf288-2b39-4b95-8ab3-42202ab15918", "name": "Business Current Account"}, "currency": "GBP", "currencyRate": 1, "date": "2022-05-14T13:12:00", "id": "ca0976d0-036d-4187-ab66-7169286b007d", "lines": [{"allocatedOnDate": "2022-05-14T13:12:00", "amount": 16221.64, "links": [{"amount": -16221.64, "currencyRate": 1, "id": "3f44d2be-d4c2-4cc3-8216-8add5265eb13", "type": "Bill"}]}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-26T12:38:17Z", "note": "Bill Payment against bill 3f44d2be-d4c2-4cc3-8216-8add5265eb13", "paymentMethodRef": {"id": "fc87fba8-812e-4a54-b633-29ef2abf4c12", "name": "CreditCard payments-u4p"}, "sourceModifiedDate": "2022-05-14T13:12:00", "supplierRef": {"id": "9efd64dc-4b31-425d-9eb2-7c7773593713", "supplierName": "Jacobson, Konopelski and Heidenreich"}, "totalAmount": 16221.64}], "totalResults": 232} + Dynamics 365 Business Central: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/d6849caf-c146-41be-8335-b73346e3bd84/data/billPayments?page=1&pageSize=2"}, "next": {"href": "/companies/d6849caf-c146-41be-8335-b73346e3bd84/data/billPayments?page=2&pageSize=2"}, "self": {"href": "/companies/d6849caf-c146-41be-8335-b73346e3bd84/data/billPayments"}}, "pageNumber": 1, "pageSize": 2, "results": [{"accountRef": {"id": "621217b3-89d1-ea11-bbaa-000d3a2b9185", "name": "Petty Cash"}, "currency": "GBP", "currencyRate": 1, "date": "2019-01-01T00:00:00", "id": "19387f05-8ad1-ea11-bbaa-000d3a2b9185", "lines": [{"allocatedOnDate": "2019-01-01T00:00:00", "amount": 234, "links": [{"amount": -234, "currencyRate": 1, "id": "c8cb06bf-89d1-ea11-bbaa-000d3a2b9185-108006", "type": "Bill"}]}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-27T14:21:25Z", "note": "Invoice 107006", "paymentMethodRef": {"id": "EILBDVJVNUAGVKRQ", "name": "AliPay"}, "reference": "108006", "sourceModifiedDate": "2022-10-23T00:00:00Z", "supplierRef": {"id": "c41217b3-89d1-ea11-bbaa-000d3a2b9185", "supplierName": "Wide World Importers"}, "totalAmount": 234}, {"accountRef": {"id": "621217b3-89d1-ea11-bbaa-000d3a2b9185", "name": "Petty Cash"}, "currency": "GBP", "currencyRate": 1, "date": "2019-01-01T00:00:00", "id": "3d387f05-8ad1-ea11-bbaa-000d3a2b9185", "lines": [{"allocatedOnDate": "2019-01-01T00:00:00", "amount": 390, "links": [{"amount": -390, "currencyRate": 1, "id": "cbcb06bf-89d1-ea11-bbaa-000d3a2b9185-108007", "type": "Bill"}]}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-27T14:21:25Z", "note": "Invoice 107007", "paymentMethodRef": {"id": "EILBDVJVNUAGVKRQ", "name": "AliPay"}, "reference": "108007", "sourceModifiedDate": "2022-10-23T00:00:00Z", "supplierRef": {"id": "be1217b3-89d1-ea11-bbaa-000d3a2b9185", "supplierName": "Fabrikam, Inc."}, "totalAmount": 390}], "totalResults": 236} + Exact (Netherlands): + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/b83b1923-4db6-45a8-a779-b4e320c15979/data/billPayments?page=1&pageSize=2"}, "next": {"href": "/companies/b83b1923-4db6-45a8-a779-b4e320c15979/data/billPayments?page=2&pageSize=2"}, "self": {"href": "/companies/b83b1923-4db6-45a8-a779-b4e320c15979/data/billPayments"}}, "pageNumber": 1, "pageSize": 2, "results": [{"accountRef": {"id": "d79d65bd-1d7d-4f55-95d3-76b3a7b7b823", "name": "Bank 1"}, "currency": "EUR", "currencyRate": 1, "date": "2019-11-05T00:00:00Z", "id": "da7e456f-76f7-42ac-8dad-d90a040f3afb", "lines": [{"allocatedOnDate": "2022-10-23T00:00:00Z", "amount": -5, "links": [{"amount": 5, "currencyRate": 1, "id": "63fadca8-4905-475a-b32a-b4341293bcf4", "type": "PaymentOnAccount"}]}], "modifiedDate": "2022-10-26T13:35:13Z", "note": "Bill Payment against bill c13e37b6-dfaa-4894-b3be-9fe97bda9f44", "paymentMethodRef": {"id": "EILBDVJVNUAGVKRQ", "name": "AliPay"}, "reference": "19200008", "sourceModifiedDate": "2019-11-05T14:26:22Z", "supplierRef": {"id": "63fadca8-4905-475a-b32a-b4341293bcf4", "supplierName": "Kelly's Industrial Supplies"}, "totalAmount": -5}, {"accountRef": {"id": "1879b322-7758-4e20-8f3f-701df27f2340", "name": "Kas"}, "currency": "EUR", "currencyRate": 1, "date": "2019-11-07T00:00:00Z", "id": "002b8462-f3a3-4019-84fe-6a2af1f30c5a", "lines": [{"allocatedOnDate": "2022-10-23T00:00:00Z", "amount": -0.12, "links": [{"amount": 0.12, "currencyRate": 1, "id": "33f3016c-2ecf-4d17-911e-b385537e7341", "type": "CreditNote"}]}, {"allocatedOnDate": "2022-10-23T00:00:00Z", "amount": 0.12, "links": [{"amount": -0.12, "currencyRate": 1, "id": "de6b3634-faf2-4688-b06b-72ed3ca6cf4e", "type": "Bill"}]}, {"allocatedOnDate": "2022-10-23T00:00:00Z", "amount": 0.13, "links": [{"amount": -0.13, "currencyRate": 1, "id": "de6b3634-faf2-4688-b06b-72ed3ca6cf4e", "type": "Bill"}]}], "modifiedDate": "2022-10-26T13:35:14Z", "note": "Bill Payment against bill c13e37b6-dfaa-4894-b3be-9fe97bda9f44", "paymentMethodRef": {"id": "EILBDVJVNUAGVKRQ", "name": "AliPay"}, "reference": "19100002", "sourceModifiedDate": "2021-11-17T12:08:10Z", "supplierRef": {"id": "5811b467-53eb-4491-8ca1-bc9b7889811b", "supplierName": "Ann's test supplier 2"}, "totalAmount": 0.13}], "totalResults": 1173} + Exact (UK): + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/d95030cd-22b2-482b-9c7b-2980dcc2b1ce/data/billPayments?page=1&pageSize=2"}, "next": {"href": "/companies/d95030cd-22b2-482b-9c7b-2980dcc2b1ce/data/billPayments?page=2&pageSize=2"}, "self": {"href": "/companies/d95030cd-22b2-482b-9c7b-2980dcc2b1ce/data/billPayments"}}, "pageNumber": 1, "pageSize": 2, "results": [{"accountRef": {"id": "4a4e34b5-7f62-4b64-a44a-073398b14b41", "name": "Bank"}, "currency": "GBP", "currencyRate": 1, "date": "2017-10-11T00:00:00Z", "id": "7a5f621b-739f-4ed8-b738-2aae3ef886ac", "lines": [{"allocatedOnDate": "2022-10-23T00:00:00Z", "amount": 123, "links": [{"amount": -123, "currencyRate": 1, "id": "e7a45898-2db3-424c-acb9-a51647740f26", "type": "Bill"}]}], "modifiedDate": "2022-10-26T13:33:17Z", "note": "Bill Payment against bill c13e37b6-dfaa-4894-b3be-9fe97bda9f44", "paymentMethodRef": {"id": "EILBDVJVNUAGVKRQ", "name": "AliPay"}, "reference": "17200006", "sourceModifiedDate": "2017-10-11T10:12:29Z", "supplierRef": {"id": "a7cad20d-44db-442b-ac1f-90475802d6fb", "supplierName": "Pencils Pencils Pencils"}, "totalAmount": 123}, {"accountRef": {"id": "4a4e34b5-7f62-4b64-a44a-073398b14b41", "name": "Bank"}, "currency": "GBP", "currencyRate": 1, "date": "2017-10-31T00:00:00Z", "id": "b358df76-3930-42ad-8f38-78edcc60172d", "lines": [{"allocatedOnDate": "2022-10-23T00:00:00Z", "amount": 55000, "links": [{"amount": -55000, "currencyRate": 1, "id": "41302634-76b5-4442-b800-0bb63780e77c", "type": "PaymentOnAccount"}]}], "modifiedDate": "2022-10-26T13:33:17Z", "note": "Bill Payment against bill c13e37b6-dfaa-4894-b3be-9fe97bda9f44", "paymentMethodRef": {"id": "EILBDVJVNUAGVKRQ", "name": "AliPay"}, "reference": "17200001", "sourceModifiedDate": "2019-02-14T17:56:54Z", "supplierRef": {"id": "41302634-76b5-4442-b800-0bb63780e77c", "supplierName": "Some Supplier"}, "totalAmount": 55000}], "totalResults": 39} + FreeAgent: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/071ad738-68f3-4561-afd0-69bab9df0803/data/billPayments?page=1&pageSize=2"}, "next": {"href": "/companies/071ad738-68f3-4561-afd0-69bab9df0803/data/billPayments?page=2&pageSize=2"}, "self": {"href": "/companies/071ad738-68f3-4561-afd0-69bab9df0803/data/billPayments"}}, "pageNumber": 1, "pageSize": 2, "results": [{"currency": "GBP", "date": "2017-11-23T00:00:00", "id": "135234103", "lines": [{"allocatedOnDate": "2022-10-23T00:00:00Z", "amount": 14.3, "links": [{"amount": -14.3, "currencyRate": 1, "id": "10659723", "type": "Bill"}]}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-25T14:21:36Z", "note": "ATOMIC SOFTWARE LIMITE WELLINGTON,NZL OTHER �14.30 - Bill payment against Pints1 (The Eagle)", "paymentMethodRef": {"id": "EILBDVJVNUAGVKRQ", "name": "AliPay"}, "sourceModifiedDate": "2022-10-23T00:00:00Z", "supplierRef": {"id": "7169654", "supplierName": "The Eagle"}, "totalAmount": 14.3}, {"currency": "GBP", "date": "2019-01-03T00:00:00", "id": "168350314", "lines": [{"allocatedOnDate": "2022-10-23T00:00:00Z", "amount": 30, "links": [{"amount": -30, "currencyRate": 1, "id": "11224800", "type": "Bill"}]}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-25T14:21:36Z", "note": "�30.00 - Bill payment against Test123 (A & J Fabtech Ltd)", "paymentMethodRef": {"id": "EILBDVJVNUAGVKRQ", "name": "AliPay"}, "sourceModifiedDate": "2022-10-23T00:00:00Z", "supplierRef": {"id": "6161941", "supplierName": "A & J Fabtech Ltd"}, "totalAmount": 30}], "totalResults": 89} + FreshBooks: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/3691c49e-0db4-4172-b3ab-e4084c365013/data/billPayments?page=1&pageSize=2"}, "next": {"href": "/companies/3691c49e-0db4-4172-b3ab-e4084c365013/data/billPayments?page=2&pageSize=2"}, "self": {"href": "/companies/3691c49e-0db4-4172-b3ab-e4084c365013/data/billPayments"}}, "pageNumber": 1, "pageSize": 2, "results": [{"accountRef": {"id": "167679", "name": "Cash"}, "currency": "GBP", "date": "2021-08-18T00:00:00", "id": "16", "lines": [{"allocatedOnDate": "2021-08-18T00:00:00", "amount": 10, "links": [{"amount": -10, "currencyRate": 1, "id": "16", "type": "Bill"}]}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-24T16:07:23Z", "note": "Bill payment", "paymentMethodRef": {"id": "EILBDVJVNUAGVKRQ", "name": "AliPay"}, "sourceModifiedDate": "2022-10-23T00:00:00Z", "supplierRef": {"id": "29"}, "totalAmount": 10}, {"accountRef": {"id": "167679", "name": "Cash"}, "currency": "USD", "date": "2021-08-18T00:00:00", "id": "18", "lines": [{"allocatedOnDate": "2021-08-18T00:00:00", "amount": 15, "links": [{"amount": -15, "currencyRate": 1, "id": "18", "type": "Bill"}]}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-24T16:07:23Z", "note": "Bill payment Ikea", "paymentMethodRef": {"id": "EILBDVJVNUAGVKRQ", "name": "AliPay"}, "sourceModifiedDate": "2022-10-23T00:00:00Z", "supplierRef": {"id": "39"}, "totalAmount": 15}], "totalResults": 26} + Oracle NetSuite: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/d5074b08-6a34-4b06-a742-236edf5dc4f1/data/billPayments?page=1&pageSize=2"}, "next": {"href": "/companies/d5074b08-6a34-4b06-a742-236edf5dc4f1/data/billPayments?page=2&pageSize=2"}, "self": {"href": "/companies/d5074b08-6a34-4b06-a742-236edf5dc4f1/data/billPayments"}}, "pageNumber": 1, "pageSize": 2, "results": [{"accountRef": {"id": "825", "name": "Codat Europe Bank"}, "currency": "GBP", "currencyRate": 1, "date": "2021-03-26T00:00:00", "id": "112", "lines": [{"allocatedOnDate": "2022-10-23T00:00:00Z", "amount": 120, "links": [{"amount": -120, "currencyRate": 1, "id": "7", "type": "Bill"}]}], "modifiedDate": "2023-01-30T14:48:40Z", "note": "Bill Payment against bill c13e37b6-dfaa-4894-b3be-9fe97bda9f44", "paymentMethodRef": {"id": "EILBDVJVNUAGVKRQ", "name": "AliPay"}, "reference": "Bill Payment #1", "sourceModifiedDate": "2021-03-26T10:31:06", "supplierRef": {"id": "724", "supplierName": "Vendor A.A.A"}, "totalAmount": 120}, {"accountRef": {"id": "825", "name": "Codat Europe Bank"}, "currency": "GBP", "currencyRate": 1, "date": "2022-07-11T00:00:00", "id": "159623-724", "lines": [{"allocatedOnDate": "2022-10-23T00:00:00Z", "amount": -555.55, "links": [{"amount": 555.55, "currencyRate": 1, "id": "724", "type": "PaymentOnAccount"}]}], "modifiedDate": "2023-01-30T14:48:40Z", "note": "Bill Payment against bill c13e37b6-dfaa-4894-b3be-9fe97bda9f44", "paymentMethodRef": {"id": "EILBDVJVNUAGVKRQ", "name": "AliPay"}, "reference": "Deposit #DEP25", "sourceModifiedDate": "2022-07-11T09:41:02", "supplierRef": {"id": "724", "supplierName": "Vendor A.A.A"}, "totalAmount": -555.55}], "totalResults": 3} + QuickBooks Desktop: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/fc72ba08-af13-4474-b28a-01dcfa6cfb51/data/billPayments?page=1&pageSize=2"}, "next": {"href": "/companies/fc72ba08-af13-4474-b28a-01dcfa6cfb51/data/billPayments?page=2&pageSize=2"}, "self": {"href": "/companies/fc72ba08-af13-4474-b28a-01dcfa6cfb51/data/billPayments"}}, "pageNumber": 1, "pageSize": 2, "results": [{"accountRef": {"id": "20000-933270541", "name": "Checking"}, "currency": "GBP", "currencyRate": 1, "date": "2023-01-11T00:00:00", "id": "3A09-1071529982", "lines": [{"allocatedOnDate": "2022-10-23T00:00:00Z", "amount": 532.97, "links": [{"amount": -532.97, "currencyRate": 1, "id": "38AA-1071513625", "type": "Bill"}]}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-26T09:09:20Z", "note": "Monthly Truck Payment", "paymentMethodRef": {"id": "EILBDVJVNUAGVKRQ", "name": "AliPay"}, "reference": "101", "sourceModifiedDate": "2023-12-16T05:04:58", "supplierRef": {"id": "720000-1071512482", "supplierName": "Bayshore Auto Mall"}, "totalAmount": 532.97}, {"accountRef": {"id": "8000007E-1197732180", "name": "CalOil Credit Card"}, "currency": "GBP", "currencyRate": 1, "date": "2023-01-15T00:00:00", "id": "84C2-1197705262", "lines": [{"allocatedOnDate": "2023-01-15T00:00:00", "amount": 4050.98, "links": [{"amount": -4050.98, "currencyRate": 1, "id": "84C2-1197705262", "type": "Bill"}]}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-26T09:09:20Z", "note": "Bill Payment against bill c13e37b6-dfaa-4894-b3be-9fe97bda9f44", "paymentMethodRef": {"id": "EILBDVJVNUAGVKRQ", "name": "AliPay"}, "sourceModifiedDate": "2023-12-16T05:06:15", "supplierRef": {"id": "B0000-933272656", "supplierName": "Patton Hardware Supplies"}, "totalAmount": 4050.98}], "totalResults": 214} + QuickBooks Online: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/10818b5e-6e6a-4ed4-a1c5-3e3efe626e87/data/billPayments?page=1&pageSize=2"}, "next": {"href": "/companies/10818b5e-6e6a-4ed4-a1c5-3e3efe626e87/data/billPayments?page=2&pageSize=2"}, "self": {"href": "/companies/10818b5e-6e6a-4ed4-a1c5-3e3efe626e87/data/billPayments"}}, "pageNumber": 1, "pageSize": 2, "results": [{"currency": "GBP", "currencyRate": 1, "date": "2019-05-13T00:00:00", "id": "20", "lines": [{"allocatedOnDate": "2022-10-23T00:00:00Z", "amount": 0, "links": [{"amount": -5, "currencyRate": 1, "id": "18", "type": "Bill"}, {"amount": 5, "currencyRate": 1, "id": "19", "type": "CreditNote"}]}], "modifiedDate": "2023-01-18T11:02:47Z", "note": "Bill Payment against bill c13e37b6-dfaa-4894-b3be-9fe97bda9f44", "paymentMethodRef": {"id": "EILBDVJVNUAGVKRQ", "name": "AliPay"}, "sourceModifiedDate": "2019-05-13T13:14:26Z", "supplierRef": {"id": "4", "supplierName": "BILLy elliot"}, "totalAmount": 0}, {"accountRef": {"id": "63", "name": "Business Bank Account"}, "currency": "GBP", "currencyRate": 1, "date": "2019-05-31T00:00:00", "id": "25", "lines": [{"allocatedOnDate": "2022-10-23T00:00:00Z", "amount": 5999.99, "links": [{"amount": -5999.99, "currencyRate": 1, "id": "24", "type": "Bill"}]}], "modifiedDate": "2023-01-18T11:02:47Z", "note": "Bill Payment against bill c13e37b6-dfaa-4894-b3be-9fe97bda9f44", "paymentMethodRef": {"id": "EILBDVJVNUAGVKRQ", "name": "AliPay"}, "sourceModifiedDate": "2019-05-31T12:55:10Z", "supplierRef": {"id": "5", "supplierName": "Callum McGinley"}, "totalAmount": 5999.99}], "totalResults": 126} + QuickBooks Online Sandbox: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/5a7f3597-36e1-4216-86fe-289ad36088a6/data/billPayments?page=1&pageSize=2"}, "next": {"href": "/companies/5a7f3597-36e1-4216-86fe-289ad36088a6/data/billPayments?page=2&pageSize=2"}, "self": {"href": "/companies/5a7f3597-36e1-4216-86fe-289ad36088a6/data/billPayments"}}, "pageNumber": 1, "pageSize": 2, "results": [{"accountRef": {"id": "81", "name": "Current"}, "currency": "HKD", "currencyRate": 0.078807, "date": "2016-01-23T00:00:00", "id": "158", "lines": [{"allocatedOnDate": "2022-10-23T00:00:00Z", "amount": 7940.6, "links": [{"amount": -7940.6, "currencyRate": 1, "id": "157", "type": "Bill"}]}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-26T09:36:42Z", "note": "Bill Payment against bill c13e37b6-dfaa-4894-b3be-9fe97bda9f44", "paymentMethodRef": {"id": "EILBDVJVNUAGVKRQ", "name": "AliPay"}, "reference": "1067", "sourceModifiedDate": "2016-09-13T21:19:36Z", "supplierRef": {"id": "57", "supplierName": "Hall's Promo Items"}, "totalAmount": 7940.6}, {"accountRef": {"id": "81", "name": "Current"}, "currency": "HKD", "currencyRate": 0.078807, "date": "2016-01-23T00:00:00", "id": "159", "lines": [{"allocatedOnDate": "2022-10-23T00:00:00Z", "amount": 742.5, "links": [{"amount": -742.5, "currencyRate": 1, "id": "28", "type": "Bill"}]}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-26T09:36:42Z", "note": "Bill Payment against bill c13e37b6-dfaa-4894-b3be-9fe97bda9f44", "paymentMethodRef": {"id": "EILBDVJVNUAGVKRQ", "name": "AliPay"}, "reference": "1068", "sourceModifiedDate": "2016-09-13T21:19:49Z", "supplierRef": {"id": "57", "supplierName": "Hall's Promo Items"}, "totalAmount": 742.5}], "totalResults": 191} + Sage 200cloud: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/93c21e2d-049c-4d24-b41b-57e61c30b69e/data/billPayments?page=1&pageSize=2"}, "next": {"href": "/companies/93c21e2d-049c-4d24-b41b-57e61c30b69e/data/billPayments?page=2&pageSize=2"}, "self": {"href": "/companies/93c21e2d-049c-4d24-b41b-57e61c30b69e/data/billPayments"}}, "pageNumber": 1, "pageSize": 2, "results": [{"currency": "GBP", "currencyRate": 1, "date": "2020-01-05T00:00:00Z", "id": "45462", "lines": [{"allocatedOnDate": "2022-10-23T00:00:00Z", "amount": 27, "links": [{"amount": -27, "currencyRate": 1, "id": "CON001", "type": "PaymentOnAccount"}]}], "modifiedDate": "2022-10-14T09:35:54Z", "note": "", "paymentMethodRef": {"id": "EILBDVJVNUAGVKRQ", "name": "AliPay"}, "reference": "Payment invoice 1", "sourceModifiedDate": "2020-02-28T14:23:46Z", "supplierRef": {"id": "CON001", "supplierName": "Concept Stationery Supplies"}, "totalAmount": 27}, {"currency": "GBP", "currencyRate": 1, "date": "2020-01-17T00:00:00Z", "id": "45502", "lines": [{"allocatedOnDate": "2022-10-23T00:00:00Z", "amount": 59, "links": [{"amount": -59, "currencyRate": 1, "id": "SDE001", "type": "PaymentOnAccount"}]}], "modifiedDate": "2022-10-14T09:35:54Z", "note": "pay3", "paymentMethodRef": {"id": "EILBDVJVNUAGVKRQ", "name": "AliPay"}, "reference": "payment inv3", "sourceModifiedDate": "2020-02-28T14:23:46Z", "supplierRef": {"id": "SDE001", "supplierName": "S D Enterprises"}, "totalAmount": 59}], "totalResults": 64} + Sage 50 (UK): + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/cf5f2a47-2990-4221-bae6-0c19c86ac304/data/billPayments?page=1&pageSize=2"}, "next": {"href": "/companies/cf5f2a47-2990-4221-bae6-0c19c86ac304/data/billPayments?page=2&pageSize=2"}, "self": {"href": "/companies/cf5f2a47-2990-4221-bae6-0c19c86ac304/data/billPayments"}}, "pageNumber": 1, "pageSize": 2, "results": [{"currency": "GBP", "currencyRate": 1, "date": "2022-01-29T00:00:00", "id": "255", "lines": [{"allocatedOnDate": "2022-10-23T00:00:00Z", "amount": 117.5, "links": [{"amount": -117.5, "currencyRate": 1, "id": "86", "type": "Bill"}]}, {"allocatedOnDate": "2022-10-23T00:00:00Z", "amount": 64.63, "links": [{"amount": -64.63, "currencyRate": 1, "id": "87", "type": "Bill"}]}, {"allocatedOnDate": "2022-10-23T00:00:00Z", "amount": 50.57, "links": [{"amount": -50.57, "currencyRate": 1, "id": "250", "type": "Bill"}]}, {"allocatedOnDate": "2022-10-23T00:00:00Z", "amount": 36.87, "links": [{"amount": -36.87, "currencyRate": 1, "id": "251", "type": "Bill"}]}, {"allocatedOnDate": "2022-10-23T00:00:00Z", "amount": 101.14, "links": [{"amount": -101.14, "currencyRate": 1, "id": "252", "type": "Bill"}]}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-30T14:42:37Z", "note": "Purchase payment 255 linked to, purchase invoice 86, purchase invoice 87, purchase invoice 250, purchase invoice 251, purchase invoice 252.", "paymentMethodRef": {"id": "EILBDVJVNUAGVKRQ", "name": "AliPay"}, "sourceModifiedDate": "2022-11-25T09:43:54", "supplierRef": {"id": "CON001", "supplierName": "Concept Stationery Supplies"}, "totalAmount": 370.71}, {"currency": "GBP", "currencyRate": 1, "date": "2022-01-29T00:00:00", "id": "256", "lines": [{"allocatedOnDate": "2022-10-23T00:00:00Z", "amount": 256.36, "links": [{"amount": -256.36, "currencyRate": 1, "id": "17", "type": "Bill"}]}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-30T14:42:37Z", "note": "Purchase payment 256 linked to, purchase invoice 17.", "paymentMethodRef": {"id": "EILBDVJVNUAGVKRQ", "name": "AliPay"}, "sourceModifiedDate": "2022-11-25T09:43:54", "supplierRef": {"id": "QUA001", "supplierName": "Quality Motors"}, "totalAmount": 256.36}], "totalResults": 27} + Sage Business Cloud Accounting: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/390083e2-351b-407c-a3be-55081c36c182/data/billPayments?page=1&pageSize=2"}, "next": {"href": "/companies/390083e2-351b-407c-a3be-55081c36c182/data/billPayments?page=2&pageSize=2"}, "self": {"href": "/companies/390083e2-351b-407c-a3be-55081c36c182/data/billPayments"}}, "pageNumber": 1, "pageSize": 2, "results": [{"accountRef": {"id": "9a25937b267a11e797950a57719b2edb", "name": "Current"}, "currency": "GBP", "currencyRate": 1, "date": "2018-02-15T00:00:00", "id": "d953b45e156011e8b45c025132dab352", "lines": [{"allocatedOnDate": "2022-10-23T00:00:00Z", "amount": 52.02, "links": [{"amount": -52.02, "currencyRate": 1, "id": "ca430e0d156011e8b45c025132dab352", "type": "PaymentOnAccount"}]}], "modifiedDate": "2022-10-24T14:54:04Z", "note": "Supplier payment using credit/debit card - Cool stuff", "paymentMethodRef": {"id": "EILBDVJVNUAGVKRQ", "name": "AliPay"}, "sourceModifiedDate": "2019-11-20T09:30:03Z", "supplierRef": {"id": "ca430e0d156011e8b45c025132dab352", "supplierName": "Test Supplier"}, "totalAmount": 52.02}, {"accountRef": {"id": "9a3e4bc6267a11e797950a57719b2edb", "name": "Cash"}, "currency": "GBP", "currencyRate": 1, "date": "2018-03-06T00:00:00", "id": "a99b9aae216111e8b45c025132dab352", "lines": [{"allocatedOnDate": "2022-10-23T00:00:00Z", "amount": 52.02, "links": [{"amount": -52.02, "currencyRate": 1, "id": "ca430e0d156011e8b45c025132dab352", "type": "PaymentOnAccount"}]}], "modifiedDate": "2022-10-24T14:54:04Z", "note": "Supplier payment using cash", "paymentMethodRef": {"id": "EILBDVJVNUAGVKRQ", "name": "AliPay"}, "sourceModifiedDate": "2018-03-06T17:13:17Z", "supplierRef": {"id": "ca430e0d156011e8b45c025132dab352", "supplierName": "Test Supplier"}, "totalAmount": 52.02}], "totalResults": 2225} + Sage Intacct: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/df02b289-cb16-4964-ac4d-9fd60b04538e/data/billPayments?page=1&pageSize=2"}, "self": {"href": "/companies/df02b289-cb16-4964-ac4d-9fd60b04538e/data/billPayments"}}, "pageNumber": 1, "pageSize": 2, "results": [{"accountRef": {"id": "353", "name": "Current Account"}, "currency": "GBP", "date": "2022-01-06T00:00:00", "id": "4471", "lines": [{"allocatedOnDate": "2022-10-23T00:00:00Z", "amount": 20, "links": [{"amount": -20, "currencyRate": 1, "id": "4470", "type": "Bill"}]}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-04T16:32:13Z", "note": "", "paymentMethodRef": {"id": "6", "name": "Cash"}, "sourceModifiedDate": "2022-02-23T12:03:30", "supplierRef": {"id": "3", "supplierName": "ADP"}, "totalAmount": 20}, {"accountRef": {"id": "353", "name": "Current Account"}, "currency": "GBP", "date": "2022-01-06T00:00:00", "id": "4472", "lines": [{"allocatedOnDate": "2022-10-23T00:00:00Z", "amount": 5, "links": [{"amount": -5, "currencyRate": 1, "id": "4470", "type": "Bill"}]}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-04T16:32:13Z", "note": "", "paymentMethodRef": {"id": "6", "name": "Cash"}, "sourceModifiedDate": "2022-02-23T12:06:58", "supplierRef": {"id": "3", "supplierName": "ADP"}, "totalAmount": 5}], "totalResults": 2} + Xero: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/5ced9667-a310-443a-a711-958d36377141/data/billPayments?page=1&pageSize=2"}, "next": {"href": "/companies/5ced9667-a310-443a-a711-958d36377141/data/billPayments?page=2&pageSize=2"}, "self": {"href": "/companies/5ced9667-a310-443a-a711-958d36377141/data/billPayments"}}, "pageNumber": 1, "pageSize": 2, "results": [{"accountRef": {"id": "bd9e85e0-0478-433d-ae9f-0b3c4f04bfe4", "name": "Business Bank Account"}, "currency": "GBP", "currencyRate": 1, "date": "2021-12-20T00:00:00", "id": "74004690-82a1-4810-aaca-6ce575af94b4", "lines": [{"allocatedOnDate": "2022-10-23T00:00:00Z", "amount": 7267.2, "links": [{"amount": -7267.2, "currencyRate": 1, "id": "3945273c-cc04-479f-a4b5-1e3dc7a55ed1", "type": "Bill"}]}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-15T20:37:10Z", "note": "Bill Payment against bill c13e37b6-dfaa-4894-b3be-9fe97bda9f44", "paymentMethodRef": {"id": "EILBDVJVNUAGVKRQ", "name": "AliPay"}, "sourceModifiedDate": "2021-01-02T22:51:40", "supplierRef": {"id": "1262c350-fe0f-40ec-aeff-41c95b4a45af", "supplierName": "DIISR - Small Business Services"}, "totalAmount": 7267.2}, {"accountRef": {"id": "bd9e85e0-0478-433d-ae9f-0b3c4f04bfe4", "name": "Business Bank Account"}, "currency": "GBP", "currencyRate": 1, "date": "2022-02-17T00:00:00", "id": "f2062172-b444-4c8b-b797-9f4c7a4244c7", "lines": [{"allocatedOnDate": "2022-10-23T00:00:00Z", "amount": 7267.2, "links": [{"amount": -7267.2, "currencyRate": 1, "id": "09aa506f-cb81-4cd3-a1ea-6a0b91804d5a", "type": "Bill"}]}], "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-15T20:37:10Z", "note": "Bill Payment against bill c13e37b6-dfaa-4894-b3be-9fe97bda9f44", "paymentMethodRef": {"id": "EILBDVJVNUAGVKRQ", "name": "AliPay"}, "sourceModifiedDate": "2021-01-02T22:51:38", "supplierRef": {"id": "1262c350-fe0f-40ec-aeff-41c95b4a45af", "supplierName": "DIISR - Small Business Services"}, "totalAmount": 7267.2}], "totalResults": 30} + Malformed query: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "400": + application/json: {"canBeRetried": "Unknown", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "detailedErrorCode": 0, "error": "Error parsing query - Malformed query.", "service": "ClientsApi", "statusCode": 400} + Unresolved property: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "400": + application/json: {"canBeRetried": "Unknown", "correlationId": "98457fb9956b7f9b4b2fd4f6e23bb5c8", "detailedErrorCode": 0, "error": "Error parsing query - Could not resolve property isCompleted on Dataset", "service": "PullApi", "statusCode": 400} + create-account: + Malformed query: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + query: {} + requestBody: + application/json: {"currency": "USD", "currentBalance": 0, "description": "Invoices the business has issued but has not yet collected payment on.", "fullyQualifiedCategory": "Asset.Current", "fullyQualifiedName": "Fixed Asset", "name": "Accounts Receivable", "nominalCode": "610", "status": "Active", "type": "Asset"} + responses: + "400": + application/json: {"canBeRetried": "Unknown", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "detailedErrorCode": 0, "error": "Error processing request - not valid.", "service": "PublicApi", "statusCode": 400} + get-account: + Clear Books: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + accountId: "" + responses: + "200": + application/json: {"currency": "GBP", "currentBalance": 0, "description": "Invoices the business has issued but has not yet collected payment on.", "fullyQualifiedCategory": "Asset.Current", "fullyQualifiedName": "Asset.Current.Accounts Receivable", "id": "1b6266d1-1e44-46c5-8eb5-a8f98e03124e", "isBankAccount": false, "modifiedDate": "2023-04-26T12:38:15Z", "name": "Accounts Receivable", "nominalCode": "610", "sourceModifiedDate": "2022-12-10T16:39:00", "status": "Active", "type": "Asset", "validDatatypeLinks": []} + Dynamics 365 Business Central: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + accountId: "" + responses: + "200": + application/json: {"currency": "GBP", "currentBalance": 0, "description": "Invoices the business has issued but has not yet collected payment on.", "fullyQualifiedCategory": " .", "fullyQualifiedName": "..", "id": "8eaed16d-c69f-ec11-80f1-0022481b4546", "isBankAccount": false, "modifiedDate": "2023-03-27T14:21:18Z", "name": "", "nominalCode": "45422026-68CA-4EF2-9", "sourceModifiedDate": "2022-03-09T16:31:54Z", "status": "Active", "type": "Unknown", "validDatatypeLinks": [{"links": ["DirectCost.LineItems.AccountRef.Id"], "property": "Id"}]} + Exact (Netherlands): + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + accountId: "" + responses: + "200": + application/json: {"currency": "EUR", "currentBalance": 864435.44, "description": "Debiteuren", "fullyQualifiedCategory": "Asset.Assets.AccountsReceivable", "fullyQualifiedName": "Asset.Assets.AccountsReceivable.Debiteuren.PaymentsEnabled", "id": "ef2fde36-4416-4bc5-b239-315b2929348c", "isBankAccount": false, "modifiedDate": "2022-10-26T13:36:17Z", "name": "Debiteuren", "nominalCode": "1300", "sourceModifiedDate": "2020-01-08T09:42:54Z", "status": "Active", "type": "Asset", "validDatatypeLinks": [{"links": ["Transfer.To.AccountRef.Id", "Transfer.From.AccountRef.Id", "Payment.AccountRef.Id", "BillPayment.AccountRef.Id"], "property": "Id"}]} + Exact (UK): + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + accountId: "" + responses: + "200": + application/json: {"currency": "GBP", "currentBalance": 0, "description": "Some thing account", "fullyQualifiedCategory": "Asset.Assets.AccountsReceivable", "fullyQualifiedName": "Asset.Assets.AccountsReceivable.Some thing account.PaymentsEnabled", "id": "ca2b96b7-cc45-4e35-9fa3-82a2ba1eec40", "isBankAccount": false, "modifiedDate": "2022-10-26T13:35:15Z", "name": "Some thing account", "nominalCode": "THING", "sourceModifiedDate": "2017-08-01T17:31:12Z", "status": "Active", "type": "Asset", "validDatatypeLinks": [{"links": ["Transfer.To.AccountRef.Id", "Transfer.From.AccountRef.Id", "Payment.AccountRef.Id", "BillPayment.AccountRef.Id"], "property": "Id"}]} + FreeAgent: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + accountId: "" + responses: + "200": + application/json: {"currency": "GBP", "currentBalance": 0, "description": "Invoices the business has issued but has not yet collected payment on.", "fullyQualifiedCategory": "Asset.Capital", "fullyQualifiedName": "Asset.Capital.Capital Asset Brought Forward", "id": "601", "isBankAccount": false, "modifiedDate": "2023-04-25T14:19:12Z", "name": "Capital Asset Brought Forward", "nominalCode": "601", "sourceModifiedDate": "2022-10-23T00:00:00Z", "status": "Active", "type": "Asset", "validDatatypeLinks": []} + FreshBooks: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + accountId: "" + responses: + "200": + application/json: {"currency": "GBP", "currentBalance": 51445.53, "description": "Invoices the business has issued but has not yet collected payment on.", "fullyQualifiedCategory": "Asset", "fullyQualifiedName": "Asset.Accounts Receivable", "id": "67357", "isBankAccount": false, "modifiedDate": "2023-03-24T16:07:24Z", "name": "Accounts Receivable", "nominalCode": "1200", "sourceModifiedDate": "2022-10-23T00:00:00Z", "status": "Active", "type": "Asset", "validDatatypeLinks": []} + KashFlow: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + accountId: "" + responses: + "200": + application/json: {"currency": "GBP", "currentBalance": 0, "description": "Invoices the business has issued but has not yet collected payment on.", "fullyQualifiedCategory": "Asset.BankAccount", "fullyQualifiedName": "Asset.BankAccount.16th Account", "id": "27840056", "isBankAccount": true, "modifiedDate": "2022-09-30T10:29:16Z", "name": "16th Account", "nominalCode": "70700", "sourceModifiedDate": "2022-10-23T00:00:00Z", "status": "Active", "type": "Asset", "validDatatypeLinks": []} + Oracle NetSuite: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + accountId: "" + responses: + "200": + application/json: {"currency": "USD", "currentBalance": -635.55, "description": "Invoices the business has issued but has not yet collected payment on.", "fullyQualifiedCategory": "AcctPay.AcctPay", "fullyQualifiedName": "AcctPay.AcctPay.Accounts Payable", "id": "111", "isBankAccount": false, "modifiedDate": "2023-01-30T14:48:33Z", "name": "Accounts Payable", "nominalCode": "610", "sourceModifiedDate": "2021-08-11T12:51:21", "status": "Active", "type": "Liability", "validDatatypeLinks": []} + QuickBooks Desktop: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + accountId: "" + responses: + "200": + application/json: {"currency": "GBP", "currentBalance": 93007.93, "description": "Accounts Receivable", "fullyQualifiedCategory": "Asset.CurrentAsset.AccountsReceivable", "fullyQualifiedName": "Asset.CurrentAsset.AccountsReceivable.Accounts Receivable", "id": "40000-933270541", "isBankAccount": false, "modifiedDate": "2023-04-26T09:06:23Z", "name": "Accounts Receivable", "nominalCode": "11000", "sourceModifiedDate": "2023-12-16T05:06:45", "status": "Active", "type": "Asset", "validDatatypeLinks": []} + QuickBooks Online: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + accountId: "" + responses: + "200": + application/json: {"currency": "GBP", "currentBalance": 41289.37, "description": "Invoices the business has issued but has not yet collected payment on.", "fullyQualifiedCategory": "Asset.Accounts Receivable.AccountsReceivable", "fullyQualifiedName": "Asset.Accounts Receivable.AccountsReceivable.Debtors", "id": "62", "isBankAccount": false, "modifiedDate": "2023-01-18T11:02:34Z", "name": "Debtors", "nominalCode": "246", "sourceModifiedDate": "2022-12-08T15:42:59Z", "status": "Active", "type": "Asset", "validDatatypeLinks": []} + QuickBooks Online Sandbox: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + accountId: "" + responses: + "200": + application/json: {"currency": "GBP", "currentBalance": 3041173.77, "description": "Invoices the business has issued but has not yet collected payment on.", "fullyQualifiedCategory": "Asset.Accounts Receivable.AccountsReceivable", "fullyQualifiedName": "Asset.Accounts Receivable.AccountsReceivable.Debtors", "id": "70", "isBankAccount": false, "modifiedDate": "2023-04-26T09:35:55Z", "name": "Debtors", "nominalCode": "610", "sourceModifiedDate": "2023-04-26T01:18:15Z", "status": "Active", "type": "Asset", "validDatatypeLinks": []} + Sage 200cloud: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + accountId: "" + responses: + "200": + application/json: {"currency": "EUR", "currentBalance": 0, "description": "Bank Account", "fullyQualifiedCategory": "Asset.Bank Account", "fullyQualifiedName": "Asset.Bank Account.Bank Account", "id": "2864", "isBankAccount": false, "modifiedDate": "2022-10-14T09:35:52Z", "name": "Bank Account", "nominalCode": "1200", "sourceModifiedDate": "2022-10-23T00:00:00Z", "status": "Archived", "type": "Asset", "validDatatypeLinks": []} + Sage 50 (UK): + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + accountId: "" + responses: + "200": + application/json: {"currency": "GBP", "currentBalance": 90640.61, "description": "Invoices the business has issued but has not yet collected payment on.", "fullyQualifiedCategory": "Asset.CurrentAssets.Debtors", "fullyQualifiedName": "Asset.CurrentAssets.Debtors.Debtors Control Account", "id": "1100", "isBankAccount": false, "modifiedDate": "2023-03-30T14:42:44Z", "name": "Debtors Control Account", "nominalCode": "1100", "sourceModifiedDate": "2022-11-25T09:43:54", "status": "Active", "type": "Asset", "validDatatypeLinks": []} + Sage Business Cloud Accounting: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + accountId: "" + responses: + "200": + application/json: {"currency": "GBP", "currentBalance": 49.61, "description": "Invoices the business has issued but has not yet collected payment on.", "fullyQualifiedCategory": "Asset.Bank", "fullyQualifiedName": "Asset.Bank.Abdi Internet Bank", "id": "e5889b459f544926ac5b8e6756df2ad4", "isBankAccount": true, "modifiedDate": "2022-10-24T14:52:53Z", "name": "Abdi Internet Bank", "nominalCode": "1560", "sourceModifiedDate": "2020-01-27T10:53:26Z", "status": "Active", "type": "Asset", "validDatatypeLinks": [{"links": ["Payment.AccountRef.Id", "BillPayment.AccountRef.Id"], "property": "Id"}]} + Sage Intacct: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + accountId: "" + responses: + "200": + application/json: {"currency": "GBP", "currentBalance": 0, "description": "Invoices the business has issued but has not yet collected payment on.", "fullyQualifiedCategory": "Assets.Current Assets.Account Receivable, Net of Allowance.Accounts Receivable.Accounts Receivable", "fullyQualifiedName": "Assets.Current Assets.Account Receivable, Net of Allowance.Accounts Receivable.Accounts Receivable.Accounts Receivable", "id": "2", "isBankAccount": false, "modifiedDate": "2023-04-04T16:31:51Z", "name": "Accounts Receivable", "nominalCode": "12100", "sourceModifiedDate": "2020-01-29T01:42:43", "status": "Active", "type": "Asset", "validDatatypeLinks": []} + Wave: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + accountId: "" + responses: + "200": + application/json: {"currency": "GBP", "currentBalance": 0, "description": "Test Balance Sheet", "fullyQualifiedCategory": "Asset.CashAndBank", "fullyQualifiedName": "Asset.CashAndBank.Abdi Bank", "id": "QWNjb3VudDo5MjIzNDE3NjkzMzk3NjA2MzM7QnVzaW5lc3M6ZTI0OGQyZDctMWE5Ni00YTk4LWFkOTEtMDdlMGYyMmNhNmE2", "isBankAccount": true, "modifiedDate": "2022-11-16T18:15:17Z", "name": "Abdi Bank", "nominalCode": "610", "sourceModifiedDate": "2022-10-23T00:00:00Z", "status": "Active", "type": "Asset", "validDatatypeLinks": []} + Xero: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + accountId: "" + responses: + "200": + application/json: {"currency": "GBP", "currentBalance": 924.25, "description": "Invoices the business has issued but has not yet collected payment on.", "fullyQualifiedCategory": "Asset.Bank", "fullyQualifiedName": "Asset.Bank.Business Bank Account", "id": "bd9e85e0-0478-433d-ae9f-0b3c4f04bfe4", "isBankAccount": true, "modifiedDate": "2023-03-15T20:35:08Z", "name": "Business Bank Account", "nominalCode": "A090", "sourceModifiedDate": "2023-02-17T11:10:49", "status": "Active", "type": "Asset", "validDatatypeLinks": [{"links": ["Payment.AccountRef.Id", "BillPayment.AccountRef.Id", "DirectIncome.LineItems.AccountRef.Id", "DirectCost.LineItems.AccountRef.Id"], "property": "Id"}]} + Zoho Books: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + accountId: "" + responses: + "200": + application/json: {"currency": "GBP", "currentBalance": -959.64, "description": "The money that customers owe you becomes the accounts receivable. A good example of this is a payment expected from an invoice sent to your customer.", "fullyQualifiedCategory": "Asset.accounts_receivable", "fullyQualifiedName": "Asset.accounts_receivable.Accounts Receivable", "id": "104957000000000352", "isBankAccount": false, "modifiedDate": "2022-10-03T08:40:43Z", "name": "Accounts Receivable", "nominalCode": "", "sourceModifiedDate": "2020-02-05T14:58:44", "status": "Active", "type": "Asset", "validDatatypeLinks": []} + Unauthorized: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + accountId: "" + responses: + "401": + application/json: {"canBeRetried": "Unknown", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "detailedErrorCode": 0, "error": "Unauthorized", "service": "PublicApi", "statusCode": 401} + get-create-account-model: + Exact (Netherlands): + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + responses: + "200": + application/json: {"description": "Nominal Accounts are the categories a business uses to record transactions", "displayName": "Nominal Account", "properties": {"nominalCode": {"description": "The external reference given to each nominal account for a business", "displayName": "Nominal Code", "required": true, "type": "String", "validation": {"information": [{"details": "Must be provided.", "field": "NominalCode"}], "warnings": []}}, "name": {"description": "Name of the account", "displayName": "Name", "required": true, "type": "String", "validation": {"information": [{"details": "Must be provided.", "field": "Name"}], "warnings": []}}, "fullyQualifiedCategory": {"description": "The full category of the account e.g. Liability.Current or Income.Revenue", "displayName": "Fully Qualified Category", "options": [{"displayName": "Asset.Assets.Cash", "required": false, "type": "String", "value": "Asset.Assets.Cash"}, {"displayName": "Asset.Assets.Bank", "required": false, "type": "String", "value": "Asset.Assets.Bank"}, {"displayName": "Asset.Assets.PaymentServices", "required": false, "type": "String", "value": "Asset.Assets.PaymentServices"}, {"displayName": "Asset.Assets.AccountsReceivable", "required": false, "type": "String", "value": "Asset.Assets.AccountsReceivable"}, {"displayName": "Liability.EquityAndLiabilities.AccountsPayable", "required": false, "type": "String", "value": "Liability.EquityAndLiabilities.AccountsPayable"}, {"displayName": "Asset.Assets.VAT", "required": false, "type": "String", "value": "Asset.Assets.VAT"}, {"displayName": "Liability.EquityAndLiabilities.EmployeesPayable", "required": false, "type": "String", "value": "Liability.EquityAndLiabilities.EmployeesPayable"}, {"displayName": "Asset.Assets.PrepaidExpenses", "required": false, "type": "String", "value": "Asset.Assets.PrepaidExpenses"}, {"displayName": "Liability.EquityAndLiabilities.AccruedExpenses", "required": false, "type": "String", "value": "Liability.EquityAndLiabilities.AccruedExpenses"}, {"displayName": "Liability.EquityAndLiabilities.IncomeTaxesPayable", "required": false, "type": "String", "value": "Liability.EquityAndLiabilities.IncomeTaxesPayable"}, {"displayName": "Asset.Assets.FixedAssets", "required": false, "type": "String", "value": "Asset.Assets.FixedAssets"}, {"displayName": "Asset.Assets.OtherAssets", "required": false, "type": "String", "value": "Asset.Assets.OtherAssets"}, {"displayName": "Asset.Assets.AccumulatedDeprecation", "required": false, "type": "String", "value": "Asset.Assets.AccumulatedDeprecation"}, {"displayName": "Asset.Assets.Inventory", "required": false, "type": "String", "value": "Asset.Assets.Inventory"}, {"displayName": "Equity.EquityAndLiabilities.CapitalStock", "required": false, "type": "String", "value": "Equity.EquityAndLiabilities.CapitalStock"}, {"displayName": "Equity.EquityAndLiabilities.RetainedEarnings", "required": false, "type": "String", "value": "Equity.EquityAndLiabilities.RetainedEarnings"}, {"displayName": "Liability.EquityAndLiabilities.LongTermDebt", "required": false, "type": "String", "value": "Liability.EquityAndLiabilities.LongTermDebt"}, {"displayName": "Liability.EquityAndLiabilities.CurrentPortionOfDebt", "required": false, "type": "String", "value": "Liability.EquityAndLiabilities.CurrentPortionOfDebt"}, {"displayName": "Unknown.EquityAndLiabilities.Intercompany", "required": false, "type": "String", "value": "Unknown.EquityAndLiabilities.Intercompany"}, {"displayName": "Unknown.General.General", "required": false, "type": "String", "value": "Unknown.General.General"}, {"displayName": "Income.NetIncome.Revenue", "required": false, "type": "String", "value": "Income.NetIncome.Revenue"}, {"displayName": "Expense.NetIncome.CostOfGoods", "required": false, "type": "String", "value": "Expense.NetIncome.CostOfGoods"}, {"displayName": "Expense.NetIncome.OtherCosts", "required": false, "type": "String", "value": "Expense.NetIncome.OtherCosts"}, {"displayName": "Expense.NetIncome.SalesGeneralAdministrativeExpenses", "required": false, "type": "String", "value": "Expense.NetIncome.SalesGeneralAdministrativeExpenses"}, {"displayName": "Expense.NetIncome.DeprecationCosts", "required": false, "type": "String", "value": "Expense.NetIncome.DeprecationCosts"}, {"displayName": "Expense.NetIncome.ResearchAndDevelopment", "required": false, "type": "String", "value": "Expense.NetIncome.ResearchAndDevelopment"}, {"displayName": "Expense.NetIncome.EmployeeCosts", "required": false, "type": "String", "value": "Expense.NetIncome.EmployeeCosts"}, {"displayName": "Expense.NetIncome.EmploymentCosts", "required": false, "type": "String", "value": "Expense.NetIncome.EmploymentCosts"}, {"displayName": "Expense.ExceptionalIncome.ExceptionalCosts", "required": false, "type": "String", "value": "Expense.ExceptionalIncome.ExceptionalCosts"}, {"displayName": "Income.ExceptionalIncome.ExceptionalIncome", "required": false, "type": "String", "value": "Income.ExceptionalIncome.ExceptionalIncome"}, {"displayName": "Expense.ExceptionalIncome.IncomeTaxes", "required": false, "type": "String", "value": "Expense.ExceptionalIncome.IncomeTaxes"}, {"displayName": "Income.ExceptionalIncome.InterestIncome", "required": false, "type": "String", "value": "Income.ExceptionalIncome.InterestIncome"}], "required": true, "type": "String", "validation": {"information": [{"details": "Must be provided.", "field": "FullyQualifiedCategory"}], "warnings": []}}, "status": {"description": "The status of the account", "displayName": "Account Status", "options": [{"displayName": "Active", "required": false, "type": "String", "value": "Active"}, {"displayName": "Pending", "required": false, "type": "String", "value": "Pending"}, {"displayName": "Unknown", "required": false, "type": "String", "value": "Unknown"}], "required": true, "type": "String", "validation": {"information": [{"details": "Must be provided.", "field": "Status"}], "warnings": []}}}, "required": true, "type": "Object"} + Exact (UK): + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + responses: + "200": + application/json: {"description": "Nominal Accounts are the categories a business uses to record transactions", "displayName": "Nominal Account", "properties": {"nominalCode": {"description": "The external reference given to each nominal account for a business", "displayName": "Nominal Code", "required": true, "type": "String", "validation": {"information": [{"details": "Must be provided.", "field": "NominalCode"}], "warnings": []}}, "name": {"description": "Name of the account", "displayName": "Name", "required": true, "type": "String", "validation": {"information": [{"details": "Must be provided.", "field": "Name"}], "warnings": []}}, "fullyQualifiedCategory": {"description": "The full category of the account e.g. Liability.Current or Income.Revenue", "displayName": "Fully Qualified Category", "options": [{"displayName": "Asset.Assets.Cash", "required": false, "type": "String", "value": "Asset.Assets.Cash"}, {"displayName": "Asset.Assets.Bank", "required": false, "type": "String", "value": "Asset.Assets.Bank"}, {"displayName": "Asset.Assets.PaymentServices", "required": false, "type": "String", "value": "Asset.Assets.PaymentServices"}, {"displayName": "Asset.Assets.AccountsReceivable", "required": false, "type": "String", "value": "Asset.Assets.AccountsReceivable"}, {"displayName": "Liability.EquityAndLiabilities.AccountsPayable", "required": false, "type": "String", "value": "Liability.EquityAndLiabilities.AccountsPayable"}, {"displayName": "Asset.Assets.VAT", "required": false, "type": "String", "value": "Asset.Assets.VAT"}, {"displayName": "Liability.EquityAndLiabilities.EmployeesPayable", "required": false, "type": "String", "value": "Liability.EquityAndLiabilities.EmployeesPayable"}, {"displayName": "Asset.Assets.PrepaidExpenses", "required": false, "type": "String", "value": "Asset.Assets.PrepaidExpenses"}, {"displayName": "Liability.EquityAndLiabilities.AccruedExpenses", "required": false, "type": "String", "value": "Liability.EquityAndLiabilities.AccruedExpenses"}, {"displayName": "Liability.EquityAndLiabilities.IncomeTaxesPayable", "required": false, "type": "String", "value": "Liability.EquityAndLiabilities.IncomeTaxesPayable"}, {"displayName": "Asset.Assets.FixedAssets", "required": false, "type": "String", "value": "Asset.Assets.FixedAssets"}, {"displayName": "Asset.Assets.OtherAssets", "required": false, "type": "String", "value": "Asset.Assets.OtherAssets"}, {"displayName": "Asset.Assets.AccumulatedDeprecation", "required": false, "type": "String", "value": "Asset.Assets.AccumulatedDeprecation"}, {"displayName": "Asset.Assets.Inventory", "required": false, "type": "String", "value": "Asset.Assets.Inventory"}, {"displayName": "Equity.EquityAndLiabilities.CapitalStock", "required": false, "type": "String", "value": "Equity.EquityAndLiabilities.CapitalStock"}, {"displayName": "Equity.EquityAndLiabilities.RetainedEarnings", "required": false, "type": "String", "value": "Equity.EquityAndLiabilities.RetainedEarnings"}, {"displayName": "Liability.EquityAndLiabilities.LongTermDebt", "required": false, "type": "String", "value": "Liability.EquityAndLiabilities.LongTermDebt"}, {"displayName": "Liability.EquityAndLiabilities.CurrentPortionOfDebt", "required": false, "type": "String", "value": "Liability.EquityAndLiabilities.CurrentPortionOfDebt"}, {"displayName": "Unknown.EquityAndLiabilities.Intercompany", "required": false, "type": "String", "value": "Unknown.EquityAndLiabilities.Intercompany"}, {"displayName": "Unknown.General.General", "required": false, "type": "String", "value": "Unknown.General.General"}, {"displayName": "Income.NetIncome.Revenue", "required": false, "type": "String", "value": "Income.NetIncome.Revenue"}, {"displayName": "Expense.NetIncome.CostOfGoods", "required": false, "type": "String", "value": "Expense.NetIncome.CostOfGoods"}, {"displayName": "Expense.NetIncome.OtherCosts", "required": false, "type": "String", "value": "Expense.NetIncome.OtherCosts"}, {"displayName": "Expense.NetIncome.SalesGeneralAdministrativeExpenses", "required": false, "type": "String", "value": "Expense.NetIncome.SalesGeneralAdministrativeExpenses"}, {"displayName": "Expense.NetIncome.DeprecationCosts", "required": false, "type": "String", "value": "Expense.NetIncome.DeprecationCosts"}, {"displayName": "Expense.NetIncome.ResearchAndDevelopment", "required": false, "type": "String", "value": "Expense.NetIncome.ResearchAndDevelopment"}, {"displayName": "Expense.NetIncome.EmployeeCosts", "required": false, "type": "String", "value": "Expense.NetIncome.EmployeeCosts"}, {"displayName": "Expense.NetIncome.EmploymentCosts", "required": false, "type": "String", "value": "Expense.NetIncome.EmploymentCosts"}, {"displayName": "Expense.ExceptionalIncome.ExceptionalCosts", "required": false, "type": "String", "value": "Expense.ExceptionalIncome.ExceptionalCosts"}, {"displayName": "Income.ExceptionalIncome.ExceptionalIncome", "required": false, "type": "String", "value": "Income.ExceptionalIncome.ExceptionalIncome"}, {"displayName": "Expense.ExceptionalIncome.IncomeTaxes", "required": false, "type": "String", "value": "Expense.ExceptionalIncome.IncomeTaxes"}, {"displayName": "Income.ExceptionalIncome.InterestIncome", "required": false, "type": "String", "value": "Income.ExceptionalIncome.InterestIncome"}], "required": true, "type": "String", "validation": {"information": [{"details": "Must be provided.", "field": "FullyQualifiedCategory"}], "warnings": []}}, "status": {"description": "The status of the account", "displayName": "Account Status", "options": [{"displayName": "Active", "required": false, "type": "String", "value": "Active"}, {"displayName": "Pending", "required": false, "type": "String", "value": "Pending"}, {"displayName": "Unknown", "required": false, "type": "String", "value": "Unknown"}], "required": true, "type": "String", "validation": {"information": [{"details": "Must be provided.", "field": "Status"}], "warnings": []}}}, "required": true, "type": "Object"} + MYOB AccountRight and Essentials: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + responses: + "200": + application/json: {"description": "Nominal Accounts are the categories a business uses to record transactions", "displayName": "Nominal Account", "properties": {"nominalCode": {"description": "The external reference given to each nominal account for a business", "displayName": "Nominal Code", "required": true, "type": "String", "validation": {"information": [], "warnings": [{"details": "If alphanumeric is supported, must be between 1 and 10 characters. Otherwise format is x-xxxx", "field": "NominalCode"}]}}, "name": {"description": "Name of the account", "displayName": "Name", "required": false, "type": "String", "validation": {"information": [], "warnings": [{"details": "Must have a length between 1 and 60 characters", "field": "Name"}]}}, "description": {"description": "Description of the account", "displayName": "Description", "required": false, "type": "String", "validation": {"information": [], "warnings": [{"details": "Must have a length between 1 and 255 characters", "field": "Description"}]}}, "fullyQualifiedCategory": {"description": "The full category of the account e.g. Liability.Current or Income.Revenue", "displayName": "Fully Qualified Category", "options": [{"displayName": "Bank", "required": false, "type": "String", "value": "Asset.Bank"}, {"displayName": "Accounts Receivable", "required": false, "type": "String", "value": "Asset.AccountReceivable"}, {"displayName": "Other Current Asset", "required": false, "type": "String", "value": "Asset.OtherCurrentAsset"}, {"displayName": "Fixed Asset", "required": false, "type": "String", "value": "Asset.FixedAsset"}, {"displayName": "Other Asset", "required": false, "type": "String", "value": "Asset.OtherAsset"}, {"displayName": "Cash", "required": false, "type": "String", "value": "Asset.CashAndBank"}, {"displayName": "Equipment Machinery", "required": false, "type": "String", "value": "Asset.Property Plant and Equipment"}, {"displayName": "Credit Card", "required": false, "type": "String", "value": "Liability.CreditCard"}, {"displayName": "Accounts Payable", "required": false, "type": "String", "value": "Liability.AccountsPayable"}, {"displayName": "Other Current Liability", "required": false, "type": "String", "value": "Liability.OtherCurrentLiability"}, {"displayName": "Long Term Liability", "required": false, "type": "String", "value": "Liability.LongTermLiability"}, {"displayName": "Other Liability", "required": false, "type": "String", "value": "Liability.OtherLiability"}, {"displayName": "Equity", "required": false, "type": "String", "value": "Equity"}, {"displayName": "Retained Earnings", "required": false, "type": "String", "value": "Equity.Equity"}, {"displayName": "Retained Earnings", "required": false, "type": "String", "value": "Equity.Equity.RetainedEarnings"}, {"displayName": "Retained Earnings", "required": false, "type": "String", "value": "Equity.Owner's Equity"}, {"displayName": "Income", "required": false, "type": "String", "value": "Income"}, {"displayName": "Other Income", "required": false, "type": "String", "value": "OtherIncome"}, {"displayName": "Expense", "required": false, "type": "String", "value": "Expense"}, {"displayName": "Sales Marketing", "required": false, "type": "String", "value": "Expense.Expense"}, {"displayName": "General Administrative", "required": false, "type": "String", "value": "Expense.Expense.Insurance"}, {"displayName": "General Administrative", "required": false, "type": "String", "value": "Expense.Overhead"}, {"displayName": "Repairs Maintenance", "required": false, "type": "String", "value": "Expense.Expense.RepairMaintenance"}, {"displayName": "Other Expense", "required": false, "type": "String", "value": "OtherExpense"}, {"displayName": "Cost of Sales", "required": false, "type": "String", "value": "CostOfSales"}, {"displayName": "Other", "required": false, "type": "String", "value": "Cost Of Goods Sold.Cost of Sales"}], "required": true, "type": "String"}, "status": {"description": "The status of the account", "displayName": "Account Status", "options": [{"displayName": "Active", "required": false, "type": "String", "value": "Active"}, {"displayName": "Archived", "required": false, "type": "String", "value": "Archived"}], "required": true, "type": "String"}}, "required": true, "type": "Object"} + QuickBooks Desktop: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + responses: + "200": + application/json: {"description": "Nominal Accounts are the categories a business uses to record transactions", "displayName": "Nominal Account", "properties": {"nominalCode": {"description": "The external reference given to each nominal account for a business", "displayName": "Nominal Code", "required": true, "type": "String", "validation": {"information": [], "warnings": [{"details": "Max length of 7 characters.", "field": "NominalCode"}]}}, "name": {"description": "Name of the account", "displayName": "Name", "required": true, "type": "String", "validation": {"information": [], "warnings": [{"details": "Max length of 31 characters.", "field": "Name"}]}}, "description": {"description": "Description of the account", "displayName": "Description", "required": false, "type": "String", "validation": {"information": [], "warnings": [{"details": "Max length of 200 characters.", "field": "Description"}]}}, "currency": {"description": "The currency of the account", "displayName": "Currency", "required": false, "type": "String", "validation": {"information": [{"details": "If not set, will default to the base currency of the QuickBooks Desktop company", "field": "Currency"}], "warnings": [{"details": "The currency must match the base currency of the QuickBooks Desktop company unless the FullyQualifiedCategory is 'Asset.AccountsReceivable','Liability.AccountsPayable' or 'Liability.CreditCard'", "field": "Currency"}, {"details": "Must be a three letter ISO code that matches an existing active currency in the QuickBooks Desktop company", "field": "Currency"}, {"details": "Can only be set if the Quickbooks Desktop company has Multicurrency enabled.", "field": "Currency"}]}}, "fullyQualifiedCategory": {"description": "The full category of the account e.g. Liability.Current or Income.Revenue", "displayName": "Fully Qualified Category", "options": [{"displayName": "Account Receivable", "required": false, "type": "String", "value": "Asset.AccountsReceivable"}, {"displayName": "Fixed Asset", "required": false, "type": "String", "value": "Asset.FixedAsset"}, {"displayName": "Other Current Asset", "required": false, "type": "String", "value": "Asset.OtherCurrentAsset"}, {"displayName": "Other Asset", "required": false, "type": "String", "value": "Asset.OtherAsset"}, {"displayName": "Income", "required": false, "type": "String", "value": "Income.Income"}, {"displayName": "Other Income", "required": false, "type": "String", "value": "Income.OtherIncome"}, {"displayName": "Accounts Payable", "required": false, "type": "String", "value": "Liability.AccountsPayable"}, {"displayName": "Credit Card", "required": false, "type": "String", "value": "Liability.CreditCard"}, {"displayName": "Long Term Liability", "required": false, "type": "String", "value": "Liability.LongTermLiability"}, {"displayName": "Other Current Liability", "required": false, "type": "String", "value": "Liability.OtherCurrentLiability"}, {"displayName": "Cost Of Goods Sold", "required": false, "type": "String", "value": "Liability.CostOfGoodsSold"}, {"displayName": "Equity", "required": false, "type": "String", "value": "Equity.Equity"}, {"displayName": "Expense", "required": false, "type": "String", "value": "Expense.Expense"}, {"displayName": "Other Expense", "required": false, "type": "String", "value": "Expense.OtherExpense"}], "required": true, "type": "String"}, "currentBalance": {"description": "The current balance in the account", "displayName": "Current Balance", "required": false, "type": "Number"}}, "required": true, "type": "Object"} + QuickBooks Online Sandbox: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + responses: + "200": + application/json: {"description": "Nominal Accounts are the categories a business uses to record transactions", "displayName": "Nominal Account", "properties": {"nominalCode": {"description": "The external reference given to each nominal account for a business", "displayName": "Nominal Code", "required": false, "type": "String", "validation": {"information": [{"details": "If included must have a length between 1 and 7 characters", "field": "NominalCode"}], "warnings": []}}, "name": {"description": "Name of the account", "displayName": "Name", "required": true, "type": "String", "validation": {"information": [], "warnings": [{"details": "Must have a length between 1 and 100 characters", "field": "Name"}]}}, "currency": {"description": "The currency of the account", "displayName": "Currency", "required": false, "type": "String", "validation": {"information": [{"details": "When not specified company base currency will be used", "field": "Currency"}], "warnings": []}}, "fullyQualifiedCategory": {"description": "The full category of the account e.g. Liability.Current or Income.Revenue", "displayName": "Fully Qualified Category", "options": [{"displayName": "Cash On Hand", "required": false, "type": "String", "value": "Asset.Bank.CashOnHand"}, {"displayName": "Checking", "required": false, "type": "String", "value": "Asset.Bank.Checking"}, {"displayName": "Money Market", "required": false, "type": "String", "value": "Asset.Bank.MoneyMarket"}, {"displayName": "Rents Held In Trust", "required": false, "type": "String", "value": "Asset.Bank.RentsHeldInTrust"}, {"displayName": "Savings", "required": false, "type": "String", "value": "Asset.Bank.Savings"}, {"displayName": "Trust Accounts", "required": false, "type": "String", "value": "Asset.Bank.TrustAccounts"}, {"displayName": "Cash And Cash Equivalents", "required": false, "type": "String", "value": "Asset.Bank.CashAndCashEquivalents"}, {"displayName": "Other Earmarked Bank Accounts", "required": false, "type": "String", "value": "Asset.Bank.OtherEarmarkedBankAccounts"}, {"displayName": "Allowance For Bad Debts", "required": false, "type": "String", "value": "Asset.Other Current Asset.AllowanceForBadDebts"}, {"displayName": "Development Costs", "required": false, "type": "String", "value": "Asset.Other Current Asset.DevelopmentCosts"}, {"displayName": "Employee Cash Advances", "required": false, "type": "String", "value": "Asset.Other Current Asset.EmployeeCashAdvances"}, {"displayName": "Other Current Assets", "required": false, "type": "String", "value": "Asset.Other Current Asset.OtherCurrentAssets"}, {"displayName": "Inventory", "required": false, "type": "String", "value": "Asset.Other Current Asset.Inventory"}, {"displayName": "Investment Mortgage Real Estate Loans", "required": false, "type": "String", "value": "Asset.Other Current Asset.Investment_MortgageRealEstateLoans"}, {"displayName": "Investment Other", "required": false, "type": "String", "value": "Asset.Other Current Asset.Investment_Other"}, {"displayName": "Investment Tax Exempt Securities", "required": false, "type": "String", "value": "Asset.Other Current Asset.Investment_TaxExemptSecurities"}, {"displayName": "Investment US Government Obligations", "required": false, "type": "String", "value": "Asset.Other Current Asset.Investment_USGovernmentObligations"}, {"displayName": "Loans To Officers", "required": false, "type": "String", "value": "Asset.Other Current Asset.LoansToOfficers"}, {"displayName": "Loans To Others", "required": false, "type": "String", "value": "Asset.Other Current Asset.LoansToOthers"}, {"displayName": "Loans To Stockholders", "required": false, "type": "String", "value": "Asset.Other Current Asset.LoansToStockholders"}, {"displayName": "Prepaid Expenses", "required": false, "type": "String", "value": "Asset.Other Current Asset.PrepaidExpenses"}, {"displayName": "Retainage", "required": false, "type": "String", "value": "Asset.Other Current Asset.Retainage"}, {"displayName": "Undeposited Funds", "required": false, "type": "String", "value": "Asset.Other Current Asset.UndepositedFunds"}, {"displayName": "Assets Available For Sale", "required": false, "type": "String", "value": "Asset.Other Current Asset.AssetsAvailableForSale"}, {"displayName": "Balance With Govt Authorities", "required": false, "type": "String", "value": "Asset.Other Current Asset.BalWithGovtAuthorities"}, {"displayName": "Called Up Share Capital Not Paid", "required": false, "type": "String", "value": "Asset.Other Current Asset.CalledUpShareCapitalNotPaid"}, {"displayName": "Expenditure Authorisations And Letters Of Credit", "required": false, "type": "String", "value": "Asset.Other Current Asset.ExpenditureAuthorisationsAndLettersOfCredit"}, {"displayName": "Global Tax Deferred", "required": false, "type": "String", "value": "Asset.Other Current Asset.GlobalTaxDeferred"}, {"displayName": "Global Tax Refund", "required": false, "type": "String", "value": "Asset.Other Current Asset.GlobalTaxRefund"}, {"displayName": "Internal Transfers", "required": false, "type": "String", "value": "Asset.Other Current Asset.InternalTransfers"}, {"displayName": "Other Consumables", "required": false, "type": "String", "value": "Asset.Other Current Asset.OtherConsumables"}, {"displayName": "Provisions Current Assets", "required": false, "type": "String", "value": "Asset.Other Current Asset.ProvisionsCurrentAssets"}, {"displayName": "Short Term Investments In Related Parties", "required": false, "type": "String", "value": "Asset.Other Current Asset.ShortTermInvestmentsInRelatedParties"}, {"displayName": "Short Term Loans And Advances To Related Parties", "required": false, "type": "String", "value": "Asset.Other Current Asset.ShortTermLoansAndAdvancesToRelatedParties"}, {"displayName": "Trade And Other Receivables", "required": false, "type": "String", "value": "Asset.Other Current Asset.TradeAndOtherReceivables"}, {"displayName": "Accumulated Depletion", "required": false, "type": "String", "value": "Asset.Fixed Asset.AccumulatedDepletion"}, {"displayName": "Accumulated Depreciation", "required": false, "type": "String", "value": "Asset.Fixed Asset.AccumulatedDepreciation"}, {"displayName": "Depletable Assets", "required": false, "type": "String", "value": "Asset.Fixed Asset.DepletableAssets"}, {"displayName": "Fixed Asset Computers", "required": false, "type": "String", "value": "Asset.Fixed Asset.FixedAssetComputers"}, {"displayName": "Fixed Asset Copiers", "required": false, "type": "String", "value": "Asset.Fixed Asset.FixedAssetCopiers"}, {"displayName": "Fixed Asset Furniture", "required": false, "type": "String", "value": "Asset.Fixed Asset.FixedAssetFurniture"}, {"displayName": "Fixed Asset Phone", "required": false, "type": "String", "value": "Asset.Fixed Asset.FixedAssetPhone"}, {"displayName": "Fixed Asset Photo Video", "required": false, "type": "String", "value": "Asset.Fixed Asset.FixedAssetPhotoVideo"}, {"displayName": "Fixed Asset Software", "required": false, "type": "String", "value": "Asset.Fixed Asset.FixedAssetSoftware"}, {"displayName": "Fixed Asset Other Tools Equipment", "required": false, "type": "String", "value": "Asset.Fixed Asset.FixedAssetOtherToolsEquipment"}, {"displayName": "Furniture And Fixtures", "required": false, "type": "String", "value": "Asset.Fixed Asset.FurnitureAndFixtures"}, {"displayName": "Land", "required": false, "type": "String", "value": "Asset.Fixed Asset.Land"}, {"displayName": "Leasehold Improvements", "required": false, "type": "String", "value": "Asset.Fixed Asset.LeaseholdImprovements"}, {"displayName": "Other Fixed Assets", "required": false, "type": "String", "value": "Asset.Fixed Asset.OtherFixedAssets"}, {"displayName": "Accumulated Amortization", "required": false, "type": "String", "value": "Asset.Fixed Asset.AccumulatedAmortization"}, {"displayName": "Buildings", "required": false, "type": "String", "value": "Asset.Fixed Asset.Buildings"}, {"displayName": "Intangible Assets", "required": false, "type": "String", "value": "Asset.Fixed Asset.IntangibleAssets"}, {"displayName": "Machinery And Equipment", "required": false, "type": "String", "value": "Asset.Fixed Asset.MachineryAndEquipment"}, {"displayName": "Vehicles", "required": false, "type": "String", "value": "Asset.Fixed Asset.Vehicles"}, {"displayName": "Assets In Course Of Construction", "required": false, "type": "String", "value": "Asset.Fixed Asset.AssetsInCourseOfConstruction"}, {"displayName": "Capital Wip", "required": false, "type": "String", "value": "Asset.Fixed Asset.CapitalWip"}, {"displayName": "Cumulative Depreciation On Intangible Assets", "required": false, "type": "String", "value": "Asset.Fixed Asset.CumulativeDepreciationOnIntangibleAssets"}, {"displayName": "Intangible Assets Under Development", "required": false, "type": "String", "value": "Asset.Fixed Asset.IntangibleAssetsUnderDevelopment"}, {"displayName": "Land Asset", "required": false, "type": "String", "value": "Asset.Fixed Asset.LandAsset"}, {"displayName": "Non Current Assets", "required": false, "type": "String", "value": "Asset.Fixed Asset.NonCurrentAssets"}, {"displayName": "Participating Interests", "required": false, "type": "String", "value": "Asset.Fixed Asset.ParticipatingInterests"}, {"displayName": "Provisions Fixed Assets", "required": false, "type": "String", "value": "Asset.Fixed Asset.ProvisionsFixedAssets"}, {"displayName": "Lease Buyout", "required": false, "type": "String", "value": "Asset.Other Asset.LeaseBuyout"}, {"displayName": "Other Long Term Assets", "required": false, "type": "String", "value": "Asset.Other Asset.OtherLongTermAssets"}, {"displayName": "Security Deposits", "required": false, "type": "String", "value": "Asset.Other Asset.SecurityDeposits"}, {"displayName": "Accumulated Amortization Of Other Assets", "required": false, "type": "String", "value": "Asset.Other Asset.AccumulatedAmortizationOfOtherAssets"}, {"displayName": "Goodwill", "required": false, "type": "String", "value": "Asset.Other Asset.Goodwill"}, {"displayName": "Licenses", "required": false, "type": "String", "value": "Asset.Other Asset.Licenses"}, {"displayName": "Organizational Costs", "required": false, "type": "String", "value": "Asset.Other Asset.OrganizationalCosts"}, {"displayName": "Assets Held For Sale", "required": false, "type": "String", "value": "Asset.Other Asset.AssetsHeldForSale"}, {"displayName": "Available For Sale Financial Assets", "required": false, "type": "String", "value": "Asset.Other Asset.AvailableForSaleFinancialAssets"}, {"displayName": "Deferred Tax", "required": false, "type": "String", "value": "Asset.Other Asset.DeferredTax"}, {"displayName": "Investments", "required": false, "type": "String", "value": "Asset.Other Asset.Investments"}, {"displayName": "Long Term Investments", "required": false, "type": "String", "value": "Asset.Other Asset.LongTermInvestments"}, {"displayName": "Long Term Loans And Advances To Related Parties", "required": false, "type": "String", "value": "Asset.Other Asset.LongTermLoansAndAdvancesToRelatedParties"}, {"displayName": "Other Intangible Assets", "required": false, "type": "String", "value": "Asset.Other Asset.OtherIntangibleAssets"}, {"displayName": "Other Long Term Investments", "required": false, "type": "String", "value": "Asset.Other Asset.OtherLongTermInvestments"}, {"displayName": "Other Long Term Loans And Advances", "required": false, "type": "String", "value": "Asset.Other Asset.OtherLongTermLoansAndAdvances"}, {"displayName": "Prepayments And Accrued Income", "required": false, "type": "String", "value": "Asset.Other Asset.PrepaymentsAndAccruedIncome"}, {"displayName": "Provisions Non-Current Assets", "required": false, "type": "String", "value": "Asset.Other Asset.ProvisionsNonCurrentAssets"}, {"displayName": "Accounts Receivable", "required": false, "type": "String", "value": "Asset.Accounts Receivable.AccountsReceivable"}, {"displayName": "Advertising/Promotional", "required": false, "type": "String", "value": "Expense.Expense.AdvertisingPromotional"}, {"displayName": "Bad Debts", "required": false, "type": "String", "value": "Expense.Expense.BadDebts"}, {"displayName": "Bank Charges", "required": false, "type": "String", "value": "Expense.Expense.BankCharges"}, {"displayName": "Charitable Contributions", "required": false, "type": "String", "value": "Expense.Expense.CharitableContributions"}, {"displayName": "Commissions And Fees", "required": false, "type": "String", "value": "Expense.Expense.CommissionsAndFees"}, {"displayName": "Entertainment", "required": false, "type": "String", "value": "Expense.Expense.Entertainment"}, {"displayName": "Entertainment Meals", "required": false, "type": "String", "value": "Expense.Expense.EntertainmentMeals"}, {"displayName": "Equipment Rental", "required": false, "type": "String", "value": "Expense.Expense.EquipmentRental"}, {"displayName": "Finance Costs", "required": false, "type": "String", "value": "Expense.Expense.FinanceCosts"}, {"displayName": "Global Tax Expense", "required": false, "type": "String", "value": "Expense.Expense.GlobalTaxExpense"}, {"displayName": "Insurance", "required": false, "type": "String", "value": "Expense.Expense.Insurance"}, {"displayName": "Interest Paid", "required": false, "type": "String", "value": "Expense.Expense.InterestPaid"}, {"displayName": "Legal And Professional Fees", "required": false, "type": "String", "value": "Expense.Expense.LegalProfessionalFees"}, {"displayName": "Office Expenses", "required": false, "type": "String", "value": "Expense.Expense.OfficeExpenses"}, {"displayName": "Office/General Administrative Expenses", "required": false, "type": "String", "value": "Expense.Expense.OfficeGeneralAdministrativeExpenses"}, {"displayName": "Other Business Expenses", "required": false, "type": "String", "value": "Expense.Expense.OtherBusinessExpenses"}, {"displayName": "Other Miscellaneous Service Cost", "required": false, "type": "String", "value": "Expense.Expense.OtherMiscellaneousServiceCost"}, {"displayName": "Promotional Meals", "required": false, "type": "String", "value": "Expense.Expense.PromotionalMeals"}, {"displayName": "Rent Or Lease Of Buildings", "required": false, "type": "String", "value": "Expense.Expense.RentOrLeaseOfBuildings"}, {"displayName": "Repair And Maintenance", "required": false, "type": "String", "value": "Expense.Expense.RepairMaintenance"}, {"displayName": "Shipping, Freight And Delivery", "required": false, "type": "String", "value": "Expense.Expense.ShippingFreightDelivery"}, {"displayName": "Supplies And Materials", "required": false, "type": "String", "value": "Expense.Expense.SuppliesMaterials"}, {"displayName": "Travel", "required": false, "type": "String", "value": "Expense.Expense.Travel"}, {"displayName": "Travel Meals", "required": false, "type": "String", "value": "Expense.Expense.TravelMeals"}, {"displayName": "Utilities", "required": false, "type": "String", "value": "Expense.Expense.Utilities"}, {"displayName": "Auto", "required": false, "type": "String", "value": "Expense.Expense.Auto"}, {"displayName": "Cost Of Labor", "required": false, "type": "String", "value": "Expense.Expense.CostOfLabor"}, {"displayName": "Dues And Subscriptions", "required": false, "type": "String", "value": "Expense.Expense.DuesSubscriptions"}, {"displayName": "Payroll Expenses", "required": false, "type": "String", "value": "Expense.Expense.PayrollExpenses"}, {"displayName": "Taxes Paid", "required": false, "type": "String", "value": "Expense.Expense.TaxesPaid"}, {"displayName": "Unapplied Cash Bill Payment Expense", "required": false, "type": "String", "value": "Expense.Expense.UnappliedCashBillPaymentExpense"}, {"displayName": "Utilities", "required": false, "type": "String", "value": "Expense.Expense.Utilities"}, {"displayName": "Amortization Expense", "required": false, "type": "String", "value": "Expense.Expense.AmortizationExpense"}, {"displayName": "Appropriations To Depreciation", "required": false, "type": "String", "value": "Expense.Expense.AppropriationsToDepreciation"}, {"displayName": "Borrowing Cost", "required": false, "type": "String", "value": "Expense.Expense.BorrowingCost"}, {"displayName": "Commissions And Fees", "required": false, "type": "String", "value": "Expense.Expense.CommissionsAndFees"}, {"displayName": "Distribution Costs", "required": false, "type": "String", "value": "Expense.Expense.DistributionCosts"}, {"displayName": "External Services", "required": false, "type": "String", "value": "Expense.Expense.ExternalServices"}, {"displayName": "Extraordinary Charges", "required": false, "type": "String", "value": "Expense.Expense.ExtraordinaryCharges"}, {"displayName": "Income Tax Expense", "required": false, "type": "String", "value": "Expense.Expense.IncomeTaxExpense"}, {"displayName": "Loss On Discontinued Operations Net Of Tax", "required": false, "type": "String", "value": "Expense.Expense.LossOnDiscontinuedOperationsNetOfTax"}, {"displayName": "Management Compensation", "required": false, "type": "String", "value": "Expense.Expense.ManagementCompensation"}, {"displayName": "Other Current Operating Charges", "required": false, "type": "String", "value": "Expense.Expense.OtherCurrentOperatingCharges"}, {"displayName": "Other External Services", "required": false, "type": "String", "value": "Expense.Expense.OtherExternalServices"}, {"displayName": "Other Rental Costs", "required": false, "type": "String", "value": "Expense.Expense.OtherRentalCosts"}, {"displayName": "Other Selling Expenses", "required": false, "type": "String", "value": "Expense.Expense.OtherSellingExpenses"}, {"displayName": "Project Studies Surveys Assessments", "required": false, "type": "String", "value": "Expense.Expense.ProjectStudiesSurveysAssessments"}, {"displayName": "Purchases Rebates", "required": false, "type": "String", "value": "Expense.Expense.PurchasesRebates"}, {"displayName": "Shipping And Delivery Expense", "required": false, "type": "String", "value": "Expense.Expense.ShippingAndDeliveryExpense"}, {"displayName": "Staff Costs", "required": false, "type": "String", "value": "Expense.Expense.StaffCosts"}, {"displayName": "Sundry", "required": false, "type": "String", "value": "Expense.Expense.Sundry"}, {"displayName": "Travel Expenses General And Admin Expenses", "required": false, "type": "String", "value": "Expense.Expense.TravelExpensesGeneralAndAdminExpenses"}, {"displayName": "Travel Expenses Selling Expense", "required": false, "type": "String", "value": "Expense.Expense.TravelExpensesSellingExpense"}, {"displayName": "Depreciation", "required": false, "type": "String", "value": "Expense.Other Expense.Depreciation"}, {"displayName": "Exchange Gain Or Loss", "required": false, "type": "String", "value": "Expense.Other Expense.ExchangeGainOrLoss"}, {"displayName": "Other Miscellaneous Expense", "required": false, "type": "String", "value": "Expense.Other Expense.OtherMiscellaneousExpense"}, {"displayName": "Penalties And Settlements", "required": false, "type": "String", "value": "Expense.Other Expense.PenaltiesSettlements"}, {"displayName": "Amortization", "required": false, "type": "String", "value": "Expense.Other Expense.Amortization"}, {"displayName": "Gas And Fuel", "required": false, "type": "String", "value": "Expense.Other Expense.GasAndFuel"}, {"displayName": "Home Office", "required": false, "type": "String", "value": "Expense.Other Expense.HomeOffice"}, {"displayName": "Home Owner Rental Insurance", "required": false, "type": "String", "value": "Expense.Other Expense.HomeOwnerRentalInsurance"}, {"displayName": "Other Home Office Expenses", "required": false, "type": "String", "value": "Expense.Other Expense.OtherHomeOfficeExpenses"}, {"displayName": "Mortgage Interest", "required": false, "type": "String", "value": "Expense.Other Expense.MortgageInterest"}, {"displayName": "Rent And Lease", "required": false, "type": "String", "value": "Expense.Other Expense.RentAndLease"}, {"displayName": "Repairs And Maintenance", "required": false, "type": "String", "value": "Expense.Other Expense.RepairsAndMaintenance"}, {"displayName": "Parking And Tolls", "required": false, "type": "String", "value": "Expense.Other Expense.ParkingAndTolls"}, {"displayName": "Vehicle", "required": false, "type": "String", "value": "Expense.Other Expense.Vehicle"}, {"displayName": "Vehicle Insurance", "required": false, "type": "String", "value": "Expense.Other Expense.VehicleInsurance"}, {"displayName": "Vehicle Lease", "required": false, "type": "String", "value": "Expense.Other Expense.VehicleLease"}, {"displayName": "Vehicle Loan Interest", "required": false, "type": "String", "value": "Expense.Other Expense.VehicleLoanInterest"}, {"displayName": "Vehicle Loan", "required": false, "type": "String", "value": "Expense.Other Expense.VehicleLoan"}, {"displayName": "Vehicle Registration", "required": false, "type": "String", "value": "Expense.Other Expense.VehicleRegistration"}, {"displayName": "Vehicle Repairs", "required": false, "type": "String", "value": "Expense.Other Expense.VehicleRepairs"}, {"displayName": "Other Vehicle Expenses", "required": false, "type": "String", "value": "Expense.Other Expense.OtherVehicleExpenses"}, {"displayName": "Utilities", "required": false, "type": "String", "value": "Expense.Other Expense.Utilities"}, {"displayName": "Wash And Road Services", "required": false, "type": "String", "value": "Expense.Other Expense.WashAndRoadServices"}, {"displayName": "Deferred Tax Expense", "required": false, "type": "String", "value": "Expense.Other Expense.DeferredTaxExpense"}, {"displayName": "Depletion", "required": false, "type": "String", "value": "Expense.Other Expense.Depletion"}, {"displayName": "Exceptional Items", "required": false, "type": "String", "value": "Expense.Other Expense.ExceptionalItems"}, {"displayName": "Extraordinary Items", "required": false, "type": "String", "value": "Expense.Other Expense.ExtraordinaryItems"}, {"displayName": "Income Tax Other Expense", "required": false, "type": "String", "value": "Expense.Other Expense.IncomeTaxOtherExpense"}, {"displayName": "Mat Credit", "required": false, "type": "String", "value": "Expense.Other Expense.MatCredit"}, {"displayName": "Prior Period Items", "required": false, "type": "String", "value": "Expense.Other Expense.PriorPeriodItems"}, {"displayName": "Tax Roundoff Gain Or Loss", "required": false, "type": "String", "value": "Expense.Other Expense.TaxRoundoffGainOrLoss"}, {"displayName": "Equipment Rental - COS", "required": false, "type": "String", "value": "Expense.Cost of Goods Sold.EquipmentRentalCos"}, {"displayName": "Other Costs Of Sales - COS", "required": false, "type": "String", "value": "Expense.Cost of Goods Sold.OtherCostsOfServiceCos"}, {"displayName": "Shipping, Freight And Delivery - COS", "required": false, "type": "String", "value": "Expense.Cost of Goods Sold.ShippingFreightDeliveryCos"}, {"displayName": "Supplies And Materials - COS", "required": false, "type": "String", "value": "Expense.Cost of Goods Sold.SuppliesMaterialsCogs"}, {"displayName": "Cost Of Labor - COS", "required": false, "type": "String", "value": "Expense.Cost of Goods Sold.CostOfLaborCos"}, {"displayName": "Cost Of Sales", "required": false, "type": "String", "value": "Expense.Cost of Goods Sold.CostOfSales"}, {"displayName": "Freight And Delivery Cost", "required": false, "type": "String", "value": "Expense.Cost of Goods Sold.FreightAndDeliveryCost"}, {"displayName": "Non Profit Income", "required": false, "type": "String", "value": "Income.Income.NonProfitIncome"}, {"displayName": "Other Primary Income", "required": false, "type": "String", "value": "Income.Income.OtherPrimaryIncome"}, {"displayName": "Sales Of ProductIncome", "required": false, "type": "String", "value": "Income.Income.SalesOfProductIncome"}, {"displayName": "Service Fee Income", "required": false, "type": "String", "value": "Income.Income.ServiceFeeIncome"}, {"displayName": "Discounts Refunds Given", "required": false, "type": "String", "value": "Income.Income.DiscountsRefundsGiven"}, {"displayName": "Unapplied Cash Payment Income", "required": false, "type": "String", "value": "Income.Income.UnappliedCashPaymentIncome"}, {"displayName": "Cash Receipt Income", "required": false, "type": "String", "value": "Income.Income.CashReceiptIncome"}, {"displayName": "Operating Grants", "required": false, "type": "String", "value": "Income.Income.OperatingGrants"}, {"displayName": "Other Current Operating Income", "required": false, "type": "String", "value": "Income.Income.OtherCurrentOperatingIncome"}, {"displayName": "Own Work Capitalized", "required": false, "type": "String", "value": "Income.Income.OwnWorkCapitalized"}, {"displayName": "Revenue General", "required": false, "type": "String", "value": "Income.Income.RevenueGeneral"}, {"displayName": "Sales Retail", "required": false, "type": "String", "value": "Income.Income.SalesRetail"}, {"displayName": "Sales Wholesale", "required": false, "type": "String", "value": "Income.Income.SalesWholesale"}, {"displayName": "Savings By Tax Scheme", "required": false, "type": "String", "value": "Income.Income.SavingsByTaxScheme"}, {"displayName": "Dividend Income", "required": false, "type": "String", "value": "Income.Other Income.DividendIncome"}, {"displayName": "Interest Earned", "required": false, "type": "String", "value": "Income.Other Income.InterestEarned"}, {"displayName": "Other Investment Income", "required": false, "type": "String", "value": "Income.Other Income.OtherInvestmentIncome"}, {"displayName": "Other Miscellaneous Income", "required": false, "type": "String", "value": "Income.Other Income.OtherMiscellaneousIncome"}, {"displayName": "Tax Exempt Interest", "required": false, "type": "String", "value": "Income.Other Income.TaxExemptInterest"}, {"displayName": "Gain Loss On Sale Of Fixed Assets", "required": false, "type": "String", "value": "Income.Other Income.GainLossOnSaleOfFixedAssets"}, {"displayName": "Gain Loss On Sale Of Investments", "required": false, "type": "String", "value": "Income.Other Income.GainLossOnSaleOfInvestments"}, {"displayName": "Loss On Disposal Of Assets", "required": false, "type": "String", "value": "Income.Other Income.LossOnDisposalOfAssets"}, {"displayName": "Other Operating Income", "required": false, "type": "String", "value": "Income.Other Income.OtherOperatingIncome"}, {"displayName": "Unrealised Loss On Securities Net Of Tax", "required": false, "type": "String", "value": "Income.Other Income.UnrealisedLossOnSecuritiesNetOfTax"}, {"displayName": "Accounts Payable", "required": false, "type": "String", "value": "Liability.Accounts Payable.AccountsPayable"}, {"displayName": "Outstanding Dues Micro Small Enterprise", "required": false, "type": "String", "value": "Liability.Accounts Payable.OutstandingDuesMicroSmallEnterprise"}, {"displayName": "Outstanding Dues Other Than Micro Small Enterprise", "required": false, "type": "String", "value": "Liability.Accounts Payable.OutstandingDuesOtherThanMicroSmallEnterprise"}, {"displayName": "Credit Card", "required": false, "type": "String", "value": "Liability.Credit Card.CreditCard"}, {"displayName": "Notes Payable", "required": false, "type": "String", "value": "Liability.Long Term Liability.NotesPayable"}, {"displayName": "Other Long Term Liabilities", "required": false, "type": "String", "value": "Liability.Long Term Liability.OtherLongTermLiabilities"}, {"displayName": "Shareholder Notes Payable", "required": false, "type": "String", "value": "Liability.Long Term Liability.ShareholderNotesPayable"}, {"displayName": "Accruals And Deferred Income", "required": false, "type": "String", "value": "Liability.Long Term Liability.AccrualsAndDeferredIncome"}, {"displayName": "Accrued Long Lerm Liabilities", "required": false, "type": "String", "value": "Liability.Long Term Liability.AccruedLongLermLiabilities"}, {"displayName": "Accrued Vacation Payable", "required": false, "type": "String", "value": "Liability.Long Term Liability.AccruedVacationPayable"}, {"displayName": "Bank Loans", "required": false, "type": "String", "value": "Liability.Long Term Liability.BankLoans"}, {"displayName": "Debts Related To Participating Interests", "required": false, "type": "String", "value": "Liability.Long Term Liability.DebtsRelatedToParticipatingInterests"}, {"displayName": "Deferred Tax Liabilities", "required": false, "type": "String", "value": "Liability.Long Term Liability.DeferredTaxLiabilities"}, {"displayName": "Government And Other Public Authorities", "required": false, "type": "String", "value": "Liability.Long Term Liability.GovernmentAndOtherPublicAuthorities"}, {"displayName": "Group And Associates", "required": false, "type": "String", "value": "Liability.Long Term Liability.GroupAndAssociates"}, {"displayName": "Liabilities Related To Assets Held For Sale", "required": false, "type": "String", "value": "Liability.Long Term Liability.LiabilitiesRelatedToAssetsHeldForSale"}, {"displayName": "Long Term Borrowings", "required": false, "type": "String", "value": "Liability.Long Term Liability.LongTermBorrowings"}, {"displayName": "Long Term Debit", "required": false, "type": "String", "value": "Liability.Long Term Liability.LongTermDebit"}, {"displayName": "Long Term Employee Benefit Obligations", "required": false, "type": "String", "value": "Liability.Long Term Liability.LongTermEmployeeBenefitObligations"}, {"displayName": "Obligations Under Finance Leases", "required": false, "type": "String", "value": "Liability.Long Term Liability.ObligationsUnderFinanceLeases"}, {"displayName": "Other Long Term Provisions", "required": false, "type": "String", "value": "Liability.Long Term Liability.OtherLongTermProvisions"}, {"displayName": "Provision For Liabilities", "required": false, "type": "String", "value": "Liability.Long Term Liability.ProvisionForLiabilities"}, {"displayName": "Provisions Non Current Liabilities", "required": false, "type": "String", "value": "Liability.Long Term Liability.ProvisionsNonCurrentLiabilities"}, {"displayName": "Staff And Related Long Term Liability Accounts", "required": false, "type": "String", "value": "Liability.Long Term Liability.StaffAndRelatedLongTermLiabilityAccounts"}, {"displayName": "Direct Deposit Payable", "required": false, "type": "String", "value": "Liability.Other Current Liability.DirectDepositPayable"}, {"displayName": "Line Of Credit", "required": false, "type": "String", "value": "Liability.Other Current Liability.LineOfCredit"}, {"displayName": "Loan Payable", "required": false, "type": "String", "value": "Liability.Other Current Liability.LoanPayable"}, {"displayName": "Global Tax Payable", "required": false, "type": "String", "value": "Liability.Other Current Liability.GlobalTaxPayable"}, {"displayName": "Global Tax Suspense", "required": false, "type": "String", "value": "Liability.Other Current Liability.GlobalTaxSuspense"}, {"displayName": "Other Current Liabilities", "required": false, "type": "String", "value": "Liability.Other Current Liability.OtherCurrentLiabilities"}, {"displayName": "Payroll Clearing", "required": false, "type": "String", "value": "Liability.Other Current Liability.PayrollClearing"}, {"displayName": "Payroll Tax Payable", "required": false, "type": "String", "value": "Liability.Other Current Liability.PayrollTaxPayable"}, {"displayName": "Prepaid Expenses Payable", "required": false, "type": "String", "value": "Liability.Other Current Liability.PrepaidExpensesPayable"}, {"displayName": "Rents In Trust Liability", "required": false, "type": "String", "value": "Liability.Other Current Liability.RentsInTrustLiability"}, {"displayName": "Trust Accounts Liabilities", "required": false, "type": "String", "value": "Liability.Other Current Liability.TrustAccountsLiabilities"}, {"displayName": "Federal Income Tax Payable", "required": false, "type": "String", "value": "Liability.Other Current Liability.FederalIncomeTaxPayable"}, {"displayName": "Insurance Payable", "required": false, "type": "String", "value": "Liability.Other Current Liability.InsurancePayable"}, {"displayName": "Sales Tax Payable", "required": false, "type": "String", "value": "Liability.Other Current Liability.SalesTaxPayable"}, {"displayName": "State Local Income Tax Payable", "required": false, "type": "String", "value": "Liability.Other Current Liability.StateLocalIncomeTaxPayable"}, {"displayName": "Accrued Liabilities", "required": false, "type": "String", "value": "Liability.Other Current Liability.AccruedLiabilities"}, {"displayName": "Current Liabilities", "required": false, "type": "String", "value": "Liability.Other Current Liability.CurrentLiabilities"}, {"displayName": "Current Portion EmployeeBenefits Obligations", "required": false, "type": "String", "value": "Liability.Other Current Liability.CurrentPortionEmployeeBenefitsObligations"}, {"displayName": "Current Portion Of Obligations Under Finance Leases", "required": false, "type": "String", "value": "Liability.Other Current Liability.CurrentPortionOfObligationsUnderFinanceLeases"}, {"displayName": "Current Tax Liability", "required": false, "type": "String", "value": "Liability.Other Current Liability.CurrentTaxLiability"}, {"displayName": "Dividends Payable", "required": false, "type": "String", "value": "Liability.Other Current Liability.DividendsPayable"}, {"displayName": "Duties And Taxes", "required": false, "type": "String", "value": "Liability.Other Current Liability.DutiesAndTaxes"}, {"displayName": "Interest Payables", "required": false, "type": "String", "value": "Liability.Other Current Liability.InterestPayables"}, {"displayName": "Provision For Warranty Obligations", "required": false, "type": "String", "value": "Liability.Other Current Liability.ProvisionForWarrantyObligations"}, {"displayName": "Provisions Current Liabilities", "required": false, "type": "String", "value": "Liability.Other Current Liability.ProvisionsCurrentLiabilities"}, {"displayName": "Short Term Borrowings", "required": false, "type": "String", "value": "Liability.Other Current Liability.ShortTermBorrowings"}, {"displayName": "Social Security Agencies", "required": false, "type": "String", "value": "Liability.Other Current Liability.SocialSecurityAgencies"}, {"displayName": "Staff And Related Liability Accounts", "required": false, "type": "String", "value": "Liability.Other Current Liability.StaffAndRelatedLiabilityAccounts"}, {"displayName": "Sundry Debtors And Creditors", "required": false, "type": "String", "value": "Liability.Other Current Liability.SundryDebtorsAndCreditors"}, {"displayName": "Trade And Other Payables", "required": false, "type": "String", "value": "Liability.Other Current Liability.TradeAndOtherPayables"}, {"displayName": "Opening Balance Equity", "required": false, "type": "String", "value": "Equity.Equity.OpeningBalanceEquity"}, {"displayName": "Partners Equity", "required": false, "type": "String", "value": "Equity.Equity.PartnersEquity"}, {"displayName": "Retained Earnings", "required": false, "type": "String", "value": "Equity.Equity.RetainedEarnings"}, {"displayName": "Accumulated Adjustment", "required": false, "type": "String", "value": "Equity.Equity.AccumulatedAdjustment"}, {"displayName": "Owners Equity", "required": false, "type": "String", "value": "Equity.Equity.OwnersEquity"}, {"displayName": "Paid In Capital Or Surplus", "required": false, "type": "String", "value": "Equity.Equity.PaidInCapitalOrSurplus"}, {"displayName": "Partner Contributions", "required": false, "type": "String", "value": "Equity.Equity.PartnerContributions"}, {"displayName": "Partner Distributions", "required": false, "type": "String", "value": "Equity.Equity.PartnerDistributions"}, {"displayName": "Preferred Stock", "required": false, "type": "String", "value": "Equity.Equity.PreferredStock"}, {"displayName": "Common Stock", "required": false, "type": "String", "value": "Equity.Equity.CommonStock"}, {"displayName": "Treasury Stock", "required": false, "type": "String", "value": "Equity.Equity.TreasuryStock"}, {"displayName": "Estimated Taxes", "required": false, "type": "String", "value": "Equity.Equity.EstimatedTaxes"}, {"displayName": "Healthcare", "required": false, "type": "String", "value": "Equity.Equity.Healthcare"}, {"displayName": "Personal Income", "required": false, "type": "String", "value": "Equity.Equity.PersonalIncome"}, {"displayName": "Personal Expense", "required": false, "type": "String", "value": "Equity.Equity.PersonalExpense"}, {"displayName": "Accumulated Other Comprehensive Income", "required": false, "type": "String", "value": "Equity.Equity.AccumulatedOtherComprehensiveIncome"}, {"displayName": "Called Up Share Capital", "required": false, "type": "String", "value": "Equity.Equity.CalledUpShareCapital"}, {"displayName": "Capital Reserves", "required": false, "type": "String", "value": "Equity.Equity.CapitalReserves"}, {"displayName": "Dividend Disbursed", "required": false, "type": "String", "value": "Equity.Equity.DividendDisbursed"}, {"displayName": "Equity In Earnings Of Subsiduaries", "required": false, "type": "String", "value": "Equity.Equity.EquityInEarningsOfSubsiduaries"}, {"displayName": "Investment Grants", "required": false, "type": "String", "value": "Equity.Equity.InvestmentGrants"}, {"displayName": "Money Received Against Share Warrants", "required": false, "type": "String", "value": "Equity.Equity.MoneyReceivedAgainstShareWarrants"}, {"displayName": "Other Free Reserves", "required": false, "type": "String", "value": "Equity.Equity.OtherFreeReserves"}, {"displayName": "Share Application Money Pending Allotment", "required": false, "type": "String", "value": "Equity.Equity.ShareApplicationMoneyPendingAllotment"}, {"displayName": "Share Capital", "required": false, "type": "String", "value": "Equity.Equity.ShareCapital"}, {"displayName": "Funds", "required": false, "type": "String", "value": "Equity.Equity.Funds"}], "required": true, "type": "String"}}, "required": true, "type": "Object"} + QuickBooks Online: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + responses: + "200": + application/json: {"description": "Nominal Accounts are the categories a business uses to record transactions", "displayName": "Nominal Account", "properties": {"nominalCode": {"description": "The external reference given to each nominal account for a business", "displayName": "Nominal Code", "required": false, "type": "String", "validation": {"information": [{"details": "If included must have a length between 1 and 7 characters", "field": "NominalCode"}], "warnings": []}}, "name": {"description": "Name of the account", "displayName": "Name", "required": true, "type": "String", "validation": {"information": [], "warnings": [{"details": "Must have a length between 1 and 100 characters", "field": "Name"}]}}, "currency": {"description": "The currency of the account", "displayName": "Currency", "required": false, "type": "String", "validation": {"information": [{"details": "When not specified company base currency will be used", "field": "Currency"}], "warnings": []}}, "fullyQualifiedCategory": {"description": "The full category of the account e.g. Liability.Current or Income.Revenue", "displayName": "Fully Qualified Category", "options": [{"displayName": "Cash On Hand", "required": false, "type": "String", "value": "Asset.Bank.CashOnHand"}, {"displayName": "Checking", "required": false, "type": "String", "value": "Asset.Bank.Checking"}, {"displayName": "Money Market", "required": false, "type": "String", "value": "Asset.Bank.MoneyMarket"}, {"displayName": "Rents Held In Trust", "required": false, "type": "String", "value": "Asset.Bank.RentsHeldInTrust"}, {"displayName": "Savings", "required": false, "type": "String", "value": "Asset.Bank.Savings"}, {"displayName": "Trust Accounts", "required": false, "type": "String", "value": "Asset.Bank.TrustAccounts"}, {"displayName": "Cash And Cash Equivalents", "required": false, "type": "String", "value": "Asset.Bank.CashAndCashEquivalents"}, {"displayName": "Other Earmarked Bank Accounts", "required": false, "type": "String", "value": "Asset.Bank.OtherEarmarkedBankAccounts"}, {"displayName": "Allowance For Bad Debts", "required": false, "type": "String", "value": "Asset.Other Current Asset.AllowanceForBadDebts"}, {"displayName": "Development Costs", "required": false, "type": "String", "value": "Asset.Other Current Asset.DevelopmentCosts"}, {"displayName": "Employee Cash Advances", "required": false, "type": "String", "value": "Asset.Other Current Asset.EmployeeCashAdvances"}, {"displayName": "Other Current Assets", "required": false, "type": "String", "value": "Asset.Other Current Asset.OtherCurrentAssets"}, {"displayName": "Inventory", "required": false, "type": "String", "value": "Asset.Other Current Asset.Inventory"}, {"displayName": "Investment Mortgage Real Estate Loans", "required": false, "type": "String", "value": "Asset.Other Current Asset.Investment_MortgageRealEstateLoans"}, {"displayName": "Investment Other", "required": false, "type": "String", "value": "Asset.Other Current Asset.Investment_Other"}, {"displayName": "Investment Tax Exempt Securities", "required": false, "type": "String", "value": "Asset.Other Current Asset.Investment_TaxExemptSecurities"}, {"displayName": "Investment US Government Obligations", "required": false, "type": "String", "value": "Asset.Other Current Asset.Investment_USGovernmentObligations"}, {"displayName": "Loans To Officers", "required": false, "type": "String", "value": "Asset.Other Current Asset.LoansToOfficers"}, {"displayName": "Loans To Others", "required": false, "type": "String", "value": "Asset.Other Current Asset.LoansToOthers"}, {"displayName": "Loans To Stockholders", "required": false, "type": "String", "value": "Asset.Other Current Asset.LoansToStockholders"}, {"displayName": "Prepaid Expenses", "required": false, "type": "String", "value": "Asset.Other Current Asset.PrepaidExpenses"}, {"displayName": "Retainage", "required": false, "type": "String", "value": "Asset.Other Current Asset.Retainage"}, {"displayName": "Undeposited Funds", "required": false, "type": "String", "value": "Asset.Other Current Asset.UndepositedFunds"}, {"displayName": "Assets Available For Sale", "required": false, "type": "String", "value": "Asset.Other Current Asset.AssetsAvailableForSale"}, {"displayName": "Balance With Govt Authorities", "required": false, "type": "String", "value": "Asset.Other Current Asset.BalWithGovtAuthorities"}, {"displayName": "Called Up Share Capital Not Paid", "required": false, "type": "String", "value": "Asset.Other Current Asset.CalledUpShareCapitalNotPaid"}, {"displayName": "Expenditure Authorisations And Letters Of Credit", "required": false, "type": "String", "value": "Asset.Other Current Asset.ExpenditureAuthorisationsAndLettersOfCredit"}, {"displayName": "Global Tax Deferred", "required": false, "type": "String", "value": "Asset.Other Current Asset.GlobalTaxDeferred"}, {"displayName": "Global Tax Refund", "required": false, "type": "String", "value": "Asset.Other Current Asset.GlobalTaxRefund"}, {"displayName": "Internal Transfers", "required": false, "type": "String", "value": "Asset.Other Current Asset.InternalTransfers"}, {"displayName": "Other Consumables", "required": false, "type": "String", "value": "Asset.Other Current Asset.OtherConsumables"}, {"displayName": "Provisions Current Assets", "required": false, "type": "String", "value": "Asset.Other Current Asset.ProvisionsCurrentAssets"}, {"displayName": "Short Term Investments In Related Parties", "required": false, "type": "String", "value": "Asset.Other Current Asset.ShortTermInvestmentsInRelatedParties"}, {"displayName": "Short Term Loans And Advances To Related Parties", "required": false, "type": "String", "value": "Asset.Other Current Asset.ShortTermLoansAndAdvancesToRelatedParties"}, {"displayName": "Trade And Other Receivables", "required": false, "type": "String", "value": "Asset.Other Current Asset.TradeAndOtherReceivables"}, {"displayName": "Accumulated Depletion", "required": false, "type": "String", "value": "Asset.Fixed Asset.AccumulatedDepletion"}, {"displayName": "Accumulated Depreciation", "required": false, "type": "String", "value": "Asset.Fixed Asset.AccumulatedDepreciation"}, {"displayName": "Depletable Assets", "required": false, "type": "String", "value": "Asset.Fixed Asset.DepletableAssets"}, {"displayName": "Fixed Asset Computers", "required": false, "type": "String", "value": "Asset.Fixed Asset.FixedAssetComputers"}, {"displayName": "Fixed Asset Copiers", "required": false, "type": "String", "value": "Asset.Fixed Asset.FixedAssetCopiers"}, {"displayName": "Fixed Asset Furniture", "required": false, "type": "String", "value": "Asset.Fixed Asset.FixedAssetFurniture"}, {"displayName": "Fixed Asset Phone", "required": false, "type": "String", "value": "Asset.Fixed Asset.FixedAssetPhone"}, {"displayName": "Fixed Asset Photo Video", "required": false, "type": "String", "value": "Asset.Fixed Asset.FixedAssetPhotoVideo"}, {"displayName": "Fixed Asset Software", "required": false, "type": "String", "value": "Asset.Fixed Asset.FixedAssetSoftware"}, {"displayName": "Fixed Asset Other Tools Equipment", "required": false, "type": "String", "value": "Asset.Fixed Asset.FixedAssetOtherToolsEquipment"}, {"displayName": "Furniture And Fixtures", "required": false, "type": "String", "value": "Asset.Fixed Asset.FurnitureAndFixtures"}, {"displayName": "Land", "required": false, "type": "String", "value": "Asset.Fixed Asset.Land"}, {"displayName": "Leasehold Improvements", "required": false, "type": "String", "value": "Asset.Fixed Asset.LeaseholdImprovements"}, {"displayName": "Other Fixed Assets", "required": false, "type": "String", "value": "Asset.Fixed Asset.OtherFixedAssets"}, {"displayName": "Accumulated Amortization", "required": false, "type": "String", "value": "Asset.Fixed Asset.AccumulatedAmortization"}, {"displayName": "Buildings", "required": false, "type": "String", "value": "Asset.Fixed Asset.Buildings"}, {"displayName": "Intangible Assets", "required": false, "type": "String", "value": "Asset.Fixed Asset.IntangibleAssets"}, {"displayName": "Machinery And Equipment", "required": false, "type": "String", "value": "Asset.Fixed Asset.MachineryAndEquipment"}, {"displayName": "Vehicles", "required": false, "type": "String", "value": "Asset.Fixed Asset.Vehicles"}, {"displayName": "Assets In Course Of Construction", "required": false, "type": "String", "value": "Asset.Fixed Asset.AssetsInCourseOfConstruction"}, {"displayName": "Capital Wip", "required": false, "type": "String", "value": "Asset.Fixed Asset.CapitalWip"}, {"displayName": "Cumulative Depreciation On Intangible Assets", "required": false, "type": "String", "value": "Asset.Fixed Asset.CumulativeDepreciationOnIntangibleAssets"}, {"displayName": "Intangible Assets Under Development", "required": false, "type": "String", "value": "Asset.Fixed Asset.IntangibleAssetsUnderDevelopment"}, {"displayName": "Land Asset", "required": false, "type": "String", "value": "Asset.Fixed Asset.LandAsset"}, {"displayName": "Non Current Assets", "required": false, "type": "String", "value": "Asset.Fixed Asset.NonCurrentAssets"}, {"displayName": "Participating Interests", "required": false, "type": "String", "value": "Asset.Fixed Asset.ParticipatingInterests"}, {"displayName": "Provisions Fixed Assets", "required": false, "type": "String", "value": "Asset.Fixed Asset.ProvisionsFixedAssets"}, {"displayName": "Lease Buyout", "required": false, "type": "String", "value": "Asset.Other Asset.LeaseBuyout"}, {"displayName": "Other Long Term Assets", "required": false, "type": "String", "value": "Asset.Other Asset.OtherLongTermAssets"}, {"displayName": "Security Deposits", "required": false, "type": "String", "value": "Asset.Other Asset.SecurityDeposits"}, {"displayName": "Accumulated Amortization Of Other Assets", "required": false, "type": "String", "value": "Asset.Other Asset.AccumulatedAmortizationOfOtherAssets"}, {"displayName": "Goodwill", "required": false, "type": "String", "value": "Asset.Other Asset.Goodwill"}, {"displayName": "Licenses", "required": false, "type": "String", "value": "Asset.Other Asset.Licenses"}, {"displayName": "Organizational Costs", "required": false, "type": "String", "value": "Asset.Other Asset.OrganizationalCosts"}, {"displayName": "Assets Held For Sale", "required": false, "type": "String", "value": "Asset.Other Asset.AssetsHeldForSale"}, {"displayName": "Available For Sale Financial Assets", "required": false, "type": "String", "value": "Asset.Other Asset.AvailableForSaleFinancialAssets"}, {"displayName": "Deferred Tax", "required": false, "type": "String", "value": "Asset.Other Asset.DeferredTax"}, {"displayName": "Investments", "required": false, "type": "String", "value": "Asset.Other Asset.Investments"}, {"displayName": "Long Term Investments", "required": false, "type": "String", "value": "Asset.Other Asset.LongTermInvestments"}, {"displayName": "Long Term Loans And Advances To Related Parties", "required": false, "type": "String", "value": "Asset.Other Asset.LongTermLoansAndAdvancesToRelatedParties"}, {"displayName": "Other Intangible Assets", "required": false, "type": "String", "value": "Asset.Other Asset.OtherIntangibleAssets"}, {"displayName": "Other Long Term Investments", "required": false, "type": "String", "value": "Asset.Other Asset.OtherLongTermInvestments"}, {"displayName": "Other Long Term Loans And Advances", "required": false, "type": "String", "value": "Asset.Other Asset.OtherLongTermLoansAndAdvances"}, {"displayName": "Prepayments And Accrued Income", "required": false, "type": "String", "value": "Asset.Other Asset.PrepaymentsAndAccruedIncome"}, {"displayName": "Provisions Non-Current Assets", "required": false, "type": "String", "value": "Asset.Other Asset.ProvisionsNonCurrentAssets"}, {"displayName": "Accounts Receivable", "required": false, "type": "String", "value": "Asset.Accounts Receivable.AccountsReceivable"}, {"displayName": "Advertising/Promotional", "required": false, "type": "String", "value": "Expense.Expense.AdvertisingPromotional"}, {"displayName": "Bad Debts", "required": false, "type": "String", "value": "Expense.Expense.BadDebts"}, {"displayName": "Bank Charges", "required": false, "type": "String", "value": "Expense.Expense.BankCharges"}, {"displayName": "Charitable Contributions", "required": false, "type": "String", "value": "Expense.Expense.CharitableContributions"}, {"displayName": "Commissions And Fees", "required": false, "type": "String", "value": "Expense.Expense.CommissionsAndFees"}, {"displayName": "Entertainment", "required": false, "type": "String", "value": "Expense.Expense.Entertainment"}, {"displayName": "Entertainment Meals", "required": false, "type": "String", "value": "Expense.Expense.EntertainmentMeals"}, {"displayName": "Equipment Rental", "required": false, "type": "String", "value": "Expense.Expense.EquipmentRental"}, {"displayName": "Finance Costs", "required": false, "type": "String", "value": "Expense.Expense.FinanceCosts"}, {"displayName": "Global Tax Expense", "required": false, "type": "String", "value": "Expense.Expense.GlobalTaxExpense"}, {"displayName": "Insurance", "required": false, "type": "String", "value": "Expense.Expense.Insurance"}, {"displayName": "Interest Paid", "required": false, "type": "String", "value": "Expense.Expense.InterestPaid"}, {"displayName": "Legal And Professional Fees", "required": false, "type": "String", "value": "Expense.Expense.LegalProfessionalFees"}, {"displayName": "Office Expenses", "required": false, "type": "String", "value": "Expense.Expense.OfficeExpenses"}, {"displayName": "Office/General Administrative Expenses", "required": false, "type": "String", "value": "Expense.Expense.OfficeGeneralAdministrativeExpenses"}, {"displayName": "Other Business Expenses", "required": false, "type": "String", "value": "Expense.Expense.OtherBusinessExpenses"}, {"displayName": "Other Miscellaneous Service Cost", "required": false, "type": "String", "value": "Expense.Expense.OtherMiscellaneousServiceCost"}, {"displayName": "Promotional Meals", "required": false, "type": "String", "value": "Expense.Expense.PromotionalMeals"}, {"displayName": "Rent Or Lease Of Buildings", "required": false, "type": "String", "value": "Expense.Expense.RentOrLeaseOfBuildings"}, {"displayName": "Repair And Maintenance", "required": false, "type": "String", "value": "Expense.Expense.RepairMaintenance"}, {"displayName": "Shipping, Freight And Delivery", "required": false, "type": "String", "value": "Expense.Expense.ShippingFreightDelivery"}, {"displayName": "Supplies And Materials", "required": false, "type": "String", "value": "Expense.Expense.SuppliesMaterials"}, {"displayName": "Travel", "required": false, "type": "String", "value": "Expense.Expense.Travel"}, {"displayName": "Travel Meals", "required": false, "type": "String", "value": "Expense.Expense.TravelMeals"}, {"displayName": "Utilities", "required": false, "type": "String", "value": "Expense.Expense.Utilities"}, {"displayName": "Auto", "required": false, "type": "String", "value": "Expense.Expense.Auto"}, {"displayName": "Cost Of Labor", "required": false, "type": "String", "value": "Expense.Expense.CostOfLabor"}, {"displayName": "Dues And Subscriptions", "required": false, "type": "String", "value": "Expense.Expense.DuesSubscriptions"}, {"displayName": "Payroll Expenses", "required": false, "type": "String", "value": "Expense.Expense.PayrollExpenses"}, {"displayName": "Taxes Paid", "required": false, "type": "String", "value": "Expense.Expense.TaxesPaid"}, {"displayName": "Unapplied Cash Bill Payment Expense", "required": false, "type": "String", "value": "Expense.Expense.UnappliedCashBillPaymentExpense"}, {"displayName": "Utilities", "required": false, "type": "String", "value": "Expense.Expense.Utilities"}, {"displayName": "Amortization Expense", "required": false, "type": "String", "value": "Expense.Expense.AmortizationExpense"}, {"displayName": "Appropriations To Depreciation", "required": false, "type": "String", "value": "Expense.Expense.AppropriationsToDepreciation"}, {"displayName": "Borrowing Cost", "required": false, "type": "String", "value": "Expense.Expense.BorrowingCost"}, {"displayName": "Commissions And Fees", "required": false, "type": "String", "value": "Expense.Expense.CommissionsAndFees"}, {"displayName": "Distribution Costs", "required": false, "type": "String", "value": "Expense.Expense.DistributionCosts"}, {"displayName": "External Services", "required": false, "type": "String", "value": "Expense.Expense.ExternalServices"}, {"displayName": "Extraordinary Charges", "required": false, "type": "String", "value": "Expense.Expense.ExtraordinaryCharges"}, {"displayName": "Income Tax Expense", "required": false, "type": "String", "value": "Expense.Expense.IncomeTaxExpense"}, {"displayName": "Loss On Discontinued Operations Net Of Tax", "required": false, "type": "String", "value": "Expense.Expense.LossOnDiscontinuedOperationsNetOfTax"}, {"displayName": "Management Compensation", "required": false, "type": "String", "value": "Expense.Expense.ManagementCompensation"}, {"displayName": "Other Current Operating Charges", "required": false, "type": "String", "value": "Expense.Expense.OtherCurrentOperatingCharges"}, {"displayName": "Other External Services", "required": false, "type": "String", "value": "Expense.Expense.OtherExternalServices"}, {"displayName": "Other Rental Costs", "required": false, "type": "String", "value": "Expense.Expense.OtherRentalCosts"}, {"displayName": "Other Selling Expenses", "required": false, "type": "String", "value": "Expense.Expense.OtherSellingExpenses"}, {"displayName": "Project Studies Surveys Assessments", "required": false, "type": "String", "value": "Expense.Expense.ProjectStudiesSurveysAssessments"}, {"displayName": "Purchases Rebates", "required": false, "type": "String", "value": "Expense.Expense.PurchasesRebates"}, {"displayName": "Shipping And Delivery Expense", "required": false, "type": "String", "value": "Expense.Expense.ShippingAndDeliveryExpense"}, {"displayName": "Staff Costs", "required": false, "type": "String", "value": "Expense.Expense.StaffCosts"}, {"displayName": "Sundry", "required": false, "type": "String", "value": "Expense.Expense.Sundry"}, {"displayName": "Travel Expenses General And Admin Expenses", "required": false, "type": "String", "value": "Expense.Expense.TravelExpensesGeneralAndAdminExpenses"}, {"displayName": "Travel Expenses Selling Expense", "required": false, "type": "String", "value": "Expense.Expense.TravelExpensesSellingExpense"}, {"displayName": "Depreciation", "required": false, "type": "String", "value": "Expense.Other Expense.Depreciation"}, {"displayName": "Exchange Gain Or Loss", "required": false, "type": "String", "value": "Expense.Other Expense.ExchangeGainOrLoss"}, {"displayName": "Other Miscellaneous Expense", "required": false, "type": "String", "value": "Expense.Other Expense.OtherMiscellaneousExpense"}, {"displayName": "Penalties And Settlements", "required": false, "type": "String", "value": "Expense.Other Expense.PenaltiesSettlements"}, {"displayName": "Amortization", "required": false, "type": "String", "value": "Expense.Other Expense.Amortization"}, {"displayName": "Gas And Fuel", "required": false, "type": "String", "value": "Expense.Other Expense.GasAndFuel"}, {"displayName": "Home Office", "required": false, "type": "String", "value": "Expense.Other Expense.HomeOffice"}, {"displayName": "Home Owner Rental Insurance", "required": false, "type": "String", "value": "Expense.Other Expense.HomeOwnerRentalInsurance"}, {"displayName": "Other Home Office Expenses", "required": false, "type": "String", "value": "Expense.Other Expense.OtherHomeOfficeExpenses"}, {"displayName": "Mortgage Interest", "required": false, "type": "String", "value": "Expense.Other Expense.MortgageInterest"}, {"displayName": "Rent And Lease", "required": false, "type": "String", "value": "Expense.Other Expense.RentAndLease"}, {"displayName": "Repairs And Maintenance", "required": false, "type": "String", "value": "Expense.Other Expense.RepairsAndMaintenance"}, {"displayName": "Parking And Tolls", "required": false, "type": "String", "value": "Expense.Other Expense.ParkingAndTolls"}, {"displayName": "Vehicle", "required": false, "type": "String", "value": "Expense.Other Expense.Vehicle"}, {"displayName": "Vehicle Insurance", "required": false, "type": "String", "value": "Expense.Other Expense.VehicleInsurance"}, {"displayName": "Vehicle Lease", "required": false, "type": "String", "value": "Expense.Other Expense.VehicleLease"}, {"displayName": "Vehicle Loan Interest", "required": false, "type": "String", "value": "Expense.Other Expense.VehicleLoanInterest"}, {"displayName": "Vehicle Loan", "required": false, "type": "String", "value": "Expense.Other Expense.VehicleLoan"}, {"displayName": "Vehicle Registration", "required": false, "type": "String", "value": "Expense.Other Expense.VehicleRegistration"}, {"displayName": "Vehicle Repairs", "required": false, "type": "String", "value": "Expense.Other Expense.VehicleRepairs"}, {"displayName": "Other Vehicle Expenses", "required": false, "type": "String", "value": "Expense.Other Expense.OtherVehicleExpenses"}, {"displayName": "Utilities", "required": false, "type": "String", "value": "Expense.Other Expense.Utilities"}, {"displayName": "Wash And Road Services", "required": false, "type": "String", "value": "Expense.Other Expense.WashAndRoadServices"}, {"displayName": "Deferred Tax Expense", "required": false, "type": "String", "value": "Expense.Other Expense.DeferredTaxExpense"}, {"displayName": "Depletion", "required": false, "type": "String", "value": "Expense.Other Expense.Depletion"}, {"displayName": "Exceptional Items", "required": false, "type": "String", "value": "Expense.Other Expense.ExceptionalItems"}, {"displayName": "Extraordinary Items", "required": false, "type": "String", "value": "Expense.Other Expense.ExtraordinaryItems"}, {"displayName": "Income Tax Other Expense", "required": false, "type": "String", "value": "Expense.Other Expense.IncomeTaxOtherExpense"}, {"displayName": "Mat Credit", "required": false, "type": "String", "value": "Expense.Other Expense.MatCredit"}, {"displayName": "Prior Period Items", "required": false, "type": "String", "value": "Expense.Other Expense.PriorPeriodItems"}, {"displayName": "Tax Roundoff Gain Or Loss", "required": false, "type": "String", "value": "Expense.Other Expense.TaxRoundoffGainOrLoss"}, {"displayName": "Equipment Rental - COS", "required": false, "type": "String", "value": "Expense.Cost of Goods Sold.EquipmentRentalCos"}, {"displayName": "Other Costs Of Sales - COS", "required": false, "type": "String", "value": "Expense.Cost of Goods Sold.OtherCostsOfServiceCos"}, {"displayName": "Shipping, Freight And Delivery - COS", "required": false, "type": "String", "value": "Expense.Cost of Goods Sold.ShippingFreightDeliveryCos"}, {"displayName": "Supplies And Materials - COS", "required": false, "type": "String", "value": "Expense.Cost of Goods Sold.SuppliesMaterialsCogs"}, {"displayName": "Cost Of Labor - COS", "required": false, "type": "String", "value": "Expense.Cost of Goods Sold.CostOfLaborCos"}, {"displayName": "Cost Of Sales", "required": false, "type": "String", "value": "Expense.Cost of Goods Sold.CostOfSales"}, {"displayName": "Freight And Delivery Cost", "required": false, "type": "String", "value": "Expense.Cost of Goods Sold.FreightAndDeliveryCost"}, {"displayName": "Non Profit Income", "required": false, "type": "String", "value": "Income.Income.NonProfitIncome"}, {"displayName": "Other Primary Income", "required": false, "type": "String", "value": "Income.Income.OtherPrimaryIncome"}, {"displayName": "Sales Of ProductIncome", "required": false, "type": "String", "value": "Income.Income.SalesOfProductIncome"}, {"displayName": "Service Fee Income", "required": false, "type": "String", "value": "Income.Income.ServiceFeeIncome"}, {"displayName": "Discounts Refunds Given", "required": false, "type": "String", "value": "Income.Income.DiscountsRefundsGiven"}, {"displayName": "Unapplied Cash Payment Income", "required": false, "type": "String", "value": "Income.Income.UnappliedCashPaymentIncome"}, {"displayName": "Cash Receipt Income", "required": false, "type": "String", "value": "Income.Income.CashReceiptIncome"}, {"displayName": "Operating Grants", "required": false, "type": "String", "value": "Income.Income.OperatingGrants"}, {"displayName": "Other Current Operating Income", "required": false, "type": "String", "value": "Income.Income.OtherCurrentOperatingIncome"}, {"displayName": "Own Work Capitalized", "required": false, "type": "String", "value": "Income.Income.OwnWorkCapitalized"}, {"displayName": "Revenue General", "required": false, "type": "String", "value": "Income.Income.RevenueGeneral"}, {"displayName": "Sales Retail", "required": false, "type": "String", "value": "Income.Income.SalesRetail"}, {"displayName": "Sales Wholesale", "required": false, "type": "String", "value": "Income.Income.SalesWholesale"}, {"displayName": "Savings By Tax Scheme", "required": false, "type": "String", "value": "Income.Income.SavingsByTaxScheme"}, {"displayName": "Dividend Income", "required": false, "type": "String", "value": "Income.Other Income.DividendIncome"}, {"displayName": "Interest Earned", "required": false, "type": "String", "value": "Income.Other Income.InterestEarned"}, {"displayName": "Other Investment Income", "required": false, "type": "String", "value": "Income.Other Income.OtherInvestmentIncome"}, {"displayName": "Other Miscellaneous Income", "required": false, "type": "String", "value": "Income.Other Income.OtherMiscellaneousIncome"}, {"displayName": "Tax Exempt Interest", "required": false, "type": "String", "value": "Income.Other Income.TaxExemptInterest"}, {"displayName": "Gain Loss On Sale Of Fixed Assets", "required": false, "type": "String", "value": "Income.Other Income.GainLossOnSaleOfFixedAssets"}, {"displayName": "Gain Loss On Sale Of Investments", "required": false, "type": "String", "value": "Income.Other Income.GainLossOnSaleOfInvestments"}, {"displayName": "Loss On Disposal Of Assets", "required": false, "type": "String", "value": "Income.Other Income.LossOnDisposalOfAssets"}, {"displayName": "Other Operating Income", "required": false, "type": "String", "value": "Income.Other Income.OtherOperatingIncome"}, {"displayName": "Unrealised Loss On Securities Net Of Tax", "required": false, "type": "String", "value": "Income.Other Income.UnrealisedLossOnSecuritiesNetOfTax"}, {"displayName": "Accounts Payable", "required": false, "type": "String", "value": "Liability.Accounts Payable.AccountsPayable"}, {"displayName": "Outstanding Dues Micro Small Enterprise", "required": false, "type": "String", "value": "Liability.Accounts Payable.OutstandingDuesMicroSmallEnterprise"}, {"displayName": "Outstanding Dues Other Than Micro Small Enterprise", "required": false, "type": "String", "value": "Liability.Accounts Payable.OutstandingDuesOtherThanMicroSmallEnterprise"}, {"displayName": "Credit Card", "required": false, "type": "String", "value": "Liability.Credit Card.CreditCard"}, {"displayName": "Notes Payable", "required": false, "type": "String", "value": "Liability.Long Term Liability.NotesPayable"}, {"displayName": "Other Long Term Liabilities", "required": false, "type": "String", "value": "Liability.Long Term Liability.OtherLongTermLiabilities"}, {"displayName": "Shareholder Notes Payable", "required": false, "type": "String", "value": "Liability.Long Term Liability.ShareholderNotesPayable"}, {"displayName": "Accruals And Deferred Income", "required": false, "type": "String", "value": "Liability.Long Term Liability.AccrualsAndDeferredIncome"}, {"displayName": "Accrued Long Lerm Liabilities", "required": false, "type": "String", "value": "Liability.Long Term Liability.AccruedLongLermLiabilities"}, {"displayName": "Accrued Vacation Payable", "required": false, "type": "String", "value": "Liability.Long Term Liability.AccruedVacationPayable"}, {"displayName": "Bank Loans", "required": false, "type": "String", "value": "Liability.Long Term Liability.BankLoans"}, {"displayName": "Debts Related To Participating Interests", "required": false, "type": "String", "value": "Liability.Long Term Liability.DebtsRelatedToParticipatingInterests"}, {"displayName": "Deferred Tax Liabilities", "required": false, "type": "String", "value": "Liability.Long Term Liability.DeferredTaxLiabilities"}, {"displayName": "Government And Other Public Authorities", "required": false, "type": "String", "value": "Liability.Long Term Liability.GovernmentAndOtherPublicAuthorities"}, {"displayName": "Group And Associates", "required": false, "type": "String", "value": "Liability.Long Term Liability.GroupAndAssociates"}, {"displayName": "Liabilities Related To Assets Held For Sale", "required": false, "type": "String", "value": "Liability.Long Term Liability.LiabilitiesRelatedToAssetsHeldForSale"}, {"displayName": "Long Term Borrowings", "required": false, "type": "String", "value": "Liability.Long Term Liability.LongTermBorrowings"}, {"displayName": "Long Term Debit", "required": false, "type": "String", "value": "Liability.Long Term Liability.LongTermDebit"}, {"displayName": "Long Term Employee Benefit Obligations", "required": false, "type": "String", "value": "Liability.Long Term Liability.LongTermEmployeeBenefitObligations"}, {"displayName": "Obligations Under Finance Leases", "required": false, "type": "String", "value": "Liability.Long Term Liability.ObligationsUnderFinanceLeases"}, {"displayName": "Other Long Term Provisions", "required": false, "type": "String", "value": "Liability.Long Term Liability.OtherLongTermProvisions"}, {"displayName": "Provision For Liabilities", "required": false, "type": "String", "value": "Liability.Long Term Liability.ProvisionForLiabilities"}, {"displayName": "Provisions Non Current Liabilities", "required": false, "type": "String", "value": "Liability.Long Term Liability.ProvisionsNonCurrentLiabilities"}, {"displayName": "Staff And Related Long Term Liability Accounts", "required": false, "type": "String", "value": "Liability.Long Term Liability.StaffAndRelatedLongTermLiabilityAccounts"}, {"displayName": "Direct Deposit Payable", "required": false, "type": "String", "value": "Liability.Other Current Liability.DirectDepositPayable"}, {"displayName": "Line Of Credit", "required": false, "type": "String", "value": "Liability.Other Current Liability.LineOfCredit"}, {"displayName": "Loan Payable", "required": false, "type": "String", "value": "Liability.Other Current Liability.LoanPayable"}, {"displayName": "Global Tax Payable", "required": false, "type": "String", "value": "Liability.Other Current Liability.GlobalTaxPayable"}, {"displayName": "Global Tax Suspense", "required": false, "type": "String", "value": "Liability.Other Current Liability.GlobalTaxSuspense"}, {"displayName": "Other Current Liabilities", "required": false, "type": "String", "value": "Liability.Other Current Liability.OtherCurrentLiabilities"}, {"displayName": "Payroll Clearing", "required": false, "type": "String", "value": "Liability.Other Current Liability.PayrollClearing"}, {"displayName": "Payroll Tax Payable", "required": false, "type": "String", "value": "Liability.Other Current Liability.PayrollTaxPayable"}, {"displayName": "Prepaid Expenses Payable", "required": false, "type": "String", "value": "Liability.Other Current Liability.PrepaidExpensesPayable"}, {"displayName": "Rents In Trust Liability", "required": false, "type": "String", "value": "Liability.Other Current Liability.RentsInTrustLiability"}, {"displayName": "Trust Accounts Liabilities", "required": false, "type": "String", "value": "Liability.Other Current Liability.TrustAccountsLiabilities"}, {"displayName": "Federal Income Tax Payable", "required": false, "type": "String", "value": "Liability.Other Current Liability.FederalIncomeTaxPayable"}, {"displayName": "Insurance Payable", "required": false, "type": "String", "value": "Liability.Other Current Liability.InsurancePayable"}, {"displayName": "Sales Tax Payable", "required": false, "type": "String", "value": "Liability.Other Current Liability.SalesTaxPayable"}, {"displayName": "State Local Income Tax Payable", "required": false, "type": "String", "value": "Liability.Other Current Liability.StateLocalIncomeTaxPayable"}, {"displayName": "Accrued Liabilities", "required": false, "type": "String", "value": "Liability.Other Current Liability.AccruedLiabilities"}, {"displayName": "Current Liabilities", "required": false, "type": "String", "value": "Liability.Other Current Liability.CurrentLiabilities"}, {"displayName": "Current Portion EmployeeBenefits Obligations", "required": false, "type": "String", "value": "Liability.Other Current Liability.CurrentPortionEmployeeBenefitsObligations"}, {"displayName": "Current Portion Of Obligations Under Finance Leases", "required": false, "type": "String", "value": "Liability.Other Current Liability.CurrentPortionOfObligationsUnderFinanceLeases"}, {"displayName": "Current Tax Liability", "required": false, "type": "String", "value": "Liability.Other Current Liability.CurrentTaxLiability"}, {"displayName": "Dividends Payable", "required": false, "type": "String", "value": "Liability.Other Current Liability.DividendsPayable"}, {"displayName": "Duties And Taxes", "required": false, "type": "String", "value": "Liability.Other Current Liability.DutiesAndTaxes"}, {"displayName": "Interest Payables", "required": false, "type": "String", "value": "Liability.Other Current Liability.InterestPayables"}, {"displayName": "Provision For Warranty Obligations", "required": false, "type": "String", "value": "Liability.Other Current Liability.ProvisionForWarrantyObligations"}, {"displayName": "Provisions Current Liabilities", "required": false, "type": "String", "value": "Liability.Other Current Liability.ProvisionsCurrentLiabilities"}, {"displayName": "Short Term Borrowings", "required": false, "type": "String", "value": "Liability.Other Current Liability.ShortTermBorrowings"}, {"displayName": "Social Security Agencies", "required": false, "type": "String", "value": "Liability.Other Current Liability.SocialSecurityAgencies"}, {"displayName": "Staff And Related Liability Accounts", "required": false, "type": "String", "value": "Liability.Other Current Liability.StaffAndRelatedLiabilityAccounts"}, {"displayName": "Sundry Debtors And Creditors", "required": false, "type": "String", "value": "Liability.Other Current Liability.SundryDebtorsAndCreditors"}, {"displayName": "Trade And Other Payables", "required": false, "type": "String", "value": "Liability.Other Current Liability.TradeAndOtherPayables"}, {"displayName": "Opening Balance Equity", "required": false, "type": "String", "value": "Equity.Equity.OpeningBalanceEquity"}, {"displayName": "Partners Equity", "required": false, "type": "String", "value": "Equity.Equity.PartnersEquity"}, {"displayName": "Retained Earnings", "required": false, "type": "String", "value": "Equity.Equity.RetainedEarnings"}, {"displayName": "Accumulated Adjustment", "required": false, "type": "String", "value": "Equity.Equity.AccumulatedAdjustment"}, {"displayName": "Owners Equity", "required": false, "type": "String", "value": "Equity.Equity.OwnersEquity"}, {"displayName": "Paid In Capital Or Surplus", "required": false, "type": "String", "value": "Equity.Equity.PaidInCapitalOrSurplus"}, {"displayName": "Partner Contributions", "required": false, "type": "String", "value": "Equity.Equity.PartnerContributions"}, {"displayName": "Partner Distributions", "required": false, "type": "String", "value": "Equity.Equity.PartnerDistributions"}, {"displayName": "Preferred Stock", "required": false, "type": "String", "value": "Equity.Equity.PreferredStock"}, {"displayName": "Common Stock", "required": false, "type": "String", "value": "Equity.Equity.CommonStock"}, {"displayName": "Treasury Stock", "required": false, "type": "String", "value": "Equity.Equity.TreasuryStock"}, {"displayName": "Estimated Taxes", "required": false, "type": "String", "value": "Equity.Equity.EstimatedTaxes"}, {"displayName": "Healthcare", "required": false, "type": "String", "value": "Equity.Equity.Healthcare"}, {"displayName": "Personal Income", "required": false, "type": "String", "value": "Equity.Equity.PersonalIncome"}, {"displayName": "Personal Expense", "required": false, "type": "String", "value": "Equity.Equity.PersonalExpense"}, {"displayName": "Accumulated Other Comprehensive Income", "required": false, "type": "String", "value": "Equity.Equity.AccumulatedOtherComprehensiveIncome"}, {"displayName": "Called Up Share Capital", "required": false, "type": "String", "value": "Equity.Equity.CalledUpShareCapital"}, {"displayName": "Capital Reserves", "required": false, "type": "String", "value": "Equity.Equity.CapitalReserves"}, {"displayName": "Dividend Disbursed", "required": false, "type": "String", "value": "Equity.Equity.DividendDisbursed"}, {"displayName": "Equity In Earnings Of Subsiduaries", "required": false, "type": "String", "value": "Equity.Equity.EquityInEarningsOfSubsiduaries"}, {"displayName": "Investment Grants", "required": false, "type": "String", "value": "Equity.Equity.InvestmentGrants"}, {"displayName": "Money Received Against Share Warrants", "required": false, "type": "String", "value": "Equity.Equity.MoneyReceivedAgainstShareWarrants"}, {"displayName": "Other Free Reserves", "required": false, "type": "String", "value": "Equity.Equity.OtherFreeReserves"}, {"displayName": "Share Application Money Pending Allotment", "required": false, "type": "String", "value": "Equity.Equity.ShareApplicationMoneyPendingAllotment"}, {"displayName": "Share Capital", "required": false, "type": "String", "value": "Equity.Equity.ShareCapital"}, {"displayName": "Funds", "required": false, "type": "String", "value": "Equity.Equity.Funds"}], "required": true, "type": "String"}}, "required": true, "type": "Object"} + Sage Business Cloud Accounting: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + responses: + "200": + application/json: {"description": "Nominal Accounts are the categories a business uses to record transactions", "displayName": "Nominal Account", "properties": {"name": {"description": "Name of the account", "displayName": "Name", "required": true, "type": "String", "validation": {"information": [{"details": "Should not be longer than 200 characters.", "field": "Name"}], "warnings": []}}, "nominalCode": {"description": "The external reference given to each nominal account for a business", "displayName": "Nominal Code", "required": true, "type": "String", "validation": {"information": [{"details": "Should be a number between 1 and 99999999.", "field": "NominalCode"}], "warnings": []}}, "fullyQualifiedCategory": {"description": "The full category of the account e.g. Liability.Current or Income.Revenue", "displayName": "Fully Qualified Category", "options": [{"displayName": "Sales", "required": false, "type": "String", "value": "SALES"}, {"displayName": "Other Income", "required": false, "type": "String", "value": "OTHER_INCOME"}, {"displayName": "Direct Expenses", "required": false, "type": "String", "value": "DIRECT_EXPENSES"}, {"displayName": "Overheads", "required": false, "type": "String", "value": "OVERHEADS"}, {"displayName": "Depreciation", "required": false, "type": "String", "value": "DEPRECIATION"}, {"displayName": "Current Assets", "required": false, "type": "String", "value": "CURRENT_ASSETS"}, {"displayName": "Fixed Assets", "required": false, "type": "String", "value": "FIXED_ASSETS"}, {"displayName": "Future Assets", "required": false, "type": "String", "value": "FUTURE_ASSETS"}, {"displayName": "Bank", "required": false, "type": "String", "value": "BANK"}, {"displayName": "Current Liability", "required": false, "type": "String", "value": "CURRENT_LIABILITY"}, {"displayName": "Future Liability", "required": false, "type": "String", "value": "FUTURE_LIABILITY"}, {"displayName": "Equity", "required": false, "type": "String", "value": "EQUITY"}, {"displayName": "Credit Card / Loan", "required": false, "type": "String", "value": "LINE_OF_CREDIT"}], "required": true, "type": "String"}}, "required": true, "type": "Object"} + Sage Intacct: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + responses: + "200": + application/json: {"description": "Nominal Accounts are the categories a business uses to record transactions", "displayName": "Nominal Account", "properties": {"nominalCode": {"description": "The external reference given to each nominal account for a business", "displayName": "Nominal Code", "required": true, "type": "String", "validation": {"information": [], "warnings": [{"details": "Must be unique within the entity.", "field": "NominalCode"}, {"details": "Must be at most 24 characters in length, although restrictions may vary between entities.", "field": "NominalCode"}]}}, "name": {"description": "Name of the account", "displayName": "Name", "required": true, "type": "String"}, "status": {"description": "The status of the account", "displayName": "Account Status", "options": [{"displayName": "Active", "required": false, "type": "String", "value": "Active"}, {"displayName": "Archived", "required": false, "type": "String", "value": "Archived"}], "required": true, "type": "String"}, "type": {"description": "The type, or base category, of the account", "displayName": "Account Type", "options": [{"displayName": "Asset", "required": false, "type": "String", "value": "Asset"}, {"displayName": "Equity", "required": false, "type": "String", "value": "Equity"}, {"displayName": "Expense", "required": false, "type": "String", "value": "Expense"}, {"displayName": "Income", "required": false, "type": "String", "value": "Income"}, {"displayName": "Liability", "required": false, "type": "String", "value": "Liability"}], "required": true, "type": "String"}, "fullyQualifiedCategory": {"description": "The full category of the account e.g. Liability.Current or Income.Revenue", "displayName": "Fully Qualified Category", "required": true, "type": "String", "validation": {"information": [{"details": "Any category that is part of the hierarchy of one of: 'Assets', 'Equity', 'Liabilities', 'Total Expenses' and 'Total Income' is permitted.", "field": "FullyQualifiedCategory"}], "warnings": []}}}, "required": true, "type": "Object"} + Sandbox: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + responses: + "200": + application/json: {"description": "Nominal Accounts are the categories a business uses to record transactions", "displayName": "Nominal Account", "properties": {"nominalCode": {"description": "The external reference given to each nominal account for a business", "displayName": "Nominal Code", "required": true, "type": "String"}, "name": {"description": "Name of the account", "displayName": "Name", "required": true, "type": "String"}, "description": {"description": "Description of the account", "displayName": "Description", "required": true, "type": "String"}, "fullyQualifiedCategory": {"description": "The full category of the account e.g. Liability.Current or Income.Revenue", "displayName": "Fully Qualified Category", "required": true, "type": "String"}, "fullyQualifiedName": {"description": "The full name of the account e.g. Liability.Current.VAT or Income.Revenue.Sales", "displayName": "Fully Qualified Name", "required": true, "type": "String"}, "currency": {"description": "The currency of the account", "displayName": "Currency", "required": true, "type": "String"}, "currentBalance": {"description": "The current balance in the account", "displayName": "Current Balance", "required": true, "type": "Number"}, "type": {"description": "The type, or base category, of the account", "displayName": "Account Type", "required": true, "type": "String"}, "status": {"description": "The status of the account", "displayName": "Account Status", "required": true, "type": "String"}, "isBankAccount": {"description": "Confirms whether the nominal account represents a bank account or not", "displayName": "Is Bank Account?", "required": true, "type": "Boolean"}, "validDatatypeLinks": {"description": "Describes which fields on other data types are valid links to this account in the originating system", "displayName": "Valid Datatype Links", "required": true, "type": "Array"}, "metadata": {"description": "Miscellaneous data about the item", "displayName": "Metadata", "required": true, "type": "Object"}}, "required": true, "type": "Object"} + Xero: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + responses: + "200": + application/json: {"description": "Nominal Accounts are the categories a business uses to record transactions", "displayName": "Nominal Account", "properties": {"nominalCode": {"description": "Identifier for the nominal account.", "displayName": "Nominal Code", "required": true, "type": "String", "validation": {"information": [], "warnings": [{"details": "Max length of 10 characters.", "field": "NominalCode"}]}}, "name": {"description": "Name of account as it appears in the chart of accounts or general ledger.", "displayName": "Name", "required": true, "type": "String", "validation": {"information": [{"details": "Payments are enabled to this account if the name ends in .PaymentsEnabled.", "field": "Name"}], "warnings": []}}, "description": {"description": "Description for the nominal account.", "displayName": "Description", "required": false, "type": "String"}, "fullyQualifiedCategory": {"description": "Account type and category for nominal account.", "displayName": "Fully Qualified Category", "options": [{"displayName": "Current Asset", "required": false, "type": "String", "value": "Asset.Current"}, {"displayName": "Fixed Asset", "required": false, "type": "String", "value": "Asset.Fixed"}, {"displayName": "Inventory", "required": false, "type": "String", "value": "Asset.Inventory"}, {"displayName": "Non-current Asset", "required": false, "type": "String", "value": "Asset.NonCurrent"}, {"displayName": "Prepayment", "required": false, "type": "String", "value": "Asset.Prepayment"}, {"displayName": "Direct Costs", "required": false, "type": "String", "value": "Expense.DirectCosts"}, {"displayName": "Expense", "required": false, "type": "String", "value": "Expense.Expense"}, {"displayName": "Overhead", "required": false, "type": "String", "value": "Expense.Overhead"}, {"displayName": "Superannuation", "required": false, "type": "String", "value": "Expense.Superannuation"}, {"displayName": "Wages", "required": false, "type": "String", "value": "Expense.Wages"}, {"displayName": "Sales", "required": false, "type": "String", "value": "Income.Sales"}, {"displayName": "Revenue", "required": false, "type": "String", "value": "Income.Revenue"}, {"displayName": "Other Income", "required": false, "type": "String", "value": "Income.Other"}, {"displayName": "Current Liability", "required": false, "type": "String", "value": "Liability.Current"}, {"displayName": "Depreciation", "required": false, "type": "String", "value": "Liability.Depreciation"}, {"displayName": "Liability", "required": false, "type": "String", "value": "Liability.Liability"}, {"displayName": "Non Current Liability", "required": false, "type": "String", "value": "Liability.NonCurrent"}, {"displayName": "Pay As You Go Liability", "required": false, "type": "String", "value": "Liability.PayAsYouGo"}, {"displayName": "Superannuation Liability", "required": false, "type": "String", "value": "Liability.Superannuation"}, {"displayName": "Wages Payable Liability", "required": false, "type": "String", "value": "Liability.WagesPayable"}, {"displayName": "Equity", "required": false, "type": "String", "value": "Equity.Equity"}], "required": true, "type": "String"}}, "required": true, "type": "Object"} + Unauthorized: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + responses: + "401": + application/json: {"canBeRetried": "Unknown", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "detailedErrorCode": 0, "error": "Unauthorized", "service": "PublicApi", "statusCode": 401} + list-accounts: + "": + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/{id}/data/{dataType}?page=1&pageSize=10"}, "self": {"href": "/companies/{id}/data/{dataType}"}}, "pageNumber": 1, "pageSize": 10, "results": [{"currency": "USD", "currentBalance": 0, "description": "Invoices the business has issued but has not yet collected payment on.", "fullyQualifiedCategory": "Asset.Current", "fullyQualifiedName": "Fixed Asset", "id": "1b6266d1-1e44-46c5-8eb5-a8f98e03124e", "modifiedDate": "2022-10-23T00:00:00Z", "name": "Accounts Receivable", "nominalCode": "610", "sourceModifiedDate": "2022-10-23T00:00:00Z", "status": "Active", "type": "Asset"}, {"currency": "GBP", "currentBalance": 0, "description": "Invoices the business has issued but has not yet collected payment on.", "fullyQualifiedCategory": "Asset.Current", "fullyQualifiedName": "Fixed Asset", "id": "1b6266d1-1e44-46c5-8eb5-a8f98e03124e", "modifiedDate": "2022-10-23T00:00:00Z", "name": "Accounts Receivable", "nominalCode": "610", "sourceModifiedDate": "2022-10-23T00:00:00Z", "status": "Active", "type": "Asset"}, {"currency": "EUR", "currentBalance": 0, "description": "Invoices the business has issued but has not yet collected payment on.", "fullyQualifiedCategory": "Asset.Current", "fullyQualifiedName": "Cash On Hand", "id": "1b6266d1-1e44-46c5-8eb5-a8f98e03124e", "modifiedDate": "2022-10-23T00:00:00Z", "name": "Accounts Receivable", "nominalCode": "610", "sourceModifiedDate": "2022-10-23T00:00:00Z", "status": "Active", "type": "Asset"}], "totalResults": 1} + "400": {} + Clear Books: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/354a121b-855f-4d25-90ad-0905b498c1c0/data/accounts?page=1&pageSize=2"}, "next": {"href": "/companies/354a121b-855f-4d25-90ad-0905b498c1c0/data/accounts?page=2&pageSize=2"}, "self": {"href": "/companies/354a121b-855f-4d25-90ad-0905b498c1c0/data/accounts"}}, "pageNumber": 1, "pageSize": 2, "results": [{"currency": "GBP", "currentBalance": 0, "description": "Invoices the business has issued but has not yet collected payment on.", "fullyQualifiedCategory": "Asset.Current", "fullyQualifiedName": "Asset.Current.Accounts Receivable", "id": "1b6266d1-1e44-46c5-8eb5-a8f98e03124e", "isBankAccount": false, "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-26T12:38:15Z", "name": "Accounts Receivable", "nominalCode": "610", "sourceModifiedDate": "2022-12-10T16:39:00", "status": "Active", "type": "Asset", "validDatatypeLinks": []}, {"currency": "GBP", "currentBalance": 0, "description": "A provision anticipating that a portion of accounts receivable will never be collected.", "fullyQualifiedCategory": "Asset.Current", "fullyQualifiedName": "Asset.Current.Accounts Receivable", "id": "76d5f23b-9623-4e3b-89cd-da57228764d3", "isBankAccount": false, "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-26T12:38:15Z", "name": "Accounts Receivable", "nominalCode": "611", "sourceModifiedDate": "2022-10-19T05:49:00", "status": "Active", "type": "Asset", "validDatatypeLinks": []}], "totalResults": 98} + Dynamics 365 Business Central: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/d6849caf-c146-41be-8335-b73346e3bd84/data/accounts?page=1&pageSize=2"}, "next": {"href": "/companies/d6849caf-c146-41be-8335-b73346e3bd84/data/accounts?page=2&pageSize=2"}, "self": {"href": "/companies/d6849caf-c146-41be-8335-b73346e3bd84/data/accounts"}}, "pageNumber": 1, "pageSize": 2, "results": [{"currency": "GBP", "currentBalance": 0, "description": "Invoices the business has issued but has not yet collected payment on.", "fullyQualifiedCategory": " .", "fullyQualifiedName": "..", "id": "8eaed16d-c69f-ec11-80f1-0022481b4546", "isBankAccount": false, "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-27T14:21:18Z", "name": "", "nominalCode": "45422026-68CA-4EF2-9", "sourceModifiedDate": "2022-03-09T16:31:54Z", "status": "Active", "type": "Unknown", "validDatatypeLinks": [{"links": ["DirectCost.LineItems.AccountRef.Id"], "property": "Id"}]}, {"currency": "GBP", "currentBalance": 27.34, "description": "Invoices the business has issued but has not yet collected payment on.", "fullyQualifiedCategory": " .", "fullyQualifiedName": "..Account no cat Balance Sheet", "id": "c0861a65-c69f-ec11-80f1-0022481b4546", "isBankAccount": false, "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-27T14:21:18Z", "name": "Account no cat Balance Sheet", "nominalCode": "10", "sourceModifiedDate": "2022-09-13T14:45:01Z", "status": "Active", "type": "Unknown", "validDatatypeLinks": [{"links": ["DirectCost.LineItems.AccountRef.Id"], "property": "Id"}]}], "totalResults": 122} + Exact (Netherlands): + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/b83b1923-4db6-45a8-a779-b4e320c15979/data/accounts?page=1&pageSize=2"}, "next": {"href": "/companies/b83b1923-4db6-45a8-a779-b4e320c15979/data/accounts?page=2&pageSize=2"}, "self": {"href": "/companies/b83b1923-4db6-45a8-a779-b4e320c15979/data/accounts"}}, "pageNumber": 1, "pageSize": 2, "results": [{"currency": "EUR", "currentBalance": 864435.44, "description": "Debiteuren", "fullyQualifiedCategory": "Asset.Assets.AccountsReceivable", "fullyQualifiedName": "Asset.Assets.AccountsReceivable.Debiteuren.PaymentsEnabled", "id": "ef2fde36-4416-4bc5-b239-315b2929348c", "isBankAccount": false, "modifiedDate": "2022-10-26T13:36:17Z", "name": "Debiteuren", "nominalCode": "1300", "sourceModifiedDate": "2020-01-08T09:42:54Z", "status": "Active", "type": "Asset", "validDatatypeLinks": [{"links": ["Transfer.To.AccountRef.Id", "Transfer.From.AccountRef.Id", "Payment.AccountRef.Id", "BillPayment.AccountRef.Id"], "property": "Id"}]}, {"currency": "EUR", "currentBalance": 2174.82, "description": "One more AR account", "fullyQualifiedCategory": "Asset.Assets.AccountsReceivable", "fullyQualifiedName": "Asset.Assets.AccountsReceivable.One more AR account.PaymentsEnabled", "id": "2052b65b-20e9-4da1-85d8-fd5ca0ea3d38", "isBankAccount": false, "modifiedDate": "2022-10-26T13:36:17Z", "name": "One more AR account", "nominalCode": "888777888", "sourceModifiedDate": "2021-06-10T11:00:20Z", "status": "Active", "type": "Asset", "validDatatypeLinks": [{"links": ["Transfer.To.AccountRef.Id", "Transfer.From.AccountRef.Id", "Payment.AccountRef.Id", "BillPayment.AccountRef.Id"], "property": "Id"}]}], "totalResults": 230} + Exact (UK): + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/d95030cd-22b2-482b-9c7b-2980dcc2b1ce/data/accounts?page=1&pageSize=2"}, "next": {"href": "/companies/d95030cd-22b2-482b-9c7b-2980dcc2b1ce/data/accounts?page=2&pageSize=2"}, "self": {"href": "/companies/d95030cd-22b2-482b-9c7b-2980dcc2b1ce/data/accounts"}}, "pageNumber": 1, "pageSize": 2, "results": [{"currency": "GBP", "currentBalance": 0, "description": "Some thing account", "fullyQualifiedCategory": "Asset.Assets.AccountsReceivable", "fullyQualifiedName": "Asset.Assets.AccountsReceivable.Some thing account.PaymentsEnabled", "id": "ca2b96b7-cc45-4e35-9fa3-82a2ba1eec40", "isBankAccount": false, "modifiedDate": "2022-10-26T13:35:15Z", "name": "Some thing account", "nominalCode": "THING", "sourceModifiedDate": "2017-08-01T17:31:12Z", "status": "Active", "type": "Asset", "validDatatypeLinks": [{"links": ["Transfer.To.AccountRef.Id", "Transfer.From.AccountRef.Id", "Payment.AccountRef.Id", "BillPayment.AccountRef.Id"], "property": "Id"}]}, {"currency": "GBP", "currentBalance": 4484655.39, "description": "Trade Debtors", "fullyQualifiedCategory": "Asset.Assets.AccountsReceivable", "fullyQualifiedName": "Asset.Assets.AccountsReceivable.Trade Debtors.PaymentsEnabled", "id": "cf9572e7-8afa-4339-9113-af32a66d9df9", "isBankAccount": false, "modifiedDate": "2022-10-26T13:35:15Z", "name": "Trade Debtors", "nominalCode": "15400", "sourceModifiedDate": "2020-01-08T13:48:38Z", "status": "Active", "type": "Asset", "validDatatypeLinks": [{"links": ["Transfer.To.AccountRef.Id", "Transfer.From.AccountRef.Id", "Payment.AccountRef.Id", "BillPayment.AccountRef.Id"], "property": "Id"}]}], "totalResults": 121} + FreeAgent: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/071ad738-68f3-4561-afd0-69bab9df0803/data/accounts?page=1&pageSize=2"}, "next": {"href": "/companies/071ad738-68f3-4561-afd0-69bab9df0803/data/accounts?page=2&pageSize=2"}, "self": {"href": "/companies/071ad738-68f3-4561-afd0-69bab9df0803/data/accounts"}}, "pageNumber": 1, "pageSize": 2, "results": [{"currency": "GBP", "currentBalance": 0, "description": "Invoices the business has issued but has not yet collected payment on.", "fullyQualifiedCategory": "Asset.Capital", "fullyQualifiedName": "Asset.Capital.Capital Asset Brought Forward", "id": "601", "isBankAccount": false, "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-25T14:19:12Z", "name": "Capital Asset Brought Forward", "nominalCode": "601", "sourceModifiedDate": "2022-10-23T00:00:00Z", "status": "Active", "type": "Asset", "validDatatypeLinks": []}, {"currency": "GBP", "currentBalance": 0, "description": "Invoices the business has issued but has not yet collected payment on.", "fullyQualifiedCategory": "Asset.Capital", "fullyQualifiedName": "Asset.Capital.Capital Asset Depreciation Brought Forward", "id": "605", "isBankAccount": false, "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-25T14:19:12Z", "name": "Capital Asset Depreciation Brought Forward", "nominalCode": "605", "sourceModifiedDate": "2022-10-23T00:00:00Z", "status": "Active", "type": "Asset", "validDatatypeLinks": []}], "totalResults": 292} + FreshBooks: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/3691c49e-0db4-4172-b3ab-e4084c365013/data/accounts?page=1&pageSize=2"}, "next": {"href": "/companies/3691c49e-0db4-4172-b3ab-e4084c365013/data/accounts?page=2&pageSize=2"}, "self": {"href": "/companies/3691c49e-0db4-4172-b3ab-e4084c365013/data/accounts"}}, "pageNumber": 1, "pageSize": 2, "results": [{"currency": "GBP", "currentBalance": 51445.53, "description": "Invoices the business has issued but has not yet collected payment on.", "fullyQualifiedCategory": "Asset", "fullyQualifiedName": "Asset.Accounts Receivable", "id": "67357", "isBankAccount": false, "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-24T16:07:24Z", "name": "Accounts Receivable", "nominalCode": "1200", "sourceModifiedDate": "2022-10-23T00:00:00Z", "status": "Active", "type": "Asset", "validDatatypeLinks": []}, {"currency": "GBP", "currentBalance": 51445.53, "description": "Invoices the business has issued but has not yet collected payment on.", "fullyQualifiedCategory": "Asset.Accounts Receivable", "fullyQualifiedName": "Asset.Accounts Receivable.Accounts Receivable", "id": "128611", "isBankAccount": false, "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-24T16:07:24Z", "name": "Accounts Receivable", "nominalCode": "1200-1", "sourceModifiedDate": "2022-10-23T00:00:00Z", "status": "Active", "type": "Asset", "validDatatypeLinks": []}], "totalResults": 96} + KashFlow: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/3a707a99-89da-4b16-a5d6-595333a16352/data/accounts?page=1&pageSize=2"}, "next": {"href": "/companies/3a707a99-89da-4b16-a5d6-595333a16352/data/accounts?page=2&pageSize=2"}, "self": {"href": "/companies/3a707a99-89da-4b16-a5d6-595333a16352/data/accounts"}}, "pageNumber": 1, "pageSize": 2, "results": [{"currency": "GBP", "currentBalance": 0, "description": "Invoices the business has issued but has not yet collected payment on.", "fullyQualifiedCategory": "Asset.BankAccount", "fullyQualifiedName": "Asset.BankAccount.16th Account", "id": "27840056", "isBankAccount": true, "modifiedDate": "2022-09-30T10:29:16Z", "name": "16th Account", "nominalCode": "70700", "sourceModifiedDate": "2022-10-23T00:00:00Z", "status": "Active", "type": "Asset", "validDatatypeLinks": []}, {"currency": "GBP", "currentBalance": 0, "description": "Invoices the business has issued but has not yet collected payment on.", "fullyQualifiedCategory": "Asset.BankAccount", "fullyQualifiedName": "Asset.BankAccount.1a1a", "id": "27840049", "isBankAccount": true, "modifiedDate": "2022-09-30T10:29:16Z", "name": "1a1a", "nominalCode": "70600", "sourceModifiedDate": "2022-10-23T00:00:00Z", "status": "Active", "type": "Asset", "validDatatypeLinks": []}], "totalResults": 157} + Oracle NetSuite: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/d5074b08-6a34-4b06-a742-236edf5dc4f1/data/accounts?page=1&pageSize=2"}, "next": {"href": "/companies/d5074b08-6a34-4b06-a742-236edf5dc4f1/data/accounts?page=2&pageSize=2"}, "self": {"href": "/companies/d5074b08-6a34-4b06-a742-236edf5dc4f1/data/accounts"}}, "pageNumber": 1, "pageSize": 2, "results": [{"currency": "GBP", "currentBalance": -635.55, "description": "Invoices the business has issued but has not yet collected payment on.", "fullyQualifiedCategory": "AcctPay.AcctPay", "fullyQualifiedName": "AcctPay.AcctPay.Accounts Payable", "id": "111", "isBankAccount": false, "modifiedDate": "2023-01-30T14:48:33Z", "name": "Accounts Payable", "nominalCode": "610", "sourceModifiedDate": "2021-08-11T12:51:21", "status": "Active", "type": "Liability", "validDatatypeLinks": []}, {"currency": "EUR", "currentBalance": -565, "description": "Invoices the business has issued but has not yet collected payment on.", "fullyQualifiedCategory": "AcctRec.AcctRec", "fullyQualifiedName": "AcctRec.AcctRec.Accounts Receivable", "id": "119", "isBankAccount": false, "modifiedDate": "2023-01-30T14:48:33Z", "name": "Accounts Receivable", "nominalCode": "610", "sourceModifiedDate": "2021-09-08T15:23:31", "status": "Active", "type": "Asset", "validDatatypeLinks": []}], "totalResults": 44} + QuickBooks Desktop: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/fc72ba08-af13-4474-b28a-01dcfa6cfb51/data/accounts?page=1&pageSize=2"}, "next": {"href": "/companies/fc72ba08-af13-4474-b28a-01dcfa6cfb51/data/accounts?page=2&pageSize=2"}, "self": {"href": "/companies/fc72ba08-af13-4474-b28a-01dcfa6cfb51/data/accounts"}}, "pageNumber": 1, "pageSize": 2, "results": [{"currency": "GBP", "currentBalance": 93007.93, "description": "Accounts Receivable", "fullyQualifiedCategory": "Asset.CurrentAsset.AccountsReceivable", "fullyQualifiedName": "Asset.CurrentAsset.AccountsReceivable.Accounts Receivable", "id": "40000-933270541", "isBankAccount": false, "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-26T09:06:23Z", "name": "Accounts Receivable", "nominalCode": "11000", "sourceModifiedDate": "2023-12-16T05:06:45", "status": "Active", "type": "Asset", "validDatatypeLinks": []}, {"currency": "GBP", "currentBalance": 46954.1, "description": "Cash", "fullyQualifiedCategory": "Asset.CurrentAsset.Bank", "fullyQualifiedName": "Asset.CurrentAsset.Bank.Checking", "id": "20000-933270541", "isBankAccount": true, "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-26T09:06:23Z", "name": "Checking", "nominalCode": "10100", "sourceModifiedDate": "2023-12-16T05:06:45", "status": "Active", "type": "Asset", "validDatatypeLinks": [{"links": ["BillLineItem.AccountRef.Id", "BillPayment.AccountRef.Id"], "property": "Id"}]}], "totalResults": 116} + QuickBooks Online: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/10818b5e-6e6a-4ed4-a1c5-3e3efe626e87/data/accounts?page=1&pageSize=2"}, "next": {"href": "/companies/10818b5e-6e6a-4ed4-a1c5-3e3efe626e87/data/accounts?page=2&pageSize=2"}, "self": {"href": "/companies/10818b5e-6e6a-4ed4-a1c5-3e3efe626e87/data/accounts"}}, "pageNumber": 1, "pageSize": 2, "results": [{"currency": "GBP", "currentBalance": 41289.37, "description": "Invoices the business has issued but has not yet collected payment on.", "fullyQualifiedCategory": "Asset.Accounts Receivable.AccountsReceivable", "fullyQualifiedName": "Asset.Accounts Receivable.AccountsReceivable.Debtors", "id": "62", "isBankAccount": false, "modifiedDate": "2023-01-18T11:02:34Z", "name": "Debtors", "nominalCode": "246", "sourceModifiedDate": "2022-12-08T15:42:59Z", "status": "Active", "type": "Asset", "validDatatypeLinks": []}, {"currency": "AED", "currentBalance": -1533.44, "description": "Invoices the business has issued but has not yet collected payment on.", "fullyQualifiedCategory": "Asset.Accounts Receivable.AccountsReceivable", "fullyQualifiedName": "Asset.Accounts Receivable.AccountsReceivable.Debtors - AED", "id": "92", "isBankAccount": false, "modifiedDate": "2023-01-18T11:02:34Z", "name": "Debtors - AED", "nominalCode": "247", "sourceModifiedDate": "2021-02-19T14:04:45Z", "status": "Active", "type": "Asset", "validDatatypeLinks": []}], "totalResults": 234} + QuickBooks Online Sandbox: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/5a7f3597-36e1-4216-86fe-289ad36088a6/data/accounts?page=1&pageSize=2"}, "next": {"href": "/companies/5a7f3597-36e1-4216-86fe-289ad36088a6/data/accounts?page=2&pageSize=2"}, "self": {"href": "/companies/5a7f3597-36e1-4216-86fe-289ad36088a6/data/accounts"}}, "pageNumber": 1, "pageSize": 2, "results": [{"currency": "GBP", "currentBalance": 3041173.77, "description": "Invoices the business has issued but has not yet collected payment on.", "fullyQualifiedCategory": "Asset.Accounts Receivable.AccountsReceivable", "fullyQualifiedName": "Asset.Accounts Receivable.AccountsReceivable.Debtors", "id": "70", "isBankAccount": false, "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-26T09:35:55Z", "name": "Debtors", "nominalCode": "610", "sourceModifiedDate": "2023-04-26T01:18:15Z", "status": "Active", "type": "Asset", "validDatatypeLinks": []}, {"currency": "USD", "currentBalance": 54822.37, "description": "Invoices the business has issued but has not yet collected payment on.", "fullyQualifiedCategory": "Asset.Accounts Receivable.AccountsReceivable", "fullyQualifiedName": "Asset.Accounts Receivable.AccountsReceivable.Debtors - USD", "id": "80", "isBankAccount": false, "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-26T09:35:55Z", "name": "Debtors - USD", "nominalCode": "610", "sourceModifiedDate": "2023-04-12T15:10:38Z", "status": "Active", "type": "Asset", "validDatatypeLinks": []}], "totalResults": 186} + Sage 200cloud: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/93c21e2d-049c-4d24-b41b-57e61c30b69e/data/accounts?page=1&pageSize=2"}, "next": {"href": "/companies/93c21e2d-049c-4d24-b41b-57e61c30b69e/data/accounts?page=2&pageSize=2"}, "self": {"href": "/companies/93c21e2d-049c-4d24-b41b-57e61c30b69e/data/accounts"}}, "pageNumber": 1, "pageSize": 2, "results": [{"currency": "USD", "currentBalance": 0, "description": "Bank Account", "fullyQualifiedCategory": "Asset.Bank Account", "fullyQualifiedName": "Asset.Bank Account.Bank Account", "id": "2864", "isBankAccount": false, "metadata": {"isDeleted": true}, "modifiedDate": "2022-10-14T09:35:52Z", "name": "Bank Account", "nominalCode": "1200", "sourceModifiedDate": "2022-10-23T00:00:00Z", "status": "Archived", "type": "Asset", "validDatatypeLinks": []}, {"currency": "USD", "currentBalance": 0, "description": "Bank Current Account", "fullyQualifiedCategory": "Asset.Bank Account", "fullyQualifiedName": "Asset.Bank Account.Bank Current Account", "id": "2368", "isBankAccount": true, "modifiedDate": "2022-10-14T09:35:52Z", "name": "Bank Current Account", "nominalCode": "1200", "sourceModifiedDate": "2020-09-11T13:53:12Z", "status": "Active", "type": "Asset", "validDatatypeLinks": []}], "totalResults": 344} + Sage 50 (UK): + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/cf5f2a47-2990-4221-bae6-0c19c86ac304/data/accounts?page=1&pageSize=2"}, "next": {"href": "/companies/cf5f2a47-2990-4221-bae6-0c19c86ac304/data/accounts?page=2&pageSize=2"}, "self": {"href": "/companies/cf5f2a47-2990-4221-bae6-0c19c86ac304/data/accounts"}}, "pageNumber": 1, "pageSize": 2, "results": [{"currency": "GBP", "currentBalance": 90640.61, "description": "Invoices the business has issued but has not yet collected payment on.", "fullyQualifiedCategory": "Asset.CurrentAssets.Debtors", "fullyQualifiedName": "Asset.CurrentAssets.Debtors.Debtors Control Account", "id": "1100", "isBankAccount": false, "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-30T14:42:44Z", "name": "Debtors Control Account", "nominalCode": "1100", "sourceModifiedDate": "2022-11-25T09:43:54", "status": "Active", "type": "Asset", "validDatatypeLinks": []}, {"currency": "GBP", "currentBalance": 0, "description": "Invoices the business has issued but has not yet collected payment on.", "fullyQualifiedCategory": "Asset.CurrentAssets.Debtors", "fullyQualifiedName": "Asset.CurrentAssets.Debtors.Other Debtors", "id": "1102", "isBankAccount": false, "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-30T14:42:44Z", "name": "Other Debtors", "nominalCode": "1102", "sourceModifiedDate": "2022-11-25T09:43:54", "status": "Active", "type": "Asset", "validDatatypeLinks": []}], "totalResults": 155} + Sage Business Cloud Accounting: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/390083e2-351b-407c-a3be-55081c36c182/data/accounts?page=1&pageSize=2"}, "next": {"href": "/companies/390083e2-351b-407c-a3be-55081c36c182/data/accounts?page=2&pageSize=2"}, "self": {"href": "/companies/390083e2-351b-407c-a3be-55081c36c182/data/accounts"}}, "pageNumber": 1, "pageSize": 2, "results": [{"currency": "GBP", "currentBalance": 49.61, "description": "Invoices the business has issued but has not yet collected payment on.", "fullyQualifiedCategory": "Asset.Bank", "fullyQualifiedName": "Asset.Bank.Abdi Internet Bank", "id": "e5889b459f544926ac5b8e6756df2ad4", "isBankAccount": true, "modifiedDate": "2022-10-24T14:52:53Z", "name": "Abdi Internet Bank", "nominalCode": "1560", "sourceModifiedDate": "2020-01-27T10:53:26Z", "status": "Active", "type": "Asset", "validDatatypeLinks": [{"links": ["Payment.AccountRef.Id", "BillPayment.AccountRef.Id"], "property": "Id"}]}, {"currency": "GBP", "currentBalance": 225830.75, "description": "Invoices the business has issued but has not yet collected payment on.", "fullyQualifiedCategory": "Asset.Bank", "fullyQualifiedName": "Asset.Bank.Abdi Live Test", "id": "b17083bc9b2748b4ab321b024e260eda", "isBankAccount": true, "modifiedDate": "2022-10-24T14:52:53Z", "name": "Abdi Live Test", "nominalCode": "147852", "sourceModifiedDate": "2020-01-28T14:00:20Z", "status": "Active", "type": "Asset", "validDatatypeLinks": [{"links": ["Payment.AccountRef.Id", "BillPayment.AccountRef.Id"], "property": "Id"}]}], "totalResults": 283} + Sage Intacct: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/df02b289-cb16-4964-ac4d-9fd60b04538e/data/accounts?page=1&pageSize=2"}, "next": {"href": "/companies/df02b289-cb16-4964-ac4d-9fd60b04538e/data/accounts?page=2&pageSize=2"}, "self": {"href": "/companies/df02b289-cb16-4964-ac4d-9fd60b04538e/data/accounts"}}, "pageNumber": 1, "pageSize": 2, "results": [{"currency": "GBP", "currentBalance": 0, "description": "Invoices the business has issued but has not yet collected payment on.", "fullyQualifiedCategory": "Assets.Current Assets.Account Receivable, Net of Allowance.Accounts Receivable.Accounts Receivable", "fullyQualifiedName": "Assets.Current Assets.Account Receivable, Net of Allowance.Accounts Receivable.Accounts Receivable.Accounts Receivable", "id": "2", "isBankAccount": false, "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-04T16:31:51Z", "name": "Accounts Receivable", "nominalCode": "12100", "sourceModifiedDate": "2020-01-29T01:42:43", "status": "Active", "type": "Asset", "validDatatypeLinks": []}, {"currency": "GBP", "currentBalance": 0, "description": "Invoices the business has issued but has not yet collected payment on.", "fullyQualifiedCategory": "Assets.Current Assets.Account Receivable, Net of Allowance.Accounts Receivable.Accounts Receivable", "fullyQualifiedName": "Assets.Current Assets.Account Receivable, Net of Allowance.Accounts Receivable.Accounts Receivable.AR - Retainage", "id": "155", "isBankAccount": false, "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-04T16:31:51Z", "name": "AR - Retainage", "nominalCode": "12710", "sourceModifiedDate": "2020-10-15T15:33:15", "status": "Active", "type": "Asset", "validDatatypeLinks": []}], "totalResults": 181} + Wave: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/0b22b59d-b4e5-4c35-b03f-88bbbcb41256/data/accounts?page=1&pageSize=2"}, "next": {"href": "/companies/0b22b59d-b4e5-4c35-b03f-88bbbcb41256/data/accounts?page=2&pageSize=2"}, "self": {"href": "/companies/0b22b59d-b4e5-4c35-b03f-88bbbcb41256/data/accounts"}}, "pageNumber": 1, "pageSize": 2, "results": [{"currency": "GBP", "currentBalance": 0, "description": "Test Balance Sheet", "fullyQualifiedCategory": "Asset.CashAndBank", "fullyQualifiedName": "Asset.CashAndBank.Abdi Bank", "id": "QWNjb3VudDo5MjIzNDE3NjkzMzk3NjA2MzM7QnVzaW5lc3M6ZTI0OGQyZDctMWE5Ni00YTk4LWFkOTEtMDdlMGYyMmNhNmE2", "isBankAccount": true, "modifiedDate": "2022-11-16T18:15:17Z", "name": "Abdi Bank", "nominalCode": "610", "sourceModifiedDate": "2022-10-23T00:00:00Z", "status": "Active", "type": "Asset", "validDatatypeLinks": []}, {"currency": "GBP", "currentBalance": 0, "description": "Cash you haven�t deposited in the bank. Add your bank and credit card accounts to accurately categorize transactions that aren't cash.", "fullyQualifiedCategory": "Asset.CashAndBank", "fullyQualifiedName": "Asset.CashAndBank.Cash on Hand", "id": "QWNjb3VudDo3OTE3NTA1OTcwOTQxNzQ3MTU7QnVzaW5lc3M6ZTI0OGQyZDctMWE5Ni00YTk4LWFkOTEtMDdlMGYyMmNhNmE2", "isBankAccount": true, "modifiedDate": "2022-11-16T18:15:17Z", "name": "Cash on Hand", "nominalCode": "610", "sourceModifiedDate": "2022-10-23T00:00:00Z", "status": "Active", "type": "Asset", "validDatatypeLinks": []}], "totalResults": 85} + Xero: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/5ced9667-a310-443a-a711-958d36377141/data/accounts?page=1&pageSize=2"}, "next": {"href": "/companies/5ced9667-a310-443a-a711-958d36377141/data/accounts?page=2&pageSize=2"}, "self": {"href": "/companies/5ced9667-a310-443a-a711-958d36377141/data/accounts"}}, "pageNumber": 1, "pageSize": 2, "results": [{"currency": "GBP", "currentBalance": 924.25, "description": "Invoices the business has issued but has not yet collected payment on.", "fullyQualifiedCategory": "Asset.Bank", "fullyQualifiedName": "Asset.Bank.Business Bank Account", "id": "bd9e85e0-0478-433d-ae9f-0b3c4f04bfe4", "isBankAccount": true, "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-15T20:35:08Z", "name": "Business Bank Account", "nominalCode": "A090", "sourceModifiedDate": "2023-02-17T11:10:49", "status": "Active", "type": "Asset", "validDatatypeLinks": [{"links": ["Payment.AccountRef.Id", "BillPayment.AccountRef.Id", "DirectIncome.LineItems.AccountRef.Id", "DirectCost.LineItems.AccountRef.Id"], "property": "Id"}]}, {"currency": "GBP", "currentBalance": 0, "description": "Invoices the business has issued but has not yet collected payment on.", "fullyQualifiedCategory": "Asset.Bank", "fullyQualifiedName": "Asset.Bank.Business Savings Account", "id": "a8d6fb1a-8c5d-4683-90ce-bf9d28fc62ba", "isBankAccount": true, "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-15T20:35:08Z", "name": "Business Savings Account", "nominalCode": "A091", "sourceModifiedDate": "2023-02-17T11:10:49", "status": "Active", "type": "Asset", "validDatatypeLinks": [{"links": ["Payment.AccountRef.Id", "BillPayment.AccountRef.Id", "DirectIncome.LineItems.AccountRef.Id", "DirectCost.LineItems.AccountRef.Id"], "property": "Id"}]}], "totalResults": 90} + Zoho Books: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/d0b68840-db50-4bc3-b88c-96e225333fea/data/accounts?page=1&pageSize=2"}, "next": {"href": "/companies/d0b68840-db50-4bc3-b88c-96e225333fea/data/accounts?page=2&pageSize=2"}, "self": {"href": "/companies/d0b68840-db50-4bc3-b88c-96e225333fea/data/accounts"}}, "pageNumber": 1, "pageSize": 2, "results": [{"currency": "GBP", "currentBalance": -959.64, "description": "The money that customers owe you becomes the accounts receivable. A good example of this is a payment expected from an invoice sent to your customer.", "fullyQualifiedCategory": "Asset.accounts_receivable", "fullyQualifiedName": "Asset.accounts_receivable.Accounts Receivable", "id": "104957000000000352", "isBankAccount": false, "modifiedDate": "2022-10-03T08:40:43Z", "name": "Accounts Receivable", "nominalCode": "", "sourceModifiedDate": "2020-02-05T14:58:44", "status": "Active", "type": "Asset", "validDatatypeLinks": []}, {"currency": "GBP", "currentBalance": 69858.44, "description": "", "fullyQualifiedCategory": "Asset.bank", "fullyQualifiedName": "Asset.bank.Abdi Test", "id": "104957000000060010", "isBankAccount": true, "modifiedDate": "2022-10-03T08:40:43Z", "name": "Abdi Test", "nominalCode": "", "sourceModifiedDate": "2020-02-17T12:19:47", "status": "Active", "type": "Asset", "validDatatypeLinks": []}], "totalResults": 68} + Malformed query: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "400": + application/json: {"canBeRetried": "Unknown", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "detailedErrorCode": 0, "error": "Error parsing query - Malformed query.", "service": "ClientsApi", "statusCode": 400} + Unresolved property: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "400": + application/json: {"canBeRetried": "Unknown", "correlationId": "98457fb9956b7f9b4b2fd4f6e23bb5c8", "detailedErrorCode": 0, "error": "Error parsing query - Could not resolve property isCompleted on Dataset", "service": "PullApi", "statusCode": 400} + create-journal-entry: + QuickBooks Desktop: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + query: {} + requestBody: + application/json: {"createdOn": "2023-02-22T19:49:16.052Z", "description": "record level description", "journalLines": [{"accountRef": {"id": "80000019-1671793811", "name": "Office Supplies"}, "currency": "USD", "description": "journalLines.description debit", "netAmount": 23.02, "tracking": {"recordRefs": [{"dataType": "customers", "id": "80000001-1674553252"}]}}, {"accountRef": {"id": "8000001E-1671793811", "name": "Utilities"}, "currency": "USD", "description": "journalLines.description credit", "netAmount": -23.02, "tracking": {"recordRefs": [{"dataType": "trackingCategories", "id": "80000002-1674553271"}]}}], "journalRef": {"id": "12"}, "metadata": {"isDeleted": true}, "modifiedDate": "2022-10-23T00:00:00Z", "postedOn": "2023-02-23T19:49:16.052Z", "recordRef": {"dataType": "bills", "id": "80000002-6722155312"}, "sourceModifiedDate": "2022-10-23T00:00:00Z", "updatedOn": "2023-02-21T19:49:16.052Z"} + responses: + "200": + application/json: {"changes": [{"recordRef": {"dataType": "invoices"}}], "companyId": "8a210b68-6988-11ed-a1eb-0242ac120002", "completedOnUtc": "2022-10-23T00:00:00Z", "dataConnectionKey": "2e9d2c44-f675-40ba-8049-353bfcb5e171", "dataType": "invoices", "pushOperationKey": "1cf021cd-9cf5-4403-a315-211a509a3080", "requestedOnUtc": "2022-10-23T00:00:00Z", "status": "TimedOut", "statusCode": 452224} + "400": {} + Sage Intacct: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + query: {} + requestBody: + application/json: {"createdOn": "2022-10-23T00:00:00Z", "description": "test", "journalLines": [{"accountRef": {"id": "151"}, "currency": "GBP", "description": "line desc 1", "netAmount": 9, "tracking": {"recordRefs": [{"dataType": "trackingCategories"}]}}, {"accountRef": {"id": "154"}, "currency": "GBP", "description": "line desc 2", "netAmount": -9, "tracking": {"recordRefs": [{"dataType": "trackingCategories"}, {"dataType": "trackingCategories"}, {"dataType": "trackingCategories"}]}}], "journalRef": {"id": "207"}, "modifiedDate": "2022-10-23T00:00:00Z", "postedOn": "2023-03-29T00:00:00Z", "recordRef": {"dataType": "transfers"}, "sourceModifiedDate": "2022-10-23T00:00:00Z", "updatedOn": "2022-10-23T00:00:00Z"} + responses: + "200": + application/json: {"changes": [{"recordRef": {"dataType": "journalEntries"}, "type": "Created"}], "companyId": "d7f743a9-1804-4116-8c8a-e606f7e2f66c", "completedOnUtc": "2022-10-23T00:00:00Z", "data": {"createdOn": "2022-10-23T00:00:00Z", "description": "test", "journalLines": [{"accountRef": {"id": "151"}, "currency": "GBP", "description": "line desc 1", "netAmount": 9, "tracking": {"recordRefs": []}}, {"accountRef": {"id": "154"}, "currency": "GBP", "description": "line desc 2", "netAmount": -9, "tracking": {"recordRefs": [{"dataType": "trackingCategories"}]}}], "journalRef": {"id": "207"}, "modifiedDate": "2022-10-23T00:00:00Z", "postedOn": "2023-03-29T00:00:00Z", "recordRef": {"dataType": "transfers"}, "sourceModifiedDate": "2022-10-23T00:00:00Z", "updatedOn": "2022-10-23T00:00:00Z"}, "dataConnectionKey": "fa139396-523a-4a58-bf2b-8da82c8a673f", "dataType": "journalEntries", "pushOperationKey": "b9c1381a-8742-4a45-9dc5-528101dbd0e3", "requestedOnUtc": "2023-03-31T14:53:44.6401039Z", "status": "Pending", "statusCode": 202} + Malformed query: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + query: {} + requestBody: + application/json: {"createdOn": "2022-10-23T00:00:00Z", "journalLines": [{"netAmount": "3254.63", "tracking": {"recordRefs": [{"dataType": "trackingCategories"}, {"dataType": "trackingCategories"}, {"dataType": "trackingCategories"}]}}], "modifiedDate": "2022-10-23T00:00:00Z", "postedOn": "2022-10-23T00:00:00Z", "recordRef": {"dataType": "transfers"}, "sourceModifiedDate": "2022-10-23T00:00:00Z", "updatedOn": "2022-10-23T00:00:00Z"} + responses: + "400": + application/json: {"canBeRetried": "Unknown", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "detailedErrorCode": 0, "error": "Error processing request - not valid.", "service": "PublicApi", "statusCode": 400} + get-create-journalEntry-model: + Dynamics 365 Business Central: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + responses: + "200": + application/json: {"displayName": "JournalEntry", "properties": {"journalRef": {"description": "Reference to the journal in which this journal entry was created", "displayName": "Journal Reference", "required": true, "type": "Object", "validation": {"information": [{"details": "Only General type Journals are allowed", "field": "JournalRef"}], "warnings": []}}, "postedOn": {"description": "The date the entry was posted in the originating system", "displayName": "Posted On", "required": true, "type": "DateTime"}, "description": {"description": "An optional top level description for the journal entry", "displayName": "Description", "required": false, "type": "String"}, "journalLines": {"description": "A collection of detail lines that represent the transactions associated in this entry", "displayName": "Journal Lines", "required": true, "type": "Array", "validation": {"information": [], "warnings": [{"details": "Must contain 2 journal lines", "field": "JournalLines"}]}}}, "required": true, "type": "Object"} + Oracle NetSuite: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + responses: + "200": + application/json: {"displayName": "JournalEntry", "properties": {"description": {"description": "An optional top level description for the journal entry", "displayName": "Description", "required": false, "type": "String"}, "postedOn": {"description": "The date the entry was posted in the originating system", "displayName": "Posted On", "required": false, "type": "DateTime", "validation": {"information": [{"details": "Defaults to today's date if not specified", "field": "PostedOn"}], "warnings": []}}, "journalLines": {"description": "A collection of detail lines that represent the transactions associated in this entry", "displayName": "Journal Lines", "required": true, "type": "Array"}}, "required": true, "type": "Object"} + QuickBooks Desktop: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + responses: + "200": + application/json: {"displayName": "JournalEntry", "properties": {"postedOn": {"description": "The date the entry was posted in the originating system", "displayName": "Posted On", "required": false, "type": "DateTime"}, "journalLines": {"description": "A collection of detail lines that represent the transactions associated in this entry", "displayName": "Journal Lines", "required": true, "type": "Array"}}, "required": true, "type": "Object"} + QuickBooks Online Sandbox: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + responses: + "200": + application/json: {"displayName": "JournalEntry", "properties": {"postedOn": {"description": "The date the entry was posted in the originating system", "displayName": "Posted On", "required": true, "type": "DateTime"}, "journalLines": {"description": "A collection of detail lines that represent the transactions associated in this entry", "displayName": "Journal Lines", "required": true, "type": "Array", "validation": {"information": [{"details": "There must be at least two lines", "field": "JournalLines"}], "warnings": []}}}, "required": true, "type": "Object", "validation": {"information": [], "warnings": [{"details": "To push a JournalEntry to a French Company in QuickBooks Online, an active JournalCode with type 'Others' or 'Autres' must exist inside the Company"}]}} + QuickBooks Online: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + responses: + "200": + application/json: {"displayName": "JournalEntry", "properties": {"postedOn": {"description": "The date the entry was posted in the originating system", "displayName": "Posted On", "required": true, "type": "DateTime"}, "journalLines": {"description": "A collection of detail lines that represent the transactions associated in this entry", "displayName": "Journal Lines", "required": true, "type": "Array", "validation": {"information": [{"details": "There must be at least two lines", "field": "JournalLines"}], "warnings": []}}}, "required": true, "type": "Object", "validation": {"information": [], "warnings": [{"details": "To push a JournalEntry to a French Company in QuickBooks Online, an active JournalCode with type 'Others' or 'Autres' must exist inside the Company"}]}} + Sage 50 (UK): + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + responses: + "200": + application/json: {"displayName": "JournalEntry", "properties": {"createdOn": {"description": "Date on which the journal was created in Sage50.", "displayName": "Created On", "required": false, "type": "DateTime", "validation": {"information": [{"details": "if empty then Sage 50 will auto generate a created on date", "field": "createdOn"}], "warnings": []}}, "updatedOn": {"description": "Date on which the journal was last updated in Sage50.", "displayName": "Updated On", "required": true, "type": "DateTime", "validation": {"information": [], "warnings": [{"details": "Is not supported and therefore will be ignored", "field": "updatedOn"}]}}, "description": {"description": "Optional description of the journal entry.", "displayName": "Description", "required": false, "type": "String", "validation": {"information": [], "warnings": [{"details": "Is not supported and therefore will be ignored", "field": "description"}]}}, "modifiedDate": {"description": "Date on which the record was last updated via pushes.", "displayName": "Source Modified Date", "required": true, "type": "DateTime", "validation": {"information": [], "warnings": [{"details": "Is not supported and therefore will be ignored", "field": "modifiedDate"}]}}, "sourceModifiedDate": {"description": "Date on which the record was last changed in Sage50.", "displayName": "Source Modified Date", "required": true, "type": "DateTime", "validation": {"information": [], "warnings": [{"details": "Is not supported and therefore will be ignored", "field": "sourceModifiedDate"}]}}, "recordRef": {"description": "Links a journal entry to the underlying record that created it.", "displayName": "Record Reference", "required": false, "type": "Object"}, "dataType": {"description": "Data type of the underlying record that created the journal entry.", "displayName": "Data Type", "required": false, "type": "String", "validation": {"information": [], "warnings": [{"details": "Is not supported and therefore will be ignored", "field": "dataType"}]}}, "journalRef": {"description": "Links journal entries to the relevant journal", "displayName": "Journal Reference", "required": false, "type": "Object"}, "id": {"description": "The reference journal id", "displayName": "Id", "required": false, "type": "String", "validation": {"information": [], "warnings": [{"details": "Is not supported and therefore will be ignored", "field": "id"}]}}, "name": {"description": "The reference journal name", "displayName": "Name", "required": false, "type": "String", "validation": {"information": [], "warnings": [{"details": "Is not supported and therefore will be ignored", "field": "name"}]}}, "journalLines": {"description": "Journal line items of the journal entry.", "displayName": "Journal Lines", "required": true, "type": "Array"}}, "required": true, "type": "Object", "validation": {"information": [{"details": "Pushing to Sage 50 2015 (v21) or below is not supported. To enable push, please upgrade to at least Sage 50 2016 (v22) and re-sync the company."}], "warnings": []}} + Sage Intacct: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + responses: + "200": + application/json: {"displayName": "JournalEntry", "properties": {"postedOn": {"description": "The date the entry was posted in the originating system", "displayName": "Posted On", "required": true, "type": "DateTime"}, "journalRef": {"description": "Reference to the journal in which this journal entry was created", "displayName": "Journal Reference", "required": true, "type": "Object"}, "description": {"description": "An optional top level description for the journal entry", "displayName": "Description", "required": true, "type": "String", "validation": {"information": [], "warnings": [{"details": "Must be no greater than 512 characters", "field": "Description"}]}}, "journalLines": {"description": "A collection of detail lines that represent the transactions associated in this entry", "displayName": "Journal Lines", "required": true, "type": "Array", "validation": {"information": [], "warnings": [{"details": "There must be at least two lines", "field": "JournalLines"}]}}}, "required": true, "type": "Object"} + Sandbox: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + responses: + "200": + application/json: {"displayName": "JournalEntry", "properties": {"description": {"description": "An optional top level description for the journal entry", "displayName": "Description", "required": true, "type": "String"}, "postedOn": {"description": "The date the entry was posted in the originating system", "displayName": "Posted On", "required": true, "type": "DateTime"}, "createdOn": {"description": "The date the entry was created in the originating system", "displayName": "Created On", "required": true, "type": "DateTime"}, "updatedOn": {"description": "The date in which the journal was last updated in the originating system", "displayName": "Updated On", "required": true, "type": "DateTime"}, "journalRef": {"description": "Reference to the journal in which this journal entry was created", "displayName": "Journal Reference", "required": true, "type": "Object"}, "journalLines": {"description": "A collection of detail lines that represent the transactions associated in this entry", "displayName": "Journal Lines", "required": true, "type": "Array"}, "recordRef": {"description": "Reference to the record for which this journal entry was created", "displayName": "Record Reference", "required": true, "type": "Object"}, "metadata": {"description": "Miscellaneous data about the item", "displayName": "Metadata", "required": true, "type": "Object"}}, "required": true, "type": "Object"} + Xero: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + responses: + "200": + application/json: {"displayName": "JournalEntry", "properties": {"postedOn": {"description": "The date the entry was posted in the originating system", "displayName": "Posted On", "required": true, "type": "DateTime", "validation": {"information": [{"details": "If no date is specified, it will default to today's date.", "field": "PostedOn"}], "warnings": []}}, "journalLines": {"description": "A collection of detail lines that represent the transactions associated in this entry", "displayName": "Journal Lines", "required": true, "type": "Array", "validation": {"information": [{"details": "At least 2 must be provided.", "field": "JournalLines"}], "warnings": []}}}, "required": true, "type": "Object"} + Unauthorized: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + responses: + "401": + application/json: {"canBeRetried": "Unknown", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "detailedErrorCode": 0, "error": "Unauthorized", "service": "PublicApi", "statusCode": 401} + create-journal: + Malformed query: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + query: {} + requestBody: + application/json: {"createdOn": "2022-10-23T00:00:00Z"} + responses: + "400": + application/json: {"canBeRetried": "Unknown", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "detailedErrorCode": 0, "error": "Error processing request - not valid.", "service": "PublicApi", "statusCode": 400} + get-journal: + Clear Books: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + journalId: "" + responses: + "200": + application/json: {"createdOn": "2021-12-11T13:04:02", "hasChildren": true, "id": "90bb7784-083b-4bcb-a534-b30756cee65d", "journalCode": "GJ", "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-26T12:38:18Z", "name": "General Journal", "sourceModifiedDate": "2022-07-15T20:19:02", "status": "Active", "type": "General Journal"} + Dynamics 365 Business Central: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + journalId: "" + responses: + "200": + application/json: {"createdOn": "2022-10-23T00:00:00Z", "hasChildren": true, "id": "211317b3-89d1-ea11-bbaa-000d3a2b9185", "journalCode": "ASSETS", "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-27T14:21:10Z", "name": "ASSETS", "sourceModifiedDate": "2023-02-02T10:26:25Z", "status": "Active", "type": "Assets"} + Exact (Netherlands): + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + journalId: "" + responses: + "200": + application/json: {"createdOn": "2019-11-05T14:44:51", "hasChildren": false, "id": "aae31284-e23d-456b-9957-fbf4bcef6c19", "journalCode": "21", "modifiedDate": "2022-10-26T13:31:58Z", "name": "12345678", "sourceModifiedDate": "2020-01-24T11:41:25Z", "status": "Active", "type": "Bank"} + Exact (UK): + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + journalId: "" + responses: + "200": + application/json: {"createdOn": "2021-04-26T16:44:47", "hasChildren": false, "id": "05b9febe-34b3-4836-8277-002294b233a9", "journalCode": "25", "modifiedDate": "2022-10-26T13:33:08Z", "name": "annaBankAccount1", "sourceModifiedDate": "2021-04-26T16:44:47Z", "status": "Active", "type": "Bank"} + Sage Intacct: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + journalId: "" + responses: + "200": + application/json: {"createdOn": "2022-01-17T10:44:23", "hasChildren": false, "id": "207", "journalCode": "AJPT", "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-04T16:31:30Z", "name": "A Journal Push Test", "sourceModifiedDate": "2022-01-17T10:44:23", "status": "Active", "type": ""} + Unauthorized: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + journalId: "" + responses: + "401": + application/json: {"canBeRetried": "Unknown", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "detailedErrorCode": 0, "error": "Unauthorized", "service": "PublicApi", "statusCode": 401} + get-create-journal-model: + Sage Intacct: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + responses: + "200": + application/json: {"displayName": "Journal", "properties": {"name": {"description": "The name of the journal", "displayName": "Name", "required": true, "type": "String", "validation": {"information": [], "warnings": [{"details": "Must be no greater than 40 characters", "field": "Name"}]}}, "journalCode": {"description": "The number or code for the journal", "displayName": "Journal Number", "required": true, "type": "String", "validation": {"information": [], "warnings": [{"details": "Must be no greater than 16 characters", "field": "JournalCode"}]}}, "status": {"description": "The status of the journal", "displayName": "Status", "options": [{"displayName": "Active", "required": false, "type": "String", "value": "Active"}, {"displayName": "Archived", "required": false, "type": "String", "value": "Archived"}], "required": true, "type": "String"}}, "required": true, "type": "Object"} + Sandbox: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + responses: + "200": + application/json: {"displayName": "Journal", "properties": {"journalCode": {"description": "The number or code for the journal", "displayName": "Journal Number", "required": true, "type": "String"}, "name": {"description": "The name of the journal", "displayName": "Name", "required": true, "type": "String"}, "type": {"description": "The type of journal", "displayName": "Type", "required": true, "type": "String"}, "parentId": {"description": "Identifier for the parent journal - empty if journal is the parent", "displayName": "Parent Id", "required": true, "type": "String"}, "hasChildren": {"description": "If a journal has children, the journal is parent of those children journals", "displayName": "Has Children", "required": true, "type": "Boolean"}, "createdOn": {"description": "The date the journal was created in the originating system", "displayName": "Created On", "required": true, "type": "DateTime"}, "status": {"description": "The status of the journal", "displayName": "Status", "required": true, "type": "String"}, "metadata": {"description": "Miscellaneous data about the item", "displayName": "Metadata", "required": true, "type": "Object"}}, "required": true, "type": "Object"} + Unauthorized: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + responses: + "401": + application/json: {"canBeRetried": "Unknown", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "detailedErrorCode": 0, "error": "Unauthorized", "service": "PublicApi", "statusCode": 401} + list-journals: + "": + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/{id}/data/{dataType}?page=1&pageSize=10"}, "self": {"href": "/companies/{id}/data/{dataType}"}}, "pageNumber": 1, "pageSize": 10, "results": [{"createdOn": "2022-10-23T00:00:00Z", "modifiedDate": "2022-10-23T00:00:00Z", "sourceModifiedDate": "2022-10-23T00:00:00Z"}, {"createdOn": "2022-10-23T00:00:00Z", "modifiedDate": "2022-10-23T00:00:00Z", "sourceModifiedDate": "2022-10-23T00:00:00Z"}, {"createdOn": "2022-10-23T00:00:00Z", "modifiedDate": "2022-10-23T00:00:00Z", "sourceModifiedDate": "2022-10-23T00:00:00Z"}], "totalResults": 1} + "400": {} + Clear Books: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/fc72ba08-af13-4474-b28a-01dcfa6cfb51/data/journals?page=1&pageSize=2"}, "next": {"href": "/companies/fc72ba08-af13-4474-b28a-01dcfa6cfb51/data/journals?page=2&pageSize=2"}, "self": {"href": "/companies/fc72ba08-af13-4474-b28a-01dcfa6cfb51/data/journals"}}, "pageNumber": 1, "pageSize": 2, "results": [{"createdOn": "2021-12-11T13:04:02", "hasChildren": true, "id": "90bb7784-083b-4bcb-a534-b30756cee65d", "journalCode": "GJ", "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-26T12:38:18Z", "name": "General Journal", "sourceModifiedDate": "2022-07-15T20:19:02", "status": "Active", "type": "General Journal"}, {"createdOn": "2021-12-11T13:04:02", "hasChildren": false, "id": "07b94827-c0a5-4cc7-ba58-3f9efec3b4b3", "journalCode": "PAY", "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-26T12:38:18Z", "name": "Payroll Journal", "parentId": "90bb7784-083b-4bcb-a534-b30756cee65d", "sourceModifiedDate": "2022-07-24T14:17:02", "status": "Active", "type": "Payroll Journal"}], "totalResults": 4} + Dynamics 365 Business Central: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/fc72ba08-af13-4474-b28a-01dcfa6cfb51/data/journals?page=1&pageSize=2"}, "next": {"href": "/companies/fc72ba08-af13-4474-b28a-01dcfa6cfb51/data/journals?page=2&pageSize=2"}, "self": {"href": "/companies/fc72ba08-af13-4474-b28a-01dcfa6cfb51/data/journals"}}, "pageNumber": 1, "pageSize": 2, "results": [{"createdOn": "2022-10-23T00:00:00Z", "hasChildren": true, "id": "211317b3-89d1-ea11-bbaa-000d3a2b9185", "journalCode": "ASSETS", "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-27T14:21:10Z", "name": "ASSETS", "sourceModifiedDate": "2023-02-02T10:26:25Z", "status": "Active", "type": "Assets"}, {"createdOn": "2022-06-15T10:03:59", "hasChildren": false, "id": "9a94ef78-92ec-ec11-82f9-000d3a8746a9", "journalCode": "BNKDEPOSIT-BNKD", "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-27T14:21:10Z", "name": "BNKD", "parentId": "af7d7e6b-e5c8-ec11-8e7e-000d3a86e04a", "sourceModifiedDate": "2022-06-15T22:45:30Z", "status": "Active", "type": "Bank Deposits"}], "totalResults": 46} + Exact (Netherlands): + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/fc72ba08-af13-4474-b28a-01dcfa6cfb51/data/journals?page=1&pageSize=2"}, "next": {"href": "/companies/fc72ba08-af13-4474-b28a-01dcfa6cfb51/data/journals?page=2&pageSize=2"}, "self": {"href": "/companies/fc72ba08-af13-4474-b28a-01dcfa6cfb51/data/journals"}}, "pageNumber": 1, "pageSize": 2, "results": [{"createdOn": "2019-11-05T14:44:51", "hasChildren": false, "id": "aae31284-e23d-456b-9957-fbf4bcef6c19", "journalCode": "21", "modifiedDate": "2022-10-26T13:31:58Z", "name": "12345678", "sourceModifiedDate": "2020-01-24T11:41:25Z", "status": "Active", "type": "Bank"}, {"createdOn": "2019-11-22T13:35:57", "hasChildren": false, "id": "74677165-1bd3-49b4-87d0-32d974674f86", "journalCode": "23", "modifiedDate": "2022-10-26T13:31:58Z", "name": "Abraham's Billion Dollar stuff", "sourceModifiedDate": "2019-11-22T13:35:57Z", "status": "Active", "type": "Bank"}], "totalResults": 47} + Exact (UK): + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/fc72ba08-af13-4474-b28a-01dcfa6cfb51/data/journals?page=1&pageSize=2"}, "next": {"href": "/companies/fc72ba08-af13-4474-b28a-01dcfa6cfb51/data/journals?page=2&pageSize=2"}, "self": {"href": "/companies/fc72ba08-af13-4474-b28a-01dcfa6cfb51/data/journals"}}, "pageNumber": 1, "pageSize": 2, "results": [{"createdOn": "2021-04-26T16:44:47", "hasChildren": false, "id": "05b9febe-34b3-4836-8277-002294b233a9", "journalCode": "25", "modifiedDate": "2022-10-26T13:33:08Z", "name": "annaBankAccount1", "sourceModifiedDate": "2021-04-26T16:44:47Z", "status": "Active", "type": "Bank"}, {"createdOn": "2021-05-18T10:24:18", "hasChildren": false, "id": "b9c3d6a6-4ce2-4714-9ff6-fb15892300f7", "journalCode": "31", "modifiedDate": "2022-10-26T13:33:08Z", "name": "annaBankAccount10", "sourceModifiedDate": "2021-05-18T10:24:18Z", "status": "Active", "type": "Bank"}], "totalResults": 21} + Sage Intacct: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/fc72ba08-af13-4474-b28a-01dcfa6cfb51/data/journals?page=1&pageSize=2"}, "next": {"href": "/companies/fc72ba08-af13-4474-b28a-01dcfa6cfb51/data/journals?page=2&pageSize=2"}, "self": {"href": "/companies/fc72ba08-af13-4474-b28a-01dcfa6cfb51/data/journals"}}, "pageNumber": 1, "pageSize": 2, "results": [{"createdOn": "2022-01-17T10:44:23", "hasChildren": false, "id": "207", "journalCode": "AJPT", "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-04T16:31:30Z", "name": "A Journal Push Test", "sourceModifiedDate": "2022-01-17T10:44:23", "status": "Active", "type": ""}, {"createdOn": "2022-01-18T15:39:07", "hasChildren": false, "id": "223", "journalCode": "AJPT2", "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-04T16:31:30Z", "name": "A Journal Push Test 2", "sourceModifiedDate": "2022-01-18T15:39:07", "status": "Active", "type": ""}], "totalResults": 1211} + Malformed query: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "400": + application/json: {"canBeRetried": "Unknown", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "detailedErrorCode": 0, "error": "Error parsing query - Malformed query.", "service": "ClientsApi", "statusCode": 400} + Unresolved property: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "400": + application/json: {"canBeRetried": "Unknown", "correlationId": "98457fb9956b7f9b4b2fd4f6e23bb5c8", "detailedErrorCode": 0, "error": "Error parsing query - Could not resolve property isCompleted on Dataset", "service": "PullApi", "statusCode": 400} + create-supplier: + Sage Intacct: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + query: {} + requestBody: + application/json: {"contactName": "Joe Bloggs", "id": "73593", "modifiedDate": "2022-10-23T00:00:00Z", "phone": "(877) 492-8687", "sourceModifiedDate": "2022-10-23T00:00:00Z", "status": "Active", "supplierName": "test 20230420 1004"} + responses: + "200": + application/json: {"changes": [], "companyId": "8a210b68-6988-11ed-a1eb-0242ac120002", "completedOnUtc": "2022-10-23T00:00:00Z", "dataConnectionKey": "2e9d2c44-f675-40ba-8049-353bfcb5e171", "dataType": "invoices", "pushOperationKey": "cf021cd9-cf54-4033-a152-11a509a3080a", "requestedOnUtc": "2022-10-23T00:00:00Z", "status": "Failed", "statusCode": 496323} + "400": {} + Malformed query: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + query: {} + requestBody: + application/json: {"addresses": [{"city": "Bakersfield", "country": "USA", "line1": "Unit 51", "line2": "Bakersfield Industrial Estate", "region": "California", "type": "Billing"}], "contactName": "Kelly's Industrial Supplies", "defaultCurrency": "string", "emailAddress": "sales@kellysupplies.com", "id": "C520FFD4-F6F6-4FC2-A6D2-5D7088B2B14F", "metadata": {"isDeleted": true}, "modifiedDate": "2022-10-23T00:00:00Z", "phone": "07999 999999", "registrationNumber": "string", "sourceModifiedDate": "2022-10-23T00:00:00Z", "status": "Unknown", "supplementalData": {"content": {"property1": {"property1": "", "property2": ""}, "property2": {"property1": "", "property2": ""}}}, "supplierName": "Kelly's Industrial Supplies", "taxNumber": "string"} + responses: + "400": + application/json: {"canBeRetried": "Unknown", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "detailedErrorCode": 0, "error": "Error processing request - not valid.", "service": "PublicApi", "statusCode": 400} + get-supplier: + Clear Books: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + supplierId: "" + responses: + "200": + application/json: {"addresses": [{"city": "Cesarmouth", "country": "United Kingdom", "line1": "Suite 431", "line2": "289 Giles Lake", "postalCode": "BG40 9GP", "region": "Northern Ireland", "type": "Delivery"}], "contactName": "Faye Hansen", "defaultCurrency": "GBP", "emailAddress": "hello@Abshire-Kshlerin.info", "id": "owQ2Gqgj9f", "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-26T12:38:17Z", "phone": "01338 858162", "registrationNumber": "VYL1XZXR", "sourceModifiedDate": "1660-11-28T23:18:00", "status": "Active", "supplierName": "Abshire - Kshlerin", "taxNumber": "1396267523.0914588"} + Dynamics 365 Business Central: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + supplierId: "" + responses: + "200": + application/json: {"addresses": [{"city": "", "country": "GB", "line1": "", "line2": "", "postalCode": "", "region": "", "type": "Billing"}], "contactName": "", "defaultCurrency": "GBP", "emailAddress": "", "id": "78623f13-931e-eb11-bbf8-0022481b3585", "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-27T14:21:12Z", "phone": "", "sourceModifiedDate": "2020-11-04T11:44:22Z", "status": "Active", "supplierName": "", "taxNumber": ""} + Exact (Netherlands): + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + supplierId: "" + responses: + "200": + application/json: {"addresses": [{"city": "Bakersfield", "country": "US", "line1": "Unit 51", "postalCode": "933081", "region": "California", "type": "Billing"}], "contactName": "Kelly's Contact Name", "defaultCurrency": "EUR", "emailAddress": "sales@kellysupplies.com", "id": "3150917c-1d92-4d77-9018-31b5c4758ca9", "modifiedDate": "2022-10-26T13:32:05Z", "phone": "07999 999999", "registrationNumber": "8409314368", "sourceModifiedDate": "2022-07-15T12:01:15Z", "status": "Active", "supplierName": "Abe"} + Exact (UK): + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + supplierId: "" + responses: + "200": + application/json: {"addresses": [{"country": "GB", "type": "Billing"}], "defaultCurrency": "GBP", "id": "0185fea2-0298-445b-909a-0db685118a9e", "modifiedDate": "2022-10-26T13:33:13Z", "phone": "01224 658 999", "sourceModifiedDate": "2017-08-02T10:58:54Z", "status": "Active", "supplierName": "a"} + FreeAgent: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + supplierId: "" + responses: + "200": + application/json: {"addresses": [{"city": "London", "country": "United Kingdom", "line1": "1 Place House", "line2": "", "postalCode": "WC1X 1AH", "type": "Billing"}], "contactName": "Test 1", "id": "11526230", "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-25T14:19:08Z", "phone": "(877) 492-8687", "sourceModifiedDate": "2023-04-17T06:02:46", "status": "Active", "supplierName": "-"} + FreshBooks: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + supplierId: "" + responses: + "200": + application/json: {"addresses": [], "id": "api vendor", "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-24T16:07:25Z", "phone": "(877) 492-8687", "sourceModifiedDate": "2022-10-23T00:00:00Z", "status": "Active", "supplierName": "api vendor"} + KashFlow: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + supplierId: "" + responses: + "200": + application/json: {"addresses": [], "contactName": "", "emailAddress": "", "id": "6202387", "modifiedDate": "2022-09-30T10:29:15Z", "phone": "", "sourceModifiedDate": "2017-05-09T00:00:00", "status": "Unknown", "supplierName": "Dell", "taxNumber": ""} + Oracle NetSuite: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + supplierId: "" + responses: + "200": + application/json: {"addresses": [], "contactName": "Test Vendor", "defaultCurrency": "GBP", "emailAddress": "", "id": "779", "modifiedDate": "2023-01-30T14:47:02Z", "phone": "", "sourceModifiedDate": "2022-02-04T14:24:43", "status": "Active", "supplierName": "Test Vendor"} + QuickBooks Desktop: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + supplierId: "" + responses: + "200": + application/json: {"addresses": [{"city": "Berkeley", "line1": "A Cheung Limited, Angela Cheung", "line2": "3818 Bear Rd. West", "postalCode": "94688", "region": "CA", "type": "Billing"}], "contactName": "Angela Cheung", "defaultCurrency": "GBP", "emailAddress": "AC@CheungLimited.com", "id": "A60000-1197760912", "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-26T09:09:03Z", "phone": "510 555 5723", "sourceModifiedDate": "2023-12-16T05:06:44", "status": "Active", "supplierName": "A Cheung Limited"} + QuickBooks Online: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + supplierId: "" + responses: + "200": + application/json: {"addresses": [{"country": "Djibouti", "line1": "test", "region": "string", "type": "Billing"}], "contactName": "AI Support", "defaultCurrency": "GBP", "id": "41", "modifiedDate": "2023-01-18T11:02:36Z", "phone": "01224 658 999", "sourceModifiedDate": "2022-12-07T10:48:18Z", "status": "Active", "supplierName": "AI Support"} + QuickBooks Online Sandbox: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + supplierId: "" + responses: + "200": + application/json: {"addresses": [{"city": "London", "country": "England", "line1": "100 London Road", "line2": "Angel", "postalCode": "EC1M", "region": "Greater London", "type": "Billing"}], "contactName": "Miss Smith", "defaultCurrency": "GBP", "id": "129", "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-26T09:35:55Z", "phone": "0728 38474", "sourceModifiedDate": "2023-04-13T01:51:08Z", "status": "Active", "supplierName": "Ally Johnson"} + Sage 200cloud: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + supplierId: "" + responses: + "200": + application/json: {"addresses": [{"city": "", "country": "Great Britain", "line1": "", "line2": "", "postalCode": "", "region": "", "type": "Unknown"}], "contactName": "", "defaultCurrency": "GBP", "emailAddress": "", "id": "776", "metadata": {"isDeleted": true}, "modifiedDate": "2022-10-14T09:35:58Z", "phone": "", "sourceModifiedDate": "2022-10-23T00:00:00Z", "status": "Archived", "supplierName": "Aaren", "taxNumber": ""} + Sage 50 (UK): + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + supplierId: "" + responses: + "200": + application/json: {"addresses": [{"city": "Newcastle Upon Tyne", "country": "GB", "line1": "66 New Street", "line2": "Ridgeway", "postalCode": "NE1 4GF", "region": "", "type": "Delivery"}, {"city": "Newcastle upon Tyne", "country": "GB", "line1": "66 New Street", "line2": "Ridgeway", "postalCode": "NE1 4GF", "region": "", "type": "Unknown"}], "contactName": "Mark Ramsay", "defaultCurrency": "GBP", "emailAddress": "newbusinessadvice@sage.com", "id": "CON001", "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-30T14:42:38Z", "phone": "0191 643 4343", "sourceModifiedDate": "2022-11-25T09:43:54Z", "status": "Active", "supplierName": "Concept Stationery Supplies", "taxNumber": "GB988 3453 23"} + Sage Business Cloud Accounting: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + supplierId: "" + responses: + "200": + application/json: {"addresses": [{"country": "United Kingdom (GB)", "type": "Billing"}], "contactName": "Main Contact", "defaultCurrency": "GBP", "id": "65179671e9ef424caff8b9006cd111c8", "modifiedDate": "2022-10-24T14:52:54Z", "phone": "(877) 492-8687", "sourceModifiedDate": "2020-02-25T17:23:33Z", "status": "Active", "supplierName": "5555 Abdul's Test Name"} + Sage Intacct: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + supplierId: "" + responses: + "200": + application/json: {"addresses": [{"city": "Dallas", "country": "United States", "line1": "208 S Akard St", "line2": "", "postalCode": "75265", "region": "TX", "type": "Unknown"}], "contactName": "Jones, William", "defaultCurrency": "USD", "id": "3", "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-04T16:32:20Z", "phone": "214-760-9491", "registrationNumber": "", "sourceModifiedDate": "2023-02-16T09:48:27", "status": "Active", "supplierName": "ADP", "taxNumber": "85-3678274"} + Wave: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + supplierId: "" + responses: + "200": + application/json: {"addresses": [], "contactName": "", "defaultCurrency": "GBP", "emailAddress": "", "id": "QnVzaW5lc3M6ZTI0OGQyZDctMWE5Ni00YTk4LWFkOTEtMDdlMGYyMmNhNmE2O1ZlbmRvcjo2NjA0Nzk0", "modifiedDate": "2022-11-16T18:15:24Z", "phone": "+44 25691 154789", "sourceModifiedDate": "2020-04-07T13:28:02Z", "status": "Active", "supplierName": "Computer Shop"} + Xero: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + supplierId: "" + responses: + "200": + application/json: {"addresses": [], "emailAddress": "", "id": "e4c9d0e2-c285-4e85-b579-6d28b180c730", "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-15T20:36:09Z", "phone": "+44 25691 154789", "sourceModifiedDate": "2023-02-17T18:03:42", "status": "Active", "supplierName": "24 Locks"} + Zoho Books: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + supplierId: "" + responses: + "200": + application/json: {"addresses": [], "defaultCurrency": "GBP", "emailAddress": "", "id": "104957000001494001", "modifiedDate": "2022-10-03T08:40:37Z", "phone": "01224 658 999", "sourceModifiedDate": "2022-09-16T13:09:56", "status": "Active", "supplierName": "Acme Corporation"} + Unauthorized: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + supplierId: "" + responses: + "401": + application/json: {"canBeRetried": "Unknown", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "detailedErrorCode": 0, "error": "Unauthorized", "service": "PublicApi", "statusCode": 401} + get-create-update-supplier-model: + Exact (Netherlands): + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + responses: + "200": + application/json: {"description": "A Supplier is a person or organisation that provides a product or service", "displayName": "Supplier", "properties": {"supplierName": {"description": "The name for the supplier, typically a company name", "displayName": "Supplier Name", "required": true, "type": "String"}, "emailAddress": {"description": "The preferred email address the supplier should be contacted on", "displayName": "Email Address", "required": false, "type": "String"}, "phone": {"description": "The preferred phone number the supplier should be contacted on", "displayName": "Phone", "required": false, "type": "String"}, "defaultCurrency": {"description": "The default currency for transactions recorded against the supplier", "displayName": "Default Currency", "required": false, "type": "String"}, "registrationNumber": {"description": "The supplier's registration number", "displayName": "Registration Number", "required": false, "type": "String", "validation": {"information": [], "warnings": [{"details": "Only for Exact Netherlands, if provided, must be exactly 20 characters in length", "field": "RegistrationNumber"}]}}, "taxNumber": {"description": "The supplier's tax number", "displayName": "Tax Number", "required": false, "type": "String"}, "contactName": {"description": "The name of the main contact for the supplier", "displayName": "Contact Name", "required": false, "type": "String"}, "addresses": {"description": "A collection of addresses associated to the supplier", "displayName": "Addresses", "required": false, "type": "Array", "validation": {"information": [{"details": "Only the first address provided will be considered, all other entries will be not be recorded", "field": "Addresses"}], "warnings": []}}}, "required": true, "type": "Object"} + Exact (UK): + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + responses: + "200": + application/json: {"description": "A Supplier is a person or organisation that provides a product or service", "displayName": "Supplier", "properties": {"supplierName": {"description": "The name for the supplier, typically a company name", "displayName": "Supplier Name", "required": true, "type": "String"}, "emailAddress": {"description": "The preferred email address the supplier should be contacted on", "displayName": "Email Address", "required": false, "type": "String"}, "phone": {"description": "The preferred phone number the supplier should be contacted on", "displayName": "Phone", "required": false, "type": "String"}, "defaultCurrency": {"description": "The default currency for transactions recorded against the supplier", "displayName": "Default Currency", "required": false, "type": "String"}, "registrationNumber": {"description": "The supplier's registration number", "displayName": "Registration Number", "required": false, "type": "String", "validation": {"information": [], "warnings": [{"details": "Only for Exact Netherlands, if provided, must be exactly 20 characters in length", "field": "RegistrationNumber"}]}}, "taxNumber": {"description": "The supplier's tax number", "displayName": "Tax Number", "required": false, "type": "String"}, "contactName": {"description": "The name of the main contact for the supplier", "displayName": "Contact Name", "required": false, "type": "String"}, "addresses": {"description": "A collection of addresses associated to the supplier", "displayName": "Addresses", "required": false, "type": "Array", "validation": {"information": [{"details": "Only the first address provided will be considered, all other entries will be not be recorded", "field": "Addresses"}], "warnings": []}}}, "required": true, "type": "Object"} + FreeAgent: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + responses: + "200": + application/json: {"description": "A Supplier is a person or organisation that provides a product or service", "displayName": "Supplier", "properties": {"supplierName": {"description": "The name for the supplier, typically a company name", "displayName": "Supplier Name", "required": true, "type": "String"}, "status": {"description": "The current state of the supplier", "displayName": "Supplier Status", "options": [{"displayName": "Active", "required": false, "type": "String", "value": "Active"}, {"displayName": "Archived", "required": false, "type": "String", "value": "Archived"}], "required": true, "type": "String"}, "addresses": {"description": "A collection of addresses associated to the supplier", "displayName": "Addresses", "required": false, "type": "Array", "validation": {"information": [{"details": "Only one address may be specified", "field": "Addresses"}], "warnings": []}}, "contactName": {"description": "The name of the main contact for the supplier", "displayName": "Contact Name", "required": false, "type": "String"}, "emailAddress": {"description": "The preferred email address the supplier should be contacted on", "displayName": "Email Address", "required": false, "type": "String"}, "taxNumber": {"description": "The supplier's tax number", "displayName": "Tax Number", "required": false, "type": "String"}}, "required": true, "type": "Object"} + MYOB AccountRight and Essentials: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + responses: + "200": + application/json: {"description": "A Supplier is a person or organisation that provides a product or service", "displayName": "Supplier", "properties": {"supplierName": {"description": "The name for the supplier, typically a company name", "displayName": "Supplier Name", "required": true, "type": "String", "validation": {"information": [{"details": "Must be provided and must contain a First and Last name separated by a ' '(space).", "field": "SupplierName"}], "warnings": [{"details": "Must not have the part after the first name longer than 30 characters.", "field": "SupplierName"}, {"details": "Must not have its first part (i.e. the first name) longer than 20 characters.", "field": "SupplierName"}]}}, "emailAddress": {"description": "The preferred email address the supplier should be contacted on", "displayName": "Email Address", "required": false, "type": "String", "validation": {"information": [{"details": "Must not be longer than 255 characters.", "field": "EmailAddress"}], "warnings": []}}, "phone": {"description": "The preferred phone number the supplier should be contacted on", "displayName": "Phone", "required": false, "type": "String", "validation": {"information": [{"details": "Must not be longer than 21 characters.", "field": "Phone"}], "warnings": []}}, "taxNumber": {"description": "The supplier's tax number", "displayName": "Tax Number", "required": false, "type": "String", "validation": {"information": [{"details": "Must not be longer than 19 characters.", "field": "TaxNumber"}], "warnings": []}}, "registrationNumber": {"description": "The supplier's registration number", "displayName": "Registration Number", "required": false, "type": "String", "validation": {"information": [{"details": "Must not be longer than 14 characters.", "field": "RegistrationNumber"}], "warnings": []}}, "status": {"description": "The current state of the supplier", "displayName": "Supplier Status", "options": [{"required": false, "type": "String", "value": "Active"}, {"required": false, "type": "String", "value": "Unknown"}], "required": true, "type": "String", "validation": {"information": [{"details": "Must be provided.", "field": "Status"}], "warnings": []}}, "addresses": {"description": "A collection of addresses associated to the supplier", "displayName": "Addresses", "required": true, "type": "Array", "validation": {"information": [{"details": "Must be provided.", "field": "Addresses"}], "warnings": [{"details": "Must only have 5 address entries at most.", "field": "Addresses"}]}}}, "required": true, "type": "Object"} + Oracle NetSuite: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + responses: + "200": + application/json: {"description": "A Supplier is a person or organisation that provides a product or service", "displayName": "Supplier", "properties": {"supplierName": {"description": "The name for the supplier, typically a company name", "displayName": "Supplier Name", "required": true, "type": "String"}, "emailAddress": {"description": "The preferred email address the supplier should be contacted on", "displayName": "Email Address", "required": false, "type": "String"}, "defaultCurrency": {"description": "The default currency for transactions recorded against the supplier", "displayName": "Default Currency", "required": false, "type": "String"}, "phone": {"description": "The preferred phone number the supplier should be contacted on", "displayName": "Phone", "required": false, "type": "String"}, "taxNumber": {"description": "The supplier's tax number", "displayName": "Tax Number", "required": false, "type": "String"}, "status": {"description": "The current state of the supplier", "displayName": "Supplier Status", "options": [{"displayName": "Active", "required": false, "type": "String", "value": "Active"}, {"displayName": "Archived", "required": false, "type": "String", "value": "Archived"}], "required": true, "type": "String"}, "addresses": {"description": "A collection of addresses associated to the supplier", "displayName": "Addresses", "required": false, "type": "Array", "validation": {"information": [{"details": "Multiple addresses of Unknown type may be provided", "field": "Addresses"}], "warnings": [{"details": "Only one each of Billing and Delivery addresses can be provided", "field": "Addresses"}]}}}, "required": true, "type": "Object"} + QuickBooks Desktop: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + responses: + "200": + application/json: {"description": "A Supplier is a person or organisation that provides a product or service", "displayName": "Supplier", "properties": {"supplierName": {"description": "The name for the supplier, typically a company name", "displayName": "Supplier Name", "required": true, "type": "String", "validation": {"information": [], "warnings": [{"details": "Max length of 41 characters.", "field": "SupplierName"}]}}, "contactName": {"description": "The name of the main contact for the supplier", "displayName": "Contact Name", "required": false, "type": "String", "validation": {"information": [], "warnings": [{"details": "Max length of 25 characters for first and last names", "field": "ContactName"}]}}, "phone": {"description": "The preferred phone number the supplier should be contacted on", "displayName": "Phone", "required": false, "type": "String"}, "emailAddress": {"description": "The preferred email address the supplier should be contacted on", "displayName": "Email Address", "required": false, "type": "String"}, "registrationNumber": {"description": "The supplier's registration number", "displayName": "Registration Number", "required": false, "type": "String"}, "taxNumber": {"description": "The supplier's tax number", "displayName": "Tax Number", "required": false, "type": "String", "validation": {"information": [], "warnings": [{"details": "Max length of 30 characters.", "field": "TaxNumber"}]}}, "defaultCurrency": {"description": "The default currency for transactions recorded against the supplier", "displayName": "Default Currency", "required": false, "type": "String", "validation": {"information": [{"details": "If not set, will default to the base currency of the QuickBooks Desktop company", "field": "DefaultCurrency"}], "warnings": [{"details": "Must be a three letter ISO code that matches an existing, active currency in the QuickBooks Desktop company", "field": "DefaultCurrency"}, {"details": "Can only be set if Multicurrency is enabled within the QuickBooks Desktop company", "field": "DefaultCurrency"}]}}, "status": {"description": "The current state of the supplier", "displayName": "Supplier Status", "options": [{"displayName": "Active", "required": false, "type": "String", "value": "Active"}, {"displayName": "Archived", "required": false, "type": "String", "value": "Archived"}], "required": true, "type": "String"}, "addresses": {"description": "A collection of addresses associated to the supplier", "displayName": "Addresses", "required": false, "type": "Array"}}, "required": true, "type": "Object"} + QuickBooks Online Sandbox: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + responses: + "200": + application/json: {"description": "A Supplier is a person or organisation that provides a product or service", "displayName": "Supplier", "properties": {"supplierName": {"description": "The name for the supplier, typically a company name", "displayName": "Supplier Name", "required": true, "type": "String"}, "phone": {"description": "The preferred phone number the supplier should be contacted on", "displayName": "Phone", "required": false, "type": "String", "validation": {"information": [], "warnings": [{"details": "Country, area, and number are space separated", "field": "Phone"}]}}, "emailAddress": {"description": "The preferred email address the supplier should be contacted on", "displayName": "Email Address", "required": false, "type": "String"}, "registrationNumber": {"description": "The supplier's registration number", "displayName": "Registration Number", "required": false, "type": "String"}, "taxNumber": {"description": "The supplier's tax number", "displayName": "Tax Number", "required": false, "type": "String"}, "status": {"description": "The current state of the supplier", "displayName": "Supplier Status", "options": [{"displayName": "Active", "required": false, "type": "String", "value": "Active"}, {"displayName": "Archived", "required": false, "type": "String", "value": "Archived"}], "required": true, "type": "String"}, "addresses": {"description": "A collection of addresses associated to the supplier", "displayName": "Addresses", "required": false, "type": "Array"}, "defaultCurrency": {"description": "The default currency for transactions recorded against the supplier", "displayName": "Default Currency", "required": false, "type": "String"}}, "required": true, "type": "Object"} + QuickBooks Online: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + responses: + "200": + application/json: {"description": "A Supplier is a person or organisation that provides a product or service", "displayName": "Supplier", "properties": {"supplierName": {"description": "The name for the supplier, typically a company name", "displayName": "Supplier Name", "required": true, "type": "String"}, "phone": {"description": "The preferred phone number the supplier should be contacted on", "displayName": "Phone", "required": false, "type": "String", "validation": {"information": [], "warnings": [{"details": "Country, area, and number are space separated", "field": "Phone"}]}}, "emailAddress": {"description": "The preferred email address the supplier should be contacted on", "displayName": "Email Address", "required": false, "type": "String"}, "registrationNumber": {"description": "The supplier's registration number", "displayName": "Registration Number", "required": false, "type": "String"}, "taxNumber": {"description": "The supplier's tax number", "displayName": "Tax Number", "required": false, "type": "String"}, "status": {"description": "The current state of the supplier", "displayName": "Supplier Status", "options": [{"displayName": "Active", "required": false, "type": "String", "value": "Active"}, {"displayName": "Archived", "required": false, "type": "String", "value": "Archived"}], "required": true, "type": "String"}, "addresses": {"description": "A collection of addresses associated to the supplier", "displayName": "Addresses", "required": false, "type": "Array"}, "defaultCurrency": {"description": "The default currency for transactions recorded against the supplier", "displayName": "Default Currency", "required": false, "type": "String"}}, "required": true, "type": "Object"} + Sage 50 (UK): + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + responses: + "200": + application/json: {"description": "A Supplier is a person or organisation that provides a product or service", "displayName": "Supplier", "properties": {"id": {"description": "ID of the supplier.", "displayName": "Id", "required": true, "type": "String", "validation": {"information": [{"details": "The supplier ID must be all Uppercase, if it is not, it will be converted to Uppercase before pushing.", "field": "id"}], "warnings": [{"details": "The supplier ID must be unique, contain no spaces and have a maximum of 8 characters.", "field": "id"}]}}, "supplierName": {"description": "Name of the supplier.", "displayName": "Name", "required": true, "type": "String", "validation": {"information": [], "warnings": [{"details": "The supplier name can have a maximum of 60 characters", "field": "supplierName"}]}}, "contactName": {"description": "The name of the main contact for the supplier.", "displayName": "Contact Name", "required": false, "type": "String", "validation": {"information": [], "warnings": [{"details": "The contact name can have a maximum of 30 characters", "field": "contactName"}]}}, "emailAddress": {"description": "The email address that the supplier may be contacted on.", "displayName": "Email Address", "required": false, "type": "String"}, "phone": {"description": "The telephone number that the supplier may be contacted on.", "displayName": "Telephone", "required": false, "type": "String"}, "defaultCurrency": {"description": "If not provided, the currency will default to the company's base currency.", "displayName": "Default Currency", "required": false, "type": "String"}, "status": {"description": "The status of the supplier.", "displayName": "Status", "options": [{"displayName": "Active Status", "required": false, "type": "String", "value": "Active"}], "required": false, "type": "String"}, "addresses": {"description": "Contact addresses for the supplier.", "displayName": "Addresses", "required": false, "type": "Array", "validation": {"information": [], "warnings": [{"details": "Only one address can be included in the Addresses array.", "field": "addresses"}]}}, "taxNumber": {"description": "Legal company registration identifier.", "displayName": "Tax Number", "required": false, "type": "String"}}, "required": true, "type": "Object", "validation": {"information": [{"details": "Pushing to Sage 50 2015 (v21) or below is not supported. To enable push, please upgrade to at least Sage 50 2016 (v22) and re-sync the company."}], "warnings": []}} + Sage Business Cloud Accounting: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + responses: + "200": + application/json: {"description": "A Supplier is a person or organisation that provides a product or service", "displayName": "Supplier", "properties": {"supplierName": {"description": "The name for the supplier, typically a company name", "displayName": "Supplier Name", "required": true, "type": "String"}, "contactName": {"description": "The name of the main contact for the supplier", "displayName": "Contact Name", "required": false, "type": "String"}, "emailAddress": {"description": "The preferred email address the supplier should be contacted on", "displayName": "Email Address", "required": false, "type": "String"}, "phone": {"description": "The preferred phone number the supplier should be contacted on", "displayName": "Phone", "required": false, "type": "String"}, "taxNumber": {"description": "The supplier's tax number", "displayName": "Tax Number", "required": false, "type": "String"}, "addresses": {"description": "A collection of addresses associated to the supplier", "displayName": "Addresses", "required": false, "type": "Array", "validation": {"information": [{"details": "Can contain a maximum of one address", "field": "Addresses"}], "warnings": []}}}, "required": true, "type": "Object"} + Sage Intacct: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + responses: + "200": + application/json: {"description": "A Supplier is a person or organisation that provides a product or service", "displayName": "Supplier", "properties": {"supplierName": {"description": "The name for the supplier, typically a company name", "displayName": "Supplier Name", "required": true, "type": "String", "validation": {"information": [], "warnings": [{"details": "Must be between 1 and 100 characters", "field": "SupplierName"}]}}, "contactName": {"description": "The name of the main contact for the supplier", "displayName": "Contact Name", "required": true, "type": "String", "validation": {"information": [], "warnings": [{"details": "Must be between 1 and 200 characters", "field": "ContactName"}]}}, "status": {"description": "The current state of the supplier", "displayName": "Supplier Status", "options": [{"displayName": "Active", "required": false, "type": "String", "value": "Active"}, {"displayName": "Archived", "required": false, "type": "String", "value": "Archived"}], "required": true, "type": "String"}, "phone": {"description": "The preferred phone number the supplier should be contacted on", "displayName": "Phone", "required": false, "type": "String", "validation": {"information": [], "warnings": [{"details": "Must be no greater than 30 characters", "field": "Phone"}]}}, "emailAddress": {"description": "The preferred email address the supplier should be contacted on", "displayName": "Email Address", "required": false, "type": "String", "validation": {"information": [], "warnings": [{"details": "Must be no greater than 200 characters", "field": "EmailAddress"}]}}, "taxNumber": {"description": "The supplier's tax number", "displayName": "Tax Number", "required": false, "type": "String", "validation": {"information": [], "warnings": [{"details": "Must be no greater than 20 characters", "field": "TaxNumber"}]}}, "registrationNumber": {"description": "The supplier's registration number", "displayName": "Registration Number", "required": false, "type": "String", "validation": {"information": [], "warnings": [{"details": "Must be no greater than 100 characters", "field": "RegistrationNumber"}]}}, "defaultCurrency": {"description": "The default currency for transactions recorded against the supplier", "displayName": "Default Currency", "options": [{"displayName": "Australian Dollar", "required": false, "type": "String", "value": "AUD"}, {"displayName": "Canadian Dollar", "required": false, "type": "String", "value": "CAD"}, {"displayName": "Pound Sterling", "required": false, "type": "String", "value": "GBP"}, {"displayName": "US Dollar", "required": false, "type": "String", "value": "USD"}, {"displayName": "Rand", "required": false, "type": "String", "value": "ZAR"}], "required": false, "type": "String"}, "addresses": {"description": "A collection of addresses associated to the supplier", "displayName": "Addresses", "required": false, "type": "Array", "validation": {"information": [], "warnings": [{"details": "If supplied, must contain only 1 address", "field": "Addresses"}, {"details": "If TaxNumber is supplied, an Address with a Country is required", "field": "Addresses"}]}}}, "required": true, "type": "Object"} + Sandbox: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + responses: + "200": + application/json: {"description": "A Supplier is a person or organisation that provides a product or service", "displayName": "Supplier", "properties": {"supplierName": {"description": "The name for the supplier, typically a company name", "displayName": "Supplier Name", "required": true, "type": "String"}, "contactName": {"description": "The name of the main contact for the supplier", "displayName": "Contact Name", "required": true, "type": "String"}, "emailAddress": {"description": "The preferred email address the supplier should be contacted on", "displayName": "Email Address", "required": true, "type": "String"}, "phone": {"description": "The preferred phone number the supplier should be contacted on", "displayName": "Phone", "required": true, "type": "String"}, "addresses": {"description": "A collection of addresses associated to the supplier", "displayName": "Addresses", "required": true, "type": "Array"}, "registrationNumber": {"description": "The supplier's registration number", "displayName": "Registration Number", "required": true, "type": "String"}, "taxNumber": {"description": "The supplier's tax number", "displayName": "Tax Number", "required": true, "type": "String"}, "status": {"description": "The current state of the supplier", "displayName": "Supplier Status", "required": true, "type": "String"}, "defaultCurrency": {"description": "The default currency for transactions recorded against the supplier", "displayName": "Default Currency", "required": true, "type": "String"}, "metadata": {"description": "Miscellaneous data about the item", "displayName": "Metadata", "required": true, "type": "Object"}}, "required": true, "type": "Object"} + Xero: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + responses: + "200": + application/json: {"description": "An accounts payable contact that supplies good or services, also referred to as a vendor.", "displayName": "Suppliers", "properties": {"supplierName": {"description": "Name of the supplier.", "displayName": "Name", "required": true, "type": "String"}, "phone": {"description": "Main contact phone number for the supplier.", "displayName": "Phone", "required": false, "type": "String", "validation": {"information": [], "warnings": [{"details": "Country, area, and number are space separated", "field": "phone"}]}}, "emailAddress": {"description": "Main contact email for the supplier.", "displayName": "Email", "required": false, "type": "String"}, "registrationNumber": {"description": "Legal company registration identifier.", "displayName": "Registration Number", "required": false, "type": "String", "validation": {"information": [], "warnings": [{"details": "Max length of 50 characters", "field": "registrationNumber"}]}}, "taxNumber": {"description": "Legal tax registration identifier.", "displayName": "Tax Number", "required": false, "type": "String"}, "status": {"description": "Status of the supplier account.", "displayName": "Status", "options": [{"displayName": "Active", "required": false, "type": "String", "value": "Active"}, {"displayName": "Inactive", "required": false, "type": "String", "value": "InActive"}], "required": false, "type": "String"}, "addresses": {"description": "Contact addresses for the supplier.", "displayName": "Addresses", "required": false, "type": "Array"}}, "required": true, "type": "Object"} + Unauthorized: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + responses: + "401": + application/json: {"canBeRetried": "Unknown", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "detailedErrorCode": 0, "error": "Unauthorized", "service": "PublicApi", "statusCode": 401} + list-suppliers: + "": + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/{id}/data/{dataType}?page=1&pageSize=10"}, "self": {"href": "/companies/{id}/data/{dataType}"}}, "pageNumber": 1, "pageSize": 10, "results": [{"addresses": [{"city": "Bakersfield", "country": "USA", "line1": "Unit 51", "line2": "Bakersfield Industrial Estate", "region": "California", "type": "Billing"}], "contactName": "Kelly's Industrial Supplies", "defaultCurrency": "string", "emailAddress": "sales@kellysupplies.com", "id": "C520FFD4-F6F6-4FC2-A6D2-5D7088B2B14F", "metadata": {"isDeleted": true}, "modifiedDate": "2022-10-23T00:00:00Z", "phone": "07999 999999", "registrationNumber": "string", "sourceModifiedDate": "2022-10-23T00:00:00Z", "status": "Unknown", "supplementalData": {"content": {"property1": {"property1": "", "property2": ""}, "property2": {"property1": "", "property2": ""}}}, "supplierName": "Kelly's Industrial Supplies", "taxNumber": "string"}], "totalResults": 1} + "400": {} + Clear Books: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/354a121b-855f-4d25-90ad-0905b498c1c0/data/suppliers?page=1&pageSize=2"}, "next": {"href": "/companies/354a121b-855f-4d25-90ad-0905b498c1c0/data/suppliers?page=2&pageSize=2"}, "self": {"href": "/companies/354a121b-855f-4d25-90ad-0905b498c1c0/data/suppliers"}}, "pageNumber": 1, "pageSize": 2, "results": [{"addresses": [{"city": "Cesarmouth", "country": "United Kingdom", "line1": "Suite 431", "line2": "289 Giles Lake", "postalCode": "BG40 9GP", "region": "Northern Ireland", "type": "Delivery"}], "contactName": "Faye Hansen", "defaultCurrency": "GBP", "emailAddress": "hello@Abshire-Kshlerin.info", "id": "owQ2Gqgj9f", "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-26T12:38:17Z", "phone": "01338 858162", "registrationNumber": "VYL1XZXR", "sourceModifiedDate": "1660-11-28T23:18:00", "status": "Active", "supplierName": "Abshire - Kshlerin", "taxNumber": "1396267523.0914588"}, {"addresses": [{"city": "Fernandohaven", "country": "United Kingdom", "line1": "Suite 214", "line2": "8439 Lueilwitz Passage", "postalCode": "JG04 7PV", "region": "Northern Ireland", "type": "Delivery"}, {"city": "Juliochester", "country": "United Kingdom", "line1": "Suite 096", "line2": "864 Halie Course", "postalCode": "DZ8 4BF", "region": "England", "type": "Delivery"}, {"city": "Naderborough", "country": "United Kingdom", "line1": "Suite 001", "line2": "416 Stokes Fords", "postalCode": "XG25 0XX", "region": "Wales", "type": "Delivery"}], "contactName": "Werner Langworth", "defaultCurrency": "GBP", "emailAddress": "Arjun34@hotmail.com", "id": "FyUkHbZxhn", "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-26T12:38:17Z", "phone": "0116 796 3163", "registrationNumber": "NI7JEJVM", "sourceModifiedDate": "0177-04-27T11:56:00", "status": "Active", "supplierName": "Arjun Kuvalis", "taxNumber": "7505220209.583549"}], "totalResults": 100} + Dynamics 365 Business Central: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/d6849caf-c146-41be-8335-b73346e3bd84/data/suppliers?page=1&pageSize=2"}, "next": {"href": "/companies/d6849caf-c146-41be-8335-b73346e3bd84/data/suppliers?page=2&pageSize=2"}, "self": {"href": "/companies/d6849caf-c146-41be-8335-b73346e3bd84/data/suppliers"}}, "pageNumber": 1, "pageSize": 2, "results": [{"addresses": [{"city": "", "country": "GB", "line1": "", "line2": "", "postalCode": "", "region": "", "type": "Billing"}], "contactName": "", "defaultCurrency": "GBP", "emailAddress": "", "id": "78623f13-931e-eb11-bbf8-0022481b3585", "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-27T14:21:12Z", "phone": "", "sourceModifiedDate": "2020-11-04T11:44:22Z", "status": "Active", "supplierName": "", "taxNumber": ""}, {"addresses": [{"city": "", "country": "GB", "line1": "", "line2": "", "postalCode": "", "region": "", "type": "Billing"}], "contactName": "", "defaultCurrency": "GBP", "emailAddress": "", "id": "be49ec62-6754-ed11-946f-0022481b67d1", "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-27T14:21:12Z", "phone": "", "sourceModifiedDate": "2022-10-25T13:17:36Z", "status": "Active", "supplierName": "", "taxNumber": ""}], "totalResults": 31} + Exact (Netherlands): + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/b83b1923-4db6-45a8-a779-b4e320c15979/data/suppliers?page=1&pageSize=2"}, "next": {"href": "/companies/b83b1923-4db6-45a8-a779-b4e320c15979/data/suppliers?page=2&pageSize=2"}, "self": {"href": "/companies/b83b1923-4db6-45a8-a779-b4e320c15979/data/suppliers"}}, "pageNumber": 1, "pageSize": 2, "results": [{"addresses": [{"city": "Bakersfield", "country": "US", "line1": "Unit 51", "postalCode": "933081", "region": "California", "type": "Billing"}], "contactName": "Kelly's Contact Name", "defaultCurrency": "EUR", "emailAddress": "sales@kellysupplies.com", "id": "3150917c-1d92-4d77-9018-31b5c4758ca9", "modifiedDate": "2022-10-26T13:32:05Z", "phone": "07999 999999", "registrationNumber": "8409314368", "sourceModifiedDate": "2022-07-15T12:01:15Z", "status": "Active", "supplierName": "Abe"}, {"addresses": [{"city": "city", "country": "RU", "line1": "line1", "line2": "line2", "postalCode": "postal", "region": "region", "type": "Billing"}], "contactName": "Ann's contact name", "defaultCurrency": "USD", "emailAddress": "anna@anna888888.com", "id": "00014c12-2616-481a-a2e8-31bdf2497775", "modifiedDate": "2022-10-26T13:32:05Z", "phone": "55555555", "registrationNumber": "55566677788899944455", "sourceModifiedDate": "2021-06-09T12:04:08Z", "status": "Active", "supplierName": "Ann's test supplier 2", "taxNumber": "RU4444444"}], "totalResults": 73} + Exact (UK): + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/d95030cd-22b2-482b-9c7b-2980dcc2b1ce/data/suppliers?page=1&pageSize=2"}, "next": {"href": "/companies/d95030cd-22b2-482b-9c7b-2980dcc2b1ce/data/suppliers?page=2&pageSize=2"}, "self": {"href": "/companies/d95030cd-22b2-482b-9c7b-2980dcc2b1ce/data/suppliers"}}, "pageNumber": 1, "pageSize": 2, "results": [{"addresses": [{"country": "GB", "type": "Billing"}], "defaultCurrency": "GBP", "id": "0185fea2-0298-445b-909a-0db685118a9e", "modifiedDate": "2022-10-26T13:33:13Z", "phone": "01224 658 999", "sourceModifiedDate": "2017-08-02T10:58:54Z", "status": "Active", "supplierName": "a"}, {"addresses": [{"country": "GB", "type": "Billing"}], "defaultCurrency": "GBP", "id": "64ae712f-4155-48bb-9fce-98232c51d979", "modifiedDate": "2022-10-26T13:33:13Z", "phone": "(877) 492-8687", "sourceModifiedDate": "2020-05-01T14:05:46Z", "status": "Active", "supplierName": "aa"}], "totalResults": 118} + FreeAgent: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/071ad738-68f3-4561-afd0-69bab9df0803/data/suppliers?page=1&pageSize=2"}, "next": {"href": "/companies/071ad738-68f3-4561-afd0-69bab9df0803/data/suppliers?page=2&pageSize=2"}, "self": {"href": "/companies/071ad738-68f3-4561-afd0-69bab9df0803/data/suppliers"}}, "pageNumber": 1, "pageSize": 2, "results": [{"addresses": [{"city": "London", "country": "United Kingdom", "line1": "1 Place House", "line2": "", "postalCode": "WC1X 1AH", "type": "Billing"}], "contactName": "Test 1", "id": "11526230", "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-25T14:19:08Z", "phone": "01224 658 999", "sourceModifiedDate": "2023-04-17T06:02:46", "status": "Active", "supplierName": "-"}, {"addresses": [{"city": "London", "country": "United Kingdom", "line1": "1 Place House", "line2": "", "postalCode": "WC1X 1AH", "type": "Billing"}], "contactName": "Test 1", "id": "9677150", "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-25T14:19:08Z", "phone": "+44 25691 154789", "sourceModifiedDate": "2023-04-24T06:19:23", "status": "Active", "supplierName": "-"}], "totalResults": 159} + FreshBooks: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/3691c49e-0db4-4172-b3ab-e4084c365013/data/suppliers?page=1&pageSize=2"}, "next": {"href": "/companies/3691c49e-0db4-4172-b3ab-e4084c365013/data/suppliers?page=2&pageSize=2"}, "self": {"href": "/companies/3691c49e-0db4-4172-b3ab-e4084c365013/data/suppliers"}}, "pageNumber": 1, "pageSize": 2, "results": [{"addresses": [], "id": "api vendor", "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-24T16:07:25Z", "phone": "+44 25691 154789", "sourceModifiedDate": "2022-10-23T00:00:00Z", "status": "Active", "supplierName": "api vendor"}, {"addresses": [], "id": "DUndsRykrmy8kFsc+FvYk29YkJze4zSjGecoF4YcUEhVU7auJ5JkQA0VjXptZ7XQ+D4n6WoxFIkaGY2V/t4flA==", "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-24T16:07:25Z", "phone": "(877) 492-8687", "sourceModifiedDate": "2022-10-23T00:00:00Z", "status": "Active", "supplierName": "Chekko Test merchant 100 - Test Very long name: ORIG CO NAME:AMERICAN EXPRESS ORIG ID:9493560001 DESC DATE:220307 CO ENTRY DESCR:ACH PMT SEC:CCD TRACE#:021000023255482 EED:220307 IND ID:A4670 IND NAME:Rick Sanchez"}], "totalResults": 7} + KashFlow: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/3a707a99-89da-4b16-a5d6-595333a16352/data/suppliers?page=1&pageSize=2"}, "next": {"href": "/companies/3a707a99-89da-4b16-a5d6-595333a16352/data/suppliers?page=2&pageSize=2"}, "self": {"href": "/companies/3a707a99-89da-4b16-a5d6-595333a16352/data/suppliers"}}, "pageNumber": 1, "pageSize": 2, "results": [{"addresses": [], "contactName": "", "emailAddress": "", "id": "6202387", "modifiedDate": "2022-09-30T10:29:15Z", "phone": "", "sourceModifiedDate": "2017-05-09T00:00:00", "status": "Unknown", "supplierName": "Dell", "taxNumber": ""}, {"addresses": [], "contactName": "", "emailAddress": "", "id": "9338173", "modifiedDate": "2022-09-30T10:29:15Z", "phone": "", "sourceModifiedDate": "1990-01-01T00:00:00", "status": "Unknown", "supplierName": "Home", "taxNumber": ""}], "totalResults": 7} + Oracle NetSuite: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/d5074b08-6a34-4b06-a742-236edf5dc4f1/data/suppliers?page=1&pageSize=2"}, "next": {"href": "/companies/d5074b08-6a34-4b06-a742-236edf5dc4f1/data/suppliers?page=2&pageSize=2"}, "self": {"href": "/companies/d5074b08-6a34-4b06-a742-236edf5dc4f1/data/suppliers"}}, "pageNumber": 1, "pageSize": 2, "results": [{"addresses": [], "contactName": "Test Vendor", "defaultCurrency": "GBP", "emailAddress": "", "id": "779", "modifiedDate": "2023-01-30T14:47:02Z", "phone": "", "sourceModifiedDate": "2022-02-04T14:24:43", "status": "Active", "supplierName": "Test Vendor"}, {"addresses": [], "contactName": "Vendor -.A", "defaultCurrency": "GBP", "emailAddress": "", "id": "726", "modifiedDate": "2023-01-30T14:47:02Z", "phone": "", "sourceModifiedDate": "2021-03-26T09:53:15", "status": "Active", "supplierName": "Vendor -.A"}], "totalResults": 6} + QuickBooks Desktop: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/fc72ba08-af13-4474-b28a-01dcfa6cfb51/data/suppliers?page=1&pageSize=2"}, "next": {"href": "/companies/fc72ba08-af13-4474-b28a-01dcfa6cfb51/data/suppliers?page=2&pageSize=2"}, "self": {"href": "/companies/fc72ba08-af13-4474-b28a-01dcfa6cfb51/data/suppliers"}}, "pageNumber": 1, "pageSize": 2, "results": [{"addresses": [{"city": "Berkeley", "line1": "A Cheung Limited, Angela Cheung", "line2": "3818 Bear Rd. West", "postalCode": "94688", "region": "CA", "type": "Billing"}], "contactName": "Angela Cheung", "defaultCurrency": "GBP", "emailAddress": "AC@CheungLimited.com", "id": "A60000-1197760912", "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-26T09:09:03Z", "phone": "510 555 5723", "sourceModifiedDate": "2023-12-16T05:06:44", "status": "Active", "supplierName": "A Cheung Limited"}, {"addresses": [{"city": "Middlefield", "line1": "Bank of Anycity, Lisa Holzhauser", "line2": "1935 Main Street", "postalCode": "94482", "region": "CA", "type": "Billing"}], "contactName": "Lisa D. Holzhauser", "defaultCurrency": "GBP", "emailAddress": "lisah@samplename.com", "id": "A40000-1197774038", "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-26T09:09:03Z", "phone": "415-555-9135", "sourceModifiedDate": "2023-12-16T05:06:44", "status": "Active", "supplierName": "Bank of Anycity"}], "totalResults": 54} + QuickBooks Online: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/10818b5e-6e6a-4ed4-a1c5-3e3efe626e87/data/suppliers?page=1&pageSize=2"}, "next": {"href": "/companies/10818b5e-6e6a-4ed4-a1c5-3e3efe626e87/data/suppliers?page=2&pageSize=2"}, "self": {"href": "/companies/10818b5e-6e6a-4ed4-a1c5-3e3efe626e87/data/suppliers"}}, "pageNumber": 1, "pageSize": 2, "results": [{"addresses": [{"country": "Djibouti", "line1": "test", "region": "string", "type": "Billing"}], "contactName": "AI Support", "defaultCurrency": "GBP", "id": "41", "modifiedDate": "2023-01-18T11:02:36Z", "phone": "+44 25691 154789", "sourceModifiedDate": "2022-12-07T10:48:18Z", "status": "Active", "supplierName": "AI Support"}, {"addresses": [{"country": "DJ", "line1": "test", "region": "string", "type": "Billing"}], "contactName": "AI Support 2", "defaultCurrency": "GBP", "id": "42", "modifiedDate": "2023-01-18T11:02:36Z", "phone": "01224 658 999", "sourceModifiedDate": "2021-08-31T08:45:02Z", "status": "Active", "supplierName": "AI Support 2"}], "totalResults": 23} + QuickBooks Online Sandbox: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/5a7f3597-36e1-4216-86fe-289ad36088a6/data/suppliers?page=1&pageSize=2"}, "next": {"href": "/companies/5a7f3597-36e1-4216-86fe-289ad36088a6/data/suppliers?page=2&pageSize=2"}, "self": {"href": "/companies/5a7f3597-36e1-4216-86fe-289ad36088a6/data/suppliers"}}, "pageNumber": 1, "pageSize": 2, "results": [{"addresses": [{"city": "London", "country": "England", "line1": "100 London Road", "line2": "Angel", "postalCode": "EC1M", "region": "Greater London", "type": "Billing"}], "contactName": "Miss Smith", "defaultCurrency": "GBP", "id": "129", "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-26T09:35:55Z", "phone": "0728 38474", "sourceModifiedDate": "2023-04-13T01:51:08Z", "status": "Active", "supplierName": "Ally Johnson"}, {"addresses": [], "defaultCurrency": "GBP", "id": "88", "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-26T09:35:55Z", "phone": "+44 25691 154789", "sourceModifiedDate": "2022-07-06T15:55:28Z", "status": "Active", "supplierName": "Andrew Haberbosch"}], "totalResults": 64} + Sage 200cloud: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/93c21e2d-049c-4d24-b41b-57e61c30b69e/data/suppliers?page=1&pageSize=2"}, "next": {"href": "/companies/93c21e2d-049c-4d24-b41b-57e61c30b69e/data/suppliers?page=2&pageSize=2"}, "self": {"href": "/companies/93c21e2d-049c-4d24-b41b-57e61c30b69e/data/suppliers"}}, "pageNumber": 1, "pageSize": 2, "results": [{"addresses": [{"city": "", "country": "Great Britain", "line1": "", "line2": "", "postalCode": "", "region": "", "type": "Unknown"}], "contactName": "", "defaultCurrency": "GBP", "emailAddress": "", "id": "776", "metadata": {"isDeleted": true}, "modifiedDate": "2022-10-14T09:35:58Z", "phone": "", "sourceModifiedDate": "2022-10-23T00:00:00Z", "status": "Archived", "supplierName": "Aaren", "taxNumber": ""}, {"addresses": [{"city": "", "country": "Great Britain", "line1": "", "line2": "", "postalCode": "", "region": "", "type": "Unknown"}], "contactName": "", "defaultCurrency": "GBP", "emailAddress": "", "id": "914", "metadata": {"isDeleted": true}, "modifiedDate": "2022-10-14T09:35:58Z", "phone": "", "sourceModifiedDate": "2022-10-23T00:00:00Z", "status": "Archived", "supplierName": "Aaren", "taxNumber": ""}], "totalResults": 943} + Sage 50 (UK): + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/cf5f2a47-2990-4221-bae6-0c19c86ac304/data/suppliers?page=1&pageSize=2"}, "next": {"href": "/companies/cf5f2a47-2990-4221-bae6-0c19c86ac304/data/suppliers?page=2&pageSize=2"}, "self": {"href": "/companies/cf5f2a47-2990-4221-bae6-0c19c86ac304/data/suppliers"}}, "pageNumber": 1, "pageSize": 2, "results": [{"addresses": [{"city": "Newcastle Upon Tyne", "country": "GB", "line1": "66 New Street", "line2": "Ridgeway", "postalCode": "NE1 4GF", "region": "", "type": "Delivery"}, {"city": "Newcastle upon Tyne", "country": "GB", "line1": "66 New Street", "line2": "Ridgeway", "postalCode": "NE1 4GF", "region": "", "type": "Unknown"}], "contactName": "Mark Ramsay", "defaultCurrency": "GBP", "emailAddress": "newbusinessadvice@sage.com", "id": "CON001", "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-30T14:42:38Z", "phone": "0191 643 4343", "sourceModifiedDate": "2022-11-25T09:43:54Z", "status": "Active", "supplierName": "Concept Stationery Supplies", "taxNumber": "GB988 3453 23"}, {"addresses": [{"city": "Chester le Street", "country": "GB", "line1": "Station Lane Ind Est", "line2": "Birtley", "postalCode": "DH1 3RG", "region": "County Durham", "type": "Delivery"}, {"city": "Chester le Street", "country": "GB", "line1": "Station Lane Ind Est", "line2": "Birtley", "postalCode": "DH1 3RG", "region": "County Durham", "type": "Unknown"}], "contactName": "Stuart Lynn", "defaultCurrency": "GBP", "emailAddress": "newbusinessadvice@sage.com", "id": "MCN001", "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-30T14:42:38Z", "phone": "0191 415 3434", "sourceModifiedDate": "2022-12-05T13:37:26Z", "status": "Active", "supplierName": "McNally Computer Supplies", "taxNumber": "GB455 2385 34"}], "totalResults": 15} + Sage Business Cloud Accounting: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/390083e2-351b-407c-a3be-55081c36c182/data/suppliers?page=1&pageSize=2"}, "next": {"href": "/companies/390083e2-351b-407c-a3be-55081c36c182/data/suppliers?page=2&pageSize=2"}, "self": {"href": "/companies/390083e2-351b-407c-a3be-55081c36c182/data/suppliers"}}, "pageNumber": 1, "pageSize": 2, "results": [{"addresses": [{"country": "United Kingdom (GB)", "type": "Billing"}], "contactName": "Main Contact", "defaultCurrency": "GBP", "id": "65179671e9ef424caff8b9006cd111c8", "modifiedDate": "2022-10-24T14:52:54Z", "phone": "(877) 492-8687", "sourceModifiedDate": "2020-02-25T17:23:33Z", "status": "Active", "supplierName": "5555 Abdul's Test Name"}, {"addresses": [{"city": "London", "country": "United Kingdom (GB)", "line1": "1 Place House", "postalCode": "WC1X 1AH", "type": "Billing"}], "contactName": "Abdi", "defaultCurrency": "GBP", "emailAddress": "abdisupplier@company.com", "id": "cf7f44d693904944a6a7cf3de0887964", "modifiedDate": "2022-10-24T14:52:54Z", "phone": "(877) 492-8687", "sourceModifiedDate": "2020-02-13T10:38:19Z", "status": "Active", "supplierName": "Abdi Supplier"}], "totalResults": 64} + Sage Intacct: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/df02b289-cb16-4964-ac4d-9fd60b04538e/data/suppliers?page=1&pageSize=2"}, "next": {"href": "/companies/df02b289-cb16-4964-ac4d-9fd60b04538e/data/suppliers?page=2&pageSize=2"}, "self": {"href": "/companies/df02b289-cb16-4964-ac4d-9fd60b04538e/data/suppliers"}}, "pageNumber": 1, "pageSize": 2, "results": [{"addresses": [{"city": "Dallas", "country": "United States", "line1": "208 S Akard St", "line2": "", "postalCode": "75265", "region": "TX", "type": "Unknown"}], "contactName": "Jones, William", "defaultCurrency": "USD", "id": "3", "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-04T16:32:20Z", "phone": "214-760-9491", "registrationNumber": "", "sourceModifiedDate": "2023-02-16T09:48:27", "status": "Active", "supplierName": "ADP", "taxNumber": "85-3678274"}, {"addresses": [{"city": "Drayton Valley", "country": "Canada", "line1": "5 Carey Hill", "line2": "", "postalCode": "G8V", "region": "Alberta", "type": "Unknown"}], "contactName": "Roach, Nathan", "defaultCurrency": "CAD", "id": "29", "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-04T16:32:20Z", "phone": "130-202-4796", "registrationNumber": "", "sourceModifiedDate": "2022-06-15T11:38:29", "status": "Active", "supplierName": "Advisor Printing", "taxNumber": ""}], "totalResults": 77} + Wave: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/0b22b59d-b4e5-4c35-b03f-88bbbcb41256/data/suppliers?page=1&pageSize=2"}, "next": {"href": "/companies/0b22b59d-b4e5-4c35-b03f-88bbbcb41256/data/suppliers?page=2&pageSize=2"}, "self": {"href": "/companies/0b22b59d-b4e5-4c35-b03f-88bbbcb41256/data/suppliers"}}, "pageNumber": 1, "pageSize": 2, "results": [{"addresses": [], "contactName": "", "defaultCurrency": "GBP", "emailAddress": "", "id": "QnVzaW5lc3M6ZTI0OGQyZDctMWE5Ni00YTk4LWFkOTEtMDdlMGYyMmNhNmE2O1ZlbmRvcjo2NjA0Nzk0", "modifiedDate": "2022-11-16T18:15:24Z", "phone": "+44 25691 154789", "sourceModifiedDate": "2020-04-07T13:28:02Z", "status": "Active", "supplierName": "Computer Shop"}, {"addresses": [], "contactName": "", "defaultCurrency": "GBP", "emailAddress": "", "id": "QnVzaW5lc3M6ZTI0OGQyZDctMWE5Ni00YTk4LWFkOTEtMDdlMGYyMmNhNmE2O1ZlbmRvcjo2NjA0NzQx", "modifiedDate": "2022-11-16T18:15:24Z", "phone": "+44 25691 154789", "sourceModifiedDate": "2020-04-07T13:12:40Z", "status": "Active", "supplierName": "Flour Mill"}], "totalResults": 9} + Xero: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/5ced9667-a310-443a-a711-958d36377141/data/suppliers?page=1&pageSize=2"}, "next": {"href": "/companies/5ced9667-a310-443a-a711-958d36377141/data/suppliers?page=2&pageSize=2"}, "self": {"href": "/companies/5ced9667-a310-443a-a711-958d36377141/data/suppliers"}}, "pageNumber": 1, "pageSize": 2, "results": [{"addresses": [], "emailAddress": "", "id": "e4c9d0e2-c285-4e85-b579-6d28b180c730", "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-15T20:36:09Z", "phone": "(877) 492-8687", "sourceModifiedDate": "2023-02-17T18:03:42", "status": "Active", "supplierName": "24 Locks"}, {"addresses": [], "emailAddress": "", "id": "bab779bc-c5fb-42cb-a888-953e8309711c", "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-15T20:36:09Z", "phone": "(877) 492-8687", "sourceModifiedDate": "2023-02-17T18:03:42", "status": "Active", "supplierName": "7-Eleven"}], "totalResults": 48} + Zoho Books: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/d0b68840-db50-4bc3-b88c-96e225333fea/data/suppliers?page=1&pageSize=2"}, "next": {"href": "/companies/d0b68840-db50-4bc3-b88c-96e225333fea/data/suppliers?page=2&pageSize=2"}, "self": {"href": "/companies/d0b68840-db50-4bc3-b88c-96e225333fea/data/suppliers"}}, "pageNumber": 1, "pageSize": 2, "results": [{"addresses": [], "defaultCurrency": "GBP", "emailAddress": "", "id": "104957000001494001", "modifiedDate": "2022-10-03T08:40:37Z", "phone": "+44 25691 154789", "sourceModifiedDate": "2022-09-16T13:09:56", "status": "Active", "supplierName": "Acme Corporation"}, {"addresses": [], "contactName": "Dre", "defaultCurrency": "CAD", "emailAddress": "", "id": "104957000000648001", "modifiedDate": "2022-10-03T08:40:37Z", "phone": "01224 658 999", "sourceModifiedDate": "2022-06-10T09:07:16", "status": "Active", "supplierName": "Cool company"}], "totalResults": 6} + Malformed query: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "400": + application/json: {"canBeRetried": "Unknown", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "detailedErrorCode": 0, "error": "Error parsing query - Malformed query.", "service": "ClientsApi", "statusCode": 400} + Unresolved property: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "400": + application/json: {"canBeRetried": "Unknown", "correlationId": "98457fb9956b7f9b4b2fd4f6e23bb5c8", "detailedErrorCode": 0, "error": "Error parsing query - Could not resolve property isCompleted on Dataset", "service": "PullApi", "statusCode": 400} + update-supplier: + Malformed query: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" + supplierId: "" + query: {} + requestBody: + application/json: {"addresses": [{"city": "Bakersfield", "country": "USA", "line1": "Unit 51", "line2": "Bakersfield Industrial Estate", "region": "California", "type": "Billing"}], "contactName": "Kelly's Industrial Supplies", "defaultCurrency": "string", "emailAddress": "sales@kellysupplies.com", "id": "C520FFD4-F6F6-4FC2-A6D2-5D7088B2B14F", "metadata": {"isDeleted": true}, "modifiedDate": "2022-10-23T00:00:00Z", "phone": "07999 999999", "registrationNumber": "string", "sourceModifiedDate": "2022-10-23T00:00:00Z", "status": "Unknown", "supplementalData": {"content": {"property1": {"property1": "", "property2": ""}, "property2": {"property1": "", "property2": ""}}}, "supplierName": "Kelly's Industrial Supplies", "taxNumber": "string"} + responses: + "400": + application/json: {"canBeRetried": "Unknown", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "detailedErrorCode": 0, "error": "Error processing request - not valid.", "service": "PublicApi", "statusCode": 400} + get-data-status: + Example: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + responses: + "200": + application/json: {"accountTransactions": {"currentStatus": "Complete", "dataType": "accountTransactions", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48"}, "balanceSheet": {"currentStatus": "Complete", "dataType": "balanceSheet", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48"}, "bankAccounts": {"currentStatus": "Complete", "dataType": "bankAccounts", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48"}, "bankTransactions": {"currentStatus": "Complete", "dataType": "bankTransactions", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48"}, "banking-accountBalances": {"currentStatus": "Complete", "dataType": "banking-accountBalances", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48"}, "banking-accounts": {"currentStatus": "Complete", "dataType": "banking-accounts", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48"}, "banking-transactionCategories": {"currentStatus": "Complete", "dataType": "banking-transactionCategories", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48"}, "banking-transactions": {"currentStatus": "Complete", "dataType": "banking-transactions", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48"}, "billCreditNotes": {"currentStatus": "Complete", "dataType": "billCreditNotes", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48"}, "billPayments": {"currentStatus": "Complete", "dataType": "billPayments", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48"}, "bills": {"currentStatus": "Complete", "dataType": "bills", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48"}, "cashFlowStatement": {"currentStatus": "Complete", "dataType": "cashFlowStatement", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48"}, "chartOfAccounts": {"currentStatus": "Complete", "dataType": "chartOfAccounts", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48"}, "commerce-companyInfo": {"currentStatus": "Complete", "dataType": "commerce-companyInfo", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48"}, "commerce-customers": {"currentStatus": "Complete", "dataType": "commerce-customers", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48"}, "commerce-disputes": {"currentStatus": "Complete", "dataType": "commerce-disputes", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48"}, "commerce-locations": {"currentStatus": "Complete", "dataType": "commerce-locations", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48"}, "commerce-orders": {"currentStatus": "Complete", "dataType": "commerce-orders", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48"}, "commerce-paymentMethods": {"currentStatus": "Complete", "dataType": "commerce-paymentMethods", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48"}, "commerce-payments": {"currentStatus": "Complete", "dataType": "commerce-payments", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48"}, "commerce-productCategories": {"currentStatus": "Complete", "dataType": "commerce-productCategories", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48"}, "commerce-products": {"currentStatus": "Complete", "dataType": "commerce-products", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48"}, "commerce-taxComponents": {"currentStatus": "Complete", "dataType": "commerce-taxComponents", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48"}, "commerce-transactions": {"currentStatus": "Complete", "dataType": "commerce-transactions", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48"}, "company": {"currentStatus": "Complete", "dataType": "company", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48"}, "creditNotes": {"currentStatus": "Complete", "dataType": "creditNotes", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48"}, "customers": {"currentStatus": "Complete", "dataType": "customers", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48"}, "directCosts": {"currentStatus": "Complete", "dataType": "directCosts", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48"}, "directIncomes": {"currentStatus": "Complete", "dataType": "directIncomes", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48"}, "invoices": {"currentStatus": "Complete", "dataType": "invoices", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48"}, "itemReceipts": {"currentStatus": "Complete", "dataType": "itemReceipts", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48"}, "items": {"currentStatus": "Complete", "dataType": "items", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48"}, "journalEntries": {"currentStatus": "Complete", "dataType": "journalEntries", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48"}, "journals": {"currentStatus": "Complete", "dataType": "journals", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48"}, "paymentMethods": {"currentStatus": "Complete", "dataType": "paymentMethods", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48"}, "payments": {"currentStatus": "Complete", "dataType": "payments", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48"}, "profitAndLoss": {"currentStatus": "Complete", "dataType": "profitAndLoss", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48"}, "purchaseOrders": {"currentStatus": "Complete", "dataType": "purchaseOrders", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48"}, "salesOrders": {"currentStatus": "Complete", "dataType": "salesOrders", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48"}, "suppliers": {"currentStatus": "Complete", "dataType": "suppliers", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48"}, "taxRates": {"currentStatus": "Complete", "dataType": "taxRates", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48"}, "trackingCategories": {"currentStatus": "Complete", "dataType": "trackingCategories", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48"}, "transfers": {"currentStatus": "Complete", "dataType": "transfers", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48"}} + 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} + get-pull-operation: + Unauthorized: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + datasetId: "71a4c0fb-8e15-45bd-958d-330b4e6e9f07" + responses: + "401": + application/json: {"canBeRetried": "Unknown", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "detailedErrorCode": 0, "error": "Unauthorized", "service": "PublicApi", "statusCode": 401} + list-pull-operations: + "": + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/{id}/data/{dataType}?page=1&pageSize=10"}, "self": {"href": "/companies/{id}/data/{dataType}"}}, "pageNumber": 1, "pageSize": 10, "results": [{"companyId": "4645bd78-8988-45bc-ac9e-67ba5df6e4e5", "completed": "2022-10-23T00:00:00Z", "connectionId": "51baa045-4836-4317-a42e-3542e991e581", "dataType": "invoices", "id": "97d60846-f07a-4d42-b5a0-0bdcc6ebf56b", "isCompleted": false, "isErrored": false, "progress": 10, "requested": "2022-11-14T11:18:37.2798351Z", "status": "Initial", "statusDescription": "Paused until 2022-10-23T00:00:00.000Z"}], "totalResults": 1} + "400": {} + Example: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/17129e41-5389-4f10-ac06-e0a37e47d177/data/history?page=1&pageSize=2"}, "next": {"href": "/companies/17129e41-5389-4f10-ac06-e0a37e47d177/data/history?page=2&pageSize=2"}, "self": {"href": "/companies/17129e41-5389-4f10-ac06-e0a37e47d177/data/history"}}, "pageNumber": 0, "pageSize": 0, "results": [{"companyId": "4645bd78-8988-45bc-ac9e-67ba5df6e4e5", "completed": "2022-10-23T00:00:00Z", "connectionId": "51baa045-4836-4317-a42e-3542e991e581", "dataType": "invoices", "id": "97d60846-f07a-4d42-b5a0-0bdcc6ebf56b", "isCompleted": false, "isErrored": false, "progress": 10, "requested": "2022-11-14T11:18:37.2798351Z", "status": "Initial", "statusDescription": "Paused until 2022-10-23T00:00:00.000Z"}], "totalResults": 0} + Malformed query: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "400": + application/json: {"canBeRetried": "Unknown", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "detailedErrorCode": 0, "error": "Error parsing query - Malformed query.", "service": "ClientsApi", "statusCode": 400} + Unresolved property: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "400": + application/json: {"canBeRetried": "Unknown", "correlationId": "98457fb9956b7f9b4b2fd4f6e23bb5c8", "detailedErrorCode": 0, "error": "Error parsing query - Could not resolve property isCompleted on Dataset", "service": "PullApi", "statusCode": 400} + refresh-all-data-types: + 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} + refresh-data-type: + Unauthorized: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + dataType: "invoices" + query: {} + responses: + "401": + application/json: {"canBeRetried": "Unknown", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "detailedErrorCode": 0, "error": "Unauthorized", "service": "PublicApi", "statusCode": 401} + get-accounting-profile: + Example 1: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + responses: + "200": + application/json: {"accountingPlatformRef": "1700060034_ETD", "addresses": [{"city": "London", "country": "United Kingdom", "line1": "301 Ink Rooms", "line2": "28 Easton Street", "postalCode": "WC1X 0BE", "region": "England", "type": "Billing"}, {"city": "London", "country": "UK", "line1": "28 Easton Street", "postalCode": "WC1X 0BE", "type": "Delivery"}], "baseCurrency": "GBP", "companyLegalName": "Codat Ltd", "companyName": "Codat", "createdDate": "2020-03-09T15:19:26", "financialYearStartDate": "2023-04-01T00:00:00", "ledgerLockDate": "2022-10-23T00:00:00Z", "phoneNumbers": [{"number": "02012 345678", "type": "Landline"}, {"number": "07123 456789", "type": "Mobile"}, {"number": "02012 345678", "type": "Fax"}], "registrationNumber": "5590111724", "sourceUrls": {"Api": "https://api.codat.io"}, "taxNumber": "74111622555799035846", "webLinks": [{"type": "Website", "url": "https://www.codat.io/"}, {"type": "Social", "url": "https://www.linkedin.com/company/codat-limited/"}]} + 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} + get-payment-method: + QuickBooks Online: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + paymentMethodId: "" + responses: + "200": + application/json: {"id": "3", "modifiedDate": "2023-01-18T11:02:37Z", "name": "Card", "sourceModifiedDate": "2017-11-24T16:53:08Z", "status": "Active", "type": "Unknown"} + QuickBooks Online Sandbox: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + paymentMethodId: "" + responses: + "200": + application/json: {"id": "3", "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-26T09:35:57Z", "name": "Card", "sourceModifiedDate": "2022-03-07T15:53:27Z", "status": "Active", "type": "Unknown"} + Sage Intacct: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + paymentMethodId: "" + responses: + "200": + application/json: {"id": "12", "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-04T16:31:24Z", "name": "ACH", "sourceModifiedDate": "2022-10-23T00:00:00Z", "status": "Unknown", "type": "Other"} + Unauthorized: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + paymentMethodId: "" + responses: + "401": + application/json: {"canBeRetried": "Unknown", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "detailedErrorCode": 0, "error": "Unauthorized", "service": "PublicApi", "statusCode": 401} + list-payment-methods: + "": + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/{id}/data/{dataType}?page=1&pageSize=10"}, "self": {"href": "/companies/{id}/data/{dataType}"}}, "pageNumber": 1, "pageSize": 10, "results": [{"modifiedDate": "2022-10-23T00:00:00Z", "sourceModifiedDate": "2022-10-23T00:00:00Z"}, {"modifiedDate": "2022-10-23T00:00:00Z", "sourceModifiedDate": "2022-10-23T00:00:00Z"}, {"modifiedDate": "2022-10-23T00:00:00Z", "sourceModifiedDate": "2022-10-23T00:00:00Z"}], "totalResults": 1} + "400": {} + QuickBooks Online: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/10818b5e-6e6a-4ed4-a1c5-3e3efe626e87/data/paymentMethods?page=1&pageSize=2"}, "next": {"href": "/companies/10818b5e-6e6a-4ed4-a1c5-3e3efe626e87/data/paymentMethods?page=2&pageSize=2"}, "self": {"href": "/companies/10818b5e-6e6a-4ed4-a1c5-3e3efe626e87/data/paymentMethods"}}, "pageNumber": 1, "pageSize": 2, "results": [{"id": "3", "modifiedDate": "2023-01-18T11:02:37Z", "name": "Card", "sourceModifiedDate": "2017-11-24T16:53:08Z", "status": "Active", "type": "Unknown"}, {"id": "1", "modifiedDate": "2023-01-18T11:02:37Z", "name": "Cash", "sourceModifiedDate": "2017-11-24T16:53:08Z", "status": "Active", "type": "Unknown"}], "totalResults": 4} + QuickBooks Online Sandbox: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/5a7f3597-36e1-4216-86fe-289ad36088a6/data/paymentMethods?page=1&pageSize=2"}, "next": {"href": "/companies/5a7f3597-36e1-4216-86fe-289ad36088a6/data/paymentMethods?page=2&pageSize=2"}, "self": {"href": "/companies/5a7f3597-36e1-4216-86fe-289ad36088a6/data/paymentMethods"}}, "pageNumber": 1, "pageSize": 2, "results": [{"id": "3", "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-26T09:35:57Z", "name": "Card", "sourceModifiedDate": "2022-03-07T15:53:27Z", "status": "Active", "type": "Unknown"}, {"id": "1", "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-26T09:35:57Z", "name": "Cash", "sourceModifiedDate": "2016-08-30T09:26:13Z", "status": "Active", "type": "Unknown"}], "totalResults": 4} + Sage Intacct: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/df02b289-cb16-4964-ac4d-9fd60b04538e/data/paymentMethods?page=1&pageSize=2"}, "next": {"href": "/companies/df02b289-cb16-4964-ac4d-9fd60b04538e/data/paymentMethods?page=2&pageSize=2"}, "self": {"href": "/companies/df02b289-cb16-4964-ac4d-9fd60b04538e/data/paymentMethods"}}, "pageNumber": 1, "pageSize": 2, "results": [{"id": "12", "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-04T16:31:24Z", "name": "ACH", "sourceModifiedDate": "2022-10-23T00:00:00Z", "status": "Unknown", "type": "Other"}, {"id": "6", "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-04T16:31:24Z", "name": "Cash", "sourceModifiedDate": "2022-10-23T00:00:00Z", "status": "Unknown", "type": "Cash"}], "totalResults": 6} + Malformed query: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "400": + application/json: {"canBeRetried": "Unknown", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "detailedErrorCode": 0, "error": "Error parsing query - Malformed query.", "service": "ClientsApi", "statusCode": 400} + Unresolved property: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "400": + application/json: {"canBeRetried": "Unknown", "correlationId": "98457fb9956b7f9b4b2fd4f6e23bb5c8", "detailedErrorCode": 0, "error": "Error parsing query - Could not resolve property isCompleted on Dataset", "service": "PullApi", "statusCode": 400} + get-tax-rate: + Clear Books: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + taxRateId: "" + responses: + "200": + application/json: {"code": "110", "components": [{"isCompound": false, "name": "10%", "rate": 10}], "effectiveTaxRate": 10, "id": "6c88aff3-7cb9-4980-a3d3-443e72e02498", "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-26T12:38:17Z", "name": "Sales Tax (10%)", "sourceModifiedDate": "2023-10-06T13:04:00", "status": "Active", "totalTaxRate": 10, "validDatatypeLinks": []} + Dynamics 365 Business Central: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + taxRateId: "" + responses: + "200": + application/json: {"code": " - ", "components": [{"isCompound": false, "name": "-", "rate": 0}], "effectiveTaxRate": 0, "id": "cc81fea8-2917-ed11-90eb-002248009df3", "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-27T14:21:18Z", "name": "", "sourceModifiedDate": "2022-10-23T00:00:00Z", "status": "Active", "totalTaxRate": 0, "validDatatypeLinks": [{"links": ["DirectIncome.LineItems.TaxRateRef.Id"], "property": "Id"}]} + Exact (Netherlands): + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + taxRateId: "" + responses: + "200": + application/json: {"code": "0", "components": [{"isCompound": false, "name": "0", "rate": 0}], "effectiveTaxRate": 0, "id": "9b131726-71cc-432c-b7eb-8dd9f6a6c2b3", "modifiedDate": "2022-10-26T13:31:58Z", "name": "Geen BTW", "sourceModifiedDate": "2019-10-22T14:09:25Z", "status": "Active", "totalTaxRate": 0, "validDatatypeLinks": [{"links": ["Invoice.LineItems.TaxRateRef.Id", "CreditNote.LineItems.TaxRateRef.Id", "Bill.LineItems.TaxRateRef.Id", "BillCreditNote.LineItems.TaxRateRef.Id"], "property": "Id"}]} + Exact (UK): + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + taxRateId: "" + responses: + "200": + application/json: {"code": "00", "components": [{"isCompound": false, "name": "00", "rate": 0}], "effectiveTaxRate": 0, "id": "3b9b05b2-2a70-4750-88e8-5d35009175e5", "modifiedDate": "2022-10-26T13:33:07Z", "name": "UK sales VAT 0%", "sourceModifiedDate": "2017-07-12T02:28:23Z", "status": "Active", "totalTaxRate": 0, "validDatatypeLinks": [{"links": ["Invoice.LineItems.TaxRateRef.Id", "CreditNote.LineItems.TaxRateRef.Id"], "property": "Id"}]} + FreeAgent: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + taxRateId: "" + responses: + "200": + application/json: {"code": "1", "components": [{"isCompound": false, "name": "VAT (20%)", "rate": 20}], "effectiveTaxRate": 20, "id": "1", "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-25T14:19:11Z", "name": "VAT (20%)", "sourceModifiedDate": "2022-10-23T00:00:00Z", "status": "Active", "totalTaxRate": 20, "validDatatypeLinks": []} + FreshBooks: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + taxRateId: "" + responses: + "200": + application/json: {"code": "111", "components": [{"isCompound": false, "name": "helloabdul", "rate": 32}], "effectiveTaxRate": 32, "id": "19255", "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-24T16:07:23Z", "name": "helloabdul", "sourceModifiedDate": "2021-02-11T09:05:45", "status": "Active", "totalTaxRate": 32, "validDatatypeLinks": []} + Oracle NetSuite: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + taxRateId: "" + responses: + "200": + application/json: {"code": ".", "components": [{"isCompound": false, "name": "GST CA_E", "rate": 0}, {"isCompound": false, "name": "PST_CA_E", "rate": 0}], "effectiveTaxRate": 0, "id": "209", "modifiedDate": "2023-01-30T14:47:01Z", "name": "<Not Used>", "sourceModifiedDate": "2022-10-23T00:00:00Z", "status": "Active", "totalTaxRate": 0, "validDatatypeLinks": [{"links": ["Invoice.LineItems.TaxRateRef.Id", "CreditNote.LineItems.TaxRateRef.Id", "Bill.LineItems.TaxRateRef.Id", "BillCreditNote.LineItems.TaxRateRef.Id"], "property": "Id"}]} + QuickBooks Desktop: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + taxRateId: "" + responses: + "200": + application/json: {"code": "Non", "components": [], "id": "20000-999022286", "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-26T09:12:08Z", "name": "Non-Taxable Sales", "sourceModifiedDate": "2001-08-28T19:11:26", "status": "Active", "validDatatypeLinks": []} + QuickBooks Online: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + taxRateId: "" + responses: + "200": + application/json: {"code": "0.0% ECG", "components": [{"isCompound": false, "name": "ECPGZR", "rate": 0}, {"isCompound": false, "name": "ECZP", "rate": 0}], "effectiveTaxRate": 0, "id": "5_Bills", "modifiedDate": "2023-01-18T11:02:40Z", "name": "0.0% ECG Bills", "sourceModifiedDate": "2019-05-18T10:17:57Z", "status": "Archived", "totalTaxRate": 0, "validDatatypeLinks": [{"links": ["Bill.LineItems.TaxRateRef.Id", "BillCreditNote.LineItems.TaxRateRef.Id"], "property": "Id"}]} + QuickBooks Online Sandbox: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + taxRateId: "" + responses: + "200": + application/json: {"code": "0.0% ECG", "components": [{"isCompound": false, "name": "ECZP", "rate": 0}, {"isCompound": false, "name": "ECPGZR", "rate": 0}], "effectiveTaxRate": 0, "id": "5_Bills", "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-26T09:35:58Z", "name": "0.0% ECG Bills", "sourceModifiedDate": "2016-09-08T21:12:44Z", "status": "Active", "totalTaxRate": 0, "validDatatypeLinks": [{"links": ["Bill.LineItems.TaxRateRef.Id", "BillCreditNote.LineItems.TaxRateRef.Id"], "property": "Id"}]} + Sage 200cloud: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + taxRateId: "" + responses: + "200": + application/json: {"code": "0", "components": [{"isCompound": false, "name": "Zero rated", "rate": 0}], "effectiveTaxRate": 0, "id": "1728", "modifiedDate": "2022-10-14T09:35:51Z", "name": "Zero rated", "sourceModifiedDate": "2020-02-28T14:23:46Z", "status": "Active", "totalTaxRate": 0, "validDatatypeLinks": []} + Sage 50 (UK): + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + taxRateId: "" + responses: + "200": + application/json: {"code": "T0", "components": [{"isCompound": false, "name": "T0", "rate": 0}], "effectiveTaxRate": 0, "id": "0", "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-30T14:42:37Z", "name": "Zero rated", "sourceModifiedDate": "2022-10-23T00:00:00Z", "status": "Active", "totalTaxRate": 0, "validDatatypeLinks": []} + Sage Business Cloud Accounting: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + taxRateId: "" + responses: + "200": + application/json: {"code": "EXEMPT", "components": [{"isCompound": false, "name": "Exempt 0.00%", "rate": 0}], "effectiveTaxRate": 0, "id": "GB_EXEMPT", "modifiedDate": "2022-10-24T14:52:49Z", "name": "Exempt 0.00%", "sourceModifiedDate": "2021-07-01T16:49:32Z", "status": "Active", "totalTaxRate": 0, "validDatatypeLinks": []} + Sage Intacct: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + taxRateId: "" + responses: + "200": + application/json: {"code": "DevboxTax", "components": [{"isCompound": false, "name": "Devbox test tax detail", "rate": 5}], "effectiveTaxRate": 5, "id": "109", "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-04T16:31:30Z", "name": "Devbox test tax detail", "sourceModifiedDate": "2022-10-23T00:00:00Z", "status": "Active", "totalTaxRate": 5, "validDatatypeLinks": []} + Wave: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + taxRateId: "" + responses: + "200": + application/json: {"code": "ANT", "components": [{"isCompound": true, "name": "Abdul's new Tax", "rate": 11}], "effectiveTaxRate": 11, "id": "QnVzaW5lc3M6ZTI0OGQyZDctMWE5Ni00YTk4LWFkOTEtMDdlMGYyMmNhNmE2O1NhbGVzVGF4OjE2NjUyNTc5ODU=", "modifiedDate": "2022-11-16T18:15:25Z", "name": "Abdul's new Tax", "sourceModifiedDate": "2022-10-23T00:00:00Z", "status": "Active", "totalTaxRate": 11, "validDatatypeLinks": []} + Xero: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + taxRateId: "" + responses: + "200": + application/json: {"code": "ECACQUISITIONS", "components": [{"isCompound": false, "name": "VAT", "rate": 0}], "effectiveTaxRate": 0, "id": "ECACQUISITIONS", "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-15T20:35:09Z", "name": "EC Acquisitions (20%)", "sourceModifiedDate": "2022-10-23T00:00:00Z", "status": "Active", "totalTaxRate": 0, "validDatatypeLinks": [{"links": ["Invoice.LineItems.TaxRateRef.Id", "CreditNote.LineItems.TaxRateRef.Id", "Bill.LineItems.TaxRateRef.Id", "BillCreditNote.LineItems.TaxRateRef.Id"], "property": "Id"}]} + Zoho Books: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + taxRateId: "" + responses: + "200": + application/json: {"code": "104957000000033027", "components": [{"isCompound": false, "name": "Standard Rate", "rate": 20}], "effectiveTaxRate": 20, "id": "104957000000033027", "modifiedDate": "2022-10-03T08:40:37Z", "name": "Standard Rate", "sourceModifiedDate": "2022-10-23T00:00:00Z", "status": "Active", "totalTaxRate": 20, "validDatatypeLinks": []} + Unauthorized: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + taxRateId: "" + responses: + "401": + application/json: {"canBeRetried": "Unknown", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "detailedErrorCode": 0, "error": "Unauthorized", "service": "PublicApi", "statusCode": 401} + list-tax-rates: + "": + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/{id}/data/{dataType}?page=1&pageSize=10"}, "self": {"href": "/companies/{id}/data/{dataType}"}}, "pageNumber": 1, "pageSize": 10, "results": [{"modifiedDate": "2022-10-23T00:00:00Z", "sourceModifiedDate": "2022-10-23T00:00:00Z"}, {"modifiedDate": "2022-10-23T00:00:00Z", "sourceModifiedDate": "2022-10-23T00:00:00Z"}, {"modifiedDate": "2022-10-23T00:00:00Z", "sourceModifiedDate": "2022-10-23T00:00:00Z"}], "totalResults": 1} + "400": {} + Clear Books: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/354a121b-855f-4d25-90ad-0905b498c1c0/data/taxRates?page=1&pageSize=2"}, "next": {"href": "/companies/354a121b-855f-4d25-90ad-0905b498c1c0/data/taxRates?page=2&pageSize=2"}, "self": {"href": "/companies/354a121b-855f-4d25-90ad-0905b498c1c0/data/taxRates"}}, "pageNumber": 1, "pageSize": 2, "results": [{"code": "110", "components": [{"isCompound": false, "name": "10%", "rate": 10}], "effectiveTaxRate": 10, "id": "6c88aff3-7cb9-4980-a3d3-443e72e02498", "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-26T12:38:17Z", "name": "Sales Tax (10%)", "sourceModifiedDate": "2023-10-06T13:04:00", "status": "Active", "totalTaxRate": 10, "validDatatypeLinks": []}, {"code": "115", "components": [{"isCompound": false, "name": "15%", "rate": 15}], "effectiveTaxRate": 15, "id": "31f5f7a5-cf8e-4452-9979-c8b43997a6f2", "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-26T12:38:17Z", "name": "Sales Tax 15%", "sourceModifiedDate": "2024-01-20T13:04:00", "status": "Active", "totalTaxRate": 15, "validDatatypeLinks": []}], "totalResults": 5} + Dynamics 365 Business Central: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/d6849caf-c146-41be-8335-b73346e3bd84/data/taxRates?page=1&pageSize=2"}, "next": {"href": "/companies/d6849caf-c146-41be-8335-b73346e3bd84/data/taxRates?page=2&pageSize=2"}, "self": {"href": "/companies/d6849caf-c146-41be-8335-b73346e3bd84/data/taxRates"}}, "pageNumber": 1, "pageSize": 2, "results": [{"code": " - ", "components": [{"isCompound": false, "name": "-", "rate": 0}], "effectiveTaxRate": 0, "id": "cc81fea8-2917-ed11-90eb-002248009df3", "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-27T14:21:18Z", "name": "", "sourceModifiedDate": "2022-10-23T00:00:00Z", "status": "Active", "totalTaxRate": 0, "validDatatypeLinks": [{"links": ["DirectIncome.LineItems.TaxRateRef.Id"], "property": "Id"}]}, {"code": " - DOMESTIC", "components": [{"isCompound": false, "name": "- DOMESTIC", "rate": 0}], "effectiveTaxRate": 0, "id": "1170560b-5519-ed11-90eb-00224800a11d", "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-27T14:21:18Z", "name": "", "sourceModifiedDate": "2022-10-23T00:00:00Z", "status": "Active", "totalTaxRate": 0, "validDatatypeLinks": [{"links": ["DirectIncome.LineItems.TaxRateRef.Id"], "property": "Id"}]}], "totalResults": 21} + Exact (Netherlands): + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/b83b1923-4db6-45a8-a779-b4e320c15979/data/taxRates?page=1&pageSize=2"}, "next": {"href": "/companies/b83b1923-4db6-45a8-a779-b4e320c15979/data/taxRates?page=2&pageSize=2"}, "self": {"href": "/companies/b83b1923-4db6-45a8-a779-b4e320c15979/data/taxRates"}}, "pageNumber": 1, "pageSize": 2, "results": [{"code": "0", "components": [{"isCompound": false, "name": "0", "rate": 0}], "effectiveTaxRate": 0, "id": "9b131726-71cc-432c-b7eb-8dd9f6a6c2b3", "modifiedDate": "2022-10-26T13:31:58Z", "name": "Geen BTW", "sourceModifiedDate": "2019-10-22T14:09:25Z", "status": "Active", "totalTaxRate": 0, "validDatatypeLinks": [{"links": ["Invoice.LineItems.TaxRateRef.Id", "CreditNote.LineItems.TaxRateRef.Id", "Bill.LineItems.TaxRateRef.Id", "BillCreditNote.LineItems.TaxRateRef.Id"], "property": "Id"}]}, {"code": "0-1", "components": [{"isCompound": false, "name": "0-1", "rate": 15}], "effectiveTaxRate": 15, "id": "146106e9-85f7-46bc-bc90-4210cde500b9", "modifiedDate": "2022-10-26T13:31:58Z", "name": "Geen BTW", "sourceModifiedDate": "2022-07-21T09:54:15Z", "status": "Active", "totalTaxRate": 15, "validDatatypeLinks": [{"links": ["Invoice.LineItems.TaxRateRef.Id", "CreditNote.LineItems.TaxRateRef.Id", "Bill.LineItems.TaxRateRef.Id", "BillCreditNote.LineItems.TaxRateRef.Id"], "property": "Id"}]}], "totalResults": 32} + Exact (UK): + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/d95030cd-22b2-482b-9c7b-2980dcc2b1ce/data/taxRates?page=1&pageSize=2"}, "next": {"href": "/companies/d95030cd-22b2-482b-9c7b-2980dcc2b1ce/data/taxRates?page=2&pageSize=2"}, "self": {"href": "/companies/d95030cd-22b2-482b-9c7b-2980dcc2b1ce/data/taxRates"}}, "pageNumber": 1, "pageSize": 2, "results": [{"code": "00", "components": [{"isCompound": false, "name": "00", "rate": 0}], "effectiveTaxRate": 0, "id": "3b9b05b2-2a70-4750-88e8-5d35009175e5", "modifiedDate": "2022-10-26T13:33:07Z", "name": "UK sales VAT 0%", "sourceModifiedDate": "2017-07-12T02:28:23Z", "status": "Active", "totalTaxRate": 0, "validDatatypeLinks": [{"links": ["Invoice.LineItems.TaxRateRef.Id", "CreditNote.LineItems.TaxRateRef.Id"], "property": "Id"}]}, {"code": "01", "components": [{"isCompound": false, "name": "01", "rate": 20}], "effectiveTaxRate": 20, "id": "92c01056-0b5e-44f8-81df-83b6f2a41dbd", "modifiedDate": "2022-10-26T13:33:07Z", "name": "UK sales standard rate", "sourceModifiedDate": "2017-07-12T02:28:23Z", "status": "Active", "totalTaxRate": 20, "validDatatypeLinks": [{"links": ["Invoice.LineItems.TaxRateRef.Id", "CreditNote.LineItems.TaxRateRef.Id"], "property": "Id"}]}], "totalResults": 22} + FreeAgent: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/071ad738-68f3-4561-afd0-69bab9df0803/data/taxRates?page=1&pageSize=2"}, "next": {"href": "/companies/071ad738-68f3-4561-afd0-69bab9df0803/data/taxRates?page=2&pageSize=2"}, "self": {"href": "/companies/071ad738-68f3-4561-afd0-69bab9df0803/data/taxRates"}}, "pageNumber": 1, "pageSize": 2, "results": [{"code": "1", "components": [{"isCompound": false, "name": "VAT (20%)", "rate": 20}], "effectiveTaxRate": 20, "id": "1", "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-25T14:19:11Z", "name": "VAT (20%)", "sourceModifiedDate": "2022-10-23T00:00:00Z", "status": "Active", "totalTaxRate": 20, "validDatatypeLinks": []}, {"code": "2", "components": [{"isCompound": false, "name": "VAT (5%)", "rate": 5}], "effectiveTaxRate": 5, "id": "2", "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-25T14:19:11Z", "name": "VAT (5%)", "sourceModifiedDate": "2022-10-23T00:00:00Z", "status": "Active", "totalTaxRate": 5, "validDatatypeLinks": []}], "totalResults": 3} + FreshBooks: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/3691c49e-0db4-4172-b3ab-e4084c365013/data/taxRates?page=1&pageSize=2"}, "next": {"href": "/companies/3691c49e-0db4-4172-b3ab-e4084c365013/data/taxRates?page=2&pageSize=2"}, "self": {"href": "/companies/3691c49e-0db4-4172-b3ab-e4084c365013/data/taxRates"}}, "pageNumber": 1, "pageSize": 2, "results": [{"code": "111", "components": [{"isCompound": false, "name": "helloabdul", "rate": 32}], "effectiveTaxRate": 32, "id": "19255", "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-24T16:07:23Z", "name": "helloabdul", "sourceModifiedDate": "2021-02-11T09:05:45", "status": "Active", "totalTaxRate": 32, "validDatatypeLinks": []}, {"code": "111", "components": [{"isCompound": false, "name": "helloabdul", "rate": 32}, {"isCompound": false, "name": "hello2", "rate": 99}], "effectiveTaxRate": 131, "id": "19255-19257", "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-24T16:07:23Z", "name": "helloabdul and hello2", "sourceModifiedDate": "2021-02-25T07:27:36", "status": "Active", "totalTaxRate": 131, "validDatatypeLinks": []}], "totalResults": 105} + Oracle NetSuite: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/d5074b08-6a34-4b06-a742-236edf5dc4f1/data/taxRates?page=1&pageSize=2"}, "next": {"href": "/companies/d5074b08-6a34-4b06-a742-236edf5dc4f1/data/taxRates?page=2&pageSize=2"}, "self": {"href": "/companies/d5074b08-6a34-4b06-a742-236edf5dc4f1/data/taxRates"}}, "pageNumber": 1, "pageSize": 2, "results": [{"code": ".", "components": [{"isCompound": false, "name": "GST CA_E", "rate": 0}, {"isCompound": false, "name": "PST_CA_E", "rate": 0}], "effectiveTaxRate": 0, "id": "209", "modifiedDate": "2023-01-30T14:47:01Z", "name": "<Not Used>", "sourceModifiedDate": "2022-10-23T00:00:00Z", "status": "Active", "totalTaxRate": 0, "validDatatypeLinks": [{"links": ["Invoice.LineItems.TaxRateRef.Id", "CreditNote.LineItems.TaxRateRef.Id", "Bill.LineItems.TaxRateRef.Id", "BillCreditNote.LineItems.TaxRateRef.Id"], "property": "Id"}]}, {"code": "CA-E", "components": [{"isCompound": false, "name": "GST CA_E", "rate": 0}, {"isCompound": false, "name": "PST_CA_E", "rate": 0}], "effectiveTaxRate": 0, "id": "208", "modifiedDate": "2023-01-30T14:47:01Z", "name": "CA-E", "sourceModifiedDate": "2022-10-23T00:00:00Z", "status": "Active", "totalTaxRate": 0, "validDatatypeLinks": [{"links": ["Invoice.LineItems.TaxRateRef.Id", "CreditNote.LineItems.TaxRateRef.Id", "Bill.LineItems.TaxRateRef.Id", "BillCreditNote.LineItems.TaxRateRef.Id"], "property": "Id"}]}], "totalResults": 48} + QuickBooks Desktop: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/fc72ba08-af13-4474-b28a-01dcfa6cfb51/data/taxRates?page=1&pageSize=2"}, "self": {"href": "/companies/fc72ba08-af13-4474-b28a-01dcfa6cfb51/data/taxRates"}}, "pageNumber": 1, "pageSize": 2, "results": [{"code": "Non", "components": [], "id": "20000-999022286", "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-26T09:12:08Z", "name": "Non-Taxable Sales", "sourceModifiedDate": "2001-08-28T19:11:26", "status": "Active", "validDatatypeLinks": []}, {"code": "Tax", "components": [], "id": "10000-999022286", "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-26T09:12:08Z", "name": "Taxable Sales", "sourceModifiedDate": "2001-08-28T19:11:26", "status": "Active", "validDatatypeLinks": []}], "totalResults": 2} + QuickBooks Online: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/10818b5e-6e6a-4ed4-a1c5-3e3efe626e87/data/taxRates?page=1&pageSize=2"}, "next": {"href": "/companies/10818b5e-6e6a-4ed4-a1c5-3e3efe626e87/data/taxRates?page=2&pageSize=2"}, "self": {"href": "/companies/10818b5e-6e6a-4ed4-a1c5-3e3efe626e87/data/taxRates"}}, "pageNumber": 1, "pageSize": 2, "results": [{"code": "0.0% ECG", "components": [{"isCompound": false, "name": "ECPGZR", "rate": 0}, {"isCompound": false, "name": "ECZP", "rate": 0}], "effectiveTaxRate": 0, "id": "5_Bills", "modifiedDate": "2023-01-18T11:02:40Z", "name": "0.0% ECG Bills", "sourceModifiedDate": "2019-05-18T10:17:57Z", "status": "Archived", "totalTaxRate": 0, "validDatatypeLinks": [{"links": ["Bill.LineItems.TaxRateRef.Id", "BillCreditNote.LineItems.TaxRateRef.Id"], "property": "Id"}]}, {"code": "0.0% ECG", "components": [{"isCompound": false, "name": "EGS-ECGS", "rate": 0}, {"isCompound": false, "name": "EGS-ECSS", "rate": 0}], "effectiveTaxRate": 0, "id": "5_Invoices", "modifiedDate": "2023-01-18T11:02:40Z", "name": "0.0% ECG Invoices", "sourceModifiedDate": "2019-05-18T10:17:57Z", "status": "Archived", "totalTaxRate": 0, "validDatatypeLinks": [{"links": ["Invoice.LineItems.TaxRateRef.Id"], "property": "Id"}]}], "totalResults": 87} + QuickBooks Online Sandbox: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/5a7f3597-36e1-4216-86fe-289ad36088a6/data/taxRates?page=1&pageSize=2"}, "next": {"href": "/companies/5a7f3597-36e1-4216-86fe-289ad36088a6/data/taxRates?page=2&pageSize=2"}, "self": {"href": "/companies/5a7f3597-36e1-4216-86fe-289ad36088a6/data/taxRates"}}, "pageNumber": 1, "pageSize": 2, "results": [{"code": "0.0% ECG", "components": [{"isCompound": false, "name": "ECZP", "rate": 0}, {"isCompound": false, "name": "ECPGZR", "rate": 0}], "effectiveTaxRate": 0, "id": "5_Bills", "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-26T09:35:58Z", "name": "0.0% ECG Bills", "sourceModifiedDate": "2016-09-08T21:12:44Z", "status": "Active", "totalTaxRate": 0, "validDatatypeLinks": [{"links": ["Bill.LineItems.TaxRateRef.Id", "BillCreditNote.LineItems.TaxRateRef.Id"], "property": "Id"}]}, {"code": "0.0% ECG", "components": [{"isCompound": false, "name": "EGS-ECGS", "rate": 0}, {"isCompound": false, "name": "EGS-ECSS", "rate": 0}], "effectiveTaxRate": 0, "id": "5_Invoices", "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-26T09:35:58Z", "name": "0.0% ECG Invoices", "sourceModifiedDate": "2016-09-08T21:12:44Z", "status": "Active", "totalTaxRate": 0, "validDatatypeLinks": [{"links": ["Invoice.LineItems.TaxRateRef.Id"], "property": "Id"}]}], "totalResults": 35} + Sage 200cloud: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/93c21e2d-049c-4d24-b41b-57e61c30b69e/data/taxRates?page=1&pageSize=2"}, "next": {"href": "/companies/93c21e2d-049c-4d24-b41b-57e61c30b69e/data/taxRates?page=2&pageSize=2"}, "self": {"href": "/companies/93c21e2d-049c-4d24-b41b-57e61c30b69e/data/taxRates"}}, "pageNumber": 1, "pageSize": 2, "results": [{"code": "0", "components": [{"isCompound": false, "name": "Zero rated", "rate": 0}], "effectiveTaxRate": 0, "id": "1728", "modifiedDate": "2022-10-14T09:35:51Z", "name": "Zero rated", "sourceModifiedDate": "2020-02-28T14:23:46Z", "status": "Active", "totalTaxRate": 0, "validDatatypeLinks": []}, {"code": "1", "components": [{"isCompound": false, "name": "Standard rate", "rate": 20}], "effectiveTaxRate": 20, "id": "1729", "modifiedDate": "2022-10-14T09:35:51Z", "name": "Standard rate", "sourceModifiedDate": "2020-02-28T14:23:46Z", "status": "Active", "totalTaxRate": 20, "validDatatypeLinks": []}], "totalResults": 19} + Sage 50 (UK): + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/cf5f2a47-2990-4221-bae6-0c19c86ac304/data/taxRates?page=1&pageSize=2"}, "next": {"href": "/companies/cf5f2a47-2990-4221-bae6-0c19c86ac304/data/taxRates?page=2&pageSize=2"}, "self": {"href": "/companies/cf5f2a47-2990-4221-bae6-0c19c86ac304/data/taxRates"}}, "pageNumber": 1, "pageSize": 2, "results": [{"code": "T0", "components": [{"isCompound": false, "name": "T0", "rate": 0}], "effectiveTaxRate": 0, "id": "0", "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-30T14:42:37Z", "name": "Zero rated", "sourceModifiedDate": "2022-10-23T00:00:00Z", "status": "Active", "totalTaxRate": 0, "validDatatypeLinks": []}, {"code": "T1", "components": [{"isCompound": false, "name": "T1", "rate": 20}], "effectiveTaxRate": 20, "id": "1", "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-30T14:42:37Z", "name": "Standard rate", "sourceModifiedDate": "2022-10-23T00:00:00Z", "status": "Active", "totalTaxRate": 20, "validDatatypeLinks": []}], "totalResults": 21} + Sage Business Cloud Accounting: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/390083e2-351b-407c-a3be-55081c36c182/data/taxRates?page=1&pageSize=2"}, "next": {"href": "/companies/390083e2-351b-407c-a3be-55081c36c182/data/taxRates?page=2&pageSize=2"}, "self": {"href": "/companies/390083e2-351b-407c-a3be-55081c36c182/data/taxRates"}}, "pageNumber": 1, "pageSize": 2, "results": [{"code": "EXEMPT", "components": [{"isCompound": false, "name": "Exempt 0.00%", "rate": 0}], "effectiveTaxRate": 0, "id": "GB_EXEMPT", "modifiedDate": "2022-10-24T14:52:49Z", "name": "Exempt 0.00%", "sourceModifiedDate": "2021-07-01T16:49:32Z", "status": "Active", "totalTaxRate": 0, "validDatatypeLinks": []}, {"code": "LOWER", "components": [{"isCompound": false, "name": "Lower Rate 5.00%", "rate": 5}], "effectiveTaxRate": 5, "id": "GB_LOWER", "modifiedDate": "2022-10-24T14:52:49Z", "name": "Lower Rate 5.00%", "sourceModifiedDate": "2021-07-01T16:49:32Z", "status": "Active", "totalTaxRate": 5, "validDatatypeLinks": []}], "totalResults": 5} + Sage Intacct: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/df02b289-cb16-4964-ac4d-9fd60b04538e/data/taxRates?page=1&pageSize=2"}, "next": {"href": "/companies/df02b289-cb16-4964-ac4d-9fd60b04538e/data/taxRates?page=2&pageSize=2"}, "self": {"href": "/companies/df02b289-cb16-4964-ac4d-9fd60b04538e/data/taxRates"}}, "pageNumber": 1, "pageSize": 2, "results": [{"code": "DevboxTax", "components": [{"isCompound": false, "name": "Devbox test tax detail", "rate": 5}], "effectiveTaxRate": 5, "id": "109", "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-04T16:31:30Z", "name": "Devbox test tax detail", "sourceModifiedDate": "2022-10-23T00:00:00Z", "status": "Active", "totalTaxRate": 5, "validDatatypeLinks": []}, {"code": "EC Purchase Goods Exempt Rate", "components": [], "effectiveTaxRate": 0, "id": "44", "metadata": {"isDeleted": false}, "modifiedDate": "2023-04-04T16:31:30Z", "name": "EC Purchase Goods Exempt Rate", "sourceModifiedDate": "2022-10-23T00:00:00Z", "status": "Active", "totalTaxRate": 0, "validDatatypeLinks": []}], "totalResults": 66} + Wave: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/0b22b59d-b4e5-4c35-b03f-88bbbcb41256/data/taxRates?page=1&pageSize=2"}, "next": {"href": "/companies/0b22b59d-b4e5-4c35-b03f-88bbbcb41256/data/taxRates?page=2&pageSize=2"}, "self": {"href": "/companies/0b22b59d-b4e5-4c35-b03f-88bbbcb41256/data/taxRates"}}, "pageNumber": 1, "pageSize": 2, "results": [{"code": "ANT", "components": [{"isCompound": true, "name": "Abdul's new Tax", "rate": 11}], "effectiveTaxRate": 11, "id": "QnVzaW5lc3M6ZTI0OGQyZDctMWE5Ni00YTk4LWFkOTEtMDdlMGYyMmNhNmE2O1NhbGVzVGF4OjE2NjUyNTc5ODU=", "modifiedDate": "2022-11-16T18:15:25Z", "name": "Abdul's new Tax", "sourceModifiedDate": "2022-10-23T00:00:00Z", "status": "Active", "totalTaxRate": 11, "validDatatypeLinks": []}, {"code": "FederalABC", "components": [{"isCompound": false, "name": "FederalABC", "rate": 5}], "effectiveTaxRate": 5, "id": "QnVzaW5lc3M6ZTI0OGQyZDctMWE5Ni00YTk4LWFkOTEtMDdlMGYyMmNhNmE2O1NhbGVzVGF4OjE1NDA5NjM0Mzg=", "modifiedDate": "2022-11-16T18:15:25Z", "name": "FederalABC", "sourceModifiedDate": "2022-10-23T00:00:00Z", "status": "Active", "totalTaxRate": 5, "validDatatypeLinks": []}], "totalResults": 4} + Xero: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/5ced9667-a310-443a-a711-958d36377141/data/taxRates?page=1&pageSize=2"}, "next": {"href": "/companies/5ced9667-a310-443a-a711-958d36377141/data/taxRates?page=2&pageSize=2"}, "self": {"href": "/companies/5ced9667-a310-443a-a711-958d36377141/data/taxRates"}}, "pageNumber": 1, "pageSize": 2, "results": [{"code": "ECACQUISITIONS", "components": [{"isCompound": false, "name": "VAT", "rate": 0}], "effectiveTaxRate": 0, "id": "ECACQUISITIONS", "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-15T20:35:09Z", "name": "EC Acquisitions (20%)", "sourceModifiedDate": "2022-10-23T00:00:00Z", "status": "Active", "totalTaxRate": 0, "validDatatypeLinks": [{"links": ["Invoice.LineItems.TaxRateRef.Id", "CreditNote.LineItems.TaxRateRef.Id", "Bill.LineItems.TaxRateRef.Id", "BillCreditNote.LineItems.TaxRateRef.Id"], "property": "Id"}]}, {"code": "ECZRACQUISITIONS", "components": [{"isCompound": false, "name": "VAT", "rate": 0}], "effectiveTaxRate": 0, "id": "ECZRACQUISITIONS", "metadata": {"isDeleted": false}, "modifiedDate": "2023-03-15T20:35:09Z", "name": "EC Acquisitions (Zero Rated)", "sourceModifiedDate": "2022-10-23T00:00:00Z", "status": "Active", "totalTaxRate": 0, "validDatatypeLinks": [{"links": ["Invoice.LineItems.TaxRateRef.Id", "CreditNote.LineItems.TaxRateRef.Id", "Bill.LineItems.TaxRateRef.Id", "BillCreditNote.LineItems.TaxRateRef.Id"], "property": "Id"}]}], "totalResults": 17} + Zoho Books: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/d0b68840-db50-4bc3-b88c-96e225333fea/data/taxRates?page=1&pageSize=2"}, "next": {"href": "/companies/d0b68840-db50-4bc3-b88c-96e225333fea/data/taxRates?page=2&pageSize=2"}, "self": {"href": "/companies/d0b68840-db50-4bc3-b88c-96e225333fea/data/taxRates"}}, "pageNumber": 1, "pageSize": 2, "results": [{"code": "104957000000033027", "components": [{"isCompound": false, "name": "Standard Rate", "rate": 20}], "effectiveTaxRate": 20, "id": "104957000000033027", "modifiedDate": "2022-10-03T08:40:37Z", "name": "Standard Rate", "sourceModifiedDate": "2022-10-23T00:00:00Z", "status": "Active", "totalTaxRate": 20, "validDatatypeLinks": []}, {"code": "104957000000033031", "components": [{"isCompound": false, "name": "Reduced Rate", "rate": 5}], "effectiveTaxRate": 5, "id": "104957000000033031", "modifiedDate": "2022-10-03T08:40:37Z", "name": "Reduced Rate", "sourceModifiedDate": "2022-10-23T00:00:00Z", "status": "Active", "totalTaxRate": 5, "validDatatypeLinks": []}], "totalResults": 6} + Malformed query: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "400": + application/json: {"canBeRetried": "Unknown", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "detailedErrorCode": 0, "error": "Error parsing query - Malformed query.", "service": "ClientsApi", "statusCode": 400} + Unresolved property: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "400": + application/json: {"canBeRetried": "Unknown", "correlationId": "98457fb9956b7f9b4b2fd4f6e23bb5c8", "detailedErrorCode": 0, "error": "Error parsing query - Could not resolve property isCompleted on Dataset", "service": "PullApi", "statusCode": 400} + get-tracking-category: + Dynamics 365 Business Central: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + trackingCategoryId: "" + responses: + "200": + application/json: {"hasChildren": false, "id": "9e1dea89-1e34-ed11-97e8-000d3a872db9", "modifiedDate": "2023-03-27T14:21:18Z", "name": "A-000-A-Hundreds", "parentId": "d1391864-77cf-eb11-9f0a-0022481b404b", "sourceModifiedDate": "2022-09-14T11:19:28Z", "status": "Active", "subCategories": []} + FreshBooks: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + trackingCategoryId: "" + responses: + "200": + application/json: {"hasChildren": false, "id": "5389667", "modifiedDate": "2023-03-24T16:07:24Z", "name": "ABCustomCategory", "parentId": "4370491", "sourceModifiedDate": "2021-05-19T11:09:40", "status": "Active", "subCategories": []} + Oracle NetSuite: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + trackingCategoryId: "" + responses: + "200": + application/json: {"hasChildren": false, "id": "CostEstimateType-AVGCOST", "modifiedDate": "2023-01-30T14:46:52Z", "name": "Average Cost", "sourceModifiedDate": "2022-10-23T00:00:00Z", "status": "Active", "subCategories": []} + QuickBooks Desktop: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + trackingCategoryId: "" + responses: + "200": + application/json: {"hasChildren": true, "id": "80000008-1734278594", "modifiedDate": "2023-04-26T09:12:46Z", "name": "ClassWithSub", "sourceModifiedDate": "2024-12-15T16:03:14", "status": "Active"} + QuickBooks Online Sandbox: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + trackingCategoryId: "" + responses: + "200": + application/json: {"hasChildren": false, "id": "CLASS_5100000000000014491", "modifiedDate": "2023-04-26T09:35:57Z", "name": "A", "parentId": "CLASSES", "sourceModifiedDate": "2022-03-07T08:28:32Z", "status": "Active", "subCategories": []} + Sage 50 (UK): + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + trackingCategoryId: "" + responses: + "200": + application/json: {"hasChildren": false, "id": "department_10", "modifiedDate": "2023-03-30T14:42:37Z", "name": "", "parentId": "DEPARTMENTS", "sourceModifiedDate": "2022-11-25T09:43:54", "status": "Active", "subCategories": []} + Sage Business Cloud Accounting: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + trackingCategoryId: "" + responses: + "200": + application/json: {"hasChildren": false, "id": "department_0", "modifiedDate": "2022-07-27T17:41:22Z", "name": "BallparkContracting", "sourceModifiedDate": "2022-03-22T15:33:21", "status": "Active", "subCategories": []} + Sage Intacct: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + trackingCategoryId: "" + responses: + "200": + application/json: {"hasChildren": false, "id": "WAREHOUSE-2", "modifiedDate": "2023-04-04T16:32:02Z", "name": "200", "parentId": "WAREHOUSE", "sourceModifiedDate": "2020-04-26T05:26:46", "status": "Active", "subCategories": []} + Xero: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + trackingCategoryId: "" + responses: + "200": + application/json: {"hasChildren": false, "id": "dba3d4da-f9ed-4eee-8e0b-452d11fdb1fa", "modifiedDate": "2023-03-15T20:37:11Z", "name": "Eastside", "parentId": "9d8ad8f6-0d0f-41e0-8851-ef47e8b54ae6", "sourceModifiedDate": "2022-10-23T00:00:00Z", "status": "Active", "subCategories": []} + Zoho Books: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + trackingCategoryId: "" + responses: + "200": + application/json: {"hasChildren": false, "id": "104957000000000323-104957000001510028", "modifiedDate": "2022-10-03T08:40:39Z", "name": "Down", "parentId": "104957000000000323", "sourceModifiedDate": "2022-10-23T00:00:00Z", "status": "Active", "subCategories": []} + Unauthorized: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + trackingCategoryId: "" + responses: + "401": + application/json: {"canBeRetried": "Unknown", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "detailedErrorCode": 0, "error": "Unauthorized", "service": "PublicApi", "statusCode": 401} + list-tracking-categories: + "": + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/{id}/data/{dataType}?page=1&pageSize=10"}, "self": {"href": "/companies/{id}/data/{dataType}"}}, "pageNumber": 1, "pageSize": 10, "results": [{"hasChildren": true, "id": "string", "modifiedDate": "2022-10-23T00:00:00Z", "name": "string", "parentId": "string", "sourceModifiedDate": "2022-10-23T00:00:00Z", "status": "Unknown"}], "totalResults": 1} + "400": {} + Dynamics 365 Business Central: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/d6849caf-c146-41be-8335-b73346e3bd84/data/trackingCategories?page=1&pageSize=2"}, "next": {"href": "/companies/d6849caf-c146-41be-8335-b73346e3bd84/data/trackingCategories?page=2&pageSize=2"}, "self": {"href": "/companies/d6849caf-c146-41be-8335-b73346e3bd84/data/trackingCategories"}}, "pageNumber": 1, "pageSize": 2, "results": [{"hasChildren": false, "id": "9e1dea89-1e34-ed11-97e8-000d3a872db9", "modifiedDate": "2023-03-27T14:21:18Z", "name": "A-000-A-Hundreds", "parentId": "d1391864-77cf-eb11-9f0a-0022481b404b", "sourceModifiedDate": "2022-09-14T11:19:28Z", "status": "Active"}, {"hasChildren": false, "id": "ffc4c780-77cf-eb11-9f0a-0022481b404b", "modifiedDate": "2023-03-27T14:21:18Z", "name": "A-100-A-100 Name", "parentId": "d1391864-77cf-eb11-9f0a-0022481b404b", "sourceModifiedDate": "2021-06-17T14:25:28Z", "status": "Active"}], "totalResults": 36} + FreshBooks: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/3691c49e-0db4-4172-b3ab-e4084c365013/data/trackingCategories?page=1&pageSize=2"}, "next": {"href": "/companies/3691c49e-0db4-4172-b3ab-e4084c365013/data/trackingCategories?page=2&pageSize=2"}, "self": {"href": "/companies/3691c49e-0db4-4172-b3ab-e4084c365013/data/trackingCategories"}}, "pageNumber": 1, "pageSize": 2, "results": [{"hasChildren": false, "id": "5389667", "modifiedDate": "2023-03-24T16:07:24Z", "name": "ABCustomCategory", "parentId": "4370491", "sourceModifiedDate": "2021-05-19T11:09:40", "status": "Active"}, {"hasChildren": false, "id": "4370499", "modifiedDate": "2023-03-24T16:07:24Z", "name": "Accident Insurance", "parentId": "4370496", "sourceModifiedDate": "2021-07-26T09:42:18", "status": "Active"}], "totalResults": 82} + Oracle NetSuite: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/d5074b08-6a34-4b06-a742-236edf5dc4f1/data/trackingCategories?page=1&pageSize=2"}, "next": {"href": "/companies/d5074b08-6a34-4b06-a742-236edf5dc4f1/data/trackingCategories?page=2&pageSize=2"}, "self": {"href": "/companies/d5074b08-6a34-4b06-a742-236edf5dc4f1/data/trackingCategories"}}, "pageNumber": 1, "pageSize": 2, "results": [{"hasChildren": false, "id": "CostEstimateType-AVGCOST", "modifiedDate": "2023-01-30T14:46:52Z", "name": "Average Cost", "sourceModifiedDate": "2022-10-23T00:00:00Z", "status": "Active"}, {"hasChildren": false, "id": "classification-1", "modifiedDate": "2023-01-30T14:46:52Z", "name": "Class 1", "sourceModifiedDate": "2022-11-17T11:47:34", "status": "Active"}], "totalResults": 18} + QuickBooks Desktop: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/fc72ba08-af13-4474-b28a-01dcfa6cfb51/data/trackingCategories?page=1&pageSize=2"}, "next": {"href": "/companies/fc72ba08-af13-4474-b28a-01dcfa6cfb51/data/trackingCategories?page=2&pageSize=2"}, "self": {"href": "/companies/fc72ba08-af13-4474-b28a-01dcfa6cfb51/data/trackingCategories"}}, "pageNumber": 1, "pageSize": 2, "results": [{"hasChildren": true, "id": "80000008-1734278594", "modifiedDate": "2023-04-26T09:12:46Z", "name": "ClassWithSub", "sourceModifiedDate": "2024-12-15T16:03:14", "status": "Active"}, {"hasChildren": false, "id": "8000000A-1734278615", "modifiedDate": "2023-04-26T09:12:46Z", "name": "Incative", "sourceModifiedDate": "2024-12-15T16:09:02", "status": "Active"}], "totalResults": 6} + QuickBooks Online Sandbox: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/5a7f3597-36e1-4216-86fe-289ad36088a6/data/trackingCategories?page=1&pageSize=2"}, "next": {"href": "/companies/5a7f3597-36e1-4216-86fe-289ad36088a6/data/trackingCategories?page=2&pageSize=2"}, "self": {"href": "/companies/5a7f3597-36e1-4216-86fe-289ad36088a6/data/trackingCategories"}}, "pageNumber": 1, "pageSize": 2, "results": [{"hasChildren": false, "id": "CLASS_5100000000000014491", "modifiedDate": "2023-04-26T09:35:57Z", "name": "A", "parentId": "CLASSES", "sourceModifiedDate": "2022-03-07T08:28:32Z", "status": "Active"}, {"hasChildren": false, "id": "CLASS_200200000000000009374", "modifiedDate": "2023-04-26T09:35:57Z", "name": "Australia (deleted)", "parentId": "CLASSES", "sourceModifiedDate": "2016-11-04T09:28:00Z", "status": "Archived"}], "totalResults": 23} + Sage 200cloud: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/93c21e2d-049c-4d24-b41b-57e61c30b69e/data/trackingCategories?page=1&pageSize=2"}, "next": {"href": "/companies/93c21e2d-049c-4d24-b41b-57e61c30b69e/data/trackingCategories?page=2&pageSize=2"}, "self": {"href": "/companies/93c21e2d-049c-4d24-b41b-57e61c30b69e/data/trackingCategories"}}, "pageNumber": 1, "pageSize": 2, "results": [{"hasChildren": false, "id": "__DEPARTMENTS/3", "modifiedDate": "2022-10-14T09:35:52Z", "name": "Accounts", "parentId": "__DEPARTMENTS", "sourceModifiedDate": "2020-02-28T14:23:46Z", "status": "Active"}, {"hasChildren": false, "id": "__DEPARTMENTS/4", "modifiedDate": "2022-10-14T09:35:52Z", "name": "Admin", "parentId": "__DEPARTMENTS", "sourceModifiedDate": "2020-02-28T14:23:46Z", "status": "Active"}], "totalResults": 24} + Sage 50 (UK): + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/cf5f2a47-2990-4221-bae6-0c19c86ac304/data/trackingCategories?page=1&pageSize=2"}, "next": {"href": "/companies/cf5f2a47-2990-4221-bae6-0c19c86ac304/data/trackingCategories?page=2&pageSize=2"}, "self": {"href": "/companies/cf5f2a47-2990-4221-bae6-0c19c86ac304/data/trackingCategories"}}, "pageNumber": 1, "pageSize": 2, "results": [{"hasChildren": false, "id": "department_10", "modifiedDate": "2023-03-30T14:42:37Z", "name": "", "parentId": "DEPARTMENTS", "sourceModifiedDate": "2022-11-25T09:43:54", "status": "Active"}, {"hasChildren": false, "id": "department_100", "modifiedDate": "2023-03-30T14:42:37Z", "name": "", "parentId": "DEPARTMENTS", "sourceModifiedDate": "2022-11-25T09:43:54", "status": "Active"}], "totalResults": 1022} + Sage Business Cloud Accounting: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/f4aae110-ca17-4cd4-8aaa-a3136b1cf0b1/data/trackingCategories?page=1&pageSize=2"}, "next": {"href": "/companies/f4aae110-ca17-4cd4-8aaa-a3136b1cf0b1/data/trackingCategories?page=2&pageSize=2"}, "self": {"href": "/companies/f4aae110-ca17-4cd4-8aaa-a3136b1cf0b1/data/trackingCategories"}}, "pageNumber": 1, "pageSize": 2, "results": [{"hasChildren": false, "id": "department_0", "modifiedDate": "2022-07-27T17:41:22Z", "name": "BallparkContracting", "sourceModifiedDate": "2022-03-22T15:33:21", "status": "Active"}, {"hasChildren": true, "id": "department_1", "modifiedDate": "2022-07-27T17:41:22Z", "name": "BaseMountainConstruction", "sourceModifiedDate": "2021-06-23T15:33:21", "status": "Active"}], "totalResults": 15} + Sage Intacct: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/df02b289-cb16-4964-ac4d-9fd60b04538e/data/trackingCategories?page=1&pageSize=2"}, "next": {"href": "/companies/df02b289-cb16-4964-ac4d-9fd60b04538e/data/trackingCategories?page=2&pageSize=2"}, "self": {"href": "/companies/df02b289-cb16-4964-ac4d-9fd60b04538e/data/trackingCategories"}}, "pageNumber": 1, "pageSize": 2, "results": [{"hasChildren": false, "id": "WAREHOUSE-2", "modifiedDate": "2023-04-04T16:32:02Z", "name": "200", "parentId": "WAREHOUSE", "sourceModifiedDate": "2020-04-26T05:26:46", "status": "Active"}, {"hasChildren": false, "id": "WAREHOUSE-3", "modifiedDate": "2023-04-04T16:32:02Z", "name": "300", "parentId": "WAREHOUSE", "sourceModifiedDate": "2021-08-10T13:41:01", "status": "Active"}], "totalResults": 757} + Xero: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/5ced9667-a310-443a-a711-958d36377141/data/trackingCategories?page=1&pageSize=2"}, "next": {"href": "/companies/5ced9667-a310-443a-a711-958d36377141/data/trackingCategories?page=2&pageSize=2"}, "self": {"href": "/companies/5ced9667-a310-443a-a711-958d36377141/data/trackingCategories"}}, "pageNumber": 1, "pageSize": 2, "results": [{"hasChildren": false, "id": "dba3d4da-f9ed-4eee-8e0b-452d11fdb1fa", "modifiedDate": "2023-03-15T20:37:11Z", "name": "Eastside", "parentId": "9d8ad8f6-0d0f-41e0-8851-ef47e8b54ae6", "sourceModifiedDate": "2022-10-23T00:00:00Z", "status": "Active"}, {"hasChildren": false, "id": "34b9b859-07a9-451a-b4d3-effc9946634a", "modifiedDate": "2023-03-15T20:37:11Z", "name": "North", "parentId": "9d8ad8f6-0d0f-41e0-8851-ef47e8b54ae6", "sourceModifiedDate": "2022-10-23T00:00:00Z", "status": "Active"}], "totalResults": 5} + Zoho Books: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/d0b68840-db50-4bc3-b88c-96e225333fea/data/trackingCategories?page=1&pageSize=2"}, "next": {"href": "/companies/d0b68840-db50-4bc3-b88c-96e225333fea/data/trackingCategories?page=2&pageSize=2"}, "self": {"href": "/companies/d0b68840-db50-4bc3-b88c-96e225333fea/data/trackingCategories"}}, "pageNumber": 1, "pageSize": 2, "results": [{"hasChildren": false, "id": "104957000000000323-104957000001510028", "modifiedDate": "2022-10-03T08:40:39Z", "name": "Down", "parentId": "104957000000000323", "sourceModifiedDate": "2022-10-23T00:00:00Z", "status": "Active"}, {"hasChildren": false, "id": "104957000000000323-104957000001510024", "modifiedDate": "2022-10-03T08:40:39Z", "name": "East", "parentId": "104957000000000323", "sourceModifiedDate": "2022-10-23T00:00:00Z", "status": "Active"}], "totalResults": 11} + Malformed query: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "400": + application/json: {"canBeRetried": "Unknown", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "detailedErrorCode": 0, "error": "Error parsing query - Malformed query.", "service": "ClientsApi", "statusCode": 400} + Unresolved property: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "400": + application/json: {"canBeRetried": "Unknown", "correlationId": "98457fb9956b7f9b4b2fd4f6e23bb5c8", "detailedErrorCode": 0, "error": "Error parsing query - Could not resolve property isCompleted on Dataset", "service": "PullApi", "statusCode": 400} + get-push-operation: + Unauthorized: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + pushOperationKey: "b888f774-3e7c-4135-a18c-6b985523c4bc" + responses: + "401": + application/json: {"canBeRetried": "Unknown", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "detailedErrorCode": 0, "error": "Unauthorized", "service": "PublicApi", "statusCode": 401} + list-push-operations: + "": + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "200": + application/json: {"_links": {"current": {"href": "/companies/{id}/data/{dataType}?page=1&pageSize=10"}, "self": {"href": "/companies/{id}/data/{dataType}"}}, "pageNumber": 1, "pageSize": 10, "results": [{"changes": [{"recordRef": {"dataType": "invoices"}}, {"recordRef": {"dataType": "invoices"}}], "companyId": "8a210b68-6988-11ed-a1eb-0242ac120002", "completedOnUtc": "2022-10-23T00:00:00Z", "dataConnectionKey": "2e9d2c44-f675-40ba-8049-353bfcb5e171", "dataType": "invoices", "pushOperationKey": "232aa0b1-1b8a-4005-b71e-9e705d0e6e21", "requestedOnUtc": "2022-10-23T00:00:00Z", "status": "Failed", "statusCode": 425334}, {"changes": [{"recordRef": {"dataType": "invoices"}}], "companyId": "8a210b68-6988-11ed-a1eb-0242ac120002", "completedOnUtc": "2022-10-23T00:00:00Z", "dataConnectionKey": "2e9d2c44-f675-40ba-8049-353bfcb5e171", "dataType": "invoices", "pushOperationKey": "18d6d461-2e0a-4ee1-8b9d-df121dc2a4c8", "requestedOnUtc": "2022-10-23T00:00:00Z", "status": "Failed", "statusCode": 993305}, {"changes": [{"recordRef": {"dataType": "invoices"}}, {"recordRef": {"dataType": "invoices"}}], "companyId": "8a210b68-6988-11ed-a1eb-0242ac120002", "completedOnUtc": "2022-10-23T00:00:00Z", "dataConnectionKey": "2e9d2c44-f675-40ba-8049-353bfcb5e171", "dataType": "invoices", "pushOperationKey": "51a70cfc-8fe0-47fb-9c60-ab960d5611ff", "requestedOnUtc": "2022-10-23T00:00:00Z", "status": "Failed", "statusCode": 212921}], "totalResults": 1} + "400": {} + Malformed query: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "400": + application/json: {"canBeRetried": "Unknown", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "detailedErrorCode": 0, "error": "Error parsing query - Malformed query.", "service": "ClientsApi", "statusCode": 400} + Unresolved property: + parameters: + path: + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" + query: + page: 1 + pageSize: 100 + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" + orderBy: "-modifiedDate" + responses: + "400": + application/json: {"canBeRetried": "Unknown", "correlationId": "98457fb9956b7f9b4b2fd4f6e23bb5c8", "detailedErrorCode": 0, "error": "Error parsing query - Could not resolve property isCompleted on Dataset", "service": "PullApi", "statusCode": 400} diff --git a/previous-versions/sync-for-payables-version-1/.speakeasy/gen.yaml b/previous-versions/sync-for-payables-version-1/.speakeasy/gen.yaml index 05efbb7dc..d741c2791 100644 --- a/previous-versions/sync-for-payables-version-1/.speakeasy/gen.yaml +++ b/previous-versions/sync-for-payables-version-1/.speakeasy/gen.yaml @@ -7,15 +7,25 @@ generation: nameResolutionDec2023: false parameterOrderingFeb2024: false requestResponseComponentNamesFeb2024: false - telemetryEnabled: true auth: oAuth2ClientCredentialsEnabled: false + telemetryEnabled: true python: - version: 3.2.0 + version: 3.2.1 + additionalDependencies: + dev: {} + main: {} author: Codat + authors: + - Speakeasy clientServerStatusCodesAsErrors: true description: Push expenses to accounting software. + enumFormat: enum + fixFlags: + responseRequiredSep2024: false flattenGlobalSecurity: false + flattenRequests: false + flatteningOrder: parameters-first imports: option: openapi paths: @@ -26,15 +36,8 @@ python: webhooks: models/webhooks inputModelSuffix: input maxMethodParams: 0 + methodArguments: infer-optional-args outputModelSuffix: output packageName: codat-sync-for-payables-version-1 - additionalDependencies: - dev: {} - main: {} - authors: - - Speakeasy - enumFormat: enum - flattenRequests: false - methodArguments: infer-optional-args responseFormat: flat templateVersion: v2 diff --git a/previous-versions/sync-for-payables-version-1/.vscode/settings.json b/previous-versions/sync-for-payables-version-1/.vscode/settings.json new file mode 100644 index 000000000..8d79f0abb --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/.vscode/settings.json @@ -0,0 +1,6 @@ +{ + "python.testing.pytestArgs": ["tests", "-vv"], + "python.testing.unittestEnabled": false, + "python.testing.pytestEnabled": true, + "pylint.args": ["--rcfile=pylintrc"] +} diff --git a/previous-versions/sync-for-payables-version-1/CONTRIBUTING.md b/previous-versions/sync-for-payables-version-1/CONTRIBUTING.md new file mode 100644 index 000000000..d585717fc --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/CONTRIBUTING.md @@ -0,0 +1,26 @@ +# Contributing to This Repository + +Thank you for your interest in contributing to this repository. Please note that this repository contains generated code. As such, we do not accept direct changes or pull requests. Instead, we encourage you to follow the guidelines below to report issues and suggest improvements. + +## How to Report Issues + +If you encounter any bugs or have suggestions for improvements, please open an issue on GitHub. When reporting an issue, please provide as much detail as possible to help us reproduce the problem. This includes: + +- A clear and descriptive title +- Steps to reproduce the issue +- Expected and actual behavior +- Any relevant logs, screenshots, or error messages +- Information about your environment (e.g., operating system, software versions) + - For example can be collected using the `npx envinfo` command from your terminal if you have Node.js installed + +## Issue Triage and Upstream Fixes + +We will review and triage issues as quickly as possible. Our goal is to address bugs and incorporate improvements in the upstream source code. Fixes will be included in the next generation of the generated code. + +## Contact + +If you have any questions or need further assistance, please feel free to reach out by opening an issue. + +Thank you for your understanding and cooperation! + +The Maintainers diff --git a/previous-versions/sync-for-payables-version-1/README.md b/previous-versions/sync-for-payables-version-1/README.md index fcc87032e..ceb3cb573 100644 --- a/previous-versions/sync-for-payables-version-1/README.md +++ b/previous-versions/sync-for-payables-version-1/README.md @@ -4,46 +4,191 @@ Streamline your customers' accounts payable workflow. + +## Summary + +Sync for Payables: The API for Sync for Payables. + +Sync for Payables is an API and a set of supporting tools built to help integrate with your customers' accounting software, and keep their supplier information, invoices, and payments in sync. + +[Explore product](https://docs.codat.io/payables/overview) | [See OpenAPI spec](https://github.com/codatio/oas) + +--- + +## Endpoints + +| Endpoints | Description | +| :- |:- | +| Companies | Create and manage your SMB users' companies. | +| Connections | Create new and manage existing data connections for a company. | +| Accounts | Get, create, and update Accounts. | +| Bank accounts | Get, create, and update Bank accounts. | +| Bills | Get, create, and update Bills. | +| Bill credit notes | Get, create, and update Bill credit notes. | +| Bill payments | Get, create, and update Bill payments. | +| Journals | Get, create, and update Journals. | +| Journal entries | Get, create, and update Journal entries. | +| Payment methods | Get, create, and update Payment methods. | +| Suppliers | Get, create, and update Suppliers. | +| Tax rates | Get, create, and update Tax rates. | +| Tracking categories | Get, create, and update Tracking categories. | +| Company info | View company profile from the source platform. | +| Push operations | View historic push operations. | +| Manage data | Control how data is retrieved from an integration. | + + + + +## Table of Contents + +* [SDK Installation](#sdk-installation) +* [IDE Support](#ide-support) +* [SDK Example Usage](#sdk-example-usage) +* [Available Resources and Operations](#available-resources-and-operations) +* [File uploads](#file-uploads) +* [Retries](#retries) +* [Error Handling](#error-handling) +* [Server Selection](#server-selection) +* [Custom HTTP Client](#custom-http-client) +* [Authentication](#authentication) +* [Debugging](#debugging) + + ## SDK Installation +The SDK can be installed with either *pip* or *poetry* package managers. + +### PIP + +*PIP* is the default package installer for Python, enabling easy installation and management of packages from PyPI via the command line. + ```bash -pip install codat-sync-for-payables +pip install codat-sync-for-payables-version-1 +``` + +### Poetry + +*Poetry* is a modern tool that simplifies dependency management and package publishing by using a single `pyproject.toml` file to handle project metadata and dependencies. + +```bash +poetry add codat-sync-for-payables-version-1 ``` ## Example Usage + +## IDE Support + +### PyCharm + +Generally, the SDK will work well with most IDEs out of the box. However, when using PyCharm, you can enjoy much better integration with Pydantic by installing an additional plugin. + +- [PyCharm Pydantic Plugin](https://docs.pydantic.dev/latest/integrations/pycharm/) + + ## SDK Example Usage ### Example ```python -import codatsyncpayables -from codatsyncpayables.models import shared +# Synchronous Example +from codat_sync_for_payables_version_1 import CodatSyncPayables +from codat_sync_for_payables_version_1.models import shared -s = codatsyncpayables.CodatSyncPayables( +s = CodatSyncPayables( security=shared.Security( auth_header="Basic BASE_64_ENCODED(API_KEY)", ), ) -req = shared.CompanyRequestBody( - name='Bank of Dave', - description='Requested early access to the new financing scheme.', -) - -res = s.companies.create(req) +res = s.companies.create(request={ + "name": "Technicalium", + "description": "Requested early access to the new financing scheme.", +}) -if res.company is not None: +if res is not None: # handle response pass ``` + +
+ +The same SDK client can also be used to make asychronous requests by importing asyncio. +```python +# Asynchronous Example +import asyncio +from codat_sync_for_payables_version_1 import CodatSyncPayables +from codat_sync_for_payables_version_1.models import shared + +async def main(): + s = CodatSyncPayables( + 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 + +asyncio.run(main()) +``` ## Available Resources and Operations +
+Available methods + +### [accounts](docs/sdks/accounts/README.md) + +* [create](docs/sdks/accounts/README.md#create) - Create account +* [get](docs/sdks/accounts/README.md#get) - Get account +* [get_create_model](docs/sdks/accounts/README.md#get_create_model) - Get create account model +* [list](docs/sdks/accounts/README.md#list) - List accounts + +### [bank_accounts](docs/sdks/bankaccounts/README.md) + +* [create](docs/sdks/bankaccounts/README.md#create) - Create bank account +* [get_create_model](docs/sdks/bankaccounts/README.md#get_create_model) - Get create/update bank account model + +### [bill_credit_notes](docs/sdks/billcreditnotes/README.md) + +* [create](docs/sdks/billcreditnotes/README.md#create) - Create bill credit note +* [get](docs/sdks/billcreditnotes/README.md#get) - Get bill credit note +* [get_create_update_model](docs/sdks/billcreditnotes/README.md#get_create_update_model) - Get create/update bill credit note model +* [list](docs/sdks/billcreditnotes/README.md#list) - List bill credit notes +* [update](docs/sdks/billcreditnotes/README.md#update) - Update bill credit note + +### [bill_payments](docs/sdks/billpayments/README.md) + +* [create](docs/sdks/billpayments/README.md#create) - Create bill payments +* [delete](docs/sdks/billpayments/README.md#delete) - Delete bill payment +* [get](docs/sdks/billpayments/README.md#get) - Get bill payment +* [get_create_model](docs/sdks/billpayments/README.md#get_create_model) - Get create bill payment model +* [list](docs/sdks/billpayments/README.md#list) - List bill payments + +### [bills](docs/sdks/bills/README.md) + +* [create](docs/sdks/bills/README.md#create) - Create bill +* [delete](docs/sdks/bills/README.md#delete) - Delete bill +* [delete_attachment](docs/sdks/bills/README.md#delete_attachment) - Delete bill attachment +* [download_attachment](docs/sdks/bills/README.md#download_attachment) - Download bill attachment +* [get](docs/sdks/bills/README.md#get) - Get bill +* [get_attachment](docs/sdks/bills/README.md#get_attachment) - Get bill attachment +* [get_create_update_model](docs/sdks/bills/README.md#get_create_update_model) - Get create/update bill model +* [list](docs/sdks/bills/README.md#list) - List bills +* [list_attachments](docs/sdks/bills/README.md#list_attachments) - List bill attachments +* [update](docs/sdks/bills/README.md#update) - Update bill +* [upload_attachment](docs/sdks/bills/README.md#upload_attachment) - Upload bill attachment + + ### [companies](docs/sdks/companies/README.md) * [create](docs/sdks/companies/README.md#create) - Create company @@ -52,9 +197,9 @@ if res.company is not None: * [list](docs/sdks/companies/README.md#list) - List companies * [update](docs/sdks/companies/README.md#update) - Update company -### [bills](docs/sdks/bills/README.md) +### [company_info](docs/sdks/companyinfo/README.md) -* [list](docs/sdks/bills/README.md#list) - List bills +* [get_accounting_profile](docs/sdks/companyinfo/README.md#get_accounting_profile) - Get company accounting profile ### [connections](docs/sdks/connections/README.md) @@ -63,12 +208,93 @@ if res.company is not None: * [get](docs/sdks/connections/README.md#get) - Get connection * [list](docs/sdks/connections/README.md#list) - List connections * [unlink](docs/sdks/connections/README.md#unlink) - Unlink connection + +### [journal_entries](docs/sdks/journalentries/README.md) + +* [create](docs/sdks/journalentries/README.md#create) - Create journal entry +* [get_create_model](docs/sdks/journalentries/README.md#get_create_model) - Get create journal entry model + +### [journals](docs/sdks/journals/README.md) + +* [create](docs/sdks/journals/README.md#create) - Create journal +* [get](docs/sdks/journals/README.md#get) - Get journal +* [get_create_model](docs/sdks/journals/README.md#get_create_model) - Get create journal model +* [list](docs/sdks/journals/README.md#list) - List journals + +### [manage_data](docs/sdks/managedata/README.md) + +* [get](docs/sdks/managedata/README.md#get) - Get data status +* [get_pull_operation](docs/sdks/managedata/README.md#get_pull_operation) - Get pull operation +* [list_pull_operations](docs/sdks/managedata/README.md#list_pull_operations) - List pull operations +* [refresh_all_data_types](docs/sdks/managedata/README.md#refresh_all_data_types) - Refresh all data +* [refresh_data_type](docs/sdks/managedata/README.md#refresh_data_type) - Refresh data type + +### [payment_methods](docs/sdks/paymentmethods/README.md) + +* [get](docs/sdks/paymentmethods/README.md#get) - Get payment method +* [list](docs/sdks/paymentmethods/README.md#list) - List payment methods + +### [push_operations](docs/sdks/pushoperations/README.md) + +* [get](docs/sdks/pushoperations/README.md#get) - Get push operation +* [list](docs/sdks/pushoperations/README.md#list) - List push operations + +### [suppliers](docs/sdks/suppliers/README.md) + +* [create](docs/sdks/suppliers/README.md#create) - Create supplier +* [get](docs/sdks/suppliers/README.md#get) - Get supplier +* [get_create_update_model](docs/sdks/suppliers/README.md#get_create_update_model) - Get create/update supplier model +* [list](docs/sdks/suppliers/README.md#list) - List suppliers +* [update](docs/sdks/suppliers/README.md#update) - Update supplier + +### [tax_rates](docs/sdks/taxrates/README.md) + +* [get](docs/sdks/taxrates/README.md#get) - Get tax rate +* [list](docs/sdks/taxrates/README.md#list) - List all tax rates + +### [tracking_categories](docs/sdks/trackingcategories/README.md) + +* [get](docs/sdks/trackingcategories/README.md#get) - Get tracking categories +* [list](docs/sdks/trackingcategories/README.md#list) - List tracking categories + +
+ +## File uploads + +Certain SDK methods accept file objects as part of a request body or multi-part request. It is possible and typically recommended to upload files as a stream rather than reading the entire contents into memory. This avoids excessive memory consumption and potentially crashing with out-of-memory errors when working with very large files. The following example demonstrates how to attach a file stream to a request. + +> [!TIP] +> +> For endpoints that handle file uploads bytes arrays can also be used. However, using streams is recommended for large files. +> + +```python +from codat_sync_for_payables_version_1 import CodatSyncPayables +from codat_sync_for_payables_version_1.models import shared + +s = CodatSyncPayables( + security=shared.Security( + auth_header="Basic BASE_64_ENCODED(API_KEY)", + ), +) + +s.bills.upload_attachment(request={ + "bill_id": "EILBDVJVNUAGVKRQ", + "company_id": "8a210b68-6988-11ed-a1eb-0242ac120002", + "connection_id": "2e9d2c44-f675-40ba-8049-353bfcb5e171", +}) + +# Use the SDK ... + +``` + + ## Retries @@ -76,95 +302,103 @@ Some of the endpoints in this SDK support retries. If you use the SDK without an To change the default retry strategy for a single API call, simply provide a `RetryConfig` object to the call: ```python -import codatsyncpayables -from codatsyncpayables.models import shared +from codat_sync_for_payables_version_1 import CodatSyncPayables +from codat_sync_for_payables_version_1.models import shared from codatsyncpayables.utils import BackoffStrategy, RetryConfig -s = codatsyncpayables.CodatSyncPayables( +s = CodatSyncPayables( security=shared.Security( auth_header="Basic BASE_64_ENCODED(API_KEY)", ), ) -req = shared.CompanyRequestBody( - name='Bank of Dave', - description='Requested early access to the new financing scheme.', -) - -res = s.companies.create(req, - RetryConfig('backoff', BackoffStrategy(1, 50, 1.1, 100), False)) +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.company is not None: +if res is not None: # handle response pass + ``` If you'd like to override the default retry strategy for all operations that support retries, you can use the `retry_config` optional parameter when initializing the SDK: ```python -import codatsyncpayables -from codatsyncpayables.models import shared +from codat_sync_for_payables_version_1 import CodatSyncPayables +from codat_sync_for_payables_version_1.models import shared from codatsyncpayables.utils import BackoffStrategy, RetryConfig -s = codatsyncpayables.CodatSyncPayables( - retry_config=RetryConfig('backoff', BackoffStrategy(1, 50, 1.1, 100), False) +s = CodatSyncPayables( + retry_config=RetryConfig("backoff", BackoffStrategy(1, 50, 1.1, 100), False), security=shared.Security( auth_header="Basic BASE_64_ENCODED(API_KEY)", ), ) -req = shared.CompanyRequestBody( - name='Bank of Dave', - description='Requested early access to the new financing scheme.', -) - -res = s.companies.create(req) +res = s.companies.create(request={ + "name": "Technicalium", + "description": "Requested early access to the new financing scheme.", +}) -if res.company is not None: +if res is not None: # handle response pass + ``` ## Error Handling -Handling errors in this SDK should largely match your expectations. All operations return a response object or raise an error. If Error objects are specified in your OpenAPI Spec, the SDK will raise the appropriate Error type. +Handling errors in this SDK should largely match your expectations. All operations return a response object or raise an exception. + +By default, an API error will raise a errors.SDKError exception, which has the following properties: -| Error Object | Status Code | Content Type | -| --------------------------- | --------------------------- | --------------------------- | -| errors.ErrorMessage | 400,401,402,403,429,500,503 | application/json | -| errors.SDKError | 4x-5xx | */* | +| Property | Type | Description | +|-----------------|------------------|-----------------------| +| `.status_code` | *int* | The HTTP status code | +| `.message` | *str* | The error message | +| `.raw_response` | *httpx.Response* | The raw HTTP response | +| `.body` | *str* | The response content | + +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 | \*/\* | ### Example ```python -import codatsyncpayables -from codatsyncpayables.models import errors, shared +from codat_sync_for_payables_version_1 import CodatSyncPayables +from codat_sync_for_payables_version_1.models import errors, shared -s = codatsyncpayables.CodatSyncPayables( +s = CodatSyncPayables( security=shared.Security( auth_header="Basic BASE_64_ENCODED(API_KEY)", ), ) -req = shared.CompanyRequestBody( - name='Bank of Dave', - description='Requested early access to the new financing scheme.', -) - res = None try: - res = s.companies.create(req) + 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 exception + # handle e.data: errors.ErrorMessageData raise(e) except errors.SDKError as e: # handle exception raise(e) - -if res.company is not None: - # handle response - pass ``` @@ -182,26 +416,25 @@ You can override the default server globally by passing a server index to the `s #### Example ```python -import codatsyncpayables -from codatsyncpayables.models import shared +from codat_sync_for_payables_version_1 import CodatSyncPayables +from codat_sync_for_payables_version_1.models import shared -s = codatsyncpayables.CodatSyncPayables( +s = CodatSyncPayables( server_idx=0, security=shared.Security( auth_header="Basic BASE_64_ENCODED(API_KEY)", ), ) -req = shared.CompanyRequestBody( - name='Bank of Dave', - description='Requested early access to the new financing scheme.', -) - -res = s.companies.create(req) +res = s.companies.create(request={ + "name": "Technicalium", + "description": "Requested early access to the new financing scheme.", +}) -if res.company is not None: +if res is not None: # handle response pass + ``` @@ -209,42 +442,106 @@ if res.company is not None: 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: ```python -import codatsyncpayables -from codatsyncpayables.models import shared +from codat_sync_for_payables_version_1 import CodatSyncPayables +from codat_sync_for_payables_version_1.models import shared -s = codatsyncpayables.CodatSyncPayables( +s = CodatSyncPayables( server_url="https://api.codat.io", security=shared.Security( auth_header="Basic BASE_64_ENCODED(API_KEY)", ), ) -req = shared.CompanyRequestBody( - name='Bank of Dave', - description='Requested early access to the new financing scheme.', -) - -res = s.companies.create(req) +res = s.companies.create(request={ + "name": "Technicalium", + "description": "Requested early access to the new financing scheme.", +}) -if res.company is not None: +if res is not None: # handle response pass + ``` ## Custom HTTP Client -The Python SDK makes API calls using the [requests](https://pypi.org/project/requests/) HTTP library. In order to provide a convenient way to configure timeouts, cookies, proxies, custom headers, and other low-level configuration, you can initialize the SDK client with a custom `requests.Session` object. +The Python SDK makes API calls using the [httpx](https://www.python-httpx.org/) HTTP library. In order to provide a convenient way to configure timeouts, cookies, proxies, custom headers, and other low-level configuration, you can initialize the SDK client with your own HTTP client instance. +Depending on whether you are using the sync or async version of the SDK, you can pass an instance of `HttpClient` or `AsyncHttpClient` respectively, which are Protocol's ensuring that the client has the necessary methods to make API calls. +This allows you to wrap the client with your own custom logic, such as adding custom headers, logging, or error handling, or you can just pass an instance of `httpx.Client` or `httpx.AsyncClient` directly. For example, you could specify a header for every request that this sdk makes as follows: ```python -import codatsyncpayables -import requests +from codat_sync_for_payables_version_1 import CodatSyncPayables +import httpx -http_client = requests.Session() -http_client.headers.update({'x-custom-header': 'someValue'}) -s = codatsyncpayables.CodatSyncPayables(client: http_client) +http_client = httpx.Client(headers={"x-custom-header": "someValue"}) +s = CodatSyncPayables(client=http_client) +``` + +or you could wrap the client with your own custom logic: +```python +from codat_sync_for_payables_version_1 import CodatSyncPayables +from codat_sync_for_payables_version_1.httpclient import AsyncHttpClient +import httpx + +class CustomClient(AsyncHttpClient): + client: AsyncHttpClient + + def __init__(self, client: AsyncHttpClient): + self.client = client + + async def send( + self, + request: httpx.Request, + *, + stream: bool = False, + auth: Union[ + httpx._types.AuthTypes, httpx._client.UseClientDefault, None + ] = httpx.USE_CLIENT_DEFAULT, + follow_redirects: Union[ + bool, httpx._client.UseClientDefault + ] = httpx.USE_CLIENT_DEFAULT, + ) -> httpx.Response: + request.headers["Client-Level-Header"] = "added by client" + + return await self.client.send( + request, stream=stream, auth=auth, follow_redirects=follow_redirects + ) + + def build_request( + self, + method: str, + url: httpx._types.URLTypes, + *, + content: Optional[httpx._types.RequestContent] = None, + data: Optional[httpx._types.RequestData] = None, + files: Optional[httpx._types.RequestFiles] = None, + json: Optional[Any] = None, + params: Optional[httpx._types.QueryParamTypes] = None, + headers: Optional[httpx._types.HeaderTypes] = None, + cookies: Optional[httpx._types.CookieTypes] = None, + timeout: Union[ + httpx._types.TimeoutTypes, httpx._client.UseClientDefault + ] = httpx.USE_CLIENT_DEFAULT, + extensions: Optional[httpx._types.RequestExtensions] = None, + ) -> httpx.Request: + return self.client.build_request( + method, + url, + content=content, + data=data, + files=files, + json=json, + params=params, + headers=headers, + cookies=cookies, + timeout=timeout, + extensions=extensions, + ) + +s = CodatSyncPayables(async_client=CustomClient(httpx.AsyncClient())) ``` @@ -261,28 +558,42 @@ This SDK supports the following security scheme globally: You can set the security parameters through the `security` optional parameter when initializing the SDK client instance. For example: ```python -import codatsyncpayables -from codatsyncpayables.models import shared +from codat_sync_for_payables_version_1 import CodatSyncPayables +from codat_sync_for_payables_version_1.models import shared -s = codatsyncpayables.CodatSyncPayables( +s = CodatSyncPayables( security=shared.Security( auth_header="Basic BASE_64_ENCODED(API_KEY)", ), ) -req = shared.CompanyRequestBody( - name='Bank of Dave', - description='Requested early access to the new financing scheme.', -) - -res = s.companies.create(req) +res = s.companies.create(request={ + "name": "Technicalium", + "description": "Requested early access to the new financing scheme.", +}) -if res.company is not None: +if res is not None: # handle response pass + ``` + +## Debugging + +You can setup your SDK to emit debug logs for SDK requests and responses. + +You can pass your own logger class directly into your SDK. +```python +from codat_sync_for_payables_version_1 import CodatSyncPayables +import logging + +logging.basicConfig(level=logging.DEBUG) +s = CodatSyncPayables(debug_logger=logging.getLogger("codat_sync_for_payables_version_1")) +``` + + diff --git a/previous-versions/sync-for-payables-version-1/RELEASES.md b/previous-versions/sync-for-payables-version-1/RELEASES.md index bd86ba8a0..4cb1a014e 100644 --- a/previous-versions/sync-for-payables-version-1/RELEASES.md +++ b/previous-versions/sync-for-payables-version-1/RELEASES.md @@ -78,4 +78,14 @@ Based on: ### Generated - [python v3.2.0] sync-for-payables ### Releases -- [PyPI v3.2.0] https://pypi.org/project/codat-sync-for-payables/3.2.0 - sync-for-payables \ No newline at end of file +- [PyPI v3.2.0] https://pypi.org/project/codat-sync-for-payables/3.2.0 - sync-for-payables + +## 2024-10-21 16:00:53 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.420.0 (2.438.15) https://github.com/speakeasy-api/speakeasy +### Generated +- [python v3.2.1] previous-versions/sync-for-payables-version-1 +### Releases +- [PyPI v3.2.1] https://pypi.org/project/codat-sync-for-payables-version-1/3.2.1 - previous-versions/sync-for-payables-version-1 \ No newline at end of file diff --git a/previous-versions/sync-for-payables-version-1/USAGE.md b/previous-versions/sync-for-payables-version-1/USAGE.md index 15ac8feb4..3caa195d9 100644 --- a/previous-versions/sync-for-payables-version-1/USAGE.md +++ b/previous-versions/sync-for-payables-version-1/USAGE.md @@ -1,23 +1,48 @@ ```python -import codatsyncpayables -from codatsyncpayables.models import shared +# Synchronous Example +from codat_sync_for_payables_version_1 import CodatSyncPayables +from codat_sync_for_payables_version_1.models import shared -s = codatsyncpayables.CodatSyncPayables( +s = CodatSyncPayables( security=shared.Security( auth_header="Basic BASE_64_ENCODED(API_KEY)", ), ) -req = shared.CompanyRequestBody( - name='Bank of Dave', - description='Requested early access to the new financing scheme.', -) - -res = s.companies.create(req) +res = s.companies.create(request={ + "name": "Technicalium", + "description": "Requested early access to the new financing scheme.", +}) -if res.company is not None: +if res is not None: # handle response pass ``` + +
+ +The same SDK client can also be used to make asychronous requests by importing asyncio. +```python +# Asynchronous Example +import asyncio +from codat_sync_for_payables_version_1 import CodatSyncPayables +from codat_sync_for_payables_version_1.models import shared + +async def main(): + s = CodatSyncPayables( + 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 + +asyncio.run(main()) +``` \ No newline at end of file diff --git a/previous-versions/sync-for-payables-version-1/docs/models/errors/errormessage.md b/previous-versions/sync-for-payables-version-1/docs/models/errors/errormessage.md index 4c73e63ee..c24cd9acc 100644 --- a/previous-versions/sync-for-payables-version-1/docs/models/errors/errormessage.md +++ b/previous-versions/sync-for-payables-version-1/docs/models/errors/errormessage.md @@ -1,6 +1,6 @@ # ErrorMessage -The request made is not valid. +Your `query` parameter was not correctly formed ## Fields @@ -13,4 +13,4 @@ The request made is not valid. | `error` | *Optional[str]* | :heavy_minus_sign: | A brief description of the error. | | `service` | *Optional[str]* | :heavy_minus_sign: | Codat's service the returned the error. | | `status_code` | *Optional[int]* | :heavy_minus_sign: | The HTTP status code returned by the error. | -| `validation` | [Optional[shared.ErrorValidation]](../../models/shared/errorvalidation.md) | :heavy_minus_sign: | A human-readable object describing validation decisions Codat has made. If an operation has failed because of validation errors, they will be detailed here. | \ No newline at end of file +| `validation` | [OptionalNullable[shared.ErrorValidation]](../../models/shared/errorvalidation.md) | :heavy_minus_sign: | A human-readable object describing validation decisions Codat has made. If an operation has failed because of validation errors, they will be detailed here. | \ No newline at end of file diff --git a/previous-versions/sync-for-payables-version-1/docs/models/shared/billeventwebhook.md b/previous-versions/sync-for-payables-version-1/docs/models/operations/createaccountrequest.md similarity index 51% rename from previous-versions/sync-for-payables-version-1/docs/models/shared/billeventwebhook.md rename to previous-versions/sync-for-payables-version-1/docs/models/operations/createaccountrequest.md index 286ab0007..9e5155a0d 100644 --- a/previous-versions/sync-for-payables-version-1/docs/models/shared/billeventwebhook.md +++ b/previous-versions/sync-for-payables-version-1/docs/models/operations/createaccountrequest.md @@ -1,11 +1,11 @@ -# BillEventWebhook +# CreateAccountRequest ## Fields | Field | Type | Required | Description | Example | | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | -| `created_date` | *Optional[str]* | :heavy_minus_sign: | The datetime in UTC of when the webhook event was produced by Codat. | 2022-10-23 11:03:35 +0000 UTC | -| `id` | *Optional[str]* | :heavy_minus_sign: | Unique identifier of the bill event. | | -| `payload` | [Optional[shared.BillEventPayload]](../../models/shared/billeventpayload.md) | :heavy_minus_sign: | N/A | | -| `type` | *Optional[str]* | :heavy_minus_sign: | Type of webhook event. | payables.bill.created | \ No newline at end of file +| `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 | +| `account_prototype` | [Optional[shared.AccountPrototype]](../../models/shared/accountprototype.md) | :heavy_minus_sign: | N/A | | +| `timeout_in_minutes` | *Optional[int]* | :heavy_minus_sign: | Time limit for the push operation to complete before it is timed out. | | \ No newline at end of file diff --git a/previous-versions/sync-for-payables-version-1/docs/models/operations/createbankaccountrequest.md b/previous-versions/sync-for-payables-version-1/docs/models/operations/createbankaccountrequest.md new file mode 100644 index 000000000..a4ec1abee --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/docs/models/operations/createbankaccountrequest.md @@ -0,0 +1,11 @@ +# CreateBankAccountRequest + + +## 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 | +| `bank_account_prototype` | [Optional[shared.BankAccountPrototype]](../../models/shared/bankaccountprototype.md) | :heavy_minus_sign: | N/A | | +| `timeout_in_minutes` | *Optional[int]* | :heavy_minus_sign: | Time limit for the push operation to complete before it is timed out. | | \ No newline at end of file diff --git a/previous-versions/sync-for-payables-version-1/docs/models/operations/createbillcreditnoterequest.md b/previous-versions/sync-for-payables-version-1/docs/models/operations/createbillcreditnoterequest.md new file mode 100644 index 000000000..95ce1f8aa --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/docs/models/operations/createbillcreditnoterequest.md @@ -0,0 +1,11 @@ +# CreateBillCreditNoteRequest + + +## 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 | +| `bill_credit_note` | [OptionalNullable[shared.BillCreditNote]](../../models/shared/billcreditnote.md) | :heavy_minus_sign: | N/A | {
"id": "6a0e9dfb-87b0-47d3-aaaf-9753ae9e757d",
"billCreditNoteNumber": "14763237",
"totalAmount": 693,
"remainingCredit": 693,
"status": "Submitted",
"issueDate": "2019-02-18T16:03:07.268Z",
"note": "Track separately",
"currency": "USD",
"lineItems": [
{
"description": "AcmeMagnet",
"unitAmount": 25,
"discountAmount": 0,
"quantity": 4,
"subTotal": 100,
"taxAmount": 10,
"totalAmount": 110,
"itemRef": {
"id": "3"
},
"taxRateRef": {
"id": "6c88aff3-7cb9-4980-a3d3-443e72e02498"
},
"accountRef": {
"id": "3f267b10-757d-44c0-bef9-20f70cc8fbe3"
},
"trackingCategoryRefs": [
{
"id": "department_1",
"name": "ACMERockets"
},
{
"id": "costcode_2",
"name": "ACM2-ACMESigns"
}
],
"createdFromLineRef": [
{
"id": "8462",
"dataType": "bill",
"lineNumber": 1
}
]
},
{
"description": "ACMEDisintegratingPistol",
"unitAmount": 25,
"discountAmount": 0,
"quantity": 3,
"subTotal": 75,
"taxAmount": 7.5,
"totalAmount": 82.5,
"itemRef": {
"id": "3abf0883-03f7-44c6-bc15-1372522d25e1"
},
"taxRateRef": {
"id": "6c88aff3-7cb9-4980-a3d3-443e72e02498"
},
"accountRef": {
"id": "3f267b10-757d-44c0-bef9-20f70cc8fbe3"
}
},
{
"description": "ACMEWhippedCreamDispenser",
"unitAmount": 52,
"discountAmount": 0,
"quantity": 6,
"subTotal": 312,
"taxAmount": 31.2,
"totalAmount": 343.2,
"itemRef": {
"id": "3691f3d9-0ff7-4358-8a93-bed31c1b4b03"
},
"taxRateRef": {
"id": "6c88aff3-7cb9-4980-a3d3-443e72e02498"
},
"accountRef": {
"id": "3f267b10-757d-44c0-bef9-20f70cc8fbe3"
}
},
{
"description": "ACMEJetPropelledPogoStick",
"unitAmount": 130,
"discountAmount": 0,
"quantity": 1,
"subTotal": 130,
"taxAmount": 27.3,
"totalAmount": 157.3,
"itemRef": {
"id": "075410d4-7edc-4936-ba52-9e1e43cbe300"
},
"taxRateRef": {
"id": "d606732b-db18-44d7-823b-7f15f42c32ea"
},
"accountRef": {
"id": "3f267b10-757d-44c0-bef9-20f70cc8fbe3"
}
}
],
"supplierRef": {
"id": "67C6A7A1-5E84-4AC4-B950-24A114E379D0",
"supplierName": "Chin's Gas and Oil"
},
"createdFromLineRef": {
"id": "8462",
"dataType": "bills",
"line": 1
}
} | +| `timeout_in_minutes` | *Optional[int]* | :heavy_minus_sign: | Time limit for the push operation to complete before it is timed out. | | \ No newline at end of file diff --git a/previous-versions/sync-for-payables-version-1/docs/models/operations/createbillpaymentrequest.md b/previous-versions/sync-for-payables-version-1/docs/models/operations/createbillpaymentrequest.md new file mode 100644 index 000000000..d590f045e --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/docs/models/operations/createbillpaymentrequest.md @@ -0,0 +1,11 @@ +# CreateBillPaymentRequest + + +## 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 | +| `bill_payment` | [OptionalNullable[shared.BillPayment]](../../models/shared/billpayment.md) | :heavy_minus_sign: | N/A | {
"totalAmount": 1000,
"lines": [
{
"amount": 1000,
"links": [
{
"type": "Bill",
"id": "x",
"amount": -1000
}
]
}
]
} | +| `timeout_in_minutes` | *Optional[int]* | :heavy_minus_sign: | Time limit for the push operation to complete before it is timed out. | | \ No newline at end of file diff --git a/previous-versions/sync-for-payables-version-1/docs/models/operations/createbillrequest.md b/previous-versions/sync-for-payables-version-1/docs/models/operations/createbillrequest.md new file mode 100644 index 000000000..e714ff78f --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/docs/models/operations/createbillrequest.md @@ -0,0 +1,11 @@ +# CreateBillRequest + + +## 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 | +| `bill` | [OptionalNullable[shared.Bill]](../../models/shared/bill.md) | :heavy_minus_sign: | N/A | | +| `timeout_in_minutes` | *Optional[int]* | :heavy_minus_sign: | Time limit for the push operation to complete before it is timed out. | | \ No newline at end of file diff --git a/previous-versions/sync-for-payables-version-1/docs/models/operations/createconnectionresponse.md b/previous-versions/sync-for-payables-version-1/docs/models/operations/createconnectionresponse.md deleted file mode 100644 index 4d113122e..000000000 --- a/previous-versions/sync-for-payables-version-1/docs/models/operations/createconnectionresponse.md +++ /dev/null @@ -1,11 +0,0 @@ -# CreateConnectionResponse - - -## Fields - -| Field | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `content_type` | *str* | :heavy_check_mark: | HTTP response content type for this operation | | -| `status_code` | *int* | :heavy_check_mark: | HTTP response status code for this operation | | -| `raw_response` | [requests.Response](https://requests.readthedocs.io/en/latest/api/#requests.Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | | -| `connection` | [Optional[shared.Connection]](../../models/shared/connection.md) | :heavy_minus_sign: | OK | {"id":"ee2eb431-c0fa-4dc9-93fa-d29781c12bcd","integrationId":"bf083d72-62c7-493e-aec9-81b4dbba7e2c","integrationKey":"dfxm","sourceId":"bdd831ce-eebd-4896-89a7-20e5ee8989ee","platformName":"Basiq","linkUrl":"https://link-api.codat.io/companies/86bd88cb-44ab-4dfb-b32f-87b19b14287f/connections/ee2eb431-c0fa-4dc9-93fa-d29781c12bcd/start","status":"Linked","lastSync":"2022-10-27T10:22:43.6464237Z","created":"2022-10-27T09:53:29Z","sourceType":"Banking"} | \ No newline at end of file diff --git a/previous-versions/sync-for-payables-version-1/docs/models/operations/createjournalentryrequest.md b/previous-versions/sync-for-payables-version-1/docs/models/operations/createjournalentryrequest.md new file mode 100644 index 000000000..d993b04b6 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/docs/models/operations/createjournalentryrequest.md @@ -0,0 +1,11 @@ +# CreateJournalEntryRequest + + +## 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 | +| `journal_entry` | [OptionalNullable[shared.JournalEntry]](../../models/shared/journalentry.md) | :heavy_minus_sign: | N/A | | +| `timeout_in_minutes` | *Optional[int]* | :heavy_minus_sign: | Time limit for the push operation to complete before it is timed out. | | \ No newline at end of file diff --git a/previous-versions/sync-for-payables-version-1/docs/models/operations/createjournalrequest.md b/previous-versions/sync-for-payables-version-1/docs/models/operations/createjournalrequest.md new file mode 100644 index 000000000..7d062265f --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/docs/models/operations/createjournalrequest.md @@ -0,0 +1,11 @@ +# CreateJournalRequest + + +## 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 | +| `journal_prototype` | [Optional[shared.JournalPrototype]](../../models/shared/journalprototype.md) | :heavy_minus_sign: | N/A | | +| `timeout_in_minutes` | *Optional[int]* | :heavy_minus_sign: | Time limit for the push operation to complete before it is timed out. | | \ No newline at end of file diff --git a/previous-versions/sync-for-payables-version-1/docs/models/operations/getcompanyresponse.md b/previous-versions/sync-for-payables-version-1/docs/models/operations/createsupplierrequest.md similarity index 84% rename from previous-versions/sync-for-payables-version-1/docs/models/operations/getcompanyresponse.md rename to previous-versions/sync-for-payables-version-1/docs/models/operations/createsupplierrequest.md index 9b44863d2..c5975b07a 100644 --- a/previous-versions/sync-for-payables-version-1/docs/models/operations/getcompanyresponse.md +++ b/previous-versions/sync-for-payables-version-1/docs/models/operations/createsupplierrequest.md @@ -1,11 +1,11 @@ -# GetCompanyResponse +# CreateSupplierRequest ## Fields -| Field | Type | Required | Description | Example | -| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `content_type` | *str* | :heavy_check_mark: | HTTP response content type for this operation | | -| `status_code` | *int* | :heavy_check_mark: | HTTP response status code for this operation | | -| `raw_response` | [requests.Response](https://requests.readthedocs.io/en/latest/api/#requests.Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | | -| `company` | [Optional[shared.Company]](../../models/shared/company.md) | :heavy_minus_sign: | OK | {"id":"0498e921-9b53-4396-a412-4f2f5983b0a2","name":"string","platform":"string","redirect":"https://link.codat.io/company/27628208-459c-46a2-a705-5641ce25f739","lastSync":"2022-01-01T12:00:00.000Z","created":"2022-01-01T12:00:00.000Z","createdByUserName":"string","dataConnections":[{"id":"ee2eb431-c0fa-4dc9-93fa-d29781c12bcd","integrationId":"bf083d72-62c7-493e-aec9-81b4dbba7e2c","integrationKey":"dfxm","sourceId":"bdd831ce-eebd-4896-89a7-20e5ee8989ee","platformName":"Basiq","linkUrl":"https://link-api.codat.io/companies/86bd88cb-44ab-4dfb-b32f-87b19b14287f/connections/ee2eb431-c0fa-4dc9-93fa-d29781c12bcd/start","status":"Linked","lastSync":"2022-10-27T10:22:43.6464237Z","created":"2022-10-27T09:53:29Z","sourceType":"Banking"}],"groups":[{"id":"d7a6c4b4-dc87-45f6-b803-62f466398680"}]} | \ No newline at end of file +| 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 | +| `supplier` | [OptionalNullable[shared.Supplier]](../../models/shared/supplier.md) | :heavy_minus_sign: | N/A | {
"id": "C520FFD4-F6F6-4FC2-A6D2-5D7088B2B14F",
"supplierName": "Kelly's Industrial Supplies",
"contactName": "Kelly's Industrial Supplies",
"emailAddress": "sales@kellysupplies.com",
"phone": "07999 999999",
"addresses": [
{
"type": "Billing",
"line1": "Unit 51",
"line2": "Bakersfield Industrial Estate",
"city": "Bakersfield",
"region": "California",
"country": "USA",
"postalcode": "93308"
}
],
"registrationNumber": "string",
"taxNumber": "string",
"status": "Unknown",
"defaultCurrency": "string",
"metadata": {
"isDeleted": true
},
"supplementalData": {
"content": {
"property1": {
"property1": null,
"property2": null
},
"property2": {
"property1": null,
"property2": null
}
}
},
"modifiedDate": "2022-10-23T00:00:00Z",
"sourceModifiedDate": "2022-10-23T00:00:00Z"
} | +| `timeout_in_minutes` | *Optional[int]* | :heavy_minus_sign: | Time limit for the push operation to complete before it is timed out. | | \ No newline at end of file diff --git a/previous-versions/sync-for-payables-version-1/docs/models/operations/deletebillattachmentrequest.md b/previous-versions/sync-for-payables-version-1/docs/models/operations/deletebillattachmentrequest.md new file mode 100644 index 000000000..54edaadeb --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/docs/models/operations/deletebillattachmentrequest.md @@ -0,0 +1,11 @@ +# DeleteBillAttachmentRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | +| `attachment_id` | *str* | :heavy_check_mark: | Unique identifier for an attachment. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `bill_id` | *str* | :heavy_check_mark: | Unique identifier for a bill. | 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/previous-versions/sync-for-payables-version-1/docs/models/operations/deletebillpaymentrequest.md b/previous-versions/sync-for-payables-version-1/docs/models/operations/deletebillpaymentrequest.md new file mode 100644 index 000000000..fce57f5d4 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/docs/models/operations/deletebillpaymentrequest.md @@ -0,0 +1,10 @@ +# DeleteBillPaymentRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------- | ------------------------------------- | ------------------------------------- | ------------------------------------- | ------------------------------------- | +| `bill_payment_id` | *str* | :heavy_check_mark: | Unique identifier for a bill payment. | | +| `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/previous-versions/sync-for-payables-version-1/docs/models/operations/deletebillrequest.md b/previous-versions/sync-for-payables-version-1/docs/models/operations/deletebillrequest.md new file mode 100644 index 000000000..fafa6c687 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/docs/models/operations/deletebillrequest.md @@ -0,0 +1,10 @@ +# DeleteBillRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | +| `bill_id` | *str* | :heavy_check_mark: | Unique identifier for a bill. | 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/previous-versions/sync-for-payables-version-1/docs/models/operations/deletecompanyresponse.md b/previous-versions/sync-for-payables-version-1/docs/models/operations/deletecompanyresponse.md deleted file mode 100644 index 7dfc00111..000000000 --- a/previous-versions/sync-for-payables-version-1/docs/models/operations/deletecompanyresponse.md +++ /dev/null @@ -1,10 +0,0 @@ -# DeleteCompanyResponse - - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | -| `content_type` | *str* | :heavy_check_mark: | HTTP response content type for this operation | -| `status_code` | *int* | :heavy_check_mark: | HTTP response status code for this operation | -| `raw_response` | [requests.Response](https://requests.readthedocs.io/en/latest/api/#requests.Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/previous-versions/sync-for-payables-version-1/docs/models/operations/deleteconnectionresponse.md b/previous-versions/sync-for-payables-version-1/docs/models/operations/deleteconnectionresponse.md deleted file mode 100644 index 373abf82a..000000000 --- a/previous-versions/sync-for-payables-version-1/docs/models/operations/deleteconnectionresponse.md +++ /dev/null @@ -1,10 +0,0 @@ -# DeleteConnectionResponse - - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | -| `content_type` | *str* | :heavy_check_mark: | HTTP response content type for this operation | -| `status_code` | *int* | :heavy_check_mark: | HTTP response status code for this operation | -| `raw_response` | [requests.Response](https://requests.readthedocs.io/en/latest/api/#requests.Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/previous-versions/sync-for-payables-version-1/docs/models/operations/downloadbillattachmentrequest.md b/previous-versions/sync-for-payables-version-1/docs/models/operations/downloadbillattachmentrequest.md new file mode 100644 index 000000000..1f1270b8e --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/docs/models/operations/downloadbillattachmentrequest.md @@ -0,0 +1,11 @@ +# DownloadBillAttachmentRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | +| `attachment_id` | *str* | :heavy_check_mark: | Unique identifier for an attachment. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `bill_id` | *str* | :heavy_check_mark: | Unique identifier for a bill. | 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/previous-versions/sync-for-payables-version-1/docs/models/operations/getaccountingprofilerequest.md b/previous-versions/sync-for-payables-version-1/docs/models/operations/getaccountingprofilerequest.md new file mode 100644 index 000000000..00f7adceb --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/docs/models/operations/getaccountingprofilerequest.md @@ -0,0 +1,8 @@ +# GetAccountingProfileRequest + + +## 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/previous-versions/sync-for-payables-version-1/docs/models/operations/getaccountrequest.md b/previous-versions/sync-for-payables-version-1/docs/models/operations/getaccountrequest.md new file mode 100644 index 000000000..a26f6ca69 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/docs/models/operations/getaccountrequest.md @@ -0,0 +1,9 @@ +# GetAccountRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | +| `account_id` | *str* | :heavy_check_mark: | Unique identifier for an account. | | +| `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/previous-versions/sync-for-payables-version-1/docs/models/operations/getbillattachmentrequest.md b/previous-versions/sync-for-payables-version-1/docs/models/operations/getbillattachmentrequest.md new file mode 100644 index 000000000..f70ca3eb2 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/docs/models/operations/getbillattachmentrequest.md @@ -0,0 +1,11 @@ +# GetBillAttachmentRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | +| `attachment_id` | *str* | :heavy_check_mark: | Unique identifier for an attachment. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `bill_id` | *str* | :heavy_check_mark: | Unique identifier for a bill. | 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/previous-versions/sync-for-payables-version-1/docs/models/operations/getbillcreditnoterequest.md b/previous-versions/sync-for-payables-version-1/docs/models/operations/getbillcreditnoterequest.md new file mode 100644 index 000000000..f5f59df16 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/docs/models/operations/getbillcreditnoterequest.md @@ -0,0 +1,9 @@ +# GetBillCreditNoteRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------- | ----------------------------------------- | ----------------------------------------- | ----------------------------------------- | ----------------------------------------- | +| `bill_credit_note_id` | *str* | :heavy_check_mark: | Unique identifier for a bill credit note. | | +| `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/previous-versions/sync-for-payables-version-1/docs/models/operations/getbillpaymentsrequest.md b/previous-versions/sync-for-payables-version-1/docs/models/operations/getbillpaymentsrequest.md new file mode 100644 index 000000000..a807176bc --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/docs/models/operations/getbillpaymentsrequest.md @@ -0,0 +1,9 @@ +# GetBillPaymentsRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------- | ------------------------------------- | ------------------------------------- | ------------------------------------- | ------------------------------------- | +| `bill_payment_id` | *str* | :heavy_check_mark: | Unique identifier for a bill payment. | | +| `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/previous-versions/sync-for-payables-version-1/docs/models/operations/getbillrequest.md b/previous-versions/sync-for-payables-version-1/docs/models/operations/getbillrequest.md new file mode 100644 index 000000000..b0994b594 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/docs/models/operations/getbillrequest.md @@ -0,0 +1,9 @@ +# GetBillRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | +| `bill_id` | *str* | :heavy_check_mark: | Unique identifier for a bill. | 13d946f0-c5d5-42bc-b092-97ece17923ab | +| `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/previous-versions/sync-for-payables-version-1/docs/models/operations/getcreateaccountmodelrequest.md b/previous-versions/sync-for-payables-version-1/docs/models/operations/getcreateaccountmodelrequest.md new file mode 100644 index 000000000..9fb89a3b5 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/docs/models/operations/getcreateaccountmodelrequest.md @@ -0,0 +1,9 @@ +# GetCreateAccountModelRequest + + +## 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 | \ No newline at end of file diff --git a/previous-versions/sync-for-payables-version-1/docs/models/operations/getcreatebankaccountsmodelrequest.md b/previous-versions/sync-for-payables-version-1/docs/models/operations/getcreatebankaccountsmodelrequest.md new file mode 100644 index 000000000..a45e1bb79 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/docs/models/operations/getcreatebankaccountsmodelrequest.md @@ -0,0 +1,9 @@ +# GetCreateBankAccountsModelRequest + + +## 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 | \ No newline at end of file diff --git a/previous-versions/sync-for-payables-version-1/docs/models/operations/getcreatebillpaymentmodelrequest.md b/previous-versions/sync-for-payables-version-1/docs/models/operations/getcreatebillpaymentmodelrequest.md new file mode 100644 index 000000000..b79cae435 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/docs/models/operations/getcreatebillpaymentmodelrequest.md @@ -0,0 +1,9 @@ +# GetCreateBillPaymentModelRequest + + +## 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 | \ No newline at end of file diff --git a/previous-versions/sync-for-payables-version-1/docs/models/operations/getcreatejournalentrymodelrequest.md b/previous-versions/sync-for-payables-version-1/docs/models/operations/getcreatejournalentrymodelrequest.md new file mode 100644 index 000000000..6637a942e --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/docs/models/operations/getcreatejournalentrymodelrequest.md @@ -0,0 +1,9 @@ +# GetCreateJournalEntryModelRequest + + +## 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 | \ No newline at end of file diff --git a/previous-versions/sync-for-payables-version-1/docs/models/operations/getcreatejournalmodelrequest.md b/previous-versions/sync-for-payables-version-1/docs/models/operations/getcreatejournalmodelrequest.md new file mode 100644 index 000000000..a915de882 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/docs/models/operations/getcreatejournalmodelrequest.md @@ -0,0 +1,9 @@ +# GetCreateJournalModelRequest + + +## 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 | \ No newline at end of file diff --git a/previous-versions/sync-for-payables-version-1/docs/models/operations/getcreateupdatebillcreditnotemodelrequest.md b/previous-versions/sync-for-payables-version-1/docs/models/operations/getcreateupdatebillcreditnotemodelrequest.md new file mode 100644 index 000000000..f09ea3aa6 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/docs/models/operations/getcreateupdatebillcreditnotemodelrequest.md @@ -0,0 +1,9 @@ +# GetCreateUpdateBillCreditNoteModelRequest + + +## 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 | \ No newline at end of file diff --git a/previous-versions/sync-for-payables-version-1/docs/models/operations/getcreateupdatebillmodelrequest.md b/previous-versions/sync-for-payables-version-1/docs/models/operations/getcreateupdatebillmodelrequest.md new file mode 100644 index 000000000..47cb051aa --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/docs/models/operations/getcreateupdatebillmodelrequest.md @@ -0,0 +1,9 @@ +# GetCreateUpdateBillModelRequest + + +## 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 | \ No newline at end of file diff --git a/previous-versions/sync-for-payables-version-1/docs/models/operations/getcreateupdatesuppliermodelrequest.md b/previous-versions/sync-for-payables-version-1/docs/models/operations/getcreateupdatesuppliermodelrequest.md new file mode 100644 index 000000000..24e95676d --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/docs/models/operations/getcreateupdatesuppliermodelrequest.md @@ -0,0 +1,9 @@ +# GetCreateUpdateSupplierModelRequest + + +## 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 | \ No newline at end of file diff --git a/previous-versions/sync-for-payables-version-1/docs/models/operations/getdatastatusdatastatuses.md b/previous-versions/sync-for-payables-version-1/docs/models/operations/getdatastatusdatastatuses.md new file mode 100644 index 000000000..f3e954e3c --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/docs/models/operations/getdatastatusdatastatuses.md @@ -0,0 +1,52 @@ +# GetDataStatusDataStatuses + +OK + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `account_transactions` | [Optional[shared.DataStatus]](../../models/shared/datastatus.md) | :heavy_minus_sign: | Describes the state of data in the Codat cache for a company and data type | {
"dataType": "string",
"lastSuccessfulSync": "2022-01-01T13:00:00.000Z",
"currentStatus": "string",
"latestSyncId": "ad474a37-2003-478e-baee-9af9f1ec2fe3",
"latestSuccessfulSyncId": "8220fc90-55b6-47bc-9417-48ac6ea93101"
} | +| `balance_sheet` | [Optional[shared.DataStatus]](../../models/shared/datastatus.md) | :heavy_minus_sign: | Describes the state of data in the Codat cache for a company and data type | {
"dataType": "string",
"lastSuccessfulSync": "2022-01-01T13:00:00.000Z",
"currentStatus": "string",
"latestSyncId": "ad474a37-2003-478e-baee-9af9f1ec2fe3",
"latestSuccessfulSyncId": "8220fc90-55b6-47bc-9417-48ac6ea93101"
} | +| `bank_accounts` | [Optional[shared.DataStatus]](../../models/shared/datastatus.md) | :heavy_minus_sign: | Describes the state of data in the Codat cache for a company and data type | {
"dataType": "string",
"lastSuccessfulSync": "2022-01-01T13:00:00.000Z",
"currentStatus": "string",
"latestSyncId": "ad474a37-2003-478e-baee-9af9f1ec2fe3",
"latestSuccessfulSyncId": "8220fc90-55b6-47bc-9417-48ac6ea93101"
} | +| `bank_transactions` | [Optional[shared.DataStatus]](../../models/shared/datastatus.md) | :heavy_minus_sign: | Describes the state of data in the Codat cache for a company and data type | {
"dataType": "string",
"lastSuccessfulSync": "2022-01-01T13:00:00.000Z",
"currentStatus": "string",
"latestSyncId": "ad474a37-2003-478e-baee-9af9f1ec2fe3",
"latestSuccessfulSyncId": "8220fc90-55b6-47bc-9417-48ac6ea93101"
} | +| `banking_account_balances` | [Optional[shared.DataStatus]](../../models/shared/datastatus.md) | :heavy_minus_sign: | Describes the state of data in the Codat cache for a company and data type | {
"dataType": "string",
"lastSuccessfulSync": "2022-01-01T13:00:00.000Z",
"currentStatus": "string",
"latestSyncId": "ad474a37-2003-478e-baee-9af9f1ec2fe3",
"latestSuccessfulSyncId": "8220fc90-55b6-47bc-9417-48ac6ea93101"
} | +| `banking_accounts` | [Optional[shared.DataStatus]](../../models/shared/datastatus.md) | :heavy_minus_sign: | Describes the state of data in the Codat cache for a company and data type | {
"dataType": "string",
"lastSuccessfulSync": "2022-01-01T13:00:00.000Z",
"currentStatus": "string",
"latestSyncId": "ad474a37-2003-478e-baee-9af9f1ec2fe3",
"latestSuccessfulSyncId": "8220fc90-55b6-47bc-9417-48ac6ea93101"
} | +| `banking_transaction_categories` | [Optional[shared.DataStatus]](../../models/shared/datastatus.md) | :heavy_minus_sign: | Describes the state of data in the Codat cache for a company and data type | {
"dataType": "string",
"lastSuccessfulSync": "2022-01-01T13:00:00.000Z",
"currentStatus": "string",
"latestSyncId": "ad474a37-2003-478e-baee-9af9f1ec2fe3",
"latestSuccessfulSyncId": "8220fc90-55b6-47bc-9417-48ac6ea93101"
} | +| `banking_transactions` | [Optional[shared.DataStatus]](../../models/shared/datastatus.md) | :heavy_minus_sign: | Describes the state of data in the Codat cache for a company and data type | {
"dataType": "string",
"lastSuccessfulSync": "2022-01-01T13:00:00.000Z",
"currentStatus": "string",
"latestSyncId": "ad474a37-2003-478e-baee-9af9f1ec2fe3",
"latestSuccessfulSyncId": "8220fc90-55b6-47bc-9417-48ac6ea93101"
} | +| `bill_credit_notes` | [Optional[shared.DataStatus]](../../models/shared/datastatus.md) | :heavy_minus_sign: | Describes the state of data in the Codat cache for a company and data type | {
"dataType": "string",
"lastSuccessfulSync": "2022-01-01T13:00:00.000Z",
"currentStatus": "string",
"latestSyncId": "ad474a37-2003-478e-baee-9af9f1ec2fe3",
"latestSuccessfulSyncId": "8220fc90-55b6-47bc-9417-48ac6ea93101"
} | +| `bill_payments` | [Optional[shared.DataStatus]](../../models/shared/datastatus.md) | :heavy_minus_sign: | Describes the state of data in the Codat cache for a company and data type | {
"dataType": "string",
"lastSuccessfulSync": "2022-01-01T13:00:00.000Z",
"currentStatus": "string",
"latestSyncId": "ad474a37-2003-478e-baee-9af9f1ec2fe3",
"latestSuccessfulSyncId": "8220fc90-55b6-47bc-9417-48ac6ea93101"
} | +| `bills` | [Optional[shared.DataStatus]](../../models/shared/datastatus.md) | :heavy_minus_sign: | Describes the state of data in the Codat cache for a company and data type | {
"dataType": "string",
"lastSuccessfulSync": "2022-01-01T13:00:00.000Z",
"currentStatus": "string",
"latestSyncId": "ad474a37-2003-478e-baee-9af9f1ec2fe3",
"latestSuccessfulSyncId": "8220fc90-55b6-47bc-9417-48ac6ea93101"
} | +| `cash_flow_statement` | [Optional[shared.DataStatus]](../../models/shared/datastatus.md) | :heavy_minus_sign: | Describes the state of data in the Codat cache for a company and data type | {
"dataType": "string",
"lastSuccessfulSync": "2022-01-01T13:00:00.000Z",
"currentStatus": "string",
"latestSyncId": "ad474a37-2003-478e-baee-9af9f1ec2fe3",
"latestSuccessfulSyncId": "8220fc90-55b6-47bc-9417-48ac6ea93101"
} | +| `chart_of_accounts` | [Optional[shared.DataStatus]](../../models/shared/datastatus.md) | :heavy_minus_sign: | Describes the state of data in the Codat cache for a company and data type | {
"dataType": "string",
"lastSuccessfulSync": "2022-01-01T13:00:00.000Z",
"currentStatus": "string",
"latestSyncId": "ad474a37-2003-478e-baee-9af9f1ec2fe3",
"latestSuccessfulSyncId": "8220fc90-55b6-47bc-9417-48ac6ea93101"
} | +| `commerce_company_info` | [Optional[shared.DataStatus]](../../models/shared/datastatus.md) | :heavy_minus_sign: | Describes the state of data in the Codat cache for a company and data type | {
"dataType": "string",
"lastSuccessfulSync": "2022-01-01T13:00:00.000Z",
"currentStatus": "string",
"latestSyncId": "ad474a37-2003-478e-baee-9af9f1ec2fe3",
"latestSuccessfulSyncId": "8220fc90-55b6-47bc-9417-48ac6ea93101"
} | +| `commerce_customers` | [Optional[shared.DataStatus]](../../models/shared/datastatus.md) | :heavy_minus_sign: | Describes the state of data in the Codat cache for a company and data type | {
"dataType": "string",
"lastSuccessfulSync": "2022-01-01T13:00:00.000Z",
"currentStatus": "string",
"latestSyncId": "ad474a37-2003-478e-baee-9af9f1ec2fe3",
"latestSuccessfulSyncId": "8220fc90-55b6-47bc-9417-48ac6ea93101"
} | +| `commerce_disputes` | [Optional[shared.DataStatus]](../../models/shared/datastatus.md) | :heavy_minus_sign: | Describes the state of data in the Codat cache for a company and data type | {
"dataType": "string",
"lastSuccessfulSync": "2022-01-01T13:00:00.000Z",
"currentStatus": "string",
"latestSyncId": "ad474a37-2003-478e-baee-9af9f1ec2fe3",
"latestSuccessfulSyncId": "8220fc90-55b6-47bc-9417-48ac6ea93101"
} | +| `commerce_locations` | [Optional[shared.DataStatus]](../../models/shared/datastatus.md) | :heavy_minus_sign: | Describes the state of data in the Codat cache for a company and data type | {
"dataType": "string",
"lastSuccessfulSync": "2022-01-01T13:00:00.000Z",
"currentStatus": "string",
"latestSyncId": "ad474a37-2003-478e-baee-9af9f1ec2fe3",
"latestSuccessfulSyncId": "8220fc90-55b6-47bc-9417-48ac6ea93101"
} | +| `commerce_orders` | [Optional[shared.DataStatus]](../../models/shared/datastatus.md) | :heavy_minus_sign: | Describes the state of data in the Codat cache for a company and data type | {
"dataType": "string",
"lastSuccessfulSync": "2022-01-01T13:00:00.000Z",
"currentStatus": "string",
"latestSyncId": "ad474a37-2003-478e-baee-9af9f1ec2fe3",
"latestSuccessfulSyncId": "8220fc90-55b6-47bc-9417-48ac6ea93101"
} | +| `commerce_payment_methods` | [Optional[shared.DataStatus]](../../models/shared/datastatus.md) | :heavy_minus_sign: | Describes the state of data in the Codat cache for a company and data type | {
"dataType": "string",
"lastSuccessfulSync": "2022-01-01T13:00:00.000Z",
"currentStatus": "string",
"latestSyncId": "ad474a37-2003-478e-baee-9af9f1ec2fe3",
"latestSuccessfulSyncId": "8220fc90-55b6-47bc-9417-48ac6ea93101"
} | +| `commerce_payments` | [Optional[shared.DataStatus]](../../models/shared/datastatus.md) | :heavy_minus_sign: | Describes the state of data in the Codat cache for a company and data type | {
"dataType": "string",
"lastSuccessfulSync": "2022-01-01T13:00:00.000Z",
"currentStatus": "string",
"latestSyncId": "ad474a37-2003-478e-baee-9af9f1ec2fe3",
"latestSuccessfulSyncId": "8220fc90-55b6-47bc-9417-48ac6ea93101"
} | +| `commerce_product_categories` | [Optional[shared.DataStatus]](../../models/shared/datastatus.md) | :heavy_minus_sign: | Describes the state of data in the Codat cache for a company and data type | {
"dataType": "string",
"lastSuccessfulSync": "2022-01-01T13:00:00.000Z",
"currentStatus": "string",
"latestSyncId": "ad474a37-2003-478e-baee-9af9f1ec2fe3",
"latestSuccessfulSyncId": "8220fc90-55b6-47bc-9417-48ac6ea93101"
} | +| `commerce_products` | [Optional[shared.DataStatus]](../../models/shared/datastatus.md) | :heavy_minus_sign: | Describes the state of data in the Codat cache for a company and data type | {
"dataType": "string",
"lastSuccessfulSync": "2022-01-01T13:00:00.000Z",
"currentStatus": "string",
"latestSyncId": "ad474a37-2003-478e-baee-9af9f1ec2fe3",
"latestSuccessfulSyncId": "8220fc90-55b6-47bc-9417-48ac6ea93101"
} | +| `commerce_tax_components` | [Optional[shared.DataStatus]](../../models/shared/datastatus.md) | :heavy_minus_sign: | Describes the state of data in the Codat cache for a company and data type | {
"dataType": "string",
"lastSuccessfulSync": "2022-01-01T13:00:00.000Z",
"currentStatus": "string",
"latestSyncId": "ad474a37-2003-478e-baee-9af9f1ec2fe3",
"latestSuccessfulSyncId": "8220fc90-55b6-47bc-9417-48ac6ea93101"
} | +| `commerce_transactions` | [Optional[shared.DataStatus]](../../models/shared/datastatus.md) | :heavy_minus_sign: | Describes the state of data in the Codat cache for a company and data type | {
"dataType": "string",
"lastSuccessfulSync": "2022-01-01T13:00:00.000Z",
"currentStatus": "string",
"latestSyncId": "ad474a37-2003-478e-baee-9af9f1ec2fe3",
"latestSuccessfulSyncId": "8220fc90-55b6-47bc-9417-48ac6ea93101"
} | +| `company` | [Optional[shared.DataStatus]](../../models/shared/datastatus.md) | :heavy_minus_sign: | Describes the state of data in the Codat cache for a company and data type | {
"dataType": "string",
"lastSuccessfulSync": "2022-01-01T13:00:00.000Z",
"currentStatus": "string",
"latestSyncId": "ad474a37-2003-478e-baee-9af9f1ec2fe3",
"latestSuccessfulSyncId": "8220fc90-55b6-47bc-9417-48ac6ea93101"
} | +| `credit_notes` | [Optional[shared.DataStatus]](../../models/shared/datastatus.md) | :heavy_minus_sign: | Describes the state of data in the Codat cache for a company and data type | {
"dataType": "string",
"lastSuccessfulSync": "2022-01-01T13:00:00.000Z",
"currentStatus": "string",
"latestSyncId": "ad474a37-2003-478e-baee-9af9f1ec2fe3",
"latestSuccessfulSyncId": "8220fc90-55b6-47bc-9417-48ac6ea93101"
} | +| `customers` | [Optional[shared.DataStatus]](../../models/shared/datastatus.md) | :heavy_minus_sign: | Describes the state of data in the Codat cache for a company and data type | {
"dataType": "string",
"lastSuccessfulSync": "2022-01-01T13:00:00.000Z",
"currentStatus": "string",
"latestSyncId": "ad474a37-2003-478e-baee-9af9f1ec2fe3",
"latestSuccessfulSyncId": "8220fc90-55b6-47bc-9417-48ac6ea93101"
} | +| `direct_costs` | [Optional[shared.DataStatus]](../../models/shared/datastatus.md) | :heavy_minus_sign: | Describes the state of data in the Codat cache for a company and data type | {
"dataType": "string",
"lastSuccessfulSync": "2022-01-01T13:00:00.000Z",
"currentStatus": "string",
"latestSyncId": "ad474a37-2003-478e-baee-9af9f1ec2fe3",
"latestSuccessfulSyncId": "8220fc90-55b6-47bc-9417-48ac6ea93101"
} | +| `direct_incomes` | [Optional[shared.DataStatus]](../../models/shared/datastatus.md) | :heavy_minus_sign: | Describes the state of data in the Codat cache for a company and data type | {
"dataType": "string",
"lastSuccessfulSync": "2022-01-01T13:00:00.000Z",
"currentStatus": "string",
"latestSyncId": "ad474a37-2003-478e-baee-9af9f1ec2fe3",
"latestSuccessfulSyncId": "8220fc90-55b6-47bc-9417-48ac6ea93101"
} | +| `invoices` | [Optional[shared.DataStatus]](../../models/shared/datastatus.md) | :heavy_minus_sign: | Describes the state of data in the Codat cache for a company and data type | {
"dataType": "string",
"lastSuccessfulSync": "2022-01-01T13:00:00.000Z",
"currentStatus": "string",
"latestSyncId": "ad474a37-2003-478e-baee-9af9f1ec2fe3",
"latestSuccessfulSyncId": "8220fc90-55b6-47bc-9417-48ac6ea93101"
} | +| `item_receipts` | [Optional[shared.DataStatus]](../../models/shared/datastatus.md) | :heavy_minus_sign: | Describes the state of data in the Codat cache for a company and data type | {
"dataType": "string",
"lastSuccessfulSync": "2022-01-01T13:00:00.000Z",
"currentStatus": "string",
"latestSyncId": "ad474a37-2003-478e-baee-9af9f1ec2fe3",
"latestSuccessfulSyncId": "8220fc90-55b6-47bc-9417-48ac6ea93101"
} | +| `items` | [Optional[shared.DataStatus]](../../models/shared/datastatus.md) | :heavy_minus_sign: | Describes the state of data in the Codat cache for a company and data type | {
"dataType": "string",
"lastSuccessfulSync": "2022-01-01T13:00:00.000Z",
"currentStatus": "string",
"latestSyncId": "ad474a37-2003-478e-baee-9af9f1ec2fe3",
"latestSuccessfulSyncId": "8220fc90-55b6-47bc-9417-48ac6ea93101"
} | +| `journal_entries` | [Optional[shared.DataStatus]](../../models/shared/datastatus.md) | :heavy_minus_sign: | Describes the state of data in the Codat cache for a company and data type | {
"dataType": "string",
"lastSuccessfulSync": "2022-01-01T13:00:00.000Z",
"currentStatus": "string",
"latestSyncId": "ad474a37-2003-478e-baee-9af9f1ec2fe3",
"latestSuccessfulSyncId": "8220fc90-55b6-47bc-9417-48ac6ea93101"
} | +| `journals` | [Optional[shared.DataStatus]](../../models/shared/datastatus.md) | :heavy_minus_sign: | Describes the state of data in the Codat cache for a company and data type | {
"dataType": "string",
"lastSuccessfulSync": "2022-01-01T13:00:00.000Z",
"currentStatus": "string",
"latestSyncId": "ad474a37-2003-478e-baee-9af9f1ec2fe3",
"latestSuccessfulSyncId": "8220fc90-55b6-47bc-9417-48ac6ea93101"
} | +| `payment_methods` | [Optional[shared.DataStatus]](../../models/shared/datastatus.md) | :heavy_minus_sign: | Describes the state of data in the Codat cache for a company and data type | {
"dataType": "string",
"lastSuccessfulSync": "2022-01-01T13:00:00.000Z",
"currentStatus": "string",
"latestSyncId": "ad474a37-2003-478e-baee-9af9f1ec2fe3",
"latestSuccessfulSyncId": "8220fc90-55b6-47bc-9417-48ac6ea93101"
} | +| `payments` | [Optional[shared.DataStatus]](../../models/shared/datastatus.md) | :heavy_minus_sign: | Describes the state of data in the Codat cache for a company and data type | {
"dataType": "string",
"lastSuccessfulSync": "2022-01-01T13:00:00.000Z",
"currentStatus": "string",
"latestSyncId": "ad474a37-2003-478e-baee-9af9f1ec2fe3",
"latestSuccessfulSyncId": "8220fc90-55b6-47bc-9417-48ac6ea93101"
} | +| `profit_and_loss` | [Optional[shared.DataStatus]](../../models/shared/datastatus.md) | :heavy_minus_sign: | Describes the state of data in the Codat cache for a company and data type | {
"dataType": "string",
"lastSuccessfulSync": "2022-01-01T13:00:00.000Z",
"currentStatus": "string",
"latestSyncId": "ad474a37-2003-478e-baee-9af9f1ec2fe3",
"latestSuccessfulSyncId": "8220fc90-55b6-47bc-9417-48ac6ea93101"
} | +| `purchase_orders` | [Optional[shared.DataStatus]](../../models/shared/datastatus.md) | :heavy_minus_sign: | Describes the state of data in the Codat cache for a company and data type | {
"dataType": "string",
"lastSuccessfulSync": "2022-01-01T13:00:00.000Z",
"currentStatus": "string",
"latestSyncId": "ad474a37-2003-478e-baee-9af9f1ec2fe3",
"latestSuccessfulSyncId": "8220fc90-55b6-47bc-9417-48ac6ea93101"
} | +| `sales_orders` | [Optional[shared.DataStatus]](../../models/shared/datastatus.md) | :heavy_minus_sign: | Describes the state of data in the Codat cache for a company and data type | {
"dataType": "string",
"lastSuccessfulSync": "2022-01-01T13:00:00.000Z",
"currentStatus": "string",
"latestSyncId": "ad474a37-2003-478e-baee-9af9f1ec2fe3",
"latestSuccessfulSyncId": "8220fc90-55b6-47bc-9417-48ac6ea93101"
} | +| `suppliers` | [Optional[shared.DataStatus]](../../models/shared/datastatus.md) | :heavy_minus_sign: | Describes the state of data in the Codat cache for a company and data type | {
"dataType": "string",
"lastSuccessfulSync": "2022-01-01T13:00:00.000Z",
"currentStatus": "string",
"latestSyncId": "ad474a37-2003-478e-baee-9af9f1ec2fe3",
"latestSuccessfulSyncId": "8220fc90-55b6-47bc-9417-48ac6ea93101"
} | +| `tax_rates` | [Optional[shared.DataStatus]](../../models/shared/datastatus.md) | :heavy_minus_sign: | Describes the state of data in the Codat cache for a company and data type | {
"dataType": "string",
"lastSuccessfulSync": "2022-01-01T13:00:00.000Z",
"currentStatus": "string",
"latestSyncId": "ad474a37-2003-478e-baee-9af9f1ec2fe3",
"latestSuccessfulSyncId": "8220fc90-55b6-47bc-9417-48ac6ea93101"
} | +| `tracking_categories` | [Optional[shared.DataStatus]](../../models/shared/datastatus.md) | :heavy_minus_sign: | Describes the state of data in the Codat cache for a company and data type | {
"dataType": "string",
"lastSuccessfulSync": "2022-01-01T13:00:00.000Z",
"currentStatus": "string",
"latestSyncId": "ad474a37-2003-478e-baee-9af9f1ec2fe3",
"latestSuccessfulSyncId": "8220fc90-55b6-47bc-9417-48ac6ea93101"
} | +| `transfers` | [Optional[shared.DataStatus]](../../models/shared/datastatus.md) | :heavy_minus_sign: | Describes the state of data in the Codat cache for a company and data type | {
"dataType": "string",
"lastSuccessfulSync": "2022-01-01T13:00:00.000Z",
"currentStatus": "string",
"latestSyncId": "ad474a37-2003-478e-baee-9af9f1ec2fe3",
"latestSuccessfulSyncId": "8220fc90-55b6-47bc-9417-48ac6ea93101"
} | \ No newline at end of file diff --git a/previous-versions/sync-for-payables-version-1/docs/models/shared/groupreference.md b/previous-versions/sync-for-payables-version-1/docs/models/operations/getdatastatusrequest.md similarity index 65% rename from previous-versions/sync-for-payables-version-1/docs/models/shared/groupreference.md rename to previous-versions/sync-for-payables-version-1/docs/models/operations/getdatastatusrequest.md index 31666edf4..12c2e50b6 100644 --- a/previous-versions/sync-for-payables-version-1/docs/models/shared/groupreference.md +++ b/previous-versions/sync-for-payables-version-1/docs/models/operations/getdatastatusrequest.md @@ -1,8 +1,8 @@ -# GroupReference +# GetDataStatusRequest ## Fields | Field | Type | Required | Description | Example | | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | -| `id` | *Optional[str]* | :heavy_minus_sign: | Unique identifier for the group. | 60d2fa12-8a04-11ee-b9d1-0242ac120002 | \ No newline at end of file +| `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/previous-versions/sync-for-payables-version-1/docs/models/operations/getjournalrequest.md b/previous-versions/sync-for-payables-version-1/docs/models/operations/getjournalrequest.md new file mode 100644 index 000000000..3cf3d3d52 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/docs/models/operations/getjournalrequest.md @@ -0,0 +1,9 @@ +# GetJournalRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | +| `company_id` | *str* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `journal_id` | *str* | :heavy_check_mark: | Unique identifier for a journal. | | \ No newline at end of file diff --git a/previous-versions/sync-for-payables-version-1/docs/models/operations/getpaymentmethodrequest.md b/previous-versions/sync-for-payables-version-1/docs/models/operations/getpaymentmethodrequest.md new file mode 100644 index 000000000..150ac2e77 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/docs/models/operations/getpaymentmethodrequest.md @@ -0,0 +1,9 @@ +# GetPaymentMethodRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| --------------------------------------- | --------------------------------------- | --------------------------------------- | --------------------------------------- | --------------------------------------- | +| `company_id` | *str* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `payment_method_id` | *str* | :heavy_check_mark: | Unique identifier for a payment method. | | \ No newline at end of file diff --git a/previous-versions/sync-for-payables-version-1/docs/models/operations/getpulloperationrequest.md b/previous-versions/sync-for-payables-version-1/docs/models/operations/getpulloperationrequest.md new file mode 100644 index 000000000..d2382bd6c --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/docs/models/operations/getpulloperationrequest.md @@ -0,0 +1,9 @@ +# GetPullOperationRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | +| `company_id` | *str* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `dataset_id` | *str* | :heavy_check_mark: | Unique identifier for the dataset that completed its sync. | | \ No newline at end of file diff --git a/previous-versions/sync-for-payables-version-1/docs/models/operations/getpushoperationrequest.md b/previous-versions/sync-for-payables-version-1/docs/models/operations/getpushoperationrequest.md new file mode 100644 index 000000000..d667790b5 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/docs/models/operations/getpushoperationrequest.md @@ -0,0 +1,9 @@ +# GetPushOperationRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | +| `company_id` | *str* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `push_operation_key` | *str* | :heavy_check_mark: | Push operation key. | | \ No newline at end of file diff --git a/previous-versions/sync-for-payables-version-1/docs/models/operations/getsupplierrequest.md b/previous-versions/sync-for-payables-version-1/docs/models/operations/getsupplierrequest.md new file mode 100644 index 000000000..4a09a7dd2 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/docs/models/operations/getsupplierrequest.md @@ -0,0 +1,9 @@ +# GetSupplierRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | +| `company_id` | *str* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `supplier_id` | *str* | :heavy_check_mark: | Unique identifier for a supplier. | | \ No newline at end of file diff --git a/previous-versions/sync-for-payables-version-1/docs/models/operations/gettaxraterequest.md b/previous-versions/sync-for-payables-version-1/docs/models/operations/gettaxraterequest.md new file mode 100644 index 000000000..5ead579f8 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/docs/models/operations/gettaxraterequest.md @@ -0,0 +1,9 @@ +# GetTaxRateRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | +| `company_id` | *str* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `tax_rate_id` | *str* | :heavy_check_mark: | Unique identifier for a tax rate. | | \ No newline at end of file diff --git a/previous-versions/sync-for-payables-version-1/docs/models/operations/gettrackingcategoryrequest.md b/previous-versions/sync-for-payables-version-1/docs/models/operations/gettrackingcategoryrequest.md new file mode 100644 index 000000000..abd957b05 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/docs/models/operations/gettrackingcategoryrequest.md @@ -0,0 +1,9 @@ +# GetTrackingCategoryRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------ | ------------------------------------------ | ------------------------------------------ | ------------------------------------------ | ------------------------------------------ | +| `company_id` | *str* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `tracking_category_id` | *str* | :heavy_check_mark: | Unique identifier for a tracking category. | | \ No newline at end of file diff --git a/previous-versions/sync-for-payables-version-1/docs/models/operations/listaccountsrequest.md b/previous-versions/sync-for-payables-version-1/docs/models/operations/listaccountsrequest.md new file mode 100644 index 000000000..acda3caa4 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/docs/models/operations/listaccountsrequest.md @@ -0,0 +1,12 @@ +# ListAccountsRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | +| `company_id` | *str* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `order_by` | *Optional[str]* | :heavy_minus_sign: | Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). | -modifiedDate | +| `page` | *Optional[int]* | :heavy_minus_sign: | Page number. [Read more](https://docs.codat.io/using-the-api/paging). | 1 | +| `page_size` | *Optional[int]* | :heavy_minus_sign: | Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). | 100 | +| `query` | *Optional[str]* | :heavy_minus_sign: | Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). | id=e3334455-1aed-4e71-ab43-6bccf12092ee | \ No newline at end of file diff --git a/previous-versions/sync-for-payables-version-1/docs/models/operations/listbillattachmentsrequest.md b/previous-versions/sync-for-payables-version-1/docs/models/operations/listbillattachmentsrequest.md new file mode 100644 index 000000000..883f467a7 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/docs/models/operations/listbillattachmentsrequest.md @@ -0,0 +1,10 @@ +# ListBillAttachmentsRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | +| `bill_id` | *str* | :heavy_check_mark: | Unique identifier for a bill. | 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/previous-versions/sync-for-payables-version-1/docs/models/operations/listbillcreditnotesrequest.md b/previous-versions/sync-for-payables-version-1/docs/models/operations/listbillcreditnotesrequest.md new file mode 100644 index 000000000..f64f9e67a --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/docs/models/operations/listbillcreditnotesrequest.md @@ -0,0 +1,12 @@ +# ListBillCreditNotesRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | +| `company_id` | *str* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `order_by` | *Optional[str]* | :heavy_minus_sign: | Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). | -modifiedDate | +| `page` | *Optional[int]* | :heavy_minus_sign: | Page number. [Read more](https://docs.codat.io/using-the-api/paging). | 1 | +| `page_size` | *Optional[int]* | :heavy_minus_sign: | Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). | 100 | +| `query` | *Optional[str]* | :heavy_minus_sign: | Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). | id=e3334455-1aed-4e71-ab43-6bccf12092ee | \ No newline at end of file diff --git a/previous-versions/sync-for-payables-version-1/docs/models/operations/listbillpaymentsrequest.md b/previous-versions/sync-for-payables-version-1/docs/models/operations/listbillpaymentsrequest.md new file mode 100644 index 000000000..00516f0b7 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/docs/models/operations/listbillpaymentsrequest.md @@ -0,0 +1,12 @@ +# ListBillPaymentsRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | +| `company_id` | *str* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `order_by` | *Optional[str]* | :heavy_minus_sign: | Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). | -modifiedDate | +| `page` | *Optional[int]* | :heavy_minus_sign: | Page number. [Read more](https://docs.codat.io/using-the-api/paging). | 1 | +| `page_size` | *Optional[int]* | :heavy_minus_sign: | Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). | 100 | +| `query` | *Optional[str]* | :heavy_minus_sign: | Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). | id=e3334455-1aed-4e71-ab43-6bccf12092ee | \ No newline at end of file diff --git a/previous-versions/sync-for-payables-version-1/docs/models/operations/listbillsrequest.md b/previous-versions/sync-for-payables-version-1/docs/models/operations/listbillsrequest.md index 787e6fc48..02fd9c313 100644 --- a/previous-versions/sync-for-payables-version-1/docs/models/operations/listbillsrequest.md +++ b/previous-versions/sync-for-payables-version-1/docs/models/operations/listbillsrequest.md @@ -6,8 +6,7 @@ | 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 | +| `order_by` | *Optional[str]* | :heavy_minus_sign: | Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). | -modifiedDate | | `page` | *Optional[int]* | :heavy_minus_sign: | Page number. [Read more](https://docs.codat.io/using-the-api/paging). | 1 | | `page_size` | *Optional[int]* | :heavy_minus_sign: | Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). | 100 | -| `source_modified_date` | *Optional[str]* | :heavy_minus_sign: | Filter bills by `sourceModifiedDate` to return bills that have changed after a specified date. | 2022-10-23 00:00:00 +0000 UTC | -| `status` | List[[shared.BillStatus](../../models/shared/billstatus.md)] | :heavy_minus_sign: | Filter bills by `status`. | | \ No newline at end of file +| `query` | *Optional[str]* | :heavy_minus_sign: | Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). | id=e3334455-1aed-4e71-ab43-6bccf12092ee | \ No newline at end of file diff --git a/previous-versions/sync-for-payables-version-1/docs/models/operations/listbillsresponse.md b/previous-versions/sync-for-payables-version-1/docs/models/operations/listbillsresponse.md deleted file mode 100644 index 0f8de9232..000000000 --- a/previous-versions/sync-for-payables-version-1/docs/models/operations/listbillsresponse.md +++ /dev/null @@ -1,11 +0,0 @@ -# ListBillsResponse - - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `content_type` | *str* | :heavy_check_mark: | HTTP response content type for this operation | | -| `status_code` | *int* | :heavy_check_mark: | HTTP response status code for this operation | | -| `raw_response` | [requests.Response](https://requests.readthedocs.io/en/latest/api/#requests.Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | | -| `bills` | [Optional[shared.Bills]](../../models/shared/bills.md) | :heavy_minus_sign: | Success | {"_links":{"pageNumber":1,"pageSize":10,"totalResults":1,"self":{"href":"/companies/{id}/data/{dataType}"},"current":{"href":"/companies/{id}/data/{dataType}?page=1&pageSize=10"}}} | \ No newline at end of file diff --git a/previous-versions/sync-for-payables-version-1/docs/models/operations/listcompaniesrequest.md b/previous-versions/sync-for-payables-version-1/docs/models/operations/listcompaniesrequest.md index 8dfaf69d5..9fc1a9c7e 100644 --- a/previous-versions/sync-for-payables-version-1/docs/models/operations/listcompaniesrequest.md +++ b/previous-versions/sync-for-payables-version-1/docs/models/operations/listcompaniesrequest.md @@ -8,4 +8,4 @@ | `order_by` | *Optional[str]* | :heavy_minus_sign: | Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). | -modifiedDate | | `page` | *Optional[int]* | :heavy_minus_sign: | Page number. [Read more](https://docs.codat.io/using-the-api/paging). | 1 | | `page_size` | *Optional[int]* | :heavy_minus_sign: | Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). | 100 | -| `query` | *Optional[str]* | :heavy_minus_sign: | Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). | | \ No newline at end of file +| `query` | *Optional[str]* | :heavy_minus_sign: | Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). | id=e3334455-1aed-4e71-ab43-6bccf12092ee | \ No newline at end of file diff --git a/previous-versions/sync-for-payables-version-1/docs/models/operations/listcompaniesresponse.md b/previous-versions/sync-for-payables-version-1/docs/models/operations/listcompaniesresponse.md deleted file mode 100644 index 7abc40ecd..000000000 --- a/previous-versions/sync-for-payables-version-1/docs/models/operations/listcompaniesresponse.md +++ /dev/null @@ -1,11 +0,0 @@ -# ListCompaniesResponse - - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `content_type` | *str* | :heavy_check_mark: | HTTP response content type for this operation | | -| `status_code` | *int* | :heavy_check_mark: | HTTP response status code for this operation | | -| `raw_response` | [requests.Response](https://requests.readthedocs.io/en/latest/api/#requests.Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | | -| `companies` | [Optional[shared.Companies]](../../models/shared/companies.md) | :heavy_minus_sign: | OK | {"_links":{"pageNumber":1,"pageSize":10,"totalResults":1,"self":{"href":"/companies/{id}/data/{dataType}"},"current":{"href":"/companies/{id}/data/{dataType}?page=1&pageSize=10"}}} | \ No newline at end of file diff --git a/previous-versions/sync-for-payables-version-1/docs/models/operations/listconnectionsrequest.md b/previous-versions/sync-for-payables-version-1/docs/models/operations/listconnectionsrequest.md index e13ad736b..949d3e3b6 100644 --- a/previous-versions/sync-for-payables-version-1/docs/models/operations/listconnectionsrequest.md +++ b/previous-versions/sync-for-payables-version-1/docs/models/operations/listconnectionsrequest.md @@ -9,4 +9,4 @@ | `order_by` | *Optional[str]* | :heavy_minus_sign: | Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). | -modifiedDate | | `page` | *Optional[int]* | :heavy_minus_sign: | Page number. [Read more](https://docs.codat.io/using-the-api/paging). | 1 | | `page_size` | *Optional[int]* | :heavy_minus_sign: | Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). | 100 | -| `query` | *Optional[str]* | :heavy_minus_sign: | Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). | | \ No newline at end of file +| `query` | *Optional[str]* | :heavy_minus_sign: | Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). | id=e3334455-1aed-4e71-ab43-6bccf12092ee | \ No newline at end of file diff --git a/previous-versions/sync-for-payables-version-1/docs/models/operations/listconnectionsresponse.md b/previous-versions/sync-for-payables-version-1/docs/models/operations/listconnectionsresponse.md deleted file mode 100644 index 78b8ddd89..000000000 --- a/previous-versions/sync-for-payables-version-1/docs/models/operations/listconnectionsresponse.md +++ /dev/null @@ -1,11 +0,0 @@ -# ListConnectionsResponse - - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `content_type` | *str* | :heavy_check_mark: | HTTP response content type for this operation | | -| `status_code` | *int* | :heavy_check_mark: | HTTP response status code for this operation | | -| `raw_response` | [requests.Response](https://requests.readthedocs.io/en/latest/api/#requests.Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | | -| `connections` | [Optional[shared.Connections]](../../models/shared/connections.md) | :heavy_minus_sign: | OK | {"_links":{"pageNumber":1,"pageSize":10,"totalResults":1,"self":{"href":"/companies/{id}/data/{dataType}"},"current":{"href":"/companies/{id}/data/{dataType}?page=1&pageSize=10"}}} | \ No newline at end of file diff --git a/previous-versions/sync-for-payables-version-1/docs/models/operations/listjournalsrequest.md b/previous-versions/sync-for-payables-version-1/docs/models/operations/listjournalsrequest.md new file mode 100644 index 000000000..8d225b42a --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/docs/models/operations/listjournalsrequest.md @@ -0,0 +1,12 @@ +# ListJournalsRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | +| `company_id` | *str* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `order_by` | *Optional[str]* | :heavy_minus_sign: | Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). | -modifiedDate | +| `page` | *Optional[int]* | :heavy_minus_sign: | Page number. [Read more](https://docs.codat.io/using-the-api/paging). | 1 | +| `page_size` | *Optional[int]* | :heavy_minus_sign: | Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). | 100 | +| `query` | *Optional[str]* | :heavy_minus_sign: | Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). | id=e3334455-1aed-4e71-ab43-6bccf12092ee | \ No newline at end of file diff --git a/previous-versions/sync-for-payables-version-1/docs/models/operations/listpaymentmethodsrequest.md b/previous-versions/sync-for-payables-version-1/docs/models/operations/listpaymentmethodsrequest.md new file mode 100644 index 000000000..07eb393f4 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/docs/models/operations/listpaymentmethodsrequest.md @@ -0,0 +1,12 @@ +# ListPaymentMethodsRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | +| `company_id` | *str* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `order_by` | *Optional[str]* | :heavy_minus_sign: | Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). | -modifiedDate | +| `page` | *Optional[int]* | :heavy_minus_sign: | Page number. [Read more](https://docs.codat.io/using-the-api/paging). | 1 | +| `page_size` | *Optional[int]* | :heavy_minus_sign: | Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). | 100 | +| `query` | *Optional[str]* | :heavy_minus_sign: | Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). | id=e3334455-1aed-4e71-ab43-6bccf12092ee | \ No newline at end of file diff --git a/previous-versions/sync-for-payables-version-1/docs/models/operations/listpulloperationsrequest.md b/previous-versions/sync-for-payables-version-1/docs/models/operations/listpulloperationsrequest.md new file mode 100644 index 000000000..90a05e642 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/docs/models/operations/listpulloperationsrequest.md @@ -0,0 +1,12 @@ +# ListPullOperationsRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | +| `company_id` | *str* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `order_by` | *Optional[str]* | :heavy_minus_sign: | Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). | -modifiedDate | +| `page` | *Optional[int]* | :heavy_minus_sign: | Page number. [Read more](https://docs.codat.io/using-the-api/paging). | 1 | +| `page_size` | *Optional[int]* | :heavy_minus_sign: | Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). | 100 | +| `query` | *Optional[str]* | :heavy_minus_sign: | Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). | id=e3334455-1aed-4e71-ab43-6bccf12092ee | \ No newline at end of file diff --git a/previous-versions/sync-for-payables-version-1/docs/models/operations/listpushoperationsrequest.md b/previous-versions/sync-for-payables-version-1/docs/models/operations/listpushoperationsrequest.md new file mode 100644 index 000000000..68a41042d --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/docs/models/operations/listpushoperationsrequest.md @@ -0,0 +1,12 @@ +# ListPushOperationsRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | +| `company_id` | *str* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `order_by` | *Optional[str]* | :heavy_minus_sign: | Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). | -modifiedDate | +| `page` | *Optional[int]* | :heavy_minus_sign: | Page number. [Read more](https://docs.codat.io/using-the-api/paging). | 1 | +| `page_size` | *Optional[int]* | :heavy_minus_sign: | Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). | 100 | +| `query` | *Optional[str]* | :heavy_minus_sign: | Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). | id=e3334455-1aed-4e71-ab43-6bccf12092ee | \ No newline at end of file diff --git a/previous-versions/sync-for-payables-version-1/docs/models/operations/listsuppliersrequest.md b/previous-versions/sync-for-payables-version-1/docs/models/operations/listsuppliersrequest.md new file mode 100644 index 000000000..0590ff1a1 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/docs/models/operations/listsuppliersrequest.md @@ -0,0 +1,12 @@ +# ListSuppliersRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | +| `company_id` | *str* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `order_by` | *Optional[str]* | :heavy_minus_sign: | Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). | -modifiedDate | +| `page` | *Optional[int]* | :heavy_minus_sign: | Page number. [Read more](https://docs.codat.io/using-the-api/paging). | 1 | +| `page_size` | *Optional[int]* | :heavy_minus_sign: | Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). | 100 | +| `query` | *Optional[str]* | :heavy_minus_sign: | Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). | id=e3334455-1aed-4e71-ab43-6bccf12092ee | \ No newline at end of file diff --git a/previous-versions/sync-for-payables-version-1/docs/models/operations/listtaxratesrequest.md b/previous-versions/sync-for-payables-version-1/docs/models/operations/listtaxratesrequest.md new file mode 100644 index 000000000..dc55ad479 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/docs/models/operations/listtaxratesrequest.md @@ -0,0 +1,12 @@ +# ListTaxRatesRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | +| `company_id` | *str* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `order_by` | *Optional[str]* | :heavy_minus_sign: | Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). | -modifiedDate | +| `page` | *Optional[int]* | :heavy_minus_sign: | Page number. [Read more](https://docs.codat.io/using-the-api/paging). | 1 | +| `page_size` | *Optional[int]* | :heavy_minus_sign: | Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). | 100 | +| `query` | *Optional[str]* | :heavy_minus_sign: | Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). | id=e3334455-1aed-4e71-ab43-6bccf12092ee | \ No newline at end of file diff --git a/previous-versions/sync-for-payables-version-1/docs/models/operations/listtrackingcategoriesrequest.md b/previous-versions/sync-for-payables-version-1/docs/models/operations/listtrackingcategoriesrequest.md new file mode 100644 index 000000000..12ee2a54b --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/docs/models/operations/listtrackingcategoriesrequest.md @@ -0,0 +1,12 @@ +# ListTrackingCategoriesRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | +| `company_id` | *str* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `order_by` | *Optional[str]* | :heavy_minus_sign: | Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). | -modifiedDate | +| `page` | *Optional[int]* | :heavy_minus_sign: | Page number. [Read more](https://docs.codat.io/using-the-api/paging). | 1 | +| `page_size` | *Optional[int]* | :heavy_minus_sign: | Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). | 100 | +| `query` | *Optional[str]* | :heavy_minus_sign: | Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). | id=e3334455-1aed-4e71-ab43-6bccf12092ee | \ No newline at end of file diff --git a/previous-versions/sync-for-payables-version-1/docs/models/operations/refreshalldatatypesrequest.md b/previous-versions/sync-for-payables-version-1/docs/models/operations/refreshalldatatypesrequest.md new file mode 100644 index 000000000..ea381e387 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/docs/models/operations/refreshalldatatypesrequest.md @@ -0,0 +1,8 @@ +# RefreshAllDataTypesRequest + + +## 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/previous-versions/sync-for-payables-version-1/docs/models/operations/refreshdatatyperequest.md b/previous-versions/sync-for-payables-version-1/docs/models/operations/refreshdatatyperequest.md new file mode 100644 index 000000000..35df09d55 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/docs/models/operations/refreshdatatyperequest.md @@ -0,0 +1,10 @@ +# RefreshDataTypeRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | +| `company_id` | *str* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `data_type` | [shared.SchemaDataType](../../models/shared/schemadatatype.md) | :heavy_check_mark: | The key of a Codat data type | invoices | +| `connection_id` | *Optional[str]* | :heavy_minus_sign: | Optionally, provide a data connection id to only queue pull operations on that connection. | | \ No newline at end of file diff --git a/previous-versions/sync-for-payables-version-1/docs/models/operations/updatebillcreditnoterequest.md b/previous-versions/sync-for-payables-version-1/docs/models/operations/updatebillcreditnoterequest.md new file mode 100644 index 000000000..f79fb97e4 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/docs/models/operations/updatebillcreditnoterequest.md @@ -0,0 +1,13 @@ +# UpdateBillCreditNoteRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `bill_credit_note_id` | *str* | :heavy_check_mark: | Unique identifier for a bill credit note. | | +| `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 | +| `bill_credit_note` | [OptionalNullable[shared.BillCreditNote]](../../models/shared/billcreditnote.md) | :heavy_minus_sign: | N/A | {
"id": "6a0e9dfb-87b0-47d3-aaaf-9753ae9e757d",
"billCreditNoteNumber": "14763237",
"totalAmount": 693,
"remainingCredit": 693,
"status": "Submitted",
"issueDate": "2019-02-18T16:03:07.268Z",
"note": "Track separately",
"currency": "USD",
"lineItems": [
{
"description": "AcmeMagnet",
"unitAmount": 25,
"discountAmount": 0,
"quantity": 4,
"subTotal": 100,
"taxAmount": 10,
"totalAmount": 110,
"itemRef": {
"id": "3"
},
"taxRateRef": {
"id": "6c88aff3-7cb9-4980-a3d3-443e72e02498"
},
"accountRef": {
"id": "3f267b10-757d-44c0-bef9-20f70cc8fbe3"
},
"trackingCategoryRefs": [
{
"id": "department_1",
"name": "ACMERockets"
},
{
"id": "costcode_2",
"name": "ACM2-ACMESigns"
}
],
"createdFromLineRef": [
{
"id": "8462",
"dataType": "bill",
"lineNumber": 1
}
]
},
{
"description": "ACMEDisintegratingPistol",
"unitAmount": 25,
"discountAmount": 0,
"quantity": 3,
"subTotal": 75,
"taxAmount": 7.5,
"totalAmount": 82.5,
"itemRef": {
"id": "3abf0883-03f7-44c6-bc15-1372522d25e1"
},
"taxRateRef": {
"id": "6c88aff3-7cb9-4980-a3d3-443e72e02498"
},
"accountRef": {
"id": "3f267b10-757d-44c0-bef9-20f70cc8fbe3"
}
},
{
"description": "ACMEWhippedCreamDispenser",
"unitAmount": 52,
"discountAmount": 0,
"quantity": 6,
"subTotal": 312,
"taxAmount": 31.2,
"totalAmount": 343.2,
"itemRef": {
"id": "3691f3d9-0ff7-4358-8a93-bed31c1b4b03"
},
"taxRateRef": {
"id": "6c88aff3-7cb9-4980-a3d3-443e72e02498"
},
"accountRef": {
"id": "3f267b10-757d-44c0-bef9-20f70cc8fbe3"
}
},
{
"description": "ACMEJetPropelledPogoStick",
"unitAmount": 130,
"discountAmount": 0,
"quantity": 1,
"subTotal": 130,
"taxAmount": 27.3,
"totalAmount": 157.3,
"itemRef": {
"id": "075410d4-7edc-4936-ba52-9e1e43cbe300"
},
"taxRateRef": {
"id": "d606732b-db18-44d7-823b-7f15f42c32ea"
},
"accountRef": {
"id": "3f267b10-757d-44c0-bef9-20f70cc8fbe3"
}
}
],
"supplierRef": {
"id": "67C6A7A1-5E84-4AC4-B950-24A114E379D0",
"supplierName": "Chin's Gas and Oil"
},
"createdFromLineRef": {
"id": "8462",
"dataType": "bills",
"line": 1
}
} | +| `force_update` | *Optional[bool]* | :heavy_minus_sign: | When updating data in the destination platform Codat checks the `sourceModifiedDate` against the `lastupdated` date from the accounting software, if they're different Codat will return an error suggesting you should initiate another pull of the data. If this is set to `true` then the update will override this check. | | +| `timeout_in_minutes` | *Optional[int]* | :heavy_minus_sign: | Time limit for the push operation to complete before it is timed out. | | \ No newline at end of file diff --git a/previous-versions/sync-for-payables-version-1/docs/models/operations/getconnectionresponse.md b/previous-versions/sync-for-payables-version-1/docs/models/operations/updatebillrequest.md similarity index 70% rename from previous-versions/sync-for-payables-version-1/docs/models/operations/getconnectionresponse.md rename to previous-versions/sync-for-payables-version-1/docs/models/operations/updatebillrequest.md index 66e3f65f1..027151d83 100644 --- a/previous-versions/sync-for-payables-version-1/docs/models/operations/getconnectionresponse.md +++ b/previous-versions/sync-for-payables-version-1/docs/models/operations/updatebillrequest.md @@ -1,11 +1,13 @@ -# GetConnectionResponse +# UpdateBillRequest ## Fields -| Field | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `content_type` | *str* | :heavy_check_mark: | HTTP response content type for this operation | | -| `status_code` | *int* | :heavy_check_mark: | HTTP response status code for this operation | | -| `raw_response` | [requests.Response](https://requests.readthedocs.io/en/latest/api/#requests.Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | | -| `connection` | [Optional[shared.Connection]](../../models/shared/connection.md) | :heavy_minus_sign: | OK | {"id":"ee2eb431-c0fa-4dc9-93fa-d29781c12bcd","integrationId":"bf083d72-62c7-493e-aec9-81b4dbba7e2c","integrationKey":"dfxm","sourceId":"bdd831ce-eebd-4896-89a7-20e5ee8989ee","platformName":"Basiq","linkUrl":"https://link-api.codat.io/companies/86bd88cb-44ab-4dfb-b32f-87b19b14287f/connections/ee2eb431-c0fa-4dc9-93fa-d29781c12bcd/start","status":"Linked","lastSync":"2022-10-27T10:22:43.6464237Z","created":"2022-10-27T09:53:29Z","sourceType":"Banking"} | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `bill_id` | *str* | :heavy_check_mark: | Unique identifier for a bill. | 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 | +| `bill` | [OptionalNullable[shared.Bill]](../../models/shared/bill.md) | :heavy_minus_sign: | N/A | | +| `force_update` | *Optional[bool]* | :heavy_minus_sign: | When updating data in the destination platform Codat checks the `sourceModifiedDate` against the `lastupdated` date from the accounting software, if they're different Codat will return an error suggesting you should initiate another pull of the data. If this is set to `true` then the update will override this check. | | +| `timeout_in_minutes` | *Optional[int]* | :heavy_minus_sign: | Time limit for the push operation to complete before it is timed out. | | \ No newline at end of file diff --git a/previous-versions/sync-for-payables-version-1/docs/models/operations/updatesupplierrequest.md b/previous-versions/sync-for-payables-version-1/docs/models/operations/updatesupplierrequest.md new file mode 100644 index 000000000..5a647f1df --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/docs/models/operations/updatesupplierrequest.md @@ -0,0 +1,13 @@ +# UpdateSupplierRequest + + +## 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 | +| `supplier_id` | *str* | :heavy_check_mark: | Unique identifier for a supplier. | | +| `supplier` | [OptionalNullable[shared.Supplier]](../../models/shared/supplier.md) | :heavy_minus_sign: | N/A | {
"id": "C520FFD4-F6F6-4FC2-A6D2-5D7088B2B14F",
"supplierName": "Kelly's Industrial Supplies",
"contactName": "Kelly's Industrial Supplies",
"emailAddress": "sales@kellysupplies.com",
"phone": "07999 999999",
"addresses": [
{
"type": "Billing",
"line1": "Unit 51",
"line2": "Bakersfield Industrial Estate",
"city": "Bakersfield",
"region": "California",
"country": "USA",
"postalcode": "93308"
}
],
"registrationNumber": "string",
"taxNumber": "string",
"status": "Unknown",
"defaultCurrency": "string",
"metadata": {
"isDeleted": true
},
"supplementalData": {
"content": {
"property1": {
"property1": null,
"property2": null
},
"property2": {
"property1": null,
"property2": null
}
}
},
"modifiedDate": "2022-10-23T00:00:00Z",
"sourceModifiedDate": "2022-10-23T00:00:00Z"
} | +| `force_update` | *Optional[bool]* | :heavy_minus_sign: | When updating data in the destination platform Codat checks the `sourceModifiedDate` against the `lastupdated` date from the accounting software, if they're different Codat will return an error suggesting you should initiate another pull of the data. If this is set to `true` then the update will override this check. | | +| `timeout_in_minutes` | *Optional[int]* | :heavy_minus_sign: | Time limit for the push operation to complete before it is timed out. | | \ No newline at end of file diff --git a/previous-versions/sync-for-payables-version-1/docs/models/operations/uploadbillattachmentrequest.md b/previous-versions/sync-for-payables-version-1/docs/models/operations/uploadbillattachmentrequest.md new file mode 100644 index 000000000..b6f66ecee --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/docs/models/operations/uploadbillattachmentrequest.md @@ -0,0 +1,11 @@ +# UploadBillAttachmentRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | +| `bill_id` | *str* | :heavy_check_mark: | Unique identifier for a bill. | 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 | +| `attachment_upload` | [Optional[shared.AttachmentUpload]](../../models/shared/attachmentupload.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/previous-versions/sync-for-payables-version-1/docs/models/shared/account.md b/previous-versions/sync-for-payables-version-1/docs/models/shared/account.md new file mode 100644 index 000000000..071475efd --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/docs/models/shared/account.md @@ -0,0 +1,52 @@ +# Account + +> **Language tip:** Accounts are also referred to as **chart of accounts**, **nominal accounts**, and **general ledger**. + +View the coverage for accounts in the Data coverage explorer. + +## Overview + +Accounts are the categories a business uses to record accounting transactions. From the Accounts endpoints, you can retrieve a list of all accounts for a specified company. + +The categories for an account include: +* Asset +* Expense +* Income +* Liability +* Equity. + +The same account may have a different category based on the integration it is used in. For example, a current account (known as checking in the US) should be categorized as `Asset.Current` for Xero, and `Asset.Bank.Checking` for QuickBooks Online. + +At the same time, each integration may have its own requirements to the categories. For example, a Paypal account in Xero is of the `Asset.Bank` category and therefore requires additional properties to be provided. + +To determine the list of allowed categories for a specific integration, you can: +- Follow our [Create, update, delete data](https://docs.codat.io/using-the-api/push) guide and use the [Get create account model](https://docs.codat.io/sync-for-payables-api#/operations/get-create-chartOfAccounts-model). +- Refer to the integration's own documentation. + +> **Accounts with no category** +> +> If an account is pulled from the chart of accounts and its nominal code does not lie within the category layout for the company's accounts, then the **type** is `Unknown`. The **fullyQualifiedCategory** and **fullyQualifiedName** fields return `null`. +> +> This approach gives a true representation of the company's accounts whilst preventing distorting financials such as a company's profit and loss and balance sheet reports. + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `currency` | *Optional[str]* | :heavy_minus_sign: | The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_.

## Unknown currencies

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

There are only a very small number of edge cases where this currency code is returned by the Codat system. | GBP | +| `current_balance` | *OptionalNullable[Decimal]* | :heavy_minus_sign: | Current balance in the account. | 0 | +| `description` | *OptionalNullable[str]* | :heavy_minus_sign: | Description for the account. | Invoices the business has issued but has not yet collected payment on. | +| `fully_qualified_category` | *OptionalNullable[str]* | :heavy_minus_sign: | Full category of the account.

For example, `Liability.Current` or `Income.Revenue`. To determine a list of possible categories for each integration, see our examples, follow our [Create, update, delete data](https://docs.codat.io/using-the-api/push) guide, or refer to the integration's own documentation. | Asset.Current | +| `fully_qualified_name` | *OptionalNullable[str]* | :heavy_minus_sign: | Full name of the account, for example:
- `Cash On Hand`
- `Rents Held In Trust`
- `Fixed Asset` | Cash On Hand | +| `id` | *Optional[str]* | :heavy_minus_sign: | Identifier for the account, unique for the company. | 1b6266d1-1e44-46c5-8eb5-a8f98e03124e | +| `is_bank_account` | *Optional[bool]* | :heavy_minus_sign: | Confirms whether the account is a bank account or not. | | +| `metadata` | [Optional[shared.Metadata]](../../models/shared/metadata.md) | :heavy_minus_sign: | N/A | | +| `modified_date` | *Optional[str]* | :heavy_minus_sign: | N/A | 2022-10-23 00:00:00 +0000 UTC | +| `name` | *OptionalNullable[str]* | :heavy_minus_sign: | Name of the account. | Accounts Receivable | +| `nominal_code` | *OptionalNullable[str]* | :heavy_minus_sign: | Reference given to each nominal account for a business. It ensures money is allocated to the correct account. This code isn't a unique identifier in the Codat system. | 610 | +| `source_modified_date` | *Optional[str]* | :heavy_minus_sign: | N/A | 2022-10-23 00:00:00 +0000 UTC | +| `status` | [Optional[shared.AccountStatus]](../../models/shared/accountstatus.md) | :heavy_minus_sign: | Status of the account | Active | +| `supplemental_data` | [Optional[shared.SupplementalData]](../../models/shared/supplementaldata.md) | :heavy_minus_sign: | Supplemental data is additional data you can include in our standard data types.

It is referenced as a configured dynamic key value pair that is unique to the accounting software. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. | | +| `type` | [Optional[shared.AccountType]](../../models/shared/accounttype.md) | :heavy_minus_sign: | Type of account | Asset | +| `valid_datatype_links` | List[[shared.AccountValidDataTypeLinks](../../models/shared/accountvaliddatatypelinks.md)] | :heavy_minus_sign: | The validDatatypeLinks can be used to determine whether an account can be correctly mapped to another object; for example, accounts with a `type` of `income` might only support being used on an Invoice and Direct Income. For more information, see [Valid Data Type Links](/sync-for-payables-api#/schemas/ValidDataTypeLinks). | | \ No newline at end of file diff --git a/previous-versions/sync-for-payables-version-1/docs/models/shared/accountingaccount.md b/previous-versions/sync-for-payables-version-1/docs/models/shared/accountingaccount.md new file mode 100644 index 000000000..64802c577 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/docs/models/shared/accountingaccount.md @@ -0,0 +1,54 @@ +# ~~AccountingAccount~~ + +> **Language tip:** Accounts are also referred to as **chart of accounts**, **nominal accounts**, and **general ledger**. + +View the coverage for accounts in the Data coverage explorer. + +## Overview + +Accounts are the categories a business uses to record accounting transactions. From the Accounts endpoints, you can retrieve a list of all accounts for a specified company. + +The categories for an account include: +* Asset +* Expense +* Income +* Liability +* Equity. + +The same account may have a different category based on the integration it is used in. For example, a current account (known as checking in the US) should be categorized as `Asset.Current` for Xero, and `Asset.Bank.Checking` for QuickBooks Online. + +At the same time, each integration may have its own requirements to the categories. For example, a Paypal account in Xero is of the `Asset.Bank` category and therefore requires additional properties to be provided. + +To determine the list of allowed categories for a specific integration, you can: +- Follow our [Create, update, delete data](https://docs.codat.io/using-the-api/push) guide and use the [Get create account model](https://docs.codat.io/sync-for-payables-api#/operations/get-create-chartOfAccounts-model). +- Refer to the integration's own documentation. + +> **Accounts with no category** +> +> If an account is pulled from the chart of accounts and its nominal code does not lie within the category layout for the company's accounts, then the **type** is `Unknown`. The **fullyQualifiedCategory** and **fullyQualifiedName** fields return `null`. +> +> This approach gives a true representation of the company's accounts whilst preventing distorting financials such as a company's profit and loss and balance sheet reports. + +> :warning: **DEPRECATED**: This will be removed in a future release, please migrate away from it as soon as possible. + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `currency` | *Optional[str]* | :heavy_minus_sign: | The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_.

## Unknown currencies

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

There are only a very small number of edge cases where this currency code is returned by the Codat system. | GBP | +| `current_balance` | *OptionalNullable[Decimal]* | :heavy_minus_sign: | Current balance in the account. | 0 | +| `description` | *OptionalNullable[str]* | :heavy_minus_sign: | Description for the account. | Invoices the business has issued but has not yet collected payment on. | +| `fully_qualified_category` | *OptionalNullable[str]* | :heavy_minus_sign: | Full category of the account.

For example, `Liability.Current` or `Income.Revenue`. To determine a list of possible categories for each integration, see our examples, follow our [Create, update, delete data](https://docs.codat.io/using-the-api/push) guide, or refer to the integration's own documentation. | Asset.Current | +| `fully_qualified_name` | *OptionalNullable[str]* | :heavy_minus_sign: | Full name of the account, for example:
- `Cash On Hand`
- `Rents Held In Trust`
- `Fixed Asset` | Cash On Hand | +| `id` | *Optional[str]* | :heavy_minus_sign: | Identifier for the account, unique for the company. | 1b6266d1-1e44-46c5-8eb5-a8f98e03124e | +| `is_bank_account` | *Optional[bool]* | :heavy_minus_sign: | Confirms whether the account is a bank account or not. | | +| `metadata` | [Optional[shared.Metadata]](../../models/shared/metadata.md) | :heavy_minus_sign: | N/A | | +| `modified_date` | *Optional[str]* | :heavy_minus_sign: | N/A | 2022-10-23 00:00:00 +0000 UTC | +| `name` | *OptionalNullable[str]* | :heavy_minus_sign: | Name of the account. | Accounts Receivable | +| `nominal_code` | *OptionalNullable[str]* | :heavy_minus_sign: | Reference given to each nominal account for a business. It ensures money is allocated to the correct account. This code isn't a unique identifier in the Codat system. | 610 | +| `source_modified_date` | *Optional[str]* | :heavy_minus_sign: | N/A | 2022-10-23 00:00:00 +0000 UTC | +| `status` | [Optional[shared.AccountStatus]](../../models/shared/accountstatus.md) | :heavy_minus_sign: | Status of the account | Active | +| `supplemental_data` | [Optional[shared.SupplementalData]](../../models/shared/supplementaldata.md) | :heavy_minus_sign: | Supplemental data is additional data you can include in our standard data types.

It is referenced as a configured dynamic key value pair that is unique to the accounting software. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. | | +| `type` | [Optional[shared.AccountType]](../../models/shared/accounttype.md) | :heavy_minus_sign: | Type of account | Asset | +| `valid_datatype_links` | List[[shared.CreateAccountResponseValidDataTypeLinks](../../models/shared/createaccountresponsevaliddatatypelinks.md)] | :heavy_minus_sign: | The validDatatypeLinks can be used to determine whether an account can be correctly mapped to another object; for example, accounts with a `type` of `income` might only support being used on an Invoice and Direct Income. For more information, see [Valid Data Type Links](/sync-for-payables-api#/schemas/ValidDataTypeLinks). | | \ No newline at end of file diff --git a/previous-versions/sync-for-payables-version-1/docs/models/shared/accountingaddresstype.md b/previous-versions/sync-for-payables-version-1/docs/models/shared/accountingaddresstype.md new file mode 100644 index 000000000..ab6961bcd --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/docs/models/shared/accountingaddresstype.md @@ -0,0 +1,12 @@ +# AccountingAddressType + +The type of the address + + +## Values + +| Name | Value | +| ---------- | ---------- | +| `UNKNOWN` | Unknown | +| `BILLING` | Billing | +| `DELIVERY` | Delivery | \ No newline at end of file diff --git a/previous-versions/sync-for-payables-version-1/docs/models/shared/accountingbankaccount.md b/previous-versions/sync-for-payables-version-1/docs/models/shared/accountingbankaccount.md new file mode 100644 index 000000000..8b0a85d72 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/docs/models/shared/accountingbankaccount.md @@ -0,0 +1,43 @@ +# ~~AccountingBankAccount~~ + +> **Accessing Bank Accounts through Banking API** +> +> This datatype was originally used for accessing bank account data both in accounting integrations and open banking aggregators. +> +> To view bank account data through the Banking API, please refer to the new datatype [here](https://docs.codat.io/sync-for-payables-api#/schemas/Account) + +> View the coverage for bank accounts in the Data coverage explorer. + +## Overview + +A list of bank accounts associated with a company and a specific data connection. + +Bank accounts data includes: +* The name and ID of the account in the accounting software. +* The currency and balance of the account. +* The sort code and account number. + +> :warning: **DEPRECATED**: This will be removed in a future release, please migrate away from it as soon as possible. + + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `account_name` | *OptionalNullable[str]* | :heavy_minus_sign: | Name of the bank account in the accounting software. | | +| `account_number` | *OptionalNullable[str]* | :heavy_minus_sign: | Account number for the bank account.

Xero integrations
Only a UK account number shows for bank accounts with GBP currency and a combined total of sort code and account number that equals 14 digits, For non-GBP accounts, the full bank account number is populated.

FreeAgent integrations
For Credit accounts, only the last four digits are required. For other types, the field is optional. | | +| `account_type` | [Optional[shared.BankAccountCreateResponseBankAccountType]](../../models/shared/bankaccountcreateresponsebankaccounttype.md) | :heavy_minus_sign: | The type of transactions and balances on the account.
For Credit accounts, positive balances are liabilities, and positive transactions **reduce** liabilities.
For Debit accounts, positive balances are assets, and positive transactions **increase** assets. | | +| `available_balance` | *OptionalNullable[Decimal]* | :heavy_minus_sign: | Total available balance of the bank account as reported by the underlying data source. This may take into account overdrafts or pending transactions for example. | | +| `balance` | *OptionalNullable[Decimal]* | :heavy_minus_sign: | Balance of the bank account. | | +| `currency` | *Optional[str]* | :heavy_minus_sign: | The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_.

## Unknown currencies

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

There are only a very small number of edge cases where this currency code is returned by the Codat system. | GBP | +| `i_ban` | *OptionalNullable[str]* | :heavy_minus_sign: | International bank account number of the account. Often used when making or receiving international payments. | | +| `id` | *Optional[str]* | :heavy_minus_sign: | Identifier for the account, unique for the company in the accounting software. | | +| `institution` | *OptionalNullable[str]* | :heavy_minus_sign: | The institution of the bank account. | | +| `metadata` | [Optional[shared.Metadata]](../../models/shared/metadata.md) | :heavy_minus_sign: | N/A | | +| `modified_date` | *Optional[str]* | :heavy_minus_sign: | N/A | 2022-10-23 00:00:00 +0000 UTC | +| `nominal_code` | *OptionalNullable[str]* | :heavy_minus_sign: | Code used to identify each nominal account for a business. | | +| `overdraft_limit` | *OptionalNullable[Decimal]* | :heavy_minus_sign: | Pre-arranged overdraft limit of the account.

The value is always positive. For example, an overdraftLimit of `1000` means that the balance of the account can go down to `-1000`. | | +| `sort_code` | *OptionalNullable[str]* | :heavy_minus_sign: | Sort code for the bank account.

Xero integrations
The sort code is only displayed when the currency = GBP and the sort code and account number sum to 14 digits. For non-GBP accounts, this field is not populated. | | +| `source_modified_date` | *Optional[str]* | :heavy_minus_sign: | N/A | 2022-10-23 00:00:00 +0000 UTC | +| `status` | [Optional[shared.BankAccountStatus]](../../models/shared/bankaccountstatus.md) | :heavy_minus_sign: | Status of the bank account. | Active | +| `supplemental_data` | [Optional[shared.SupplementalData]](../../models/shared/supplementaldata.md) | :heavy_minus_sign: | Supplemental data is additional data you can include in our standard data types.

It is referenced as a configured dynamic key value pair that is unique to the accounting software. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. | | \ No newline at end of file diff --git a/previous-versions/sync-for-payables-version-1/docs/models/shared/accountingbill.md b/previous-versions/sync-for-payables-version-1/docs/models/shared/accountingbill.md new file mode 100644 index 000000000..ba82e882d --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/docs/models/shared/accountingbill.md @@ -0,0 +1,50 @@ +# ~~AccountingBill~~ + +> **Invoices or bills?** +> +> We distinguish between invoices where the company *owes money* vs. *is owed money*. If the company has received an invoice, and owes money to someone else (accounts payable) we call this a Bill. +> +> See [Invoices](https://docs.codat.io/sync-for-payables-api#/schemas/Invoice) for the accounts receivable equivalent of bills. + +View the coverage for bills in the Data coverage explorer. + +## Overview + +In Codat, a bill contains details of: +* When the bill was recorded in the accounting system. +* How much the bill is for and the currency of the amount. +* Who the bill was received from — the *supplier*. +* What the bill is for — the *line items*. + +Some accounting software give a separate name to purchases where the payment is made immediately, such as something bought with a credit card or online payment. One example of this would be QuickBooks Online's *expenses*. + +You can find these types of transactions in our [Direct costs](https://docs.codat.io/sync-for-payables-api#/schemas/DirectCost) data model. + +> :warning: **DEPRECATED**: This will be removed in a future release, please migrate away from it as soon as possible. + + +## Fields + +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `issue_date` | *str* | :heavy_check_mark: | N/A | 2022-10-23 00:00:00 +0000 UTC | +| `status` | [shared.BillStatus](../../models/shared/billstatus.md) | :heavy_check_mark: | Current state of the bill. | | +| `sub_total` | *Decimal* | :heavy_check_mark: | Total amount of the bill, excluding any taxes. | | +| `tax_amount` | *Decimal* | :heavy_check_mark: | Amount of tax on the bill. | | +| `total_amount` | *Decimal* | :heavy_check_mark: | Amount of the bill, including tax. | | +| `amount_due` | *OptionalNullable[Decimal]* | :heavy_minus_sign: | Amount outstanding on the bill. | | +| `currency` | *Optional[str]* | :heavy_minus_sign: | The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_.

## Unknown currencies

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

There are only a very small number of edge cases where this currency code is returned by the Codat system. | GBP | +| `currency_rate` | *OptionalNullable[Decimal]* | :heavy_minus_sign: | Rate to convert the total amount of the payment into the base currency for the company at the time of the payment.

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

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

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

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

## Examples with base currency of GBP

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

## Examples with base currency of USD

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


### Integration-specific details

\| Integration \| Scenario \| System behavior \|
\|-------------------\|-------------------------------------------------\|----------------------------------------------------------------------------------------------------------------------------------------------------------------------\|
\| QuickBooks Online \| Transaction currency differs from base currency \| If currency rate value is left `null`, a rate of 1 will be used by QBO by default. To override this, specify a currencyRate in the request body. \| | | +| `due_date` | *Optional[str]* | :heavy_minus_sign: | N/A | 2022-10-23 00:00:00 +0000 UTC | +| `id` | *Optional[str]* | :heavy_minus_sign: | Identifier for the bill, unique for the company in the accounting software. | | +| `line_items` | List[[shared.BillLineItem](../../models/shared/billlineitem.md)] | :heavy_minus_sign: | Array of Bill line items. | | +| `metadata` | [Optional[shared.Metadata]](../../models/shared/metadata.md) | :heavy_minus_sign: | N/A | | +| `modified_date` | *Optional[str]* | :heavy_minus_sign: | N/A | 2022-10-23 00:00:00 +0000 UTC | +| `note` | *OptionalNullable[str]* | :heavy_minus_sign: | Any private, company notes about the bill, such as payment information. | | +| `payment_allocations` | List[[shared.CreateBillResponseAccountingPaymentAllocation](../../models/shared/createbillresponseaccountingpaymentallocation.md)] | :heavy_minus_sign: | An array of payment allocations. | | +| `purchase_order_refs` | List[[shared.CreateBillResponsePurchaseOrderReference](../../models/shared/createbillresponsepurchaseorderreference.md)] | :heavy_minus_sign: | N/A | | +| `reference` | *OptionalNullable[str]* | :heavy_minus_sign: | User-friendly reference for the bill. | | +| `source_modified_date` | *Optional[str]* | :heavy_minus_sign: | N/A | 2022-10-23 00:00:00 +0000 UTC | +| `supplemental_data` | [Optional[shared.SupplementalData]](../../models/shared/supplementaldata.md) | :heavy_minus_sign: | Supplemental data is additional data you can include in our standard data types.

It is referenced as a configured dynamic key value pair that is unique to the accounting software. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. | | +| `supplier_ref` | [Optional[shared.SupplierRef]](../../models/shared/supplierref.md) | :heavy_minus_sign: | Reference to the supplier the record relates to. | | +| `withholding_tax` | List[[shared.CreateBillResponseWithholdingTax](../../models/shared/createbillresponsewithholdingtax.md)] | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/previous-versions/sync-for-payables-version-1/docs/models/shared/accountingbillcreditnote.md b/previous-versions/sync-for-payables-version-1/docs/models/shared/accountingbillcreditnote.md new file mode 100644 index 000000000..b1e0f22f8 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/docs/models/shared/accountingbillcreditnote.md @@ -0,0 +1,49 @@ +# ~~AccountingBillCreditNote~~ + +> **Bill credit notes or credit notes?** +> +> In Codat, bill credit notes represent accounts payable only. For accounts receivable, see [Credit notes](https://docs.codat.io/sync-for-payables-api#/schemas/CreditNote). + +View the coverage for bill credit notes in the Data coverage explorer. + +## Overview + +A bill credit note is issued by a supplier for the purpose of recording credit. For example, if a supplier was unable to fulfil an order that was placed by a business, or delivered damaged goods, they would issue a bill credit note. A bill credit note reduces the amount a business owes to the supplier. It can be refunded to the business or used to pay off future bills. + +In the Codat API, a bill credit note is an accounts payable record issued by a [supplier](https://docs.codat.io/sync-for-payables-api#/schemas/Supplier). + +A bill credit note includes details of: +* The original and remaining credit. +* Any allocations of the credit against other records, such as [bills](https://docs.codat.io/sync-for-payables-api#/schemas/Bill). +* The supplier that issued the bill credit note. + +> :warning: **DEPRECATED**: This will be removed in a future release, please migrate away from it as soon as possible. + + +## Fields + +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `discount_percentage` | *Decimal* | :heavy_check_mark: | Percentage rate of any discount applied to the bill credit note. | 0 | +| `status` | [shared.BillCreditNoteStatus](../../models/shared/billcreditnotestatus.md) | :heavy_check_mark: | Current state of the bill credit note | Paid | +| `sub_total` | *Decimal* | :heavy_check_mark: | Total amount of the bill credit note, including discounts but excluding tax. | 805.78 | +| `total_amount` | *Decimal* | :heavy_check_mark: | Total amount of credit that has been applied to the business' account with the supplier, including discounts and tax. | 805.78 | +| `total_discount` | *Decimal* | :heavy_check_mark: | Total value of any discounts applied. | 0 | +| `total_tax_amount` | *Decimal* | :heavy_check_mark: | Amount of tax included in the bill credit note. | 0 | +| `allocated_on_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 | +| `bill_credit_note_number` | *OptionalNullable[str]* | :heavy_minus_sign: | Friendly reference for the bill credit note. | 91fe2a83-e161-4c21-929d-c5c10c4b07e5 | +| `created_from_refs` | List[[shared.CreateBillCreditNoteResponseRecordReference](../../models/shared/createbillcreditnoteresponserecordreference.md)] | :heavy_minus_sign: | An array of records the credit note was created from. | | +| `currency` | *Optional[str]* | :heavy_minus_sign: | The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_.

## Unknown currencies

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

There are only a very small number of edge cases where this currency code is returned by the Codat system. | GBP | +| `currency_rate` | *OptionalNullable[Decimal]* | :heavy_minus_sign: | Rate to convert the total amount of the payment into the base currency for the company at the time of the payment.

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

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

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

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

## Examples with base currency of GBP

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

## Examples with base currency of USD

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


### Integration-specific details

\| Integration \| Scenario \| System behavior \|
\|-------------------\|-------------------------------------------------\|----------------------------------------------------------------------------------------------------------------------------------------------------------------------\|
\| QuickBooks Online \| Transaction currency differs from base currency \| If currency rate value is left `null`, a rate of 1 will be used by QBO by default. To override this, specify a currencyRate in the request body. \| | | +| `id` | *Optional[str]* | :heavy_minus_sign: | Identifier for the bill credit note that is unique to a company in the accounting software. | 1509398f-98e2-436d-8a5d-c042e0c74ffc | +| `issue_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 | +| `line_items` | List[[shared.BillCreditNoteLineItem](../../models/shared/billcreditnotelineitem.md)] | :heavy_minus_sign: | An array of line | | +| `metadata` | [Optional[shared.Metadata]](../../models/shared/metadata.md) | :heavy_minus_sign: | N/A | | +| `modified_date` | *Optional[str]* | :heavy_minus_sign: | N/A | 2022-10-23 00:00:00 +0000 UTC | +| `note` | *OptionalNullable[str]* | :heavy_minus_sign: | Any additional information about the bill credit note. | Bill Credit Note with 1 line items, totaling 805.78 | +| `payment_allocations` | List[[shared.Items](../../models/shared/items.md)] | :heavy_minus_sign: | An array of payment allocations. | | +| `remaining_credit` | *Optional[Decimal]* | :heavy_minus_sign: | Amount of the bill credit note that is still outstanding. | 0 | +| `source_modified_date` | *Optional[str]* | :heavy_minus_sign: | N/A | 2022-10-23 00:00:00 +0000 UTC | +| `supplemental_data` | [Optional[shared.SupplementalData]](../../models/shared/supplementaldata.md) | :heavy_minus_sign: | Supplemental data is additional data you can include in our standard data types.

It is referenced as a configured dynamic key value pair that is unique to the accounting software. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. | | +| `supplier_ref` | [Optional[shared.SupplierRef]](../../models/shared/supplierref.md) | :heavy_minus_sign: | Reference to the supplier the record relates to. | | +| `withholding_tax` | List[[shared.WithholdingTaxItems](../../models/shared/withholdingtaxitems.md)] | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/previous-versions/sync-for-payables-version-1/docs/models/shared/accountingbillpayment.md b/previous-versions/sync-for-payables-version-1/docs/models/shared/accountingbillpayment.md new file mode 100644 index 000000000..6fa240691 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/docs/models/shared/accountingbillpayment.md @@ -0,0 +1,176 @@ +# ~~AccountingBillPayment~~ + +> **Bill payments or payments?** +> +> We distinguish between transactions where the company received money vs. paid money. If the transaction represents a company spending money (accounts payable) we call this a Bill payment. +> +> See [payments](https://docs.codat.io/sync-for-payables-api#/schemas/Payment) for the accounts receivable equivalent of Bill payments, which covers [invoices](https://docs.codat.io/sync-for-payables-api#/schemas/Invoice) and [credit notes](https://docs.codat.io/sync-for-payables-api#/schemas/CreditNote). + +> View the coverage for bill payments in the Data coverage explorer. + +## Overview + +Bill payments include all accounts payable transaction data ([bills](https://docs.codat.io/sync-for-payables-api#/schemas/Bill) and [credit notes against bills](https://docs.codat.io/sync-for-payables-api#/schemas/BillCreditNote)). + +A bill payment in Codat usually represents an allocation of money within any customer accounts payable account. This includes, but is not strictly limited to: + +- A payment made against a bill — for example, a credit card payment, cheque payment, or cash payment. +- An allocation of a supplier's credit note to a bill or perhaps a refund. +- A bill payment made directly to an accounts payable account. This could be an overpayment or a prepayment, or a refund of a payment made directly to an accounts payable account. + +Depending on the bill payments which are allowed by the underlying accounting software, some of these types may be combined. Please see the example data section for samples of what these cases look like. + +In Codat, a bill payment contains details of: + +- When the bill payment was recorded in the accounting system. +- How much it is for and in the currency. +- Who the payment has been paid to, the _supplier_. +- The types of bill payments, the _line items_. + +Some accounting software give a separate name to purchases where the payment is made immediately, such as something bought with a credit card or online payment. One example of this would be QuickBooks Online's _expenses_. You can find these types of transactions in our [Direct costs](https://docs.codat.io/sync-for-payables-api#/schemas/DirectCost) data model. + +Bill payments is a child data type of [account transactions](https://docs.codat.io/sync-for-payables-api#/schemas/AccountTransaction). + +--- + +## Bill payment types + +### Payment of a bill + +A payment paying a single bill should have the following properties: + +- A `totalAmount` indicating the amount of the bill that was paid. This is always positive. +- A `lines` array containing one element with the following properties: + - An `amount` equal to the `totalAmount` above. + - A `links` array containing one element with the following properties: + - A `type` indicating the type of link, in this case a `Bill`. + - An `id` containing the ID of the bill that was paid. + - An amount of `-totalAmount` (negative `totalAmount`), indicating that the entirety of the paid amount is allocated to the bill. + +### Payment of multiple bills + +It is possible for one payment to pay multiple bills. This can be represented using two possible formats, depending on how the supplier keeps their books: + +1. The payment has multiple entries in its **lines** array, one for each bill that is paid. Each line will follow the above example for paying a bill, and the rules detailed in the data model. +2. The payment has a line with multiple links to each bill. This occurs when the proportion of the original payment allocated to each bill is not available. + +Each line is the same as those described above, with the **amount** indicating how much of the payment is allocated to the bill. The **amount** on the lines sum to the **totalAmount** on the payment. + +> Pushing batch payments to Xero +> +> When pushing a single bill payment to Xero to pay multiple bills, only the first format is supported—multiple entries in the payment **lines** array. + +### Payments and refunds on account + +A payment on account, that is a payment that doesn’t pay a specific bill, has one entry in its lines array. + +The line has the following properties: + +- A **totalAmount** indicating the amount paid by a supplier or refunded to them by a company. A payment to the supplier is always negative. A refund is always positive. +- A **links** array containing one element with the following properties: + - A **type** indicating the type of link. For a payment this is `PaymentOnAccount`. For a refund this is `Refund`. + - The **id** containing the ID of the supplier. + - An amount for the link is `0` **totalAmount** or the amount of the payment or refund. + +It is possible to have a payment that is part on account and part allocated to a bill. Each line should follow the examples above. + +### Using a credit note to pay a bill + +The payment of a bill using a credit note has one entry in its `lines` array. This **line** has the following properties: + +- An **amount** indicating the amount of money moved, which in this case is `0`, as the credit note and bill allocation must balance each other. +- A **links** array containing two elements: + - The first link has: + - A **type** indicating the type of link, in this case a `Bill`. + - An **id** containing the ID of the bill that was paid. + - The second link has: + - A **type** indicating the type of link, in this case a `CreditNote`. + - An **id** containing the ID of the credit note used by this payment. + +The **amount** field on the **line** equals the **totalAmount** on the payment. + +### Refunding a credit note + +A bill payment refunding a credit note has one entry in its **lines** array. This line has the following properties: + +- An **amount** indicating the amount of the credit note that was refunded. This is always negative, indicating that it is a refund. +- A **links** array containing one element with the following properties: + - A **type** indicating the type of `link`, in this case a `CreditNote`. + - An **id** containing the ID of the credit note that was refunded. + +The **totalAmount** field on the payment equals the line's **amount** field. These are both negative, as this is money leaving accounts payable. + +### Refunding a payment + +If a payment is refunded, for example, when a company overpaid a bill and the overpayment is returned, there are two payment records: + +- One for the incoming overpayment. +- Another for the outgoing refund. + +The payment issuing the refund is identified by the fact that the **totalAmount** is negative. This payment has one entry in its lines array that have the following properties: + +- An **amount** indicating the amount that was refunded. This is always negative. +- A **links** array containing one element with the following properties: + - A **type** indicating the type of a the link, in this case a `BillPayment`. + - An **id** containing the ID of the payment that was refunded. + +The **amount** field on the line equals the **totalAmount** on the payment and is negative as this is money leaving accounts payable. + +The payment that was refunded can be identified as it has a line where the `amount` on its `line` is positive and the type of the link is `Refund`. This payment may have several entries in its **lines** array if it was partly used to pay an bill. For example, a £1,050 payment paying a £1,000 bill with a refund of £50 has two lines: + +- One for £1,000 linked to the bill that was paid +- Another for £50 linked to the payment that refunded the over payment. This link is of type `Refund` but the ID corresponds to a bill payment. + +The line linked to the bill payment has the following properties: + +- An **amount** indicating the amount that was refunded. This is positive as its money that was added to accounts payable, but is balanced out by the negative amount of the refund. +- A **links** array containing one element with the following properties: + - A **type** indicating the type of the link, in this case a `Refund`. + - An **id** containing the ID of the payment that refunded this line. + +> Linked payments +> +> Not all accounting software support linked payments in this way. In these platforms you may see a payment on account and a refund on account. + +## Foreign currencies + +There are two types of currency rate that are detailed in the bill payments data type: + +Payment currency rate: + +- Base currency of the accounts payable account. +- Foreign currency of the bill payment. + +Payment line link currency rate: + +- Base currency of the item that the link represents. +- Foreign currency of the payment. + +These two rates allow the calculation of currency loss or gain for any of the transactions affected by the payment lines. The second rate is used when a bill payment is applied to an item in a currency that does not match either: + +- The base currency for the accounts payable account. +- The currency of the item. + + +> :warning: **DEPRECATED**: This will be removed in a future release, please migrate away from it as soon as possible. + + +## Fields + +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `date_` | *str* | :heavy_check_mark: | N/A | 2022-10-23 00:00:00 +0000 UTC | +| `account_ref` | [Optional[shared.AccountRef]](../../models/shared/accountref.md) | :heavy_minus_sign: | Data types that reference an account, for example bill and invoice line items, use an accountRef that includes the ID and name of the linked account. | | +| `currency` | *Optional[str]* | :heavy_minus_sign: | N/A | GBP | +| `currency_rate` | *OptionalNullable[Decimal]* | :heavy_minus_sign: | Rate to convert the total amount of the payment into the base currency for the company at the time of the payment.

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

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

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

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

## Examples with base currency of GBP

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

## Examples with base currency of USD

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


### Integration-specific details

\| Integration \| Scenario \| System behavior \|
\|-------------------\|-------------------------------------------------\|----------------------------------------------------------------------------------------------------------------------------------------------------------------------\|
\| QuickBooks Online \| Transaction currency differs from base currency \| If currency rate value is left `null`, a rate of 1 will be used by QBO by default. To override this, specify a currencyRate in the request body. \| | | +| `id` | *Optional[str]* | :heavy_minus_sign: | Identifier for the bill payment, unique for the company in the accounting software. | 3d5a8e00-d108-4045-8823-7f342676cffa | +| `lines` | List[[shared.BillPaymentLine](../../models/shared/billpaymentline.md)] | :heavy_minus_sign: | An array of bill payment lines. | | +| `metadata` | [Optional[shared.Metadata]](../../models/shared/metadata.md) | :heavy_minus_sign: | N/A | | +| `modified_date` | *Optional[str]* | :heavy_minus_sign: | N/A | 2022-10-23 00:00:00 +0000 UTC | +| `note` | *OptionalNullable[str]* | :heavy_minus_sign: | Additional information associated with the payment. | Bill Payment against bill c13e37b6-dfaa-4894-b3be-9fe97bda9f44 | +| `payment_method_ref` | [Optional[shared.PaymentMethodRef]](../../models/shared/paymentmethodref.md) | :heavy_minus_sign: | N/A | {
"id": "EILBDVJVNUAGVKRQ",
"name": "AliPay"
} | +| `reference` | *OptionalNullable[str]* | :heavy_minus_sign: | Additional information associated with the payment. | | +| `source_modified_date` | *Optional[str]* | :heavy_minus_sign: | N/A | 2022-10-23 00:00:00 +0000 UTC | +| `supplemental_data` | [Optional[shared.SupplementalData]](../../models/shared/supplementaldata.md) | :heavy_minus_sign: | Supplemental data is additional data you can include in our standard data types.

It is referenced as a configured dynamic key value pair that is unique to the accounting software. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. | | +| `supplier_ref` | [Optional[shared.SupplierRef]](../../models/shared/supplierref.md) | :heavy_minus_sign: | N/A | | +| `total_amount` | *Optional[Decimal]* | :heavy_minus_sign: | Amount of the payment in the payment currency. This value never changes and represents the amount of money that is paid into the supplier's account. | 1329.54 | \ No newline at end of file diff --git a/previous-versions/sync-for-payables-version-1/docs/models/shared/accountingjournal.md b/previous-versions/sync-for-payables-version-1/docs/models/shared/accountingjournal.md new file mode 100644 index 000000000..53bc1328d --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/docs/models/shared/accountingjournal.md @@ -0,0 +1,44 @@ +# ~~AccountingJournal~~ + +> **Language tip:** For line items, or individual transactions, of a company's financial documents, refer to the [Journal entries](https://docs.codat.io/sync-for-payables-api#/schemas/JournalEntry) data type + +> View the coverage for journals in the Data coverage explorer. + +## Overview + +In accounting software, journals are used to record all the financial transactions of a company. Each transaction in a journal is represented by a separate [journal entry](https://docs.codat.io/sync-for-payables-api#/schemas/JournalEntry). These entries are used to create the general ledger, which is then used to create the financial statements of a business. + +When a company records all their transactions in a single journal, it can become large and difficult to maintain and track. This is why large companies often use multiple journals (also known as subjournals) to categorize and manage journal entries. + +Such journals can be divided into two categories: + +- Special journals: journals used to record specific types of transactions; for example, a purchases journal, a sales journal, or a cash management journal. +- General journals: journals used to record transactions that fall outside the scope of the special journals. + +Multiple journals or subjournals are used in the following Codat integrations: + +- [Sage Intacct](https://docs.codat.io/integrations/accounting/sage-intacct/accounting-sage-intacct) (mandatory) +- [Exact Online](https://docs.codat.io/integrations/accounting/exact-online/accounting-exact-online) (mandatory) +- [Oracle NetSuite](https://docs.codat.io/integrations/accounting/netsuite/accounting-netsuite) (optional) + +> When pushing journal entries to an accounting software that doesn’t support multiple journals (multi-book accounting), the entries will be linked to the platform-generic journal. The Journals data type will only include one object. + + +> :warning: **DEPRECATED**: This will be removed in a future release, please migrate away from it as soon as possible. + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `created_on` | *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 | +| `has_children` | *Optional[bool]* | :heavy_minus_sign: | If the journal has child journals, this value is true. If it doesn’t, it is false. | | +| `id` | *Optional[str]* | :heavy_minus_sign: | Journal ID. | | +| `journal_code` | *OptionalNullable[str]* | :heavy_minus_sign: | Native journal number or code. | | +| `metadata` | [Optional[shared.Metadata]](../../models/shared/metadata.md) | :heavy_minus_sign: | N/A | | +| `modified_date` | *Optional[str]* | :heavy_minus_sign: | N/A | 2022-10-23 00:00:00 +0000 UTC | +| `name` | *OptionalNullable[str]* | :heavy_minus_sign: | Journal name.
The maximum length for a journal name is 256 characters. All characters above that number will be truncated. | | +| `parent_id` | *OptionalNullable[str]* | :heavy_minus_sign: | Parent journal ID.
If the journal is a parent journal, this value is not present. | | +| `source_modified_date` | *Optional[str]* | :heavy_minus_sign: | N/A | 2022-10-23 00:00:00 +0000 UTC | +| `status` | [Optional[shared.JournalStatus]](../../models/shared/journalstatus.md) | :heavy_minus_sign: | Current journal status. | | +| `type` | *OptionalNullable[str]* | :heavy_minus_sign: | The type of the journal. | | \ No newline at end of file diff --git a/previous-versions/sync-for-payables-version-1/docs/models/shared/accountingjournalentry.md b/previous-versions/sync-for-payables-version-1/docs/models/shared/accountingjournalentry.md new file mode 100644 index 000000000..08f876b97 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/docs/models/shared/accountingjournalentry.md @@ -0,0 +1,44 @@ +# ~~AccountingJournalEntry~~ + +> **Language tip:** For the top-level record of a company's financial transactions, refer to the [Journals](https://docs.codat.io/sync-for-payables-api#/schemas/Journal) data type + +> View the coverage for journal entries in the Data coverage explorer. + +## Overview + +A journal entry report shows the entries made in a company's general ledger, or [accounts](https://docs.codat.io/sync-for-payables-api#/schemas/Account), when transactions are approved. The journal line items for each journal entry should balance. + +A journal entry line item is a single transaction line on the journal entry. For example: + +- When a journal entry is recording a receipt of cash, the credit to accounts receivable and the debit to cash are separate line items. +- When a company needs to recognise revenue from an annual contract on a monthly basis, on receipt of cash for month one, they make a debit to deferred income and a credit to revenue. + +In Codat a journal entry contains details of: + +- The date on which the entry was created and posted. +- Itemised lines, including amounts and currency. +- A reference to the associated accounts. +- A reference to the underlying record. For example, the invoice, bill, or other data type that triggered the posting of the journal entry to the general ledger. + +> **Pushing journal entries** +> Codat only supports journal entries in the base currency of the company that are pushed into accounts denominated in the same base currency. + +> :warning: **DEPRECATED**: This will be removed in a future release, please migrate away from it as soon as possible. + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `created_on` | *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: | Optional description of the journal entry. | | +| `id` | *Optional[str]* | :heavy_minus_sign: | Unique identifier of the journal entry for the company in the accounting software. | | +| `journal_lines` | List[[shared.JournalLine](../../models/shared/journalline.md)] | :heavy_minus_sign: | An array of journal lines. | | +| `journal_ref` | [Optional[shared.JournalRef]](../../models/shared/journalref.md) | :heavy_minus_sign: | Links journal entries to the relevant journal in accounting integrations that use multi-book accounting (multiple journals). | | +| `metadata` | [Optional[shared.Metadata]](../../models/shared/metadata.md) | :heavy_minus_sign: | N/A | | +| `modified_date` | *Optional[str]* | :heavy_minus_sign: | N/A | 2022-10-23 00:00:00 +0000 UTC | +| `posted_on` | *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 | +| `record_ref` | [Optional[shared.JournalEntryRecordRef]](../../models/shared/journalentryrecordref.md) | :heavy_minus_sign: | Links a journal entry to the underlying record that created it. | | +| `source_modified_date` | *Optional[str]* | :heavy_minus_sign: | N/A | 2022-10-23 00:00:00 +0000 UTC | +| `supplemental_data` | [Optional[shared.SupplementalData]](../../models/shared/supplementaldata.md) | :heavy_minus_sign: | Supplemental data is additional data you can include in our standard data types.

It is referenced as a configured dynamic key value pair that is unique to the accounting software. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. | | +| `updated_on` | *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 | \ No newline at end of file diff --git a/previous-versions/sync-for-payables-version-1/docs/models/shared/accountingpaymentallocation.md b/previous-versions/sync-for-payables-version-1/docs/models/shared/accountingpaymentallocation.md new file mode 100644 index 000000000..0da94bb99 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/docs/models/shared/accountingpaymentallocation.md @@ -0,0 +1,9 @@ +# AccountingPaymentAllocation + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | +| `allocation` | [shared.BillAllocation](../../models/shared/billallocation.md) | :heavy_check_mark: | N/A | +| `payment` | [shared.PaymentAllocationPayment](../../models/shared/paymentallocationpayment.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/previous-versions/sync-for-payables-version-1/docs/models/shared/accountingprojectreference.md b/previous-versions/sync-for-payables-version-1/docs/models/shared/accountingprojectreference.md new file mode 100644 index 000000000..147c08a07 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/docs/models/shared/accountingprojectreference.md @@ -0,0 +1,9 @@ +# AccountingProjectReference + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------- | ------------------------------------------- | ------------------------------------------- | ------------------------------------------- | +| `id` | *str* | :heavy_check_mark: | Unique identifier to the project reference. | +| `name` | *OptionalNullable[str]* | :heavy_minus_sign: | The project's name. | \ No newline at end of file diff --git a/previous-versions/sync-for-payables-version-1/docs/models/shared/accountingsupplier.md b/previous-versions/sync-for-payables-version-1/docs/models/shared/accountingsupplier.md new file mode 100644 index 000000000..77a78436a --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/docs/models/shared/accountingsupplier.md @@ -0,0 +1,29 @@ +# ~~AccountingSupplier~~ + +> View the coverage for suppliers in the Data coverage explorer. + +## Overview + +From the **Suppliers** endpoints, you can retrieve a list of [all the suppliers for a company](https://docs.codat.io/sync-for-payables-api#/operations/list-suppliers). Suppliers' data links to accounts payable [bills](https://docs.codat.io/sync-for-payables-api#/schemas/Bill). + +> :warning: **DEPRECATED**: This will be removed in a future release, please migrate away from it as soon as possible. + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `status` | [shared.SupplierStatus](../../models/shared/supplierstatus.md) | :heavy_check_mark: | Status of the supplier. | | +| `addresses` | List[[shared.Address](../../models/shared/address.md)] | :heavy_minus_sign: | An array of Addresses. | | +| `contact_name` | *OptionalNullable[str]* | :heavy_minus_sign: | Name of the main contact for the supplier. | | +| `default_currency` | *OptionalNullable[str]* | :heavy_minus_sign: | Default currency the supplier's transactional data is recorded in. | | +| `email_address` | *OptionalNullable[str]* | :heavy_minus_sign: | Email address that the supplier may be contacted on. | | +| `id` | *Optional[str]* | :heavy_minus_sign: | Identifier for the supplier, unique to the company in the accounting software. | | +| `metadata` | [Optional[shared.Metadata]](../../models/shared/metadata.md) | :heavy_minus_sign: | N/A | | +| `modified_date` | *Optional[str]* | :heavy_minus_sign: | N/A | 2022-10-23 00:00:00 +0000 UTC | +| `phone` | *OptionalNullable[str]* | :heavy_minus_sign: | Phone number that the supplier may be contacted on. | +44 25691 154789 | +| `registration_number` | *OptionalNullable[str]* | :heavy_minus_sign: | Company number of the supplier. In the UK, this is typically the company registration number issued by Companies House. | | +| `source_modified_date` | *Optional[str]* | :heavy_minus_sign: | N/A | 2022-10-23 00:00:00 +0000 UTC | +| `supplemental_data` | [Optional[shared.SupplementalData]](../../models/shared/supplementaldata.md) | :heavy_minus_sign: | Supplemental data is additional data you can include in our standard data types.

It is referenced as a configured dynamic key value pair that is unique to the accounting software. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. | | +| `supplier_name` | *OptionalNullable[str]* | :heavy_minus_sign: | Name of the supplier as recorded in the accounting system, typically the company name. | | +| `tax_number` | *OptionalNullable[str]* | :heavy_minus_sign: | Supplier's company tax number. | | \ No newline at end of file diff --git a/previous-versions/sync-for-payables-version-1/docs/models/shared/accountprototype.md b/previous-versions/sync-for-payables-version-1/docs/models/shared/accountprototype.md new file mode 100644 index 000000000..f84247705 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/docs/models/shared/accountprototype.md @@ -0,0 +1,19 @@ +# AccountPrototype + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `currency` | *Optional[str]* | :heavy_minus_sign: | The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_.

## Unknown currencies

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

There are only a very small number of edge cases where this currency code is returned by the Codat system. | GBP | +| `current_balance` | *OptionalNullable[Decimal]* | :heavy_minus_sign: | Current balance in the account. | 0 | +| `description` | *OptionalNullable[str]* | :heavy_minus_sign: | Description for the account. | Invoices the business has issued but has not yet collected payment on. | +| `fully_qualified_category` | *OptionalNullable[str]* | :heavy_minus_sign: | Full category of the account.

For example, `Liability.Current` or `Income.Revenue`. To determine a list of possible categories for each integration, see our examples, follow our [Create, update, delete data](https://docs.codat.io/using-the-api/push) guide, or refer to the integration's own documentation. | Asset.Current | +| `fully_qualified_name` | *OptionalNullable[str]* | :heavy_minus_sign: | Full name of the account, for example:
- `Cash On Hand`
- `Rents Held In Trust`
- `Fixed Asset` | Cash On Hand | +| `is_bank_account` | *Optional[bool]* | :heavy_minus_sign: | Confirms whether the account is a bank account or not. | | +| `name` | *OptionalNullable[str]* | :heavy_minus_sign: | Name of the account. | Accounts Receivable | +| `nominal_code` | *OptionalNullable[str]* | :heavy_minus_sign: | Reference given to each nominal account for a business. It ensures money is allocated to the correct account. This code isn't a unique identifier in the Codat system. | 610 | +| `status` | [Optional[shared.AccountStatus]](../../models/shared/accountstatus.md) | :heavy_minus_sign: | Status of the account | Active | +| `supplemental_data` | [Optional[shared.SupplementalData]](../../models/shared/supplementaldata.md) | :heavy_minus_sign: | Supplemental data is additional data you can include in our standard data types.

It is referenced as a configured dynamic key value pair that is unique to the accounting software. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. | | +| `type` | [Optional[shared.AccountType]](../../models/shared/accounttype.md) | :heavy_minus_sign: | Type of account | Asset | +| `valid_datatype_links` | List[[shared.ValidDataTypeLinks](../../models/shared/validdatatypelinks.md)] | :heavy_minus_sign: | The validDatatypeLinks can be used to determine whether an account can be correctly mapped to another object; for example, accounts with a `type` of `income` might only support being used on an Invoice and Direct Income. For more information, see [Valid Data Type Links](/sync-for-payables-api#/schemas/ValidDataTypeLinks). | | \ No newline at end of file diff --git a/previous-versions/sync-for-payables-version-1/docs/models/shared/accountreference.md b/previous-versions/sync-for-payables-version-1/docs/models/shared/accountref.md similarity index 79% rename from previous-versions/sync-for-payables-version-1/docs/models/shared/accountreference.md rename to previous-versions/sync-for-payables-version-1/docs/models/shared/accountref.md index fe5dc4df9..167b8047c 100644 --- a/previous-versions/sync-for-payables-version-1/docs/models/shared/accountreference.md +++ b/previous-versions/sync-for-payables-version-1/docs/models/shared/accountref.md @@ -1,6 +1,6 @@ -# AccountReference +# AccountRef -Reference to the account to which the line item is linked. +Data types that reference an account, for example bill and invoice line items, use an accountRef that includes the ID and name of the linked account. ## Fields diff --git a/previous-versions/sync-for-payables-version-1/docs/models/shared/accounts.md b/previous-versions/sync-for-payables-version-1/docs/models/shared/accounts.md new file mode 100644 index 000000000..ff086d4d8 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/docs/models/shared/accounts.md @@ -0,0 +1,12 @@ +# Accounts + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | +| `links` | [shared.Links](../../models/shared/links.md) | :heavy_check_mark: | N/A | {
"self": {
"href": "/companies"
},
"current": {
"href": "/companies?page=1\u0026pageSize=10"
}
} | +| `page_number` | *int* | :heavy_check_mark: | Current page number. | | +| `page_size` | *int* | :heavy_check_mark: | Number of items to return in results array. | | +| `total_results` | *int* | :heavy_check_mark: | Total number of items. | | +| `results` | List[[shared.Account](../../models/shared/account.md)] | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/previous-versions/sync-for-payables-version-1/docs/models/shared/accountstatus.md b/previous-versions/sync-for-payables-version-1/docs/models/shared/accountstatus.md new file mode 100644 index 000000000..bd4cf2f26 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/docs/models/shared/accountstatus.md @@ -0,0 +1,13 @@ +# AccountStatus + +Status of the account + + +## Values + +| Name | Value | +| ---------- | ---------- | +| `UNKNOWN` | Unknown | +| `ACTIVE` | Active | +| `ARCHIVED` | Archived | +| `PENDING` | Pending | \ No newline at end of file diff --git a/previous-versions/sync-for-payables-version-1/docs/models/shared/accounttype.md b/previous-versions/sync-for-payables-version-1/docs/models/shared/accounttype.md new file mode 100644 index 000000000..f9c49f991 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/docs/models/shared/accounttype.md @@ -0,0 +1,15 @@ +# AccountType + +Type of account + + +## Values + +| Name | Value | +| ----------- | ----------- | +| `UNKNOWN` | Unknown | +| `ASSET` | Asset | +| `EXPENSE` | Expense | +| `INCOME` | Income | +| `LIABILITY` | Liability | +| `EQUITY` | Equity | \ No newline at end of file diff --git a/previous-versions/sync-for-payables-version-1/docs/models/shared/accountvaliddatatypelinks.md b/previous-versions/sync-for-payables-version-1/docs/models/shared/accountvaliddatatypelinks.md new file mode 100644 index 000000000..4aef075d4 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/docs/models/shared/accountvaliddatatypelinks.md @@ -0,0 +1,50 @@ +# AccountValidDataTypeLinks + +When querying Codat's data model, some data types return `validDatatypeLinks` metadata in the JSON response. This indicates where that object can be used as a reference—a _valid link_—when creating or updating other data. + +For example, `validDatatypeLinks` might indicate the following references: + +- Which tax rates are valid to use on the line item of a bill. +- Which items can be used when creating an invoice. + +You can use `validDatatypeLinks` to present your SMB customers with only valid choices when selecting objects from a list, for example. + +## `validDatatypeLinks` example + +The following example uses the `Accounting.Accounts` data type. It shows that, on the linked integration, this account is valid as the account on a payment or bill payment; and as the account referenced on the line item of a direct income or direct cost. Because there is no valid link to Invoices or Bills, using this account on those data types will result in an error. + +```json validDatatypeLinks for an account +{ + "id": "bd9e85e0-0478-433d-ae9f-0b3c4f04bfe4", + "nominalCode": "090", + "name": "Business Bank Account", + #... + "validDatatypeLinks": [ + { + "property": "Id", + "links": [ + "Payment.AccountRef.Id", + "BillPayment.AccountRef.Id", + "DirectIncome.LineItems.AccountRef.Id", + "DirectCost.LineItems.AccountRef.Id" + ] + } + ] + } +``` + + + +## Support for `validDatatypeLinks` + +Codat currently supports `validDatatypeLinks` for some data types on our Xero, QuickBooks Online, QuickBooks Desktop, Exact (NL), and Sage Business Cloud integrations. + +If you'd like us to extend support to more data types or integrations, suggest or vote for this on our Product Roadmap. + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | +| `links` | List[*str*] | :heavy_minus_sign: | Supported `dataTypes` that the record can be linked to. | +| `property` | *OptionalNullable[str]* | :heavy_minus_sign: | The property from the account that can be linked. | \ No newline at end of file diff --git a/previous-versions/sync-for-payables-version-1/docs/models/shared/address.md b/previous-versions/sync-for-payables-version-1/docs/models/shared/address.md new file mode 100644 index 000000000..adf3eb081 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/docs/models/shared/address.md @@ -0,0 +1,14 @@ +# Address + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | +| `type` | [shared.AccountingAddressType](../../models/shared/accountingaddresstype.md) | :heavy_check_mark: | The type of the address | +| `city` | *OptionalNullable[str]* | :heavy_minus_sign: | City of the customer address. | +| `country` | *OptionalNullable[str]* | :heavy_minus_sign: | Country of the customer address. | +| `line1` | *OptionalNullable[str]* | :heavy_minus_sign: | Line 1 of the customer address. | +| `line2` | *OptionalNullable[str]* | :heavy_minus_sign: | Line 2 of the customer address. | +| `postal_code` | *OptionalNullable[str]* | :heavy_minus_sign: | Postal code or zip code. | +| `region` | *OptionalNullable[str]* | :heavy_minus_sign: | Region of the customer address. | \ No newline at end of file diff --git a/previous-versions/sync-for-payables-version-1/docs/models/shared/allocation.md b/previous-versions/sync-for-payables-version-1/docs/models/shared/allocation.md new file mode 100644 index 000000000..cf516833b --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/docs/models/shared/allocation.md @@ -0,0 +1,11 @@ +# Allocation + + +## Fields + +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `allocated_on_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 | +| `currency` | *Optional[str]* | :heavy_minus_sign: | The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_.

## Unknown currencies

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

There are only a very small number of edge cases where this currency code is returned by the Codat system. | GBP | +| `currency_rate` | *OptionalNullable[Decimal]* | :heavy_minus_sign: | Rate to convert the total amount of the payment into the base currency for the company at the time of the payment.

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

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

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

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

## Examples with base currency of GBP

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

## Examples with base currency of USD

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


### Integration-specific details

\| Integration \| Scenario \| System behavior \|
\|-------------------\|-------------------------------------------------\|----------------------------------------------------------------------------------------------------------------------------------------------------------------------\|
\| QuickBooks Online \| Transaction currency differs from base currency \| If currency rate value is left `null`, a rate of 1 will be used by QBO by default. To override this, specify a currencyRate in the request body. \| | | +| `total_amount` | *Optional[Decimal]* | :heavy_minus_sign: | The total amount that has been allocated. | | \ No newline at end of file diff --git a/previous-versions/sync-for-payables-version-1/docs/models/shared/attachment.md b/previous-versions/sync-for-payables-version-1/docs/models/shared/attachment.md new file mode 100644 index 000000000..4265b934c --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/docs/models/shared/attachment.md @@ -0,0 +1,35 @@ +# Attachment + +The Codat API supports pulling and pushing of file attachments for invoices, bills, direct costs, and direct incomes. + +> **Retrieving attachments** +> +> If a company is authorized, you can query the Codat API to read, download, and upload attachments without requiring a fresh sync of data. + +Unlike other data types, Codat doesn't support [sync settings](https://docs.codat.io/knowledge-base/advanced-sync-settings) for attachments. + +Note that different integrations have different requirements to file size and extension of attachments. + +| Integration | File size | File extension | +|-------------------|-----------|--------------------------------------------------------------------------------------------------------------------------------------------------------------| +| Xero | 4 MB | 7Z, BMP, CSV, DOC, DOCX, EML, GIF, JPEG, JPG, KEYNOTE, MSG, NUMBERS, ODF, ODS, ODT, PAGES, PDF, PNG, PPT, PPTX, RAR, RTF, TIF, TIFF, TXT, XLS, XLSX, ZIP | +| QuickBooks Online | 100 MB | AI, CSV, DOC, DOCX, EPS, GIF, JPEG, JPG, ODS, PAGES, PDF, PNG, RTF, TIF, TXT, XLS, XLSX, XML | +| NetSuite | 100 MB | BMP, CSV, XLS, XLSX, JSON, PDF, PJPG, PJPEG, PNG, TXT, SVG, TIF, TIFF, DOC, DOCX, ZIP | +| Dynamics 365 Business Central | 350 MB | Dynamics do not explicitly outline which file types are supported but they do state here that "You can attach any type of file, such as text, image, or video files". | + +View the coverage for each integration in the Data coverage explorer. + + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `content_type` | *OptionalNullable[str]* | :heavy_minus_sign: | File type of the attachment. This is represented by appending the file type to the [IETF standard file naming requirements](https://tools.ietf.org/html/rfc6838). For example, for a jpeg file the output is **image/jpeg**.

Supported file types vary per platform. | | +| `date_created` | *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 | +| `file_size` | *OptionalNullable[int]* | :heavy_minus_sign: | File size in bytes. For example, if this reads **46153**, then the file size is 46kb. | | +| `id` | *Optional[str]* | :heavy_minus_sign: | Identifier for the attachment, unique for the company in the accounting software. | | +| `include_when_sent` | *Optional[bool]* | :heavy_minus_sign: | If `true`, then the attachment is included with the associated invoice, bill or direct costs when it is printed, emailed, or sent to a customer, if the underlying accounting software allows this. | | +| `modified_date` | *Optional[str]* | :heavy_minus_sign: | N/A | 2022-10-23 00:00:00 +0000 UTC | +| `name` | *OptionalNullable[str]* | :heavy_minus_sign: | Name of the attachment file. | | +| `source_modified_date` | *Optional[str]* | :heavy_minus_sign: | N/A | 2022-10-23 00:00:00 +0000 UTC | \ No newline at end of file diff --git a/previous-versions/sync-for-payables-version-1/docs/models/shared/attachments.md b/previous-versions/sync-for-payables-version-1/docs/models/shared/attachments.md new file mode 100644 index 000000000..95fd6a1d0 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/docs/models/shared/attachments.md @@ -0,0 +1,8 @@ +# Attachments + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | +| `attachments` | List[[shared.Attachment](../../models/shared/attachment.md)] | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/previous-versions/sync-for-payables-version-1/docs/models/shared/attachmentupload.md b/previous-versions/sync-for-payables-version-1/docs/models/shared/attachmentupload.md new file mode 100644 index 000000000..02d7ac41a --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/docs/models/shared/attachmentupload.md @@ -0,0 +1,8 @@ +# AttachmentUpload + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | +| `file` | [shared.CodatFile](../../models/shared/codatfile.md) | :heavy_check_mark: | The file to be uploaded as an attachment. | \ No newline at end of file diff --git a/previous-versions/sync-for-payables-version-1/docs/models/shared/bankaccountcreateresponse.md b/previous-versions/sync-for-payables-version-1/docs/models/shared/bankaccountcreateresponse.md new file mode 100644 index 000000000..685488c3c --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/docs/models/shared/bankaccountcreateresponse.md @@ -0,0 +1,21 @@ +# BankAccountCreateResponse + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `company_id` | *str* | :heavy_check_mark: | Unique identifier for your SMB in Codat. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `data_connection_key` | *str* | :heavy_check_mark: | Unique identifier for a company's data connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | +| `push_operation_key` | *str* | :heavy_check_mark: | A unique identifier generated by Codat to represent this single push operation. This identifier can be used to track the status of the push, and should be persisted. | | +| `requested_on_utc` | *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 | +| `status` | [shared.PushOperationStatus](../../models/shared/pushoperationstatus.md) | :heavy_check_mark: | The current status of the push operation. | | +| `status_code` | *int* | :heavy_check_mark: | Push status code. | | +| `changes` | List[[shared.PushOperationChange](../../models/shared/pushoperationchange.md)] | :heavy_minus_sign: | Contains a single entry that communicates which record has changed and the manner in which it changed. | | +| `completed_on_utc` | *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 | +| `data` | [OptionalNullable[shared.AccountingBankAccount]](../../models/shared/accountingbankaccount.md) | :heavy_minus_sign: | N/A | | +| `data_type` | [Optional[shared.DataType]](../../models/shared/datatype.md) | :heavy_minus_sign: | Available data types | invoices | +| `error_message` | *OptionalNullable[str]* | :heavy_minus_sign: | A message about the error. | | +| `timeout_in_minutes` | *OptionalNullable[int]* | :heavy_minus_sign: | Number of minutes the push operation must complete within before it times out. | | +| ~~`timeout_in_seconds`~~ | *OptionalNullable[int]* | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible.

Number of seconds the push operation must complete within before it times out. | | +| `validation` | [Optional[shared.Validation]](../../models/shared/validation.md) | :heavy_minus_sign: | A human-readable object describing validation decisions Codat has made when pushing data into the platform. If a push has failed because of validation errors, they will be detailed here. | | \ No newline at end of file diff --git a/previous-versions/sync-for-payables-version-1/docs/models/shared/bankaccountcreateresponsebankaccounttype.md b/previous-versions/sync-for-payables-version-1/docs/models/shared/bankaccountcreateresponsebankaccounttype.md new file mode 100644 index 000000000..1672cfb66 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/docs/models/shared/bankaccountcreateresponsebankaccounttype.md @@ -0,0 +1,14 @@ +# BankAccountCreateResponseBankAccountType + +The type of transactions and balances on the account. +For Credit accounts, positive balances are liabilities, and positive transactions **reduce** liabilities. +For Debit accounts, positive balances are assets, and positive transactions **increase** assets. + + +## Values + +| Name | Value | +| --------- | --------- | +| `UNKNOWN` | Unknown | +| `CREDIT` | Credit | +| `DEBIT` | Debit | \ No newline at end of file diff --git a/previous-versions/sync-for-payables-version-1/docs/models/operations/updatecompanyresponse.md b/previous-versions/sync-for-payables-version-1/docs/models/shared/bankaccountprototype.md similarity index 74% rename from previous-versions/sync-for-payables-version-1/docs/models/operations/updatecompanyresponse.md rename to previous-versions/sync-for-payables-version-1/docs/models/shared/bankaccountprototype.md index 3005c9e88..eaaa4a252 100644 --- a/previous-versions/sync-for-payables-version-1/docs/models/operations/updatecompanyresponse.md +++ b/previous-versions/sync-for-payables-version-1/docs/models/shared/bankaccountprototype.md @@ -1,11 +1,19 @@ -# UpdateCompanyResponse +# BankAccountPrototype ## Fields -| Field | Type | Required | Description | Example | -| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `content_type` | *str* | :heavy_check_mark: | HTTP response content type for this operation | | -| `status_code` | *int* | :heavy_check_mark: | HTTP response status code for this operation | | -| `raw_response` | [requests.Response](https://requests.readthedocs.io/en/latest/api/#requests.Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | | -| `company` | [Optional[shared.Company]](../../models/shared/company.md) | :heavy_minus_sign: | OK | {"id":"0498e921-9b53-4396-a412-4f2f5983b0a2","name":"string","platform":"string","redirect":"https://link.codat.io/company/27628208-459c-46a2-a705-5641ce25f739","lastSync":"2022-01-01T12:00:00.000Z","created":"2022-01-01T12:00:00.000Z","createdByUserName":"string","dataConnections":[{"id":"ee2eb431-c0fa-4dc9-93fa-d29781c12bcd","integrationId":"bf083d72-62c7-493e-aec9-81b4dbba7e2c","integrationKey":"dfxm","sourceId":"bdd831ce-eebd-4896-89a7-20e5ee8989ee","platformName":"Basiq","linkUrl":"https://link-api.codat.io/companies/86bd88cb-44ab-4dfb-b32f-87b19b14287f/connections/ee2eb431-c0fa-4dc9-93fa-d29781c12bcd/start","status":"Linked","lastSync":"2022-10-27T10:22:43.6464237Z","created":"2022-10-27T09:53:29Z","sourceType":"Banking"}],"groups":[{"id":"d7a6c4b4-dc87-45f6-b803-62f466398680"}]} | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `account_name` | *OptionalNullable[str]* | :heavy_minus_sign: | Name of the bank account in the accounting software. | | +| `account_number` | *OptionalNullable[str]* | :heavy_minus_sign: | Account number for the bank account.

Xero integrations
Only a UK account number shows for bank accounts with GBP currency and a combined total of sort code and account number that equals 14 digits, For non-GBP accounts, the full bank account number is populated.

FreeAgent integrations
For Credit accounts, only the last four digits are required. For other types, the field is optional. | | +| `account_type` | [Optional[shared.BankAccountType]](../../models/shared/bankaccounttype.md) | :heavy_minus_sign: | The type of transactions and balances on the account.
For Credit accounts, positive balances are liabilities, and positive transactions **reduce** liabilities.
For Debit accounts, positive balances are assets, and positive transactions **increase** assets. | | +| `available_balance` | *OptionalNullable[Decimal]* | :heavy_minus_sign: | Total available balance of the bank account as reported by the underlying data source. This may take into account overdrafts or pending transactions for example. | | +| `balance` | *OptionalNullable[Decimal]* | :heavy_minus_sign: | Balance of the bank account. | | +| `currency` | *Optional[str]* | :heavy_minus_sign: | The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_.

## Unknown currencies

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

There are only a very small number of edge cases where this currency code is returned by the Codat system. | GBP | +| `i_ban` | *OptionalNullable[str]* | :heavy_minus_sign: | International bank account number of the account. Often used when making or receiving international payments. | | +| `institution` | *OptionalNullable[str]* | :heavy_minus_sign: | The institution of the bank account. | | +| `nominal_code` | *OptionalNullable[str]* | :heavy_minus_sign: | Code used to identify each nominal account for a business. | | +| `overdraft_limit` | *OptionalNullable[Decimal]* | :heavy_minus_sign: | Pre-arranged overdraft limit of the account.

The value is always positive. For example, an overdraftLimit of `1000` means that the balance of the account can go down to `-1000`. | | +| `sort_code` | *OptionalNullable[str]* | :heavy_minus_sign: | Sort code for the bank account.

Xero integrations
The sort code is only displayed when the currency = GBP and the sort code and account number sum to 14 digits. For non-GBP accounts, this field is not populated. | | +| `status` | [Optional[shared.BankAccountStatus]](../../models/shared/bankaccountstatus.md) | :heavy_minus_sign: | Status of the bank account. | Active | \ No newline at end of file diff --git a/previous-versions/sync-for-payables-version-1/docs/models/shared/bankaccountstatus.md b/previous-versions/sync-for-payables-version-1/docs/models/shared/bankaccountstatus.md new file mode 100644 index 000000000..b4d504d31 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/docs/models/shared/bankaccountstatus.md @@ -0,0 +1,13 @@ +# BankAccountStatus + +Status of the bank account. + + +## Values + +| Name | Value | +| ---------- | ---------- | +| `UNKNOWN` | Unknown | +| `ACTIVE` | Active | +| `ARCHIVED` | Archived | +| `PENDING` | Pending | \ No newline at end of file diff --git a/previous-versions/sync-for-payables-version-1/docs/models/shared/bankaccounttype.md b/previous-versions/sync-for-payables-version-1/docs/models/shared/bankaccounttype.md new file mode 100644 index 000000000..a995a4e52 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/docs/models/shared/bankaccounttype.md @@ -0,0 +1,14 @@ +# BankAccountType + +The type of transactions and balances on the account. +For Credit accounts, positive balances are liabilities, and positive transactions **reduce** liabilities. +For Debit accounts, positive balances are assets, and positive transactions **increase** assets. + + +## Values + +| Name | Value | +| --------- | --------- | +| `UNKNOWN` | Unknown | +| `CREDIT` | Credit | +| `DEBIT` | Debit | \ No newline at end of file diff --git a/previous-versions/sync-for-payables-version-1/docs/models/shared/bill.md b/previous-versions/sync-for-payables-version-1/docs/models/shared/bill.md index 432298308..67bffa3fa 100644 --- a/previous-versions/sync-for-payables-version-1/docs/models/shared/bill.md +++ b/previous-versions/sync-for-payables-version-1/docs/models/shared/bill.md @@ -1,20 +1,48 @@ # Bill -Bills are invoices that represent the SMB's financial obligations to their supplier for a purchase of goods or services. +> **Invoices or bills?** +> +> We distinguish between invoices where the company *owes money* vs. *is owed money*. If the company has received an invoice, and owes money to someone else (accounts payable) we call this a Bill. +> +> See [Invoices](https://docs.codat.io/sync-for-payables-api#/schemas/Invoice) for the accounts receivable equivalent of bills. + +View the coverage for bills in the Data coverage explorer. + +## Overview + +In Codat, a bill contains details of: +* When the bill was recorded in the accounting system. +* How much the bill is for and the currency of the amount. +* Who the bill was received from — the *supplier*. +* What the bill is for — the *line items*. + +Some accounting software give a separate name to purchases where the payment is made immediately, such as something bought with a credit card or online payment. One example of this would be QuickBooks Online's *expenses*. + +You can find these types of transactions in our [Direct costs](https://docs.codat.io/sync-for-payables-api#/schemas/DirectCost) data model. ## Fields -| Field | Type | Required | Description | Example | -| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `amount_due` | *Optional[Decimal]* | :heavy_minus_sign: | Amount outstanding on the bill. | | -| `currency` | *Optional[str]* | :heavy_minus_sign: | The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_.

## Unknown currencies

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

There are only a very small number of edge cases where this currency code is returned by the Codat system. | GBP | -| `due_date` | *Optional[str]* | :heavy_minus_sign: | N/A | 2022-10-23 00:00:00 +0000 UTC | -| `id` | *Optional[str]* | :heavy_minus_sign: | Identifier for the bill, unique for the company in the accounting platform. | | -| `issue_date` | *Optional[str]* | :heavy_minus_sign: | N/A | 2022-10-23 00:00:00 +0000 UTC | -| `line_items` | List[[shared.BillLineItem](../../models/shared/billlineitem.md)] | :heavy_minus_sign: | Array of Bill line items. | | -| `reference` | *Optional[str]* | :heavy_minus_sign: | User-friendly reference for the bill. | | -| `source_modified_date` | *Optional[str]* | :heavy_minus_sign: | N/A | 2022-10-23 00:00:00 +0000 UTC | -| `status` | [Optional[shared.BillStatus]](../../models/shared/billstatus.md) | :heavy_minus_sign: | Current state of the bill. | Open | -| `supplier_ref` | [Optional[shared.SupplierRef]](../../models/shared/supplierref.md) | :heavy_minus_sign: | Reference to the supplier the record relates to. | | -| `total_amount` | *Optional[Decimal]* | :heavy_minus_sign: | Amount of the bill, including tax. | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `issue_date` | *str* | :heavy_check_mark: | N/A | 2022-10-23 00:00:00 +0000 UTC | +| `status` | [shared.BillStatus](../../models/shared/billstatus.md) | :heavy_check_mark: | Current state of the bill. | | +| `sub_total` | *Decimal* | :heavy_check_mark: | Total amount of the bill, excluding any taxes. | | +| `tax_amount` | *Decimal* | :heavy_check_mark: | Amount of tax on the bill. | | +| `total_amount` | *Decimal* | :heavy_check_mark: | Amount of the bill, including tax. | | +| `amount_due` | *OptionalNullable[Decimal]* | :heavy_minus_sign: | Amount outstanding on the bill. | | +| `currency` | *Optional[str]* | :heavy_minus_sign: | The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_.

## Unknown currencies

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

There are only a very small number of edge cases where this currency code is returned by the Codat system. | GBP | +| `currency_rate` | *OptionalNullable[Decimal]* | :heavy_minus_sign: | Rate to convert the total amount of the payment into the base currency for the company at the time of the payment.

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

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

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

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

## Examples with base currency of GBP

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

## Examples with base currency of USD

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


### Integration-specific details

\| Integration \| Scenario \| System behavior \|
\|-------------------\|-------------------------------------------------\|----------------------------------------------------------------------------------------------------------------------------------------------------------------------\|
\| QuickBooks Online \| Transaction currency differs from base currency \| If currency rate value is left `null`, a rate of 1 will be used by QBO by default. To override this, specify a currencyRate in the request body. \| | | +| `due_date` | *Optional[str]* | :heavy_minus_sign: | N/A | 2022-10-23 00:00:00 +0000 UTC | +| `id` | *Optional[str]* | :heavy_minus_sign: | Identifier for the bill, unique for the company in the accounting software. | | +| `line_items` | List[[shared.BillLineItem](../../models/shared/billlineitem.md)] | :heavy_minus_sign: | Array of Bill line items. | | +| `metadata` | [Optional[shared.Metadata]](../../models/shared/metadata.md) | :heavy_minus_sign: | N/A | | +| `modified_date` | *Optional[str]* | :heavy_minus_sign: | N/A | 2022-10-23 00:00:00 +0000 UTC | +| `note` | *OptionalNullable[str]* | :heavy_minus_sign: | Any private, company notes about the bill, such as payment information. | | +| `payment_allocations` | List[[shared.AccountingPaymentAllocation](../../models/shared/accountingpaymentallocation.md)] | :heavy_minus_sign: | An array of payment allocations. | | +| `purchase_order_refs` | List[[shared.PurchaseOrderReference](../../models/shared/purchaseorderreference.md)] | :heavy_minus_sign: | N/A | | +| `reference` | *OptionalNullable[str]* | :heavy_minus_sign: | User-friendly reference for the bill. | | +| `source_modified_date` | *Optional[str]* | :heavy_minus_sign: | N/A | 2022-10-23 00:00:00 +0000 UTC | +| `supplemental_data` | [Optional[shared.SupplementalData]](../../models/shared/supplementaldata.md) | :heavy_minus_sign: | Supplemental data is additional data you can include in our standard data types.

It is referenced as a configured dynamic key value pair that is unique to the accounting software. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. | | +| `supplier_ref` | [Optional[shared.SupplierRef]](../../models/shared/supplierref.md) | :heavy_minus_sign: | Reference to the supplier the record relates to. | | +| `withholding_tax` | List[[shared.WithholdingTax](../../models/shared/withholdingtax.md)] | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/previous-versions/sync-for-payables-version-1/docs/models/shared/billallocation.md b/previous-versions/sync-for-payables-version-1/docs/models/shared/billallocation.md new file mode 100644 index 000000000..46ff017e5 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/docs/models/shared/billallocation.md @@ -0,0 +1,11 @@ +# BillAllocation + + +## Fields + +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `allocated_on_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 | +| `currency` | *Optional[str]* | :heavy_minus_sign: | The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_.

## Unknown currencies

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

There are only a very small number of edge cases where this currency code is returned by the Codat system. | GBP | +| `currency_rate` | *OptionalNullable[Decimal]* | :heavy_minus_sign: | Rate to convert the total amount of the payment into the base currency for the company at the time of the payment.

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

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

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

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

## Examples with base currency of GBP

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

## Examples with base currency of USD

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


### Integration-specific details

\| Integration \| Scenario \| System behavior \|
\|-------------------\|-------------------------------------------------\|----------------------------------------------------------------------------------------------------------------------------------------------------------------------\|
\| QuickBooks Online \| Transaction currency differs from base currency \| If currency rate value is left `null`, a rate of 1 will be used by QBO by default. To override this, specify a currencyRate in the request body. \| | | +| `total_amount` | *Optional[Decimal]* | :heavy_minus_sign: | The total amount that has been allocated. | | \ No newline at end of file diff --git a/previous-versions/sync-for-payables-version-1/docs/models/shared/billcreditnote.md b/previous-versions/sync-for-payables-version-1/docs/models/shared/billcreditnote.md new file mode 100644 index 000000000..07a6823b5 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/docs/models/shared/billcreditnote.md @@ -0,0 +1,47 @@ +# BillCreditNote + +> **Bill credit notes or credit notes?** +> +> In Codat, bill credit notes represent accounts payable only. For accounts receivable, see [Credit notes](https://docs.codat.io/sync-for-payables-api#/schemas/CreditNote). + +View the coverage for bill credit notes in the Data coverage explorer. + +## Overview + +A bill credit note is issued by a supplier for the purpose of recording credit. For example, if a supplier was unable to fulfil an order that was placed by a business, or delivered damaged goods, they would issue a bill credit note. A bill credit note reduces the amount a business owes to the supplier. It can be refunded to the business or used to pay off future bills. + +In the Codat API, a bill credit note is an accounts payable record issued by a [supplier](https://docs.codat.io/sync-for-payables-api#/schemas/Supplier). + +A bill credit note includes details of: +* The original and remaining credit. +* Any allocations of the credit against other records, such as [bills](https://docs.codat.io/sync-for-payables-api#/schemas/Bill). +* The supplier that issued the bill credit note. + + +## Fields + +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `discount_percentage` | *Decimal* | :heavy_check_mark: | Percentage rate of any discount applied to the bill credit note. | 0 | +| `status` | [shared.BillCreditNoteStatus](../../models/shared/billcreditnotestatus.md) | :heavy_check_mark: | Current state of the bill credit note | Paid | +| `sub_total` | *Decimal* | :heavy_check_mark: | Total amount of the bill credit note, including discounts but excluding tax. | 805.78 | +| `total_amount` | *Decimal* | :heavy_check_mark: | Total amount of credit that has been applied to the business' account with the supplier, including discounts and tax. | 805.78 | +| `total_discount` | *Decimal* | :heavy_check_mark: | Total value of any discounts applied. | 0 | +| `total_tax_amount` | *Decimal* | :heavy_check_mark: | Amount of tax included in the bill credit note. | 0 | +| `allocated_on_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 | +| `bill_credit_note_number` | *OptionalNullable[str]* | :heavy_minus_sign: | Friendly reference for the bill credit note. | 91fe2a83-e161-4c21-929d-c5c10c4b07e5 | +| `created_from_refs` | List[[shared.RecordReference](../../models/shared/recordreference.md)] | :heavy_minus_sign: | An array of records the credit note was created from. | | +| `currency` | *Optional[str]* | :heavy_minus_sign: | The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_.

## Unknown currencies

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

There are only a very small number of edge cases where this currency code is returned by the Codat system. | GBP | +| `currency_rate` | *OptionalNullable[Decimal]* | :heavy_minus_sign: | Rate to convert the total amount of the payment into the base currency for the company at the time of the payment.

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

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

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

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

## Examples with base currency of GBP

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

## Examples with base currency of USD

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


### Integration-specific details

\| Integration \| Scenario \| System behavior \|
\|-------------------\|-------------------------------------------------\|----------------------------------------------------------------------------------------------------------------------------------------------------------------------\|
\| QuickBooks Online \| Transaction currency differs from base currency \| If currency rate value is left `null`, a rate of 1 will be used by QBO by default. To override this, specify a currencyRate in the request body. \| | | +| `id` | *Optional[str]* | :heavy_minus_sign: | Identifier for the bill credit note that is unique to a company in the accounting software. | 1509398f-98e2-436d-8a5d-c042e0c74ffc | +| `issue_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 | +| `line_items` | List[[shared.BillCreditNoteLineItem](../../models/shared/billcreditnotelineitem.md)] | :heavy_minus_sign: | An array of line | | +| `metadata` | [Optional[shared.Metadata]](../../models/shared/metadata.md) | :heavy_minus_sign: | N/A | | +| `modified_date` | *Optional[str]* | :heavy_minus_sign: | N/A | 2022-10-23 00:00:00 +0000 UTC | +| `note` | *OptionalNullable[str]* | :heavy_minus_sign: | Any additional information about the bill credit note. | Bill Credit Note with 1 line items, totaling 805.78 | +| `payment_allocations` | List[[shared.Items](../../models/shared/items.md)] | :heavy_minus_sign: | An array of payment allocations. | | +| `remaining_credit` | *Optional[Decimal]* | :heavy_minus_sign: | Amount of the bill credit note that is still outstanding. | 0 | +| `source_modified_date` | *Optional[str]* | :heavy_minus_sign: | N/A | 2022-10-23 00:00:00 +0000 UTC | +| `supplemental_data` | [Optional[shared.SupplementalData]](../../models/shared/supplementaldata.md) | :heavy_minus_sign: | Supplemental data is additional data you can include in our standard data types.

It is referenced as a configured dynamic key value pair that is unique to the accounting software. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. | | +| `supplier_ref` | [Optional[shared.SupplierRef]](../../models/shared/supplierref.md) | :heavy_minus_sign: | Reference to the supplier the record relates to. | | +| `withholding_tax` | List[[shared.WithholdingTaxItems](../../models/shared/withholdingtaxitems.md)] | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/previous-versions/sync-for-payables-version-1/docs/models/operations/unlinkconnectionresponse.md b/previous-versions/sync-for-payables-version-1/docs/models/shared/billcreditnotelineitem.md similarity index 54% rename from previous-versions/sync-for-payables-version-1/docs/models/operations/unlinkconnectionresponse.md rename to previous-versions/sync-for-payables-version-1/docs/models/shared/billcreditnotelineitem.md index 08eb976b5..268918105 100644 --- a/previous-versions/sync-for-payables-version-1/docs/models/operations/unlinkconnectionresponse.md +++ b/previous-versions/sync-for-payables-version-1/docs/models/shared/billcreditnotelineitem.md @@ -1,11 +1,22 @@ -# UnlinkConnectionResponse +# BillCreditNoteLineItem ## Fields -| Field | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `content_type` | *str* | :heavy_check_mark: | HTTP response content type for this operation | | -| `status_code` | *int* | :heavy_check_mark: | HTTP response status code for this operation | | -| `raw_response` | [requests.Response](https://requests.readthedocs.io/en/latest/api/#requests.Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | | -| `connection` | [Optional[shared.Connection]](../../models/shared/connection.md) | :heavy_minus_sign: | OK | {"id":"ee2eb431-c0fa-4dc9-93fa-d29781c12bcd","integrationId":"bf083d72-62c7-493e-aec9-81b4dbba7e2c","integrationKey":"dfxm","sourceId":"bdd831ce-eebd-4896-89a7-20e5ee8989ee","platformName":"Basiq","linkUrl":"https://link-api.codat.io/companies/86bd88cb-44ab-4dfb-b32f-87b19b14287f/connections/ee2eb431-c0fa-4dc9-93fa-d29781c12bcd/start","status":"Linked","lastSync":"2022-10-27T10:22:43.6464237Z","created":"2022-10-27T09:53:29Z","sourceType":"Banking"} | \ No newline at end of file +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `quantity` | *Decimal* | :heavy_check_mark: | Number of units of the goods or service for which credit has been received. | +| `unit_amount` | *Decimal* | :heavy_check_mark: | Unit price of the goods or service. | +| `account_ref` | [Optional[shared.AccountRef]](../../models/shared/accountref.md) | :heavy_minus_sign: | Data types that reference an account, for example bill and invoice line items, use an accountRef that includes the ID and name of the linked account. | +| `created_from_line_ref` | [Optional[shared.Zero]](../../models/shared/zero.md) | :heavy_minus_sign: | Links the current record line to the underlying record line that created it.

For example, if a bill is generated from a purchase order, this property allows you to connect the bill line item to the purchase order line item in our data model. | +| `description` | *OptionalNullable[str]* | :heavy_minus_sign: | Friendly name of each line item. For example, the goods or service for which credit has been received. | +| `discount_amount` | *OptionalNullable[Decimal]* | :heavy_minus_sign: | Value of any discounts applied. | +| `discount_percentage` | *OptionalNullable[Decimal]* | :heavy_minus_sign: | Percentage rate of any discount applied to the line item. | +| `item_ref` | [Optional[shared.ItemReference]](../../models/shared/itemreference.md) | :heavy_minus_sign: | Reference to the item the line is linked to. | +| `sub_total` | *OptionalNullable[Decimal]* | :heavy_minus_sign: | Amount of credit associated with the line item, including discounts but excluding tax. | +| `tax_amount` | *OptionalNullable[Decimal]* | :heavy_minus_sign: | Amount of tax associated with the line item. | +| `tax_rate_ref` | [Optional[shared.TaxRateRef]](../../models/shared/taxrateref.md) | :heavy_minus_sign: | Data types that reference a tax rate, for example invoice and bill line items, use a taxRateRef that includes the ID and name of the linked tax rate.

Found on:

- Bill line items
- Bill Credit Note line items
- Credit Note line items
- Direct incomes line items
- Invoice line items
- Items | +| `total_amount` | *OptionalNullable[Decimal]* | :heavy_minus_sign: | Total amount of the line item, including discounts and tax. | +| `tracking` | [Optional[shared.BillCreditNoteLineItemTracking]](../../models/shared/billcreditnotelineitemtracking.md) | :heavy_minus_sign: | Categories, and a project and customer, against which the item is tracked. | +| ~~`tracking_category_refs`~~ | List[[shared.TrackingCategoryRef](../../models/shared/trackingcategoryref.md)] | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible.

Reference to the tracking categories to which the line item is linked. | +| `unit_of_measurement` | *OptionalNullable[str]* | :heavy_minus_sign: | The measurement which defines a unit for this item (e.g. 'kilogram', 'litre'). | \ No newline at end of file diff --git a/previous-versions/sync-for-payables-version-1/docs/models/shared/billcreditnotelineitemaccountingprojectreference.md b/previous-versions/sync-for-payables-version-1/docs/models/shared/billcreditnotelineitemaccountingprojectreference.md new file mode 100644 index 000000000..dc518119b --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/docs/models/shared/billcreditnotelineitemaccountingprojectreference.md @@ -0,0 +1,9 @@ +# BillCreditNoteLineItemAccountingProjectReference + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------- | ------------------------------------------- | ------------------------------------------- | ------------------------------------------- | +| `id` | *str* | :heavy_check_mark: | Unique identifier to the project reference. | +| `name` | *OptionalNullable[str]* | :heavy_minus_sign: | The project's name. | \ No newline at end of file diff --git a/previous-versions/sync-for-payables-version-1/docs/models/shared/billcreditnotelineitemcustomerref.md b/previous-versions/sync-for-payables-version-1/docs/models/shared/billcreditnotelineitemcustomerref.md new file mode 100644 index 000000000..a921b9c76 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/docs/models/shared/billcreditnotelineitemcustomerref.md @@ -0,0 +1,9 @@ +# BillCreditNoteLineItemCustomerRef + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------ | ------------------------------------------ | ------------------------------------------ | ------------------------------------------ | +| `id` | *str* | :heavy_check_mark: | `id` from the Customers data type | +| `company_name` | *OptionalNullable[str]* | :heavy_minus_sign: | `customerName` from the Customer data type | \ No newline at end of file diff --git a/previous-versions/sync-for-payables-version-1/docs/models/shared/billcreditnotelineitemtracking.md b/previous-versions/sync-for-payables-version-1/docs/models/shared/billcreditnotelineitemtracking.md new file mode 100644 index 000000000..fb22ffd72 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/docs/models/shared/billcreditnotelineitemtracking.md @@ -0,0 +1,14 @@ +# BillCreditNoteLineItemTracking + +Categories, and a project and customer, against which the item is tracked. + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------- | +| `category_refs` | List[[shared.TrackingCategoryRef](../../models/shared/trackingcategoryref.md)] | :heavy_check_mark: | N/A | +| `is_billed_to` | [shared.BilledToType](../../models/shared/billedtotype.md) | :heavy_check_mark: | Defines if the invoice or credit note is billed/rebilled to a project or customer. | +| `is_rebilled_to` | [shared.BilledToType](../../models/shared/billedtotype.md) | :heavy_check_mark: | Defines if the invoice or credit note is billed/rebilled to a project or customer. | +| `customer_ref` | [Optional[shared.BillCreditNoteLineItemCustomerRef]](../../models/shared/billcreditnotelineitemcustomerref.md) | :heavy_minus_sign: | N/A | +| `project_ref` | [Optional[shared.BillCreditNoteLineItemAccountingProjectReference]](../../models/shared/billcreditnotelineitemaccountingprojectreference.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/previous-versions/sync-for-payables-version-1/docs/models/shared/billcreditnotes.md b/previous-versions/sync-for-payables-version-1/docs/models/shared/billcreditnotes.md new file mode 100644 index 000000000..d763c1f37 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/docs/models/shared/billcreditnotes.md @@ -0,0 +1,12 @@ +# BillCreditNotes + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | +| `links` | [shared.Links](../../models/shared/links.md) | :heavy_check_mark: | N/A | {
"self": {
"href": "/companies"
},
"current": {
"href": "/companies?page=1\u0026pageSize=10"
}
} | +| `page_number` | *int* | :heavy_check_mark: | Current page number. | | +| `page_size` | *int* | :heavy_check_mark: | Number of items to return in results array. | | +| `total_results` | *int* | :heavy_check_mark: | Total number of items. | | +| `results` | List[[shared.BillCreditNote](../../models/shared/billcreditnote.md)] | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/previous-versions/sync-for-payables-version-1/docs/models/shared/billcreditnotestatus.md b/previous-versions/sync-for-payables-version-1/docs/models/shared/billcreditnotestatus.md new file mode 100644 index 000000000..d741e549d --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/docs/models/shared/billcreditnotestatus.md @@ -0,0 +1,15 @@ +# BillCreditNoteStatus + +Current state of the bill credit note + + +## Values + +| Name | Value | +| ---------------- | ---------------- | +| `UNKNOWN` | Unknown | +| `DRAFT` | Draft | +| `SUBMITTED` | Submitted | +| `PAID` | Paid | +| `VOID` | Void | +| `PARTIALLY_PAID` | PartiallyPaid | \ No newline at end of file diff --git a/previous-versions/sync-for-payables-version-1/docs/models/shared/billedtotype.md b/previous-versions/sync-for-payables-version-1/docs/models/shared/billedtotype.md new file mode 100644 index 000000000..61634e737 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/docs/models/shared/billedtotype.md @@ -0,0 +1,13 @@ +# BilledToType + +Defines if the invoice or credit note is billed/rebilled to a project or customer. + + +## Values + +| Name | Value | +| ---------------- | ---------------- | +| `UNKNOWN` | Unknown | +| `NOT_APPLICABLE` | NotApplicable | +| `CUSTOMER` | Customer | +| `PROJECT` | Project | \ No newline at end of file diff --git a/previous-versions/sync-for-payables-version-1/docs/models/shared/billeventpayload.md b/previous-versions/sync-for-payables-version-1/docs/models/shared/billeventpayload.md deleted file mode 100644 index 79eba1392..000000000 --- a/previous-versions/sync-for-payables-version-1/docs/models/shared/billeventpayload.md +++ /dev/null @@ -1,11 +0,0 @@ -# BillEventPayload - - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- | -| `bill` | [Optional[shared.Bill]](../../models/shared/bill.md) | :heavy_minus_sign: | Bills are invoices that represent the SMB's financial obligations to their supplier for a purchase of goods or services. | | -| `company_id` | *Optional[str]* | :heavy_minus_sign: | Unique identifier for your SMB in Codat. | 8a210b68-6988-11ed-a1eb-0242ac120002 | -| `connection_id` | *Optional[str]* | :heavy_minus_sign: | Unique identifier for a company's data connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | -| `push_operation_key` | *Optional[str]* | :heavy_minus_sign: | Unique identifier for the push operation. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | \ No newline at end of file diff --git a/previous-versions/sync-for-payables-version-1/docs/models/shared/billlineitem.md b/previous-versions/sync-for-payables-version-1/docs/models/shared/billlineitem.md index 4d208e931..f4db6f06e 100644 --- a/previous-versions/sync-for-payables-version-1/docs/models/shared/billlineitem.md +++ b/previous-versions/sync-for-payables-version-1/docs/models/shared/billlineitem.md @@ -3,12 +3,22 @@ ## Fields -| Field | Type | Required | Description | -| ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | -| `quantity` | *Decimal* | :heavy_check_mark: | Number of units of goods or services received. | -| `account_ref` | [Optional[shared.AccountReference]](../../models/shared/accountreference.md) | :heavy_minus_sign: | Reference to the account to which the line item is linked. | -| `description` | *Optional[str]* | :heavy_minus_sign: | Friendly name of the goods or services received. | -| `tax_amount` | *Optional[Decimal]* | :heavy_minus_sign: | Amount of tax applied to the line item. | -| `tax_rate_ref` | [Optional[shared.TaxRateReference]](../../models/shared/taxratereference.md) | :heavy_minus_sign: | Reference to the tax rate to which the line item is linked. | -| `total_amount` | *Optional[Decimal]* | :heavy_minus_sign: | Total amount of the line, including tax. | -| `unit_amount` | *Optional[Decimal]* | :heavy_minus_sign: | Unit price of the goods or service. | \ No newline at end of file +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `quantity` | *Decimal* | :heavy_check_mark: | Number of units of goods or services received. | +| `unit_amount` | *Decimal* | :heavy_check_mark: | Price of each unit of goods or services. | +| `account_ref` | [Optional[shared.AccountRef]](../../models/shared/accountref.md) | :heavy_minus_sign: | Data types that reference an account, for example bill and invoice line items, use an accountRef that includes the ID and name of the linked account. | +| `description` | *OptionalNullable[str]* | :heavy_minus_sign: | Friendly name of the goods or services received. | +| `discount_amount` | *OptionalNullable[Decimal]* | :heavy_minus_sign: | Numerical value of any discounts applied.

Do not use to apply discounts in Oracle NetSuite—see Oracle NetSuite integration reference. | +| `discount_percentage` | *OptionalNullable[Decimal]* | :heavy_minus_sign: | Percentage rate of any discount applied to the bill. | +| `is_direct_cost` | *Optional[bool]* | :heavy_minus_sign: | The bill is a direct cost if `True`. | +| `item_ref` | [Optional[shared.ItemRef]](../../models/shared/itemref.md) | :heavy_minus_sign: | Reference to the item the line is linked to. | +| `line_number` | *OptionalNullable[str]* | :heavy_minus_sign: | The bill line's number. | +| `purchase_order_line_ref` | [Optional[shared.RecordLineReference]](../../models/shared/recordlinereference.md) | :heavy_minus_sign: | N/A | +| `sub_total` | *OptionalNullable[Decimal]* | :heavy_minus_sign: | Amount of the line, inclusive of discounts but exclusive of tax. | +| `tax_amount` | *OptionalNullable[Decimal]* | :heavy_minus_sign: | Amount of tax for the line. | +| `tax_rate_ref` | [Optional[shared.TaxRateRef]](../../models/shared/taxrateref.md) | :heavy_minus_sign: | Data types that reference a tax rate, for example invoice and bill line items, use a taxRateRef that includes the ID and name of the linked tax rate.

Found on:

- Bill line items
- Bill Credit Note line items
- Credit Note line items
- Direct incomes line items
- Invoice line items
- Items | +| `total_amount` | *OptionalNullable[Decimal]* | :heavy_minus_sign: | Total amount of the line, including tax. | +| `tracking` | [Optional[shared.Tracking]](../../models/shared/tracking.md) | :heavy_minus_sign: | Categories, and a project and customer, against which the item is tracked. | +| `tracking_category_refs` | List[[shared.TrackingCategoryRef](../../models/shared/trackingcategoryref.md)] | :heavy_minus_sign: | Collection of categories against which this item is tracked. | +| `unit_of_measurement` | *OptionalNullable[str]* | :heavy_minus_sign: | The measurement which defines a unit for this item (e.g. 'kilogram', 'litre'). | \ No newline at end of file diff --git a/previous-versions/sync-for-payables-version-1/docs/models/shared/billlineitemdatatype.md b/previous-versions/sync-for-payables-version-1/docs/models/shared/billlineitemdatatype.md new file mode 100644 index 000000000..b73a45c3c --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/docs/models/shared/billlineitemdatatype.md @@ -0,0 +1,11 @@ +# BillLineItemDataType + +Allowed name of the 'dataType'. + + +## Values + +| Name | Value | +| ----------------- | ----------------- | +| `PURCHASE_ORDERS` | purchaseOrders | +| `BILLS` | bills | \ No newline at end of file diff --git a/previous-versions/sync-for-payables-version-1/docs/models/shared/billpayment.md b/previous-versions/sync-for-payables-version-1/docs/models/shared/billpayment.md new file mode 100644 index 000000000..096788c85 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/docs/models/shared/billpayment.md @@ -0,0 +1,174 @@ +# BillPayment + +> **Bill payments or payments?** +> +> We distinguish between transactions where the company received money vs. paid money. If the transaction represents a company spending money (accounts payable) we call this a Bill payment. +> +> See [payments](https://docs.codat.io/sync-for-payables-api#/schemas/Payment) for the accounts receivable equivalent of Bill payments, which covers [invoices](https://docs.codat.io/sync-for-payables-api#/schemas/Invoice) and [credit notes](https://docs.codat.io/sync-for-payables-api#/schemas/CreditNote). + +> View the coverage for bill payments in the Data coverage explorer. + +## Overview + +Bill payments include all accounts payable transaction data ([bills](https://docs.codat.io/sync-for-payables-api#/schemas/Bill) and [credit notes against bills](https://docs.codat.io/sync-for-payables-api#/schemas/BillCreditNote)). + +A bill payment in Codat usually represents an allocation of money within any customer accounts payable account. This includes, but is not strictly limited to: + +- A payment made against a bill — for example, a credit card payment, cheque payment, or cash payment. +- An allocation of a supplier's credit note to a bill or perhaps a refund. +- A bill payment made directly to an accounts payable account. This could be an overpayment or a prepayment, or a refund of a payment made directly to an accounts payable account. + +Depending on the bill payments which are allowed by the underlying accounting software, some of these types may be combined. Please see the example data section for samples of what these cases look like. + +In Codat, a bill payment contains details of: + +- When the bill payment was recorded in the accounting system. +- How much it is for and in the currency. +- Who the payment has been paid to, the _supplier_. +- The types of bill payments, the _line items_. + +Some accounting software give a separate name to purchases where the payment is made immediately, such as something bought with a credit card or online payment. One example of this would be QuickBooks Online's _expenses_. You can find these types of transactions in our [Direct costs](https://docs.codat.io/sync-for-payables-api#/schemas/DirectCost) data model. + +Bill payments is a child data type of [account transactions](https://docs.codat.io/sync-for-payables-api#/schemas/AccountTransaction). + +--- + +## Bill payment types + +### Payment of a bill + +A payment paying a single bill should have the following properties: + +- A `totalAmount` indicating the amount of the bill that was paid. This is always positive. +- A `lines` array containing one element with the following properties: + - An `amount` equal to the `totalAmount` above. + - A `links` array containing one element with the following properties: + - A `type` indicating the type of link, in this case a `Bill`. + - An `id` containing the ID of the bill that was paid. + - An amount of `-totalAmount` (negative `totalAmount`), indicating that the entirety of the paid amount is allocated to the bill. + +### Payment of multiple bills + +It is possible for one payment to pay multiple bills. This can be represented using two possible formats, depending on how the supplier keeps their books: + +1. The payment has multiple entries in its **lines** array, one for each bill that is paid. Each line will follow the above example for paying a bill, and the rules detailed in the data model. +2. The payment has a line with multiple links to each bill. This occurs when the proportion of the original payment allocated to each bill is not available. + +Each line is the same as those described above, with the **amount** indicating how much of the payment is allocated to the bill. The **amount** on the lines sum to the **totalAmount** on the payment. + +> Pushing batch payments to Xero +> +> When pushing a single bill payment to Xero to pay multiple bills, only the first format is supported—multiple entries in the payment **lines** array. + +### Payments and refunds on account + +A payment on account, that is a payment that doesn’t pay a specific bill, has one entry in its lines array. + +The line has the following properties: + +- A **totalAmount** indicating the amount paid by a supplier or refunded to them by a company. A payment to the supplier is always negative. A refund is always positive. +- A **links** array containing one element with the following properties: + - A **type** indicating the type of link. For a payment this is `PaymentOnAccount`. For a refund this is `Refund`. + - The **id** containing the ID of the supplier. + - An amount for the link is `0` **totalAmount** or the amount of the payment or refund. + +It is possible to have a payment that is part on account and part allocated to a bill. Each line should follow the examples above. + +### Using a credit note to pay a bill + +The payment of a bill using a credit note has one entry in its `lines` array. This **line** has the following properties: + +- An **amount** indicating the amount of money moved, which in this case is `0`, as the credit note and bill allocation must balance each other. +- A **links** array containing two elements: + - The first link has: + - A **type** indicating the type of link, in this case a `Bill`. + - An **id** containing the ID of the bill that was paid. + - The second link has: + - A **type** indicating the type of link, in this case a `CreditNote`. + - An **id** containing the ID of the credit note used by this payment. + +The **amount** field on the **line** equals the **totalAmount** on the payment. + +### Refunding a credit note + +A bill payment refunding a credit note has one entry in its **lines** array. This line has the following properties: + +- An **amount** indicating the amount of the credit note that was refunded. This is always negative, indicating that it is a refund. +- A **links** array containing one element with the following properties: + - A **type** indicating the type of `link`, in this case a `CreditNote`. + - An **id** containing the ID of the credit note that was refunded. + +The **totalAmount** field on the payment equals the line's **amount** field. These are both negative, as this is money leaving accounts payable. + +### Refunding a payment + +If a payment is refunded, for example, when a company overpaid a bill and the overpayment is returned, there are two payment records: + +- One for the incoming overpayment. +- Another for the outgoing refund. + +The payment issuing the refund is identified by the fact that the **totalAmount** is negative. This payment has one entry in its lines array that have the following properties: + +- An **amount** indicating the amount that was refunded. This is always negative. +- A **links** array containing one element with the following properties: + - A **type** indicating the type of a the link, in this case a `BillPayment`. + - An **id** containing the ID of the payment that was refunded. + +The **amount** field on the line equals the **totalAmount** on the payment and is negative as this is money leaving accounts payable. + +The payment that was refunded can be identified as it has a line where the `amount` on its `line` is positive and the type of the link is `Refund`. This payment may have several entries in its **lines** array if it was partly used to pay an bill. For example, a £1,050 payment paying a £1,000 bill with a refund of £50 has two lines: + +- One for £1,000 linked to the bill that was paid +- Another for £50 linked to the payment that refunded the over payment. This link is of type `Refund` but the ID corresponds to a bill payment. + +The line linked to the bill payment has the following properties: + +- An **amount** indicating the amount that was refunded. This is positive as its money that was added to accounts payable, but is balanced out by the negative amount of the refund. +- A **links** array containing one element with the following properties: + - A **type** indicating the type of the link, in this case a `Refund`. + - An **id** containing the ID of the payment that refunded this line. + +> Linked payments +> +> Not all accounting software support linked payments in this way. In these platforms you may see a payment on account and a refund on account. + +## Foreign currencies + +There are two types of currency rate that are detailed in the bill payments data type: + +Payment currency rate: + +- Base currency of the accounts payable account. +- Foreign currency of the bill payment. + +Payment line link currency rate: + +- Base currency of the item that the link represents. +- Foreign currency of the payment. + +These two rates allow the calculation of currency loss or gain for any of the transactions affected by the payment lines. The second rate is used when a bill payment is applied to an item in a currency that does not match either: + +- The base currency for the accounts payable account. +- The currency of the item. + + + +## Fields + +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `date_` | *str* | :heavy_check_mark: | N/A | 2022-10-23 00:00:00 +0000 UTC | +| `account_ref` | [Optional[shared.AccountRef]](../../models/shared/accountref.md) | :heavy_minus_sign: | Data types that reference an account, for example bill and invoice line items, use an accountRef that includes the ID and name of the linked account. | | +| `currency` | *Optional[str]* | :heavy_minus_sign: | N/A | GBP | +| `currency_rate` | *OptionalNullable[Decimal]* | :heavy_minus_sign: | Rate to convert the total amount of the payment into the base currency for the company at the time of the payment.

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

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

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

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

## Examples with base currency of GBP

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

## Examples with base currency of USD

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


### Integration-specific details

\| Integration \| Scenario \| System behavior \|
\|-------------------\|-------------------------------------------------\|----------------------------------------------------------------------------------------------------------------------------------------------------------------------\|
\| QuickBooks Online \| Transaction currency differs from base currency \| If currency rate value is left `null`, a rate of 1 will be used by QBO by default. To override this, specify a currencyRate in the request body. \| | | +| `id` | *Optional[str]* | :heavy_minus_sign: | Identifier for the bill payment, unique for the company in the accounting software. | 3d5a8e00-d108-4045-8823-7f342676cffa | +| `lines` | List[[shared.BillPaymentLine](../../models/shared/billpaymentline.md)] | :heavy_minus_sign: | An array of bill payment lines. | | +| `metadata` | [Optional[shared.Metadata]](../../models/shared/metadata.md) | :heavy_minus_sign: | N/A | | +| `modified_date` | *Optional[str]* | :heavy_minus_sign: | N/A | 2022-10-23 00:00:00 +0000 UTC | +| `note` | *OptionalNullable[str]* | :heavy_minus_sign: | Additional information associated with the payment. | Bill Payment against bill c13e37b6-dfaa-4894-b3be-9fe97bda9f44 | +| `payment_method_ref` | [Optional[shared.PaymentMethodRef]](../../models/shared/paymentmethodref.md) | :heavy_minus_sign: | N/A | {
"id": "EILBDVJVNUAGVKRQ",
"name": "AliPay"
} | +| `reference` | *OptionalNullable[str]* | :heavy_minus_sign: | Additional information associated with the payment. | | +| `source_modified_date` | *Optional[str]* | :heavy_minus_sign: | N/A | 2022-10-23 00:00:00 +0000 UTC | +| `supplemental_data` | [Optional[shared.SupplementalData]](../../models/shared/supplementaldata.md) | :heavy_minus_sign: | Supplemental data is additional data you can include in our standard data types.

It is referenced as a configured dynamic key value pair that is unique to the accounting software. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. | | +| `supplier_ref` | [Optional[shared.SupplierRef]](../../models/shared/supplierref.md) | :heavy_minus_sign: | N/A | | +| `total_amount` | *Optional[Decimal]* | :heavy_minus_sign: | Amount of the payment in the payment currency. This value never changes and represents the amount of money that is paid into the supplier's account. | 1329.54 | \ No newline at end of file diff --git a/previous-versions/sync-for-payables-version-1/docs/models/shared/billpaymentline.md b/previous-versions/sync-for-payables-version-1/docs/models/shared/billpaymentline.md new file mode 100644 index 000000000..36ae4f462 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/docs/models/shared/billpaymentline.md @@ -0,0 +1,10 @@ +# BillPaymentLine + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `amount` | *Decimal* | :heavy_check_mark: | Amount in the bill payment currency. | | +| `allocated_on_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 | +| `links` | List[[shared.BillPaymentLineLink](../../models/shared/billpaymentlinelink.md)] | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/previous-versions/sync-for-payables-version-1/docs/models/shared/billpaymentlinelink.md b/previous-versions/sync-for-payables-version-1/docs/models/shared/billpaymentlinelink.md new file mode 100644 index 000000000..a2c04f9a9 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/docs/models/shared/billpaymentlinelink.md @@ -0,0 +1,11 @@ +# BillPaymentLineLink + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `type` | [shared.BillPaymentLineLinkType](../../models/shared/billpaymentlinelinktype.md) | :heavy_check_mark: | Types of links to bill payment lines. | +| `amount` | *OptionalNullable[Decimal]* | :heavy_minus_sign: | Amount by which the balance of the linked entity is altered, in the currency of the linked entity.

- A negative link amount reduces the outstanding amount on the accounts payable account.
- A positive link amount increases the outstanding amount on the accounts payable account. | +| `currency_rate` | *OptionalNullable[Decimal]* | :heavy_minus_sign: | Rate to convert the total amount of the payment into the base currency for the company at the time of the payment.

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

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

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

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

## Examples with base currency of GBP

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

## Examples with base currency of USD

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


### Integration-specific details

\| Integration \| Scenario \| System behavior \|
\|-------------------\|-------------------------------------------------\|----------------------------------------------------------------------------------------------------------------------------------------------------------------------\|
\| QuickBooks Online \| Transaction currency differs from base currency \| If currency rate value is left `null`, a rate of 1 will be used by QBO by default. To override this, specify a currencyRate in the request body. \| | +| `id` | *OptionalNullable[str]* | :heavy_minus_sign: | Unique identifier of the transaction represented by the link. | \ No newline at end of file diff --git a/previous-versions/sync-for-payables-version-1/docs/models/shared/billpaymentlinelinktype.md b/previous-versions/sync-for-payables-version-1/docs/models/shared/billpaymentlinelinktype.md new file mode 100644 index 000000000..2f099d0a9 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/docs/models/shared/billpaymentlinelinktype.md @@ -0,0 +1,19 @@ +# BillPaymentLineLinkType + +Types of links to bill payment lines. + + +## Values + +| Name | Value | +| -------------------- | -------------------- | +| `UNKNOWN` | Unknown | +| `UNLINKED` | Unlinked | +| `BILL` | Bill | +| `OTHER` | Other | +| `CREDIT_NOTE` | CreditNote | +| `BILL_PAYMENT` | BillPayment | +| `PAYMENT_ON_ACCOUNT` | PaymentOnAccount | +| `REFUND` | Refund | +| `MANUAL_JOURNAL` | ManualJournal | +| `DISCOUNT` | Discount | \ No newline at end of file diff --git a/previous-versions/sync-for-payables-version-1/docs/models/shared/billpayments.md b/previous-versions/sync-for-payables-version-1/docs/models/shared/billpayments.md new file mode 100644 index 000000000..e8acadb36 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/docs/models/shared/billpayments.md @@ -0,0 +1,12 @@ +# BillPayments + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | +| `links` | [shared.Links](../../models/shared/links.md) | :heavy_check_mark: | N/A | {
"self": {
"href": "/companies"
},
"current": {
"href": "/companies?page=1\u0026pageSize=10"
}
} | +| `page_number` | *int* | :heavy_check_mark: | Current page number. | | +| `page_size` | *int* | :heavy_check_mark: | Number of items to return in results array. | | +| `total_results` | *int* | :heavy_check_mark: | Total number of items. | | +| `results` | List[[shared.BillPayment](../../models/shared/billpayment.md)] | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/previous-versions/sync-for-payables-version-1/docs/models/shared/bills.md b/previous-versions/sync-for-payables-version-1/docs/models/shared/bills.md index 94f2c120a..3a7e9d1a2 100644 --- a/previous-versions/sync-for-payables-version-1/docs/models/shared/bills.md +++ b/previous-versions/sync-for-payables-version-1/docs/models/shared/bills.md @@ -3,10 +3,10 @@ ## Fields -| Field | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | -| `links` | [shared.Links](../../models/shared/links.md) | :heavy_check_mark: | N/A | {"self":{"href":"/companies/{id}/data/{dataType}"},"current":{"href":"/companies/{id}/data/{dataType}?page=1&pageSize=10"}} | -| `page_number` | *int* | :heavy_check_mark: | Current page number. | | -| `page_size` | *int* | :heavy_check_mark: | Number of items to return in results array. | | -| `total_results` | *int* | :heavy_check_mark: | Total number of items. | | -| `results` | List[[shared.Bill](../../models/shared/bill.md)] | :heavy_minus_sign: | N/A | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | +| `links` | [shared.Links](../../models/shared/links.md) | :heavy_check_mark: | N/A | {
"self": {
"href": "/companies"
},
"current": {
"href": "/companies?page=1\u0026pageSize=10"
}
} | +| `page_number` | *int* | :heavy_check_mark: | Current page number. | | +| `page_size` | *int* | :heavy_check_mark: | Number of items to return in results array. | | +| `total_results` | *int* | :heavy_check_mark: | Total number of items. | | +| `results` | List[[shared.Bill](../../models/shared/bill.md)] | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/previous-versions/sync-for-payables-version-1/docs/models/shared/clientratelimitreachedwebhook.md b/previous-versions/sync-for-payables-version-1/docs/models/shared/clientratelimitreachedwebhook.md index 0e1855429..7e8db4c18 100644 --- a/previous-versions/sync-for-payables-version-1/docs/models/shared/clientratelimitreachedwebhook.md +++ b/previous-versions/sync-for-payables-version-1/docs/models/shared/clientratelimitreachedwebhook.md @@ -5,12 +5,12 @@ Webhook request body for a client that has reached their rate limit. ## Fields -| Field | Type | Required | Description | -| -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | -| `alert_id` | *Optional[str]* | :heavy_minus_sign: | Unique identifier of the webhook event. | -| `client_id` | *Optional[str]* | :heavy_minus_sign: | Unique identifier for your client in Codat. | -| `client_name` | *Optional[str]* | :heavy_minus_sign: | Name of your client in Codat. | -| `data` | [Optional[shared.ClientRateLimitReachedWebhookData]](../../models/shared/clientratelimitreachedwebhookdata.md) | :heavy_minus_sign: | N/A | -| `message` | *Optional[str]* | :heavy_minus_sign: | A human readable message about the webhook. | -| `rule_id` | *Optional[str]* | :heavy_minus_sign: | Unique identifier for the rule. | -| `rule_type` | *Optional[str]* | :heavy_minus_sign: | The type of rule. | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `alert_id` | *Optional[str]* | :heavy_minus_sign: | Unique identifier of the webhook event. | +| `client_id` | *Optional[str]* | :heavy_minus_sign: | Unique identifier for your client in Codat. | +| `client_name` | *Optional[str]* | :heavy_minus_sign: | Name of your client in Codat. | +| `data` | [Optional[shared.ClientRateLimitReachedWebhookData]](../../models/shared/clientratelimitreachedwebhookdata.md) | :heavy_minus_sign: | N/A | +| `message` | *Optional[str]* | :heavy_minus_sign: | A human-readable message about the webhook. | +| ~~`rule_id`~~ | *Optional[str]* | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible.

Unique identifier for the rule. | +| `rule_type` | *Optional[str]* | :heavy_minus_sign: | The type of rule. | \ No newline at end of file diff --git a/previous-versions/sync-for-payables-version-1/docs/models/shared/clientratelimitresetwebhook.md b/previous-versions/sync-for-payables-version-1/docs/models/shared/clientratelimitresetwebhook.md index de4352761..4b69731e8 100644 --- a/previous-versions/sync-for-payables-version-1/docs/models/shared/clientratelimitresetwebhook.md +++ b/previous-versions/sync-for-payables-version-1/docs/models/shared/clientratelimitresetwebhook.md @@ -5,12 +5,12 @@ Webhook request body for a client that has had their rate limit reset. ## Fields -| Field | Type | Required | Description | -| ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | -| `alert_id` | *Optional[str]* | :heavy_minus_sign: | Unique identifier of the webhook event. | -| `client_id` | *Optional[str]* | :heavy_minus_sign: | Unique identifier for your client in Codat. | -| `client_name` | *Optional[str]* | :heavy_minus_sign: | Name of your client in Codat. | -| `data` | [Optional[shared.ClientRateLimitResetWebhookData]](../../models/shared/clientratelimitresetwebhookdata.md) | :heavy_minus_sign: | N/A | -| `message` | *Optional[str]* | :heavy_minus_sign: | A human readable message about the webhook. | -| `rule_id` | *Optional[str]* | :heavy_minus_sign: | Unique identifier for the rule. | -| `rule_type` | *Optional[str]* | :heavy_minus_sign: | The type of rule. | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `alert_id` | *Optional[str]* | :heavy_minus_sign: | Unique identifier of the webhook event. | +| `client_id` | *Optional[str]* | :heavy_minus_sign: | Unique identifier for your client in Codat. | +| `client_name` | *Optional[str]* | :heavy_minus_sign: | Name of your client in Codat. | +| `data` | [Optional[shared.ClientRateLimitResetWebhookData]](../../models/shared/clientratelimitresetwebhookdata.md) | :heavy_minus_sign: | N/A | +| `message` | *Optional[str]* | :heavy_minus_sign: | A human-readable message about the webhook. | +| ~~`rule_id`~~ | *Optional[str]* | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible.

Unique identifier for the rule. | +| `rule_type` | *Optional[str]* | :heavy_minus_sign: | The type of rule. | \ No newline at end of file diff --git a/previous-versions/sync-for-payables-version-1/docs/models/shared/clientratelimitresetwebhookdata.md b/previous-versions/sync-for-payables-version-1/docs/models/shared/clientratelimitresetwebhookdata.md index e62b34279..e585938fa 100644 --- a/previous-versions/sync-for-payables-version-1/docs/models/shared/clientratelimitresetwebhookdata.md +++ b/previous-versions/sync-for-payables-version-1/docs/models/shared/clientratelimitresetwebhookdata.md @@ -7,5 +7,5 @@ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `daily_quota` | *Optional[int]* | :heavy_minus_sign: | The number of available requests per day. | | | `expires_utc` | *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 | -| `quota_remaining` | *Optional[int]* | :heavy_minus_sign: | Total number of request remaining for your client. | | +| `quota_remaining` | *OptionalNullable[int]* | :heavy_minus_sign: | Total number of requests remaining for your client. | | | `reset_reason` | *Optional[str]* | :heavy_minus_sign: | The reason for your rate limit quota being reset. | | \ No newline at end of file diff --git a/previous-versions/sync-for-payables-version-1/docs/models/operations/createcompanyresponse.md b/previous-versions/sync-for-payables-version-1/docs/models/shared/clientratelimitwebhook.md similarity index 84% rename from previous-versions/sync-for-payables-version-1/docs/models/operations/createcompanyresponse.md rename to previous-versions/sync-for-payables-version-1/docs/models/shared/clientratelimitwebhook.md index faee951b5..063e072ec 100644 --- a/previous-versions/sync-for-payables-version-1/docs/models/operations/createcompanyresponse.md +++ b/previous-versions/sync-for-payables-version-1/docs/models/shared/clientratelimitwebhook.md @@ -1,11 +1,11 @@ -# CreateCompanyResponse +# ClientRateLimitWebhook ## Fields -| Field | Type | Required | Description | Example | -| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `content_type` | *str* | :heavy_check_mark: | HTTP response content type for this operation | | -| `status_code` | *int* | :heavy_check_mark: | HTTP response status code for this operation | | -| `raw_response` | [requests.Response](https://requests.readthedocs.io/en/latest/api/#requests.Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | | -| `company` | [Optional[shared.Company]](../../models/shared/company.md) | :heavy_minus_sign: | OK | {"id":"0498e921-9b53-4396-a412-4f2f5983b0a2","name":"string","platform":"string","redirect":"https://link.codat.io/company/27628208-459c-46a2-a705-5641ce25f739","lastSync":"2022-01-01T12:00:00.000Z","created":"2022-01-01T12:00:00.000Z","createdByUserName":"string","dataConnections":[{"id":"ee2eb431-c0fa-4dc9-93fa-d29781c12bcd","integrationId":"bf083d72-62c7-493e-aec9-81b4dbba7e2c","integrationKey":"dfxm","sourceId":"bdd831ce-eebd-4896-89a7-20e5ee8989ee","platformName":"Basiq","linkUrl":"https://link-api.codat.io/companies/86bd88cb-44ab-4dfb-b32f-87b19b14287f/connections/ee2eb431-c0fa-4dc9-93fa-d29781c12bcd/start","status":"Linked","lastSync":"2022-10-27T10:22:43.6464237Z","created":"2022-10-27T09:53:29Z","sourceType":"Banking"}],"groups":[{"id":"d7a6c4b4-dc87-45f6-b803-62f466398680"}]} | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `event_type` | *Optional[str]* | :heavy_minus_sign: | The type of event. | client.rateLimit.reset | +| `generated_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 | +| `id` | *Optional[str]* | :heavy_minus_sign: | Unique identifier of the event. | 743ec94a-8aa4-44bb-8bd4-e1855ee0e74b | +| `payload` | [Optional[shared.ClientRateLimitWebhookPayload]](../../models/shared/clientratelimitwebhookpayload.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/previous-versions/sync-for-payables-version-1/docs/models/shared/clientratelimitwebhookpayload.md b/previous-versions/sync-for-payables-version-1/docs/models/shared/clientratelimitwebhookpayload.md new file mode 100644 index 000000000..449b685f6 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/docs/models/shared/clientratelimitwebhookpayload.md @@ -0,0 +1,10 @@ +# ClientRateLimitWebhookPayload + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `daily_quota` | *Optional[int]* | :heavy_minus_sign: | The number of available requests per day. | | +| `expiry_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 | +| `quota_remaining` | *Optional[int]* | :heavy_minus_sign: | Total number of requests remaining for your client. | | \ No newline at end of file diff --git a/previous-versions/sync-for-payables-version-1/docs/models/shared/codatfile.md b/previous-versions/sync-for-payables-version-1/docs/models/shared/codatfile.md new file mode 100644 index 000000000..1b6592448 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/docs/models/shared/codatfile.md @@ -0,0 +1,10 @@ +# CodatFile + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------- | -------------------------------------------- | -------------------------------------------- | -------------------------------------------- | +| `content` | *Union[bytes, IO[bytes], io.BufferedReader]* | :heavy_check_mark: | N/A | +| `file_name` | *str* | :heavy_check_mark: | N/A | +| `content_type` | *Optional[str]* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/previous-versions/sync-for-payables-version-1/docs/models/shared/companies.md b/previous-versions/sync-for-payables-version-1/docs/models/shared/companies.md index c19c46de5..d6b5a8ea8 100644 --- a/previous-versions/sync-for-payables-version-1/docs/models/shared/companies.md +++ b/previous-versions/sync-for-payables-version-1/docs/models/shared/companies.md @@ -3,10 +3,10 @@ ## Fields -| Field | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | -| `links` | [shared.Links](../../models/shared/links.md) | :heavy_check_mark: | N/A | {"self":{"href":"/companies/{id}/data/{dataType}"},"current":{"href":"/companies/{id}/data/{dataType}?page=1&pageSize=10"}} | -| `page_number` | *int* | :heavy_check_mark: | Current page number. | | -| `page_size` | *int* | :heavy_check_mark: | Number of items to return in results array. | | -| `total_results` | *int* | :heavy_check_mark: | Total number of items. | | -| `results` | List[[shared.Company](../../models/shared/company.md)] | :heavy_minus_sign: | N/A | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | +| `links` | [shared.Links](../../models/shared/links.md) | :heavy_check_mark: | N/A | {
"self": {
"href": "/companies"
},
"current": {
"href": "/companies?page=1\u0026pageSize=10"
}
} | +| `page_number` | *int* | :heavy_check_mark: | Current page number. | | +| `page_size` | *int* | :heavy_check_mark: | Number of items to return in results array. | | +| `total_results` | *int* | :heavy_check_mark: | Total number of items. | | +| `results` | List[[shared.Company](../../models/shared/company.md)] | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/previous-versions/sync-for-payables-version-1/docs/models/shared/company.md b/previous-versions/sync-for-payables-version-1/docs/models/shared/company.md index 7e2cc2af2..e76a14dc8 100644 --- a/previous-versions/sync-for-payables-version-1/docs/models/shared/company.md +++ b/previous-versions/sync-for-payables-version-1/docs/models/shared/company.md @@ -15,9 +15,9 @@ When you create a company, you can specify a `name` and we will automatically ge | `name` | *str* | :heavy_check_mark: | The name of the company | Codat Ltd. | | `redirect` | *str* | :heavy_check_mark: | The `redirect` [Link URL](https://docs.codat.io/auth-flow/authorize-hosted-link) enabling the customer to start their auth flow journey for the company. | https://link.codat.io/company/27628208-459c-46a2-a705-5641ce25f739 | | `created` | *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 | -| `created_by_user_name` | *Optional[str]* | :heavy_minus_sign: | Name of user that created the company in Codat. | | +| `created_by_user_name` | *OptionalNullable[str]* | :heavy_minus_sign: | Name of user that created the company in Codat. | | | `data_connections` | List[[shared.Connection](../../models/shared/connection.md)] | :heavy_minus_sign: | N/A | | | `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. | -| `groups` | List[[shared.GroupReference](../../models/shared/groupreference.md)] | :heavy_minus_sign: | An array of groups the company has been assigned to. | | | `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 | -| ~~`platform`~~ | *Optional[str]* | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible.

`platformKeys` name used when creating the company. | Xero | \ No newline at end of file +| `products` | List[*str*] | :heavy_minus_sign: | An array of products that are currently enabled for the company. | | +| `tags` | [Optional[shared.CompanyTags]](../../models/shared/companytags.md) | :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/previous-versions/sync-for-payables-version-1/docs/models/shared/companyinfo.md b/previous-versions/sync-for-payables-version-1/docs/models/shared/companyinfo.md new file mode 100644 index 000000000..6b4945b31 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/docs/models/shared/companyinfo.md @@ -0,0 +1,29 @@ +# CompanyInfo + +> View the coverage for company profile in the Data coverage explorer. + +Company info provides standard details about a linked company such as their address, phone number, and company registration. + +> **Company information or companies?** +> +> Company profile is standard information that is held in the accounting software about a company. `Companies` is an endpoint that lists businesses in the Codat system that have linked and shared their data sources. + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `accounting_platform_ref` | *OptionalNullable[str]* | :heavy_minus_sign: | Identifier or reference for the company in the accounting software. | | +| `addresses` | List[[shared.Address](../../models/shared/address.md)] | :heavy_minus_sign: | An array of Addresses. | | +| `base_currency` | *OptionalNullable[str]* | :heavy_minus_sign: | Currency set in the accounting software of the linked company. Used by the currency rate. | | +| `company_legal_name` | *OptionalNullable[str]* | :heavy_minus_sign: | Registered legal name of the linked company. | | +| `company_name` | *OptionalNullable[str]* | :heavy_minus_sign: | Name of the linked company. | | +| `created_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 | +| `financial_year_start_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 | +| `ledger_lock_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 | +| `phone_numbers` | List[[shared.PhoneNumber](../../models/shared/phonenumber.md)] | :heavy_minus_sign: | An array of phone numbers. | | +| `registration_number` | *OptionalNullable[str]* | :heavy_minus_sign: | Registration number given to the linked company by the companies authority in the country of origin. In the UK this is Companies House. | | +| `source_urls` | Dict[str, *str*] | :heavy_minus_sign: | URL addresses for the accounting source.

For example, for Xero integrations two URLs are returned. These have many potential use cases, such as [deep linking](https://developer.xero.com/documentation/api-guides/deep-link-xero). | | +| `supplemental_data` | [Optional[shared.SupplementalData]](../../models/shared/supplementaldata.md) | :heavy_minus_sign: | Supplemental data is additional data you can include in our standard data types.

It is referenced as a configured dynamic key value pair that is unique to the accounting software. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. | | +| `tax_number` | *OptionalNullable[str]* | :heavy_minus_sign: | Company tax number. | | +| `web_links` | List[[shared.WebLink](../../models/shared/weblink.md)] | :heavy_minus_sign: | An array of weblinks. | | \ No newline at end of file diff --git a/previous-versions/sync-for-payables-version-1/docs/models/shared/companyrequestbody.md b/previous-versions/sync-for-payables-version-1/docs/models/shared/companyrequestbody.md index c88c7388b..22fb289bc 100644 --- a/previous-versions/sync-for-payables-version-1/docs/models/shared/companyrequestbody.md +++ b/previous-versions/sync-for-payables-version-1/docs/models/shared/companyrequestbody.md @@ -7,4 +7,4 @@ | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | | `name` | *str* | :heavy_check_mark: | Name of company being connected. | Bank of Dave | | `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. | -| `groups` | List[[shared.Items](../../models/shared/items.md)] | :heavy_minus_sign: | Reference to the groups that the company is assigned to. | | \ No newline at end of file +| `tags` | [Optional[shared.Tags]](../../models/shared/tags.md) | :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/previous-versions/sync-for-payables-version-1/docs/models/shared/companytags.md b/previous-versions/sync-for-payables-version-1/docs/models/shared/companytags.md new file mode 100644 index 000000000..cbbb3f90f --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/docs/models/shared/companytags.md @@ -0,0 +1,9 @@ +# CompanyTags + +A collection of user-defined key-value pairs that store custom metadata against the company. + + +## Fields + +| Field | Type | Required | Description | +| ----------- | ----------- | ----------- | ----------- | \ No newline at end of file diff --git a/previous-versions/sync-for-payables-version-1/docs/models/shared/connection.md b/previous-versions/sync-for-payables-version-1/docs/models/shared/connection.md index 62add1f2c..159e9cb02 100644 --- a/previous-versions/sync-for-payables-version-1/docs/models/shared/connection.md +++ b/previous-versions/sync-for-payables-version-1/docs/models/shared/connection.md @@ -25,7 +25,6 @@ Before you can use a data connection to pull or push data, the company must gran | `source_id` | *str* | :heavy_check_mark: | A source-specific ID used to distinguish between different sources originating from the same data connection. In general, a data connection is a single data source. However, for TrueLayer, `sourceId` is associated with a specific bank and has a many-to-one relationship with the `integrationId`. | 35b92968-9851-4095-ad60-395c95cbcba4 | | `source_type` | [shared.SourceType](../../models/shared/sourcetype.md) | :heavy_check_mark: | The type of platform of the connection. | Accounting | | `status` | [shared.DataConnectionStatus](../../models/shared/dataconnectionstatus.md) | :heavy_check_mark: | The current authorization status of the data connection. | | -| `additional_properties` | *Optional[Any]* | :heavy_minus_sign: | N/A | | | `connection_info` | Dict[str, *str*] | :heavy_minus_sign: | N/A | | | `data_connection_errors` | List[[shared.DataConnectionError](../../models/shared/dataconnectionerror.md)] | :heavy_minus_sign: | N/A | | | `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 | \ No newline at end of file diff --git a/previous-versions/sync-for-payables-version-1/docs/models/shared/connections.md b/previous-versions/sync-for-payables-version-1/docs/models/shared/connections.md index b2e15bef0..1323c74a1 100644 --- a/previous-versions/sync-for-payables-version-1/docs/models/shared/connections.md +++ b/previous-versions/sync-for-payables-version-1/docs/models/shared/connections.md @@ -3,10 +3,10 @@ ## Fields -| Field | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | -| `links` | [shared.Links](../../models/shared/links.md) | :heavy_check_mark: | N/A | {"self":{"href":"/companies/{id}/data/{dataType}"},"current":{"href":"/companies/{id}/data/{dataType}?page=1&pageSize=10"}} | -| `page_number` | *int* | :heavy_check_mark: | Current page number. | | -| `page_size` | *int* | :heavy_check_mark: | Number of items to return in results array. | | -| `total_results` | *int* | :heavy_check_mark: | Total number of items. | | -| `results` | List[[shared.Connection](../../models/shared/connection.md)] | :heavy_minus_sign: | N/A | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | +| `links` | [shared.Links](../../models/shared/links.md) | :heavy_check_mark: | N/A | {
"self": {
"href": "/companies"
},
"current": {
"href": "/companies?page=1\u0026pageSize=10"
}
} | +| `page_number` | *int* | :heavy_check_mark: | Current page number. | | +| `page_size` | *int* | :heavy_check_mark: | Number of items to return in results array. | | +| `total_results` | *int* | :heavy_check_mark: | Total number of items. | | +| `results` | List[[shared.Connection](../../models/shared/connection.md)] | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/previous-versions/sync-for-payables-version-1/docs/models/shared/contactreference.md b/previous-versions/sync-for-payables-version-1/docs/models/shared/contactreference.md new file mode 100644 index 000000000..1adaccc2b --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/docs/models/shared/contactreference.md @@ -0,0 +1,9 @@ +# ContactReference + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | +| `id` | *str* | :heavy_check_mark: | Unique identifier for a customer or supplier. | +| `data_type` | [OptionalNullable[shared.JournalLineDataType]](../../models/shared/journallinedatatype.md) | :heavy_minus_sign: | Allowed name of the 'dataType'. | \ No newline at end of file diff --git a/previous-versions/sync-for-payables-version-1/docs/models/shared/createaccountresponse.md b/previous-versions/sync-for-payables-version-1/docs/models/shared/createaccountresponse.md new file mode 100644 index 000000000..2757a3460 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/docs/models/shared/createaccountresponse.md @@ -0,0 +1,21 @@ +# CreateAccountResponse + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `company_id` | *str* | :heavy_check_mark: | Unique identifier for your SMB in Codat. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `data_connection_key` | *str* | :heavy_check_mark: | Unique identifier for a company's data connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | +| `push_operation_key` | *str* | :heavy_check_mark: | A unique identifier generated by Codat to represent this single push operation. This identifier can be used to track the status of the push, and should be persisted. | | +| `requested_on_utc` | *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 | +| `status` | [shared.PushOperationStatus](../../models/shared/pushoperationstatus.md) | :heavy_check_mark: | The current status of the push operation. | | +| `status_code` | *int* | :heavy_check_mark: | Push status code. | | +| `changes` | List[[shared.PushOperationChange](../../models/shared/pushoperationchange.md)] | :heavy_minus_sign: | Contains a single entry that communicates which record has changed and the manner in which it changed. | | +| `completed_on_utc` | *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 | +| `data` | [OptionalNullable[shared.AccountingAccount]](../../models/shared/accountingaccount.md) | :heavy_minus_sign: | N/A | | +| `data_type` | [Optional[shared.DataType]](../../models/shared/datatype.md) | :heavy_minus_sign: | Available data types | invoices | +| `error_message` | *OptionalNullable[str]* | :heavy_minus_sign: | A message about the error. | | +| `timeout_in_minutes` | *OptionalNullable[int]* | :heavy_minus_sign: | Number of minutes the push operation must complete within before it times out. | | +| ~~`timeout_in_seconds`~~ | *OptionalNullable[int]* | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible.

Number of seconds the push operation must complete within before it times out. | | +| `validation` | [Optional[shared.Validation]](../../models/shared/validation.md) | :heavy_minus_sign: | A human-readable object describing validation decisions Codat has made when pushing data into the platform. If a push has failed because of validation errors, they will be detailed here. | | \ No newline at end of file diff --git a/previous-versions/sync-for-payables-version-1/docs/models/shared/createaccountresponsevaliddatatypelinks.md b/previous-versions/sync-for-payables-version-1/docs/models/shared/createaccountresponsevaliddatatypelinks.md new file mode 100644 index 000000000..00f6b195f --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/docs/models/shared/createaccountresponsevaliddatatypelinks.md @@ -0,0 +1,50 @@ +# CreateAccountResponseValidDataTypeLinks + +When querying Codat's data model, some data types return `validDatatypeLinks` metadata in the JSON response. This indicates where that object can be used as a reference—a _valid link_—when creating or updating other data. + +For example, `validDatatypeLinks` might indicate the following references: + +- Which tax rates are valid to use on the line item of a bill. +- Which items can be used when creating an invoice. + +You can use `validDatatypeLinks` to present your SMB customers with only valid choices when selecting objects from a list, for example. + +## `validDatatypeLinks` example + +The following example uses the `Accounting.Accounts` data type. It shows that, on the linked integration, this account is valid as the account on a payment or bill payment; and as the account referenced on the line item of a direct income or direct cost. Because there is no valid link to Invoices or Bills, using this account on those data types will result in an error. + +```json validDatatypeLinks for an account +{ + "id": "bd9e85e0-0478-433d-ae9f-0b3c4f04bfe4", + "nominalCode": "090", + "name": "Business Bank Account", + #... + "validDatatypeLinks": [ + { + "property": "Id", + "links": [ + "Payment.AccountRef.Id", + "BillPayment.AccountRef.Id", + "DirectIncome.LineItems.AccountRef.Id", + "DirectCost.LineItems.AccountRef.Id" + ] + } + ] + } +``` + + + +## Support for `validDatatypeLinks` + +Codat currently supports `validDatatypeLinks` for some data types on our Xero, QuickBooks Online, QuickBooks Desktop, Exact (NL), and Sage Business Cloud integrations. + +If you'd like us to extend support to more data types or integrations, suggest or vote for this on our Product Roadmap. + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | +| `links` | List[*str*] | :heavy_minus_sign: | Supported `dataTypes` that the record can be linked to. | +| `property` | *OptionalNullable[str]* | :heavy_minus_sign: | The property from the account that can be linked. | \ No newline at end of file diff --git a/previous-versions/sync-for-payables-version-1/docs/models/shared/createbillcreditnoteresponse.md b/previous-versions/sync-for-payables-version-1/docs/models/shared/createbillcreditnoteresponse.md new file mode 100644 index 000000000..482e497f5 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/docs/models/shared/createbillcreditnoteresponse.md @@ -0,0 +1,21 @@ +# CreateBillCreditNoteResponse + + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `company_id` | *str* | :heavy_check_mark: | Unique identifier for your SMB in Codat. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `data_connection_key` | *str* | :heavy_check_mark: | Unique identifier for a company's data connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | +| `push_operation_key` | *str* | :heavy_check_mark: | A unique identifier generated by Codat to represent this single push operation. This identifier can be used to track the status of the push, and should be persisted. | | +| `requested_on_utc` | *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 | +| `status` | [shared.PushOperationStatus](../../models/shared/pushoperationstatus.md) | :heavy_check_mark: | The current status of the push operation. | | +| `status_code` | *int* | :heavy_check_mark: | Push status code. | | +| `changes` | List[[shared.PushOperationChange](../../models/shared/pushoperationchange.md)] | :heavy_minus_sign: | Contains a single entry that communicates which record has changed and the manner in which it changed. | | +| `completed_on_utc` | *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 | +| `data` | [OptionalNullable[shared.AccountingBillCreditNote]](../../models/shared/accountingbillcreditnote.md) | :heavy_minus_sign: | N/A | {
"id": "6a0e9dfb-87b0-47d3-aaaf-9753ae9e757d",
"billCreditNoteNumber": "14763237",
"totalAmount": 693,
"remainingCredit": 693,
"status": "Submitted",
"issueDate": "2019-02-18T16:03:07.268Z",
"note": "Track separately",
"currency": "USD",
"lineItems": [
{
"description": "AcmeMagnet",
"unitAmount": 25,
"discountAmount": 0,
"quantity": 4,
"subTotal": 100,
"taxAmount": 10,
"totalAmount": 110,
"itemRef": {
"id": "3"
},
"taxRateRef": {
"id": "6c88aff3-7cb9-4980-a3d3-443e72e02498"
},
"accountRef": {
"id": "3f267b10-757d-44c0-bef9-20f70cc8fbe3"
},
"trackingCategoryRefs": [
{
"id": "department_1",
"name": "ACMERockets"
},
{
"id": "costcode_2",
"name": "ACM2-ACMESigns"
}
],
"createdFromLineRef": [
{
"id": "8462",
"dataType": "bill",
"lineNumber": 1
}
]
},
{
"description": "ACMEDisintegratingPistol",
"unitAmount": 25,
"discountAmount": 0,
"quantity": 3,
"subTotal": 75,
"taxAmount": 7.5,
"totalAmount": 82.5,
"itemRef": {
"id": "3abf0883-03f7-44c6-bc15-1372522d25e1"
},
"taxRateRef": {
"id": "6c88aff3-7cb9-4980-a3d3-443e72e02498"
},
"accountRef": {
"id": "3f267b10-757d-44c0-bef9-20f70cc8fbe3"
}
},
{
"description": "ACMEWhippedCreamDispenser",
"unitAmount": 52,
"discountAmount": 0,
"quantity": 6,
"subTotal": 312,
"taxAmount": 31.2,
"totalAmount": 343.2,
"itemRef": {
"id": "3691f3d9-0ff7-4358-8a93-bed31c1b4b03"
},
"taxRateRef": {
"id": "6c88aff3-7cb9-4980-a3d3-443e72e02498"
},
"accountRef": {
"id": "3f267b10-757d-44c0-bef9-20f70cc8fbe3"
}
},
{
"description": "ACMEJetPropelledPogoStick",
"unitAmount": 130,
"discountAmount": 0,
"quantity": 1,
"subTotal": 130,
"taxAmount": 27.3,
"totalAmount": 157.3,
"itemRef": {
"id": "075410d4-7edc-4936-ba52-9e1e43cbe300"
},
"taxRateRef": {
"id": "d606732b-db18-44d7-823b-7f15f42c32ea"
},
"accountRef": {
"id": "3f267b10-757d-44c0-bef9-20f70cc8fbe3"
}
}
],
"supplierRef": {
"id": "67C6A7A1-5E84-4AC4-B950-24A114E379D0",
"supplierName": "Chin's Gas and Oil"
},
"createdFromLineRef": {
"id": "8462",
"dataType": "bills",
"line": 1
}
} | +| `data_type` | [Optional[shared.DataType]](../../models/shared/datatype.md) | :heavy_minus_sign: | Available data types | invoices | +| `error_message` | *OptionalNullable[str]* | :heavy_minus_sign: | A message about the error. | | +| `timeout_in_minutes` | *OptionalNullable[int]* | :heavy_minus_sign: | Number of minutes the push operation must complete within before it times out. | | +| ~~`timeout_in_seconds`~~ | *OptionalNullable[int]* | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible.

Number of seconds the push operation must complete within before it times out. | | +| `validation` | [Optional[shared.Validation]](../../models/shared/validation.md) | :heavy_minus_sign: | A human-readable object describing validation decisions Codat has made when pushing data into the platform. If a push has failed because of validation errors, they will be detailed here. | | \ No newline at end of file diff --git a/previous-versions/sync-for-payables-version-1/docs/models/shared/createbillcreditnoteresponserecordreference.md b/previous-versions/sync-for-payables-version-1/docs/models/shared/createbillcreditnoteresponserecordreference.md new file mode 100644 index 000000000..f2e79b2c4 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/docs/models/shared/createbillcreditnoteresponserecordreference.md @@ -0,0 +1,13 @@ +# CreateBillCreditNoteResponseRecordReference + +Links the current record to the underlying record or data type that created it. + +For example, if a journal entry is generated based on an invoice, this property allows you to connect the journal entry to the underlying invoice in our data model. + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------- | ------------------------------------------- | ------------------------------------------- | ------------------------------------------- | ------------------------------------------- | +| `data_type` | *Optional[str]* | :heavy_minus_sign: | Allowed name of the 'dataType'. | journalEntry | +| `id` | *Optional[str]* | :heavy_minus_sign: | 'id' of the underlying record or data type. | | \ No newline at end of file diff --git a/previous-versions/sync-for-payables-version-1/docs/models/shared/createbillpaymentresponse.md b/previous-versions/sync-for-payables-version-1/docs/models/shared/createbillpaymentresponse.md new file mode 100644 index 000000000..c33601a0d --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/docs/models/shared/createbillpaymentresponse.md @@ -0,0 +1,21 @@ +# CreateBillPaymentResponse + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `company_id` | *str* | :heavy_check_mark: | Unique identifier for your SMB in Codat. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `data_connection_key` | *str* | :heavy_check_mark: | Unique identifier for a company's data connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | +| `push_operation_key` | *str* | :heavy_check_mark: | A unique identifier generated by Codat to represent this single push operation. This identifier can be used to track the status of the push, and should be persisted. | | +| `requested_on_utc` | *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 | +| `status` | [shared.PushOperationStatus](../../models/shared/pushoperationstatus.md) | :heavy_check_mark: | The current status of the push operation. | | +| `status_code` | *int* | :heavy_check_mark: | Push status code. | | +| `changes` | List[[shared.PushOperationChange](../../models/shared/pushoperationchange.md)] | :heavy_minus_sign: | Contains a single entry that communicates which record has changed and the manner in which it changed. | | +| `completed_on_utc` | *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 | +| `data` | [OptionalNullable[shared.AccountingBillPayment]](../../models/shared/accountingbillpayment.md) | :heavy_minus_sign: | N/A | {
"totalAmount": 1000,
"lines": [
{
"amount": 1000,
"links": [
{
"type": "Bill",
"id": "x",
"amount": -1000
}
]
}
]
} | +| `data_type` | [Optional[shared.DataType]](../../models/shared/datatype.md) | :heavy_minus_sign: | Available data types | invoices | +| `error_message` | *OptionalNullable[str]* | :heavy_minus_sign: | A message about the error. | | +| `timeout_in_minutes` | *OptionalNullable[int]* | :heavy_minus_sign: | Number of minutes the push operation must complete within before it times out. | | +| ~~`timeout_in_seconds`~~ | *OptionalNullable[int]* | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible.

Number of seconds the push operation must complete within before it times out. | | +| `validation` | [Optional[shared.Validation]](../../models/shared/validation.md) | :heavy_minus_sign: | A human-readable object describing validation decisions Codat has made when pushing data into the platform. If a push has failed because of validation errors, they will be detailed here. | | \ No newline at end of file diff --git a/previous-versions/sync-for-payables-version-1/docs/models/shared/createbillresponse.md b/previous-versions/sync-for-payables-version-1/docs/models/shared/createbillresponse.md new file mode 100644 index 000000000..368470580 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/docs/models/shared/createbillresponse.md @@ -0,0 +1,21 @@ +# CreateBillResponse + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `company_id` | *str* | :heavy_check_mark: | Unique identifier for your SMB in Codat. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `data_connection_key` | *str* | :heavy_check_mark: | Unique identifier for a company's data connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | +| `push_operation_key` | *str* | :heavy_check_mark: | A unique identifier generated by Codat to represent this single push operation. This identifier can be used to track the status of the push, and should be persisted. | | +| `requested_on_utc` | *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 | +| `status` | [shared.PushOperationStatus](../../models/shared/pushoperationstatus.md) | :heavy_check_mark: | The current status of the push operation. | | +| `status_code` | *int* | :heavy_check_mark: | Push status code. | | +| `changes` | List[[shared.PushOperationChange](../../models/shared/pushoperationchange.md)] | :heavy_minus_sign: | Contains a single entry that communicates which record has changed and the manner in which it changed. | | +| `completed_on_utc` | *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 | +| `data` | [OptionalNullable[shared.AccountingBill]](../../models/shared/accountingbill.md) | :heavy_minus_sign: | N/A | | +| `data_type` | [Optional[shared.DataType]](../../models/shared/datatype.md) | :heavy_minus_sign: | Available data types | invoices | +| `error_message` | *OptionalNullable[str]* | :heavy_minus_sign: | A message about the error. | | +| `timeout_in_minutes` | *OptionalNullable[int]* | :heavy_minus_sign: | Number of minutes the push operation must complete within before it times out. | | +| ~~`timeout_in_seconds`~~ | *OptionalNullable[int]* | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible.

Number of seconds the push operation must complete within before it times out. | | +| `validation` | [Optional[shared.Validation]](../../models/shared/validation.md) | :heavy_minus_sign: | A human-readable object describing validation decisions Codat has made when pushing data into the platform. If a push has failed because of validation errors, they will be detailed here. | | \ No newline at end of file diff --git a/previous-versions/sync-for-payables-version-1/docs/models/shared/createbillresponseaccountingpaymentallocation.md b/previous-versions/sync-for-payables-version-1/docs/models/shared/createbillresponseaccountingpaymentallocation.md new file mode 100644 index 000000000..beb6119d2 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/docs/models/shared/createbillresponseaccountingpaymentallocation.md @@ -0,0 +1,9 @@ +# CreateBillResponseAccountingPaymentAllocation + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | +| `allocation` | [shared.CreateBillResponseAllocation](../../models/shared/createbillresponseallocation.md) | :heavy_check_mark: | N/A | +| `payment` | [shared.PaymentAllocationPayment](../../models/shared/paymentallocationpayment.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/previous-versions/sync-for-payables-version-1/docs/models/shared/createbillresponseallocation.md b/previous-versions/sync-for-payables-version-1/docs/models/shared/createbillresponseallocation.md new file mode 100644 index 000000000..204ec4500 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/docs/models/shared/createbillresponseallocation.md @@ -0,0 +1,11 @@ +# CreateBillResponseAllocation + + +## Fields + +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `allocated_on_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 | +| `currency` | *Optional[str]* | :heavy_minus_sign: | The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_.

## Unknown currencies

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

There are only a very small number of edge cases where this currency code is returned by the Codat system. | GBP | +| `currency_rate` | *OptionalNullable[Decimal]* | :heavy_minus_sign: | Rate to convert the total amount of the payment into the base currency for the company at the time of the payment.

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

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

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

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

## Examples with base currency of GBP

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

## Examples with base currency of USD

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


### Integration-specific details

\| Integration \| Scenario \| System behavior \|
\|-------------------\|-------------------------------------------------\|----------------------------------------------------------------------------------------------------------------------------------------------------------------------\|
\| QuickBooks Online \| Transaction currency differs from base currency \| If currency rate value is left `null`, a rate of 1 will be used by QBO by default. To override this, specify a currencyRate in the request body. \| | | +| `total_amount` | *Optional[Decimal]* | :heavy_minus_sign: | The total amount that has been allocated. | | \ No newline at end of file diff --git a/previous-versions/sync-for-payables-version-1/docs/models/shared/createbillresponsepurchaseorderreference.md b/previous-versions/sync-for-payables-version-1/docs/models/shared/createbillresponsepurchaseorderreference.md new file mode 100644 index 000000000..eba1b1b60 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/docs/models/shared/createbillresponsepurchaseorderreference.md @@ -0,0 +1,9 @@ +# CreateBillResponsePurchaseOrderReference + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | +| `id` | *Optional[str]* | :heavy_minus_sign: | Identifier for the purchase order, unique for the company in the accounting software. | +| `purchase_order_number` | *OptionalNullable[str]* | :heavy_minus_sign: | Friendly reference for the purchase order, commonly generated by the accounting software. | \ No newline at end of file diff --git a/previous-versions/sync-for-payables-version-1/docs/models/shared/createbillresponsewithholdingtax.md b/previous-versions/sync-for-payables-version-1/docs/models/shared/createbillresponsewithholdingtax.md new file mode 100644 index 000000000..e125de326 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/docs/models/shared/createbillresponsewithholdingtax.md @@ -0,0 +1,9 @@ +# CreateBillResponseWithholdingTax + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------ | ------------------------------ | ------------------------------ | ------------------------------ | +| `amount` | *Decimal* | :heavy_check_mark: | Amount of tax withheld. | +| `name` | *str* | :heavy_check_mark: | Name assigned to withheld tax. | \ No newline at end of file diff --git a/previous-versions/sync-for-payables-version-1/docs/models/shared/createjournalentryresponse.md b/previous-versions/sync-for-payables-version-1/docs/models/shared/createjournalentryresponse.md new file mode 100644 index 000000000..60a36482d --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/docs/models/shared/createjournalentryresponse.md @@ -0,0 +1,21 @@ +# CreateJournalEntryResponse + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `company_id` | *str* | :heavy_check_mark: | Unique identifier for your SMB in Codat. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `data_connection_key` | *str* | :heavy_check_mark: | Unique identifier for a company's data connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | +| `push_operation_key` | *str* | :heavy_check_mark: | A unique identifier generated by Codat to represent this single push operation. This identifier can be used to track the status of the push, and should be persisted. | | +| `requested_on_utc` | *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 | +| `status` | [shared.PushOperationStatus](../../models/shared/pushoperationstatus.md) | :heavy_check_mark: | The current status of the push operation. | | +| `status_code` | *int* | :heavy_check_mark: | Push status code. | | +| `changes` | List[[shared.PushOperationChange](../../models/shared/pushoperationchange.md)] | :heavy_minus_sign: | Contains a single entry that communicates which record has changed and the manner in which it changed. | | +| `completed_on_utc` | *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 | +| `data` | [OptionalNullable[shared.AccountingJournalEntry]](../../models/shared/accountingjournalentry.md) | :heavy_minus_sign: | N/A | | +| `data_type` | [Optional[shared.DataType]](../../models/shared/datatype.md) | :heavy_minus_sign: | Available data types | invoices | +| `error_message` | *OptionalNullable[str]* | :heavy_minus_sign: | A message about the error. | | +| `timeout_in_minutes` | *OptionalNullable[int]* | :heavy_minus_sign: | Number of minutes the push operation must complete within before it times out. | | +| ~~`timeout_in_seconds`~~ | *OptionalNullable[int]* | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible.

Number of seconds the push operation must complete within before it times out. | | +| `validation` | [Optional[shared.Validation]](../../models/shared/validation.md) | :heavy_minus_sign: | A human-readable object describing validation decisions Codat has made when pushing data into the platform. If a push has failed because of validation errors, they will be detailed here. | | \ No newline at end of file diff --git a/previous-versions/sync-for-payables-version-1/docs/models/shared/createjournalresponse.md b/previous-versions/sync-for-payables-version-1/docs/models/shared/createjournalresponse.md new file mode 100644 index 000000000..4ac7faf82 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/docs/models/shared/createjournalresponse.md @@ -0,0 +1,21 @@ +# CreateJournalResponse + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `company_id` | *str* | :heavy_check_mark: | Unique identifier for your SMB in Codat. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `data_connection_key` | *str* | :heavy_check_mark: | Unique identifier for a company's data connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | +| `push_operation_key` | *str* | :heavy_check_mark: | A unique identifier generated by Codat to represent this single push operation. This identifier can be used to track the status of the push, and should be persisted. | | +| `requested_on_utc` | *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 | +| `status` | [shared.PushOperationStatus](../../models/shared/pushoperationstatus.md) | :heavy_check_mark: | The current status of the push operation. | | +| `status_code` | *int* | :heavy_check_mark: | Push status code. | | +| `changes` | List[[shared.PushOperationChange](../../models/shared/pushoperationchange.md)] | :heavy_minus_sign: | Contains a single entry that communicates which record has changed and the manner in which it changed. | | +| `completed_on_utc` | *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 | +| `data` | [OptionalNullable[shared.AccountingJournal]](../../models/shared/accountingjournal.md) | :heavy_minus_sign: | N/A | | +| `data_type` | [Optional[shared.DataType]](../../models/shared/datatype.md) | :heavy_minus_sign: | Available data types | invoices | +| `error_message` | *OptionalNullable[str]* | :heavy_minus_sign: | A message about the error. | | +| `timeout_in_minutes` | *OptionalNullable[int]* | :heavy_minus_sign: | Number of minutes the push operation must complete within before it times out. | | +| ~~`timeout_in_seconds`~~ | *OptionalNullable[int]* | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible.

Number of seconds the push operation must complete within before it times out. | | +| `validation` | [Optional[shared.Validation]](../../models/shared/validation.md) | :heavy_minus_sign: | A human-readable object describing validation decisions Codat has made when pushing data into the platform. If a push has failed because of validation errors, they will be detailed here. | | \ No newline at end of file diff --git a/previous-versions/sync-for-payables-version-1/docs/models/shared/createsupplierresponse.md b/previous-versions/sync-for-payables-version-1/docs/models/shared/createsupplierresponse.md new file mode 100644 index 000000000..0345ee33f --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/docs/models/shared/createsupplierresponse.md @@ -0,0 +1,21 @@ +# CreateSupplierResponse + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `company_id` | *str* | :heavy_check_mark: | Unique identifier for your SMB in Codat. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `data_connection_key` | *str* | :heavy_check_mark: | Unique identifier for a company's data connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | +| `push_operation_key` | *str* | :heavy_check_mark: | A unique identifier generated by Codat to represent this single push operation. This identifier can be used to track the status of the push, and should be persisted. | | +| `requested_on_utc` | *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 | +| `status` | [shared.PushOperationStatus](../../models/shared/pushoperationstatus.md) | :heavy_check_mark: | The current status of the push operation. | | +| `status_code` | *int* | :heavy_check_mark: | Push status code. | | +| `changes` | List[[shared.PushOperationChange](../../models/shared/pushoperationchange.md)] | :heavy_minus_sign: | Contains a single entry that communicates which record has changed and the manner in which it changed. | | +| `completed_on_utc` | *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 | +| `data` | [OptionalNullable[shared.AccountingSupplier]](../../models/shared/accountingsupplier.md) | :heavy_minus_sign: | N/A | {
"id": "C520FFD4-F6F6-4FC2-A6D2-5D7088B2B14F",
"supplierName": "Kelly's Industrial Supplies",
"contactName": "Kelly's Industrial Supplies",
"emailAddress": "sales@kellysupplies.com",
"phone": "07999 999999",
"addresses": [
{
"type": "Billing",
"line1": "Unit 51",
"line2": "Bakersfield Industrial Estate",
"city": "Bakersfield",
"region": "California",
"country": "USA",
"postalcode": "93308"
}
],
"registrationNumber": "string",
"taxNumber": "string",
"status": "Unknown",
"defaultCurrency": "string",
"metadata": {
"isDeleted": true
},
"supplementalData": {
"content": {
"property1": {
"property1": null,
"property2": null
},
"property2": {
"property1": null,
"property2": null
}
}
},
"modifiedDate": "2022-10-23T00:00:00Z",
"sourceModifiedDate": "2022-10-23T00:00:00Z"
} | +| `data_type` | [Optional[shared.DataType]](../../models/shared/datatype.md) | :heavy_minus_sign: | Available data types | invoices | +| `error_message` | *OptionalNullable[str]* | :heavy_minus_sign: | A message about the error. | | +| `timeout_in_minutes` | *OptionalNullable[int]* | :heavy_minus_sign: | Number of minutes the push operation must complete within before it times out. | | +| ~~`timeout_in_seconds`~~ | *OptionalNullable[int]* | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible.

Number of seconds the push operation must complete within before it times out. | | +| `validation` | [Optional[shared.Validation]](../../models/shared/validation.md) | :heavy_minus_sign: | A human-readable object describing validation decisions Codat has made when pushing data into the platform. If a push has failed because of validation errors, they will be detailed here. | | \ No newline at end of file diff --git a/previous-versions/sync-for-payables-version-1/docs/models/shared/customerref.md b/previous-versions/sync-for-payables-version-1/docs/models/shared/customerref.md new file mode 100644 index 000000000..d76eec16b --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/docs/models/shared/customerref.md @@ -0,0 +1,9 @@ +# CustomerRef + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------ | ------------------------------------------ | ------------------------------------------ | ------------------------------------------ | +| `id` | *str* | :heavy_check_mark: | `id` from the Customers data type | +| `company_name` | *OptionalNullable[str]* | :heavy_minus_sign: | `customerName` from the Customer data type | \ No newline at end of file diff --git a/previous-versions/sync-for-payables-version-1/docs/models/shared/dataconnectionerror.md b/previous-versions/sync-for-payables-version-1/docs/models/shared/dataconnectionerror.md index 2c12bb648..413231fec 100644 --- a/previous-versions/sync-for-payables-version-1/docs/models/shared/dataconnectionerror.md +++ b/previous-versions/sync-for-payables-version-1/docs/models/shared/dataconnectionerror.md @@ -5,7 +5,9 @@ | Field | Type | Required | Description | Example | | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `error_message` | *Optional[str]* | :heavy_minus_sign: | A brief message about the error. | | +| `error_message` | *Optional[str]* | :heavy_minus_sign: | A message about a error returned by Codat. | | | `errored_on_utc` | *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 | -| `status_code` | *Optional[str]* | :heavy_minus_sign: | The HTTP status code returned by the error. | | -| `status_text` | *Optional[str]* | :heavy_minus_sign: | A non-numeric status code/text. | | \ No newline at end of file +| `resolved_on_utc` | *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 | +| `status` | [OptionalNullable[shared.ErrorStatus]](../../models/shared/errorstatus.md) | :heavy_minus_sign: | The current status of a transient error. Null statuses indicate that the error is not transient. | | +| `status_code` | *Optional[str]* | :heavy_minus_sign: | The HTTP status code returned by the source platform when the error occurred. | | +| `status_text` | *Optional[str]* | :heavy_minus_sign: | A non-numeric status code/text returned by the source platform when the error occurred. | | \ No newline at end of file diff --git a/previous-versions/sync-for-payables-version-1/docs/models/shared/datasetstatus.md b/previous-versions/sync-for-payables-version-1/docs/models/shared/datasetstatus.md new file mode 100644 index 000000000..42a224341 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/docs/models/shared/datasetstatus.md @@ -0,0 +1,30 @@ +# DatasetStatus + +The current status of the dataset. + + +## Values + +| Name | Value | +| ---------------------- | ---------------------- | +| `INITIAL` | Initial | +| `QUEUED` | Queued | +| `FETCHING` | Fetching | +| `MAP_QUEUED` | MapQueued | +| `MAPPING` | Mapping | +| `COMPLETE` | Complete | +| `FETCH_ERROR` | FetchError | +| `MAP_ERROR` | MapError | +| `INTERNAL_ERROR` | InternalError | +| `PROCESSING_QUEUED` | ProcessingQueued | +| `PROCESSING` | Processing | +| `PROCESSING_ERROR` | ProcessingError | +| `VALIDATION_QUEUED` | ValidationQueued | +| `VALIDATING` | Validating | +| `VALIDATION_ERROR` | ValidationError | +| `AUTH_ERROR` | AuthError | +| `CANCELLED` | Cancelled | +| `NOT_SUPPORTED` | NotSupported | +| `RATE_LIMIT_ERROR` | RateLimitError | +| `PERMISSIONS_ERROR` | PermissionsError | +| `PREREQUISITE_NOT_MET` | PrerequisiteNotMet | \ No newline at end of file diff --git a/previous-versions/sync-for-payables-version-1/docs/models/shared/datastatus.md b/previous-versions/sync-for-payables-version-1/docs/models/shared/datastatus.md new file mode 100644 index 000000000..d6d6b5b08 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/docs/models/shared/datastatus.md @@ -0,0 +1,14 @@ +# DataStatus + +Describes the state of data in the Codat cache for a company and data type + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `current_status` | [shared.PropertieStatus](../../models/shared/propertiestatus.md) | :heavy_check_mark: | The current status of the dataset. | | +| `data_type` | [shared.DataTypes](../../models/shared/datatypes.md) | :heavy_check_mark: | Available data types | invoices | +| `last_successful_sync` | *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 | +| `latest_successful_sync_id` | *Optional[str]* | :heavy_minus_sign: | Unique identifier for the most recent successful sync of data type. | 8220fc90-55b6-47bc-9417-48ac6ea93101 | +| `latest_sync_id` | *Optional[str]* | :heavy_minus_sign: | Unique identifier for most recent sync of data type. | ad474a37-2003-478e-baee-9af9f1ec2fe3 | \ No newline at end of file diff --git a/previous-versions/sync-for-payables-version-1/docs/models/shared/datatype.md b/previous-versions/sync-for-payables-version-1/docs/models/shared/datatype.md new file mode 100644 index 000000000..593192d4b --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/docs/models/shared/datatype.md @@ -0,0 +1,52 @@ +# DataType + +Available data types + + +## Values + +| Name | Value | +| -------------------------------- | -------------------------------- | +| `ACCOUNT_TRANSACTIONS` | accountTransactions | +| `BALANCE_SHEET` | balanceSheet | +| `BANK_ACCOUNTS` | bankAccounts | +| `BANK_TRANSACTIONS` | bankTransactions | +| `BILL_CREDIT_NOTES` | billCreditNotes | +| `BILL_PAYMENTS` | billPayments | +| `BILLS` | bills | +| `CASH_FLOW_STATEMENT` | cashFlowStatement | +| `CHART_OF_ACCOUNTS` | chartOfAccounts | +| `COMPANY` | company | +| `CREDIT_NOTES` | creditNotes | +| `CUSTOMERS` | customers | +| `DIRECT_COSTS` | directCosts | +| `DIRECT_INCOMES` | directIncomes | +| `INVOICES` | invoices | +| `ITEM_RECEIPTS` | itemReceipts | +| `ITEMS` | items | +| `JOURNAL_ENTRIES` | journalEntries | +| `JOURNALS` | journals | +| `PAYMENT_METHODS` | paymentMethods | +| `PAYMENTS` | payments | +| `PROFIT_AND_LOSS` | profitAndLoss | +| `PURCHASE_ORDERS` | purchaseOrders | +| `SALES_ORDERS` | salesOrders | +| `SUPPLIERS` | suppliers | +| `TAX_RATES` | taxRates | +| `TRACKING_CATEGORIES` | trackingCategories | +| `TRANSFERS` | transfers | +| `BANKING_ACCOUNT_BALANCES` | banking-accountBalances | +| `BANKING_ACCOUNTS` | banking-accounts | +| `BANKING_TRANSACTION_CATEGORIES` | banking-transactionCategories | +| `BANKING_TRANSACTIONS` | banking-transactions | +| `COMMERCE_COMPANY_INFO` | commerce-companyInfo | +| `COMMERCE_CUSTOMERS` | commerce-customers | +| `COMMERCE_DISPUTES` | commerce-disputes | +| `COMMERCE_LOCATIONS` | commerce-locations | +| `COMMERCE_ORDERS` | commerce-orders | +| `COMMERCE_PAYMENT_METHODS` | commerce-paymentMethods | +| `COMMERCE_PAYMENTS` | commerce-payments | +| `COMMERCE_PRODUCT_CATEGORIES` | commerce-productCategories | +| `COMMERCE_PRODUCTS` | commerce-products | +| `COMMERCE_TAX_COMPONENTS` | commerce-taxComponents | +| `COMMERCE_TRANSACTIONS` | commerce-transactions | \ No newline at end of file diff --git a/previous-versions/sync-for-payables-version-1/docs/models/shared/datatypes.md b/previous-versions/sync-for-payables-version-1/docs/models/shared/datatypes.md new file mode 100644 index 000000000..a102001d1 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/docs/models/shared/datatypes.md @@ -0,0 +1,52 @@ +# DataTypes + +Available data types + + +## Values + +| Name | Value | +| -------------------------------- | -------------------------------- | +| `ACCOUNT_TRANSACTIONS` | accountTransactions | +| `BALANCE_SHEET` | balanceSheet | +| `BANK_ACCOUNTS` | bankAccounts | +| `BANK_TRANSACTIONS` | bankTransactions | +| `BILL_CREDIT_NOTES` | billCreditNotes | +| `BILL_PAYMENTS` | billPayments | +| `BILLS` | bills | +| `CASH_FLOW_STATEMENT` | cashFlowStatement | +| `CHART_OF_ACCOUNTS` | chartOfAccounts | +| `COMPANY` | company | +| `CREDIT_NOTES` | creditNotes | +| `CUSTOMERS` | customers | +| `DIRECT_COSTS` | directCosts | +| `DIRECT_INCOMES` | directIncomes | +| `INVOICES` | invoices | +| `ITEM_RECEIPTS` | itemReceipts | +| `ITEMS` | items | +| `JOURNAL_ENTRIES` | journalEntries | +| `JOURNALS` | journals | +| `PAYMENT_METHODS` | paymentMethods | +| `PAYMENTS` | payments | +| `PROFIT_AND_LOSS` | profitAndLoss | +| `PURCHASE_ORDERS` | purchaseOrders | +| `SALES_ORDERS` | salesOrders | +| `SUPPLIERS` | suppliers | +| `TAX_RATES` | taxRates | +| `TRACKING_CATEGORIES` | trackingCategories | +| `TRANSFERS` | transfers | +| `BANKING_ACCOUNT_BALANCES` | banking-accountBalances | +| `BANKING_ACCOUNTS` | banking-accounts | +| `BANKING_TRANSACTION_CATEGORIES` | banking-transactionCategories | +| `BANKING_TRANSACTIONS` | banking-transactions | +| `COMMERCE_COMPANY_INFO` | commerce-companyInfo | +| `COMMERCE_CUSTOMERS` | commerce-customers | +| `COMMERCE_DISPUTES` | commerce-disputes | +| `COMMERCE_LOCATIONS` | commerce-locations | +| `COMMERCE_ORDERS` | commerce-orders | +| `COMMERCE_PAYMENT_METHODS` | commerce-paymentMethods | +| `COMMERCE_PAYMENTS` | commerce-payments | +| `COMMERCE_PRODUCT_CATEGORIES` | commerce-productCategories | +| `COMMERCE_PRODUCTS` | commerce-products | +| `COMMERCE_TAX_COMPONENTS` | commerce-taxComponents | +| `COMMERCE_TRANSACTIONS` | commerce-transactions | \ No newline at end of file diff --git a/previous-versions/sync-for-payables-version-1/docs/models/shared/errorstatus.md b/previous-versions/sync-for-payables-version-1/docs/models/shared/errorstatus.md new file mode 100644 index 000000000..02c0ec3d9 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/docs/models/shared/errorstatus.md @@ -0,0 +1,11 @@ +# ErrorStatus + +The current status of a transient error. Null statuses indicate that the error is not transient. + + +## Values + +| Name | Value | +| ---------- | ---------- | +| `ACTIVE` | Active | +| `RESOLVED` | Resolved | \ No newline at end of file diff --git a/previous-versions/sync-for-payables-version-1/docs/models/shared/errorvalidationitem.md b/previous-versions/sync-for-payables-version-1/docs/models/shared/errorvalidationitem.md index 346bb51f1..fca2ef14a 100644 --- a/previous-versions/sync-for-payables-version-1/docs/models/shared/errorvalidationitem.md +++ b/previous-versions/sync-for-payables-version-1/docs/models/shared/errorvalidationitem.md @@ -5,6 +5,6 @@ | Field | Type | Required | Description | | -------------------------------------------- | -------------------------------------------- | -------------------------------------------- | -------------------------------------------- | -| `item_id` | *Optional[str]* | :heavy_minus_sign: | Unique identifier for a validation item. | -| `message` | *Optional[str]* | :heavy_minus_sign: | A message outlining validation item's issue. | -| `validator_name` | *Optional[str]* | :heavy_minus_sign: | Name of validator. | \ No newline at end of file +| `item_id` | *OptionalNullable[str]* | :heavy_minus_sign: | Unique identifier for a validation item. | +| `message` | *OptionalNullable[str]* | :heavy_minus_sign: | A message outlining validation item's issue. | +| `validator_name` | *OptionalNullable[str]* | :heavy_minus_sign: | Name of validator. | \ No newline at end of file diff --git a/previous-versions/sync-for-payables-version-1/docs/models/shared/itemref.md b/previous-versions/sync-for-payables-version-1/docs/models/shared/itemref.md new file mode 100644 index 000000000..cf1cc9404 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/docs/models/shared/itemref.md @@ -0,0 +1,11 @@ +# ItemRef + +Reference to the item the line is linked to. + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | +| `id` | *str* | :heavy_check_mark: | Unique identifier for the item in the accounting software. | +| `name` | *OptionalNullable[str]* | :heavy_minus_sign: | Name of the item in the accounting software. | \ No newline at end of file diff --git a/previous-versions/sync-for-payables-version-1/docs/models/shared/itemreference.md b/previous-versions/sync-for-payables-version-1/docs/models/shared/itemreference.md new file mode 100644 index 000000000..e60fe984a --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/docs/models/shared/itemreference.md @@ -0,0 +1,11 @@ +# ItemReference + +Reference to the item the line is linked to. + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | +| `id` | *str* | :heavy_check_mark: | Unique identifier for the item in the accounting software. | +| `name` | *OptionalNullable[str]* | :heavy_minus_sign: | Name of the item in the accounting software. | \ No newline at end of file diff --git a/previous-versions/sync-for-payables-version-1/docs/models/shared/items.md b/previous-versions/sync-for-payables-version-1/docs/models/shared/items.md index 8bf62de24..7898573e1 100644 --- a/previous-versions/sync-for-payables-version-1/docs/models/shared/items.md +++ b/previous-versions/sync-for-payables-version-1/docs/models/shared/items.md @@ -3,6 +3,7 @@ ## Fields -| Field | Type | Required | Description | Example | -| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | -| `id` | *Optional[str]* | :heavy_minus_sign: | Unique identifier for the group. | 60d2fa12-8a04-11ee-b9d1-0242ac120002 | \ No newline at end of file +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | +| `allocation` | [shared.Allocation](../../models/shared/allocation.md) | :heavy_check_mark: | N/A | +| `payment` | [shared.PaymentAllocationPayment](../../models/shared/paymentallocationpayment.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/previous-versions/sync-for-payables-version-1/docs/models/shared/journal.md b/previous-versions/sync-for-payables-version-1/docs/models/shared/journal.md new file mode 100644 index 000000000..0e944402a --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/docs/models/shared/journal.md @@ -0,0 +1,42 @@ +# Journal + +> **Language tip:** For line items, or individual transactions, of a company's financial documents, refer to the [Journal entries](https://docs.codat.io/sync-for-payables-api#/schemas/JournalEntry) data type + +> View the coverage for journals in the Data coverage explorer. + +## Overview + +In accounting software, journals are used to record all the financial transactions of a company. Each transaction in a journal is represented by a separate [journal entry](https://docs.codat.io/sync-for-payables-api#/schemas/JournalEntry). These entries are used to create the general ledger, which is then used to create the financial statements of a business. + +When a company records all their transactions in a single journal, it can become large and difficult to maintain and track. This is why large companies often use multiple journals (also known as subjournals) to categorize and manage journal entries. + +Such journals can be divided into two categories: + +- Special journals: journals used to record specific types of transactions; for example, a purchases journal, a sales journal, or a cash management journal. +- General journals: journals used to record transactions that fall outside the scope of the special journals. + +Multiple journals or subjournals are used in the following Codat integrations: + +- [Sage Intacct](https://docs.codat.io/integrations/accounting/sage-intacct/accounting-sage-intacct) (mandatory) +- [Exact Online](https://docs.codat.io/integrations/accounting/exact-online/accounting-exact-online) (mandatory) +- [Oracle NetSuite](https://docs.codat.io/integrations/accounting/netsuite/accounting-netsuite) (optional) + +> When pushing journal entries to an accounting software that doesn’t support multiple journals (multi-book accounting), the entries will be linked to the platform-generic journal. The Journals data type will only include one object. + + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `created_on` | *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 | +| `has_children` | *Optional[bool]* | :heavy_minus_sign: | If the journal has child journals, this value is true. If it doesn’t, it is false. | | +| `id` | *Optional[str]* | :heavy_minus_sign: | Journal ID. | | +| `journal_code` | *OptionalNullable[str]* | :heavy_minus_sign: | Native journal number or code. | | +| `metadata` | [Optional[shared.Metadata]](../../models/shared/metadata.md) | :heavy_minus_sign: | N/A | | +| `modified_date` | *Optional[str]* | :heavy_minus_sign: | N/A | 2022-10-23 00:00:00 +0000 UTC | +| `name` | *OptionalNullable[str]* | :heavy_minus_sign: | Journal name.
The maximum length for a journal name is 256 characters. All characters above that number will be truncated. | | +| `parent_id` | *OptionalNullable[str]* | :heavy_minus_sign: | Parent journal ID.
If the journal is a parent journal, this value is not present. | | +| `source_modified_date` | *Optional[str]* | :heavy_minus_sign: | N/A | 2022-10-23 00:00:00 +0000 UTC | +| `status` | [Optional[shared.JournalStatus]](../../models/shared/journalstatus.md) | :heavy_minus_sign: | Current journal status. | | +| `type` | *OptionalNullable[str]* | :heavy_minus_sign: | The type of the journal. | | \ No newline at end of file diff --git a/previous-versions/sync-for-payables-version-1/docs/models/shared/journalentry.md b/previous-versions/sync-for-payables-version-1/docs/models/shared/journalentry.md new file mode 100644 index 000000000..85972cfab --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/docs/models/shared/journalentry.md @@ -0,0 +1,42 @@ +# JournalEntry + +> **Language tip:** For the top-level record of a company's financial transactions, refer to the [Journals](https://docs.codat.io/sync-for-payables-api#/schemas/Journal) data type + +> View the coverage for journal entries in the Data coverage explorer. + +## Overview + +A journal entry report shows the entries made in a company's general ledger, or [accounts](https://docs.codat.io/sync-for-payables-api#/schemas/Account), when transactions are approved. The journal line items for each journal entry should balance. + +A journal entry line item is a single transaction line on the journal entry. For example: + +- When a journal entry is recording a receipt of cash, the credit to accounts receivable and the debit to cash are separate line items. +- When a company needs to recognise revenue from an annual contract on a monthly basis, on receipt of cash for month one, they make a debit to deferred income and a credit to revenue. + +In Codat a journal entry contains details of: + +- The date on which the entry was created and posted. +- Itemised lines, including amounts and currency. +- A reference to the associated accounts. +- A reference to the underlying record. For example, the invoice, bill, or other data type that triggered the posting of the journal entry to the general ledger. + +> **Pushing journal entries** +> Codat only supports journal entries in the base currency of the company that are pushed into accounts denominated in the same base currency. + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `created_on` | *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: | Optional description of the journal entry. | | +| `id` | *Optional[str]* | :heavy_minus_sign: | Unique identifier of the journal entry for the company in the accounting software. | | +| `journal_lines` | List[[shared.JournalLine](../../models/shared/journalline.md)] | :heavy_minus_sign: | An array of journal lines. | | +| `journal_ref` | [Optional[shared.JournalRef]](../../models/shared/journalref.md) | :heavy_minus_sign: | Links journal entries to the relevant journal in accounting integrations that use multi-book accounting (multiple journals). | | +| `metadata` | [Optional[shared.Metadata]](../../models/shared/metadata.md) | :heavy_minus_sign: | N/A | | +| `modified_date` | *Optional[str]* | :heavy_minus_sign: | N/A | 2022-10-23 00:00:00 +0000 UTC | +| `posted_on` | *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 | +| `record_ref` | [Optional[shared.JournalEntryRecordRef]](../../models/shared/journalentryrecordref.md) | :heavy_minus_sign: | Links a journal entry to the underlying record that created it. | | +| `source_modified_date` | *Optional[str]* | :heavy_minus_sign: | N/A | 2022-10-23 00:00:00 +0000 UTC | +| `supplemental_data` | [Optional[shared.SupplementalData]](../../models/shared/supplementaldata.md) | :heavy_minus_sign: | Supplemental data is additional data you can include in our standard data types.

It is referenced as a configured dynamic key value pair that is unique to the accounting software. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. | | +| `updated_on` | *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 | \ No newline at end of file diff --git a/previous-versions/sync-for-payables-version-1/docs/models/shared/journalentryrecordref.md b/previous-versions/sync-for-payables-version-1/docs/models/shared/journalentryrecordref.md new file mode 100644 index 000000000..3e4a213a0 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/docs/models/shared/journalentryrecordref.md @@ -0,0 +1,11 @@ +# JournalEntryRecordRef + +Links a journal entry to the underlying record that created it. + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | +| `data_type` | [Optional[shared.JournalEntryRecordRefDataType]](../../models/shared/journalentryrecordrefdatatype.md) | :heavy_minus_sign: | Name of underlying data type. | transfers | +| `id` | *Optional[str]* | :heavy_minus_sign: | 'id' of the underlying record or data type. | | \ No newline at end of file diff --git a/previous-versions/sync-for-payables-version-1/docs/models/shared/journalentryrecordrefdatatype.md b/previous-versions/sync-for-payables-version-1/docs/models/shared/journalentryrecordrefdatatype.md new file mode 100644 index 000000000..2fc37230d --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/docs/models/shared/journalentryrecordrefdatatype.md @@ -0,0 +1,20 @@ +# JournalEntryRecordRefDataType + +Name of underlying data type. + + +## Values + +| Name | Value | +| ------------------- | ------------------- | +| `BANK_TRANSACTIONS` | bankTransactions | +| `BILL_CREDIT_NOTES` | billCreditNotes | +| `BILL_PAYMENTS` | billPayments | +| `BILLS` | bills | +| `CREDIT_NOTES` | creditNotes | +| `DIRECT_COSTS` | directCosts | +| `DIRECT_INCOMES` | directIncomes | +| `INVOICES` | invoices | +| `JOURNAL_ENTRIES` | journalEntries | +| `PAYMENTS` | payments | +| `TRANSFERS` | transfers | \ No newline at end of file diff --git a/previous-versions/sync-for-payables-version-1/docs/models/shared/journalline.md b/previous-versions/sync-for-payables-version-1/docs/models/shared/journalline.md new file mode 100644 index 000000000..372081ba2 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/docs/models/shared/journalline.md @@ -0,0 +1,13 @@ +# JournalLine + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- | +| `net_amount` | *Decimal* | :heavy_check_mark: | Amount for the journal line. Debit entries are considered positive, and credit entries are considered negative. | +| `account_ref` | [Optional[shared.AccountRef]](../../models/shared/accountref.md) | :heavy_minus_sign: | Data types that reference an account, for example bill and invoice line items, use an accountRef that includes the ID and name of the linked account. | +| `contact_ref` | [Optional[shared.ContactReference]](../../models/shared/contactreference.md) | :heavy_minus_sign: | N/A | +| `currency` | *OptionalNullable[str]* | :heavy_minus_sign: | Currency for the journal line item. | +| `description` | *OptionalNullable[str]* | :heavy_minus_sign: | Description of the journal line item. | +| `tracking` | [Optional[shared.JournalLineTracking]](../../models/shared/journallinetracking.md) | :heavy_minus_sign: | List of record refs associated with the tracking information for the line (eg to a Tracking Category, or customer etc.) | \ No newline at end of file diff --git a/previous-versions/sync-for-payables-version-1/docs/models/shared/journallinedatatype.md b/previous-versions/sync-for-payables-version-1/docs/models/shared/journallinedatatype.md new file mode 100644 index 000000000..2b88d07d3 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/docs/models/shared/journallinedatatype.md @@ -0,0 +1,11 @@ +# JournalLineDataType + +Allowed name of the 'dataType'. + + +## Values + +| Name | Value | +| ----------- | ----------- | +| `CUSTOMERS` | customers | +| `SUPPLIERS` | suppliers | \ No newline at end of file diff --git a/previous-versions/sync-for-payables-version-1/docs/models/shared/journallinetracking.md b/previous-versions/sync-for-payables-version-1/docs/models/shared/journallinetracking.md new file mode 100644 index 000000000..0d8fea50c --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/docs/models/shared/journallinetracking.md @@ -0,0 +1,10 @@ +# JournalLineTracking + +List of record refs associated with the tracking information for the line (eg to a Tracking Category, or customer etc.) + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | +| `record_refs` | List[[shared.TrackingRecordRef](../../models/shared/trackingrecordref.md)] | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/previous-versions/sync-for-payables-version-1/docs/models/shared/journalprototype.md b/previous-versions/sync-for-payables-version-1/docs/models/shared/journalprototype.md new file mode 100644 index 000000000..aea6d2574 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/docs/models/shared/journalprototype.md @@ -0,0 +1,14 @@ +# JournalPrototype + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `created_on` | *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 | +| `has_children` | *Optional[bool]* | :heavy_minus_sign: | If the journal has child journals, this value is true. If it doesn’t, it is false. | | +| `journal_code` | *OptionalNullable[str]* | :heavy_minus_sign: | Native journal number or code. | | +| `name` | *OptionalNullable[str]* | :heavy_minus_sign: | Journal name.
The maximum length for a journal name is 256 characters. All characters above that number will be truncated. | | +| `parent_id` | *OptionalNullable[str]* | :heavy_minus_sign: | Parent journal ID.
If the journal is a parent journal, this value is not present. | | +| `status` | [Optional[shared.JournalStatus]](../../models/shared/journalstatus.md) | :heavy_minus_sign: | Current journal status. | | +| `type` | *OptionalNullable[str]* | :heavy_minus_sign: | The type of the journal. | | \ No newline at end of file diff --git a/previous-versions/sync-for-payables-version-1/docs/models/shared/journalref.md b/previous-versions/sync-for-payables-version-1/docs/models/shared/journalref.md new file mode 100644 index 000000000..6be19166a --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/docs/models/shared/journalref.md @@ -0,0 +1,11 @@ +# JournalRef + +Links journal entries to the relevant journal in accounting integrations that use multi-book accounting (multiple journals). + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | +| `id` | *str* | :heavy_check_mark: | GUID of the underlying journal. | +| `name` | *OptionalNullable[str]* | :heavy_minus_sign: | Name of journal | \ No newline at end of file diff --git a/previous-versions/sync-for-payables-version-1/docs/models/shared/journals.md b/previous-versions/sync-for-payables-version-1/docs/models/shared/journals.md new file mode 100644 index 000000000..0a24ff0ed --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/docs/models/shared/journals.md @@ -0,0 +1,12 @@ +# Journals + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | +| `links` | [shared.Links](../../models/shared/links.md) | :heavy_check_mark: | N/A | {
"self": {
"href": "/companies"
},
"current": {
"href": "/companies?page=1\u0026pageSize=10"
}
} | +| `page_number` | *int* | :heavy_check_mark: | Current page number. | | +| `page_size` | *int* | :heavy_check_mark: | Number of items to return in results array. | | +| `total_results` | *int* | :heavy_check_mark: | Total number of items. | | +| `results` | List[[shared.Journal](../../models/shared/journal.md)] | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/previous-versions/sync-for-payables-version-1/docs/models/shared/journalstatus.md b/previous-versions/sync-for-payables-version-1/docs/models/shared/journalstatus.md new file mode 100644 index 000000000..c1ebc3837 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/docs/models/shared/journalstatus.md @@ -0,0 +1,12 @@ +# JournalStatus + +Current journal status. + + +## Values + +| Name | Value | +| ---------- | ---------- | +| `UNKNOWN` | Unknown | +| `ACTIVE` | Active | +| `ARCHIVED` | Archived | \ No newline at end of file diff --git a/previous-versions/sync-for-payables-version-1/docs/models/shared/metadata.md b/previous-versions/sync-for-payables-version-1/docs/models/shared/metadata.md new file mode 100644 index 000000000..8fb4a6e5c --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/docs/models/shared/metadata.md @@ -0,0 +1,8 @@ +# Metadata + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | +| `is_deleted` | *OptionalNullable[bool]* | :heavy_minus_sign: | Indicates whether the record has been deleted in the third-party system this record originated from. | \ No newline at end of file diff --git a/previous-versions/sync-for-payables-version-1/docs/models/shared/paymentallocationpayment.md b/previous-versions/sync-for-payables-version-1/docs/models/shared/paymentallocationpayment.md new file mode 100644 index 000000000..5154922f5 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/docs/models/shared/paymentallocationpayment.md @@ -0,0 +1,15 @@ +# PaymentAllocationPayment + + +## Fields + +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `account_ref` | [Optional[shared.AccountRef]](../../models/shared/accountref.md) | :heavy_minus_sign: | Data types that reference an account, for example bill and invoice line items, use an accountRef that includes the ID and name of the linked account. | | +| `currency` | *Optional[str]* | :heavy_minus_sign: | The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_.

## Unknown currencies

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

There are only a very small number of edge cases where this currency code is returned by the Codat system. | GBP | +| `currency_rate` | *OptionalNullable[Decimal]* | :heavy_minus_sign: | Rate to convert the total amount of the payment into the base currency for the company at the time of the payment.

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

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

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

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

## Examples with base currency of GBP

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

## Examples with base currency of USD

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


### Integration-specific details

\| Integration \| Scenario \| System behavior \|
\|-------------------\|-------------------------------------------------\|----------------------------------------------------------------------------------------------------------------------------------------------------------------------\|
\| QuickBooks Online \| Transaction currency differs from base currency \| If currency rate value is left `null`, a rate of 1 will be used by QBO by default. To override this, specify a currencyRate in the request body. \| | | +| `id` | *Optional[str]* | :heavy_minus_sign: | Identifier of the allocated payment. | | +| `note` | *OptionalNullable[str]* | :heavy_minus_sign: | Notes attached to the allocated payment. | | +| `paid_on_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 | +| `reference` | *OptionalNullable[str]* | :heavy_minus_sign: | Reference to the allocated payment. | | +| `total_amount` | *Optional[Decimal]* | :heavy_minus_sign: | Total amount that was paid. | | \ No newline at end of file diff --git a/previous-versions/sync-for-payables-version-1/docs/models/shared/paymentmethod.md b/previous-versions/sync-for-payables-version-1/docs/models/shared/paymentmethod.md new file mode 100644 index 000000000..156770b93 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/docs/models/shared/paymentmethod.md @@ -0,0 +1,20 @@ +# PaymentMethod + +> View the coverage for payment methods in the Data coverage explorer. + +## Overview + +A Payment Method represents the payment method(s) used to pay a Bill. Payment Methods are referenced on [Bill Payments](https://docs.codat.io/sync-for-payables-api#/schemas/BillPayment) and [Payments](https://docs.codat.io/sync-for-payables-api#/schemas/Payment). + + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | +| `id` | *Optional[str]* | :heavy_minus_sign: | Unique identifier for the payment method. | | +| `metadata` | [Optional[shared.Metadata]](../../models/shared/metadata.md) | :heavy_minus_sign: | N/A | | +| `modified_date` | *Optional[str]* | :heavy_minus_sign: | N/A | 2022-10-23 00:00:00 +0000 UTC | +| `name` | *OptionalNullable[str]* | :heavy_minus_sign: | Name of the payment method. | | +| `source_modified_date` | *Optional[str]* | :heavy_minus_sign: | N/A | 2022-10-23 00:00:00 +0000 UTC | +| `status` | [Optional[shared.PaymentMethodStatus]](../../models/shared/paymentmethodstatus.md) | :heavy_minus_sign: | Status of the Payment Method. | | +| `type` | [Optional[shared.PaymentMethodType]](../../models/shared/paymentmethodtype.md) | :heavy_minus_sign: | Method of payment. | | \ No newline at end of file diff --git a/previous-versions/sync-for-payables-version-1/docs/models/shared/paymentmethodref.md b/previous-versions/sync-for-payables-version-1/docs/models/shared/paymentmethodref.md new file mode 100644 index 000000000..bc5000caa --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/docs/models/shared/paymentmethodref.md @@ -0,0 +1,11 @@ +# PaymentMethodRef + +The Payment Method to which the payment is linked in the accounting software. + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | +| `id` | *str* | :heavy_check_mark: | The unique identifier of the location being referenced. | +| `name` | *Optional[str]* | :heavy_minus_sign: | Name of the location being referenced. | \ No newline at end of file diff --git a/previous-versions/sync-for-payables-version-1/docs/models/shared/paymentmethods.md b/previous-versions/sync-for-payables-version-1/docs/models/shared/paymentmethods.md new file mode 100644 index 000000000..98a1b5adb --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/docs/models/shared/paymentmethods.md @@ -0,0 +1,12 @@ +# PaymentMethods + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | +| `links` | [shared.Links](../../models/shared/links.md) | :heavy_check_mark: | N/A | {
"self": {
"href": "/companies"
},
"current": {
"href": "/companies?page=1\u0026pageSize=10"
}
} | +| `page_number` | *int* | :heavy_check_mark: | Current page number. | | +| `page_size` | *int* | :heavy_check_mark: | Number of items to return in results array. | | +| `total_results` | *int* | :heavy_check_mark: | Total number of items. | | +| `results` | List[[shared.PaymentMethod](../../models/shared/paymentmethod.md)] | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/previous-versions/sync-for-payables-version-1/docs/models/shared/paymentmethodstatus.md b/previous-versions/sync-for-payables-version-1/docs/models/shared/paymentmethodstatus.md new file mode 100644 index 000000000..18014390a --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/docs/models/shared/paymentmethodstatus.md @@ -0,0 +1,12 @@ +# PaymentMethodStatus + +Status of the Payment Method. + + +## Values + +| Name | Value | +| ---------- | ---------- | +| `UNKNOWN` | Unknown | +| `ACTIVE` | Active | +| `ARCHIVED` | Archived | \ No newline at end of file diff --git a/previous-versions/sync-for-payables-version-1/docs/models/shared/paymentmethodtype.md b/previous-versions/sync-for-payables-version-1/docs/models/shared/paymentmethodtype.md new file mode 100644 index 000000000..e1cf7a3f3 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/docs/models/shared/paymentmethodtype.md @@ -0,0 +1,16 @@ +# PaymentMethodType + +Method of payment. + + +## Values + +| Name | Value | +| --------------- | --------------- | +| `UNKNOWN` | Unknown | +| `CASH` | Cash | +| `CHECK` | Check | +| `CREDIT_CARD` | CreditCard | +| `DEBIT_CARD` | DebitCard | +| `BANK_TRANSFER` | BankTransfer | +| `OTHER` | Other | \ No newline at end of file diff --git a/previous-versions/sync-for-payables-version-1/docs/models/shared/phonenumber.md b/previous-versions/sync-for-payables-version-1/docs/models/shared/phonenumber.md new file mode 100644 index 000000000..41bdf34db --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/docs/models/shared/phonenumber.md @@ -0,0 +1,9 @@ +# PhoneNumber + + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- | +| `type` | [shared.PhoneNumberType](../../models/shared/phonenumbertype.md) | :heavy_check_mark: | The type of phone number | | +| `number` | *OptionalNullable[str]* | :heavy_minus_sign: | A phone number. | +44 25691 154789 | \ No newline at end of file diff --git a/previous-versions/sync-for-payables-version-1/docs/models/shared/phonenumbertype.md b/previous-versions/sync-for-payables-version-1/docs/models/shared/phonenumbertype.md new file mode 100644 index 000000000..4702d4b78 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/docs/models/shared/phonenumbertype.md @@ -0,0 +1,14 @@ +# PhoneNumberType + +The type of phone number + + +## Values + +| Name | Value | +| ---------- | ---------- | +| `PRIMARY` | Primary | +| `LANDLINE` | Landline | +| `MOBILE` | Mobile | +| `FAX` | Fax | +| `UNKNOWN` | Unknown | \ No newline at end of file diff --git a/previous-versions/sync-for-payables-version-1/docs/models/shared/propertiestatus.md b/previous-versions/sync-for-payables-version-1/docs/models/shared/propertiestatus.md new file mode 100644 index 000000000..9754f3a57 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/docs/models/shared/propertiestatus.md @@ -0,0 +1,30 @@ +# PropertieStatus + +The current status of the dataset. + + +## Values + +| Name | Value | +| ---------------------- | ---------------------- | +| `INITIAL` | Initial | +| `QUEUED` | Queued | +| `FETCHING` | Fetching | +| `MAP_QUEUED` | MapQueued | +| `MAPPING` | Mapping | +| `COMPLETE` | Complete | +| `FETCH_ERROR` | FetchError | +| `MAP_ERROR` | MapError | +| `INTERNAL_ERROR` | InternalError | +| `PROCESSING_QUEUED` | ProcessingQueued | +| `PROCESSING` | Processing | +| `PROCESSING_ERROR` | ProcessingError | +| `VALIDATION_QUEUED` | ValidationQueued | +| `VALIDATING` | Validating | +| `VALIDATION_ERROR` | ValidationError | +| `AUTH_ERROR` | AuthError | +| `CANCELLED` | Cancelled | +| `NOT_SUPPORTED` | NotSupported | +| `RATE_LIMIT_ERROR` | RateLimitError | +| `PERMISSIONS_ERROR` | PermissionsError | +| `PREREQUISITE_NOT_MET` | PrerequisiteNotMet | \ No newline at end of file diff --git a/previous-versions/sync-for-payables-version-1/docs/models/shared/pulloperation.md b/previous-versions/sync-for-payables-version-1/docs/models/shared/pulloperation.md new file mode 100644 index 000000000..5cfeb2fb3 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/docs/models/shared/pulloperation.md @@ -0,0 +1,22 @@ +# PullOperation + +Information about a queued, in progress or completed pull operation. +*Formally called `dataset`* + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `company_id` | *str* | :heavy_check_mark: | Unique identifier of the company associated to this pull operation. | 22ece347-e5f6-4896-95e0-35a4c7f17023 | +| `connection_id` | *str* | :heavy_check_mark: | Unique identifier of the connection associated to this pull operation. | 50830828-7d39-4367-b0eb-5ddb2de5faa5 | +| `data_type` | *str* | :heavy_check_mark: | The data type you are requesting in a pull operation. | | +| `id` | *str* | :heavy_check_mark: | Unique identifier of the pull operation. | 943accd0-4247-42d8-865b-363c8629e1da | +| `is_completed` | *bool* | :heavy_check_mark: | `True` if the pull operation is completed successfully. The `isCompleted` property is not queryable. To filter failed pull operations, query by `status!=Complete&&status!=NotSupported` instead. | | +| `is_errored` | *bool* | :heavy_check_mark: | `True` if the pull operation entered an error state. | | +| `progress` | *int* | :heavy_check_mark: | An integer signifying the progress of the pull operation. | | +| `requested` | *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 | +| `status` | [shared.DatasetStatus](../../models/shared/datasetstatus.md) | :heavy_check_mark: | The current status of the dataset. | | +| `completed` | *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 | +| `error_message` | *OptionalNullable[str]* | :heavy_minus_sign: | A message about a transient or persistent error returned by Codat or the source platform. | | +| `status_description` | *OptionalNullable[str]* | :heavy_minus_sign: | Additional information about the dataset status. | Paused until 2022-10-23T00:00:00.000Z | \ No newline at end of file diff --git a/previous-versions/sync-for-payables-version-1/docs/models/shared/pulloperations.md b/previous-versions/sync-for-payables-version-1/docs/models/shared/pulloperations.md new file mode 100644 index 000000000..69df81c54 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/docs/models/shared/pulloperations.md @@ -0,0 +1,12 @@ +# PullOperations + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | +| `links` | [shared.Links](../../models/shared/links.md) | :heavy_check_mark: | N/A | {
"self": {
"href": "/companies"
},
"current": {
"href": "/companies?page=1\u0026pageSize=10"
}
} | +| `page_number` | *int* | :heavy_check_mark: | Current page number. | | +| `page_size` | *int* | :heavy_check_mark: | Number of items to return in results array. | | +| `total_results` | *int* | :heavy_check_mark: | Total number of items. | | +| `results` | List[[shared.PullOperation](../../models/shared/pulloperation.md)] | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/previous-versions/sync-for-payables-version-1/docs/models/shared/purchaseorderreference.md b/previous-versions/sync-for-payables-version-1/docs/models/shared/purchaseorderreference.md new file mode 100644 index 000000000..6b00e0a49 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/docs/models/shared/purchaseorderreference.md @@ -0,0 +1,9 @@ +# PurchaseOrderReference + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | +| `id` | *Optional[str]* | :heavy_minus_sign: | Identifier for the purchase order, unique for the company in the accounting software. | +| `purchase_order_number` | *OptionalNullable[str]* | :heavy_minus_sign: | Friendly reference for the purchase order, commonly generated by the accounting software. | \ No newline at end of file diff --git a/previous-versions/sync-for-payables-version-1/docs/models/shared/pushchangetype.md b/previous-versions/sync-for-payables-version-1/docs/models/shared/pushchangetype.md new file mode 100644 index 000000000..33a957e79 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/docs/models/shared/pushchangetype.md @@ -0,0 +1,14 @@ +# PushChangeType + +Type of change being applied to record in third party platform. + + +## Values + +| Name | Value | +| --------------------- | --------------------- | +| `UNKNOWN` | Unknown | +| `CREATED` | Created | +| `MODIFIED` | Modified | +| `DELETED` | Deleted | +| `ATTACHMENT_UPLOADED` | AttachmentUploaded | \ No newline at end of file diff --git a/previous-versions/sync-for-payables-version-1/docs/models/shared/pushfieldvalidation.md b/previous-versions/sync-for-payables-version-1/docs/models/shared/pushfieldvalidation.md new file mode 100644 index 000000000..d3558cfad --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/docs/models/shared/pushfieldvalidation.md @@ -0,0 +1,10 @@ +# PushFieldValidation + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | +| `details` | *str* | :heavy_check_mark: | Details on the validation issue. | +| `field` | *Optional[str]* | :heavy_minus_sign: | Field name that resulted in the validation issue. | +| `ref` | *OptionalNullable[str]* | :heavy_minus_sign: | Unique reference identifier for the validation issue. | \ No newline at end of file diff --git a/previous-versions/sync-for-payables-version-1/docs/models/shared/pushoperation.md b/previous-versions/sync-for-payables-version-1/docs/models/shared/pushoperation.md new file mode 100644 index 000000000..13591843b --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/docs/models/shared/pushoperation.md @@ -0,0 +1,20 @@ +# PushOperation + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `company_id` | *str* | :heavy_check_mark: | Unique identifier for your SMB in Codat. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `data_connection_key` | *str* | :heavy_check_mark: | Unique identifier for a company's data connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | +| `push_operation_key` | *str* | :heavy_check_mark: | A unique identifier generated by Codat to represent this single push operation. This identifier can be used to track the status of the push, and should be persisted. | | +| `requested_on_utc` | *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 | +| `status` | [shared.PushOperationStatus](../../models/shared/pushoperationstatus.md) | :heavy_check_mark: | The current status of the push operation. | | +| `status_code` | *int* | :heavy_check_mark: | Push status code. | | +| `changes` | List[[shared.PushOperationChange](../../models/shared/pushoperationchange.md)] | :heavy_minus_sign: | Contains a single entry that communicates which record has changed and the manner in which it changed. | | +| `completed_on_utc` | *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 | +| `data_type` | [Optional[shared.DataType]](../../models/shared/datatype.md) | :heavy_minus_sign: | Available data types | invoices | +| `error_message` | *OptionalNullable[str]* | :heavy_minus_sign: | A message about the error. | | +| `timeout_in_minutes` | *OptionalNullable[int]* | :heavy_minus_sign: | Number of minutes the push operation must complete within before it times out. | | +| ~~`timeout_in_seconds`~~ | *OptionalNullable[int]* | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible.

Number of seconds the push operation must complete within before it times out. | | +| `validation` | [Optional[shared.Validation]](../../models/shared/validation.md) | :heavy_minus_sign: | A human-readable object describing validation decisions Codat has made when pushing data into the platform. If a push has failed because of validation errors, they will be detailed here. | | \ No newline at end of file diff --git a/previous-versions/sync-for-payables-version-1/docs/models/shared/pushoperationchange.md b/previous-versions/sync-for-payables-version-1/docs/models/shared/pushoperationchange.md new file mode 100644 index 000000000..d5516b5c7 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/docs/models/shared/pushoperationchange.md @@ -0,0 +1,10 @@ +# PushOperationChange + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | +| `attachment_id` | *OptionalNullable[str]* | :heavy_minus_sign: | Unique identifier for the attachment created otherwise null. | +| `record_ref` | [Optional[shared.PushOperationRef]](../../models/shared/pushoperationref.md) | :heavy_minus_sign: | N/A | +| `type` | [Optional[shared.PushChangeType]](../../models/shared/pushchangetype.md) | :heavy_minus_sign: | Type of change being applied to record in third party platform. | \ No newline at end of file diff --git a/previous-versions/sync-for-payables-version-1/docs/models/shared/pushoperationref.md b/previous-versions/sync-for-payables-version-1/docs/models/shared/pushoperationref.md new file mode 100644 index 000000000..7c26e1c4f --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/docs/models/shared/pushoperationref.md @@ -0,0 +1,9 @@ +# PushOperationRef + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | +| `data_type` | [Optional[shared.DataType]](../../models/shared/datatype.md) | :heavy_minus_sign: | Available data types | invoices | +| `id` | *Optional[str]* | :heavy_minus_sign: | Unique identifier for a push operation. | | \ No newline at end of file diff --git a/previous-versions/sync-for-payables-version-1/docs/models/shared/pushoperations.md b/previous-versions/sync-for-payables-version-1/docs/models/shared/pushoperations.md new file mode 100644 index 000000000..91dea4734 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/docs/models/shared/pushoperations.md @@ -0,0 +1,12 @@ +# PushOperations + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | +| `links` | [shared.Links](../../models/shared/links.md) | :heavy_check_mark: | N/A | {
"self": {
"href": "/companies"
},
"current": {
"href": "/companies?page=1\u0026pageSize=10"
}
} | +| `page_number` | *int* | :heavy_check_mark: | Current page number. | | +| `page_size` | *int* | :heavy_check_mark: | Number of items to return in results array. | | +| `total_results` | *int* | :heavy_check_mark: | Total number of items. | | +| `results` | List[[shared.PushOperation](../../models/shared/pushoperation.md)] | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/previous-versions/sync-for-payables-version-1/docs/models/shared/pushoperationstatus.md b/previous-versions/sync-for-payables-version-1/docs/models/shared/pushoperationstatus.md new file mode 100644 index 000000000..721aaa76b --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/docs/models/shared/pushoperationstatus.md @@ -0,0 +1,13 @@ +# PushOperationStatus + +The current status of the push operation. + + +## Values + +| Name | Value | +| ----------- | ----------- | +| `PENDING` | Pending | +| `FAILED` | Failed | +| `SUCCESS` | Success | +| `TIMED_OUT` | TimedOut | \ No newline at end of file diff --git a/previous-versions/sync-for-payables-version-1/docs/models/shared/pushoption.md b/previous-versions/sync-for-payables-version-1/docs/models/shared/pushoption.md new file mode 100644 index 000000000..a41fbc063 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/docs/models/shared/pushoption.md @@ -0,0 +1,14 @@ +# PushOption + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | +| `display_name` | *str* | :heavy_check_mark: | The property's display name. | +| `required` | *bool* | :heavy_check_mark: | The property is required if `True`. | +| `type` | [shared.PushOptionType](../../models/shared/pushoptiontype.md) | :heavy_check_mark: | The option type. | +| `description` | *Optional[str]* | :heavy_minus_sign: | A description of the property. | +| `options` | List[[shared.PushOptionChoice](../../models/shared/pushoptionchoice.md)] | :heavy_minus_sign: | N/A | +| `properties` | Dict[str, [shared.PushOptionProperty](../../models/shared/pushoptionproperty.md)] | :heavy_minus_sign: | N/A | +| `validation` | [Optional[shared.PushValidationInfo]](../../models/shared/pushvalidationinfo.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/previous-versions/sync-for-payables-version-1/docs/models/shared/pushoptionchoice.md b/previous-versions/sync-for-payables-version-1/docs/models/shared/pushoptionchoice.md new file mode 100644 index 000000000..44e988b26 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/docs/models/shared/pushoptionchoice.md @@ -0,0 +1,12 @@ +# PushOptionChoice + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | +| `description` | *Optional[str]* | :heavy_minus_sign: | A description of the property. | +| `display_name` | *Optional[str]* | :heavy_minus_sign: | The property's display name. | +| `required` | *Optional[bool]* | :heavy_minus_sign: | The property is required if `True`. | +| `type` | [Optional[shared.PushOptionType]](../../models/shared/pushoptiontype.md) | :heavy_minus_sign: | The option type. | +| `value` | *Optional[str]* | :heavy_minus_sign: | Allowed value for field. | \ No newline at end of file diff --git a/previous-versions/sync-for-payables-version-1/docs/models/shared/pushoptionproperty.md b/previous-versions/sync-for-payables-version-1/docs/models/shared/pushoptionproperty.md new file mode 100644 index 000000000..cb20b30fe --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/docs/models/shared/pushoptionproperty.md @@ -0,0 +1,14 @@ +# PushOptionProperty + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | +| `description` | *str* | :heavy_check_mark: | A description of the property. | +| `display_name` | *str* | :heavy_check_mark: | The property's display name. | +| `required` | *bool* | :heavy_check_mark: | The property is required if `True`. | +| `type` | [shared.PushOptionType](../../models/shared/pushoptiontype.md) | :heavy_check_mark: | The option type. | +| `options` | List[[shared.PushOptionChoice](../../models/shared/pushoptionchoice.md)] | :heavy_minus_sign: | N/A | +| `properties` | Dict[str, [shared.PushOptionProperty](../../models/shared/pushoptionproperty.md)] | :heavy_minus_sign: | N/A | +| `validation` | [Optional[shared.PushValidationInfo]](../../models/shared/pushvalidationinfo.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/previous-versions/sync-for-payables-version-1/docs/models/shared/pushoptiontype.md b/previous-versions/sync-for-payables-version-1/docs/models/shared/pushoptiontype.md new file mode 100644 index 000000000..2f263a07c --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/docs/models/shared/pushoptiontype.md @@ -0,0 +1,17 @@ +# PushOptionType + +The option type. + + +## Values + +| Name | Value | +| ------------ | ------------ | +| `ARRAY` | Array | +| `OBJECT` | Object | +| `STRING` | String | +| `NUMBER` | Number | +| `BOOLEAN` | Boolean | +| `DATE_TIME` | DateTime | +| `FILE` | File | +| `MULTI_PART` | MultiPart | \ No newline at end of file diff --git a/previous-versions/sync-for-payables-version-1/docs/models/shared/pushvalidationinfo.md b/previous-versions/sync-for-payables-version-1/docs/models/shared/pushvalidationinfo.md new file mode 100644 index 000000000..110eb3f76 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/docs/models/shared/pushvalidationinfo.md @@ -0,0 +1,9 @@ +# PushValidationInfo + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | +| `information` | List[[shared.PushFieldValidation](../../models/shared/pushfieldvalidation.md)] | :heavy_minus_sign: | N/A | +| `warnings` | List[[shared.PushFieldValidation](../../models/shared/pushfieldvalidation.md)] | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/previous-versions/sync-for-payables-version-1/docs/models/shared/recordlinereference.md b/previous-versions/sync-for-payables-version-1/docs/models/shared/recordlinereference.md new file mode 100644 index 000000000..17e83d195 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/docs/models/shared/recordlinereference.md @@ -0,0 +1,12 @@ +# RecordLineReference + +Reference to the purchase order line this line was generated from. + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | +| `data_type` | [Optional[shared.BillLineItemDataType]](../../models/shared/billlineitemdatatype.md) | :heavy_minus_sign: | Allowed name of the 'dataType'. | +| `id` | *Optional[str]* | :heavy_minus_sign: | 'id' of the underlying record. | +| `line_number` | *Optional[str]* | :heavy_minus_sign: | Line number of the underlying record. | \ No newline at end of file diff --git a/previous-versions/sync-for-payables-version-1/docs/models/shared/recordreference.md b/previous-versions/sync-for-payables-version-1/docs/models/shared/recordreference.md new file mode 100644 index 000000000..e586fb3ba --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/docs/models/shared/recordreference.md @@ -0,0 +1,13 @@ +# RecordReference + +Links the current record to the underlying record or data type that created it. + +For example, if a journal entry is generated based on an invoice, this property allows you to connect the journal entry to the underlying invoice in our data model. + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------- | ------------------------------------------- | ------------------------------------------- | ------------------------------------------- | ------------------------------------------- | +| `data_type` | *Optional[str]* | :heavy_minus_sign: | Allowed name of the 'dataType'. | journalEntry | +| `id` | *Optional[str]* | :heavy_minus_sign: | 'id' of the underlying record or data type. | | \ No newline at end of file diff --git a/previous-versions/sync-for-payables-version-1/docs/models/shared/schemadatatype.md b/previous-versions/sync-for-payables-version-1/docs/models/shared/schemadatatype.md new file mode 100644 index 000000000..a7b7e6ae3 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/docs/models/shared/schemadatatype.md @@ -0,0 +1,52 @@ +# SchemaDataType + +Available data types + + +## Values + +| Name | Value | +| -------------------------------- | -------------------------------- | +| `ACCOUNT_TRANSACTIONS` | accountTransactions | +| `BALANCE_SHEET` | balanceSheet | +| `BANK_ACCOUNTS` | bankAccounts | +| `BANK_TRANSACTIONS` | bankTransactions | +| `BILL_CREDIT_NOTES` | billCreditNotes | +| `BILL_PAYMENTS` | billPayments | +| `BILLS` | bills | +| `CASH_FLOW_STATEMENT` | cashFlowStatement | +| `CHART_OF_ACCOUNTS` | chartOfAccounts | +| `COMPANY` | company | +| `CREDIT_NOTES` | creditNotes | +| `CUSTOMERS` | customers | +| `DIRECT_COSTS` | directCosts | +| `DIRECT_INCOMES` | directIncomes | +| `INVOICES` | invoices | +| `ITEM_RECEIPTS` | itemReceipts | +| `ITEMS` | items | +| `JOURNAL_ENTRIES` | journalEntries | +| `JOURNALS` | journals | +| `PAYMENT_METHODS` | paymentMethods | +| `PAYMENTS` | payments | +| `PROFIT_AND_LOSS` | profitAndLoss | +| `PURCHASE_ORDERS` | purchaseOrders | +| `SALES_ORDERS` | salesOrders | +| `SUPPLIERS` | suppliers | +| `TAX_RATES` | taxRates | +| `TRACKING_CATEGORIES` | trackingCategories | +| `TRANSFERS` | transfers | +| `BANKING_ACCOUNT_BALANCES` | banking-accountBalances | +| `BANKING_ACCOUNTS` | banking-accounts | +| `BANKING_TRANSACTION_CATEGORIES` | banking-transactionCategories | +| `BANKING_TRANSACTIONS` | banking-transactions | +| `COMMERCE_COMPANY_INFO` | commerce-companyInfo | +| `COMMERCE_CUSTOMERS` | commerce-customers | +| `COMMERCE_DISPUTES` | commerce-disputes | +| `COMMERCE_LOCATIONS` | commerce-locations | +| `COMMERCE_ORDERS` | commerce-orders | +| `COMMERCE_PAYMENT_METHODS` | commerce-paymentMethods | +| `COMMERCE_PAYMENTS` | commerce-payments | +| `COMMERCE_PRODUCT_CATEGORIES` | commerce-productCategories | +| `COMMERCE_PRODUCTS` | commerce-products | +| `COMMERCE_TAX_COMPONENTS` | commerce-taxComponents | +| `COMMERCE_TRANSACTIONS` | commerce-transactions | \ No newline at end of file diff --git a/previous-versions/sync-for-payables-version-1/docs/models/shared/status.md b/previous-versions/sync-for-payables-version-1/docs/models/shared/status.md new file mode 100644 index 000000000..8d413a2b2 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/docs/models/shared/status.md @@ -0,0 +1,12 @@ +# Status + +Current state of the tracking category. + + +## Values + +| Name | Value | +| ---------- | ---------- | +| `UNKNOWN` | Unknown | +| `ACTIVE` | Active | +| `ARCHIVED` | Archived | \ No newline at end of file diff --git a/previous-versions/sync-for-payables-version-1/docs/models/shared/supplementaldata.md b/previous-versions/sync-for-payables-version-1/docs/models/shared/supplementaldata.md new file mode 100644 index 000000000..7415a8519 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/docs/models/shared/supplementaldata.md @@ -0,0 +1,12 @@ +# SupplementalData + +Supplemental data is additional data you can include in our standard data types. + +It is referenced as a configured dynamic key value pair that is unique to the accounting software. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. + + +## Fields + +| Field | Type | Required | Description | +| --------------------------- | --------------------------- | --------------------------- | --------------------------- | +| `content` | Dict[str, Dict[str, *Any*]] | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/previous-versions/sync-for-payables-version-1/docs/models/shared/supplier.md b/previous-versions/sync-for-payables-version-1/docs/models/shared/supplier.md new file mode 100644 index 000000000..0499245bb --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/docs/models/shared/supplier.md @@ -0,0 +1,27 @@ +# Supplier + +> View the coverage for suppliers in the Data coverage explorer. + +## Overview + +From the **Suppliers** endpoints, you can retrieve a list of [all the suppliers for a company](https://docs.codat.io/sync-for-payables-api#/operations/list-suppliers). Suppliers' data links to accounts payable [bills](https://docs.codat.io/sync-for-payables-api#/schemas/Bill). + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `status` | [shared.SupplierStatus](../../models/shared/supplierstatus.md) | :heavy_check_mark: | Status of the supplier. | | +| `addresses` | List[[shared.Address](../../models/shared/address.md)] | :heavy_minus_sign: | An array of Addresses. | | +| `contact_name` | *OptionalNullable[str]* | :heavy_minus_sign: | Name of the main contact for the supplier. | | +| `default_currency` | *OptionalNullable[str]* | :heavy_minus_sign: | Default currency the supplier's transactional data is recorded in. | | +| `email_address` | *OptionalNullable[str]* | :heavy_minus_sign: | Email address that the supplier may be contacted on. | | +| `id` | *Optional[str]* | :heavy_minus_sign: | Identifier for the supplier, unique to the company in the accounting software. | | +| `metadata` | [Optional[shared.Metadata]](../../models/shared/metadata.md) | :heavy_minus_sign: | N/A | | +| `modified_date` | *Optional[str]* | :heavy_minus_sign: | N/A | 2022-10-23 00:00:00 +0000 UTC | +| `phone` | *OptionalNullable[str]* | :heavy_minus_sign: | Phone number that the supplier may be contacted on. | +44 25691 154789 | +| `registration_number` | *OptionalNullable[str]* | :heavy_minus_sign: | Company number of the supplier. In the UK, this is typically the company registration number issued by Companies House. | | +| `source_modified_date` | *Optional[str]* | :heavy_minus_sign: | N/A | 2022-10-23 00:00:00 +0000 UTC | +| `supplemental_data` | [Optional[shared.SupplementalData]](../../models/shared/supplementaldata.md) | :heavy_minus_sign: | Supplemental data is additional data you can include in our standard data types.

It is referenced as a configured dynamic key value pair that is unique to the accounting software. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. | | +| `supplier_name` | *OptionalNullable[str]* | :heavy_minus_sign: | Name of the supplier as recorded in the accounting system, typically the company name. | | +| `tax_number` | *OptionalNullable[str]* | :heavy_minus_sign: | Supplier's company tax number. | | \ No newline at end of file diff --git a/previous-versions/sync-for-payables-version-1/docs/models/shared/supplierref.md b/previous-versions/sync-for-payables-version-1/docs/models/shared/supplierref.md index a8824b5f9..9ac54781a 100644 --- a/previous-versions/sync-for-payables-version-1/docs/models/shared/supplierref.md +++ b/previous-versions/sync-for-payables-version-1/docs/models/shared/supplierref.md @@ -8,4 +8,4 @@ Reference to the supplier the record relates to. | Field | Type | Required | Description | | ------------------------ | ------------------------ | ------------------------ | ------------------------ | | `id` | *str* | :heavy_check_mark: | The supplier's unique ID | -| `supplier_name` | *Optional[str]* | :heavy_minus_sign: | The supplier's name | \ No newline at end of file +| `supplier_name` | *OptionalNullable[str]* | :heavy_minus_sign: | The supplier's name | \ No newline at end of file diff --git a/previous-versions/sync-for-payables-version-1/docs/models/shared/suppliers.md b/previous-versions/sync-for-payables-version-1/docs/models/shared/suppliers.md new file mode 100644 index 000000000..3374dc9b4 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/docs/models/shared/suppliers.md @@ -0,0 +1,12 @@ +# Suppliers + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | +| `links` | [shared.Links](../../models/shared/links.md) | :heavy_check_mark: | N/A | {
"self": {
"href": "/companies"
},
"current": {
"href": "/companies?page=1\u0026pageSize=10"
}
} | +| `page_number` | *int* | :heavy_check_mark: | Current page number. | | +| `page_size` | *int* | :heavy_check_mark: | Number of items to return in results array. | | +| `total_results` | *int* | :heavy_check_mark: | Total number of items. | | +| `results` | List[[shared.Supplier](../../models/shared/supplier.md)] | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/previous-versions/sync-for-payables-version-1/docs/models/shared/supplierstatus.md b/previous-versions/sync-for-payables-version-1/docs/models/shared/supplierstatus.md new file mode 100644 index 000000000..0374ea9e0 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/docs/models/shared/supplierstatus.md @@ -0,0 +1,12 @@ +# SupplierStatus + +Status of the supplier. + + +## Values + +| Name | Value | +| ---------- | ---------- | +| `UNKNOWN` | Unknown | +| `ACTIVE` | Active | +| `ARCHIVED` | Archived | \ No newline at end of file diff --git a/previous-versions/sync-for-payables-version-1/docs/models/shared/tags.md b/previous-versions/sync-for-payables-version-1/docs/models/shared/tags.md new file mode 100644 index 000000000..6de993aa8 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/docs/models/shared/tags.md @@ -0,0 +1,9 @@ +# Tags + +A collection of user-defined key-value pairs that store custom metadata against the company. + + +## Fields + +| Field | Type | Required | Description | +| ----------- | ----------- | ----------- | ----------- | \ No newline at end of file diff --git a/previous-versions/sync-for-payables-version-1/docs/models/shared/taxrate.md b/previous-versions/sync-for-payables-version-1/docs/models/shared/taxrate.md new file mode 100644 index 000000000..50de88c61 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/docs/models/shared/taxrate.md @@ -0,0 +1,40 @@ +# TaxRate + +> View the coverage for tax rates in the Data coverage explorer. + +## Overview + +Accounting systems typically store a set of taxes and associated rates within the accounting software. This means that users don't have to look up or remember the rates for each type of tax. For example, applying the tax "UK sales VAT" to line items of an invoice adds the correct rate of 20%. + +### Tax components + +In some cases, a tax is made up of multiple sub taxes, often called _components_ of the tax. For example, you may have an item that is charged a tax rate called "City import tax (8%)" that has two components: + +- A city tax of 5% +- An import tax of 3% + +> **Effective tax rates** +> - Where there are multiple components of a tax, each component may be calculated on the original amount and added together. Alternatively, one tax may be calculated on the sub-total of the original amount plus another tax, which is referred to as _compounding_. When there is compounding, the effective tax rate is the rate that, if applied to the original amount, would result in the total amount of tax with compounding. +> +> **Example:** +> A tax has two components. Both components have a rate of 10%, and one component is compound. In this case, there is a total tax rate of 20% but an effective tax rate of 21%. +> +> - For QuickBooks Online, Codat doesn't use compound rates. Instead, the calculated effective tax rate for each component is shown. This means that the effective and total rates are the same because the total tax rate is a sum of the component rates. + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `code` | *OptionalNullable[str]* | :heavy_minus_sign: | Code for the tax rate from the accounting software. | | +| `components` | List[[shared.TaxRateComponent](../../models/shared/taxratecomponent.md)] | :heavy_minus_sign: | N/A | | +| `effective_tax_rate` | *OptionalNullable[Decimal]* | :heavy_minus_sign: | See Effective tax rates description. | | +| `id` | *Optional[str]* | :heavy_minus_sign: | Identifier for the tax rate, unique for the company in the accounting software. | | +| `metadata` | [Optional[shared.Metadata]](../../models/shared/metadata.md) | :heavy_minus_sign: | N/A | | +| `modified_date` | *Optional[str]* | :heavy_minus_sign: | N/A | 2022-10-23 00:00:00 +0000 UTC | +| `name` | *OptionalNullable[str]* | :heavy_minus_sign: | Codat-augmented name of the tax rate in the accounting software. | | +| `source_modified_date` | *Optional[str]* | :heavy_minus_sign: | N/A | 2022-10-23 00:00:00 +0000 UTC | +| `status` | [Optional[shared.TaxRateStatus]](../../models/shared/taxratestatus.md) | :heavy_minus_sign: | Status of the tax rate in the accounting software.
- `Active` - An active tax rate in use by a company.
- `Archived` - A tax rate that has been archived or is inactive in the accounting software.
- `Unknown` - Where the status of the tax rate cannot be determined from the underlying platform. | | +| `supplemental_data` | [Optional[shared.SupplementalData]](../../models/shared/supplementaldata.md) | :heavy_minus_sign: | Supplemental data is additional data you can include in our standard data types.

It is referenced as a configured dynamic key value pair that is unique to the accounting software. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. | | +| `total_tax_rate` | *OptionalNullable[Decimal]* | :heavy_minus_sign: | Total (not compounded) sum of the components of a tax rate. | | +| `valid_datatype_links` | List[[shared.ValidDatatypeLinkItems](../../models/shared/validdatatypelinkitems.md)] | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/previous-versions/sync-for-payables-version-1/docs/models/shared/taxratecomponent.md b/previous-versions/sync-for-payables-version-1/docs/models/shared/taxratecomponent.md new file mode 100644 index 000000000..578572b5f --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/docs/models/shared/taxratecomponent.md @@ -0,0 +1,12 @@ +# TaxRateComponent + +A tax rate can be made up of multiple sub taxes, often called components of the tax. + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | +| `is_compound` | *bool* | :heavy_check_mark: | A flag to indicate with the tax is calculated using the principle of compounding. | +| `name` | *OptionalNullable[str]* | :heavy_minus_sign: | Name of the tax rate component. | +| `rate` | *OptionalNullable[Decimal]* | :heavy_minus_sign: | The rate of the tax rate component, usually a percentage. | \ No newline at end of file diff --git a/previous-versions/sync-for-payables-version-1/docs/models/shared/taxratereference.md b/previous-versions/sync-for-payables-version-1/docs/models/shared/taxrateref.md similarity index 73% rename from previous-versions/sync-for-payables-version-1/docs/models/shared/taxratereference.md rename to previous-versions/sync-for-payables-version-1/docs/models/shared/taxrateref.md index ae00d80d4..eb85c3b40 100644 --- a/previous-versions/sync-for-payables-version-1/docs/models/shared/taxratereference.md +++ b/previous-versions/sync-for-payables-version-1/docs/models/shared/taxrateref.md @@ -1,6 +1,15 @@ -# TaxRateReference +# TaxRateRef -Reference to the tax rate to which the line item is linked. +Data types that reference a tax rate, for example invoice and bill line items, use a taxRateRef that includes the ID and name of the linked tax rate. + +Found on: + +- Bill line items +- Bill Credit Note line items +- Credit Note line items +- Direct incomes line items +- Invoice line items +- Items ## Fields @@ -8,5 +17,5 @@ Reference to the tax rate to which the line item is linked. | Field | Type | Required | Description | | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | | `effective_tax_rate` | *Optional[Decimal]* | :heavy_minus_sign: | Applicable tax rate. | -| `id` | *Optional[str]* | :heavy_minus_sign: | Unique identifier for the tax rate in the accounting platform. | -| `name` | *Optional[str]* | :heavy_minus_sign: | Name of the tax rate in the accounting platform. | \ No newline at end of file +| `id` | *Optional[str]* | :heavy_minus_sign: | Unique identifier for the tax rate in the accounting software. | +| `name` | *Optional[str]* | :heavy_minus_sign: | Name of the tax rate in the accounting software. | \ No newline at end of file diff --git a/previous-versions/sync-for-payables-version-1/docs/models/shared/taxrates.md b/previous-versions/sync-for-payables-version-1/docs/models/shared/taxrates.md new file mode 100644 index 000000000..cd448ba2d --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/docs/models/shared/taxrates.md @@ -0,0 +1,12 @@ +# TaxRates + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | +| `links` | [shared.Links](../../models/shared/links.md) | :heavy_check_mark: | N/A | {
"self": {
"href": "/companies"
},
"current": {
"href": "/companies?page=1\u0026pageSize=10"
}
} | +| `page_number` | *int* | :heavy_check_mark: | Current page number. | | +| `page_size` | *int* | :heavy_check_mark: | Number of items to return in results array. | | +| `total_results` | *int* | :heavy_check_mark: | Total number of items. | | +| `results` | List[[shared.TaxRate](../../models/shared/taxrate.md)] | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/previous-versions/sync-for-payables-version-1/docs/models/shared/taxratestatus.md b/previous-versions/sync-for-payables-version-1/docs/models/shared/taxratestatus.md new file mode 100644 index 000000000..a416d1ceb --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/docs/models/shared/taxratestatus.md @@ -0,0 +1,15 @@ +# TaxRateStatus + +Status of the tax rate in the accounting software. +- `Active` - An active tax rate in use by a company. +- `Archived` - A tax rate that has been archived or is inactive in the accounting software. +- `Unknown` - Where the status of the tax rate cannot be determined from the underlying platform. + + +## Values + +| Name | Value | +| ---------- | ---------- | +| `UNKNOWN` | Unknown | +| `ACTIVE` | Active | +| `ARCHIVED` | Archived | \ No newline at end of file diff --git a/previous-versions/sync-for-payables-version-1/docs/models/shared/tracking.md b/previous-versions/sync-for-payables-version-1/docs/models/shared/tracking.md new file mode 100644 index 000000000..acf377970 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/docs/models/shared/tracking.md @@ -0,0 +1,14 @@ +# Tracking + +Categories, and a project and customer, against which the item is tracked. + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | +| `category_refs` | List[[shared.TrackingCategoryRef](../../models/shared/trackingcategoryref.md)] | :heavy_check_mark: | N/A | +| `is_billed_to` | [shared.BilledToType](../../models/shared/billedtotype.md) | :heavy_check_mark: | Defines if the invoice or credit note is billed/rebilled to a project or customer. | +| `is_rebilled_to` | [shared.BilledToType](../../models/shared/billedtotype.md) | :heavy_check_mark: | Defines if the invoice or credit note is billed/rebilled to a project or customer. | +| `customer_ref` | [Optional[shared.CustomerRef]](../../models/shared/customerref.md) | :heavy_minus_sign: | N/A | +| `project_ref` | [Optional[shared.AccountingProjectReference]](../../models/shared/accountingprojectreference.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/previous-versions/sync-for-payables-version-1/docs/models/shared/trackingcategories.md b/previous-versions/sync-for-payables-version-1/docs/models/shared/trackingcategories.md new file mode 100644 index 000000000..20b57034d --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/docs/models/shared/trackingcategories.md @@ -0,0 +1,12 @@ +# TrackingCategories + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | +| `links` | [shared.Links](../../models/shared/links.md) | :heavy_check_mark: | N/A | {
"self": {
"href": "/companies"
},
"current": {
"href": "/companies?page=1\u0026pageSize=10"
}
} | +| `page_number` | *int* | :heavy_check_mark: | Current page number. | | +| `page_size` | *int* | :heavy_check_mark: | Number of items to return in results array. | | +| `total_results` | *int* | :heavy_check_mark: | Total number of items. | | +| `results` | List[[shared.TrackingCategory](../../models/shared/trackingcategory.md)] | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/previous-versions/sync-for-payables-version-1/docs/models/shared/trackingcategory.md b/previous-versions/sync-for-payables-version-1/docs/models/shared/trackingcategory.md new file mode 100644 index 000000000..28af64d73 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/docs/models/shared/trackingcategory.md @@ -0,0 +1,144 @@ +# TrackingCategory + +Details of a category used for tracking transactions. + +> Language tip +> +> Parameters used to track types of spend in various parts of an organization can be called **dimensions**, **projects**, **classes**, or **locations** in different accounting software. In Codat, we refer to these as tracking categories. + +View the coverage for tracking categories in the Data coverage explorer. + +## Overview + +Tracking categories are used to monitor cost centres and control budgets that sit outside the standard chart of accounts. Customers may use tracking categories to group together and track the income and costs of specific departments, projects, locations or customers. + +From their accounting system, customers can: + +- Create and maintain tracking categories and tracking category types. +- View all tracking categories that are available for use. +- View the relationships between the categories. +- Assign invoices, bills, credit notes, or bill credit notes to one or more categories. +- View the categories that a transaction belongs to. +- View all transactions in a tracking category. + +### Tracking categories per platform + +Review the platform-specific tracking categories that Codat supports, and the level they are assigned to in the source platform. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
PlatformTracking categoryTracking level
Dynamics 365DimensionsLine item
FreshbooksExpense categoriesLine item
MYOBCategoriesTransaction
NetsuiteClassesLine item
LocationsLine item
DepartmentsLine item
Custom segmentsLine item
QuickBooks DesktopClassesLine item or transaction level
LocationsTransaction
QuickBooks OnlineClassesLine item or transaction level
LocationsTransaction
Sage 200Cost centersLine item
DepartmentsLine item
Analysis codesTransaction
Sage 50DepartmentsLine item
CostcodesLine item
ProjectsLine item
Sage IntacctDimensionsLine item
XeroTracking categoriesLine item
+ +> **Example use case** +> +> Monitor the budget for your annual conference using a tracking category called 'AnnualConference2020' with the **type** set to **Costing**. + +If a tracking category has a parent category, the ID of that parent category is displayed. There is also a `hasChildren` field that shows whether there are child subcategories nested beneath. + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------- | ----------------------------------------------------------------- | ----------------------------------------------------------------- | ----------------------------------------------------------------- | ----------------------------------------------------------------- | +| `has_children` | *Optional[bool]* | :heavy_minus_sign: | Boolean value indicating whether this category has SubCategories. | | +| `id` | *OptionalNullable[str]* | :heavy_minus_sign: | The identifier for the item, unique per tracking category. | | +| `metadata` | [Optional[shared.Metadata]](../../models/shared/metadata.md) | :heavy_minus_sign: | N/A | | +| `modified_date` | *Optional[str]* | :heavy_minus_sign: | N/A | 2022-10-23 00:00:00 +0000 UTC | +| `name` | *OptionalNullable[str]* | :heavy_minus_sign: | The name of the tracking category. | | +| `parent_id` | *OptionalNullable[str]* | :heavy_minus_sign: | The identifier for this item's immediate parent. | | +| `source_modified_date` | *Optional[str]* | :heavy_minus_sign: | N/A | 2022-10-23 00:00:00 +0000 UTC | +| `status` | [Optional[shared.Status]](../../models/shared/status.md) | :heavy_minus_sign: | Current state of the tracking category. | | \ No newline at end of file diff --git a/previous-versions/sync-for-payables-version-1/docs/models/shared/trackingcategoryref.md b/previous-versions/sync-for-payables-version-1/docs/models/shared/trackingcategoryref.md new file mode 100644 index 000000000..71a56ed35 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/docs/models/shared/trackingcategoryref.md @@ -0,0 +1,13 @@ +# ~~TrackingCategoryRef~~ + +References a category against which the item is tracked. + +> :warning: **DEPRECATED**: This will be removed in a future release, please migrate away from it as soon as possible. + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------- | ------------------------------------------- | ------------------------------------------- | ------------------------------------------- | +| `id` | *str* | :heavy_check_mark: | Unique identifier to the tracking category. | +| `name` | *OptionalNullable[str]* | :heavy_minus_sign: | Name of tracking category. | \ No newline at end of file diff --git a/previous-versions/sync-for-payables-version-1/docs/models/shared/trackingcategorytree.md b/previous-versions/sync-for-payables-version-1/docs/models/shared/trackingcategorytree.md new file mode 100644 index 000000000..4669f8615 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/docs/models/shared/trackingcategorytree.md @@ -0,0 +1,18 @@ +# TrackingCategoryTree + +The full structure of a specific tracking category including any child or subcategories. + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | +| `has_children` | *Optional[bool]* | :heavy_minus_sign: | Boolean value indicating whether this category has SubCategories | | +| `id` | *OptionalNullable[str]* | :heavy_minus_sign: | The identifier for the item, unique per tracking category | | +| `metadata` | [Optional[shared.Metadata]](../../models/shared/metadata.md) | :heavy_minus_sign: | N/A | | +| `modified_date` | *Optional[str]* | :heavy_minus_sign: | N/A | 2022-10-23 00:00:00 +0000 UTC | +| `name` | *OptionalNullable[str]* | :heavy_minus_sign: | The name of the tracking category | | +| `parent_id` | *OptionalNullable[str]* | :heavy_minus_sign: | The identifier for this item's immediate parent | | +| `source_modified_date` | *Optional[str]* | :heavy_minus_sign: | N/A | 2022-10-23 00:00:00 +0000 UTC | +| `status` | [Optional[shared.Status]](../../models/shared/status.md) | :heavy_minus_sign: | Current state of the tracking category. | | +| `sub_categories` | List[[shared.TrackingCategoryTree](../../models/shared/trackingcategorytree.md)] | :heavy_minus_sign: | A collection of subcategories that are nested beneath this category. | | \ No newline at end of file diff --git a/previous-versions/sync-for-payables-version-1/docs/models/shared/trackingrecordref.md b/previous-versions/sync-for-payables-version-1/docs/models/shared/trackingrecordref.md new file mode 100644 index 000000000..cb54c2c2d --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/docs/models/shared/trackingrecordref.md @@ -0,0 +1,11 @@ +# TrackingRecordRef + +Links to the customer or tracking category. + + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | +| `data_type` | [Optional[shared.TrackingRecordRefDataType]](../../models/shared/trackingrecordrefdatatype.md) | :heavy_minus_sign: | Name of underlying data type. | trackingCategories | +| `id` | *Optional[str]* | :heavy_minus_sign: | 'id' of the underlying record or data type. | | \ No newline at end of file diff --git a/previous-versions/sync-for-payables-version-1/docs/models/shared/trackingrecordrefdatatype.md b/previous-versions/sync-for-payables-version-1/docs/models/shared/trackingrecordrefdatatype.md new file mode 100644 index 000000000..0336475e7 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/docs/models/shared/trackingrecordrefdatatype.md @@ -0,0 +1,12 @@ +# TrackingRecordRefDataType + +Name of underlying data type. + + +## Values + +| Name | Value | +| --------------------- | --------------------- | +| `CUSTOMERS` | customers | +| `SUPPLIERS` | suppliers | +| `TRACKING_CATEGORIES` | trackingCategories | \ No newline at end of file diff --git a/previous-versions/sync-for-payables-version-1/docs/models/shared/type.md b/previous-versions/sync-for-payables-version-1/docs/models/shared/type.md new file mode 100644 index 000000000..595fc09c0 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/docs/models/shared/type.md @@ -0,0 +1,12 @@ +# Type + +The type of the weblink. + + +## Values + +| Name | Value | +| --------- | --------- | +| `WEBSITE` | Website | +| `SOCIAL` | Social | +| `UNKNOWN` | Unknown | \ No newline at end of file diff --git a/previous-versions/sync-for-payables-version-1/docs/models/shared/updatebillcreditnoteresponse.md b/previous-versions/sync-for-payables-version-1/docs/models/shared/updatebillcreditnoteresponse.md new file mode 100644 index 000000000..77e38bbd0 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/docs/models/shared/updatebillcreditnoteresponse.md @@ -0,0 +1,21 @@ +# UpdateBillCreditNoteResponse + + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `company_id` | *str* | :heavy_check_mark: | Unique identifier for your SMB in Codat. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `data_connection_key` | *str* | :heavy_check_mark: | Unique identifier for a company's data connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | +| `push_operation_key` | *str* | :heavy_check_mark: | A unique identifier generated by Codat to represent this single push operation. This identifier can be used to track the status of the push, and should be persisted. | | +| `requested_on_utc` | *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 | +| `status` | [shared.PushOperationStatus](../../models/shared/pushoperationstatus.md) | :heavy_check_mark: | The current status of the push operation. | | +| `status_code` | *int* | :heavy_check_mark: | Push status code. | | +| `changes` | List[[shared.PushOperationChange](../../models/shared/pushoperationchange.md)] | :heavy_minus_sign: | Contains a single entry that communicates which record has changed and the manner in which it changed. | | +| `completed_on_utc` | *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 | +| `data` | [OptionalNullable[shared.UpdateBillCreditNoteResponseAccountingBillCreditNote]](../../models/shared/updatebillcreditnoteresponseaccountingbillcreditnote.md) | :heavy_minus_sign: | N/A | {
"id": "6a0e9dfb-87b0-47d3-aaaf-9753ae9e757d",
"billCreditNoteNumber": "14763237",
"totalAmount": 693,
"remainingCredit": 693,
"status": "Submitted",
"issueDate": "2019-02-18T16:03:07.268Z",
"note": "Track separately",
"currency": "USD",
"lineItems": [
{
"description": "AcmeMagnet",
"unitAmount": 25,
"discountAmount": 0,
"quantity": 4,
"subTotal": 100,
"taxAmount": 10,
"totalAmount": 110,
"itemRef": {
"id": "3"
},
"taxRateRef": {
"id": "6c88aff3-7cb9-4980-a3d3-443e72e02498"
},
"accountRef": {
"id": "3f267b10-757d-44c0-bef9-20f70cc8fbe3"
},
"trackingCategoryRefs": [
{
"id": "department_1",
"name": "ACMERockets"
},
{
"id": "costcode_2",
"name": "ACM2-ACMESigns"
}
],
"createdFromLineRef": [
{
"id": "8462",
"dataType": "bill",
"lineNumber": 1
}
]
},
{
"description": "ACMEDisintegratingPistol",
"unitAmount": 25,
"discountAmount": 0,
"quantity": 3,
"subTotal": 75,
"taxAmount": 7.5,
"totalAmount": 82.5,
"itemRef": {
"id": "3abf0883-03f7-44c6-bc15-1372522d25e1"
},
"taxRateRef": {
"id": "6c88aff3-7cb9-4980-a3d3-443e72e02498"
},
"accountRef": {
"id": "3f267b10-757d-44c0-bef9-20f70cc8fbe3"
}
},
{
"description": "ACMEWhippedCreamDispenser",
"unitAmount": 52,
"discountAmount": 0,
"quantity": 6,
"subTotal": 312,
"taxAmount": 31.2,
"totalAmount": 343.2,
"itemRef": {
"id": "3691f3d9-0ff7-4358-8a93-bed31c1b4b03"
},
"taxRateRef": {
"id": "6c88aff3-7cb9-4980-a3d3-443e72e02498"
},
"accountRef": {
"id": "3f267b10-757d-44c0-bef9-20f70cc8fbe3"
}
},
{
"description": "ACMEJetPropelledPogoStick",
"unitAmount": 130,
"discountAmount": 0,
"quantity": 1,
"subTotal": 130,
"taxAmount": 27.3,
"totalAmount": 157.3,
"itemRef": {
"id": "075410d4-7edc-4936-ba52-9e1e43cbe300"
},
"taxRateRef": {
"id": "d606732b-db18-44d7-823b-7f15f42c32ea"
},
"accountRef": {
"id": "3f267b10-757d-44c0-bef9-20f70cc8fbe3"
}
}
],
"supplierRef": {
"id": "67C6A7A1-5E84-4AC4-B950-24A114E379D0",
"supplierName": "Chin's Gas and Oil"
},
"createdFromLineRef": {
"id": "8462",
"dataType": "bills",
"line": 1
}
} | +| `data_type` | [Optional[shared.DataType]](../../models/shared/datatype.md) | :heavy_minus_sign: | Available data types | invoices | +| `error_message` | *OptionalNullable[str]* | :heavy_minus_sign: | A message about the error. | | +| `timeout_in_minutes` | *OptionalNullable[int]* | :heavy_minus_sign: | Number of minutes the push operation must complete within before it times out. | | +| ~~`timeout_in_seconds`~~ | *OptionalNullable[int]* | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible.

Number of seconds the push operation must complete within before it times out. | | +| `validation` | [Optional[shared.Validation]](../../models/shared/validation.md) | :heavy_minus_sign: | A human-readable object describing validation decisions Codat has made when pushing data into the platform. If a push has failed because of validation errors, they will be detailed here. | | \ No newline at end of file diff --git a/previous-versions/sync-for-payables-version-1/docs/models/shared/updatebillcreditnoteresponseaccountingbillcreditnote.md b/previous-versions/sync-for-payables-version-1/docs/models/shared/updatebillcreditnoteresponseaccountingbillcreditnote.md new file mode 100644 index 000000000..d2c91e66d --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/docs/models/shared/updatebillcreditnoteresponseaccountingbillcreditnote.md @@ -0,0 +1,49 @@ +# ~~UpdateBillCreditNoteResponseAccountingBillCreditNote~~ + +> **Bill credit notes or credit notes?** +> +> In Codat, bill credit notes represent accounts payable only. For accounts receivable, see [Credit notes](https://docs.codat.io/sync-for-payables-api#/schemas/CreditNote). + +View the coverage for bill credit notes in the Data coverage explorer. + +## Overview + +A bill credit note is issued by a supplier for the purpose of recording credit. For example, if a supplier was unable to fulfil an order that was placed by a business, or delivered damaged goods, they would issue a bill credit note. A bill credit note reduces the amount a business owes to the supplier. It can be refunded to the business or used to pay off future bills. + +In the Codat API, a bill credit note is an accounts payable record issued by a [supplier](https://docs.codat.io/sync-for-payables-api#/schemas/Supplier). + +A bill credit note includes details of: +* The original and remaining credit. +* Any allocations of the credit against other records, such as [bills](https://docs.codat.io/sync-for-payables-api#/schemas/Bill). +* The supplier that issued the bill credit note. + +> :warning: **DEPRECATED**: This will be removed in a future release, please migrate away from it as soon as possible. + + +## Fields + +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `discount_percentage` | *Decimal* | :heavy_check_mark: | Percentage rate of any discount applied to the bill credit note. | 0 | +| `status` | [shared.BillCreditNoteStatus](../../models/shared/billcreditnotestatus.md) | :heavy_check_mark: | Current state of the bill credit note | Paid | +| `sub_total` | *Decimal* | :heavy_check_mark: | Total amount of the bill credit note, including discounts but excluding tax. | 805.78 | +| `total_amount` | *Decimal* | :heavy_check_mark: | Total amount of credit that has been applied to the business' account with the supplier, including discounts and tax. | 805.78 | +| `total_discount` | *Decimal* | :heavy_check_mark: | Total value of any discounts applied. | 0 | +| `total_tax_amount` | *Decimal* | :heavy_check_mark: | Amount of tax included in the bill credit note. | 0 | +| `allocated_on_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 | +| `bill_credit_note_number` | *OptionalNullable[str]* | :heavy_minus_sign: | Friendly reference for the bill credit note. | 91fe2a83-e161-4c21-929d-c5c10c4b07e5 | +| `created_from_refs` | List[[shared.UpdateBillCreditNoteResponseRecordReference](../../models/shared/updatebillcreditnoteresponserecordreference.md)] | :heavy_minus_sign: | An array of records the credit note was created from. | | +| `currency` | *Optional[str]* | :heavy_minus_sign: | The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_.

## Unknown currencies

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

There are only a very small number of edge cases where this currency code is returned by the Codat system. | GBP | +| `currency_rate` | *OptionalNullable[Decimal]* | :heavy_minus_sign: | Rate to convert the total amount of the payment into the base currency for the company at the time of the payment.

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

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

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

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

## Examples with base currency of GBP

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

## Examples with base currency of USD

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


### Integration-specific details

\| Integration \| Scenario \| System behavior \|
\|-------------------\|-------------------------------------------------\|----------------------------------------------------------------------------------------------------------------------------------------------------------------------\|
\| QuickBooks Online \| Transaction currency differs from base currency \| If currency rate value is left `null`, a rate of 1 will be used by QBO by default. To override this, specify a currencyRate in the request body. \| | | +| `id` | *Optional[str]* | :heavy_minus_sign: | Identifier for the bill credit note that is unique to a company in the accounting software. | 1509398f-98e2-436d-8a5d-c042e0c74ffc | +| `issue_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 | +| `line_items` | List[[shared.BillCreditNoteLineItem](../../models/shared/billcreditnotelineitem.md)] | :heavy_minus_sign: | An array of line | | +| `metadata` | [Optional[shared.Metadata]](../../models/shared/metadata.md) | :heavy_minus_sign: | N/A | | +| `modified_date` | *Optional[str]* | :heavy_minus_sign: | N/A | 2022-10-23 00:00:00 +0000 UTC | +| `note` | *OptionalNullable[str]* | :heavy_minus_sign: | Any additional information about the bill credit note. | Bill Credit Note with 1 line items, totaling 805.78 | +| `payment_allocations` | List[[shared.Items](../../models/shared/items.md)] | :heavy_minus_sign: | An array of payment allocations. | | +| `remaining_credit` | *Optional[Decimal]* | :heavy_minus_sign: | Amount of the bill credit note that is still outstanding. | 0 | +| `source_modified_date` | *Optional[str]* | :heavy_minus_sign: | N/A | 2022-10-23 00:00:00 +0000 UTC | +| `supplemental_data` | [Optional[shared.SupplementalData]](../../models/shared/supplementaldata.md) | :heavy_minus_sign: | Supplemental data is additional data you can include in our standard data types.

It is referenced as a configured dynamic key value pair that is unique to the accounting software. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. | | +| `supplier_ref` | [Optional[shared.SupplierRef]](../../models/shared/supplierref.md) | :heavy_minus_sign: | Reference to the supplier the record relates to. | | +| `withholding_tax` | List[[shared.WithholdingTaxItems](../../models/shared/withholdingtaxitems.md)] | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/previous-versions/sync-for-payables-version-1/docs/models/shared/updatebillcreditnoteresponserecordreference.md b/previous-versions/sync-for-payables-version-1/docs/models/shared/updatebillcreditnoteresponserecordreference.md new file mode 100644 index 000000000..5bcae050b --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/docs/models/shared/updatebillcreditnoteresponserecordreference.md @@ -0,0 +1,13 @@ +# UpdateBillCreditNoteResponseRecordReference + +Links the current record to the underlying record or data type that created it. + +For example, if a journal entry is generated based on an invoice, this property allows you to connect the journal entry to the underlying invoice in our data model. + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------- | ------------------------------------------- | ------------------------------------------- | ------------------------------------------- | ------------------------------------------- | +| `data_type` | *Optional[str]* | :heavy_minus_sign: | Allowed name of the 'dataType'. | journalEntry | +| `id` | *Optional[str]* | :heavy_minus_sign: | 'id' of the underlying record or data type. | | \ No newline at end of file diff --git a/previous-versions/sync-for-payables-version-1/docs/models/shared/updatebillresponse.md b/previous-versions/sync-for-payables-version-1/docs/models/shared/updatebillresponse.md new file mode 100644 index 000000000..094790f6e --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/docs/models/shared/updatebillresponse.md @@ -0,0 +1,21 @@ +# UpdateBillResponse + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `company_id` | *str* | :heavy_check_mark: | Unique identifier for your SMB in Codat. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `data_connection_key` | *str* | :heavy_check_mark: | Unique identifier for a company's data connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | +| `push_operation_key` | *str* | :heavy_check_mark: | A unique identifier generated by Codat to represent this single push operation. This identifier can be used to track the status of the push, and should be persisted. | | +| `requested_on_utc` | *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 | +| `status` | [shared.PushOperationStatus](../../models/shared/pushoperationstatus.md) | :heavy_check_mark: | The current status of the push operation. | | +| `status_code` | *int* | :heavy_check_mark: | Push status code. | | +| `changes` | List[[shared.PushOperationChange](../../models/shared/pushoperationchange.md)] | :heavy_minus_sign: | Contains a single entry that communicates which record has changed and the manner in which it changed. | | +| `completed_on_utc` | *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 | +| `data` | [OptionalNullable[shared.UpdateBillResponseAccountingBill]](../../models/shared/updatebillresponseaccountingbill.md) | :heavy_minus_sign: | N/A | | +| `data_type` | [Optional[shared.DataType]](../../models/shared/datatype.md) | :heavy_minus_sign: | Available data types | invoices | +| `error_message` | *OptionalNullable[str]* | :heavy_minus_sign: | A message about the error. | | +| `timeout_in_minutes` | *OptionalNullable[int]* | :heavy_minus_sign: | Number of minutes the push operation must complete within before it times out. | | +| ~~`timeout_in_seconds`~~ | *OptionalNullable[int]* | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible.

Number of seconds the push operation must complete within before it times out. | | +| `validation` | [Optional[shared.Validation]](../../models/shared/validation.md) | :heavy_minus_sign: | A human-readable object describing validation decisions Codat has made when pushing data into the platform. If a push has failed because of validation errors, they will be detailed here. | | \ No newline at end of file diff --git a/previous-versions/sync-for-payables-version-1/docs/models/shared/updatebillresponseaccountingbill.md b/previous-versions/sync-for-payables-version-1/docs/models/shared/updatebillresponseaccountingbill.md new file mode 100644 index 000000000..9e17aabc3 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/docs/models/shared/updatebillresponseaccountingbill.md @@ -0,0 +1,50 @@ +# ~~UpdateBillResponseAccountingBill~~ + +> **Invoices or bills?** +> +> We distinguish between invoices where the company *owes money* vs. *is owed money*. If the company has received an invoice, and owes money to someone else (accounts payable) we call this a Bill. +> +> See [Invoices](https://docs.codat.io/sync-for-payables-api#/schemas/Invoice) for the accounts receivable equivalent of bills. + +View the coverage for bills in the Data coverage explorer. + +## Overview + +In Codat, a bill contains details of: +* When the bill was recorded in the accounting system. +* How much the bill is for and the currency of the amount. +* Who the bill was received from — the *supplier*. +* What the bill is for — the *line items*. + +Some accounting software give a separate name to purchases where the payment is made immediately, such as something bought with a credit card or online payment. One example of this would be QuickBooks Online's *expenses*. + +You can find these types of transactions in our [Direct costs](https://docs.codat.io/sync-for-payables-api#/schemas/DirectCost) data model. + +> :warning: **DEPRECATED**: This will be removed in a future release, please migrate away from it as soon as possible. + + +## Fields + +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `issue_date` | *str* | :heavy_check_mark: | N/A | 2022-10-23 00:00:00 +0000 UTC | +| `status` | [shared.BillStatus](../../models/shared/billstatus.md) | :heavy_check_mark: | Current state of the bill. | | +| `sub_total` | *Decimal* | :heavy_check_mark: | Total amount of the bill, excluding any taxes. | | +| `tax_amount` | *Decimal* | :heavy_check_mark: | Amount of tax on the bill. | | +| `total_amount` | *Decimal* | :heavy_check_mark: | Amount of the bill, including tax. | | +| `amount_due` | *OptionalNullable[Decimal]* | :heavy_minus_sign: | Amount outstanding on the bill. | | +| `currency` | *Optional[str]* | :heavy_minus_sign: | The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_.

## Unknown currencies

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

There are only a very small number of edge cases where this currency code is returned by the Codat system. | GBP | +| `currency_rate` | *OptionalNullable[Decimal]* | :heavy_minus_sign: | Rate to convert the total amount of the payment into the base currency for the company at the time of the payment.

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

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

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

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

## Examples with base currency of GBP

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

## Examples with base currency of USD

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


### Integration-specific details

\| Integration \| Scenario \| System behavior \|
\|-------------------\|-------------------------------------------------\|----------------------------------------------------------------------------------------------------------------------------------------------------------------------\|
\| QuickBooks Online \| Transaction currency differs from base currency \| If currency rate value is left `null`, a rate of 1 will be used by QBO by default. To override this, specify a currencyRate in the request body. \| | | +| `due_date` | *Optional[str]* | :heavy_minus_sign: | N/A | 2022-10-23 00:00:00 +0000 UTC | +| `id` | *Optional[str]* | :heavy_minus_sign: | Identifier for the bill, unique for the company in the accounting software. | | +| `line_items` | List[[shared.BillLineItem](../../models/shared/billlineitem.md)] | :heavy_minus_sign: | Array of Bill line items. | | +| `metadata` | [Optional[shared.Metadata]](../../models/shared/metadata.md) | :heavy_minus_sign: | N/A | | +| `modified_date` | *Optional[str]* | :heavy_minus_sign: | N/A | 2022-10-23 00:00:00 +0000 UTC | +| `note` | *OptionalNullable[str]* | :heavy_minus_sign: | Any private, company notes about the bill, such as payment information. | | +| `payment_allocations` | List[[shared.UpdateBillResponseAccountingPaymentAllocation](../../models/shared/updatebillresponseaccountingpaymentallocation.md)] | :heavy_minus_sign: | An array of payment allocations. | | +| `purchase_order_refs` | List[[shared.UpdateBillResponsePurchaseOrderReference](../../models/shared/updatebillresponsepurchaseorderreference.md)] | :heavy_minus_sign: | N/A | | +| `reference` | *OptionalNullable[str]* | :heavy_minus_sign: | User-friendly reference for the bill. | | +| `source_modified_date` | *Optional[str]* | :heavy_minus_sign: | N/A | 2022-10-23 00:00:00 +0000 UTC | +| `supplemental_data` | [Optional[shared.SupplementalData]](../../models/shared/supplementaldata.md) | :heavy_minus_sign: | Supplemental data is additional data you can include in our standard data types.

It is referenced as a configured dynamic key value pair that is unique to the accounting software. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. | | +| `supplier_ref` | [Optional[shared.SupplierRef]](../../models/shared/supplierref.md) | :heavy_minus_sign: | Reference to the supplier the record relates to. | | +| `withholding_tax` | List[[shared.UpdateBillResponseWithholdingTax](../../models/shared/updatebillresponsewithholdingtax.md)] | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/previous-versions/sync-for-payables-version-1/docs/models/shared/updatebillresponseaccountingpaymentallocation.md b/previous-versions/sync-for-payables-version-1/docs/models/shared/updatebillresponseaccountingpaymentallocation.md new file mode 100644 index 000000000..239d34529 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/docs/models/shared/updatebillresponseaccountingpaymentallocation.md @@ -0,0 +1,9 @@ +# UpdateBillResponseAccountingPaymentAllocation + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | +| `allocation` | [shared.UpdateBillResponseAllocation](../../models/shared/updatebillresponseallocation.md) | :heavy_check_mark: | N/A | +| `payment` | [shared.PaymentAllocationPayment](../../models/shared/paymentallocationpayment.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/previous-versions/sync-for-payables-version-1/docs/models/shared/updatebillresponseallocation.md b/previous-versions/sync-for-payables-version-1/docs/models/shared/updatebillresponseallocation.md new file mode 100644 index 000000000..e8ee46cc7 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/docs/models/shared/updatebillresponseallocation.md @@ -0,0 +1,11 @@ +# UpdateBillResponseAllocation + + +## Fields + +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `allocated_on_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 | +| `currency` | *Optional[str]* | :heavy_minus_sign: | The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_.

## Unknown currencies

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

There are only a very small number of edge cases where this currency code is returned by the Codat system. | GBP | +| `currency_rate` | *OptionalNullable[Decimal]* | :heavy_minus_sign: | Rate to convert the total amount of the payment into the base currency for the company at the time of the payment.

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

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

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

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

## Examples with base currency of GBP

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

## Examples with base currency of USD

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


### Integration-specific details

\| Integration \| Scenario \| System behavior \|
\|-------------------\|-------------------------------------------------\|----------------------------------------------------------------------------------------------------------------------------------------------------------------------\|
\| QuickBooks Online \| Transaction currency differs from base currency \| If currency rate value is left `null`, a rate of 1 will be used by QBO by default. To override this, specify a currencyRate in the request body. \| | | +| `total_amount` | *Optional[Decimal]* | :heavy_minus_sign: | The total amount that has been allocated. | | \ No newline at end of file diff --git a/previous-versions/sync-for-payables-version-1/docs/models/shared/updatebillresponsepurchaseorderreference.md b/previous-versions/sync-for-payables-version-1/docs/models/shared/updatebillresponsepurchaseorderreference.md new file mode 100644 index 000000000..aa85ec732 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/docs/models/shared/updatebillresponsepurchaseorderreference.md @@ -0,0 +1,9 @@ +# UpdateBillResponsePurchaseOrderReference + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | +| `id` | *Optional[str]* | :heavy_minus_sign: | Identifier for the purchase order, unique for the company in the accounting software. | +| `purchase_order_number` | *OptionalNullable[str]* | :heavy_minus_sign: | Friendly reference for the purchase order, commonly generated by the accounting software. | \ No newline at end of file diff --git a/previous-versions/sync-for-payables-version-1/docs/models/shared/updatebillresponsewithholdingtax.md b/previous-versions/sync-for-payables-version-1/docs/models/shared/updatebillresponsewithholdingtax.md new file mode 100644 index 000000000..19a92502d --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/docs/models/shared/updatebillresponsewithholdingtax.md @@ -0,0 +1,9 @@ +# UpdateBillResponseWithholdingTax + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------ | ------------------------------ | ------------------------------ | ------------------------------ | +| `amount` | *Decimal* | :heavy_check_mark: | Amount of tax withheld. | +| `name` | *str* | :heavy_check_mark: | Name assigned to withheld tax. | \ No newline at end of file diff --git a/previous-versions/sync-for-payables-version-1/docs/models/shared/updatesupplierresponse.md b/previous-versions/sync-for-payables-version-1/docs/models/shared/updatesupplierresponse.md new file mode 100644 index 000000000..bea4a87c4 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/docs/models/shared/updatesupplierresponse.md @@ -0,0 +1,21 @@ +# UpdateSupplierResponse + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `company_id` | *str* | :heavy_check_mark: | Unique identifier for your SMB in Codat. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `data_connection_key` | *str* | :heavy_check_mark: | Unique identifier for a company's data connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | +| `push_operation_key` | *str* | :heavy_check_mark: | A unique identifier generated by Codat to represent this single push operation. This identifier can be used to track the status of the push, and should be persisted. | | +| `requested_on_utc` | *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 | +| `status` | [shared.PushOperationStatus](../../models/shared/pushoperationstatus.md) | :heavy_check_mark: | The current status of the push operation. | | +| `status_code` | *int* | :heavy_check_mark: | Push status code. | | +| `changes` | List[[shared.PushOperationChange](../../models/shared/pushoperationchange.md)] | :heavy_minus_sign: | Contains a single entry that communicates which record has changed and the manner in which it changed. | | +| `completed_on_utc` | *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 | +| `data` | [OptionalNullable[shared.UpdateSupplierResponseAccountingSupplier]](../../models/shared/updatesupplierresponseaccountingsupplier.md) | :heavy_minus_sign: | N/A | {
"id": "C520FFD4-F6F6-4FC2-A6D2-5D7088B2B14F",
"supplierName": "Kelly's Industrial Supplies",
"contactName": "Kelly's Industrial Supplies",
"emailAddress": "sales@kellysupplies.com",
"phone": "07999 999999",
"addresses": [
{
"type": "Billing",
"line1": "Unit 51",
"line2": "Bakersfield Industrial Estate",
"city": "Bakersfield",
"region": "California",
"country": "USA",
"postalcode": "93308"
}
],
"registrationNumber": "string",
"taxNumber": "string",
"status": "Unknown",
"defaultCurrency": "string",
"metadata": {
"isDeleted": true
},
"supplementalData": {
"content": {
"property1": {
"property1": null,
"property2": null
},
"property2": {
"property1": null,
"property2": null
}
}
},
"modifiedDate": "2022-10-23T00:00:00Z",
"sourceModifiedDate": "2022-10-23T00:00:00Z"
} | +| `data_type` | [Optional[shared.DataType]](../../models/shared/datatype.md) | :heavy_minus_sign: | Available data types | invoices | +| `error_message` | *OptionalNullable[str]* | :heavy_minus_sign: | A message about the error. | | +| `timeout_in_minutes` | *OptionalNullable[int]* | :heavy_minus_sign: | Number of minutes the push operation must complete within before it times out. | | +| ~~`timeout_in_seconds`~~ | *OptionalNullable[int]* | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible.

Number of seconds the push operation must complete within before it times out. | | +| `validation` | [Optional[shared.Validation]](../../models/shared/validation.md) | :heavy_minus_sign: | A human-readable object describing validation decisions Codat has made when pushing data into the platform. If a push has failed because of validation errors, they will be detailed here. | | \ No newline at end of file diff --git a/previous-versions/sync-for-payables-version-1/docs/models/shared/updatesupplierresponseaccountingsupplier.md b/previous-versions/sync-for-payables-version-1/docs/models/shared/updatesupplierresponseaccountingsupplier.md new file mode 100644 index 000000000..191f68811 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/docs/models/shared/updatesupplierresponseaccountingsupplier.md @@ -0,0 +1,29 @@ +# ~~UpdateSupplierResponseAccountingSupplier~~ + +> View the coverage for suppliers in the Data coverage explorer. + +## Overview + +From the **Suppliers** endpoints, you can retrieve a list of [all the suppliers for a company](https://docs.codat.io/sync-for-payables-api#/operations/list-suppliers). Suppliers' data links to accounts payable [bills](https://docs.codat.io/sync-for-payables-api#/schemas/Bill). + +> :warning: **DEPRECATED**: This will be removed in a future release, please migrate away from it as soon as possible. + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `status` | [shared.SupplierStatus](../../models/shared/supplierstatus.md) | :heavy_check_mark: | Status of the supplier. | | +| `addresses` | List[[shared.Address](../../models/shared/address.md)] | :heavy_minus_sign: | An array of Addresses. | | +| `contact_name` | *OptionalNullable[str]* | :heavy_minus_sign: | Name of the main contact for the supplier. | | +| `default_currency` | *OptionalNullable[str]* | :heavy_minus_sign: | Default currency the supplier's transactional data is recorded in. | | +| `email_address` | *OptionalNullable[str]* | :heavy_minus_sign: | Email address that the supplier may be contacted on. | | +| `id` | *Optional[str]* | :heavy_minus_sign: | Identifier for the supplier, unique to the company in the accounting software. | | +| `metadata` | [Optional[shared.Metadata]](../../models/shared/metadata.md) | :heavy_minus_sign: | N/A | | +| `modified_date` | *Optional[str]* | :heavy_minus_sign: | N/A | 2022-10-23 00:00:00 +0000 UTC | +| `phone` | *OptionalNullable[str]* | :heavy_minus_sign: | Phone number that the supplier may be contacted on. | +44 25691 154789 | +| `registration_number` | *OptionalNullable[str]* | :heavy_minus_sign: | Company number of the supplier. In the UK, this is typically the company registration number issued by Companies House. | | +| `source_modified_date` | *Optional[str]* | :heavy_minus_sign: | N/A | 2022-10-23 00:00:00 +0000 UTC | +| `supplemental_data` | [Optional[shared.SupplementalData]](../../models/shared/supplementaldata.md) | :heavy_minus_sign: | Supplemental data is additional data you can include in our standard data types.

It is referenced as a configured dynamic key value pair that is unique to the accounting software. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. | | +| `supplier_name` | *OptionalNullable[str]* | :heavy_minus_sign: | Name of the supplier as recorded in the accounting system, typically the company name. | | +| `tax_number` | *OptionalNullable[str]* | :heavy_minus_sign: | Supplier's company tax number. | | \ No newline at end of file diff --git a/previous-versions/sync-for-payables-version-1/docs/models/shared/validation.md b/previous-versions/sync-for-payables-version-1/docs/models/shared/validation.md new file mode 100644 index 000000000..4cfc544dc --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/docs/models/shared/validation.md @@ -0,0 +1,11 @@ +# Validation + +A human-readable object describing validation decisions Codat has made when pushing data into the platform. If a push has failed because of validation errors, they will be detailed here. + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | +| `errors` | List[[shared.ValidationItem](../../models/shared/validationitem.md)] | :heavy_minus_sign: | N/A | +| `warnings` | List[[shared.ValidationItem](../../models/shared/validationitem.md)] | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/previous-versions/sync-for-payables-version-1/docs/models/shared/validationitem.md b/previous-versions/sync-for-payables-version-1/docs/models/shared/validationitem.md new file mode 100644 index 000000000..1aaf084c9 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/docs/models/shared/validationitem.md @@ -0,0 +1,10 @@ +# ValidationItem + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------- | -------------------------------------------- | -------------------------------------------- | -------------------------------------------- | +| `item_id` | *OptionalNullable[str]* | :heavy_minus_sign: | Unique identifier for a validation item. | +| `message` | *OptionalNullable[str]* | :heavy_minus_sign: | A message outlining validation item's issue. | +| `validator_name` | *OptionalNullable[str]* | :heavy_minus_sign: | Name of validator. | \ No newline at end of file diff --git a/previous-versions/sync-for-payables-version-1/docs/models/shared/validdatatypelinkitems.md b/previous-versions/sync-for-payables-version-1/docs/models/shared/validdatatypelinkitems.md new file mode 100644 index 000000000..983e47245 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/docs/models/shared/validdatatypelinkitems.md @@ -0,0 +1,50 @@ +# ValidDatatypeLinkItems + +When querying Codat's data model, some data types return `validDatatypeLinks` metadata in the JSON response. This indicates where that object can be used as a reference—a _valid link_—when creating or updating other data. + +For example, `validDatatypeLinks` might indicate the following references: + +- Which tax rates are valid to use on the line item of a bill. +- Which items can be used when creating an invoice. + +You can use `validDatatypeLinks` to present your SMB customers with only valid choices when selecting objects from a list, for example. + +## `validDatatypeLinks` example + +The following example uses the `Accounting.Accounts` data type. It shows that, on the linked integration, this account is valid as the account on a payment or bill payment; and as the account referenced on the line item of a direct income or direct cost. Because there is no valid link to Invoices or Bills, using this account on those data types will result in an error. + +```json validDatatypeLinks for an account +{ + "id": "bd9e85e0-0478-433d-ae9f-0b3c4f04bfe4", + "nominalCode": "090", + "name": "Business Bank Account", + #... + "validDatatypeLinks": [ + { + "property": "Id", + "links": [ + "Payment.AccountRef.Id", + "BillPayment.AccountRef.Id", + "DirectIncome.LineItems.AccountRef.Id", + "DirectCost.LineItems.AccountRef.Id" + ] + } + ] + } +``` + + + +## Support for `validDatatypeLinks` + +Codat currently supports `validDatatypeLinks` for some data types on our Xero, QuickBooks Online, QuickBooks Desktop, Exact (NL), and Sage Business Cloud integrations. + +If you'd like us to extend support to more data types or integrations, suggest or vote for this on our Product Roadmap. + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | +| `links` | List[*str*] | :heavy_minus_sign: | Supported `dataTypes` that the record can be linked to. | +| `property` | *OptionalNullable[str]* | :heavy_minus_sign: | The property from the account that can be linked. | \ No newline at end of file diff --git a/previous-versions/sync-for-payables-version-1/docs/models/shared/validdatatypelinks.md b/previous-versions/sync-for-payables-version-1/docs/models/shared/validdatatypelinks.md new file mode 100644 index 000000000..809a80db0 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/docs/models/shared/validdatatypelinks.md @@ -0,0 +1,50 @@ +# ValidDataTypeLinks + +When querying Codat's data model, some data types return `validDatatypeLinks` metadata in the JSON response. This indicates where that object can be used as a reference—a _valid link_—when creating or updating other data. + +For example, `validDatatypeLinks` might indicate the following references: + +- Which tax rates are valid to use on the line item of a bill. +- Which items can be used when creating an invoice. + +You can use `validDatatypeLinks` to present your SMB customers with only valid choices when selecting objects from a list, for example. + +## `validDatatypeLinks` example + +The following example uses the `Accounting.Accounts` data type. It shows that, on the linked integration, this account is valid as the account on a payment or bill payment; and as the account referenced on the line item of a direct income or direct cost. Because there is no valid link to Invoices or Bills, using this account on those data types will result in an error. + +```json validDatatypeLinks for an account +{ + "id": "bd9e85e0-0478-433d-ae9f-0b3c4f04bfe4", + "nominalCode": "090", + "name": "Business Bank Account", + #... + "validDatatypeLinks": [ + { + "property": "Id", + "links": [ + "Payment.AccountRef.Id", + "BillPayment.AccountRef.Id", + "DirectIncome.LineItems.AccountRef.Id", + "DirectCost.LineItems.AccountRef.Id" + ] + } + ] + } +``` + + + +## Support for `validDatatypeLinks` + +Codat currently supports `validDatatypeLinks` for some data types on our Xero, QuickBooks Online, QuickBooks Desktop, Exact (NL), and Sage Business Cloud integrations. + +If you'd like us to extend support to more data types or integrations, suggest or vote for this on our Product Roadmap. + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | +| `links` | List[*str*] | :heavy_minus_sign: | Supported `dataTypes` that the record can be linked to. | +| `property` | *OptionalNullable[str]* | :heavy_minus_sign: | The property from the account that can be linked. | \ No newline at end of file diff --git a/previous-versions/sync-for-payables-version-1/docs/models/shared/weblink.md b/previous-versions/sync-for-payables-version-1/docs/models/shared/weblink.md new file mode 100644 index 000000000..2a5dfd3c5 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/docs/models/shared/weblink.md @@ -0,0 +1,11 @@ +# WebLink + +Weblink associated with the company. + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | +| `type` | [Optional[shared.Type]](../../models/shared/type.md) | :heavy_minus_sign: | The type of the weblink. | +| `url` | *Optional[str]* | :heavy_minus_sign: | The full URL for the weblink. | \ No newline at end of file diff --git a/previous-versions/sync-for-payables-version-1/docs/models/shared/withholdingtax.md b/previous-versions/sync-for-payables-version-1/docs/models/shared/withholdingtax.md new file mode 100644 index 000000000..277b9561e --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/docs/models/shared/withholdingtax.md @@ -0,0 +1,9 @@ +# WithholdingTax + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------ | ------------------------------ | ------------------------------ | ------------------------------ | +| `amount` | *Decimal* | :heavy_check_mark: | Amount of tax withheld. | +| `name` | *str* | :heavy_check_mark: | Name assigned to withheld tax. | \ No newline at end of file diff --git a/previous-versions/sync-for-payables-version-1/docs/models/shared/withholdingtaxitems.md b/previous-versions/sync-for-payables-version-1/docs/models/shared/withholdingtaxitems.md new file mode 100644 index 000000000..3940b46e5 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/docs/models/shared/withholdingtaxitems.md @@ -0,0 +1,9 @@ +# WithholdingTaxItems + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------ | ------------------------------ | ------------------------------ | ------------------------------ | +| `amount` | *Decimal* | :heavy_check_mark: | Amount of tax withheld. | +| `name` | *str* | :heavy_check_mark: | Name assigned to withheld tax. | \ No newline at end of file diff --git a/previous-versions/sync-for-payables-version-1/docs/models/shared/zero.md b/previous-versions/sync-for-payables-version-1/docs/models/shared/zero.md new file mode 100644 index 000000000..6c2faac45 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/docs/models/shared/zero.md @@ -0,0 +1,14 @@ +# Zero + +Links the current record line to the underlying record line that created it. + +For example, if a bill is generated from a purchase order, this property allows you to connect the bill line item to the purchase order line item in our data model. + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | +| `data_type` | [Optional[shared.ZeroDataType]](../../models/shared/zerodatatype.md) | :heavy_minus_sign: | Allowed name of the 'dataType'. | +| `id` | *Optional[str]* | :heavy_minus_sign: | 'id' of the underlying record. | +| `line_number` | *Optional[str]* | :heavy_minus_sign: | Line number of the underlying record. | \ No newline at end of file diff --git a/previous-versions/sync-for-payables-version-1/docs/models/shared/zerodatatype.md b/previous-versions/sync-for-payables-version-1/docs/models/shared/zerodatatype.md new file mode 100644 index 000000000..2a8e2bdc0 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/docs/models/shared/zerodatatype.md @@ -0,0 +1,11 @@ +# ZeroDataType + +Allowed name of the 'dataType'. + + +## Values + +| Name | Value | +| ----------------- | ----------------- | +| `PURCHASE_ORDERS` | purchaseOrders | +| `BILLS` | bills | \ No newline at end of file diff --git a/previous-versions/sync-for-payables-version-1/docs/models/webhooks/clientratelimitreachedresponse.md b/previous-versions/sync-for-payables-version-1/docs/models/webhooks/clientratelimitreachedresponse.md deleted file mode 100644 index 4408f824d..000000000 --- a/previous-versions/sync-for-payables-version-1/docs/models/webhooks/clientratelimitreachedresponse.md +++ /dev/null @@ -1,10 +0,0 @@ -# ClientRateLimitReachedResponse - - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | -| `content_type` | *str* | :heavy_check_mark: | HTTP response content type for this operation | -| `status_code` | *int* | :heavy_check_mark: | HTTP response status code for this operation | -| `raw_response` | [requests.Response](https://requests.readthedocs.io/en/latest/api/#requests.Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/previous-versions/sync-for-payables-version-1/docs/models/webhooks/clientratelimitresetresponse.md b/previous-versions/sync-for-payables-version-1/docs/models/webhooks/clientratelimitresetresponse.md deleted file mode 100644 index 14a24dc94..000000000 --- a/previous-versions/sync-for-payables-version-1/docs/models/webhooks/clientratelimitresetresponse.md +++ /dev/null @@ -1,10 +0,0 @@ -# ClientRateLimitResetResponse - - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | -| `content_type` | *str* | :heavy_check_mark: | HTTP response content type for this operation | -| `status_code` | *int* | :heavy_check_mark: | HTTP response status code for this operation | -| `raw_response` | [requests.Response](https://requests.readthedocs.io/en/latest/api/#requests.Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/previous-versions/sync-for-payables-version-1/docs/models/webhooks/payablesbillcreatedresponse.md b/previous-versions/sync-for-payables-version-1/docs/models/webhooks/payablesbillcreatedresponse.md deleted file mode 100644 index 3f0aad9be..000000000 --- a/previous-versions/sync-for-payables-version-1/docs/models/webhooks/payablesbillcreatedresponse.md +++ /dev/null @@ -1,10 +0,0 @@ -# PayablesBillCreatedResponse - - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | -| `content_type` | *str* | :heavy_check_mark: | HTTP response content type for this operation | -| `status_code` | *int* | :heavy_check_mark: | HTTP response status code for this operation | -| `raw_response` | [requests.Response](https://requests.readthedocs.io/en/latest/api/#requests.Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/previous-versions/sync-for-payables-version-1/docs/models/webhooks/payablesbilldeletedresponse.md b/previous-versions/sync-for-payables-version-1/docs/models/webhooks/payablesbilldeletedresponse.md deleted file mode 100644 index 3ac6d7baf..000000000 --- a/previous-versions/sync-for-payables-version-1/docs/models/webhooks/payablesbilldeletedresponse.md +++ /dev/null @@ -1,10 +0,0 @@ -# PayablesBillDeletedResponse - - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | -| `content_type` | *str* | :heavy_check_mark: | HTTP response content type for this operation | -| `status_code` | *int* | :heavy_check_mark: | HTTP response status code for this operation | -| `raw_response` | [requests.Response](https://requests.readthedocs.io/en/latest/api/#requests.Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/previous-versions/sync-for-payables-version-1/docs/models/webhooks/payablesbillupdatedresponse.md b/previous-versions/sync-for-payables-version-1/docs/models/webhooks/payablesbillupdatedresponse.md deleted file mode 100644 index 00439f1cd..000000000 --- a/previous-versions/sync-for-payables-version-1/docs/models/webhooks/payablesbillupdatedresponse.md +++ /dev/null @@ -1,10 +0,0 @@ -# PayablesBillUpdatedResponse - - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | -| `content_type` | *str* | :heavy_check_mark: | HTTP response content type for this operation | -| `status_code` | *int* | :heavy_check_mark: | HTTP response status code for this operation | -| `raw_response` | [requests.Response](https://requests.readthedocs.io/en/latest/api/#requests.Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/previous-versions/sync-for-payables-version-1/docs/sdks/accounts/README.md b/previous-versions/sync-for-payables-version-1/docs/sdks/accounts/README.md new file mode 100644 index 000000000..991bc7191 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/docs/sdks/accounts/README.md @@ -0,0 +1,237 @@ +# Accounts +(*accounts*) + +## Overview + +Get, create, and update Accounts. + +### Available Operations + +* [create](#create) - Create account +* [get](#get) - Get account +* [get_create_model](#get_create_model) - Get create account model +* [list](#list) - List accounts + +## create + +The *Create account* endpoint creates a new [account](https://docs.codat.io/sync-for-payables-api#/schemas/Account) for a given company's connection. + +[Accounts](https://docs.codat.io/sync-for-payables-api#/schemas/Account) are the categories a business uses to record accounting transactions. + +**Integration-specific behaviour** + +Required data may vary by integration. To see what data to post, first call [Get create account model](https://docs.codat.io/sync-for-payables-api#/operations/get-create-chartOfAccounts-model). + +Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=chartOfAccounts) for integrations that support creating an account. + + +### Example Usage + +```python +from codat_sync_for_payables_version_1 import CodatSyncPayables +from codat_sync_for_payables_version_1.models import shared +from decimal import Decimal + +s = CodatSyncPayables( + security=shared.Security( + auth_header="Basic BASE_64_ENCODED(API_KEY)", + ), +) + +res = s.accounts.create(request={ + "company_id": "8a210b68-6988-11ed-a1eb-0242ac120002", + "connection_id": "2e9d2c44-f675-40ba-8049-353bfcb5e171", + "account_prototype": { + "currency": "USD", + "current_balance": Decimal("0"), + "description": "Invoices the business has issued but has not yet collected payment on.", + "fully_qualified_category": "Asset.Current", + "fully_qualified_name": "Fixed Asset", + "name": "Accounts Receivable", + "nominal_code": "610", + "status": shared.AccountStatus.ACTIVE, + "type": shared.AccountType.ASSET, + }, +}) + +if res is not None: + # handle response + pass + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | +| `request` | [operations.CreateAccountRequest](../../models/operations/createaccountrequest.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.CreateAccountResponse](../../models/shared/createaccountresponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| -------------------------------------- | -------------------------------------- | -------------------------------------- | +| errors.ErrorMessage | 400, 401, 402, 403, 404, 429, 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## get + +The *Get account* endpoint returns a single account for a given `accountId`. + +[Accounts](https://docs.codat.io/sync-for-payables-api#/schemas/Account) are the categories a business uses to record accounting transactions. + +Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=chartOfAccounts) for integrations that support getting a specific account. + +Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/sync-for-payables-api#/operations/refresh-company-data). + + +### Example Usage + +```python +from codat_sync_for_payables_version_1 import CodatSyncPayables +from codat_sync_for_payables_version_1.models import shared + +s = CodatSyncPayables( + security=shared.Security( + auth_header="Basic BASE_64_ENCODED(API_KEY)", + ), +) + +res = s.accounts.get(request={ + "account_id": "", + "company_id": "8a210b68-6988-11ed-a1eb-0242ac120002", +}) + +if res is not None: + # handle response + pass + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | +| `request` | [operations.GetAccountRequest](../../models/operations/getaccountrequest.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.Account](../../models/shared/account.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| -------------------------------------- | -------------------------------------- | -------------------------------------- | +| errors.ErrorMessage | 401, 402, 403, 404, 409, 429, 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## get_create_model + +The *Get create account model* endpoint returns the expected data for the request payload when creating an [account](https://docs.codat.io/sync-for-payables-api#/schemas/Account) for a given company and integration. + +[Accounts](https://docs.codat.io/sync-for-payables-api#/schemas/Account) are the categories a business uses to record accounting transactions. + +**Integration-specific behaviour** + +See the *response examples* for integration-specific indicative models. + +Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=chartOfAccounts) for integrations that support creating an account. + + +### Example Usage + +```python +from codat_sync_for_payables_version_1 import CodatSyncPayables +from codat_sync_for_payables_version_1.models import shared + +s = CodatSyncPayables( + security=shared.Security( + auth_header="Basic BASE_64_ENCODED(API_KEY)", + ), +) + +res = s.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 + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | +| `request` | [operations.GetCreateAccountModelRequest](../../models/operations/getcreateaccountmodelrequest.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 | \*/\* | + +## list + +The *List accounts* endpoint returns a list of [accounts](https://docs.codat.io/sync-for-payables-api#/schemas/Account) for a given company's connection. + +[Accounts](https://docs.codat.io/sync-for-payables-api#/schemas/Account) are the categories a business uses to record accounting transactions. + +Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/sync-for-payables-api#/operations/refresh-company-data). + +### Example Usage + +```python +from codat_sync_for_payables_version_1 import CodatSyncPayables +from codat_sync_for_payables_version_1.models import shared + +s = CodatSyncPayables( + security=shared.Security( + auth_header="Basic BASE_64_ENCODED(API_KEY)", + ), +) + +res = s.accounts.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 + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | +| `request` | [operations.ListAccountsRequest](../../models/operations/listaccountsrequest.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.Accounts](../../models/shared/accounts.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 | \*/\* | \ No newline at end of file diff --git a/previous-versions/sync-for-payables-version-1/docs/sdks/bankaccounts/README.md b/previous-versions/sync-for-payables-version-1/docs/sdks/bankaccounts/README.md new file mode 100644 index 000000000..5160dcfb8 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/docs/sdks/bankaccounts/README.md @@ -0,0 +1,122 @@ +# BankAccounts +(*bank_accounts*) + +## Overview + +Get, create, and update Bank accounts. + +### Available Operations + +* [create](#create) - Create bank account +* [get_create_model](#get_create_model) - Get create/update bank account model + +## create + +The *Create bank account* endpoint creates a new [bank account](https://docs.codat.io/sync-for-payables-api#/schemas/BankAccount) for a given company's connection. + +[Bank accounts](https://docs.codat.io/sync-for-payables-api#/schemas/BankAccount) are financial accounts maintained by a bank or other financial institution. + +**Integration-specific behaviour** + +Required data may vary by integration. To see what data to post, first call [Get create/update bank account model](https://docs.codat.io/sync-for-payables-api#/operations/get-create-update-bankAccounts-model). + +Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=bankAccounts) for integrations that support creating an account. + +### Example Usage + +```python +from codat_sync_for_payables_version_1 import CodatSyncPayables +from codat_sync_for_payables_version_1.models import shared + +s = CodatSyncPayables( + 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 + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | +| `request` | [operations.CreateBankAccountRequest](../../models/operations/createbankaccountrequest.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.BankAccountCreateResponse](../../models/shared/bankaccountcreateresponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| -------------------------------------- | -------------------------------------- | -------------------------------------- | +| errors.ErrorMessage | 400, 401, 402, 403, 404, 429, 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## get_create_model + +The *Get create/update bank account model* endpoint returns the expected data for the request payload when creating and updating a [bank account](https://docs.codat.io/sync-for-payables-api#/schemas/BankAccount) for a given company and integration. + +[Bank accounts](https://docs.codat.io/sync-for-payables-api#/schemas/BankAccount) are financial accounts maintained by a bank or other financial institution. + +**Integration-specific behaviour** + +See the *response examples* for integration-specific indicative models. + +Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=bankAccounts) for integrations that support creating and updating a bank account. + + +### Example Usage + +```python +from codat_sync_for_payables_version_1 import CodatSyncPayables +from codat_sync_for_payables_version_1.models import shared + +s = CodatSyncPayables( + 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", +}) + +if res is not None: + # handle response + pass + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.GetCreateBankAccountsModelRequest](../../models/operations/getcreatebankaccountsmodelrequest.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 | \*/\* | \ No newline at end of file diff --git a/previous-versions/sync-for-payables-version-1/docs/sdks/billcreditnotes/README.md b/previous-versions/sync-for-payables-version-1/docs/sdks/billcreditnotes/README.md new file mode 100644 index 000000000..c75190bc8 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/docs/sdks/billcreditnotes/README.md @@ -0,0 +1,509 @@ +# BillCreditNotes +(*bill_credit_notes*) + +## Overview + +Get, create, and update Bill credit notes. + +### Available Operations + +* [create](#create) - Create bill credit note +* [get](#get) - Get bill credit note +* [get_create_update_model](#get_create_update_model) - Get create/update bill credit note model +* [list](#list) - List bill credit notes +* [update](#update) - Update bill credit note + +## create + +The *Create bill credit note* endpoint creates a new [bill credit note](https://docs.codat.io/sync-for-payables-api#/schemas/BillCreditNote) for a given company's connection. + +[Bill credit notes](https://docs.codat.io/sync-for-payables-api#/schemas/BillCreditNote) are issued by a supplier for the purpose of recording credit. + +**Integration-specific behaviour** + +Required data may vary by integration. To see what data to post, first call [Get create/update bill credit note model](https://docs.codat.io/sync-for-payables-api#/operations/get-create-update-billCreditNotes-model). + +Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=billCreditNotes) for integrations that support creating a bill credit note. + + +### Example Usage + +```python +from codat_sync_for_payables_version_1 import CodatSyncPayables +from codat_sync_for_payables_version_1.models import shared +from decimal import Decimal + +s = CodatSyncPayables( + security=shared.Security( + auth_header="Basic BASE_64_ENCODED(API_KEY)", + ), +) + +res = s.bill_credit_notes.create(request={ + "company_id": "8a210b68-6988-11ed-a1eb-0242ac120002", + "connection_id": "2e9d2c44-f675-40ba-8049-353bfcb5e171", + "bill_credit_note": { + "discount_percentage": Decimal("0"), + "status": shared.BillCreditNoteStatus.SUBMITTED, + "sub_total": Decimal("100"), + "total_amount": Decimal("100"), + "total_discount": Decimal("0"), + "total_tax_amount": Decimal("0"), + "allocated_on_date": "2022-10-23T00:00:00Z", + "bill_credit_note_number": "309", + "created_from_refs": [ + { + "data_type": "invoice", + }, + { + "data_type": "journalEntry", + }, + ], + "currency": "GBP", + "currency_rate": Decimal("1.242097"), + "id": "1509398f-98e2-436d-8a5d-c042e0c74ffc", + "issue_date": "2023-04-20T00:00:00", + "line_items": [ + { + "quantity": Decimal("1"), + "unit_amount": Decimal("100"), + "account_ref": { + "id": "7", + }, + "description": "", + "sub_total": Decimal("100"), + "tax_amount": Decimal("0"), + "tax_rate_ref": { + "effective_tax_rate": Decimal("0"), + "id": "NON", + "name": "NON", + }, + "total_amount": Decimal("100"), + "tracking": { + "category_refs": [ + { + "id": "", + }, + ], + "is_billed_to": shared.BilledToType.UNKNOWN, + "is_rebilled_to": shared.BilledToType.NOT_APPLICABLE, + }, + "tracking_category_refs": [ + { + "id": "", + }, + ], + }, + ], + "modified_date": "2022-10-23T00:00:00Z", + "note": "Bill Credit Note with 1 line items, totaling 805.78", + "payment_allocations": [ + { + "allocation": { + "allocated_on_date": "2022-10-23T00:00:00Z", + "currency": "GBP", + }, + "payment": { + "currency": "GBP", + "paid_on_date": "2022-10-23T00:00:00Z", + }, + }, + { + "allocation": { + "allocated_on_date": "2022-10-23T00:00:00Z", + "currency": "EUR", + }, + "payment": { + "currency": "USD", + "paid_on_date": "2022-10-23T00:00:00Z", + }, + }, + { + "allocation": { + "allocated_on_date": "2022-10-23T00:00:00Z", + "currency": "USD", + }, + "payment": { + "currency": "GBP", + "paid_on_date": "2022-10-23T00:00:00Z", + }, + }, + ], + "remaining_credit": Decimal("100"), + "source_modified_date": "2022-10-23T00:00:00Z", + "supplier_ref": { + "id": "87", + "supplier_name": "Ankunding Inc", + }, + "withholding_tax": [ + { + "amount": Decimal("4865.89"), + "name": "", + }, + ], + }, +}) + +if res is not None: + # handle response + pass + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | +| `request` | [operations.CreateBillCreditNoteRequest](../../models/operations/createbillcreditnoterequest.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.CreateBillCreditNoteResponse](../../models/shared/createbillcreditnoteresponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| -------------------------------------- | -------------------------------------- | -------------------------------------- | +| errors.ErrorMessage | 400, 401, 402, 403, 404, 429, 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## get + +The *Get bill credit note* endpoint returns a single bill credit note for a given `billCreditNoteId`. + +[Bill credit notes](https://docs.codat.io/sync-for-payables-api#/schemas/BillCreditNote) are issued by a supplier for the purpose of recording credit. + +Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=billCreditNotes) for integrations that support getting a specific bill credit note. + +Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/sync-for-payables-api#/operations/refresh-company-data). + + +### Example Usage + +```python +from codat_sync_for_payables_version_1 import CodatSyncPayables +from codat_sync_for_payables_version_1.models import shared + +s = CodatSyncPayables( + security=shared.Security( + auth_header="Basic BASE_64_ENCODED(API_KEY)", + ), +) + +res = s.bill_credit_notes.get(request={ + "bill_credit_note_id": "", + "company_id": "8a210b68-6988-11ed-a1eb-0242ac120002", +}) + +if res is not None: + # handle response + pass + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | +| `request` | [operations.GetBillCreditNoteRequest](../../models/operations/getbillcreditnoterequest.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.BillCreditNote](../../models/shared/billcreditnote.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| -------------------------------------- | -------------------------------------- | -------------------------------------- | +| errors.ErrorMessage | 401, 402, 403, 404, 409, 429, 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## get_create_update_model + +The *Get create/update bill credit note model* endpoint returns the expected data for the request payload when creating and updating a [bill credit note](https://docs.codat.io/sync-for-payables-api#/schemas/BillCreditNote) for a given company and integration. + +[Bill credit notes](https://docs.codat.io/sync-for-payables-api#/schemas/BillCreditNote) are issued by a supplier for the purpose of recording credit. + +**Integration-specific behaviour** + +See the *response examples* for integration-specific indicative models. + +Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=billCreditNotes) for integrations that support creating and updating a bill credit note. + + +### Example Usage + +```python +from codat_sync_for_payables_version_1 import CodatSyncPayables +from codat_sync_for_payables_version_1.models import shared + +s = CodatSyncPayables( + security=shared.Security( + auth_header="Basic BASE_64_ENCODED(API_KEY)", + ), +) + +res = s.bill_credit_notes.get_create_update_model(request={ + "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.GetCreateUpdateBillCreditNoteModelRequest](../../models/operations/getcreateupdatebillcreditnotemodelrequest.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 | \*/\* | + +## list + +The *List bill credit notes* endpoint returns a list of [bill credit notes](https://docs.codat.io/sync-for-payables-api#/schemas/BillCreditNote) for a given company's connection. + +[Bill credit notes](https://docs.codat.io/sync-for-payables-api#/schemas/BillCreditNote) are issued by a supplier for the purpose of recording credit. + +Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/sync-for-payables-api#/operations/refresh-company-data). + + +### Example Usage + +```python +from codat_sync_for_payables_version_1 import CodatSyncPayables +from codat_sync_for_payables_version_1.models import shared + +s = CodatSyncPayables( + security=shared.Security( + auth_header="Basic BASE_64_ENCODED(API_KEY)", + ), +) + +res = s.bill_credit_notes.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 + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | +| `request` | [operations.ListBillCreditNotesRequest](../../models/operations/listbillcreditnotesrequest.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.BillCreditNotes](../../models/shared/billcreditnotes.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 | \*/\* | + +## update + +The *Update bill credit note* endpoint updates an existing [bill credit note](https://docs.codat.io/sync-for-payables-api#/schemas/BillCreditNote) for a given company's connection. + +[Bill credit notes](https://docs.codat.io/sync-for-payables-api#/schemas/BillCreditNote) are issued by a supplier for the purpose of recording credit. + +**Integration-specific behaviour** + +Required data may vary by integration. To see what data to post, first call [Get create/update bill credit note model](https://docs.codat.io/sync-for-payables-api#/operations/get-create-update-billCreditNotes-model). + +Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=billCreditNotes) for integrations that support creating a bill credit note. + + +### Example Usage + +```python +from codat_sync_for_payables_version_1 import CodatSyncPayables +from codat_sync_for_payables_version_1.models import shared +from decimal import Decimal + +s = CodatSyncPayables( + security=shared.Security( + auth_header="Basic BASE_64_ENCODED(API_KEY)", + ), +) + +res = s.bill_credit_notes.update(request={ + "bill_credit_note_id": "", + "company_id": "8a210b68-6988-11ed-a1eb-0242ac120002", + "connection_id": "2e9d2c44-f675-40ba-8049-353bfcb5e171", + "bill_credit_note": { + "discount_percentage": Decimal("0"), + "status": shared.BillCreditNoteStatus.SUBMITTED, + "sub_total": Decimal("805.78"), + "total_amount": Decimal("693"), + "total_discount": Decimal("0"), + "total_tax_amount": Decimal("0"), + "allocated_on_date": "2022-10-23T00:00:00Z", + "bill_credit_note_number": "14763237", + "created_from_refs": [ + { + "data_type": "invoice", + }, + { + "data_type": "transfer", + }, + ], + "currency": "USD", + "id": "6a0e9dfb-87b0-47d3-aaaf-9753ae9e757d", + "issue_date": "2019-02-18T16:03:07.268Z", + "line_items": [ + { + "quantity": Decimal("4"), + "unit_amount": Decimal("25"), + "account_ref": { + "id": "3f267b10-757d-44c0-bef9-20f70cc8fbe3", + }, + "description": "AcmeMagnet", + "discount_amount": Decimal("0"), + "item_ref": { + "id": "3", + }, + "sub_total": Decimal("100"), + "tax_amount": Decimal("10"), + "tax_rate_ref": { + "id": "6c88aff3-7cb9-4980-a3d3-443e72e02498", + }, + "total_amount": Decimal("110"), + "tracking_category_refs": [ + { + "id": "department_1", + "name": "ACMERockets", + }, + { + "id": "costcode_2", + "name": "ACM2-ACMESigns", + }, + ], + }, + { + "quantity": Decimal("3"), + "unit_amount": Decimal("25"), + "account_ref": { + "id": "3f267b10-757d-44c0-bef9-20f70cc8fbe3", + }, + "description": "ACMEDisintegratingPistol", + "discount_amount": Decimal("0"), + "item_ref": { + "id": "3abf0883-03f7-44c6-bc15-1372522d25e1", + }, + "sub_total": Decimal("75"), + "tax_amount": Decimal("7.5"), + "tax_rate_ref": { + "id": "6c88aff3-7cb9-4980-a3d3-443e72e02498", + }, + "total_amount": Decimal("82.5"), + }, + { + "quantity": Decimal("6"), + "unit_amount": Decimal("52"), + "account_ref": { + "id": "3f267b10-757d-44c0-bef9-20f70cc8fbe3", + }, + "description": "ACMEWhippedCreamDispenser", + "discount_amount": Decimal("0"), + "item_ref": { + "id": "3691f3d9-0ff7-4358-8a93-bed31c1b4b03", + }, + "sub_total": Decimal("312"), + "tax_amount": Decimal("31.2"), + "tax_rate_ref": { + "id": "6c88aff3-7cb9-4980-a3d3-443e72e02498", + }, + "total_amount": Decimal("343.2"), + }, + { + "quantity": Decimal("1"), + "unit_amount": Decimal("130"), + "account_ref": { + "id": "3f267b10-757d-44c0-bef9-20f70cc8fbe3", + }, + "description": "ACMEJetPropelledPogoStick", + "discount_amount": Decimal("0"), + "item_ref": { + "id": "075410d4-7edc-4936-ba52-9e1e43cbe300", + }, + "sub_total": Decimal("130"), + "tax_amount": Decimal("27.3"), + "tax_rate_ref": { + "id": "d606732b-db18-44d7-823b-7f15f42c32ea", + }, + "total_amount": Decimal("157.3"), + }, + ], + "modified_date": "2022-10-23T00:00:00Z", + "note": "Track separately", + "payment_allocations": [ + { + "allocation": { + "allocated_on_date": "2022-10-23T00:00:00Z", + "currency": "GBP", + }, + "payment": { + "currency": "EUR", + "paid_on_date": "2022-10-23T00:00:00Z", + }, + }, + ], + "remaining_credit": Decimal("693"), + "source_modified_date": "2022-10-23T00:00:00Z", + "supplier_ref": { + "id": "67C6A7A1-5E84-4AC4-B950-24A114E379D0", + "supplier_name": "Chin's Gas and Oil", + }, + }, +}) + +if res is not None: + # handle response + pass + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | +| `request` | [operations.UpdateBillCreditNoteRequest](../../models/operations/updatebillcreditnoterequest.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.UpdateBillCreditNoteResponse](../../models/shared/updatebillcreditnoteresponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| -------------------------------------- | -------------------------------------- | -------------------------------------- | +| errors.ErrorMessage | 400, 401, 402, 403, 404, 429, 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/previous-versions/sync-for-payables-version-1/docs/sdks/billpayments/README.md b/previous-versions/sync-for-payables-version-1/docs/sdks/billpayments/README.md new file mode 100644 index 000000000..29f244f97 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/docs/sdks/billpayments/README.md @@ -0,0 +1,343 @@ +# BillPayments +(*bill_payments*) + +## Overview + +Get, create, and update Bill payments. + +### Available Operations + +* [create](#create) - Create bill payments +* [delete](#delete) - Delete bill payment +* [get](#get) - Get bill payment +* [get_create_model](#get_create_model) - Get create bill payment model +* [list](#list) - List bill payments + +## create + +The *Create bill payment* endpoint creates a new [bill payment](https://docs.codat.io/sync-for-payables-api#/schemas/BillPayment) for a given company's connection. + +[Bill payments](https://docs.codat.io/sync-for-payables-api#/schemas/BillPayment) are an allocation of money within any customer accounts payable account. + +**Integration-specific behaviour** + +Required data may vary by integration. To see what data to post, first call [Get create bill payment model](https://docs.codat.io/sync-for-payables-api#/operations/get-create-billPayments-model). + +Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=billPayments) for integrations that support creating a bill payment. + + +### Example Usage + +```python +from codat_sync_for_payables_version_1 import CodatSyncPayables +from codat_sync_for_payables_version_1.models import shared +from decimal import Decimal + +s = CodatSyncPayables( + security=shared.Security( + auth_header="Basic BASE_64_ENCODED(API_KEY)", + ), +) + +res = s.bill_payments.create(request={ + "company_id": "8a210b68-6988-11ed-a1eb-0242ac120002", + "connection_id": "2e9d2c44-f675-40ba-8049-353bfcb5e171", + "bill_payment": { + "date_": "2023-01-05T12:33:25.339Z", + "account_ref": { + "id": "1200", + "name": "string", + }, + "currency": "GBP", + "currency_rate": Decimal("1"), + "id": "3d5a8e00-d108-4045-8823-7f342676cffa", + "lines": [ + { + "amount": Decimal("15.38"), + "allocated_on_date": "2023-01-05T12:33:25.339Z", + "links": [ + { + "type": shared.BillPaymentLineLinkType.BILL, + "amount": Decimal("-15.38"), + "currency_rate": Decimal("1"), + "id": "3", + }, + ], + }, + ], + "metadata": { + "is_deleted": True, + }, + "modified_date": "2023-01-05T12:33:25.339Z", + "note": "note - billpayment on 20230220 of 15.38", + "payment_method_ref": { + "id": "string", + "name": "string", + }, + "reference": "reference 20230220 15.38", + "source_modified_date": "2023-01-05T12:33:25.339Z", + "supplier_ref": { + "id": "SUPP1", + "supplier_name": "string", + }, + "total_amount": Decimal("15.38"), + }, +}) + +if res is not None: + # handle response + pass + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | +| `request` | [operations.CreateBillPaymentRequest](../../models/operations/createbillpaymentrequest.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.CreateBillPaymentResponse](../../models/shared/createbillpaymentresponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| -------------------------------------- | -------------------------------------- | -------------------------------------- | +| errors.ErrorMessage | 400, 401, 402, 403, 404, 429, 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## delete + +The *Delete bill payment* endpoint allows you to delete a specified bill payment from an accounting software. + +[Bill payments](https://docs.codat.io/sync-for-payables-api#/schemas/BillPayment) are an allocation of money within any Accounts Payable account. + +### Process +1. Pass the `{billPaymentId}` to the *Delete bill payment* endpoint and store the `pushOperationKey` returned. +2. Check the status of the delete operation by checking the status of the push operation either via + 1. [Push operation webhook](https://docs.codat.io/introduction/webhooks/core-rules-types#push-operation-status-has-changed) (advised), + 2. [Push operation status endpoint](https://docs.codat.io/sync-for-payables-api#/operations/get-push-operation). + + A `Success` status indicates that the bill payment object was deleted from the accounting software. +3. (Optional) Check that the bill payment was deleted from the accounting software. + +### Effect on related objects +Be aware that deleting a bill payment from an accounting software might cause related objects to be modified. + +## Integration specifics +Integrations that support soft delete do not permanently delete the object in the accounting software. + +| Integration | Soft Delete | Details | +|-------------|-------------|---------| +| QuickBooks Online | No | - +| QuickBooks Desktop | No | - +| Oracle NetSuite | No | See [here](/integrations/accounting/netsuite/accounting-netsuite-how-deleting-bill-payments-works) to learn more. +| Xero | Yes | - +| Sage Intacct | No | Some bill payments in Sage Intacct can only be deleted, whilst others can only be voided. Codat have applied logic to handle this complexity. + +> **Supported integrations** +> +> This functionality is currently supported for our QuickBooks Online, QuickBooks Desktop, Oracle NetSuite, Xero and Sage Intacct integrations. + +### Example Usage + +```python +from codat_sync_for_payables_version_1 import CodatSyncPayables +from codat_sync_for_payables_version_1.models import shared + +s = CodatSyncPayables( + security=shared.Security( + auth_header="Basic BASE_64_ENCODED(API_KEY)", + ), +) + +res = s.bill_payments.delete(request={ + "bill_payment_id": "", + "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.DeleteBillPaymentRequest](../../models/operations/deletebillpaymentrequest.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.PushOperation](../../models/shared/pushoperation.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| --------------------------------- | --------------------------------- | --------------------------------- | +| errors.ErrorMessage | 401, 402, 403, 404, 429, 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## get + +The *Get bill payment* endpoint returns a single bill payment for a given `billPaymentId`. + +[Bill payments](https://docs.codat.io/sync-for-payables-api#/schemas/BillPayment) are an allocation of money within any Accounts Payable account. + +Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=billPayments) for integrations that support getting a specific bill payment. + +Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/sync-for-payables-api#/operations/refresh-company-data). + + +### Example Usage + +```python +from codat_sync_for_payables_version_1 import CodatSyncPayables +from codat_sync_for_payables_version_1.models import shared + +s = CodatSyncPayables( + security=shared.Security( + auth_header="Basic BASE_64_ENCODED(API_KEY)", + ), +) + +res = s.bill_payments.get(request={ + "bill_payment_id": "", + "company_id": "8a210b68-6988-11ed-a1eb-0242ac120002", +}) + +if res is not None: + # handle response + pass + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | +| `request` | [operations.GetBillPaymentsRequest](../../models/operations/getbillpaymentsrequest.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.BillPayment](../../models/shared/billpayment.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| -------------------------------------- | -------------------------------------- | -------------------------------------- | +| errors.ErrorMessage | 401, 402, 403, 404, 409, 429, 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## get_create_model + +The *Get create bill payment model* endpoint returns the expected data for the request payload when creating a [bill payment](https://docs.codat.io/sync-for-payables-api#/schemas/BillPayment) for a given company and integration. + +[Bill payments](https://docs.codat.io/sync-for-payables-api#/schemas/BillPayment) are an allocation of money within any Accounts Payable account. + +**Integration-specific behaviour** + +See the *response examples* for integration-specific indicative models. + +Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=billPayments) for integrations that support creating a bill payment. + + +### Example Usage + +```python +from codat_sync_for_payables_version_1 import CodatSyncPayables +from codat_sync_for_payables_version_1.models import shared + +s = CodatSyncPayables( + security=shared.Security( + auth_header="Basic BASE_64_ENCODED(API_KEY)", + ), +) + +res = s.bill_payments.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 + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | +| `request` | [operations.GetCreateBillPaymentModelRequest](../../models/operations/getcreatebillpaymentmodelrequest.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 | \*/\* | + +## list + +The *List bill payments* endpoint returns a list of [bill payments](https://docs.codat.io/sync-for-payables-api#/schemas/BillPayment) for a given company's connection. + +[Bill payments](https://docs.codat.io/sync-for-payables-api#/schemas/BillPayment) are an allocation of money within any Accounts Payable account. + +Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/sync-for-payables-api#/operations/refresh-company-data). + + +### Example Usage + +```python +from codat_sync_for_payables_version_1 import CodatSyncPayables +from codat_sync_for_payables_version_1.models import shared + +s = CodatSyncPayables( + security=shared.Security( + auth_header="Basic BASE_64_ENCODED(API_KEY)", + ), +) + +res = s.bill_payments.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 + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | +| `request` | [operations.ListBillPaymentsRequest](../../models/operations/listbillpaymentsrequest.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.BillPayments](../../models/shared/billpayments.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 | \*/\* | \ No newline at end of file diff --git a/previous-versions/sync-for-payables-version-1/docs/sdks/bills/README.md b/previous-versions/sync-for-payables-version-1/docs/sdks/bills/README.md index 5ab162b2f..c4a5a8757 100644 --- a/previous-versions/sync-for-payables-version-1/docs/sdks/bills/README.md +++ b/previous-versions/sync-for-payables-version-1/docs/sdks/bills/README.md @@ -3,46 +3,544 @@ ## Overview -Bills +Get, create, and update Bills. ### Available Operations +* [create](#create) - Create bill +* [delete](#delete) - Delete bill +* [delete_attachment](#delete_attachment) - Delete bill attachment +* [download_attachment](#download_attachment) - Download bill attachment +* [get](#get) - Get bill +* [get_attachment](#get_attachment) - Get bill attachment +* [get_create_update_model](#get_create_update_model) - Get create/update bill model * [list](#list) - List bills +* [list_attachments](#list_attachments) - List bill attachments +* [update](#update) - Update bill +* [upload_attachment](#upload_attachment) - Upload bill attachment -## list +## create + +The *Create bill* endpoint creates a new [bill](https://docs.codat.io/sync-for-payables-api#/schemas/Bill) for a given company's connection. + +[Bills](https://docs.codat.io/sync-for-payables-api#/schemas/Bill) are invoices that represent the SMB's financial obligations to their supplier for a purchase of goods or services. + +**Integration-specific behaviour** + +Required data may vary by integration. To see what data to post, first call [Get create/update bill model](https://docs.codat.io/sync-for-payables-api#/operations/get-create-update-bills-model). + +Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=bills) for integrations that support creating a bill. + + +### Example Usage + +```python +from codat_sync_for_payables_version_1 import CodatSyncPayables +from codat_sync_for_payables_version_1.models import shared +from decimal import Decimal + +s = CodatSyncPayables( + security=shared.Security( + auth_header="Basic BASE_64_ENCODED(API_KEY)", + ), +) + +res = s.bills.create(request={ + "company_id": "8a210b68-6988-11ed-a1eb-0242ac120002", + "connection_id": "2e9d2c44-f675-40ba-8049-353bfcb5e171", + "bill": { + "issue_date": "2023-03-08T09:21:18.558Z", + "status": shared.BillStatus.OPEN, + "sub_total": Decimal("3.25"), + "tax_amount": Decimal("0"), + "total_amount": Decimal("3.25"), + "amount_due": Decimal("115.899999984"), + "currency": "USD", + "currency_rate": Decimal("1"), + "due_date": "2023-03-14T09:21:18.558Z", + "line_items": [ + { + "quantity": Decimal("2"), + "unit_amount": Decimal("1.625"), + "description": "line 1 description", + "discount_amount": Decimal("0"), + "discount_percentage": Decimal("0"), + "is_direct_cost": True, + "item_ref": { + "id": "80000001-1674566705", + "name": "string", + }, + "sub_total": Decimal("3.25"), + "tax_amount": Decimal("0"), + "total_amount": Decimal("3.25"), + "tracking": { + "category_refs": [ + { + "id": "80000001-1674553252", + "name": "Class 1", + }, + ], + "is_billed_to": shared.BilledToType.UNKNOWN, + "is_rebilled_to": shared.BilledToType.CUSTOMER, + "customer_ref": { + "id": "80000002-1674552702", + "company_name": "string", + }, + "project_ref": { + "id": "string", + "name": "string", + }, + }, + "tracking_category_refs": [ + { + "id": "80000003-1674553958", + "name": "Class 2", + }, + ], + }, + ], + "modified_date": "2022-10-23T00:00:00Z", + "note": "note", + "payment_allocations": [ + { + "allocation": { + "allocated_on_date": "2022-10-23T00:00:00Z", + "currency": "USD", + }, + "payment": { + "currency": "USD", + "paid_on_date": "2022-10-23T00:00:00Z", + }, + }, + ], + "purchase_order_refs": [ + { + "id": "string", + "purchase_order_number": "string", + }, + ], + "reference": "20230308 15.16", + "source_modified_date": "2022-10-23T00:00:00Z", + "supplier_ref": { + "id": "80000001-1671793885", + "supplier_name": "string", + }, + "withholding_tax": [ + { + "amount": Decimal("0"), + "name": "string", + }, + ], + }, +}) + +if res is not None: + # handle response + pass + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | +| `request` | [operations.CreateBillRequest](../../models/operations/createbillrequest.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.CreateBillResponse](../../models/shared/createbillresponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| -------------------------------------- | -------------------------------------- | -------------------------------------- | +| errors.ErrorMessage | 400, 401, 402, 403, 404, 429, 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## delete + +The *Delete bill* endpoint allows you to delete a specified bill from an accounting software. + +[Bills](https://docs.codat.io/sync-for-payables-api#/schemas/Bill) are itemized records of goods received or services provided to the SMB. + +### Process +1. Pass the `{billId}` to the *Delete bill* endpoint and store the `pushOperationKey` returned. +2. Check the status of the delete operation by checking the status of the push operation either via + 1. [Push operation webhook](https://docs.codat.io/introduction/webhooks/core-rules-types#push-operation-status-has-changed) (advised), + 2. [Push operation status endpoint](https://docs.codat.io/sync-for-payables-api#/operations/get-push-operation). + + A `Success` status indicates that the bill object was deleted from the accounting software. +3. (Optional) Check that the bill was deleted from the accounting software. + +### Effect on related objects + +Be aware that deleting a bill from an accounting software might cause related objects to be modified. For example, if you delete a paid bill in QuickBooks Online or QuickBooks Desktop, the bill is deleted but the bill payment against that bill is not. The bill payment is converted to a payment on account. + +## Integration specifics +Integrations that support soft delete do not permanently delete the object in the accounting software. + +| Integration | Soft Delete | Details | +|-------------|-------------|--------------------------------------------------------------------------------------------------------------| +| QuickBooks Online | No | - | +| QuickBooks Desktop | No | - | +| Oracle NetSuite | No | When deleting a bill that's already linked to a bill payment, you must delete the linked bill payment first. | | +| Sage Intacct | No | When deleting a bill that's already linked to a bill payment, you must delete the linked bill payment first. | +| Xero | No | Draft bills will be deleted. Open bills will be voided instead of deleted since Xero only allows voiding a bill once it's been posted. When deleting a bill that's already linked to a bill payment, you must delete the linked bill payment first. | + +> **Supported Integrations** +> +> This functionality is currently supported for our QuickBooks Online, QuickBooks Desktop, Xero, Oracle NetSuite and Sage Intacct integrations. + +### Example Usage + +```python +from codat_sync_for_payables_version_1 import CodatSyncPayables +from codat_sync_for_payables_version_1.models import shared + +s = CodatSyncPayables( + security=shared.Security( + auth_header="Basic BASE_64_ENCODED(API_KEY)", + ), +) + +res = s.bills.delete(request={ + "bill_id": "7110701885", + "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.DeleteBillRequest](../../models/operations/deletebillrequest.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.PushOperation](../../models/shared/pushoperation.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| --------------------------------- | --------------------------------- | --------------------------------- | +| errors.ErrorMessage | 401, 402, 403, 404, 429, 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## delete_attachment + +The *Delete bill attachment* endpoint allows you to delete a specified bill attachment from an accounting software. + +[Bills](https://docs.codat.io/sync-for-payables-api#/schemas/Bill) are invoices +that represent the SMB's financial obligations to their supplier for a +purchase of goods or services. + +### Process + +1. Pass the `{billId}` and `{attachmentId}` to the *Delete bill attachment* endpoint and store the `pushOperationKey` returned. + +2. Check the status of the delete operation by checking the status of push operation either via + +1. [Push operation webhook](https://docs.codat.io/introduction/webhookscore-rules-types#push-operation-status-has-changed) (advised), + +2. [Push operation status endpoint](https://docs.codat.io/sync-for-payables-api#/operations/get-push-operation). A `Success` status indicates that the bill attachment object was deleted from the accounting software. + +3. (Optional) Check that the bill attachment was deleted from the accounting software. + +>**Supported Integrations** +> +>This functionality is currently only supported for our QuickBooks Online integration. + +### Example Usage + +```python +from codat_sync_for_payables_version_1 import CodatSyncPayables +from codat_sync_for_payables_version_1.models import shared + +s = CodatSyncPayables( + security=shared.Security( + auth_header="Basic BASE_64_ENCODED(API_KEY)", + ), +) + +res = s.bills.delete_attachment(request={ + "attachment_id": "8a210b68-6988-11ed-a1eb-0242ac120002", + "bill_id": "9wg4lep4ush5cxs79pl8sozmsndbaukll3ind4g7buqbm1h2", + "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.DeleteBillAttachmentRequest](../../models/operations/deletebillattachmentrequest.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.PushOperation](../../models/shared/pushoperation.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| --------------------------------- | --------------------------------- | --------------------------------- | +| errors.ErrorMessage | 401, 402, 403, 404, 429, 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## download_attachment + +The *Download bill attachment* endpoint downloads a specific attachment for a given `billId` and `attachmentId`. + +[Bills](https://docs.codat.io/sync-for-payables-api#/schemas/Bill) are invoices that represent the SMB's financial obligations to their supplier for a purchase of goods or services. + +Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=bills) for integrations that support downloading a bill attachment. + + +### Example Usage + +```python +from codat_sync_for_payables_version_1 import CodatSyncPayables +from codat_sync_for_payables_version_1.models import shared + +s = CodatSyncPayables( + security=shared.Security( + auth_header="Basic BASE_64_ENCODED(API_KEY)", + ), +) + +res = s.bills.download_attachment(request={ + "attachment_id": "8a210b68-6988-11ed-a1eb-0242ac120002", + "bill_id": "EILBDVJVNUAGVKRQ", + "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.DownloadBillAttachmentRequest](../../models/operations/downloadbillattachmentrequest.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 + +**[httpx.Response](../../models/.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| --------------------------------- | --------------------------------- | --------------------------------- | +| errors.ErrorMessage | 401, 402, 403, 404, 429, 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## get + +The *Get bill* endpoint returns a single bill for a given `billId`. + +[Bills](https://docs.codat.io/sync-for-payables-api#/schemas/Bill) are invoices that represent the SMB's financial obligations to their supplier for a purchase of goods or services. + +Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=bills) for integrations that support getting a specific bill. + +Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/sync-for-payables-api#/operations/refresh-company-data). + + +### Example Usage + +```python +from codat_sync_for_payables_version_1 import CodatSyncPayables +from codat_sync_for_payables_version_1.models import shared + +s = CodatSyncPayables( + security=shared.Security( + auth_header="Basic BASE_64_ENCODED(API_KEY)", + ), +) + +res = s.bills.get(request={ + "bill_id": "7110701885", + "company_id": "8a210b68-6988-11ed-a1eb-0242ac120002", +}) + +if res is not None: + # handle response + pass + +``` + +### Parameters -The *List bills* endpoint returns a list of [bills](https://docs.codat.io/sync-for-payables-api#/schemas/Bill) for a given company's connection. +| Parameter | Type | Required | Description | +| ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | +| `request` | [operations.GetBillRequest](../../models/operations/getbillrequest.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. | -By default, the endpoint will return all bills irrespective of payment status. To filter outstanding bills use the `outstandingBills=true` query parameter to return all unpaid and partially paid bills. +### Response + +**[shared.Bill](../../models/shared/bill.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| -------------------------------------- | -------------------------------------- | -------------------------------------- | +| errors.ErrorMessage | 401, 402, 403, 404, 409, 429, 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## get_attachment + +The *Get bill attachment* endpoint returns a specific attachment for a given `billId` and `attachmentId`. [Bills](https://docs.codat.io/sync-for-payables-api#/schemas/Bill) are invoices that represent the SMB's financial obligations to their supplier for a purchase of goods or services. - + +Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=bills) for integrations that support getting a bill attachment. + ### Example Usage ```python -import codatsyncpayables -from codatsyncpayables.models import operations, shared +from codat_sync_for_payables_version_1 import CodatSyncPayables +from codat_sync_for_payables_version_1.models import shared -s = codatsyncpayables.CodatSyncPayables( +s = CodatSyncPayables( security=shared.Security( auth_header="Basic BASE_64_ENCODED(API_KEY)", ), ) -req = operations.ListBillsRequest( - company_id='8a210b68-6988-11ed-a1eb-0242ac120002', - connection_id='2e9d2c44-f675-40ba-8049-353bfcb5e171', - page=1, - page_size=100, - source_modified_date='2022-10-23T00:00:00Z', +res = s.bills.get_attachment(request={ + "attachment_id": "8a210b68-6988-11ed-a1eb-0242ac120002", + "bill_id": "EILBDVJVNUAGVKRQ", + "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.GetBillAttachmentRequest](../../models/operations/getbillattachmentrequest.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.Attachment](../../models/shared/attachment.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_update_model + +The *Get create/update bill model* endpoint returns the expected data for the request payload when creating and updating a [bill](https://docs.codat.io/sync-for-payables-api#/schemas/Bill) for a given company and integration. + +[Bills](https://docs.codat.io/sync-for-payables-api#/schemas/Bill) are invoices that represent the SMB's financial obligations to their supplier for a purchase of goods or services. + +**Integration-specific behaviour** + +See the *response examples* for integration-specific indicative models. + +Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=bills) for integrations that support creating and updating a bill. + + +### Example Usage + +```python +from codat_sync_for_payables_version_1 import CodatSyncPayables +from codat_sync_for_payables_version_1.models import shared + +s = CodatSyncPayables( + security=shared.Security( + auth_header="Basic BASE_64_ENCODED(API_KEY)", + ), ) -res = s.bills.list(req) +res = s.bills.get_create_update_model(request={ + "company_id": "8a210b68-6988-11ed-a1eb-0242ac120002", + "connection_id": "2e9d2c44-f675-40ba-8049-353bfcb5e171", +}) -if res.bills is not None: +if res is not None: # handle response pass + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | +| `request` | [operations.GetCreateUpdateBillModelRequest](../../models/operations/getcreateupdatebillmodelrequest.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 | \*/\* | + +## list + +The *List bills* endpoint returns a list of [bills](https://docs.codat.io/sync-for-payables-api#/schemas/Bill) for a given company's connection. + +[Bills](https://docs.codat.io/sync-for-payables-api#/schemas/Bill) are invoices that represent the SMB's financial obligations to their supplier for a purchase of goods or services. + +### Example Usage + +```python +from codat_sync_for_payables_version_1 import CodatSyncPayables +from codat_sync_for_payables_version_1.models import shared + +s = CodatSyncPayables( + security=shared.Security( + auth_header="Basic BASE_64_ENCODED(API_KEY)", + ), +) + +res = s.bills.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 + ``` ### Parameters @@ -52,13 +550,199 @@ if res.bills is not None: | `request` | [operations.ListBillsRequest](../../models/operations/listbillsrequest.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.Bills](../../models/shared/bills.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 | \*/\* | + +## list_attachments + +The *List bill attachments* endpoint returns a list of attachments available to download for a given `billId`. + +[Bills](https://docs.codat.io/sync-for-payables-api#/schemas/Bill) are invoices that represent the SMB's financial obligations to their supplier for a purchase of goods or services. + +### Example Usage + +```python +from codat_sync_for_payables_version_1 import CodatSyncPayables +from codat_sync_for_payables_version_1.models import shared + +s = CodatSyncPayables( + security=shared.Security( + auth_header="Basic BASE_64_ENCODED(API_KEY)", + ), +) + +res = s.bills.list_attachments(request={ + "bill_id": "EILBDVJVNUAGVKRQ", + "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.ListBillAttachmentsRequest](../../models/operations/listbillattachmentsrequest.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.ListBillsResponse](../../models/operations/listbillsresponse.md)** +**[shared.Attachments](../../models/shared/attachments.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| -------------------------------------- | -------------------------------------- | -------------------------------------- | +| errors.ErrorMessage | 401, 402, 403, 404, 409, 429, 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## update + +The *Update bill* endpoint updates an existing [bill](https://docs.codat.io/sync-for-payables-api#/schemas/Bill) for a given company's connection. + +[Bills](https://docs.codat.io/sync-for-payables-api#/schemas/Bill) are invoices that represent the SMB's financial obligations to their supplier for a purchase of goods or services. + +**Integration-specific behaviour** + +Required data may vary by integration. To see what data to post, first call [Get create/update bill model](https://docs.codat.io/sync-for-payables-api#/operations/get-create-update-bills-model). + +Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=bills) for integrations that support creating a bill. + + +### Example Usage + +```python +from codat_sync_for_payables_version_1 import CodatSyncPayables +from codat_sync_for_payables_version_1.models import shared +from decimal import Decimal + +s = CodatSyncPayables( + security=shared.Security( + auth_header="Basic BASE_64_ENCODED(API_KEY)", + ), +) + +res = s.bills.update(request={ + "bill_id": "7110701885", + "company_id": "8a210b68-6988-11ed-a1eb-0242ac120002", + "connection_id": "2e9d2c44-f675-40ba-8049-353bfcb5e171", + "bill": { + "issue_date": "2022-10-23T00:00:00Z", + "status": shared.BillStatus.DRAFT, + "sub_total": Decimal("3024.61"), + "tax_amount": Decimal("4643.85"), + "total_amount": Decimal("7712.03"), + "currency": "EUR", + "due_date": "2022-10-23T00:00:00Z", + "modified_date": "2022-10-23T00:00:00Z", + "payment_allocations": [ + { + "allocation": { + "allocated_on_date": "2022-10-23T00:00:00Z", + "currency": "EUR", + }, + "payment": { + "currency": "GBP", + "paid_on_date": "2022-10-23T00:00:00Z", + }, + }, + { + "allocation": { + "allocated_on_date": "2022-10-23T00:00:00Z", + "currency": "GBP", + }, + "payment": { + "currency": "GBP", + "paid_on_date": "2022-10-23T00:00:00Z", + }, + }, + ], + "source_modified_date": "2022-10-23T00:00:00Z", + }, +}) + +if res is not None: + # handle response + pass + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | +| `request` | [operations.UpdateBillRequest](../../models/operations/updatebillrequest.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.UpdateBillResponse](../../models/shared/updatebillresponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| -------------------------------------- | -------------------------------------- | -------------------------------------- | +| errors.ErrorMessage | 400, 401, 402, 403, 404, 429, 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## upload_attachment + +The *Upload bill attachment* endpoint uploads an attachment and assigns it against a specific `billId`. + +[Bills](https://docs.codat.io/sync-for-payables-api#/schemas/Bill) are invoices that represent the SMB's financial obligations to their supplier for a purchase of goods or services. + +**Integration-specific behaviour** + +For more details on supported file types by integration see [Attachments](https://docs.codat.io/sync-for-payables-api#/schemas/Attachment). + +Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=bills) for integrations that support uploading a bill attachment. + + +### Example Usage + +```python +from codat_sync_for_payables_version_1 import CodatSyncPayables +from codat_sync_for_payables_version_1.models import shared + +s = CodatSyncPayables( + security=shared.Security( + auth_header="Basic BASE_64_ENCODED(API_KEY)", + ), +) + +s.bills.upload_attachment(request={ + "bill_id": "EILBDVJVNUAGVKRQ", + "company_id": "8a210b68-6988-11ed-a1eb-0242ac120002", + "connection_id": "2e9d2c44-f675-40ba-8049-353bfcb5e171", +}) + +# Use the SDK ... + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | +| `request` | [operations.UploadBillAttachmentRequest](../../models/operations/uploadbillattachmentrequest.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. | + ### Errors -| Error Object | Status Code | Content Type | -| ----------------------------------- | ----------------------------------- | ----------------------------------- | -| errors.ErrorMessage | 400,401,402,403,404,409,429,500,503 | application/json | -| errors.SDKError | 4x-5xx | */* | +| Error Type | Status Code | Content Type | +| -------------------------------------- | -------------------------------------- | -------------------------------------- | +| errors.ErrorMessage | 400, 401, 402, 403, 404, 429, 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/previous-versions/sync-for-payables-version-1/docs/sdks/codatsyncpayables/README.md b/previous-versions/sync-for-payables-version-1/docs/sdks/codatsyncpayables/README.md index 7df99c035..9a8b00de8 100644 --- a/previous-versions/sync-for-payables-version-1/docs/sdks/codatsyncpayables/README.md +++ b/previous-versions/sync-for-payables-version-1/docs/sdks/codatsyncpayables/README.md @@ -1,6 +1,5 @@ # CodatSyncPayables SDK - ## Overview Sync for Payables: The API for Sync for Payables. @@ -10,26 +9,25 @@ Sync for Payables is an API and a set of supporting tools built to help integrat [Explore product](https://docs.codat.io/payables/overview) | [See OpenAPI spec](https://github.com/codatio/oas) --- - + ## Endpoints -| Endpoints | Description | -|:---------------------|:-----------------------------------------------------------------------------------------------------------| -| Companies | Create and manage your SMB users' companies. | -| Connections | Create new and manage existing data connections for a company. | -| Accounts | Get, create, and update Accounts | -| Bills | Get, create, and update Bills | -| Bill credit notes | Get, create, and update Bill credit notes | -| Bill payments | Get, create, and update Bill payments | -| Journals | Get, create, and update Journals | -| Journal entries | Get, create, and update Journal entries | -| Payment methods | Get, create, and update Payment methods | -| Suppliers | Get, create, and update Suppliers | -| Tax rates | Get, create, and update Tax rates | -| Tracking categories | Get, create, and update Tracking categories | -| Push operations | View historic push operations | -| Company info | View company profile from the source platform. | -| Manage data | Control how data is retrieved from an integration. | - -### Available Operations - +| Endpoints | Description | +| :- |:- | +| Companies | Create and manage your SMB users' companies. | +| Connections | Create new and manage existing data connections for a company. | +| Accounts | Get, create, and update Accounts. | +| Bank accounts | Get, create, and update Bank accounts. | +| Bills | Get, create, and update Bills. | +| Bill credit notes | Get, create, and update Bill credit notes. | +| Bill payments | Get, create, and update Bill payments. | +| Journals | Get, create, and update Journals. | +| Journal entries | Get, create, and update Journal entries. | +| Payment methods | Get, create, and update Payment methods. | +| Suppliers | Get, create, and update Suppliers. | +| Tax rates | Get, create, and update Tax rates. | +| Tracking categories | Get, create, and update Tracking categories. | +| Company info | View company profile from the source platform. | +| Push operations | View historic push operations. | +| Manage data | Control how data is retrieved from an integration. | + \ No newline at end of file diff --git a/previous-versions/sync-for-payables-version-1/docs/sdks/companies/README.md b/previous-versions/sync-for-payables-version-1/docs/sdks/companies/README.md index 8ce00967f..7c99d7f61 100644 --- a/previous-versions/sync-for-payables-version-1/docs/sdks/companies/README.md +++ b/previous-versions/sync-for-payables-version-1/docs/sdks/companies/README.md @@ -3,7 +3,7 @@ ## Overview -Create and manage your Codat companies. +Create and manage your SMB users' companies. ### Available Operations @@ -25,25 +25,24 @@ If forbidden characters (see `name` pattern) are present in the request, a compa ### Example Usage ```python -import codatsyncpayables -from codatsyncpayables.models import shared +from codat_sync_for_payables_version_1 import CodatSyncPayables +from codat_sync_for_payables_version_1.models import shared -s = codatsyncpayables.CodatSyncPayables( +s = CodatSyncPayables( security=shared.Security( auth_header="Basic BASE_64_ENCODED(API_KEY)", ), ) -req = shared.CompanyRequestBody( - name='Bank of Dave', - description='Requested early access to the new financing scheme.', -) - -res = s.companies.create(req) +res = s.companies.create(request={ + "name": "Technicalium", + "description": "Requested early access to the new financing scheme.", +}) -if res.company is not None: +if res is not None: # handle response pass + ``` ### Parameters @@ -53,16 +52,16 @@ if res.company is not None: | `request` | [shared.CompanyRequestBody](../../models/shared/companyrequestbody.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.CreateCompanyResponse](../../models/operations/createcompanyresponse.md)** +**[shared.Company](../../models/shared/company.md)** + ### Errors -| Error Object | Status Code | Content Type | -| --------------------------- | --------------------------- | --------------------------- | -| errors.ErrorMessage | 400,401,402,403,429,500,503 | application/json | -| errors.SDKError | 4x-5xx | */* | +| Error Type | Status Code | Content Type | +| --------------------------------- | --------------------------------- | --------------------------------- | +| errors.ErrorMessage | 400, 401, 402, 403, 429, 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | ## delete @@ -75,24 +74,21 @@ Each company can have multiple [connections](https://docs.codat.io/sync-for-paya ### Example Usage ```python -import codatsyncpayables -from codatsyncpayables.models import operations, shared +from codat_sync_for_payables_version_1 import CodatSyncPayables +from codat_sync_for_payables_version_1.models import shared -s = codatsyncpayables.CodatSyncPayables( +s = CodatSyncPayables( security=shared.Security( auth_header="Basic BASE_64_ENCODED(API_KEY)", ), ) -req = operations.DeleteCompanyRequest( - company_id='8a210b68-6988-11ed-a1eb-0242ac120002', -) +s.companies.delete(request={ + "company_id": "8a210b68-6988-11ed-a1eb-0242ac120002", +}) -res = s.companies.delete(req) +# Use the SDK ... -if res.status_code == 200: - # handle response - pass ``` ### Parameters @@ -102,16 +98,12 @@ if res.status_code == 200: | `request` | [operations.DeleteCompanyRequest](../../models/operations/deletecompanyrequest.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.DeleteCompanyResponse](../../models/operations/deletecompanyresponse.md)** ### Errors -| Error Object | Status Code | Content Type | -| --------------------------- | --------------------------- | --------------------------- | -| errors.ErrorMessage | 401,402,403,404,429,500,503 | application/json | -| errors.SDKError | 4x-5xx | */* | +| Error Type | Status Code | Content Type | +| --------------------------------- | --------------------------------- | --------------------------------- | +| errors.ErrorMessage | 401, 402, 403, 404, 429, 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | ## get @@ -124,24 +116,23 @@ Each company can have multiple [connections](https://docs.codat.io/sync-for-paya ### Example Usage ```python -import codatsyncpayables -from codatsyncpayables.models import operations, shared +from codat_sync_for_payables_version_1 import CodatSyncPayables +from codat_sync_for_payables_version_1.models import shared -s = codatsyncpayables.CodatSyncPayables( +s = CodatSyncPayables( security=shared.Security( auth_header="Basic BASE_64_ENCODED(API_KEY)", ), ) -req = operations.GetCompanyRequest( - company_id='8a210b68-6988-11ed-a1eb-0242ac120002', -) - -res = s.companies.get(req) +res = s.companies.get(request={ + "company_id": "8a210b68-6988-11ed-a1eb-0242ac120002", +}) -if res.company is not None: +if res is not None: # handle response pass + ``` ### Parameters @@ -151,16 +142,16 @@ if res.company is not None: | `request` | [operations.GetCompanyRequest](../../models/operations/getcompanyrequest.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.GetCompanyResponse](../../models/operations/getcompanyresponse.md)** +**[shared.Company](../../models/shared/company.md)** + ### Errors -| Error Object | Status Code | Content Type | -| --------------------------- | --------------------------- | --------------------------- | -| errors.ErrorMessage | 401,402,403,404,429,500,503 | application/json | -| errors.SDKError | 4x-5xx | */* | +| Error Type | Status Code | Content Type | +| --------------------------------- | --------------------------------- | --------------------------------- | +| errors.ErrorMessage | 401, 402, 403, 404, 429, 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | ## list @@ -172,26 +163,26 @@ Each company can have multiple [connections](https://docs.codat.io/sync-for-paya ### Example Usage ```python -import codatsyncpayables -from codatsyncpayables.models import operations, shared +from codat_sync_for_payables_version_1 import CodatSyncPayables +from codat_sync_for_payables_version_1.models import shared -s = codatsyncpayables.CodatSyncPayables( +s = CodatSyncPayables( security=shared.Security( auth_header="Basic BASE_64_ENCODED(API_KEY)", ), ) -req = operations.ListCompaniesRequest( - order_by='-modifiedDate', - page=1, - page_size=100, -) +res = s.companies.list(request={ + "order_by": "-modifiedDate", + "page": 1, + "page_size": 100, + "query": "id=e3334455-1aed-4e71-ab43-6bccf12092ee", +}) -res = s.companies.list(req) - -if res.companies is not None: +if res is not None: # handle response pass + ``` ### Parameters @@ -201,21 +192,20 @@ if res.companies is not None: | `request` | [operations.ListCompaniesRequest](../../models/operations/listcompaniesrequest.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.ListCompaniesResponse](../../models/operations/listcompaniesresponse.md)** +**[shared.Companies](../../models/shared/companies.md)** + ### Errors -| Error Object | Status Code | Content Type | -| ------------------------------- | ------------------------------- | ------------------------------- | -| errors.ErrorMessage | 400,401,402,403,404,429,500,503 | application/json | -| errors.SDKError | 4x-5xx | */* | +| Error Type | Status Code | Content Type | +| -------------------------------------- | -------------------------------------- | -------------------------------------- | +| errors.ErrorMessage | 400, 401, 402, 403, 404, 429, 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | ## update Use the *Update company* endpoint to update both the name and description of the company. -If you use [groups](https://docs.codat.io/sync-for-payables-api#/schemas/Group) to manage a set of companies, use the [Add company](https://docs.codat.io/sync-for-payables-api#/operations/add-company-to-group) or [Remove company](https://docs.codat.io/sync-for-payables-api#/operations/remove-company-from-group) endpoints to add or remove a company from a group. A [company](https://docs.codat.io/sync-for-payables-api#/schemas/Company) represents a business sharing access to their data. Each company can have multiple [connections](https://docs.codat.io/sync-for-payables-api#/schemas/Connection) to different data sources, such as one connection to Xero for accounting data, two connections to Plaid for two bank accounts, and a connection to Zettle for POS data. @@ -223,24 +213,27 @@ Each company can have multiple [connections](https://docs.codat.io/sync-for-paya ### Example Usage ```python -import codatsyncpayables -from codatsyncpayables.models import operations, shared +from codat_sync_for_payables_version_1 import CodatSyncPayables +from codat_sync_for_payables_version_1.models import shared -s = codatsyncpayables.CodatSyncPayables( +s = CodatSyncPayables( security=shared.Security( auth_header="Basic BASE_64_ENCODED(API_KEY)", ), ) -req = operations.UpdateCompanyRequest( - company_id='8a210b68-6988-11ed-a1eb-0242ac120002', -) - -res = s.companies.update(req) +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.company is not None: +if res is not None: # handle response pass + ``` ### Parameters @@ -250,13 +243,13 @@ if res.company is not None: | `request` | [operations.UpdateCompanyRequest](../../models/operations/updatecompanyrequest.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.UpdateCompanyResponse](../../models/operations/updatecompanyresponse.md)** +**[shared.Company](../../models/shared/company.md)** + ### Errors -| Error Object | Status Code | Content Type | -| --------------------------- | --------------------------- | --------------------------- | -| errors.ErrorMessage | 401,402,403,404,429,500,503 | application/json | -| errors.SDKError | 4x-5xx | */* | +| Error Type | Status Code | Content Type | +| --------------------------------- | --------------------------------- | --------------------------------- | +| errors.ErrorMessage | 401, 402, 403, 404, 429, 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/previous-versions/sync-for-payables-version-1/docs/sdks/companyinfo/README.md b/previous-versions/sync-for-payables-version-1/docs/sdks/companyinfo/README.md new file mode 100644 index 000000000..41736e0b8 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/docs/sdks/companyinfo/README.md @@ -0,0 +1,54 @@ +# CompanyInfo +(*company_info*) + +## Overview + +View company profile from the source platform. + +### Available Operations + +* [get_accounting_profile](#get_accounting_profile) - Get company accounting profile + +## get_accounting_profile + +Gets the latest basic info for a company. + +### Example Usage + +```python +from codat_sync_for_payables_version_1 import CodatSyncPayables +from codat_sync_for_payables_version_1.models import shared + +s = CodatSyncPayables( + security=shared.Security( + auth_header="Basic BASE_64_ENCODED(API_KEY)", + ), +) + +res = s.company_info.get_accounting_profile(request={ + "company_id": "8a210b68-6988-11ed-a1eb-0242ac120002", +}) + +if res is not None: + # handle response + pass + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | +| `request` | [operations.GetAccountingProfileRequest](../../models/operations/getaccountingprofilerequest.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.CompanyInfo](../../models/shared/companyinfo.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| -------------------------------------- | -------------------------------------- | -------------------------------------- | +| errors.ErrorMessage | 401, 402, 403, 404, 409, 429, 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/previous-versions/sync-for-payables-version-1/docs/sdks/connections/README.md b/previous-versions/sync-for-payables-version-1/docs/sdks/connections/README.md index 17a2d8878..a397d5456 100644 --- a/previous-versions/sync-for-payables-version-1/docs/sdks/connections/README.md +++ b/previous-versions/sync-for-payables-version-1/docs/sdks/connections/README.md @@ -3,7 +3,7 @@ ## Overview -Manage your companies' data connections. +Create new and manage existing data connections for a company. ### Available Operations @@ -22,24 +22,26 @@ Use the [List Integrations](https://docs.codat.io/sync-for-payables-api#/operati ### Example Usage ```python -import codatsyncpayables -from codatsyncpayables.models import operations, shared +from codat_sync_for_payables_version_1 import CodatSyncPayables +from codat_sync_for_payables_version_1.models import shared -s = codatsyncpayables.CodatSyncPayables( +s = CodatSyncPayables( security=shared.Security( auth_header="Basic BASE_64_ENCODED(API_KEY)", ), ) -req = operations.CreateConnectionRequest( - company_id='8a210b68-6988-11ed-a1eb-0242ac120002', -) - -res = s.connections.create(req) +res = s.connections.create(request={ + "company_id": "8a210b68-6988-11ed-a1eb-0242ac120002", + "request_body": { + "platform_key": "gbol", + }, +}) -if res.connection is not None: +if res is not None: # handle response pass + ``` ### Parameters @@ -49,16 +51,16 @@ if res.connection is not None: | `request` | [operations.CreateConnectionRequest](../../models/operations/createconnectionrequest.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.CreateConnectionResponse](../../models/operations/createconnectionresponse.md)** +**[shared.Connection](../../models/shared/connection.md)** + ### Errors -| Error Object | Status Code | Content Type | -| --------------------------- | --------------------------- | --------------------------- | -| errors.ErrorMessage | 401,402,403,404,429,500,503 | application/json | -| errors.SDKError | 4x-5xx | */* | +| Error Type | Status Code | Content Type | +| --------------------------------- | --------------------------------- | --------------------------------- | +| errors.ErrorMessage | 401, 402, 403, 404, 429, 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | ## delete @@ -68,25 +70,22 @@ This operation is not reversible. The end user would need to reauthorize a new d ### Example Usage ```python -import codatsyncpayables -from codatsyncpayables.models import operations, shared +from codat_sync_for_payables_version_1 import CodatSyncPayables +from codat_sync_for_payables_version_1.models import shared -s = codatsyncpayables.CodatSyncPayables( +s = CodatSyncPayables( security=shared.Security( auth_header="Basic BASE_64_ENCODED(API_KEY)", ), ) -req = operations.DeleteConnectionRequest( - company_id='8a210b68-6988-11ed-a1eb-0242ac120002', - connection_id='2e9d2c44-f675-40ba-8049-353bfcb5e171', -) +s.connections.delete(request={ + "company_id": "8a210b68-6988-11ed-a1eb-0242ac120002", + "connection_id": "2e9d2c44-f675-40ba-8049-353bfcb5e171", +}) -res = s.connections.delete(req) +# Use the SDK ... -if res.status_code == 200: - # handle response - pass ``` ### Parameters @@ -96,16 +95,12 @@ if res.status_code == 200: | `request` | [operations.DeleteConnectionRequest](../../models/operations/deleteconnectionrequest.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.DeleteConnectionResponse](../../models/operations/deleteconnectionresponse.md)** ### Errors -| Error Object | Status Code | Content Type | -| --------------------------- | --------------------------- | --------------------------- | -| errors.ErrorMessage | 401,402,403,404,429,500,503 | application/json | -| errors.SDKError | 4x-5xx | */* | +| Error Type | Status Code | Content Type | +| --------------------------------- | --------------------------------- | --------------------------------- | +| errors.ErrorMessage | 401, 402, 403, 404, 429, 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | ## get @@ -114,25 +109,24 @@ if res.status_code == 200: ### Example Usage ```python -import codatsyncpayables -from codatsyncpayables.models import operations, shared +from codat_sync_for_payables_version_1 import CodatSyncPayables +from codat_sync_for_payables_version_1.models import shared -s = codatsyncpayables.CodatSyncPayables( +s = CodatSyncPayables( security=shared.Security( auth_header="Basic BASE_64_ENCODED(API_KEY)", ), ) -req = operations.GetConnectionRequest( - company_id='8a210b68-6988-11ed-a1eb-0242ac120002', - connection_id='2e9d2c44-f675-40ba-8049-353bfcb5e171', -) - -res = s.connections.get(req) +res = s.connections.get(request={ + "company_id": "8a210b68-6988-11ed-a1eb-0242ac120002", + "connection_id": "2e9d2c44-f675-40ba-8049-353bfcb5e171", +}) -if res.connection is not None: +if res is not None: # handle response pass + ``` ### Parameters @@ -142,16 +136,16 @@ if res.connection is not None: | `request` | [operations.GetConnectionRequest](../../models/operations/getconnectionrequest.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.GetConnectionResponse](../../models/operations/getconnectionresponse.md)** +**[shared.Connection](../../models/shared/connection.md)** + ### Errors -| Error Object | Status Code | Content Type | -| --------------------------- | --------------------------- | --------------------------- | -| errors.ErrorMessage | 401,402,403,404,429,500,503 | application/json | -| errors.SDKError | 4x-5xx | */* | +| Error Type | Status Code | Content Type | +| --------------------------------- | --------------------------------- | --------------------------------- | +| errors.ErrorMessage | 401, 402, 403, 404, 429, 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | ## list @@ -160,27 +154,27 @@ if res.connection is not None: ### Example Usage ```python -import codatsyncpayables -from codatsyncpayables.models import operations, shared +from codat_sync_for_payables_version_1 import CodatSyncPayables +from codat_sync_for_payables_version_1.models import shared -s = codatsyncpayables.CodatSyncPayables( +s = CodatSyncPayables( security=shared.Security( auth_header="Basic BASE_64_ENCODED(API_KEY)", ), ) -req = operations.ListConnectionsRequest( - company_id='8a210b68-6988-11ed-a1eb-0242ac120002', - order_by='-modifiedDate', - page=1, - page_size=100, -) +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", +}) -res = s.connections.list(req) - -if res.connections is not None: +if res is not None: # handle response pass + ``` ### Parameters @@ -190,16 +184,16 @@ if res.connections is not None: | `request` | [operations.ListConnectionsRequest](../../models/operations/listconnectionsrequest.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.ListConnectionsResponse](../../models/operations/listconnectionsresponse.md)** +**[shared.Connections](../../models/shared/connections.md)** + ### Errors -| Error Object | Status Code | Content Type | -| ------------------------------- | ------------------------------- | ------------------------------- | -| errors.ErrorMessage | 400,401,402,403,404,429,500,503 | application/json | -| errors.SDKError | 4x-5xx | */* | +| Error Type | Status Code | Content Type | +| -------------------------------------- | -------------------------------------- | -------------------------------------- | +| errors.ErrorMessage | 400, 401, 402, 403, 404, 429, 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | ## unlink @@ -208,25 +202,27 @@ if res.connections is not None: ### Example Usage ```python -import codatsyncpayables -from codatsyncpayables.models import operations, shared +from codat_sync_for_payables_version_1 import CodatSyncPayables +from codat_sync_for_payables_version_1.models import shared -s = codatsyncpayables.CodatSyncPayables( +s = CodatSyncPayables( security=shared.Security( auth_header="Basic BASE_64_ENCODED(API_KEY)", ), ) -req = operations.UnlinkConnectionRequest( - company_id='8a210b68-6988-11ed-a1eb-0242ac120002', - connection_id='2e9d2c44-f675-40ba-8049-353bfcb5e171', -) - -res = s.connections.unlink(req) +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.connection is not None: +if res is not None: # handle response pass + ``` ### Parameters @@ -236,13 +232,13 @@ if res.connection is not None: | `request` | [operations.UnlinkConnectionRequest](../../models/operations/unlinkconnectionrequest.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.UnlinkConnectionResponse](../../models/operations/unlinkconnectionresponse.md)** +**[shared.Connection](../../models/shared/connection.md)** + ### Errors -| Error Object | Status Code | Content Type | -| --------------------------- | --------------------------- | --------------------------- | -| errors.ErrorMessage | 401,402,403,404,429,500,503 | application/json | -| errors.SDKError | 4x-5xx | */* | +| Error Type | Status Code | Content Type | +| --------------------------------- | --------------------------------- | --------------------------------- | +| errors.ErrorMessage | 401, 402, 403, 404, 429, 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/previous-versions/sync-for-payables-version-1/docs/sdks/journalentries/README.md b/previous-versions/sync-for-payables-version-1/docs/sdks/journalentries/README.md new file mode 100644 index 000000000..f0bbd75be --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/docs/sdks/journalentries/README.md @@ -0,0 +1,174 @@ +# JournalEntries +(*journal_entries*) + +## Overview + +Get, create, and update Journal entries. + +### Available Operations + +* [create](#create) - Create journal entry +* [get_create_model](#get_create_model) - Get create journal entry model + +## create + +The *Create journal entry* endpoint creates a new [journal entry](https://docs.codat.io/sync-for-payables-api#/schemas/JournalEntry) for a given company's connection. + +[Journal entries](https://docs.codat.io/sync-for-payables-api#/schemas/JournalEntry) are made in a company's general ledger, or accounts, when transactions are approved. + +**Integration-specific behaviour** + +Required data may vary by integration. To see what data to post, first call [Get create journal entry model](https://docs.codat.io/sync-for-payables-api#/operations/get-create-journalEntries-model). + +Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=journalEntries) for integrations that support creating a journal entry. + + +### Example Usage + +```python +from codat_sync_for_payables_version_1 import CodatSyncPayables +from codat_sync_for_payables_version_1.models import shared +from decimal import Decimal + +s = CodatSyncPayables( + security=shared.Security( + auth_header="Basic BASE_64_ENCODED(API_KEY)", + ), +) + +res = s.journal_entries.create(request={ + "company_id": "8a210b68-6988-11ed-a1eb-0242ac120002", + "connection_id": "2e9d2c44-f675-40ba-8049-353bfcb5e171", + "journal_entry": { + "created_on": "2023-02-22T19:49:16.052Z", + "description": "record level description", + "journal_lines": [ + { + "net_amount": Decimal("23.02"), + "account_ref": { + "id": "80000019-1671793811", + "name": "Office Supplies", + }, + "currency": "USD", + "description": "journalLines.description debit", + "tracking": { + "record_refs": [ + { + "data_type": shared.TrackingRecordRefDataType.CUSTOMERS, + "id": "80000001-1674553252", + }, + ], + }, + }, + { + "net_amount": Decimal("-23.02"), + "account_ref": { + "id": "8000001E-1671793811", + "name": "Utilities", + }, + "currency": "USD", + "description": "journalLines.description credit", + "tracking": { + "record_refs": [ + { + "data_type": shared.TrackingRecordRefDataType.TRACKING_CATEGORIES, + "id": "80000002-1674553271", + }, + ], + }, + }, + ], + "journal_ref": { + "id": "12", + }, + "metadata": { + "is_deleted": True, + }, + "modified_date": "2022-10-23T00:00:00Z", + "posted_on": "2023-02-23T19:49:16.052Z", + "record_ref": { + "data_type": shared.JournalEntryRecordRefDataType.BILLS, + "id": "80000002-6722155312", + }, + "source_modified_date": "2022-10-23T00:00:00Z", + "updated_on": "2023-02-21T19:49:16.052Z", + }, +}) + +if res is not None: + # handle response + pass + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | +| `request` | [operations.CreateJournalEntryRequest](../../models/operations/createjournalentryrequest.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.CreateJournalEntryResponse](../../models/shared/createjournalentryresponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| -------------------------------------- | -------------------------------------- | -------------------------------------- | +| errors.ErrorMessage | 400, 401, 402, 403, 404, 429, 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## get_create_model + +The *Get create journal entry model* endpoint returns the expected data for the request payload when creating a [journal entry](https://docs.codat.io/sync-for-payables-api#/schemas/JournalEntry) for a given company and integration. + +[Journal entries](https://docs.codat.io/sync-for-payables-api#/schemas/JournalEntry) are made in a company's general ledger, or accounts, when transactions are approved. + +**Integration-specific behaviour** + +See the *response examples* for integration-specific indicative models. + +Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=journalEntries) for integrations that support creating a journal entry. + + +### Example Usage + +```python +from codat_sync_for_payables_version_1 import CodatSyncPayables +from codat_sync_for_payables_version_1.models import shared + +s = CodatSyncPayables( + security=shared.Security( + auth_header="Basic BASE_64_ENCODED(API_KEY)", + ), +) + +res = s.journal_entries.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 + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.GetCreateJournalEntryModelRequest](../../models/operations/getcreatejournalentrymodelrequest.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 | \*/\* | \ No newline at end of file diff --git a/previous-versions/sync-for-payables-version-1/docs/sdks/journals/README.md b/previous-versions/sync-for-payables-version-1/docs/sdks/journals/README.md new file mode 100644 index 000000000..9420681c1 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/docs/sdks/journals/README.md @@ -0,0 +1,229 @@ +# Journals +(*journals*) + +## Overview + +Get, create, and update Journals. + +### Available Operations + +* [create](#create) - Create journal +* [get](#get) - Get journal +* [get_create_model](#get_create_model) - Get create journal model +* [list](#list) - List journals + +## create + +The *Create journal* endpoint creates a new [journal](https://docs.codat.io/sync-for-payables-api#/schemas/Journal) for a given company's connection. + +[Journals](https://docs.codat.io/sync-for-payables-api#/schemas/Journal) are used to record all the financial transactions of a company. + +**Integration-specific behaviour** + +Required data may vary by integration. To see what data to post, first call [Get create journal model](https://docs.codat.io/sync-for-payables-api#/operations/get-create-journals-model). + +Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=journals) for integrations that support creating a journal. + + +### Example Usage + +```python +from codat_sync_for_payables_version_1 import CodatSyncPayables +from codat_sync_for_payables_version_1.models import shared + +s = CodatSyncPayables( + security=shared.Security( + auth_header="Basic BASE_64_ENCODED(API_KEY)", + ), +) + +res = s.journals.create(request={ + "company_id": "8a210b68-6988-11ed-a1eb-0242ac120002", + "connection_id": "2e9d2c44-f675-40ba-8049-353bfcb5e171", + "journal_prototype": { + "created_on": "2022-10-23T00:00:00Z", + }, +}) + +if res is not None: + # handle response + pass + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | +| `request` | [operations.CreateJournalRequest](../../models/operations/createjournalrequest.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.CreateJournalResponse](../../models/shared/createjournalresponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| -------------------------------------- | -------------------------------------- | -------------------------------------- | +| errors.ErrorMessage | 400, 401, 402, 403, 404, 429, 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## get + +The *Get journal* endpoint returns a single journal for a given `journalId`. + +[Journals](https://docs.codat.io/sync-for-payables-api#/schemas/Journal) are used to record all the financial transactions of a company. + +Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=journals) for integrations that support getting a specific journal. + +Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/sync-for-payables-api#/operations/refresh-company-data). + + +### Example Usage + +```python +from codat_sync_for_payables_version_1 import CodatSyncPayables +from codat_sync_for_payables_version_1.models import shared + +s = CodatSyncPayables( + security=shared.Security( + auth_header="Basic BASE_64_ENCODED(API_KEY)", + ), +) + +res = s.journals.get(request={ + "company_id": "8a210b68-6988-11ed-a1eb-0242ac120002", + "journal_id": "", +}) + +if res is not None: + # handle response + pass + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | +| `request` | [operations.GetJournalRequest](../../models/operations/getjournalrequest.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.Journal](../../models/shared/journal.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| -------------------------------------- | -------------------------------------- | -------------------------------------- | +| errors.ErrorMessage | 401, 402, 403, 404, 409, 429, 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## get_create_model + +The *Get create journal model* endpoint returns the expected data for the request payload when creating a [journal](https://docs.codat.io/sync-for-payables-api#/schemas/Journal) for a given company and integration. + +[Journals](https://docs.codat.io/sync-for-payables-api#/schemas/Journal) are used to record all the financial transactions of a company. + +**Integration-specific behaviour** + +See the *response examples* for integration-specific indicative models. + +Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=journals) for integrations that support creating a journal. + + +### Example Usage + +```python +from codat_sync_for_payables_version_1 import CodatSyncPayables +from codat_sync_for_payables_version_1.models import shared + +s = CodatSyncPayables( + security=shared.Security( + auth_header="Basic BASE_64_ENCODED(API_KEY)", + ), +) + +res = s.journals.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 + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | +| `request` | [operations.GetCreateJournalModelRequest](../../models/operations/getcreatejournalmodelrequest.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 | \*/\* | + +## list + +The *List journals* endpoint returns a list of [journals](https://docs.codat.io/sync-for-payables-api#/schemas/Journal) for a given company's connection. + +[Journals](https://docs.codat.io/sync-for-payables-api#/schemas/Journal) are used to record all the financial transactions of a company. + +Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/sync-for-payables-api#/operations/refresh-company-data). + + +### Example Usage + +```python +from codat_sync_for_payables_version_1 import CodatSyncPayables +from codat_sync_for_payables_version_1.models import shared + +s = CodatSyncPayables( + security=shared.Security( + auth_header="Basic BASE_64_ENCODED(API_KEY)", + ), +) + +res = s.journals.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 + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | +| `request` | [operations.ListJournalsRequest](../../models/operations/listjournalsrequest.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.Journals](../../models/shared/journals.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 | \*/\* | \ No newline at end of file diff --git a/previous-versions/sync-for-payables-version-1/docs/sdks/managedata/README.md b/previous-versions/sync-for-payables-version-1/docs/sdks/managedata/README.md new file mode 100644 index 000000000..c37857e87 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/docs/sdks/managedata/README.md @@ -0,0 +1,240 @@ +# ManageData +(*manage_data*) + +## Overview + +Control how data is retrieved from an integration. + +### Available Operations + +* [get](#get) - Get data status +* [get_pull_operation](#get_pull_operation) - Get pull operation +* [list_pull_operations](#list_pull_operations) - List pull operations +* [refresh_all_data_types](#refresh_all_data_types) - Refresh all data +* [refresh_data_type](#refresh_data_type) - Refresh data type + +## get + +Get the state of each data type for a company + +### Example Usage + +```python +from codat_sync_for_payables_version_1 import CodatSyncPayables +from codat_sync_for_payables_version_1.models import shared + +s = CodatSyncPayables( + security=shared.Security( + auth_header="Basic BASE_64_ENCODED(API_KEY)", + ), +) + +res = s.manage_data.get(request={ + "company_id": "8a210b68-6988-11ed-a1eb-0242ac120002", +}) + +if res is not None: + # handle response + pass + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | +| `request` | [operations.GetDataStatusRequest](../../models/operations/getdatastatusrequest.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.GetDataStatusDataStatuses](../../models/operations/getdatastatusdatastatuses.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| --------------------------------- | --------------------------------- | --------------------------------- | +| errors.ErrorMessage | 401, 402, 403, 404, 429, 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## get_pull_operation + +Retrieve information about a single dataset or pull operation. + +### Example Usage + +```python +from codat_sync_for_payables_version_1 import CodatSyncPayables +from codat_sync_for_payables_version_1.models import shared + +s = CodatSyncPayables( + security=shared.Security( + auth_header="Basic BASE_64_ENCODED(API_KEY)", + ), +) + +res = s.manage_data.get_pull_operation(request={ + "company_id": "8a210b68-6988-11ed-a1eb-0242ac120002", + "dataset_id": "71a4c0fb-8e15-45bd-958d-330b4e6e9f07", +}) + +if res is not None: + # handle response + pass + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | +| `request` | [operations.GetPullOperationRequest](../../models/operations/getpulloperationrequest.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.PullOperation](../../models/shared/pulloperation.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| --------------------------------- | --------------------------------- | --------------------------------- | +| errors.ErrorMessage | 401, 402, 403, 404, 429, 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## list_pull_operations + +Gets the pull operation history (datasets) for a given company. + +### Example Usage + +```python +from codat_sync_for_payables_version_1 import CodatSyncPayables +from codat_sync_for_payables_version_1.models import shared + +s = CodatSyncPayables( + security=shared.Security( + auth_header="Basic BASE_64_ENCODED(API_KEY)", + ), +) + +res = s.manage_data.list_pull_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 + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | +| `request` | [operations.ListPullOperationsRequest](../../models/operations/listpulloperationsrequest.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.PullOperations](../../models/shared/pulloperations.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| -------------------------------------- | -------------------------------------- | -------------------------------------- | +| errors.ErrorMessage | 400, 401, 402, 403, 404, 429, 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## refresh_all_data_types + +Refreshes all data types with `fetch on first link` set to `true` for a given company. + +This is an asynchronous operation, and will bring updated data into Codat from the linked integration for you to view. + +[Read more](https://docs.codat.io/core-concepts/data-type-settings) about data type settings and `fetch on first link`. + +### Example Usage + +```python +from codat_sync_for_payables_version_1 import CodatSyncPayables +from codat_sync_for_payables_version_1.models import shared + +s = CodatSyncPayables( + security=shared.Security( + auth_header="Basic BASE_64_ENCODED(API_KEY)", + ), +) + +s.manage_data.refresh_all_data_types(request={ + "company_id": "8a210b68-6988-11ed-a1eb-0242ac120002", +}) + +# Use the SDK ... + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | +| `request` | [operations.RefreshAllDataTypesRequest](../../models/operations/refreshalldatatypesrequest.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. | + +### Errors + +| Error Type | Status Code | Content Type | +| --------------------------------- | --------------------------------- | --------------------------------- | +| errors.ErrorMessage | 401, 402, 403, 404, 429, 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## refresh_data_type + +Refreshes a given data type for a given company. + +This is an asynchronous operation, and will bring updated data into Codat from the linked integration for you to view. + +### Example Usage + +```python +from codat_sync_for_payables_version_1 import CodatSyncPayables +from codat_sync_for_payables_version_1.models import shared + +s = CodatSyncPayables( + security=shared.Security( + auth_header="Basic BASE_64_ENCODED(API_KEY)", + ), +) + +res = s.manage_data.refresh_data_type(request={ + "company_id": "8a210b68-6988-11ed-a1eb-0242ac120002", + "data_type": shared.SchemaDataType.INVOICES, +}) + +if res is not None: + # handle response + pass + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | +| `request` | [operations.RefreshDataTypeRequest](../../models/operations/refreshdatatyperequest.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.PullOperation](../../models/shared/pulloperation.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| --------------------------------- | --------------------------------- | --------------------------------- | +| errors.ErrorMessage | 401, 402, 403, 404, 429, 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/previous-versions/sync-for-payables-version-1/docs/sdks/paymentmethods/README.md b/previous-versions/sync-for-payables-version-1/docs/sdks/paymentmethods/README.md new file mode 100644 index 000000000..fb80c9bbd --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/docs/sdks/paymentmethods/README.md @@ -0,0 +1,116 @@ +# PaymentMethods +(*payment_methods*) + +## Overview + +Get, create, and update Payment methods. + +### Available Operations + +* [get](#get) - Get payment method +* [list](#list) - List payment methods + +## get + +The *Get payment method* endpoint returns a single payment method for a given `paymentMethodId`. + +[Payment methods](https://docs.codat.io/sync-for-payables-api#/schemas/PaymentMethod) are used to pay a Bill. Payment Methods are referenced on [Bill Payments](https://docs.codat.io/sync-for-payables-api#/schemas/BillPayment) and [Payments](https://docs.codat.io/sync-for-payables-api#/schemas/Payment). + +Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=paymentMethods) for integrations that support getting a specific payment method. + +Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/sync-for-payables-api#/operations/refresh-company-data). + + +### Example Usage + +```python +from codat_sync_for_payables_version_1 import CodatSyncPayables +from codat_sync_for_payables_version_1.models import shared + +s = CodatSyncPayables( + security=shared.Security( + auth_header="Basic BASE_64_ENCODED(API_KEY)", + ), +) + +res = s.payment_methods.get(request={ + "company_id": "8a210b68-6988-11ed-a1eb-0242ac120002", + "payment_method_id": "", +}) + +if res is not None: + # handle response + pass + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | +| `request` | [operations.GetPaymentMethodRequest](../../models/operations/getpaymentmethodrequest.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.PaymentMethod](../../models/shared/paymentmethod.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| -------------------------------------- | -------------------------------------- | -------------------------------------- | +| errors.ErrorMessage | 401, 402, 403, 404, 409, 429, 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## list + +The *List payment methods* endpoint returns a list of [payment methods](https://docs.codat.io/sync-for-payables-api#/schemas/PaymentMethod) for a given company's connection. + +[Payment methods](https://docs.codat.io/sync-for-payables-api#/schemas/PaymentMethod) are used to pay a Bill. Payment Methods are referenced on [Bill Payments](https://docs.codat.io/sync-for-payables-api#/schemas/BillPayment) and [Payments](https://docs.codat.io/sync-for-payables-api#/schemas/Payment). + +Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/sync-for-payables-api#/operations/refresh-company-data). + + +### Example Usage + +```python +from codat_sync_for_payables_version_1 import CodatSyncPayables +from codat_sync_for_payables_version_1.models import shared + +s = CodatSyncPayables( + security=shared.Security( + auth_header="Basic BASE_64_ENCODED(API_KEY)", + ), +) + +res = s.payment_methods.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 + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | +| `request` | [operations.ListPaymentMethodsRequest](../../models/operations/listpaymentmethodsrequest.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.PaymentMethods](../../models/shared/paymentmethods.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 | \*/\* | \ No newline at end of file diff --git a/previous-versions/sync-for-payables-version-1/docs/sdks/pushoperations/README.md b/previous-versions/sync-for-payables-version-1/docs/sdks/pushoperations/README.md new file mode 100644 index 000000000..8d01abda0 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/docs/sdks/pushoperations/README.md @@ -0,0 +1,104 @@ +# PushOperations +(*push_operations*) + +## Overview + +View historic push operations. + +### Available Operations + +* [get](#get) - Get push operation +* [list](#list) - List push operations + +## get + +Retrieve push operation. + +### Example Usage + +```python +from codat_sync_for_payables_version_1 import CodatSyncPayables +from codat_sync_for_payables_version_1.models import shared + +s = CodatSyncPayables( + security=shared.Security( + auth_header="Basic BASE_64_ENCODED(API_KEY)", + ), +) + +res = s.push_operations.get(request={ + "company_id": "8a210b68-6988-11ed-a1eb-0242ac120002", + "push_operation_key": "b888f774-3e7c-4135-a18c-6b985523c4bc", +}) + +if res is not None: + # handle response + pass + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | +| `request` | [operations.GetPushOperationRequest](../../models/operations/getpushoperationrequest.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.PushOperation](../../models/shared/pushoperation.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| --------------------------------- | --------------------------------- | --------------------------------- | +| errors.ErrorMessage | 401, 402, 403, 404, 429, 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## list + +List push operation records. + +### Example Usage + +```python +from codat_sync_for_payables_version_1 import CodatSyncPayables +from codat_sync_for_payables_version_1.models import shared + +s = CodatSyncPayables( + security=shared.Security( + auth_header="Basic BASE_64_ENCODED(API_KEY)", + ), +) + +res = s.push_operations.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 + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | +| `request` | [operations.ListPushOperationsRequest](../../models/operations/listpushoperationsrequest.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.PushOperations](../../models/shared/pushoperations.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| -------------------------------------- | -------------------------------------- | -------------------------------------- | +| errors.ErrorMessage | 400, 401, 402, 403, 404, 429, 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/previous-versions/sync-for-payables-version-1/docs/sdks/suppliers/README.md b/previous-versions/sync-for-payables-version-1/docs/sdks/suppliers/README.md new file mode 100644 index 000000000..32e7fc6a8 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/docs/sdks/suppliers/README.md @@ -0,0 +1,326 @@ +# Suppliers +(*suppliers*) + +## Overview + +Get, create, and update Suppliers. + +### Available Operations + +* [create](#create) - Create supplier +* [get](#get) - Get supplier +* [get_create_update_model](#get_create_update_model) - Get create/update supplier model +* [list](#list) - List suppliers +* [update](#update) - Update supplier + +## create + +The *Create supplier* endpoint creates a new [supplier](https://docs.codat.io/sync-for-payables-api#/schemas/Supplier) for a given company's connection. + +[Suppliers](https://docs.codat.io/sync-for-payables-api#/schemas/Supplier) are people or organizations that provide something, such as a product or service. + +**Integration-specific behaviour** + +Required data may vary by integration. To see what data to post, first call [Get create/update supplier model](https://docs.codat.io/sync-for-payables-api#/operations/get-create-update-suppliers-model). + +Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=suppliers) for integrations that support creating a supplier. + + +### Example Usage + +```python +from codat_sync_for_payables_version_1 import CodatSyncPayables +from codat_sync_for_payables_version_1.models import shared + +s = CodatSyncPayables( + security=shared.Security( + auth_header="Basic BASE_64_ENCODED(API_KEY)", + ), +) + +res = s.suppliers.create(request={ + "company_id": "8a210b68-6988-11ed-a1eb-0242ac120002", + "connection_id": "2e9d2c44-f675-40ba-8049-353bfcb5e171", + "supplier": { + "status": shared.SupplierStatus.ACTIVE, + "contact_name": "Joe Bloggs", + "id": "73593", + "modified_date": "2022-10-23T00:00:00Z", + "phone": "(877) 492-8687", + "source_modified_date": "2022-10-23T00:00:00Z", + "supplier_name": "test 20230420 1004", + }, +}) + +if res is not None: + # handle response + pass + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | +| `request` | [operations.CreateSupplierRequest](../../models/operations/createsupplierrequest.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.CreateSupplierResponse](../../models/shared/createsupplierresponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| -------------------------------------- | -------------------------------------- | -------------------------------------- | +| errors.ErrorMessage | 400, 401, 402, 403, 404, 429, 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## get + +The *Get supplier* endpoint returns a single supplier for a given `supplierId`. + +[Suppliers](https://docs.codat.io/sync-for-payables-api#/schemas/Supplier) are people or organizations that provide something, such as a product or service. + +Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=suppliers) for integrations that support getting a specific supplier. + +Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/sync-for-payables-api#/operations/refresh-company-data). + + +### Example Usage + +```python +from codat_sync_for_payables_version_1 import CodatSyncPayables +from codat_sync_for_payables_version_1.models import shared + +s = CodatSyncPayables( + security=shared.Security( + auth_header="Basic BASE_64_ENCODED(API_KEY)", + ), +) + +res = s.suppliers.get(request={ + "company_id": "8a210b68-6988-11ed-a1eb-0242ac120002", + "supplier_id": "", +}) + +if res is not None: + # handle response + pass + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | +| `request` | [operations.GetSupplierRequest](../../models/operations/getsupplierrequest.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.Supplier](../../models/shared/supplier.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| -------------------------------------- | -------------------------------------- | -------------------------------------- | +| errors.ErrorMessage | 401, 402, 403, 404, 409, 429, 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## get_create_update_model + +The *Get create/update supplier model* endpoint returns the expected data for the request payload when creating and updating a [supplier](https://docs.codat.io/sync-for-payables-api#/schemas/Supplier) for a given company and integration. + +[Suppliers](https://docs.codat.io/sync-for-payables-api#/schemas/Supplier) are people or organizations that provide something, such as a product or service. + +**Integration-specific behaviour** + +See the *response examples* for integration-specific indicative models. + +Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=suppliers) for integrations that support creating and updating a supplier. + + +### Example Usage + +```python +from codat_sync_for_payables_version_1 import CodatSyncPayables +from codat_sync_for_payables_version_1.models import shared + +s = CodatSyncPayables( + security=shared.Security( + auth_header="Basic BASE_64_ENCODED(API_KEY)", + ), +) + +res = s.suppliers.get_create_update_model(request={ + "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.GetCreateUpdateSupplierModelRequest](../../models/operations/getcreateupdatesuppliermodelrequest.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 | \*/\* | + +## list + +The *List suppliers* endpoint returns a list of [suppliers](https://docs.codat.io/sync-for-payables-api#/schemas/Supplier) for a given company's connection. + +[Suppliers](https://docs.codat.io/sync-for-payables-api#/schemas/Supplier) are people or organizations that provide something, such as a product or service. + +### Example Usage + +```python +from codat_sync_for_payables_version_1 import CodatSyncPayables +from codat_sync_for_payables_version_1.models import shared + +s = CodatSyncPayables( + security=shared.Security( + auth_header="Basic BASE_64_ENCODED(API_KEY)", + ), +) + +res = s.suppliers.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 + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | +| `request` | [operations.ListSuppliersRequest](../../models/operations/listsuppliersrequest.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.Suppliers](../../models/shared/suppliers.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 | \*/\* | + +## update + +The *Update supplier* endpoint updates an existing [supplier](https://docs.codat.io/sync-for-payables-api#/schemas/Supplier) for a given company's connection. + +[Suppliers](https://docs.codat.io/sync-for-payables-api#/schemas/Supplier) are people or organizations that provide something, such as a product or service. + +**Integration-specific behaviour** + +Required data may vary by integration. To see what data to post, first call [Get create/update supplier model](https://docs.codat.io/sync-for-payables-api#/operations/get-create-update-suppliers-model). + +Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=suppliers) for integrations that support creating a supplier. + + +### Example Usage + +```python +from codat_sync_for_payables_version_1 import CodatSyncPayables +from codat_sync_for_payables_version_1.models import shared + +s = CodatSyncPayables( + security=shared.Security( + auth_header="Basic BASE_64_ENCODED(API_KEY)", + ), +) + +res = s.suppliers.update(request={ + "company_id": "8a210b68-6988-11ed-a1eb-0242ac120002", + "connection_id": "2e9d2c44-f675-40ba-8049-353bfcb5e171", + "supplier_id": "", + "supplier": { + "status": shared.SupplierStatus.UNKNOWN, + "addresses": [ + { + "type": shared.AccountingAddressType.BILLING, + "city": "Bakersfield", + "country": "USA", + "line1": "Unit 51", + "line2": "Bakersfield Industrial Estate", + "region": "California", + }, + ], + "contact_name": "Kelly's Industrial Supplies", + "default_currency": "string", + "email_address": "sales@kellysupplies.com", + "id": "C520FFD4-F6F6-4FC2-A6D2-5D7088B2B14F", + "metadata": { + "is_deleted": True, + }, + "modified_date": "2022-10-23T00:00:00Z", + "phone": "07999 999999", + "registration_number": "string", + "source_modified_date": "2022-10-23T00:00:00Z", + "supplemental_data": { + "content": { + "property1": { + "property1": "", + "property2": "", + }, + "property2": { + "property1": "", + "property2": "", + }, + }, + }, + "supplier_name": "Kelly's Industrial Supplies", + "tax_number": "string", + }, +}) + +if res is not None: + # handle response + pass + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | +| `request` | [operations.UpdateSupplierRequest](../../models/operations/updatesupplierrequest.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.UpdateSupplierResponse](../../models/shared/updatesupplierresponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| -------------------------------------- | -------------------------------------- | -------------------------------------- | +| errors.ErrorMessage | 400, 401, 402, 403, 404, 429, 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/previous-versions/sync-for-payables-version-1/docs/sdks/taxrates/README.md b/previous-versions/sync-for-payables-version-1/docs/sdks/taxrates/README.md new file mode 100644 index 000000000..3f79106e5 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/docs/sdks/taxrates/README.md @@ -0,0 +1,116 @@ +# TaxRates +(*tax_rates*) + +## Overview + +Get, create, and update Tax rates. + +### Available Operations + +* [get](#get) - Get tax rate +* [list](#list) - List all tax rates + +## get + +The *Get tax rate* endpoint returns a single tax rate for a given `taxRateId`. + +[Tax rates](https://docs.codat.io/sync-for-payables-api#/schemas/TaxRate) are a set of taxes and associated rates within the SMB's accounting software. + +Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=taxRates) for integrations that support getting a specific tax rate. + +Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/sync-for-payables-api#/operations/refresh-company-data). + + +### Example Usage + +```python +from codat_sync_for_payables_version_1 import CodatSyncPayables +from codat_sync_for_payables_version_1.models import shared + +s = CodatSyncPayables( + security=shared.Security( + auth_header="Basic BASE_64_ENCODED(API_KEY)", + ), +) + +res = s.tax_rates.get(request={ + "company_id": "8a210b68-6988-11ed-a1eb-0242ac120002", + "tax_rate_id": "", +}) + +if res is not None: + # handle response + pass + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | +| `request` | [operations.GetTaxRateRequest](../../models/operations/gettaxraterequest.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.TaxRate](../../models/shared/taxrate.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| -------------------------------------- | -------------------------------------- | -------------------------------------- | +| errors.ErrorMessage | 401, 402, 403, 404, 409, 429, 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## list + +The *List tax rates* endpoint returns a list of [tax rates](https://docs.codat.io/sync-for-payables-api#/schemas/TaxRate) for a given company's connection. + +[Tax rates](https://docs.codat.io/sync-for-payables-api#/schemas/TaxRate) are a set of taxes and associated rates within the SMB's accounting software. + +Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/sync-for-payables-api#/operations/refresh-company-data). + + +### Example Usage + +```python +from codat_sync_for_payables_version_1 import CodatSyncPayables +from codat_sync_for_payables_version_1.models import shared + +s = CodatSyncPayables( + security=shared.Security( + auth_header="Basic BASE_64_ENCODED(API_KEY)", + ), +) + +res = s.tax_rates.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 + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | +| `request` | [operations.ListTaxRatesRequest](../../models/operations/listtaxratesrequest.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.TaxRates](../../models/shared/taxrates.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 | \*/\* | \ No newline at end of file diff --git a/previous-versions/sync-for-payables-version-1/docs/sdks/trackingcategories/README.md b/previous-versions/sync-for-payables-version-1/docs/sdks/trackingcategories/README.md new file mode 100644 index 000000000..4820ab344 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/docs/sdks/trackingcategories/README.md @@ -0,0 +1,116 @@ +# TrackingCategories +(*tracking_categories*) + +## Overview + +Get, create, and update Tracking categories. + +### Available Operations + +* [get](#get) - Get tracking categories +* [list](#list) - List tracking categories + +## get + +The *Get tracking category* endpoint returns a single tracking category for a given `trackingCategoryId`. + +[Tracking categories](https://docs.codat.io/sync-for-payables-api#/schemas/TrackingCategory) are used to monitor cost centres and control budgets that sit outside the standard set of accounts. + +Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=trackingCategories) for integrations that support getting a specific tracking category. + +Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/sync-for-payables-api#/operations/refresh-company-data). + + +### Example Usage + +```python +from codat_sync_for_payables_version_1 import CodatSyncPayables +from codat_sync_for_payables_version_1.models import shared + +s = CodatSyncPayables( + security=shared.Security( + auth_header="Basic BASE_64_ENCODED(API_KEY)", + ), +) + +res = s.tracking_categories.get(request={ + "company_id": "8a210b68-6988-11ed-a1eb-0242ac120002", + "tracking_category_id": "", +}) + +if res is not None: + # handle response + pass + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | +| `request` | [operations.GetTrackingCategoryRequest](../../models/operations/gettrackingcategoryrequest.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.TrackingCategoryTree](../../models/shared/trackingcategorytree.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| -------------------------------------- | -------------------------------------- | -------------------------------------- | +| errors.ErrorMessage | 401, 402, 403, 404, 409, 429, 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## list + +The *List tracking categories* endpoint returns a list of [tracking categories](https://docs.codat.io/sync-for-payables-api#/schemas/TrackingCategory) for a given company's connection. + +[Tracking categories](https://docs.codat.io/sync-for-payables-api#/schemas/TrackingCategory) are used to monitor cost centres and control budgets that sit outside the standard set of accounts. + +Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/sync-for-payables-api#/operations/refresh-company-data). + + +### Example Usage + +```python +from codat_sync_for_payables_version_1 import CodatSyncPayables +from codat_sync_for_payables_version_1.models import shared + +s = CodatSyncPayables( + security=shared.Security( + auth_header="Basic BASE_64_ENCODED(API_KEY)", + ), +) + +res = s.tracking_categories.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 + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | +| `request` | [operations.ListTrackingCategoriesRequest](../../models/operations/listtrackingcategoriesrequest.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.TrackingCategories](../../models/shared/trackingcategories.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 | \*/\* | \ No newline at end of file diff --git a/previous-versions/sync-for-payables-version-1/poetry.lock b/previous-versions/sync-for-payables-version-1/poetry.lock new file mode 100644 index 000000000..2b38ecfe5 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/poetry.lock @@ -0,0 +1,551 @@ +# This file is automatically @generated by Poetry 1.8.3 and should not be changed by hand. + +[[package]] +name = "annotated-types" +version = "0.7.0" +description = "Reusable constraint types to use with typing.Annotated" +optional = false +python-versions = ">=3.8" +files = [ + {file = "annotated_types-0.7.0-py3-none-any.whl", hash = "sha256:1f02e8b43a8fbbc3f3e0d4f0f4bfc8131bcb4eebe8849b8e5c773f3a1c582a53"}, + {file = "annotated_types-0.7.0.tar.gz", hash = "sha256:aff07c09a53a08bc8cfccb9c85b05f1aa9a2a6f23728d790723543408344ce89"}, +] + +[package.dependencies] +typing-extensions = {version = ">=4.0.0", markers = "python_version < \"3.9\""} + +[[package]] +name = "anyio" +version = "4.5.2" +description = "High level compatibility layer for multiple asynchronous event loop implementations" +optional = false +python-versions = ">=3.8" +files = [ + {file = "anyio-4.5.2-py3-none-any.whl", hash = "sha256:c011ee36bc1e8ba40e5a81cb9df91925c218fe9b778554e0b56a21e1b5d4716f"}, + {file = "anyio-4.5.2.tar.gz", hash = "sha256:23009af4ed04ce05991845451e11ef02fc7c5ed29179ac9a420e5ad0ac7ddc5b"}, +] + +[package.dependencies] +exceptiongroup = {version = ">=1.0.2", markers = "python_version < \"3.11\""} +idna = ">=2.8" +sniffio = ">=1.1" +typing-extensions = {version = ">=4.1", markers = "python_version < \"3.11\""} + +[package.extras] +doc = ["Sphinx (>=7.4,<8.0)", "packaging", "sphinx-autodoc-typehints (>=1.2.0)", "sphinx-rtd-theme"] +test = ["anyio[trio]", "coverage[toml] (>=7)", "exceptiongroup (>=1.2.0)", "hypothesis (>=4.0)", "psutil (>=5.9)", "pytest (>=7.0)", "pytest-mock (>=3.6.1)", "trustme", "truststore (>=0.9.1)", "uvloop (>=0.21.0b1)"] +trio = ["trio (>=0.26.1)"] + +[[package]] +name = "astroid" +version = "3.2.4" +description = "An abstract syntax tree for Python with inference support." +optional = false +python-versions = ">=3.8.0" +files = [ + {file = "astroid-3.2.4-py3-none-any.whl", hash = "sha256:413658a61eeca6202a59231abb473f932038fbcbf1666587f66d482083413a25"}, + {file = "astroid-3.2.4.tar.gz", hash = "sha256:0e14202810b30da1b735827f78f5157be2bbd4a7a59b7707ca0bfc2fb4c0063a"}, +] + +[package.dependencies] +typing-extensions = {version = ">=4.0.0", markers = "python_version < \"3.11\""} + +[[package]] +name = "certifi" +version = "2024.8.30" +description = "Python package for providing Mozilla's CA Bundle." +optional = false +python-versions = ">=3.6" +files = [ + {file = "certifi-2024.8.30-py3-none-any.whl", hash = "sha256:922820b53db7a7257ffbda3f597266d435245903d80737e34f8a45ff3e3230d8"}, + {file = "certifi-2024.8.30.tar.gz", hash = "sha256:bec941d2aa8195e248a60b31ff9f0558284cf01a52591ceda73ea9afffd69fd9"}, +] + +[[package]] +name = "colorama" +version = "0.4.6" +description = "Cross-platform colored terminal text." +optional = false +python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,!=3.5.*,!=3.6.*,>=2.7" +files = [ + {file = "colorama-0.4.6-py2.py3-none-any.whl", hash = "sha256:4f1d9991f5acc0ca119f9d443620b77f9d6b33703e51011c16baf57afb285fc6"}, + {file = "colorama-0.4.6.tar.gz", hash = "sha256:08695f5cb7ed6e0531a20572697297273c47b8cae5a63ffc6d6ed5c201be6e44"}, +] + +[[package]] +name = "dill" +version = "0.3.9" +description = "serialize all of Python" +optional = false +python-versions = ">=3.8" +files = [ + {file = "dill-0.3.9-py3-none-any.whl", hash = "sha256:468dff3b89520b474c0397703366b7b95eebe6303f108adf9b19da1f702be87a"}, + {file = "dill-0.3.9.tar.gz", hash = "sha256:81aa267dddf68cbfe8029c42ca9ec6a4ab3b22371d1c450abc54422577b4512c"}, +] + +[package.extras] +graph = ["objgraph (>=1.7.2)"] +profile = ["gprof2dot (>=2022.7.29)"] + +[[package]] +name = "eval-type-backport" +version = "0.2.0" +description = "Like `typing._eval_type`, but lets older Python versions use newer typing features." +optional = false +python-versions = ">=3.8" +files = [ + {file = "eval_type_backport-0.2.0-py3-none-any.whl", hash = "sha256:ac2f73d30d40c5a30a80b8739a789d6bb5e49fdffa66d7912667e2015d9c9933"}, + {file = "eval_type_backport-0.2.0.tar.gz", hash = "sha256:68796cfbc7371ebf923f03bdf7bef415f3ec098aeced24e054b253a0e78f7b37"}, +] + +[package.extras] +tests = ["pytest"] + +[[package]] +name = "exceptiongroup" +version = "1.2.2" +description = "Backport of PEP 654 (exception groups)" +optional = false +python-versions = ">=3.7" +files = [ + {file = "exceptiongroup-1.2.2-py3-none-any.whl", hash = "sha256:3111b9d131c238bec2f8f516e123e14ba243563fb135d3fe885990585aa7795b"}, + {file = "exceptiongroup-1.2.2.tar.gz", hash = "sha256:47c2edf7c6738fafb49fd34290706d1a1a2f4d1c6df275526b62cbb4aa5393cc"}, +] + +[package.extras] +test = ["pytest (>=6)"] + +[[package]] +name = "h11" +version = "0.14.0" +description = "A pure-Python, bring-your-own-I/O implementation of HTTP/1.1" +optional = false +python-versions = ">=3.7" +files = [ + {file = "h11-0.14.0-py3-none-any.whl", hash = "sha256:e3fe4ac4b851c468cc8363d500db52c2ead036020723024a109d37346efaa761"}, + {file = "h11-0.14.0.tar.gz", hash = "sha256:8f19fbbe99e72420ff35c00b27a34cb9937e902a8b810e2c88300c6f0a3b699d"}, +] + +[[package]] +name = "httpcore" +version = "1.0.6" +description = "A minimal low-level HTTP client." +optional = false +python-versions = ">=3.8" +files = [ + {file = "httpcore-1.0.6-py3-none-any.whl", hash = "sha256:27b59625743b85577a8c0e10e55b50b5368a4f2cfe8cc7bcfa9cf00829c2682f"}, + {file = "httpcore-1.0.6.tar.gz", hash = "sha256:73f6dbd6eb8c21bbf7ef8efad555481853f5f6acdeaff1edb0694289269ee17f"}, +] + +[package.dependencies] +certifi = "*" +h11 = ">=0.13,<0.15" + +[package.extras] +asyncio = ["anyio (>=4.0,<5.0)"] +http2 = ["h2 (>=3,<5)"] +socks = ["socksio (==1.*)"] +trio = ["trio (>=0.22.0,<1.0)"] + +[[package]] +name = "httpx" +version = "0.27.2" +description = "The next generation HTTP client." +optional = false +python-versions = ">=3.8" +files = [ + {file = "httpx-0.27.2-py3-none-any.whl", hash = "sha256:7bb2708e112d8fdd7829cd4243970f0c223274051cb35ee80c03301ee29a3df0"}, + {file = "httpx-0.27.2.tar.gz", hash = "sha256:f7c2be1d2f3c3c3160d441802406b206c2b76f5947b11115e6df10c6c65e66c2"}, +] + +[package.dependencies] +anyio = "*" +certifi = "*" +httpcore = "==1.*" +idna = "*" +sniffio = "*" + +[package.extras] +brotli = ["brotli", "brotlicffi"] +cli = ["click (==8.*)", "pygments (==2.*)", "rich (>=10,<14)"] +http2 = ["h2 (>=3,<5)"] +socks = ["socksio (==1.*)"] +zstd = ["zstandard (>=0.18.0)"] + +[[package]] +name = "idna" +version = "3.10" +description = "Internationalized Domain Names in Applications (IDNA)" +optional = false +python-versions = ">=3.6" +files = [ + {file = "idna-3.10-py3-none-any.whl", hash = "sha256:946d195a0d259cbba61165e88e65941f16e9b36ea6ddb97f00452bae8b1287d3"}, + {file = "idna-3.10.tar.gz", hash = "sha256:12f65c9b470abda6dc35cf8e63cc574b1c52b11df2c86030af0ac09b01b13ea9"}, +] + +[package.extras] +all = ["flake8 (>=7.1.1)", "mypy (>=1.11.2)", "pytest (>=8.3.2)", "ruff (>=0.6.2)"] + +[[package]] +name = "isort" +version = "5.13.2" +description = "A Python utility / library to sort Python imports." +optional = false +python-versions = ">=3.8.0" +files = [ + {file = "isort-5.13.2-py3-none-any.whl", hash = "sha256:8ca5e72a8d85860d5a3fa69b8745237f2939afe12dbf656afbcb47fe72d947a6"}, + {file = "isort-5.13.2.tar.gz", hash = "sha256:48fdfcb9face5d58a4f6dde2e72a1fb8dcaf8ab26f95ab49fab84c2ddefb0109"}, +] + +[package.extras] +colors = ["colorama (>=0.4.6)"] + +[[package]] +name = "jsonpath-python" +version = "1.0.6" +description = "A more powerful JSONPath implementation in modern python" +optional = false +python-versions = ">=3.6" +files = [ + {file = "jsonpath-python-1.0.6.tar.gz", hash = "sha256:dd5be4a72d8a2995c3f583cf82bf3cd1a9544cfdabf2d22595b67aff07349666"}, + {file = "jsonpath_python-1.0.6-py3-none-any.whl", hash = "sha256:1e3b78df579f5efc23565293612decee04214609208a2335884b3ee3f786b575"}, +] + +[[package]] +name = "mccabe" +version = "0.7.0" +description = "McCabe checker, plugin for flake8" +optional = false +python-versions = ">=3.6" +files = [ + {file = "mccabe-0.7.0-py2.py3-none-any.whl", hash = "sha256:6c2d30ab6be0e4a46919781807b4f0d834ebdd6c6e3dca0bda5a15f863427b6e"}, + {file = "mccabe-0.7.0.tar.gz", hash = "sha256:348e0240c33b60bbdf4e523192ef919f28cb2c3d7d5c7794f74009290f236325"}, +] + +[[package]] +name = "mypy" +version = "1.10.1" +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"}, +] + +[package.dependencies] +mypy-extensions = ">=1.0.0" +tomli = {version = ">=1.1.0", markers = "python_version < \"3.11\""} +typing-extensions = ">=4.1.0" + +[package.extras] +dmypy = ["psutil (>=4.0)"] +install-types = ["pip"] +mypyc = ["setuptools (>=50)"] +reports = ["lxml"] + +[[package]] +name = "mypy-extensions" +version = "1.0.0" +description = "Type system extensions for programs checked with the mypy type checker." +optional = false +python-versions = ">=3.5" +files = [ + {file = "mypy_extensions-1.0.0-py3-none-any.whl", hash = "sha256:4392f6c0eb8a5668a69e23d168ffa70f0be9ccfd32b5cc2d26a34ae5b844552d"}, + {file = "mypy_extensions-1.0.0.tar.gz", hash = "sha256:75dbf8955dc00442a438fc4d0666508a9a97b6bd41aa2f0ffe9d2f2725af0782"}, +] + +[[package]] +name = "platformdirs" +version = "4.3.6" +description = "A small Python package for determining appropriate platform-specific dirs, e.g. a `user data dir`." +optional = false +python-versions = ">=3.8" +files = [ + {file = "platformdirs-4.3.6-py3-none-any.whl", hash = "sha256:73e575e1408ab8103900836b97580d5307456908a03e92031bab39e4554cc3fb"}, + {file = "platformdirs-4.3.6.tar.gz", hash = "sha256:357fb2acbc885b0419afd3ce3ed34564c13c9b95c89360cd9563f73aa5e2b907"}, +] + +[package.extras] +docs = ["furo (>=2024.8.6)", "proselint (>=0.14)", "sphinx (>=8.0.2)", "sphinx-autodoc-typehints (>=2.4)"] +test = ["appdirs (==1.4.4)", "covdefaults (>=2.3)", "pytest (>=8.3.2)", "pytest-cov (>=5)", "pytest-mock (>=3.14)"] +type = ["mypy (>=1.11.2)"] + +[[package]] +name = "pydantic" +version = "2.9.2" +description = "Data validation using Python type hints" +optional = false +python-versions = ">=3.8" +files = [ + {file = "pydantic-2.9.2-py3-none-any.whl", hash = "sha256:f048cec7b26778210e28a0459867920654d48e5e62db0958433636cde4254f12"}, + {file = "pydantic-2.9.2.tar.gz", hash = "sha256:d155cef71265d1e9807ed1c32b4c8deec042a44a50a4188b25ac67ecd81a9c0f"}, +] + +[package.dependencies] +annotated-types = ">=0.6.0" +pydantic-core = "2.23.4" +typing-extensions = [ + {version = ">=4.6.1", markers = "python_version < \"3.13\""}, + {version = ">=4.12.2", markers = "python_version >= \"3.13\""}, +] + +[package.extras] +email = ["email-validator (>=2.0.0)"] +timezone = ["tzdata"] + +[[package]] +name = "pydantic-core" +version = "2.23.4" +description = "Core functionality for Pydantic validation and serialization" +optional = false +python-versions = ">=3.8" +files = [ + {file = "pydantic_core-2.23.4-cp310-cp310-macosx_10_12_x86_64.whl", hash = "sha256:b10bd51f823d891193d4717448fab065733958bdb6a6b351967bd349d48d5c9b"}, + {file = "pydantic_core-2.23.4-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:4fc714bdbfb534f94034efaa6eadd74e5b93c8fa6315565a222f7b6f42ca1166"}, + {file = "pydantic_core-2.23.4-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:63e46b3169866bd62849936de036f901a9356e36376079b05efa83caeaa02ceb"}, + {file = "pydantic_core-2.23.4-cp310-cp310-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:ed1a53de42fbe34853ba90513cea21673481cd81ed1be739f7f2efb931b24916"}, + {file = "pydantic_core-2.23.4-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:cfdd16ab5e59fc31b5e906d1a3f666571abc367598e3e02c83403acabc092e07"}, + {file = "pydantic_core-2.23.4-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:255a8ef062cbf6674450e668482456abac99a5583bbafb73f9ad469540a3a232"}, + {file = "pydantic_core-2.23.4-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:4a7cd62e831afe623fbb7aabbb4fe583212115b3ef38a9f6b71869ba644624a2"}, + {file = "pydantic_core-2.23.4-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:f09e2ff1f17c2b51f2bc76d1cc33da96298f0a036a137f5440ab3ec5360b624f"}, + {file = "pydantic_core-2.23.4-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:e38e63e6f3d1cec5a27e0afe90a085af8b6806ee208b33030e65b6516353f1a3"}, + {file = "pydantic_core-2.23.4-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:0dbd8dbed2085ed23b5c04afa29d8fd2771674223135dc9bc937f3c09284d071"}, + {file = "pydantic_core-2.23.4-cp310-none-win32.whl", hash = "sha256:6531b7ca5f951d663c339002e91aaebda765ec7d61b7d1e3991051906ddde119"}, + {file = "pydantic_core-2.23.4-cp310-none-win_amd64.whl", hash = "sha256:7c9129eb40958b3d4500fa2467e6a83356b3b61bfff1b414c7361d9220f9ae8f"}, + {file = "pydantic_core-2.23.4-cp311-cp311-macosx_10_12_x86_64.whl", hash = "sha256:77733e3892bb0a7fa797826361ce8a9184d25c8dffaec60b7ffe928153680ba8"}, + {file = "pydantic_core-2.23.4-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:1b84d168f6c48fabd1f2027a3d1bdfe62f92cade1fb273a5d68e621da0e44e6d"}, + {file = "pydantic_core-2.23.4-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:df49e7a0861a8c36d089c1ed57d308623d60416dab2647a4a17fe050ba85de0e"}, + {file = "pydantic_core-2.23.4-cp311-cp311-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:ff02b6d461a6de369f07ec15e465a88895f3223eb75073ffea56b84d9331f607"}, + {file = "pydantic_core-2.23.4-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:996a38a83508c54c78a5f41456b0103c30508fed9abcad0a59b876d7398f25fd"}, + {file = "pydantic_core-2.23.4-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:d97683ddee4723ae8c95d1eddac7c192e8c552da0c73a925a89fa8649bf13eea"}, + {file = "pydantic_core-2.23.4-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:216f9b2d7713eb98cb83c80b9c794de1f6b7e3145eef40400c62e86cee5f4e1e"}, + {file = "pydantic_core-2.23.4-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:6f783e0ec4803c787bcea93e13e9932edab72068f68ecffdf86a99fd5918878b"}, + {file = "pydantic_core-2.23.4-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:d0776dea117cf5272382634bd2a5c1b6eb16767c223c6a5317cd3e2a757c61a0"}, + {file = "pydantic_core-2.23.4-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:d5f7a395a8cf1621939692dba2a6b6a830efa6b3cee787d82c7de1ad2930de64"}, + {file = "pydantic_core-2.23.4-cp311-none-win32.whl", hash = "sha256:74b9127ffea03643e998e0c5ad9bd3811d3dac8c676e47db17b0ee7c3c3bf35f"}, + {file = "pydantic_core-2.23.4-cp311-none-win_amd64.whl", hash = "sha256:98d134c954828488b153d88ba1f34e14259284f256180ce659e8d83e9c05eaa3"}, + {file = "pydantic_core-2.23.4-cp312-cp312-macosx_10_12_x86_64.whl", hash = "sha256:f3e0da4ebaef65158d4dfd7d3678aad692f7666877df0002b8a522cdf088f231"}, + {file = "pydantic_core-2.23.4-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:f69a8e0b033b747bb3e36a44e7732f0c99f7edd5cea723d45bc0d6e95377ffee"}, + {file = "pydantic_core-2.23.4-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:723314c1d51722ab28bfcd5240d858512ffd3116449c557a1336cbe3919beb87"}, + {file = "pydantic_core-2.23.4-cp312-cp312-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:bb2802e667b7051a1bebbfe93684841cc9351004e2badbd6411bf357ab8d5ac8"}, + {file = "pydantic_core-2.23.4-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:d18ca8148bebe1b0a382a27a8ee60350091a6ddaf475fa05ef50dc35b5df6327"}, + {file = "pydantic_core-2.23.4-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:33e3d65a85a2a4a0dc3b092b938a4062b1a05f3a9abde65ea93b233bca0e03f2"}, + {file = "pydantic_core-2.23.4-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:128585782e5bfa515c590ccee4b727fb76925dd04a98864182b22e89a4e6ed36"}, + {file = "pydantic_core-2.23.4-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:68665f4c17edcceecc112dfed5dbe6f92261fb9d6054b47d01bf6371a6196126"}, + {file = "pydantic_core-2.23.4-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:20152074317d9bed6b7a95ade3b7d6054845d70584216160860425f4fbd5ee9e"}, + {file = "pydantic_core-2.23.4-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:9261d3ce84fa1d38ed649c3638feefeae23d32ba9182963e465d58d62203bd24"}, + {file = "pydantic_core-2.23.4-cp312-none-win32.whl", hash = "sha256:4ba762ed58e8d68657fc1281e9bb72e1c3e79cc5d464be146e260c541ec12d84"}, + {file = "pydantic_core-2.23.4-cp312-none-win_amd64.whl", hash = "sha256:97df63000f4fea395b2824da80e169731088656d1818a11b95f3b173747b6cd9"}, + {file = "pydantic_core-2.23.4-cp313-cp313-macosx_10_12_x86_64.whl", hash = "sha256:7530e201d10d7d14abce4fb54cfe5b94a0aefc87da539d0346a484ead376c3cc"}, + {file = "pydantic_core-2.23.4-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:df933278128ea1cd77772673c73954e53a1c95a4fdf41eef97c2b779271bd0bd"}, + {file = "pydantic_core-2.23.4-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:0cb3da3fd1b6a5d0279a01877713dbda118a2a4fc6f0d821a57da2e464793f05"}, + {file = "pydantic_core-2.23.4-cp313-cp313-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:42c6dcb030aefb668a2b7009c85b27f90e51e6a3b4d5c9bc4c57631292015b0d"}, + {file = "pydantic_core-2.23.4-cp313-cp313-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:696dd8d674d6ce621ab9d45b205df149399e4bb9aa34102c970b721554828510"}, + {file = "pydantic_core-2.23.4-cp313-cp313-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:2971bb5ffe72cc0f555c13e19b23c85b654dd2a8f7ab493c262071377bfce9f6"}, + {file = "pydantic_core-2.23.4-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8394d940e5d400d04cad4f75c0598665cbb81aecefaca82ca85bd28264af7f9b"}, + {file = "pydantic_core-2.23.4-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:0dff76e0602ca7d4cdaacc1ac4c005e0ce0dcfe095d5b5259163a80d3a10d327"}, + {file = "pydantic_core-2.23.4-cp313-cp313-musllinux_1_1_aarch64.whl", hash = "sha256:7d32706badfe136888bdea71c0def994644e09fff0bfe47441deaed8e96fdbc6"}, + {file = "pydantic_core-2.23.4-cp313-cp313-musllinux_1_1_x86_64.whl", hash = "sha256:ed541d70698978a20eb63d8c5d72f2cc6d7079d9d90f6b50bad07826f1320f5f"}, + {file = "pydantic_core-2.23.4-cp313-none-win32.whl", hash = "sha256:3d5639516376dce1940ea36edf408c554475369f5da2abd45d44621cb616f769"}, + {file = "pydantic_core-2.23.4-cp313-none-win_amd64.whl", hash = "sha256:5a1504ad17ba4210df3a045132a7baeeba5a200e930f57512ee02909fc5c4cb5"}, + {file = "pydantic_core-2.23.4-cp38-cp38-macosx_10_12_x86_64.whl", hash = "sha256:d4488a93b071c04dc20f5cecc3631fc78b9789dd72483ba15d423b5b3689b555"}, + {file = "pydantic_core-2.23.4-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:81965a16b675b35e1d09dd14df53f190f9129c0202356ed44ab2728b1c905658"}, + {file = "pydantic_core-2.23.4-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:4ffa2ebd4c8530079140dd2d7f794a9d9a73cbb8e9d59ffe24c63436efa8f271"}, + {file = "pydantic_core-2.23.4-cp38-cp38-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:61817945f2fe7d166e75fbfb28004034b48e44878177fc54d81688e7b85a3665"}, + {file = "pydantic_core-2.23.4-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:29d2c342c4bc01b88402d60189f3df065fb0dda3654744d5a165a5288a657368"}, + {file = "pydantic_core-2.23.4-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:5e11661ce0fd30a6790e8bcdf263b9ec5988e95e63cf901972107efc49218b13"}, + {file = "pydantic_core-2.23.4-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:9d18368b137c6295db49ce7218b1a9ba15c5bc254c96d7c9f9e924a9bc7825ad"}, + {file = "pydantic_core-2.23.4-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:ec4e55f79b1c4ffb2eecd8a0cfba9955a2588497d96851f4c8f99aa4a1d39b12"}, + {file = "pydantic_core-2.23.4-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:374a5e5049eda9e0a44c696c7ade3ff355f06b1fe0bb945ea3cac2bc336478a2"}, + {file = "pydantic_core-2.23.4-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:5c364564d17da23db1106787675fc7af45f2f7b58b4173bfdd105564e132e6fb"}, + {file = "pydantic_core-2.23.4-cp38-none-win32.whl", hash = "sha256:d7a80d21d613eec45e3d41eb22f8f94ddc758a6c4720842dc74c0581f54993d6"}, + {file = "pydantic_core-2.23.4-cp38-none-win_amd64.whl", hash = "sha256:5f5ff8d839f4566a474a969508fe1c5e59c31c80d9e140566f9a37bba7b8d556"}, + {file = "pydantic_core-2.23.4-cp39-cp39-macosx_10_12_x86_64.whl", hash = "sha256:a4fa4fc04dff799089689f4fd502ce7d59de529fc2f40a2c8836886c03e0175a"}, + {file = "pydantic_core-2.23.4-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:0a7df63886be5e270da67e0966cf4afbae86069501d35c8c1b3b6c168f42cb36"}, + {file = "pydantic_core-2.23.4-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:dcedcd19a557e182628afa1d553c3895a9f825b936415d0dbd3cd0bbcfd29b4b"}, + {file = "pydantic_core-2.23.4-cp39-cp39-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:5f54b118ce5de9ac21c363d9b3caa6c800341e8c47a508787e5868c6b79c9323"}, + {file = "pydantic_core-2.23.4-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:86d2f57d3e1379a9525c5ab067b27dbb8a0642fb5d454e17a9ac434f9ce523e3"}, + {file = "pydantic_core-2.23.4-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:de6d1d1b9e5101508cb37ab0d972357cac5235f5c6533d1071964c47139257df"}, + {file = "pydantic_core-2.23.4-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:1278e0d324f6908e872730c9102b0112477a7f7cf88b308e4fc36ce1bdb6d58c"}, + {file = "pydantic_core-2.23.4-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:9a6b5099eeec78827553827f4c6b8615978bb4b6a88e5d9b93eddf8bb6790f55"}, + {file = "pydantic_core-2.23.4-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:e55541f756f9b3ee346b840103f32779c695a19826a4c442b7954550a0972040"}, + {file = "pydantic_core-2.23.4-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:a5c7ba8ffb6d6f8f2ab08743be203654bb1aaa8c9dcb09f82ddd34eadb695605"}, + {file = "pydantic_core-2.23.4-cp39-none-win32.whl", hash = "sha256:37b0fe330e4a58d3c58b24d91d1eb102aeec675a3db4c292ec3928ecd892a9a6"}, + {file = "pydantic_core-2.23.4-cp39-none-win_amd64.whl", hash = "sha256:1498bec4c05c9c787bde9125cfdcc63a41004ff167f495063191b863399b1a29"}, + {file = "pydantic_core-2.23.4-pp310-pypy310_pp73-macosx_10_12_x86_64.whl", hash = "sha256:f455ee30a9d61d3e1a15abd5068827773d6e4dc513e795f380cdd59932c782d5"}, + {file = "pydantic_core-2.23.4-pp310-pypy310_pp73-macosx_11_0_arm64.whl", hash = "sha256:1e90d2e3bd2c3863d48525d297cd143fe541be8bbf6f579504b9712cb6b643ec"}, + {file = "pydantic_core-2.23.4-pp310-pypy310_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:2e203fdf807ac7e12ab59ca2bfcabb38c7cf0b33c41efeb00f8e5da1d86af480"}, + {file = "pydantic_core-2.23.4-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:e08277a400de01bc72436a0ccd02bdf596631411f592ad985dcee21445bd0068"}, + {file = "pydantic_core-2.23.4-pp310-pypy310_pp73-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:f220b0eea5965dec25480b6333c788fb72ce5f9129e8759ef876a1d805d00801"}, + {file = "pydantic_core-2.23.4-pp310-pypy310_pp73-musllinux_1_1_aarch64.whl", hash = "sha256:d06b0c8da4f16d1d1e352134427cb194a0a6e19ad5db9161bf32b2113409e728"}, + {file = "pydantic_core-2.23.4-pp310-pypy310_pp73-musllinux_1_1_x86_64.whl", hash = "sha256:ba1a0996f6c2773bd83e63f18914c1de3c9dd26d55f4ac302a7efe93fb8e7433"}, + {file = "pydantic_core-2.23.4-pp310-pypy310_pp73-win_amd64.whl", hash = "sha256:9a5bce9d23aac8f0cf0836ecfc033896aa8443b501c58d0602dbfd5bd5b37753"}, + {file = "pydantic_core-2.23.4-pp39-pypy39_pp73-macosx_10_12_x86_64.whl", hash = "sha256:78ddaaa81421a29574a682b3179d4cf9e6d405a09b99d93ddcf7e5239c742e21"}, + {file = "pydantic_core-2.23.4-pp39-pypy39_pp73-macosx_11_0_arm64.whl", hash = "sha256:883a91b5dd7d26492ff2f04f40fbb652de40fcc0afe07e8129e8ae779c2110eb"}, + {file = "pydantic_core-2.23.4-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:88ad334a15b32a791ea935af224b9de1bf99bcd62fabf745d5f3442199d86d59"}, + {file = "pydantic_core-2.23.4-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:233710f069d251feb12a56da21e14cca67994eab08362207785cf8c598e74577"}, + {file = "pydantic_core-2.23.4-pp39-pypy39_pp73-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:19442362866a753485ba5e4be408964644dd6a09123d9416c54cd49171f50744"}, + {file = "pydantic_core-2.23.4-pp39-pypy39_pp73-musllinux_1_1_aarch64.whl", hash = "sha256:624e278a7d29b6445e4e813af92af37820fafb6dcc55c012c834f9e26f9aaaef"}, + {file = "pydantic_core-2.23.4-pp39-pypy39_pp73-musllinux_1_1_x86_64.whl", hash = "sha256:f5ef8f42bec47f21d07668a043f077d507e5bf4e668d5c6dfe6aaba89de1a5b8"}, + {file = "pydantic_core-2.23.4-pp39-pypy39_pp73-win_amd64.whl", hash = "sha256:aea443fffa9fbe3af1a9ba721a87f926fe548d32cab71d188a6ede77d0ff244e"}, + {file = "pydantic_core-2.23.4.tar.gz", hash = "sha256:2584f7cf844ac4d970fba483a717dbe10c1c1c96a969bf65d61ffe94df1b2863"}, +] + +[package.dependencies] +typing-extensions = ">=4.6.0,<4.7.0 || >4.7.0" + +[[package]] +name = "pylint" +version = "3.2.3" +description = "python code static checker" +optional = false +python-versions = ">=3.8.0" +files = [ + {file = "pylint-3.2.3-py3-none-any.whl", hash = "sha256:b3d7d2708a3e04b4679e02d99e72329a8b7ee8afb8d04110682278781f889fa8"}, + {file = "pylint-3.2.3.tar.gz", hash = "sha256:02f6c562b215582386068d52a30f520d84fdbcf2a95fc7e855b816060d048b60"}, +] + +[package.dependencies] +astroid = ">=3.2.2,<=3.3.0-dev0" +colorama = {version = ">=0.4.5", markers = "sys_platform == \"win32\""} +dill = [ + {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" +mccabe = ">=0.6,<0.8" +platformdirs = ">=2.2.0" +tomli = {version = ">=1.1.0", markers = "python_version < \"3.11\""} +tomlkit = ">=0.10.1" +typing-extensions = {version = ">=3.10.0", markers = "python_version < \"3.10\""} + +[package.extras] +spelling = ["pyenchant (>=3.2,<4.0)"] +testutils = ["gitpython (>3)"] + +[[package]] +name = "python-dateutil" +version = "2.8.2" +description = "Extensions to the standard Python datetime module" +optional = false +python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,>=2.7" +files = [ + {file = "python-dateutil-2.8.2.tar.gz", hash = "sha256:0123cacc1627ae19ddf3c27a5de5bd67ee4586fbdd6440d9748f8abb483d3e86"}, + {file = "python_dateutil-2.8.2-py2.py3-none-any.whl", hash = "sha256:961d03dc3453ebbc59dbdea9e4e11c5651520a876d0f4db161e8674aae935da9"}, +] + +[package.dependencies] +six = ">=1.5" + +[[package]] +name = "six" +version = "1.16.0" +description = "Python 2 and 3 compatibility utilities" +optional = false +python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*" +files = [ + {file = "six-1.16.0-py2.py3-none-any.whl", hash = "sha256:8abb2f1d86890a2dfb989f9a77cfcfd3e47c2a354b01111771326f8aa26e0254"}, + {file = "six-1.16.0.tar.gz", hash = "sha256:1e61c37477a1626458e36f7b1d82aa5c9b094fa4802892072e49de9c60c4c926"}, +] + +[[package]] +name = "sniffio" +version = "1.3.1" +description = "Sniff out which async library your code is running under" +optional = false +python-versions = ">=3.7" +files = [ + {file = "sniffio-1.3.1-py3-none-any.whl", hash = "sha256:2f6da418d1f1e0fddd844478f41680e794e6051915791a034ff65e5f100525a2"}, + {file = "sniffio-1.3.1.tar.gz", hash = "sha256:f4324edc670a0f49750a81b895f35c3adb843cca46f0530f79fc1babb23789dc"}, +] + +[[package]] +name = "tomli" +version = "2.0.2" +description = "A lil' TOML parser" +optional = false +python-versions = ">=3.8" +files = [ + {file = "tomli-2.0.2-py3-none-any.whl", hash = "sha256:2ebe24485c53d303f690b0ec092806a085f07af5a5aa1464f3931eec36caaa38"}, + {file = "tomli-2.0.2.tar.gz", hash = "sha256:d46d457a85337051c36524bc5349dd91b1877838e2979ac5ced3e710ed8a60ed"}, +] + +[[package]] +name = "tomlkit" +version = "0.13.2" +description = "Style preserving TOML library" +optional = false +python-versions = ">=3.8" +files = [ + {file = "tomlkit-0.13.2-py3-none-any.whl", hash = "sha256:7a974427f6e119197f670fbbbeae7bef749a6c14e793db934baefc1b5f03efde"}, + {file = "tomlkit-0.13.2.tar.gz", hash = "sha256:fff5fe59a87295b278abd31bec92c15d9bc4a06885ab12bcea52c71119392e79"}, +] + +[[package]] +name = "types-python-dateutil" +version = "2.9.0.20241003" +description = "Typing stubs for python-dateutil" +optional = false +python-versions = ">=3.8" +files = [ + {file = "types-python-dateutil-2.9.0.20241003.tar.gz", hash = "sha256:58cb85449b2a56d6684e41aeefb4c4280631246a0da1a719bdbe6f3fb0317446"}, + {file = "types_python_dateutil-2.9.0.20241003-py3-none-any.whl", hash = "sha256:250e1d8e80e7bbc3a6c99b907762711d1a1cdd00e978ad39cb5940f6f0a87f3d"}, +] + +[[package]] +name = "typing-extensions" +version = "4.12.2" +description = "Backported and Experimental Type Hints for Python 3.8+" +optional = false +python-versions = ">=3.8" +files = [ + {file = "typing_extensions-4.12.2-py3-none-any.whl", hash = "sha256:04e5ca0351e0f3f85c6853954072df659d0d13fac324d0072316b67d7794700d"}, + {file = "typing_extensions-4.12.2.tar.gz", hash = "sha256:1a7ead55c7e559dd4dee8856e3a88b41225abfe1ce8df57b7c13915fe121ffb8"}, +] + +[[package]] +name = "typing-inspect" +version = "0.9.0" +description = "Runtime inspection utilities for typing module." +optional = false +python-versions = "*" +files = [ + {file = "typing_inspect-0.9.0-py3-none-any.whl", hash = "sha256:9ee6fc59062311ef8547596ab6b955e1b8aa46242d854bfc78f4f6b0eff35f9f"}, + {file = "typing_inspect-0.9.0.tar.gz", hash = "sha256:b23fc42ff6f6ef6954e4852c1fb512cdd18dbea03134f91f856a95ccc9461f78"}, +] + +[package.dependencies] +mypy-extensions = ">=0.3.0" +typing-extensions = ">=3.7.4" + +[metadata] +lock-version = "2.0" +python-versions = "^3.8" +content-hash = "6bb5f77afb8fcbe7327ccd1fcc33f5c279c6a2582d43be73b69c2a94b836b85d" diff --git a/previous-versions/sync-for-payables-version-1/poetry.toml b/previous-versions/sync-for-payables-version-1/poetry.toml new file mode 100644 index 000000000..ab1033bd3 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/poetry.toml @@ -0,0 +1,2 @@ +[virtualenvs] +in-project = true diff --git a/previous-versions/sync-for-payables-version-1/py.typed b/previous-versions/sync-for-payables-version-1/py.typed new file mode 100644 index 000000000..3e38f1a92 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/py.typed @@ -0,0 +1 @@ +# Marker file for PEP 561. The package enables type hints. diff --git a/previous-versions/sync-for-payables-version-1/pylintrc b/previous-versions/sync-for-payables-version-1/pylintrc index cebe76d49..508003862 100644 --- a/previous-versions/sync-for-payables-version-1/pylintrc +++ b/previous-versions/sync-for-payables-version-1/pylintrc @@ -59,10 +59,11 @@ ignore-paths= # Emacs file locks ignore-patterns=^\.# -# List of module names for which member attributes should not be checked -# (useful for modules/projects where namespaces are manipulated during runtime -# and thus existing member attributes cannot be deduced by static analysis). It -# supports qualified module names, as well as Unix pattern matching. +# List of module names for which member attributes should not be checked and +# will not be imported (useful for modules/projects where namespaces are +# manipulated during runtime and thus existing member attributes cannot be +# deduced by static analysis). It supports qualified module names, as well as +# Unix pattern matching. ignored-modules= # Python code to execute, usually for sys.path manipulation such as @@ -93,6 +94,12 @@ py-version=3.8 # Discover python modules and packages in the file system subtree. recursive=no +# Add paths to the list of the source roots. Supports globbing patterns. The +# source root is an absolute path or a path relative to the current working +# directory used to determine a package namespace for modules located under the +# source root. +source-roots=src + # When enabled, pylint would attempt to guess common misconfiguration and emit # user-friendly hints instead of false-positive error messages. suggestion-mode=yes @@ -180,6 +187,7 @@ good-names=i, ex, Run, _, + e, id # Good variable names regexes, separated by a comma. If names match any regex, @@ -224,6 +232,10 @@ no-docstring-rgx=^_ # These decorators are taken in consideration only for invalid-name. property-classes=abc.abstractproperty +# Regular expression matching correct type alias names. If left empty, type +# alias names will be checked with the set naming style. +typealias-rgx=.* + # Regular expression matching correct type variable names. If left empty, type # variable names will be checked with the set naming style. #typevar-rgx= @@ -246,15 +258,12 @@ check-protected-access-in-special-methods=no defining-attr-methods=__init__, __new__, setUp, + asyncSetUp, __post_init__ # List of member names, which should be excluded from the protected access # warning. -exclude-protected=_asdict, - _fields, - _replace, - _source, - _make +exclude-protected=_asdict,_fields,_replace,_source,_make,os._exit # List of valid names for the first argument in a class method. valid-classmethod-first-arg=cls @@ -417,6 +426,8 @@ disable=raw-checker-failed, suppressed-message, useless-suppression, deprecated-pragma, + use-implicit-booleaness-not-comparison-to-string, + use-implicit-booleaness-not-comparison-to-zero, use-symbolic-message-instead, trailing-whitespace, line-too-long, @@ -429,7 +440,6 @@ disable=raw-checker-failed, broad-exception-raised, too-few-public-methods, too-many-branches, - chained-comparison, duplicate-code, trailing-newlines, too-many-public-methods, @@ -441,13 +451,16 @@ disable=raw-checker-failed, too-many-nested-blocks, too-many-boolean-expressions, no-else-raise, - bare-except + bare-except, + broad-exception-caught, + fixme, + relative-beyond-top-level # Enable the message, report, category or checker with the given id(s). You can # either give multiple identifier separated by comma (,) or put this option # multiple time (only on the command line, not in the configuration file where # it should appear only once). See also the "--disable" option for examples. -enable=c-extension-no-member +enable= [METHOD_ARGS] @@ -493,8 +506,9 @@ evaluation=max(0, 0 if fatal else 10.0 - ((float(5 * error + warning + refactor # used to format the message information. See doc for all details. msg-template= -# Set the output format. Available formats are text, parseable, colorized, json -# and msvs (visual studio). You can also give a reporter class, e.g. +# Set the output format. Available formats are: text, parseable, colorized, +# json2 (improved json format), json (old json format) and msvs (visual +# studio). You can also give a reporter class, e.g. # mypackage.mymodule.MyReporterClass. #output-format= @@ -528,8 +542,8 @@ min-similarity-lines=4 # Limits count of emitted suggestions for spelling mistakes. max-spelling-suggestions=4 -# Spelling dictionary name. Available dictionaries: none. To make it work, -# install the 'python-enchant' package. +# Spelling dictionary name. No available dictionaries : You need to install +# both the python package and the system dependency for enchant to work. spelling-dict= # List of comma separated words that should be considered directives if they diff --git a/previous-versions/sync-for-payables-version-1/pyproject.toml b/previous-versions/sync-for-payables-version-1/pyproject.toml new file mode 100644 index 000000000..4c48a540e --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/pyproject.toml @@ -0,0 +1,55 @@ +[tool.poetry] +name = "codat-sync-for-payables-version-1" +version = "3.2.1" +description = "Push expenses to accounting software." +authors = ["Speakeasy",] +readme = "README-PYPI.md" +repository = "https://github.com/codatio/client-sdk-python.git" +packages = [ + { include = "codat_sync_for_payables_version_1", from = "src" } +] +include = ["py.typed", "src/codat_sync_for_payables_version_1/py.typed"] + +[tool.setuptools.package-data] +"*" = ["py.typed", "src/codat_sync_for_payables_version_1/py.typed"] + +[virtualenvs] +in-project = true + +[tool.poetry.dependencies] +python = "^3.8" +eval-type-backport = "^0.2.0" +httpx = "^0.27.0" +jsonpath-python = "^1.0.6" +pydantic = "~2.9.0" +python-dateutil = "2.8.2" +typing-inspect = "^0.9.0" + +[tool.poetry.group.dev.dependencies] +mypy = "==1.10.1" +pylint = "==3.2.3" +types-python-dateutil = "^2.9.0.20240316" + +[build-system] +requires = ["poetry-core"] +build-backend = "poetry.core.masonry.api" + +[tool.pytest.ini_options] +pythonpath = ["src"] + +[tool.mypy] +disable_error_code = "misc" + +[[tool.mypy.overrides]] +module = "typing_inspect" +ignore_missing_imports = true + +[[tool.mypy.overrides]] +module = "jsonpath" +ignore_missing_imports = true + +[tool.pyright] +venvPath = "." +venv = ".venv" + + diff --git a/previous-versions/sync-for-payables-version-1/scripts/compile.sh b/previous-versions/sync-for-payables-version-1/scripts/compile.sh new file mode 100755 index 000000000..fafe635b2 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/scripts/compile.sh @@ -0,0 +1,85 @@ +#!/usr/bin/env bash + +set -o pipefail # Ensure pipeline failures are propagated + +# Use temporary files to store outputs and exit statuses +declare -A output_files +declare -A status_files + +# Function to run a command with temporary output and status files +run_command() { + local cmd="$1" + local key="$2" + local output_file="$3" + local status_file="$4" + + # Run the command and store output and exit status + { + eval "$cmd" + echo $? > "$status_file" + } &> "$output_file" & +} + +poetry run python scripts/prepare-readme.py + +# Create temporary files for outputs and statuses +for cmd in compileall pylint mypy pyright; do + output_files[$cmd]=$(mktemp) + status_files[$cmd]=$(mktemp) +done + +# Collect PIDs for background processes +declare -a pids + +# Run commands in parallel using temporary files +echo "Running python -m compileall" +run_command 'poetry run python -m compileall -q . && echo "Success"' 'compileall' "${output_files[compileall]}" "${status_files[compileall]}" +pids+=($!) + +echo "Running pylint" +run_command 'poetry run pylint src' 'pylint' "${output_files[pylint]}" "${status_files[pylint]}" +pids+=($!) + +echo "Running mypy" +run_command 'poetry run mypy src' 'mypy' "${output_files[mypy]}" "${status_files[mypy]}" +pids+=($!) + +echo "Running pyright (optional)" +run_command 'if command -v pyright > /dev/null 2>&1; then pyright src; else echo "pyright not found, skipping"; fi' 'pyright' "${output_files[pyright]}" "${status_files[pyright]}" +pids+=($!) + +# Wait for all processes to complete +echo "Waiting for processes to complete" +for pid in "${pids[@]}"; do + wait "$pid" +done + +# Print output sequentially and check for failures +failed=false +for key in "${!output_files[@]}"; do + echo "--- Output from Command: $key ---" + echo + cat "${output_files[$key]}" + echo # Empty line for separation + echo "--- End of Output from Command: $key ---" + echo + + exit_status=$(cat "${status_files[$key]}") + if [ "$exit_status" -ne 0 ]; then + echo "Command $key failed with exit status $exit_status" >&2 + failed=true + fi +done + +# Clean up temporary files +for tmp_file in "${output_files[@]}" "${status_files[@]}"; do + rm -f "$tmp_file" +done + +if $failed; then + echo "One or more commands failed." >&2 + exit 1 +else + echo "All commands completed successfully." + exit 0 +fi diff --git a/previous-versions/sync-for-payables-version-1/scripts/prepare-readme.py b/previous-versions/sync-for-payables-version-1/scripts/prepare-readme.py new file mode 100644 index 000000000..7c07cddd7 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/scripts/prepare-readme.py @@ -0,0 +1,33 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +import re +import shutil + +try: + with open("README.md", "r") as rh: + readme_contents = rh.read() + GITHUB_URL = "https://github.com/codatio/client-sdk-python.git" + GITHUB_URL = ( + GITHUB_URL[: -len(".git")] if GITHUB_URL.endswith(".git") else GITHUB_URL + ) + # links on PyPI should have absolute URLs + readme_contents = re.sub( + r"(\[[^\]]+\]\()((?!https?:)[^\)]+)(\))", + lambda m: m.group(1) + + GITHUB_URL + + "/blob/master/" + + m.group(2) + + m.group(3), + readme_contents, + ) + + with open("README-PYPI.md", "w") as wh: + wh.write(readme_contents) +except Exception as e: + try: + print("Failed to rewrite README.md to README-PYPI.md, copying original instead") + print(e) + shutil.copyfile("README.md", "README-PYPI.md") + except Exception as e: + print("Failed to copy README.md to README-PYPI.md") + print(e) diff --git a/previous-versions/sync-for-payables-version-1/scripts/publish.sh b/previous-versions/sync-for-payables-version-1/scripts/publish.sh new file mode 100755 index 000000000..ab45b1f94 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/scripts/publish.sh @@ -0,0 +1,7 @@ +#!/usr/bin/env bash + +export POETRY_PYPI_TOKEN_PYPI=${PYPI_TOKEN} + +poetry run python scripts/prepare-readme.py + +poetry publish --build --skip-existing diff --git a/previous-versions/sync-for-payables-version-1/setup.py b/previous-versions/sync-for-payables-version-1/setup.py deleted file mode 100644 index 55e0c1741..000000000 --- a/previous-versions/sync-for-payables-version-1/setup.py +++ /dev/null @@ -1,41 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -import setuptools - -try: - with open("README.md", "r") as fh: - long_description = fh.read() -except FileNotFoundError: - long_description = "" - -setuptools.setup( - name="codat-sync-for-payables", - version="3.2.0", - author="Codat", - description="Streamline your customers' accounts payable workflow.", - long_description=long_description, - long_description_content_type="text/markdown", - packages=setuptools.find_packages(where="src"), - install_requires=[ - "certifi>=2023.7.22", - "charset-normalizer>=3.2.0", - "dataclasses-json-speakeasy>=0.5.11", - "idna>=3.4", - "jsonpath-python>=1.0.6 ", - "marshmallow>=3.19.0", - "mypy-extensions>=1.0.0", - "packaging>=23.1", - "python-dateutil>=2.8.2", - "requests>=2.31.0", - "six>=1.16.0", - "typing-inspect>=0.9.0", - "typing_extensions>=4.7.1", - "urllib3>=1.26.18", - ], - extras_require={ - "dev":["pylint==2.16.2"] - }, - package_dir={'': 'src'}, - python_requires='>=3.8', - package_data={"codat-sync-for-payables": ["py.typed"]}, -) diff --git a/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/__init__.py b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/__init__.py new file mode 100644 index 000000000..5c3491793 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/__init__.py @@ -0,0 +1,8 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from ._version import __title__, __version__ +from .sdk import * +from .sdkconfiguration import * + + +VERSION: str = __version__ diff --git a/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/_hooks/__init__.py b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/_hooks/__init__.py new file mode 100644 index 000000000..2ee66cdd5 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/_hooks/__init__.py @@ -0,0 +1,5 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from .sdkhooks import * +from .types import * +from .registration import * diff --git a/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/_hooks/registration.py b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/_hooks/registration.py new file mode 100644 index 000000000..cab477877 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/_hooks/registration.py @@ -0,0 +1,13 @@ +from .types import Hooks + + +# This file is only ever generated once on the first generation and then is free to be modified. +# Any hooks you wish to add should be registered in the init_hooks function. Feel free to define them +# in this file or in separate files in the hooks folder. + + +def init_hooks(hooks: Hooks): + # pylint: disable=unused-argument + """Add hooks by calling hooks.register{sdk_init/before_request/after_success/after_error}Hook + with an instance of a hook that implements that specific Hook interface + Hooks are registered per SDK instance, and are valid for the lifetime of the SDK instance""" diff --git a/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/_hooks/sdkhooks.py b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/_hooks/sdkhooks.py new file mode 100644 index 000000000..ec59a90ca --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/_hooks/sdkhooks.py @@ -0,0 +1,76 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +import httpx +from .types import ( + SDKInitHook, + BeforeRequestContext, + BeforeRequestHook, + AfterSuccessContext, + AfterSuccessHook, + AfterErrorContext, + AfterErrorHook, + Hooks, +) +from .registration import init_hooks +from typing import List, Optional, Tuple +from codat_sync_for_payables_version_1.httpclient import HttpClient + + +class SDKHooks(Hooks): + def __init__(self) -> None: + self.sdk_init_hooks: List[SDKInitHook] = [] + self.before_request_hooks: List[BeforeRequestHook] = [] + self.after_success_hooks: List[AfterSuccessHook] = [] + self.after_error_hooks: List[AfterErrorHook] = [] + init_hooks(self) + + def register_sdk_init_hook(self, hook: SDKInitHook) -> None: + self.sdk_init_hooks.append(hook) + + def register_before_request_hook(self, hook: BeforeRequestHook) -> None: + self.before_request_hooks.append(hook) + + def register_after_success_hook(self, hook: AfterSuccessHook) -> None: + self.after_success_hooks.append(hook) + + def register_after_error_hook(self, hook: AfterErrorHook) -> None: + self.after_error_hooks.append(hook) + + def sdk_init(self, base_url: str, client: HttpClient) -> Tuple[str, HttpClient]: + for hook in self.sdk_init_hooks: + base_url, client = hook.sdk_init(base_url, client) + return base_url, client + + def before_request( + self, hook_ctx: BeforeRequestContext, request: httpx.Request + ) -> httpx.Request: + for hook in self.before_request_hooks: + out = hook.before_request(hook_ctx, request) + if isinstance(out, Exception): + raise out + request = out + + return request + + def after_success( + self, hook_ctx: AfterSuccessContext, response: httpx.Response + ) -> httpx.Response: + for hook in self.after_success_hooks: + out = hook.after_success(hook_ctx, response) + if isinstance(out, Exception): + raise out + response = out + return response + + def after_error( + self, + hook_ctx: AfterErrorContext, + response: Optional[httpx.Response], + error: Optional[Exception], + ) -> Tuple[Optional[httpx.Response], Optional[Exception]]: + for hook in self.after_error_hooks: + result = hook.after_error(hook_ctx, response, error) + if isinstance(result, Exception): + raise result + response, error = result + return response, error diff --git a/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/_hooks/types.py b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/_hooks/types.py new file mode 100644 index 000000000..f290b68f8 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/_hooks/types.py @@ -0,0 +1,94 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from abc import ABC, abstractmethod +from codat_sync_for_payables_version_1.httpclient import HttpClient +import httpx +from typing import Any, Callable, List, Optional, Tuple, Union + + +class HookContext: + operation_id: str + oauth2_scopes: Optional[List[str]] = None + security_source: Optional[Union[Any, Callable[[], Any]]] = None + + def __init__( + self, + operation_id: str, + oauth2_scopes: Optional[List[str]], + security_source: Optional[Union[Any, Callable[[], Any]]], + ): + self.operation_id = operation_id + self.oauth2_scopes = oauth2_scopes + self.security_source = security_source + + +class BeforeRequestContext(HookContext): + def __init__(self, hook_ctx: HookContext): + super().__init__( + hook_ctx.operation_id, hook_ctx.oauth2_scopes, hook_ctx.security_source + ) + + +class AfterSuccessContext(HookContext): + def __init__(self, hook_ctx: HookContext): + super().__init__( + hook_ctx.operation_id, hook_ctx.oauth2_scopes, hook_ctx.security_source + ) + + +class AfterErrorContext(HookContext): + def __init__(self, hook_ctx: HookContext): + super().__init__( + hook_ctx.operation_id, hook_ctx.oauth2_scopes, hook_ctx.security_source + ) + + +class SDKInitHook(ABC): + @abstractmethod + def sdk_init(self, base_url: str, client: HttpClient) -> Tuple[str, HttpClient]: + pass + + +class BeforeRequestHook(ABC): + @abstractmethod + def before_request( + self, hook_ctx: BeforeRequestContext, request: httpx.Request + ) -> Union[httpx.Request, Exception]: + pass + + +class AfterSuccessHook(ABC): + @abstractmethod + def after_success( + self, hook_ctx: AfterSuccessContext, response: httpx.Response + ) -> Union[httpx.Response, Exception]: + pass + + +class AfterErrorHook(ABC): + @abstractmethod + def after_error( + self, + hook_ctx: AfterErrorContext, + response: Optional[httpx.Response], + error: Optional[Exception], + ) -> Union[Tuple[Optional[httpx.Response], Optional[Exception]], Exception]: + pass + + +class Hooks(ABC): + @abstractmethod + def register_sdk_init_hook(self, hook: SDKInitHook): + pass + + @abstractmethod + def register_before_request_hook(self, hook: BeforeRequestHook): + pass + + @abstractmethod + def register_after_success_hook(self, hook: AfterSuccessHook): + pass + + @abstractmethod + def register_after_error_hook(self, hook: AfterErrorHook): + pass diff --git a/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/_version.py b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/_version.py new file mode 100644 index 000000000..62d95481e --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/_version.py @@ -0,0 +1,12 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +import importlib.metadata + +__title__: str = "codat-sync-for-payables-version-1" +__version__: str = "3.2.1" + +try: + if __package__ is not None: + __version__ = importlib.metadata.version(__package__) +except importlib.metadata.PackageNotFoundError: + pass diff --git a/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/accounts.py b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/accounts.py new file mode 100644 index 000000000..e233bf13a --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/accounts.py @@ -0,0 +1,930 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from .basesdk import BaseSDK +from codat_sync_for_payables_version_1 import utils +from codat_sync_for_payables_version_1._hooks import HookContext +from codat_sync_for_payables_version_1.models import errors, operations, shared +from codat_sync_for_payables_version_1.types import BaseModel, OptionalNullable, UNSET +from typing import Any, Optional, Union, cast + + +class Accounts(BaseSDK): + r"""Get, create, and update Accounts.""" + + def create( + self, + *, + request: Union[ + operations.CreateAccountRequest, operations.CreateAccountRequestTypedDict + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.CreateAccountResponse]: + r"""Create account + + The *Create account* endpoint creates a new [account](https://docs.codat.io/sync-for-payables-api#/schemas/Account) for a given company's connection. + + [Accounts](https://docs.codat.io/sync-for-payables-api#/schemas/Account) are the categories a business uses to record accounting transactions. + + **Integration-specific behaviour** + + Required data may vary by integration. To see what data to post, first call [Get create account model](https://docs.codat.io/sync-for-payables-api#/operations/get-create-chartOfAccounts-model). + + Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=chartOfAccounts) for integrations that support creating an account. + + + :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.CreateAccountRequest) + request = cast(operations.CreateAccountRequest, request) + + req = self.build_request( + method="POST", + path="/companies/{companyId}/connections/{connectionId}/push/accounts", + 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.account_prototype, + False, + True, + "json", + Optional[shared.AccountPrototype], + ), + 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-account", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=[ + "400", + "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.CreateAccountResponse] + ) + if utils.match_response( + http_res, + ["400", "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 create_async( + self, + *, + request: Union[ + operations.CreateAccountRequest, operations.CreateAccountRequestTypedDict + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.CreateAccountResponse]: + r"""Create account + + The *Create account* endpoint creates a new [account](https://docs.codat.io/sync-for-payables-api#/schemas/Account) for a given company's connection. + + [Accounts](https://docs.codat.io/sync-for-payables-api#/schemas/Account) are the categories a business uses to record accounting transactions. + + **Integration-specific behaviour** + + Required data may vary by integration. To see what data to post, first call [Get create account model](https://docs.codat.io/sync-for-payables-api#/operations/get-create-chartOfAccounts-model). + + Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=chartOfAccounts) for integrations that support creating an account. + + + :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.CreateAccountRequest) + request = cast(operations.CreateAccountRequest, request) + + req = self.build_request_async( + method="POST", + path="/companies/{companyId}/connections/{connectionId}/push/accounts", + 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.account_prototype, + False, + True, + "json", + Optional[shared.AccountPrototype], + ), + 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-account", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=[ + "400", + "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.CreateAccountResponse] + ) + if utils.match_response( + http_res, + ["400", "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( + self, + *, + request: Union[ + operations.GetAccountRequest, operations.GetAccountRequestTypedDict + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.Account]: + r"""Get account + + The *Get account* endpoint returns a single account for a given `accountId`. + + [Accounts](https://docs.codat.io/sync-for-payables-api#/schemas/Account) are the categories a business uses to record accounting transactions. + + Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=chartOfAccounts) for integrations that support getting a specific account. + + Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/sync-for-payables-api#/operations/refresh-company-data). + + + :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.GetAccountRequest) + request = cast(operations.GetAccountRequest, request) + + req = self.build_request( + method="GET", + path="/companies/{companyId}/data/accounts/{accountId}", + 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-account", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=[ + "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[shared.Account]) + if utils.match_response( + http_res, + ["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 get_async( + self, + *, + request: Union[ + operations.GetAccountRequest, operations.GetAccountRequestTypedDict + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.Account]: + r"""Get account + + The *Get account* endpoint returns a single account for a given `accountId`. + + [Accounts](https://docs.codat.io/sync-for-payables-api#/schemas/Account) are the categories a business uses to record accounting transactions. + + Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=chartOfAccounts) for integrations that support getting a specific account. + + Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/sync-for-payables-api#/operations/refresh-company-data). + + + :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.GetAccountRequest) + request = cast(operations.GetAccountRequest, request) + + req = self.build_request_async( + method="GET", + path="/companies/{companyId}/data/accounts/{accountId}", + 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-account", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=[ + "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[shared.Account]) + if utils.match_response( + http_res, + ["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 get_create_model( + self, + *, + request: Union[ + operations.GetCreateAccountModelRequest, + operations.GetCreateAccountModelRequestTypedDict, + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.PushOption]: + r"""Get create account model + + The *Get create account model* endpoint returns the expected data for the request payload when creating an [account](https://docs.codat.io/sync-for-payables-api#/schemas/Account) for a given company and integration. + + [Accounts](https://docs.codat.io/sync-for-payables-api#/schemas/Account) are the categories a business uses to record accounting transactions. + + **Integration-specific behaviour** + + See the *response examples* for integration-specific indicative models. + + Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=chartOfAccounts) for integrations that support creating an account. + + + :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.GetCreateAccountModelRequest) + request = cast(operations.GetCreateAccountModelRequest, request) + + req = self.build_request( + method="GET", + path="/companies/{companyId}/connections/{connectionId}/options/chartOfAccounts", + 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-account-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.GetCreateAccountModelRequest, + operations.GetCreateAccountModelRequestTypedDict, + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.PushOption]: + r"""Get create account model + + The *Get create account model* endpoint returns the expected data for the request payload when creating an [account](https://docs.codat.io/sync-for-payables-api#/schemas/Account) for a given company and integration. + + [Accounts](https://docs.codat.io/sync-for-payables-api#/schemas/Account) are the categories a business uses to record accounting transactions. + + **Integration-specific behaviour** + + See the *response examples* for integration-specific indicative models. + + Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=chartOfAccounts) for integrations that support creating an account. + + + :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.GetCreateAccountModelRequest) + request = cast(operations.GetCreateAccountModelRequest, request) + + req = self.build_request_async( + method="GET", + path="/companies/{companyId}/connections/{connectionId}/options/chartOfAccounts", + 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-account-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 list( + self, + *, + request: Union[ + operations.ListAccountsRequest, operations.ListAccountsRequestTypedDict + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.Accounts]: + r"""List accounts + + The *List accounts* endpoint returns a list of [accounts](https://docs.codat.io/sync-for-payables-api#/schemas/Account) for a given company's connection. + + [Accounts](https://docs.codat.io/sync-for-payables-api#/schemas/Account) are the categories a business uses to record accounting transactions. + + Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/sync-for-payables-api#/operations/refresh-company-data). + + :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.ListAccountsRequest) + request = cast(operations.ListAccountsRequest, request) + + req = self.build_request( + method="GET", + path="/companies/{companyId}/data/accounts", + 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="list-accounts", + 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[shared.Accounts]) + 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 list_async( + self, + *, + request: Union[ + operations.ListAccountsRequest, operations.ListAccountsRequestTypedDict + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.Accounts]: + r"""List accounts + + The *List accounts* endpoint returns a list of [accounts](https://docs.codat.io/sync-for-payables-api#/schemas/Account) for a given company's connection. + + [Accounts](https://docs.codat.io/sync-for-payables-api#/schemas/Account) are the categories a business uses to record accounting transactions. + + Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/sync-for-payables-api#/operations/refresh-company-data). + + :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.ListAccountsRequest) + request = cast(operations.ListAccountsRequest, request) + + req = self.build_request_async( + method="GET", + path="/companies/{companyId}/data/accounts", + 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="list-accounts", + 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[shared.Accounts]) + 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, + ) diff --git a/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/bank_accounts.py b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/bank_accounts.py new file mode 100644 index 000000000..78d963c59 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/bank_accounts.py @@ -0,0 +1,490 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from .basesdk import BaseSDK +from codat_sync_for_payables_version_1 import utils +from codat_sync_for_payables_version_1._hooks import HookContext +from codat_sync_for_payables_version_1.models import errors, operations, shared +from codat_sync_for_payables_version_1.types import BaseModel, OptionalNullable, UNSET +from typing import Any, Optional, Union, cast + + +class BankAccounts(BaseSDK): + r"""Get, create, and update Bank accounts.""" + + def create( + self, + *, + request: Union[ + operations.CreateBankAccountRequest, + operations.CreateBankAccountRequestTypedDict, + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.BankAccountCreateResponse]: + r"""Create bank account + + The *Create bank account* endpoint creates a new [bank account](https://docs.codat.io/sync-for-payables-api#/schemas/BankAccount) for a given company's connection. + + [Bank accounts](https://docs.codat.io/sync-for-payables-api#/schemas/BankAccount) are financial accounts maintained by a bank or other financial institution. + + **Integration-specific behaviour** + + Required data may vary by integration. To see what data to post, first call [Get create/update bank account model](https://docs.codat.io/sync-for-payables-api#/operations/get-create-update-bankAccounts-model). + + Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=bankAccounts) for integrations that support creating an account. + + :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.CreateBankAccountRequest) + request = cast(operations.CreateBankAccountRequest, request) + + req = self.build_request( + method="POST", + path="/companies/{companyId}/connections/{connectionId}/push/bankAccounts", + 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.bank_account_prototype, + False, + True, + "json", + Optional[shared.BankAccountPrototype], + ), + 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-bank-account", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=[ + "400", + "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.BankAccountCreateResponse] + ) + if utils.match_response( + http_res, + ["400", "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 create_async( + self, + *, + request: Union[ + operations.CreateBankAccountRequest, + operations.CreateBankAccountRequestTypedDict, + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.BankAccountCreateResponse]: + r"""Create bank account + + The *Create bank account* endpoint creates a new [bank account](https://docs.codat.io/sync-for-payables-api#/schemas/BankAccount) for a given company's connection. + + [Bank accounts](https://docs.codat.io/sync-for-payables-api#/schemas/BankAccount) are financial accounts maintained by a bank or other financial institution. + + **Integration-specific behaviour** + + Required data may vary by integration. To see what data to post, first call [Get create/update bank account model](https://docs.codat.io/sync-for-payables-api#/operations/get-create-update-bankAccounts-model). + + Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=bankAccounts) for integrations that support creating an account. + + :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.CreateBankAccountRequest) + request = cast(operations.CreateBankAccountRequest, request) + + req = self.build_request_async( + method="POST", + path="/companies/{companyId}/connections/{connectionId}/push/bankAccounts", + 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.bank_account_prototype, + False, + True, + "json", + Optional[shared.BankAccountPrototype], + ), + 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-bank-account", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=[ + "400", + "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.BankAccountCreateResponse] + ) + if utils.match_response( + http_res, + ["400", "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_model( + self, + *, + request: Union[ + operations.GetCreateBankAccountsModelRequest, + operations.GetCreateBankAccountsModelRequestTypedDict, + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.PushOption]: + r"""Get create/update bank account model + + The *Get create/update bank account model* endpoint returns the expected data for the request payload when creating and updating a [bank account](https://docs.codat.io/sync-for-payables-api#/schemas/BankAccount) for a given company and integration. + + [Bank accounts](https://docs.codat.io/sync-for-payables-api#/schemas/BankAccount) are financial accounts maintained by a bank or other financial institution. + + **Integration-specific behaviour** + + See the *response examples* for integration-specific indicative models. + + Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=bankAccounts) for integrations that support creating and updating a bank account. + + + :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.GetCreateBankAccountsModelRequest + ) + request = cast(operations.GetCreateBankAccountsModelRequest, request) + + req = self.build_request( + method="GET", + path="/companies/{companyId}/connections/{connectionId}/options/bankAccounts", + 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-bankAccounts-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.GetCreateBankAccountsModelRequest, + operations.GetCreateBankAccountsModelRequestTypedDict, + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.PushOption]: + r"""Get create/update bank account model + + The *Get create/update bank account model* endpoint returns the expected data for the request payload when creating and updating a [bank account](https://docs.codat.io/sync-for-payables-api#/schemas/BankAccount) for a given company and integration. + + [Bank accounts](https://docs.codat.io/sync-for-payables-api#/schemas/BankAccount) are financial accounts maintained by a bank or other financial institution. + + **Integration-specific behaviour** + + See the *response examples* for integration-specific indicative models. + + Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=bankAccounts) for integrations that support creating and updating a bank account. + + + :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.GetCreateBankAccountsModelRequest + ) + request = cast(operations.GetCreateBankAccountsModelRequest, request) + + req = self.build_request_async( + method="GET", + path="/companies/{companyId}/connections/{connectionId}/options/bankAccounts", + 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-bankAccounts-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, + ) diff --git a/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/basesdk.py b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/basesdk.py new file mode 100644 index 000000000..8bed4b10b --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/basesdk.py @@ -0,0 +1,343 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from .sdkconfiguration import SDKConfiguration +from codat_sync_for_payables_version_1 import utils +from codat_sync_for_payables_version_1._hooks import ( + AfterErrorContext, + AfterSuccessContext, + BeforeRequestContext, +) +from codat_sync_for_payables_version_1.models import errors +from codat_sync_for_payables_version_1.utils import ( + RetryConfig, + SerializedRequestBody, + get_body_content, +) +import httpx +from typing import Callable, List, Optional, Tuple + + +class BaseSDK: + sdk_configuration: SDKConfiguration + + def __init__(self, sdk_config: SDKConfiguration) -> None: + self.sdk_configuration = sdk_config + + def get_url(self, base_url, url_variables): + sdk_url, sdk_variables = self.sdk_configuration.get_server_details() + + if base_url is None: + base_url = sdk_url + + if url_variables is None: + url_variables = sdk_variables + + return utils.template_url(base_url, url_variables) + + def build_request_async( + self, + method, + path, + base_url, + url_variables, + request, + request_body_required, + request_has_path_params, + request_has_query_params, + user_agent_header, + accept_header_value, + _globals=None, + security=None, + timeout_ms: Optional[int] = None, + get_serialized_body: Optional[ + Callable[[], Optional[SerializedRequestBody]] + ] = None, + url_override: Optional[str] = None, + ) -> httpx.Request: + client = self.sdk_configuration.async_client + return self.build_request_with_client( + client, + method, + path, + base_url, + url_variables, + request, + request_body_required, + request_has_path_params, + request_has_query_params, + user_agent_header, + accept_header_value, + _globals, + security, + timeout_ms, + get_serialized_body, + url_override, + ) + + def build_request( + self, + method, + path, + base_url, + url_variables, + request, + request_body_required, + request_has_path_params, + request_has_query_params, + user_agent_header, + accept_header_value, + _globals=None, + security=None, + timeout_ms: Optional[int] = None, + get_serialized_body: Optional[ + Callable[[], Optional[SerializedRequestBody]] + ] = None, + url_override: Optional[str] = None, + ) -> httpx.Request: + client = self.sdk_configuration.client + return self.build_request_with_client( + client, + method, + path, + base_url, + url_variables, + request, + request_body_required, + request_has_path_params, + request_has_query_params, + user_agent_header, + accept_header_value, + _globals, + security, + timeout_ms, + get_serialized_body, + url_override, + ) + + def build_request_with_client( + self, + client, + method, + path, + base_url, + url_variables, + request, + request_body_required, + request_has_path_params, + request_has_query_params, + user_agent_header, + accept_header_value, + _globals=None, + security=None, + timeout_ms: Optional[int] = None, + get_serialized_body: Optional[ + Callable[[], Optional[SerializedRequestBody]] + ] = None, + url_override: Optional[str] = None, + ) -> httpx.Request: + query_params = {} + + url = url_override + if url is None: + url = utils.generate_url( + self.get_url(base_url, url_variables), + path, + request if request_has_path_params else None, + _globals if request_has_path_params else None, + ) + + query_params = utils.get_query_params( + request if request_has_query_params else None, + _globals if request_has_query_params else None, + ) + + headers = utils.get_headers(request, _globals) + headers["Accept"] = accept_header_value + headers[user_agent_header] = self.sdk_configuration.user_agent + + if security is not None: + if callable(security): + security = security() + + if security is not None: + security_headers, security_query_params = utils.get_security(security) + headers = {**headers, **security_headers} + query_params = {**query_params, **security_query_params} + + serialized_request_body = SerializedRequestBody("application/octet-stream") + if get_serialized_body is not None: + rb = get_serialized_body() + if request_body_required and rb is None: + raise ValueError("request body is required") + + if rb is not None: + serialized_request_body = rb + + if ( + serialized_request_body.media_type is not None + and serialized_request_body.media_type + not in ( + "multipart/form-data", + "multipart/mixed", + ) + ): + headers["content-type"] = serialized_request_body.media_type + + timeout = timeout_ms / 1000 if timeout_ms is not None else None + + return client.build_request( + method, + url, + params=query_params, + content=serialized_request_body.content, + data=serialized_request_body.data, + files=serialized_request_body.files, + headers=headers, + timeout=timeout, + ) + + def do_request( + self, + hook_ctx, + request, + error_status_codes, + stream=False, + retry_config: Optional[Tuple[RetryConfig, List[str]]] = None, + ) -> httpx.Response: + client = self.sdk_configuration.client + logger = self.sdk_configuration.debug_logger + + def do(): + http_res = None + try: + req = self.sdk_configuration.get_hooks().before_request( + BeforeRequestContext(hook_ctx), request + ) + logger.debug( + "Request:\nMethod: %s\nURL: %s\nHeaders: %s\nBody: %s", + req.method, + req.url, + req.headers, + get_body_content(req), + ) + http_res = client.send(req, stream=stream) + except Exception as e: + _, e = self.sdk_configuration.get_hooks().after_error( + AfterErrorContext(hook_ctx), None, e + ) + if e is not None: + logger.debug("Request Exception", exc_info=True) + raise e + + if http_res is None: + logger.debug("Raising no response SDK error") + raise errors.SDKError("No response received") + + logger.debug( + "Response:\nStatus Code: %s\nURL: %s\nHeaders: %s\nBody: %s", + http_res.status_code, + http_res.url, + http_res.headers, + "" if stream else http_res.text, + ) + + if utils.match_status_codes(error_status_codes, http_res.status_code): + result, err = self.sdk_configuration.get_hooks().after_error( + AfterErrorContext(hook_ctx), http_res, None + ) + if err is not None: + logger.debug("Request Exception", exc_info=True) + raise err + if result is not None: + http_res = result + else: + logger.debug("Raising unexpected SDK error") + raise errors.SDKError("Unexpected error occurred") + + return http_res + + if retry_config is not None: + http_res = utils.retry(do, utils.Retries(retry_config[0], retry_config[1])) + else: + http_res = do() + + if not utils.match_status_codes(error_status_codes, http_res.status_code): + http_res = self.sdk_configuration.get_hooks().after_success( + AfterSuccessContext(hook_ctx), http_res + ) + + return http_res + + async def do_request_async( + self, + hook_ctx, + request, + error_status_codes, + stream=False, + retry_config: Optional[Tuple[RetryConfig, List[str]]] = None, + ) -> httpx.Response: + client = self.sdk_configuration.async_client + logger = self.sdk_configuration.debug_logger + + async def do(): + http_res = None + try: + req = self.sdk_configuration.get_hooks().before_request( + BeforeRequestContext(hook_ctx), request + ) + logger.debug( + "Request:\nMethod: %s\nURL: %s\nHeaders: %s\nBody: %s", + req.method, + req.url, + req.headers, + get_body_content(req), + ) + http_res = await client.send(req, stream=stream) + except Exception as e: + _, e = self.sdk_configuration.get_hooks().after_error( + AfterErrorContext(hook_ctx), None, e + ) + if e is not None: + logger.debug("Request Exception", exc_info=True) + raise e + + if http_res is None: + logger.debug("Raising no response SDK error") + raise errors.SDKError("No response received") + + logger.debug( + "Response:\nStatus Code: %s\nURL: %s\nHeaders: %s\nBody: %s", + http_res.status_code, + http_res.url, + http_res.headers, + "" if stream else http_res.text, + ) + + if utils.match_status_codes(error_status_codes, http_res.status_code): + result, err = self.sdk_configuration.get_hooks().after_error( + AfterErrorContext(hook_ctx), http_res, None + ) + if err is not None: + logger.debug("Request Exception", exc_info=True) + raise err + if result is not None: + http_res = result + else: + logger.debug("Raising unexpected SDK error") + raise errors.SDKError("Unexpected error occurred") + + return http_res + + if retry_config is not None: + http_res = await utils.retry_async( + do, utils.Retries(retry_config[0], retry_config[1]) + ) + else: + http_res = await do() + + if not utils.match_status_codes(error_status_codes, http_res.status_code): + http_res = self.sdk_configuration.get_hooks().after_success( + AfterSuccessContext(hook_ctx), http_res + ) + + return http_res diff --git a/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/bill_credit_notes.py b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/bill_credit_notes.py new file mode 100644 index 000000000..0d4711984 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/bill_credit_notes.py @@ -0,0 +1,1190 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from .basesdk import BaseSDK +from codat_sync_for_payables_version_1 import utils +from codat_sync_for_payables_version_1._hooks import HookContext +from codat_sync_for_payables_version_1.models import errors, operations, shared +from codat_sync_for_payables_version_1.types import BaseModel, OptionalNullable, UNSET +from typing import Any, Optional, Union, cast + + +class BillCreditNotes(BaseSDK): + r"""Get, create, and update Bill credit notes.""" + + def create( + self, + *, + request: Union[ + operations.CreateBillCreditNoteRequest, + operations.CreateBillCreditNoteRequestTypedDict, + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.CreateBillCreditNoteResponse]: + r"""Create bill credit note + + The *Create bill credit note* endpoint creates a new [bill credit note](https://docs.codat.io/sync-for-payables-api#/schemas/BillCreditNote) for a given company's connection. + + [Bill credit notes](https://docs.codat.io/sync-for-payables-api#/schemas/BillCreditNote) are issued by a supplier for the purpose of recording credit. + + **Integration-specific behaviour** + + Required data may vary by integration. To see what data to post, first call [Get create/update bill credit note model](https://docs.codat.io/sync-for-payables-api#/operations/get-create-update-billCreditNotes-model). + + Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=billCreditNotes) for integrations that support creating a bill credit note. + + + :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.CreateBillCreditNoteRequest) + request = cast(operations.CreateBillCreditNoteRequest, request) + + req = self.build_request( + method="POST", + path="/companies/{companyId}/connections/{connectionId}/push/billCreditNotes", + 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.bill_credit_note, + True, + True, + "json", + OptionalNullable[shared.BillCreditNote], + ), + 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-bill-credit-note", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=[ + "400", + "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.CreateBillCreditNoteResponse] + ) + if utils.match_response( + http_res, + ["400", "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 create_async( + self, + *, + request: Union[ + operations.CreateBillCreditNoteRequest, + operations.CreateBillCreditNoteRequestTypedDict, + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.CreateBillCreditNoteResponse]: + r"""Create bill credit note + + The *Create bill credit note* endpoint creates a new [bill credit note](https://docs.codat.io/sync-for-payables-api#/schemas/BillCreditNote) for a given company's connection. + + [Bill credit notes](https://docs.codat.io/sync-for-payables-api#/schemas/BillCreditNote) are issued by a supplier for the purpose of recording credit. + + **Integration-specific behaviour** + + Required data may vary by integration. To see what data to post, first call [Get create/update bill credit note model](https://docs.codat.io/sync-for-payables-api#/operations/get-create-update-billCreditNotes-model). + + Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=billCreditNotes) for integrations that support creating a bill credit note. + + + :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.CreateBillCreditNoteRequest) + request = cast(operations.CreateBillCreditNoteRequest, request) + + req = self.build_request_async( + method="POST", + path="/companies/{companyId}/connections/{connectionId}/push/billCreditNotes", + 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.bill_credit_note, + True, + True, + "json", + OptionalNullable[shared.BillCreditNote], + ), + 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-bill-credit-note", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=[ + "400", + "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.CreateBillCreditNoteResponse] + ) + if utils.match_response( + http_res, + ["400", "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( + self, + *, + request: Union[ + operations.GetBillCreditNoteRequest, + operations.GetBillCreditNoteRequestTypedDict, + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.BillCreditNote]: + r"""Get bill credit note + + The *Get bill credit note* endpoint returns a single bill credit note for a given `billCreditNoteId`. + + [Bill credit notes](https://docs.codat.io/sync-for-payables-api#/schemas/BillCreditNote) are issued by a supplier for the purpose of recording credit. + + Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=billCreditNotes) for integrations that support getting a specific bill credit note. + + Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/sync-for-payables-api#/operations/refresh-company-data). + + + :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.GetBillCreditNoteRequest) + request = cast(operations.GetBillCreditNoteRequest, request) + + req = self.build_request( + method="GET", + path="/companies/{companyId}/data/billCreditNotes/{billCreditNoteId}", + 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-bill-credit-note", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=[ + "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[shared.BillCreditNote]) + if utils.match_response( + http_res, + ["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 get_async( + self, + *, + request: Union[ + operations.GetBillCreditNoteRequest, + operations.GetBillCreditNoteRequestTypedDict, + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.BillCreditNote]: + r"""Get bill credit note + + The *Get bill credit note* endpoint returns a single bill credit note for a given `billCreditNoteId`. + + [Bill credit notes](https://docs.codat.io/sync-for-payables-api#/schemas/BillCreditNote) are issued by a supplier for the purpose of recording credit. + + Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=billCreditNotes) for integrations that support getting a specific bill credit note. + + Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/sync-for-payables-api#/operations/refresh-company-data). + + + :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.GetBillCreditNoteRequest) + request = cast(operations.GetBillCreditNoteRequest, request) + + req = self.build_request_async( + method="GET", + path="/companies/{companyId}/data/billCreditNotes/{billCreditNoteId}", + 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-bill-credit-note", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=[ + "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[shared.BillCreditNote]) + if utils.match_response( + http_res, + ["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 get_create_update_model( + self, + *, + request: Union[ + operations.GetCreateUpdateBillCreditNoteModelRequest, + operations.GetCreateUpdateBillCreditNoteModelRequestTypedDict, + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.PushOption]: + r"""Get create/update bill credit note model + + The *Get create/update bill credit note model* endpoint returns the expected data for the request payload when creating and updating a [bill credit note](https://docs.codat.io/sync-for-payables-api#/schemas/BillCreditNote) for a given company and integration. + + [Bill credit notes](https://docs.codat.io/sync-for-payables-api#/schemas/BillCreditNote) are issued by a supplier for the purpose of recording credit. + + **Integration-specific behaviour** + + See the *response examples* for integration-specific indicative models. + + Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=billCreditNotes) for integrations that support creating and updating a bill credit note. + + + :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.GetCreateUpdateBillCreditNoteModelRequest + ) + request = cast(operations.GetCreateUpdateBillCreditNoteModelRequest, request) + + req = self.build_request( + method="GET", + path="/companies/{companyId}/connections/{connectionId}/options/billCreditNotes", + 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-update-billCreditNote-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_update_model_async( + self, + *, + request: Union[ + operations.GetCreateUpdateBillCreditNoteModelRequest, + operations.GetCreateUpdateBillCreditNoteModelRequestTypedDict, + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.PushOption]: + r"""Get create/update bill credit note model + + The *Get create/update bill credit note model* endpoint returns the expected data for the request payload when creating and updating a [bill credit note](https://docs.codat.io/sync-for-payables-api#/schemas/BillCreditNote) for a given company and integration. + + [Bill credit notes](https://docs.codat.io/sync-for-payables-api#/schemas/BillCreditNote) are issued by a supplier for the purpose of recording credit. + + **Integration-specific behaviour** + + See the *response examples* for integration-specific indicative models. + + Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=billCreditNotes) for integrations that support creating and updating a bill credit note. + + + :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.GetCreateUpdateBillCreditNoteModelRequest + ) + request = cast(operations.GetCreateUpdateBillCreditNoteModelRequest, request) + + req = self.build_request_async( + method="GET", + path="/companies/{companyId}/connections/{connectionId}/options/billCreditNotes", + 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-update-billCreditNote-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 list( + self, + *, + request: Union[ + operations.ListBillCreditNotesRequest, + operations.ListBillCreditNotesRequestTypedDict, + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.BillCreditNotes]: + r"""List bill credit notes + + The *List bill credit notes* endpoint returns a list of [bill credit notes](https://docs.codat.io/sync-for-payables-api#/schemas/BillCreditNote) for a given company's connection. + + [Bill credit notes](https://docs.codat.io/sync-for-payables-api#/schemas/BillCreditNote) are issued by a supplier for the purpose of recording credit. + + Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/sync-for-payables-api#/operations/refresh-company-data). + + + :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.ListBillCreditNotesRequest) + request = cast(operations.ListBillCreditNotesRequest, request) + + req = self.build_request( + method="GET", + path="/companies/{companyId}/data/billCreditNotes", + 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="list-bill-credit-notes", + 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[shared.BillCreditNotes]) + 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 list_async( + self, + *, + request: Union[ + operations.ListBillCreditNotesRequest, + operations.ListBillCreditNotesRequestTypedDict, + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.BillCreditNotes]: + r"""List bill credit notes + + The *List bill credit notes* endpoint returns a list of [bill credit notes](https://docs.codat.io/sync-for-payables-api#/schemas/BillCreditNote) for a given company's connection. + + [Bill credit notes](https://docs.codat.io/sync-for-payables-api#/schemas/BillCreditNote) are issued by a supplier for the purpose of recording credit. + + Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/sync-for-payables-api#/operations/refresh-company-data). + + + :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.ListBillCreditNotesRequest) + request = cast(operations.ListBillCreditNotesRequest, request) + + req = self.build_request_async( + method="GET", + path="/companies/{companyId}/data/billCreditNotes", + 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="list-bill-credit-notes", + 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[shared.BillCreditNotes]) + 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 update( + self, + *, + request: Union[ + operations.UpdateBillCreditNoteRequest, + operations.UpdateBillCreditNoteRequestTypedDict, + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.UpdateBillCreditNoteResponse]: + r"""Update bill credit note + + The *Update bill credit note* endpoint updates an existing [bill credit note](https://docs.codat.io/sync-for-payables-api#/schemas/BillCreditNote) for a given company's connection. + + [Bill credit notes](https://docs.codat.io/sync-for-payables-api#/schemas/BillCreditNote) are issued by a supplier for the purpose of recording credit. + + **Integration-specific behaviour** + + Required data may vary by integration. To see what data to post, first call [Get create/update bill credit note model](https://docs.codat.io/sync-for-payables-api#/operations/get-create-update-billCreditNotes-model). + + Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=billCreditNotes) for integrations that support creating a bill credit note. + + + :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.UpdateBillCreditNoteRequest) + request = cast(operations.UpdateBillCreditNoteRequest, request) + + req = self.build_request( + method="PUT", + path="/companies/{companyId}/connections/{connectionId}/push/billCreditNotes/{billCreditNoteId}", + 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.bill_credit_note, + True, + True, + "json", + OptionalNullable[shared.BillCreditNote], + ), + 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="update-bill-credit-note", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=[ + "400", + "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.UpdateBillCreditNoteResponse] + ) + if utils.match_response( + http_res, + ["400", "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 update_async( + self, + *, + request: Union[ + operations.UpdateBillCreditNoteRequest, + operations.UpdateBillCreditNoteRequestTypedDict, + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.UpdateBillCreditNoteResponse]: + r"""Update bill credit note + + The *Update bill credit note* endpoint updates an existing [bill credit note](https://docs.codat.io/sync-for-payables-api#/schemas/BillCreditNote) for a given company's connection. + + [Bill credit notes](https://docs.codat.io/sync-for-payables-api#/schemas/BillCreditNote) are issued by a supplier for the purpose of recording credit. + + **Integration-specific behaviour** + + Required data may vary by integration. To see what data to post, first call [Get create/update bill credit note model](https://docs.codat.io/sync-for-payables-api#/operations/get-create-update-billCreditNotes-model). + + Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=billCreditNotes) for integrations that support creating a bill credit note. + + + :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.UpdateBillCreditNoteRequest) + request = cast(operations.UpdateBillCreditNoteRequest, request) + + req = self.build_request_async( + method="PUT", + path="/companies/{companyId}/connections/{connectionId}/push/billCreditNotes/{billCreditNoteId}", + 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.bill_credit_note, + True, + True, + "json", + OptionalNullable[shared.BillCreditNote], + ), + 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="update-bill-credit-note", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=[ + "400", + "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.UpdateBillCreditNoteResponse] + ) + if utils.match_response( + http_res, + ["400", "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, + ) diff --git a/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/bill_payments.py b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/bill_payments.py new file mode 100644 index 000000000..f3933e66c --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/bill_payments.py @@ -0,0 +1,1210 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from .basesdk import BaseSDK +from codat_sync_for_payables_version_1 import utils +from codat_sync_for_payables_version_1._hooks import HookContext +from codat_sync_for_payables_version_1.models import errors, operations, shared +from codat_sync_for_payables_version_1.types import BaseModel, OptionalNullable, UNSET +from typing import Any, Optional, Union, cast + + +class BillPayments(BaseSDK): + r"""Get, create, and update Bill payments.""" + + def create( + self, + *, + request: Union[ + operations.CreateBillPaymentRequest, + operations.CreateBillPaymentRequestTypedDict, + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.CreateBillPaymentResponse]: + r"""Create bill payments + + The *Create bill payment* endpoint creates a new [bill payment](https://docs.codat.io/sync-for-payables-api#/schemas/BillPayment) for a given company's connection. + + [Bill payments](https://docs.codat.io/sync-for-payables-api#/schemas/BillPayment) are an allocation of money within any customer accounts payable account. + + **Integration-specific behaviour** + + Required data may vary by integration. To see what data to post, first call [Get create bill payment model](https://docs.codat.io/sync-for-payables-api#/operations/get-create-billPayments-model). + + Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=billPayments) for integrations that support creating a bill payment. + + + :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.CreateBillPaymentRequest) + request = cast(operations.CreateBillPaymentRequest, request) + + req = self.build_request( + method="POST", + path="/companies/{companyId}/connections/{connectionId}/push/billPayments", + 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.bill_payment, + True, + True, + "json", + OptionalNullable[shared.BillPayment], + ), + 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-bill-payment", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=[ + "400", + "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.CreateBillPaymentResponse] + ) + if utils.match_response( + http_res, + ["400", "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 create_async( + self, + *, + request: Union[ + operations.CreateBillPaymentRequest, + operations.CreateBillPaymentRequestTypedDict, + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.CreateBillPaymentResponse]: + r"""Create bill payments + + The *Create bill payment* endpoint creates a new [bill payment](https://docs.codat.io/sync-for-payables-api#/schemas/BillPayment) for a given company's connection. + + [Bill payments](https://docs.codat.io/sync-for-payables-api#/schemas/BillPayment) are an allocation of money within any customer accounts payable account. + + **Integration-specific behaviour** + + Required data may vary by integration. To see what data to post, first call [Get create bill payment model](https://docs.codat.io/sync-for-payables-api#/operations/get-create-billPayments-model). + + Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=billPayments) for integrations that support creating a bill payment. + + + :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.CreateBillPaymentRequest) + request = cast(operations.CreateBillPaymentRequest, request) + + req = self.build_request_async( + method="POST", + path="/companies/{companyId}/connections/{connectionId}/push/billPayments", + 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.bill_payment, + True, + True, + "json", + OptionalNullable[shared.BillPayment], + ), + 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-bill-payment", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=[ + "400", + "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.CreateBillPaymentResponse] + ) + if utils.match_response( + http_res, + ["400", "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 delete( + self, + *, + request: Union[ + operations.DeleteBillPaymentRequest, + operations.DeleteBillPaymentRequestTypedDict, + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.PushOperation]: + r"""Delete bill payment + + The *Delete bill payment* endpoint allows you to delete a specified bill payment from an accounting software. + + [Bill payments](https://docs.codat.io/sync-for-payables-api#/schemas/BillPayment) are an allocation of money within any Accounts Payable account. + + ### Process + 1. Pass the `{billPaymentId}` to the *Delete bill payment* endpoint and store the `pushOperationKey` returned. + 2. Check the status of the delete operation by checking the status of the push operation either via + 1. [Push operation webhook](https://docs.codat.io/introduction/webhooks/core-rules-types#push-operation-status-has-changed) (advised), + 2. [Push operation status endpoint](https://docs.codat.io/sync-for-payables-api#/operations/get-push-operation). + + A `Success` status indicates that the bill payment object was deleted from the accounting software. + 3. (Optional) Check that the bill payment was deleted from the accounting software. + + ### Effect on related objects + Be aware that deleting a bill payment from an accounting software might cause related objects to be modified. + + ## Integration specifics + Integrations that support soft delete do not permanently delete the object in the accounting software. + + | Integration | Soft Delete | Details | + |-------------|-------------|---------| + | QuickBooks Online | No | - + | QuickBooks Desktop | No | - + | Oracle NetSuite | No | See [here](/integrations/accounting/netsuite/accounting-netsuite-how-deleting-bill-payments-works) to learn more. + | Xero | Yes | - + | Sage Intacct | No | Some bill payments in Sage Intacct can only be deleted, whilst others can only be voided. Codat have applied logic to handle this complexity. + + > **Supported integrations** + > + > This functionality is currently supported for our QuickBooks Online, QuickBooks Desktop, Oracle NetSuite, Xero and Sage Intacct integrations. + + :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.DeleteBillPaymentRequest) + request = cast(operations.DeleteBillPaymentRequest, request) + + req = self.build_request( + method="DELETE", + path="/companies/{companyId}/connections/{connectionId}/push/billPayments/{billPaymentId}", + 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="delete-billPayment", + 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.PushOperation]) + 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 delete_async( + self, + *, + request: Union[ + operations.DeleteBillPaymentRequest, + operations.DeleteBillPaymentRequestTypedDict, + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.PushOperation]: + r"""Delete bill payment + + The *Delete bill payment* endpoint allows you to delete a specified bill payment from an accounting software. + + [Bill payments](https://docs.codat.io/sync-for-payables-api#/schemas/BillPayment) are an allocation of money within any Accounts Payable account. + + ### Process + 1. Pass the `{billPaymentId}` to the *Delete bill payment* endpoint and store the `pushOperationKey` returned. + 2. Check the status of the delete operation by checking the status of the push operation either via + 1. [Push operation webhook](https://docs.codat.io/introduction/webhooks/core-rules-types#push-operation-status-has-changed) (advised), + 2. [Push operation status endpoint](https://docs.codat.io/sync-for-payables-api#/operations/get-push-operation). + + A `Success` status indicates that the bill payment object was deleted from the accounting software. + 3. (Optional) Check that the bill payment was deleted from the accounting software. + + ### Effect on related objects + Be aware that deleting a bill payment from an accounting software might cause related objects to be modified. + + ## Integration specifics + Integrations that support soft delete do not permanently delete the object in the accounting software. + + | Integration | Soft Delete | Details | + |-------------|-------------|---------| + | QuickBooks Online | No | - + | QuickBooks Desktop | No | - + | Oracle NetSuite | No | See [here](/integrations/accounting/netsuite/accounting-netsuite-how-deleting-bill-payments-works) to learn more. + | Xero | Yes | - + | Sage Intacct | No | Some bill payments in Sage Intacct can only be deleted, whilst others can only be voided. Codat have applied logic to handle this complexity. + + > **Supported integrations** + > + > This functionality is currently supported for our QuickBooks Online, QuickBooks Desktop, Oracle NetSuite, Xero and Sage Intacct integrations. + + :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.DeleteBillPaymentRequest) + request = cast(operations.DeleteBillPaymentRequest, request) + + req = self.build_request_async( + method="DELETE", + path="/companies/{companyId}/connections/{connectionId}/push/billPayments/{billPaymentId}", + 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="delete-billPayment", + 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.PushOperation]) + 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( + self, + *, + request: Union[ + operations.GetBillPaymentsRequest, + operations.GetBillPaymentsRequestTypedDict, + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.BillPayment]: + r"""Get bill payment + + The *Get bill payment* endpoint returns a single bill payment for a given `billPaymentId`. + + [Bill payments](https://docs.codat.io/sync-for-payables-api#/schemas/BillPayment) are an allocation of money within any Accounts Payable account. + + Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=billPayments) for integrations that support getting a specific bill payment. + + Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/sync-for-payables-api#/operations/refresh-company-data). + + + :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.GetBillPaymentsRequest) + request = cast(operations.GetBillPaymentsRequest, request) + + req = self.build_request( + method="GET", + path="/companies/{companyId}/data/billPayments/{billPaymentId}", + 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-bill-payments", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=[ + "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[shared.BillPayment]) + if utils.match_response( + http_res, + ["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 get_async( + self, + *, + request: Union[ + operations.GetBillPaymentsRequest, + operations.GetBillPaymentsRequestTypedDict, + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.BillPayment]: + r"""Get bill payment + + The *Get bill payment* endpoint returns a single bill payment for a given `billPaymentId`. + + [Bill payments](https://docs.codat.io/sync-for-payables-api#/schemas/BillPayment) are an allocation of money within any Accounts Payable account. + + Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=billPayments) for integrations that support getting a specific bill payment. + + Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/sync-for-payables-api#/operations/refresh-company-data). + + + :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.GetBillPaymentsRequest) + request = cast(operations.GetBillPaymentsRequest, request) + + req = self.build_request_async( + method="GET", + path="/companies/{companyId}/data/billPayments/{billPaymentId}", + 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-bill-payments", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=[ + "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[shared.BillPayment]) + if utils.match_response( + http_res, + ["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 get_create_model( + self, + *, + request: Union[ + operations.GetCreateBillPaymentModelRequest, + operations.GetCreateBillPaymentModelRequestTypedDict, + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.PushOption]: + r"""Get create bill payment model + + The *Get create bill payment model* endpoint returns the expected data for the request payload when creating a [bill payment](https://docs.codat.io/sync-for-payables-api#/schemas/BillPayment) for a given company and integration. + + [Bill payments](https://docs.codat.io/sync-for-payables-api#/schemas/BillPayment) are an allocation of money within any Accounts Payable account. + + **Integration-specific behaviour** + + See the *response examples* for integration-specific indicative models. + + Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=billPayments) for integrations that support creating a bill payment. + + + :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.GetCreateBillPaymentModelRequest + ) + request = cast(operations.GetCreateBillPaymentModelRequest, request) + + req = self.build_request( + method="GET", + path="/companies/{companyId}/connections/{connectionId}/options/billPayments", + 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-billPayment-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.GetCreateBillPaymentModelRequest, + operations.GetCreateBillPaymentModelRequestTypedDict, + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.PushOption]: + r"""Get create bill payment model + + The *Get create bill payment model* endpoint returns the expected data for the request payload when creating a [bill payment](https://docs.codat.io/sync-for-payables-api#/schemas/BillPayment) for a given company and integration. + + [Bill payments](https://docs.codat.io/sync-for-payables-api#/schemas/BillPayment) are an allocation of money within any Accounts Payable account. + + **Integration-specific behaviour** + + See the *response examples* for integration-specific indicative models. + + Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=billPayments) for integrations that support creating a bill payment. + + + :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.GetCreateBillPaymentModelRequest + ) + request = cast(operations.GetCreateBillPaymentModelRequest, request) + + req = self.build_request_async( + method="GET", + path="/companies/{companyId}/connections/{connectionId}/options/billPayments", + 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-billPayment-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 list( + self, + *, + request: Union[ + operations.ListBillPaymentsRequest, + operations.ListBillPaymentsRequestTypedDict, + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.BillPayments]: + r"""List bill payments + + The *List bill payments* endpoint returns a list of [bill payments](https://docs.codat.io/sync-for-payables-api#/schemas/BillPayment) for a given company's connection. + + [Bill payments](https://docs.codat.io/sync-for-payables-api#/schemas/BillPayment) are an allocation of money within any Accounts Payable account. + + Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/sync-for-payables-api#/operations/refresh-company-data). + + + :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.ListBillPaymentsRequest) + request = cast(operations.ListBillPaymentsRequest, request) + + req = self.build_request( + method="GET", + path="/companies/{companyId}/data/billPayments", + 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="list-bill-payments", + 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[shared.BillPayments]) + 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 list_async( + self, + *, + request: Union[ + operations.ListBillPaymentsRequest, + operations.ListBillPaymentsRequestTypedDict, + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.BillPayments]: + r"""List bill payments + + The *List bill payments* endpoint returns a list of [bill payments](https://docs.codat.io/sync-for-payables-api#/schemas/BillPayment) for a given company's connection. + + [Bill payments](https://docs.codat.io/sync-for-payables-api#/schemas/BillPayment) are an allocation of money within any Accounts Payable account. + + Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/sync-for-payables-api#/operations/refresh-company-data). + + + :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.ListBillPaymentsRequest) + request = cast(operations.ListBillPaymentsRequest, request) + + req = self.build_request_async( + method="GET", + path="/companies/{companyId}/data/billPayments", + 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="list-bill-payments", + 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[shared.BillPayments]) + 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, + ) diff --git a/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/bills.py b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/bills.py new file mode 100644 index 000000000..06e7f14ae --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/bills.py @@ -0,0 +1,2579 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from .basesdk import BaseSDK +from codat_sync_for_payables_version_1 import utils +from codat_sync_for_payables_version_1._hooks import HookContext +from codat_sync_for_payables_version_1.models import errors, operations, shared +from codat_sync_for_payables_version_1.types import BaseModel, OptionalNullable, UNSET +import httpx +from typing import Any, Optional, Union, cast + + +class Bills(BaseSDK): + r"""Get, create, and update Bills.""" + + def create( + self, + *, + request: Union[ + operations.CreateBillRequest, operations.CreateBillRequestTypedDict + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.CreateBillResponse]: + r"""Create bill + + The *Create bill* endpoint creates a new [bill](https://docs.codat.io/sync-for-payables-api#/schemas/Bill) for a given company's connection. + + [Bills](https://docs.codat.io/sync-for-payables-api#/schemas/Bill) are invoices that represent the SMB's financial obligations to their supplier for a purchase of goods or services. + + **Integration-specific behaviour** + + Required data may vary by integration. To see what data to post, first call [Get create/update bill model](https://docs.codat.io/sync-for-payables-api#/operations/get-create-update-bills-model). + + Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=bills) for integrations that support creating a bill. + + + :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.CreateBillRequest) + request = cast(operations.CreateBillRequest, request) + + req = self.build_request( + method="POST", + path="/companies/{companyId}/connections/{connectionId}/push/bills", + 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.bill, True, True, "json", OptionalNullable[shared.Bill] + ), + 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-bill", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=[ + "400", + "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.CreateBillResponse] + ) + if utils.match_response( + http_res, + ["400", "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 create_async( + self, + *, + request: Union[ + operations.CreateBillRequest, operations.CreateBillRequestTypedDict + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.CreateBillResponse]: + r"""Create bill + + The *Create bill* endpoint creates a new [bill](https://docs.codat.io/sync-for-payables-api#/schemas/Bill) for a given company's connection. + + [Bills](https://docs.codat.io/sync-for-payables-api#/schemas/Bill) are invoices that represent the SMB's financial obligations to their supplier for a purchase of goods or services. + + **Integration-specific behaviour** + + Required data may vary by integration. To see what data to post, first call [Get create/update bill model](https://docs.codat.io/sync-for-payables-api#/operations/get-create-update-bills-model). + + Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=bills) for integrations that support creating a bill. + + + :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.CreateBillRequest) + request = cast(operations.CreateBillRequest, request) + + req = self.build_request_async( + method="POST", + path="/companies/{companyId}/connections/{connectionId}/push/bills", + 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.bill, True, True, "json", OptionalNullable[shared.Bill] + ), + 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-bill", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=[ + "400", + "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.CreateBillResponse] + ) + if utils.match_response( + http_res, + ["400", "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 delete( + self, + *, + request: Union[ + operations.DeleteBillRequest, operations.DeleteBillRequestTypedDict + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.PushOperation]: + r"""Delete bill + + The *Delete bill* endpoint allows you to delete a specified bill from an accounting software. + + [Bills](https://docs.codat.io/sync-for-payables-api#/schemas/Bill) are itemized records of goods received or services provided to the SMB. + + ### Process + 1. Pass the `{billId}` to the *Delete bill* endpoint and store the `pushOperationKey` returned. + 2. Check the status of the delete operation by checking the status of the push operation either via + 1. [Push operation webhook](https://docs.codat.io/introduction/webhooks/core-rules-types#push-operation-status-has-changed) (advised), + 2. [Push operation status endpoint](https://docs.codat.io/sync-for-payables-api#/operations/get-push-operation). + + A `Success` status indicates that the bill object was deleted from the accounting software. + 3. (Optional) Check that the bill was deleted from the accounting software. + + ### Effect on related objects + + Be aware that deleting a bill from an accounting software might cause related objects to be modified. For example, if you delete a paid bill in QuickBooks Online or QuickBooks Desktop, the bill is deleted but the bill payment against that bill is not. The bill payment is converted to a payment on account. + + ## Integration specifics + Integrations that support soft delete do not permanently delete the object in the accounting software. + + | Integration | Soft Delete | Details | + |-------------|-------------|--------------------------------------------------------------------------------------------------------------| + | QuickBooks Online | No | - | + | QuickBooks Desktop | No | - | + | Oracle NetSuite | No | When deleting a bill that's already linked to a bill payment, you must delete the linked bill payment first. | | + | Sage Intacct | No | When deleting a bill that's already linked to a bill payment, you must delete the linked bill payment first. | + | Xero | No | Draft bills will be deleted. Open bills will be voided instead of deleted since Xero only allows voiding a bill once it's been posted. When deleting a bill that's already linked to a bill payment, you must delete the linked bill payment first. | + + > **Supported Integrations** + > + > This functionality is currently supported for our QuickBooks Online, QuickBooks Desktop, Xero, Oracle NetSuite and Sage Intacct integrations. + + :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.DeleteBillRequest) + request = cast(operations.DeleteBillRequest, request) + + req = self.build_request( + method="DELETE", + path="/companies/{companyId}/connections/{connectionId}/push/bills/{billId}", + 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="delete-bill", + 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.PushOperation]) + 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 delete_async( + self, + *, + request: Union[ + operations.DeleteBillRequest, operations.DeleteBillRequestTypedDict + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.PushOperation]: + r"""Delete bill + + The *Delete bill* endpoint allows you to delete a specified bill from an accounting software. + + [Bills](https://docs.codat.io/sync-for-payables-api#/schemas/Bill) are itemized records of goods received or services provided to the SMB. + + ### Process + 1. Pass the `{billId}` to the *Delete bill* endpoint and store the `pushOperationKey` returned. + 2. Check the status of the delete operation by checking the status of the push operation either via + 1. [Push operation webhook](https://docs.codat.io/introduction/webhooks/core-rules-types#push-operation-status-has-changed) (advised), + 2. [Push operation status endpoint](https://docs.codat.io/sync-for-payables-api#/operations/get-push-operation). + + A `Success` status indicates that the bill object was deleted from the accounting software. + 3. (Optional) Check that the bill was deleted from the accounting software. + + ### Effect on related objects + + Be aware that deleting a bill from an accounting software might cause related objects to be modified. For example, if you delete a paid bill in QuickBooks Online or QuickBooks Desktop, the bill is deleted but the bill payment against that bill is not. The bill payment is converted to a payment on account. + + ## Integration specifics + Integrations that support soft delete do not permanently delete the object in the accounting software. + + | Integration | Soft Delete | Details | + |-------------|-------------|--------------------------------------------------------------------------------------------------------------| + | QuickBooks Online | No | - | + | QuickBooks Desktop | No | - | + | Oracle NetSuite | No | When deleting a bill that's already linked to a bill payment, you must delete the linked bill payment first. | | + | Sage Intacct | No | When deleting a bill that's already linked to a bill payment, you must delete the linked bill payment first. | + | Xero | No | Draft bills will be deleted. Open bills will be voided instead of deleted since Xero only allows voiding a bill once it's been posted. When deleting a bill that's already linked to a bill payment, you must delete the linked bill payment first. | + + > **Supported Integrations** + > + > This functionality is currently supported for our QuickBooks Online, QuickBooks Desktop, Xero, Oracle NetSuite and Sage Intacct integrations. + + :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.DeleteBillRequest) + request = cast(operations.DeleteBillRequest, request) + + req = self.build_request_async( + method="DELETE", + path="/companies/{companyId}/connections/{connectionId}/push/bills/{billId}", + 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="delete-bill", + 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.PushOperation]) + 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 delete_attachment( + self, + *, + request: Union[ + operations.DeleteBillAttachmentRequest, + operations.DeleteBillAttachmentRequestTypedDict, + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.PushOperation]: + r"""Delete bill attachment + + The *Delete bill attachment* endpoint allows you to delete a specified bill attachment from an accounting software. + + [Bills](https://docs.codat.io/sync-for-payables-api#/schemas/Bill) are invoices + that represent the SMB's financial obligations to their supplier for a + purchase of goods or services. + + ### Process + + 1. Pass the `{billId}` and `{attachmentId}` to the *Delete bill attachment* endpoint and store the `pushOperationKey` returned. + + 2. Check the status of the delete operation by checking the status of push operation either via + + 1. [Push operation webhook](https://docs.codat.io/introduction/webhookscore-rules-types#push-operation-status-has-changed) (advised), + + 2. [Push operation status endpoint](https://docs.codat.io/sync-for-payables-api#/operations/get-push-operation). A `Success` status indicates that the bill attachment object was deleted from the accounting software. + + 3. (Optional) Check that the bill attachment was deleted from the accounting software. + + >**Supported Integrations** + > + >This functionality is currently only supported for our QuickBooks Online integration. + + :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.DeleteBillAttachmentRequest) + request = cast(operations.DeleteBillAttachmentRequest, request) + + req = self.build_request( + method="DELETE", + path="/companies/{companyId}/connections/{connectionId}/push/bills/{billId}/attachments/{attachmentId}", + 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="delete-bill-attachment", + 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.PushOperation]) + 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 delete_attachment_async( + self, + *, + request: Union[ + operations.DeleteBillAttachmentRequest, + operations.DeleteBillAttachmentRequestTypedDict, + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.PushOperation]: + r"""Delete bill attachment + + The *Delete bill attachment* endpoint allows you to delete a specified bill attachment from an accounting software. + + [Bills](https://docs.codat.io/sync-for-payables-api#/schemas/Bill) are invoices + that represent the SMB's financial obligations to their supplier for a + purchase of goods or services. + + ### Process + + 1. Pass the `{billId}` and `{attachmentId}` to the *Delete bill attachment* endpoint and store the `pushOperationKey` returned. + + 2. Check the status of the delete operation by checking the status of push operation either via + + 1. [Push operation webhook](https://docs.codat.io/introduction/webhookscore-rules-types#push-operation-status-has-changed) (advised), + + 2. [Push operation status endpoint](https://docs.codat.io/sync-for-payables-api#/operations/get-push-operation). A `Success` status indicates that the bill attachment object was deleted from the accounting software. + + 3. (Optional) Check that the bill attachment was deleted from the accounting software. + + >**Supported Integrations** + > + >This functionality is currently only supported for our QuickBooks Online integration. + + :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.DeleteBillAttachmentRequest) + request = cast(operations.DeleteBillAttachmentRequest, request) + + req = self.build_request_async( + method="DELETE", + path="/companies/{companyId}/connections/{connectionId}/push/bills/{billId}/attachments/{attachmentId}", + 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="delete-bill-attachment", + 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.PushOperation]) + 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 download_attachment( + self, + *, + request: Union[ + operations.DownloadBillAttachmentRequest, + operations.DownloadBillAttachmentRequestTypedDict, + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[httpx.Response]: + r"""Download bill attachment + + The *Download bill attachment* endpoint downloads a specific attachment for a given `billId` and `attachmentId`. + + [Bills](https://docs.codat.io/sync-for-payables-api#/schemas/Bill) are invoices that represent the SMB's financial obligations to their supplier for a purchase of goods or services. + + Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=bills) for integrations that support downloading a bill attachment. + + + :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.DownloadBillAttachmentRequest) + request = cast(operations.DownloadBillAttachmentRequest, request) + + req = self.build_request( + method="GET", + path="/companies/{companyId}/connections/{connectionId}/data/bills/{billId}/attachments/{attachmentId}/download", + 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/octet-stream", + 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="download-bill-attachment", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=[ + "401", + "402", + "403", + "404", + "429", + "4XX", + "500", + "503", + "5XX", + ], + stream=True, + retry_config=retry_config, + ) + + data: Any = None + if utils.match_response(http_res, "200", "application/octet-stream"): + return http_res + if utils.match_response( + http_res, + ["401", "402", "403", "404", "429", "500", "503"], + "application/json", + ): + http_res_text = utils.stream_to_text(http_res) + 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 download_attachment_async( + self, + *, + request: Union[ + operations.DownloadBillAttachmentRequest, + operations.DownloadBillAttachmentRequestTypedDict, + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[httpx.Response]: + r"""Download bill attachment + + The *Download bill attachment* endpoint downloads a specific attachment for a given `billId` and `attachmentId`. + + [Bills](https://docs.codat.io/sync-for-payables-api#/schemas/Bill) are invoices that represent the SMB's financial obligations to their supplier for a purchase of goods or services. + + Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=bills) for integrations that support downloading a bill attachment. + + + :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.DownloadBillAttachmentRequest) + request = cast(operations.DownloadBillAttachmentRequest, request) + + req = self.build_request_async( + method="GET", + path="/companies/{companyId}/connections/{connectionId}/data/bills/{billId}/attachments/{attachmentId}/download", + 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/octet-stream", + 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="download-bill-attachment", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=[ + "401", + "402", + "403", + "404", + "429", + "4XX", + "500", + "503", + "5XX", + ], + stream=True, + retry_config=retry_config, + ) + + data: Any = None + if utils.match_response(http_res, "200", "application/octet-stream"): + return http_res + if utils.match_response( + http_res, + ["401", "402", "403", "404", "429", "500", "503"], + "application/json", + ): + http_res_text = await utils.stream_to_text_async(http_res) + 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( + self, + *, + request: Union[operations.GetBillRequest, operations.GetBillRequestTypedDict], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.Bill]: + r"""Get bill + + The *Get bill* endpoint returns a single bill for a given `billId`. + + [Bills](https://docs.codat.io/sync-for-payables-api#/schemas/Bill) are invoices that represent the SMB's financial obligations to their supplier for a purchase of goods or services. + + Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=bills) for integrations that support getting a specific bill. + + Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/sync-for-payables-api#/operations/refresh-company-data). + + + :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.GetBillRequest) + request = cast(operations.GetBillRequest, request) + + req = self.build_request( + method="GET", + path="/companies/{companyId}/data/bills/{billId}", + 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-bill", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=[ + "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[shared.Bill]) + if utils.match_response( + http_res, + ["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 get_async( + self, + *, + request: Union[operations.GetBillRequest, operations.GetBillRequestTypedDict], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.Bill]: + r"""Get bill + + The *Get bill* endpoint returns a single bill for a given `billId`. + + [Bills](https://docs.codat.io/sync-for-payables-api#/schemas/Bill) are invoices that represent the SMB's financial obligations to their supplier for a purchase of goods or services. + + Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=bills) for integrations that support getting a specific bill. + + Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/sync-for-payables-api#/operations/refresh-company-data). + + + :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.GetBillRequest) + request = cast(operations.GetBillRequest, request) + + req = self.build_request_async( + method="GET", + path="/companies/{companyId}/data/bills/{billId}", + 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-bill", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=[ + "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[shared.Bill]) + if utils.match_response( + http_res, + ["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 get_attachment( + self, + *, + request: Union[ + operations.GetBillAttachmentRequest, + operations.GetBillAttachmentRequestTypedDict, + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.Attachment]: + r"""Get bill attachment + + The *Get bill attachment* endpoint returns a specific attachment for a given `billId` and `attachmentId`. + + [Bills](https://docs.codat.io/sync-for-payables-api#/schemas/Bill) are invoices that represent the SMB's financial obligations to their supplier for a purchase of goods or services. + + Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=bills) for integrations that support getting a bill attachment. + + + :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.GetBillAttachmentRequest) + request = cast(operations.GetBillAttachmentRequest, request) + + req = self.build_request( + method="GET", + path="/companies/{companyId}/connections/{connectionId}/data/bills/{billId}/attachments/{attachmentId}", + 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-bill-attachment", + 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.Attachment]) + 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_attachment_async( + self, + *, + request: Union[ + operations.GetBillAttachmentRequest, + operations.GetBillAttachmentRequestTypedDict, + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.Attachment]: + r"""Get bill attachment + + The *Get bill attachment* endpoint returns a specific attachment for a given `billId` and `attachmentId`. + + [Bills](https://docs.codat.io/sync-for-payables-api#/schemas/Bill) are invoices that represent the SMB's financial obligations to their supplier for a purchase of goods or services. + + Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=bills) for integrations that support getting a bill attachment. + + + :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.GetBillAttachmentRequest) + request = cast(operations.GetBillAttachmentRequest, request) + + req = self.build_request_async( + method="GET", + path="/companies/{companyId}/connections/{connectionId}/data/bills/{billId}/attachments/{attachmentId}", + 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-bill-attachment", + 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.Attachment]) + 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_update_model( + self, + *, + request: Union[ + operations.GetCreateUpdateBillModelRequest, + operations.GetCreateUpdateBillModelRequestTypedDict, + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.PushOption]: + r"""Get create/update bill model + + The *Get create/update bill model* endpoint returns the expected data for the request payload when creating and updating a [bill](https://docs.codat.io/sync-for-payables-api#/schemas/Bill) for a given company and integration. + + [Bills](https://docs.codat.io/sync-for-payables-api#/schemas/Bill) are invoices that represent the SMB's financial obligations to their supplier for a purchase of goods or services. + + **Integration-specific behaviour** + + See the *response examples* for integration-specific indicative models. + + Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=bills) for integrations that support creating and updating a bill. + + + :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.GetCreateUpdateBillModelRequest + ) + request = cast(operations.GetCreateUpdateBillModelRequest, request) + + req = self.build_request( + method="GET", + path="/companies/{companyId}/connections/{connectionId}/options/bills", + 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-update-bill-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_update_model_async( + self, + *, + request: Union[ + operations.GetCreateUpdateBillModelRequest, + operations.GetCreateUpdateBillModelRequestTypedDict, + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.PushOption]: + r"""Get create/update bill model + + The *Get create/update bill model* endpoint returns the expected data for the request payload when creating and updating a [bill](https://docs.codat.io/sync-for-payables-api#/schemas/Bill) for a given company and integration. + + [Bills](https://docs.codat.io/sync-for-payables-api#/schemas/Bill) are invoices that represent the SMB's financial obligations to their supplier for a purchase of goods or services. + + **Integration-specific behaviour** + + See the *response examples* for integration-specific indicative models. + + Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=bills) for integrations that support creating and updating a bill. + + + :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.GetCreateUpdateBillModelRequest + ) + request = cast(operations.GetCreateUpdateBillModelRequest, request) + + req = self.build_request_async( + method="GET", + path="/companies/{companyId}/connections/{connectionId}/options/bills", + 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-update-bill-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 list( + self, + *, + request: Union[ + operations.ListBillsRequest, operations.ListBillsRequestTypedDict + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.Bills]: + r"""List bills + + The *List bills* endpoint returns a list of [bills](https://docs.codat.io/sync-for-payables-api#/schemas/Bill) for a given company's connection. + + [Bills](https://docs.codat.io/sync-for-payables-api#/schemas/Bill) are invoices that represent the SMB's financial obligations to their supplier for a purchase of goods or services. + + :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.ListBillsRequest) + request = cast(operations.ListBillsRequest, request) + + req = self.build_request( + method="GET", + path="/companies/{companyId}/data/bills", + 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="list-bills", + 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[shared.Bills]) + 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 list_async( + self, + *, + request: Union[ + operations.ListBillsRequest, operations.ListBillsRequestTypedDict + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.Bills]: + r"""List bills + + The *List bills* endpoint returns a list of [bills](https://docs.codat.io/sync-for-payables-api#/schemas/Bill) for a given company's connection. + + [Bills](https://docs.codat.io/sync-for-payables-api#/schemas/Bill) are invoices that represent the SMB's financial obligations to their supplier for a purchase of goods or services. + + :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.ListBillsRequest) + request = cast(operations.ListBillsRequest, request) + + req = self.build_request_async( + method="GET", + path="/companies/{companyId}/data/bills", + 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="list-bills", + 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[shared.Bills]) + 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 list_attachments( + self, + *, + request: Union[ + operations.ListBillAttachmentsRequest, + operations.ListBillAttachmentsRequestTypedDict, + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.Attachments]: + r"""List bill attachments + + The *List bill attachments* endpoint returns a list of attachments available to download for a given `billId`. + + [Bills](https://docs.codat.io/sync-for-payables-api#/schemas/Bill) are invoices that represent the SMB's financial obligations to their supplier for a purchase of goods or services. + + :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.ListBillAttachmentsRequest) + request = cast(operations.ListBillAttachmentsRequest, request) + + req = self.build_request( + method="GET", + path="/companies/{companyId}/connections/{connectionId}/data/bills/{billId}/attachments", + 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="list-bill-attachments", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=[ + "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[shared.Attachments]) + if utils.match_response( + http_res, + ["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 list_attachments_async( + self, + *, + request: Union[ + operations.ListBillAttachmentsRequest, + operations.ListBillAttachmentsRequestTypedDict, + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.Attachments]: + r"""List bill attachments + + The *List bill attachments* endpoint returns a list of attachments available to download for a given `billId`. + + [Bills](https://docs.codat.io/sync-for-payables-api#/schemas/Bill) are invoices that represent the SMB's financial obligations to their supplier for a purchase of goods or services. + + :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.ListBillAttachmentsRequest) + request = cast(operations.ListBillAttachmentsRequest, request) + + req = self.build_request_async( + method="GET", + path="/companies/{companyId}/connections/{connectionId}/data/bills/{billId}/attachments", + 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="list-bill-attachments", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=[ + "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[shared.Attachments]) + if utils.match_response( + http_res, + ["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 update( + self, + *, + request: Union[ + operations.UpdateBillRequest, operations.UpdateBillRequestTypedDict + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.UpdateBillResponse]: + r"""Update bill + + The *Update bill* endpoint updates an existing [bill](https://docs.codat.io/sync-for-payables-api#/schemas/Bill) for a given company's connection. + + [Bills](https://docs.codat.io/sync-for-payables-api#/schemas/Bill) are invoices that represent the SMB's financial obligations to their supplier for a purchase of goods or services. + + **Integration-specific behaviour** + + Required data may vary by integration. To see what data to post, first call [Get create/update bill model](https://docs.codat.io/sync-for-payables-api#/operations/get-create-update-bills-model). + + Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=bills) for integrations that support creating a bill. + + + :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.UpdateBillRequest) + request = cast(operations.UpdateBillRequest, request) + + req = self.build_request( + method="PUT", + path="/companies/{companyId}/connections/{connectionId}/push/bills/{billId}", + 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.bill, True, True, "json", OptionalNullable[shared.Bill] + ), + 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="update-bill", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=[ + "400", + "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.UpdateBillResponse] + ) + if utils.match_response( + http_res, + ["400", "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 update_async( + self, + *, + request: Union[ + operations.UpdateBillRequest, operations.UpdateBillRequestTypedDict + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.UpdateBillResponse]: + r"""Update bill + + The *Update bill* endpoint updates an existing [bill](https://docs.codat.io/sync-for-payables-api#/schemas/Bill) for a given company's connection. + + [Bills](https://docs.codat.io/sync-for-payables-api#/schemas/Bill) are invoices that represent the SMB's financial obligations to their supplier for a purchase of goods or services. + + **Integration-specific behaviour** + + Required data may vary by integration. To see what data to post, first call [Get create/update bill model](https://docs.codat.io/sync-for-payables-api#/operations/get-create-update-bills-model). + + Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=bills) for integrations that support creating a bill. + + + :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.UpdateBillRequest) + request = cast(operations.UpdateBillRequest, request) + + req = self.build_request_async( + method="PUT", + path="/companies/{companyId}/connections/{connectionId}/push/bills/{billId}", + 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.bill, True, True, "json", OptionalNullable[shared.Bill] + ), + 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="update-bill", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=[ + "400", + "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.UpdateBillResponse] + ) + if utils.match_response( + http_res, + ["400", "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 upload_attachment( + self, + *, + request: Union[ + operations.UploadBillAttachmentRequest, + operations.UploadBillAttachmentRequestTypedDict, + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ): + r"""Upload bill attachment + + The *Upload bill attachment* endpoint uploads an attachment and assigns it against a specific `billId`. + + [Bills](https://docs.codat.io/sync-for-payables-api#/schemas/Bill) are invoices that represent the SMB's financial obligations to their supplier for a purchase of goods or services. + + **Integration-specific behaviour** + + For more details on supported file types by integration see [Attachments](https://docs.codat.io/sync-for-payables-api#/schemas/Attachment). + + Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=bills) for integrations that support uploading a bill attachment. + + + :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.UploadBillAttachmentRequest) + request = cast(operations.UploadBillAttachmentRequest, request) + + req = self.build_request( + method="POST", + path="/companies/{companyId}/connections/{connectionId}/push/bills/{billId}/attachments", + 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.attachment_upload, + False, + True, + "multipart", + Optional[shared.AttachmentUpload], + ), + 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="upload-bill-attachment", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=[ + "400", + "401", + "402", + "403", + "404", + "429", + "4XX", + "500", + "503", + "5XX", + ], + retry_config=retry_config, + ) + + data: Any = None + if utils.match_response(http_res, "200", "*"): + return + if utils.match_response( + http_res, + ["400", "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 upload_attachment_async( + self, + *, + request: Union[ + operations.UploadBillAttachmentRequest, + operations.UploadBillAttachmentRequestTypedDict, + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ): + r"""Upload bill attachment + + The *Upload bill attachment* endpoint uploads an attachment and assigns it against a specific `billId`. + + [Bills](https://docs.codat.io/sync-for-payables-api#/schemas/Bill) are invoices that represent the SMB's financial obligations to their supplier for a purchase of goods or services. + + **Integration-specific behaviour** + + For more details on supported file types by integration see [Attachments](https://docs.codat.io/sync-for-payables-api#/schemas/Attachment). + + Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=bills) for integrations that support uploading a bill attachment. + + + :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.UploadBillAttachmentRequest) + request = cast(operations.UploadBillAttachmentRequest, request) + + req = self.build_request_async( + method="POST", + path="/companies/{companyId}/connections/{connectionId}/push/bills/{billId}/attachments", + 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.attachment_upload, + False, + True, + "multipart", + Optional[shared.AttachmentUpload], + ), + 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="upload-bill-attachment", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=[ + "400", + "401", + "402", + "403", + "404", + "429", + "4XX", + "500", + "503", + "5XX", + ], + retry_config=retry_config, + ) + + data: Any = None + if utils.match_response(http_res, "200", "*"): + return + if utils.match_response( + http_res, + ["400", "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, + ) diff --git a/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/companies.py b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/companies.py new file mode 100644 index 000000000..0d3531045 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/companies.py @@ -0,0 +1,1112 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from .basesdk import BaseSDK +from codat_sync_for_payables_version_1 import utils +from codat_sync_for_payables_version_1._hooks import HookContext +from codat_sync_for_payables_version_1.models import errors, operations, shared +from codat_sync_for_payables_version_1.types import BaseModel, OptionalNullable, UNSET +from typing import Any, Optional, Union, cast + + +class Companies(BaseSDK): + r"""Create and manage your SMB users' companies.""" + + def create( + self, + *, + request: Optional[ + Union[shared.CompanyRequestBody, shared.CompanyRequestBodyTypedDict] + ] = None, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.Company]: + r"""Create company + + Use the *Create company* endpoint to create a new [company](https://docs.codat.io/sync-for-payables-api#/schemas/Company) that represents your customer in Codat. + + A [company](https://docs.codat.io/sync-for-payables-api#/schemas/Company) represents a business sharing access to their data. + Each company can have multiple [connections](https://docs.codat.io/sync-for-payables-api#/schemas/Connection) to different data sources, such as one connection to Xero for accounting data, two connections to Plaid for two bank accounts, and a connection to Zettle for POS data. + + If forbidden characters (see `name` pattern) are present in the request, a company will be created with the forbidden characters removed. For example, `Company (Codat[1])` with be created as `Company Codat1`. + + :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, Optional[shared.CompanyRequestBody]) + request = cast(Optional[shared.CompanyRequestBody], request) + + req = self.build_request( + method="POST", + path="/companies", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=False, + 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, False, True, "json", Optional[shared.CompanyRequestBody] + ), + 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-company", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=[ + "400", + "401", + "402", + "403", + "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.Company]) + if utils.match_response( + http_res, + ["400", "401", "402", "403", "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_async( + self, + *, + request: Optional[ + Union[shared.CompanyRequestBody, shared.CompanyRequestBodyTypedDict] + ] = None, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.Company]: + r"""Create company + + Use the *Create company* endpoint to create a new [company](https://docs.codat.io/sync-for-payables-api#/schemas/Company) that represents your customer in Codat. + + A [company](https://docs.codat.io/sync-for-payables-api#/schemas/Company) represents a business sharing access to their data. + Each company can have multiple [connections](https://docs.codat.io/sync-for-payables-api#/schemas/Connection) to different data sources, such as one connection to Xero for accounting data, two connections to Plaid for two bank accounts, and a connection to Zettle for POS data. + + If forbidden characters (see `name` pattern) are present in the request, a company will be created with the forbidden characters removed. For example, `Company (Codat[1])` with be created as `Company Codat1`. + + :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, Optional[shared.CompanyRequestBody]) + request = cast(Optional[shared.CompanyRequestBody], request) + + req = self.build_request_async( + method="POST", + path="/companies", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=False, + 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, False, True, "json", Optional[shared.CompanyRequestBody] + ), + 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-company", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=[ + "400", + "401", + "402", + "403", + "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.Company]) + if utils.match_response( + http_res, + ["400", "401", "402", "403", "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, + *, + request: Union[ + operations.DeleteCompanyRequest, operations.DeleteCompanyRequestTypedDict + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ): + r"""Delete a company + + The *Delete company* endpoint permanently deletes a [company](https://docs.codat.io/sync-for-payables-api#/schemas/Company), its [connections](https://docs.codat.io/sync-for-payables-api#/schemas/Connection) and any cached data. This operation is irreversible. + + A [company](https://docs.codat.io/sync-for-payables-api#/schemas/Company) represents a business sharing access to their data. + Each company can have multiple [connections](https://docs.codat.io/sync-for-payables-api#/schemas/Connection) to different data sources, such as one connection to Xero for accounting data, two connections to Plaid for two bank accounts, and a connection to Zettle for POS data. + + + :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.DeleteCompanyRequest) + request = cast(operations.DeleteCompanyRequest, request) + + req = self.build_request( + method="DELETE", + path="/companies/{companyId}", + 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="delete-company", + 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, "204", "*"): + return + 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 delete_async( + self, + *, + request: Union[ + operations.DeleteCompanyRequest, operations.DeleteCompanyRequestTypedDict + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ): + r"""Delete a company + + The *Delete company* endpoint permanently deletes a [company](https://docs.codat.io/sync-for-payables-api#/schemas/Company), its [connections](https://docs.codat.io/sync-for-payables-api#/schemas/Connection) and any cached data. This operation is irreversible. + + A [company](https://docs.codat.io/sync-for-payables-api#/schemas/Company) represents a business sharing access to their data. + Each company can have multiple [connections](https://docs.codat.io/sync-for-payables-api#/schemas/Connection) to different data sources, such as one connection to Xero for accounting data, two connections to Plaid for two bank accounts, and a connection to Zettle for POS data. + + + :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.DeleteCompanyRequest) + request = cast(operations.DeleteCompanyRequest, request) + + req = self.build_request_async( + method="DELETE", + path="/companies/{companyId}", + 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="delete-company", + 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, "204", "*"): + return + 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( + self, + *, + request: Union[ + operations.GetCompanyRequest, operations.GetCompanyRequestTypedDict + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.Company]: + r"""Get company + + The *Get company* endpoint returns a single company for a given `companyId`. + + A [company](https://docs.codat.io/sync-for-payables-api#/schemas/Company) represents a business sharing access to their data. + Each company can have multiple [connections](https://docs.codat.io/sync-for-payables-api#/schemas/Connection) to different data sources, such as one connection to Xero for accounting data, two connections to Plaid for two bank accounts, and a connection to Zettle for POS data. + + + :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.GetCompanyRequest) + request = cast(operations.GetCompanyRequest, request) + + req = self.build_request( + method="GET", + path="/companies/{companyId}", + 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", + 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.Company]) + 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_async( + self, + *, + request: Union[ + operations.GetCompanyRequest, operations.GetCompanyRequestTypedDict + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.Company]: + r"""Get company + + The *Get company* endpoint returns a single company for a given `companyId`. + + A [company](https://docs.codat.io/sync-for-payables-api#/schemas/Company) represents a business sharing access to their data. + Each company can have multiple [connections](https://docs.codat.io/sync-for-payables-api#/schemas/Connection) to different data sources, such as one connection to Xero for accounting data, two connections to Plaid for two bank accounts, and a connection to Zettle for POS data. + + + :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.GetCompanyRequest) + request = cast(operations.GetCompanyRequest, request) + + req = self.build_request_async( + method="GET", + path="/companies/{companyId}", + 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", + 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.Company]) + 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, + *, + request: Union[ + operations.ListCompaniesRequest, operations.ListCompaniesRequestTypedDict + ] = operations.ListCompaniesRequest(), + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.Companies]: + r"""List companies + + The *List companies* endpoint returns a list of [companies] associated to your instances. + + A [company](https://docs.codat.io/sync-for-payables-api#/schemas/Company) represents a business sharing access to their data. + Each company can have multiple [connections](https://docs.codat.io/sync-for-payables-api#/schemas/Connection) to different data sources, such as one connection to Xero for accounting data, two connections to Plaid for two bank accounts, and a connection to Zettle for POS data. + + :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.ListCompaniesRequest) + request = cast(operations.ListCompaniesRequest, request) + + req = self.build_request( + method="GET", + path="/companies", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=False, + 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="list-companies", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=[ + "400", + "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.Companies]) + if utils.match_response( + http_res, + ["400", "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 list_async( + self, + *, + request: Union[ + operations.ListCompaniesRequest, operations.ListCompaniesRequestTypedDict + ] = operations.ListCompaniesRequest(), + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.Companies]: + r"""List companies + + The *List companies* endpoint returns a list of [companies] associated to your instances. + + A [company](https://docs.codat.io/sync-for-payables-api#/schemas/Company) represents a business sharing access to their data. + Each company can have multiple [connections](https://docs.codat.io/sync-for-payables-api#/schemas/Connection) to different data sources, such as one connection to Xero for accounting data, two connections to Plaid for two bank accounts, and a connection to Zettle for POS data. + + :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.ListCompaniesRequest) + request = cast(operations.ListCompaniesRequest, request) + + req = self.build_request_async( + method="GET", + path="/companies", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=False, + 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="list-companies", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=[ + "400", + "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.Companies]) + if utils.match_response( + http_res, + ["400", "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 update( + self, + *, + request: Union[ + operations.UpdateCompanyRequest, operations.UpdateCompanyRequestTypedDict + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.Company]: + r"""Update company + + Use the *Update company* endpoint to update both the name and description of the company. + + A [company](https://docs.codat.io/sync-for-payables-api#/schemas/Company) represents a business sharing access to their data. + Each company can have multiple [connections](https://docs.codat.io/sync-for-payables-api#/schemas/Connection) to different data sources, such as one connection to Xero for accounting data, two connections to Plaid for two bank accounts, and a connection to Zettle for POS data. + + :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.UpdateCompanyRequest) + request = cast(operations.UpdateCompanyRequest, request) + + req = self.build_request( + method="PUT", + path="/companies/{companyId}", + 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.company_request_body, + False, + True, + "json", + Optional[shared.CompanyRequestBody], + ), + 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="update-company", + 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.Company]) + 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 update_async( + self, + *, + request: Union[ + operations.UpdateCompanyRequest, operations.UpdateCompanyRequestTypedDict + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.Company]: + r"""Update company + + Use the *Update company* endpoint to update both the name and description of the company. + + A [company](https://docs.codat.io/sync-for-payables-api#/schemas/Company) represents a business sharing access to their data. + Each company can have multiple [connections](https://docs.codat.io/sync-for-payables-api#/schemas/Connection) to different data sources, such as one connection to Xero for accounting data, two connections to Plaid for two bank accounts, and a connection to Zettle for POS data. + + :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.UpdateCompanyRequest) + request = cast(operations.UpdateCompanyRequest, request) + + req = self.build_request_async( + method="PUT", + path="/companies/{companyId}", + 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.company_request_body, + False, + True, + "json", + Optional[shared.CompanyRequestBody], + ), + 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="update-company", + 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.Company]) + 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, + ) diff --git a/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/company_info.py b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/company_info.py new file mode 100644 index 000000000..35156b7ce --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/company_info.py @@ -0,0 +1,224 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from .basesdk import BaseSDK +from codat_sync_for_payables_version_1 import utils +from codat_sync_for_payables_version_1._hooks import HookContext +from codat_sync_for_payables_version_1.models import errors, operations, shared +from codat_sync_for_payables_version_1.types import BaseModel, OptionalNullable, UNSET +from typing import Any, Optional, Union, cast + + +class CompanyInfo(BaseSDK): + r"""View company profile from the source platform.""" + + def get_accounting_profile( + self, + *, + request: Union[ + operations.GetAccountingProfileRequest, + operations.GetAccountingProfileRequestTypedDict, + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.CompanyInfo]: + r"""Get company accounting profile + + Gets the latest basic info for a company. + + :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.GetAccountingProfileRequest) + request = cast(operations.GetAccountingProfileRequest, request) + + req = self.build_request( + method="GET", + path="/companies/{companyId}/data/info", + 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-accounting-profile", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=[ + "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[shared.CompanyInfo]) + if utils.match_response( + http_res, + ["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 get_accounting_profile_async( + self, + *, + request: Union[ + operations.GetAccountingProfileRequest, + operations.GetAccountingProfileRequestTypedDict, + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.CompanyInfo]: + r"""Get company accounting profile + + Gets the latest basic info for a company. + + :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.GetAccountingProfileRequest) + request = cast(operations.GetAccountingProfileRequest, request) + + req = self.build_request_async( + method="GET", + path="/companies/{companyId}/data/info", + 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-accounting-profile", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=[ + "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[shared.CompanyInfo]) + if utils.match_response( + http_res, + ["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, + ) diff --git a/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/connections.py b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/connections.py new file mode 100644 index 000000000..2dbf4e8a4 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/connections.py @@ -0,0 +1,1096 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from .basesdk import BaseSDK +from codat_sync_for_payables_version_1 import utils +from codat_sync_for_payables_version_1._hooks import HookContext +from codat_sync_for_payables_version_1.models import errors, operations, shared +from codat_sync_for_payables_version_1.types import BaseModel, OptionalNullable, UNSET +from typing import Any, Optional, Union, cast + + +class Connections(BaseSDK): + r"""Create new and manage existing data connections for a company.""" + + def create( + self, + *, + request: Union[ + operations.CreateConnectionRequest, + operations.CreateConnectionRequestTypedDict, + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.Connection]: + r"""Create connection + + Creates a connection for the company by providing a valid `platformKey`. + + Use the [List Integrations](https://docs.codat.io/sync-for-payables-api#/operations/list-integrations) endpoint to access valid platform keys. + + :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.CreateConnectionRequest) + request = cast(operations.CreateConnectionRequest, request) + + req = self.build_request( + method="POST", + path="/companies/{companyId}/connections", + 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.CreateConnectionRequestBody], + ), + 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-connection", + 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.Connection]) + 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 create_async( + self, + *, + request: Union[ + operations.CreateConnectionRequest, + operations.CreateConnectionRequestTypedDict, + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.Connection]: + r"""Create connection + + Creates a connection for the company by providing a valid `platformKey`. + + Use the [List Integrations](https://docs.codat.io/sync-for-payables-api#/operations/list-integrations) endpoint to access valid platform keys. + + :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.CreateConnectionRequest) + request = cast(operations.CreateConnectionRequest, request) + + req = self.build_request_async( + method="POST", + path="/companies/{companyId}/connections", + 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.CreateConnectionRequestBody], + ), + 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-connection", + 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.Connection]) + 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 delete( + self, + *, + request: Union[ + operations.DeleteConnectionRequest, + operations.DeleteConnectionRequestTypedDict, + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ): + r"""Delete connection + + Revoke and remove a connection from a company. + This operation is not reversible. The end user would need to reauthorize a new data connection if you wish to view new data for this company. + + :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.DeleteConnectionRequest) + request = cast(operations.DeleteConnectionRequest, request) + + req = self.build_request( + method="DELETE", + path="/companies/{companyId}/connections/{connectionId}", + 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="delete-connection", + 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", "*"): + return + 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 delete_async( + self, + *, + request: Union[ + operations.DeleteConnectionRequest, + operations.DeleteConnectionRequestTypedDict, + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ): + r"""Delete connection + + Revoke and remove a connection from a company. + This operation is not reversible. The end user would need to reauthorize a new data connection if you wish to view new data for this company. + + :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.DeleteConnectionRequest) + request = cast(operations.DeleteConnectionRequest, request) + + req = self.build_request_async( + method="DELETE", + path="/companies/{companyId}/connections/{connectionId}", + 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="delete-connection", + 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", "*"): + return + 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( + self, + *, + request: Union[ + operations.GetConnectionRequest, operations.GetConnectionRequestTypedDict + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.Connection]: + r"""Get connection + + Returns a specific connection for a company when valid identifiers are provided. If the identifiers are for a deleted company and/or connection, a not found response is returned. + + :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.GetConnectionRequest) + request = cast(operations.GetConnectionRequest, request) + + req = self.build_request( + method="GET", + path="/companies/{companyId}/connections/{connectionId}", + 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-connection", + 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.Connection]) + 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_async( + self, + *, + request: Union[ + operations.GetConnectionRequest, operations.GetConnectionRequestTypedDict + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.Connection]: + r"""Get connection + + Returns a specific connection for a company when valid identifiers are provided. If the identifiers are for a deleted company and/or connection, a not found response is returned. + + :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.GetConnectionRequest) + request = cast(operations.GetConnectionRequest, request) + + req = self.build_request_async( + method="GET", + path="/companies/{companyId}/connections/{connectionId}", + 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-connection", + 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.Connection]) + 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, + *, + request: Union[ + operations.ListConnectionsRequest, + operations.ListConnectionsRequestTypedDict, + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.Connections]: + r"""List connections + + List the connections for a company. + + :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.ListConnectionsRequest) + request = cast(operations.ListConnectionsRequest, request) + + req = self.build_request( + method="GET", + path="/companies/{companyId}/connections", + 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="list-connections", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=[ + "400", + "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.Connections]) + if utils.match_response( + http_res, + ["400", "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 list_async( + self, + *, + request: Union[ + operations.ListConnectionsRequest, + operations.ListConnectionsRequestTypedDict, + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.Connections]: + r"""List connections + + List the connections for a company. + + :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.ListConnectionsRequest) + request = cast(operations.ListConnectionsRequest, request) + + req = self.build_request_async( + method="GET", + path="/companies/{companyId}/connections", + 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="list-connections", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=[ + "400", + "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.Connections]) + if utils.match_response( + http_res, + ["400", "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 unlink( + self, + *, + request: Union[ + operations.UnlinkConnectionRequest, + operations.UnlinkConnectionRequestTypedDict, + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.Connection]: + r"""Unlink connection + + This allows you to deauthorize a connection, without deleting it from Codat. This means you can still view any data that has previously been pulled into Codat, and also lets you re-authorize in future if your customer wishes to resume sharing their data. + + :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.UnlinkConnectionRequest) + request = cast(operations.UnlinkConnectionRequest, request) + + req = self.build_request( + method="PATCH", + path="/companies/{companyId}/connections/{connectionId}", + 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.UnlinkConnectionUpdateConnection], + ), + 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="unlink-connection", + 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.Connection]) + 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 unlink_async( + self, + *, + request: Union[ + operations.UnlinkConnectionRequest, + operations.UnlinkConnectionRequestTypedDict, + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.Connection]: + r"""Unlink connection + + This allows you to deauthorize a connection, without deleting it from Codat. This means you can still view any data that has previously been pulled into Codat, and also lets you re-authorize in future if your customer wishes to resume sharing their data. + + :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.UnlinkConnectionRequest) + request = cast(operations.UnlinkConnectionRequest, request) + + req = self.build_request_async( + method="PATCH", + path="/companies/{companyId}/connections/{connectionId}", + 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.UnlinkConnectionUpdateConnection], + ), + 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="unlink-connection", + 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.Connection]) + 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, + ) diff --git a/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/httpclient.py b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/httpclient.py new file mode 100644 index 000000000..36b642a0e --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/httpclient.py @@ -0,0 +1,78 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +# pyright: reportReturnType = false +from typing_extensions import Protocol, runtime_checkable +import httpx +from typing import Any, Optional, Union + + +@runtime_checkable +class HttpClient(Protocol): + def send( + self, + request: httpx.Request, + *, + stream: bool = False, + auth: Union[ + httpx._types.AuthTypes, httpx._client.UseClientDefault, None + ] = httpx.USE_CLIENT_DEFAULT, + follow_redirects: Union[ + bool, httpx._client.UseClientDefault + ] = httpx.USE_CLIENT_DEFAULT, + ) -> httpx.Response: + pass + + def build_request( + self, + method: str, + url: httpx._types.URLTypes, + *, + content: Optional[httpx._types.RequestContent] = None, + data: Optional[httpx._types.RequestData] = None, + files: Optional[httpx._types.RequestFiles] = None, + json: Optional[Any] = None, + params: Optional[httpx._types.QueryParamTypes] = None, + headers: Optional[httpx._types.HeaderTypes] = None, + cookies: Optional[httpx._types.CookieTypes] = None, + timeout: Union[ + httpx._types.TimeoutTypes, httpx._client.UseClientDefault + ] = httpx.USE_CLIENT_DEFAULT, + extensions: Optional[httpx._types.RequestExtensions] = None, + ) -> httpx.Request: + pass + + +@runtime_checkable +class AsyncHttpClient(Protocol): + async def send( + self, + request: httpx.Request, + *, + stream: bool = False, + auth: Union[ + httpx._types.AuthTypes, httpx._client.UseClientDefault, None + ] = httpx.USE_CLIENT_DEFAULT, + follow_redirects: Union[ + bool, httpx._client.UseClientDefault + ] = httpx.USE_CLIENT_DEFAULT, + ) -> httpx.Response: + pass + + def build_request( + self, + method: str, + url: httpx._types.URLTypes, + *, + content: Optional[httpx._types.RequestContent] = None, + data: Optional[httpx._types.RequestData] = None, + files: Optional[httpx._types.RequestFiles] = None, + json: Optional[Any] = None, + params: Optional[httpx._types.QueryParamTypes] = None, + headers: Optional[httpx._types.HeaderTypes] = None, + cookies: Optional[httpx._types.CookieTypes] = None, + timeout: Union[ + httpx._types.TimeoutTypes, httpx._client.UseClientDefault + ] = httpx.USE_CLIENT_DEFAULT, + extensions: Optional[httpx._types.RequestExtensions] = None, + ) -> httpx.Request: + pass diff --git a/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/journal_entries.py b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/journal_entries.py new file mode 100644 index 000000000..40bb065ab --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/journal_entries.py @@ -0,0 +1,492 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from .basesdk import BaseSDK +from codat_sync_for_payables_version_1 import utils +from codat_sync_for_payables_version_1._hooks import HookContext +from codat_sync_for_payables_version_1.models import errors, operations, shared +from codat_sync_for_payables_version_1.types import BaseModel, OptionalNullable, UNSET +from typing import Any, Optional, Union, cast + + +class JournalEntries(BaseSDK): + r"""Get, create, and update Journal entries.""" + + def create( + self, + *, + request: Union[ + operations.CreateJournalEntryRequest, + operations.CreateJournalEntryRequestTypedDict, + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.CreateJournalEntryResponse]: + r"""Create journal entry + + The *Create journal entry* endpoint creates a new [journal entry](https://docs.codat.io/sync-for-payables-api#/schemas/JournalEntry) for a given company's connection. + + [Journal entries](https://docs.codat.io/sync-for-payables-api#/schemas/JournalEntry) are made in a company's general ledger, or accounts, when transactions are approved. + + **Integration-specific behaviour** + + Required data may vary by integration. To see what data to post, first call [Get create journal entry model](https://docs.codat.io/sync-for-payables-api#/operations/get-create-journalEntries-model). + + Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=journalEntries) for integrations that support creating a journal entry. + + + :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.CreateJournalEntryRequest) + request = cast(operations.CreateJournalEntryRequest, request) + + req = self.build_request( + method="POST", + path="/companies/{companyId}/connections/{connectionId}/push/journalEntries", + 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.journal_entry, + True, + True, + "json", + OptionalNullable[shared.JournalEntry], + ), + 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-journal-entry", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=[ + "400", + "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.CreateJournalEntryResponse] + ) + if utils.match_response( + http_res, + ["400", "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 create_async( + self, + *, + request: Union[ + operations.CreateJournalEntryRequest, + operations.CreateJournalEntryRequestTypedDict, + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.CreateJournalEntryResponse]: + r"""Create journal entry + + The *Create journal entry* endpoint creates a new [journal entry](https://docs.codat.io/sync-for-payables-api#/schemas/JournalEntry) for a given company's connection. + + [Journal entries](https://docs.codat.io/sync-for-payables-api#/schemas/JournalEntry) are made in a company's general ledger, or accounts, when transactions are approved. + + **Integration-specific behaviour** + + Required data may vary by integration. To see what data to post, first call [Get create journal entry model](https://docs.codat.io/sync-for-payables-api#/operations/get-create-journalEntries-model). + + Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=journalEntries) for integrations that support creating a journal entry. + + + :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.CreateJournalEntryRequest) + request = cast(operations.CreateJournalEntryRequest, request) + + req = self.build_request_async( + method="POST", + path="/companies/{companyId}/connections/{connectionId}/push/journalEntries", + 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.journal_entry, + True, + True, + "json", + OptionalNullable[shared.JournalEntry], + ), + 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-journal-entry", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=[ + "400", + "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.CreateJournalEntryResponse] + ) + if utils.match_response( + http_res, + ["400", "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_model( + self, + *, + request: Union[ + operations.GetCreateJournalEntryModelRequest, + operations.GetCreateJournalEntryModelRequestTypedDict, + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.PushOption]: + r"""Get create journal entry model + + The *Get create journal entry model* endpoint returns the expected data for the request payload when creating a [journal entry](https://docs.codat.io/sync-for-payables-api#/schemas/JournalEntry) for a given company and integration. + + [Journal entries](https://docs.codat.io/sync-for-payables-api#/schemas/JournalEntry) are made in a company's general ledger, or accounts, when transactions are approved. + + **Integration-specific behaviour** + + See the *response examples* for integration-specific indicative models. + + Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=journalEntries) for integrations that support creating a journal entry. + + + :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.GetCreateJournalEntryModelRequest + ) + request = cast(operations.GetCreateJournalEntryModelRequest, request) + + req = self.build_request( + method="GET", + path="/companies/{companyId}/connections/{connectionId}/options/journalEntries", + 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-journalEntry-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.GetCreateJournalEntryModelRequest, + operations.GetCreateJournalEntryModelRequestTypedDict, + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.PushOption]: + r"""Get create journal entry model + + The *Get create journal entry model* endpoint returns the expected data for the request payload when creating a [journal entry](https://docs.codat.io/sync-for-payables-api#/schemas/JournalEntry) for a given company and integration. + + [Journal entries](https://docs.codat.io/sync-for-payables-api#/schemas/JournalEntry) are made in a company's general ledger, or accounts, when transactions are approved. + + **Integration-specific behaviour** + + See the *response examples* for integration-specific indicative models. + + Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=journalEntries) for integrations that support creating a journal entry. + + + :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.GetCreateJournalEntryModelRequest + ) + request = cast(operations.GetCreateJournalEntryModelRequest, request) + + req = self.build_request_async( + method="GET", + path="/companies/{companyId}/connections/{connectionId}/options/journalEntries", + 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-journalEntry-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, + ) diff --git a/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/journals.py b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/journals.py new file mode 100644 index 000000000..3cc893277 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/journals.py @@ -0,0 +1,932 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from .basesdk import BaseSDK +from codat_sync_for_payables_version_1 import utils +from codat_sync_for_payables_version_1._hooks import HookContext +from codat_sync_for_payables_version_1.models import errors, operations, shared +from codat_sync_for_payables_version_1.types import BaseModel, OptionalNullable, UNSET +from typing import Any, Optional, Union, cast + + +class Journals(BaseSDK): + r"""Get, create, and update Journals.""" + + def create( + self, + *, + request: Union[ + operations.CreateJournalRequest, operations.CreateJournalRequestTypedDict + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.CreateJournalResponse]: + r"""Create journal + + The *Create journal* endpoint creates a new [journal](https://docs.codat.io/sync-for-payables-api#/schemas/Journal) for a given company's connection. + + [Journals](https://docs.codat.io/sync-for-payables-api#/schemas/Journal) are used to record all the financial transactions of a company. + + **Integration-specific behaviour** + + Required data may vary by integration. To see what data to post, first call [Get create journal model](https://docs.codat.io/sync-for-payables-api#/operations/get-create-journals-model). + + Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=journals) for integrations that support creating a journal. + + + :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.CreateJournalRequest) + request = cast(operations.CreateJournalRequest, request) + + req = self.build_request( + method="POST", + path="/companies/{companyId}/connections/{connectionId}/push/journals", + 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.journal_prototype, + False, + True, + "json", + Optional[shared.JournalPrototype], + ), + 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-journal", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=[ + "400", + "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.CreateJournalResponse] + ) + if utils.match_response( + http_res, + ["400", "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 create_async( + self, + *, + request: Union[ + operations.CreateJournalRequest, operations.CreateJournalRequestTypedDict + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.CreateJournalResponse]: + r"""Create journal + + The *Create journal* endpoint creates a new [journal](https://docs.codat.io/sync-for-payables-api#/schemas/Journal) for a given company's connection. + + [Journals](https://docs.codat.io/sync-for-payables-api#/schemas/Journal) are used to record all the financial transactions of a company. + + **Integration-specific behaviour** + + Required data may vary by integration. To see what data to post, first call [Get create journal model](https://docs.codat.io/sync-for-payables-api#/operations/get-create-journals-model). + + Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=journals) for integrations that support creating a journal. + + + :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.CreateJournalRequest) + request = cast(operations.CreateJournalRequest, request) + + req = self.build_request_async( + method="POST", + path="/companies/{companyId}/connections/{connectionId}/push/journals", + 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.journal_prototype, + False, + True, + "json", + Optional[shared.JournalPrototype], + ), + 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-journal", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=[ + "400", + "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.CreateJournalResponse] + ) + if utils.match_response( + http_res, + ["400", "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( + self, + *, + request: Union[ + operations.GetJournalRequest, operations.GetJournalRequestTypedDict + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.Journal]: + r"""Get journal + + The *Get journal* endpoint returns a single journal for a given `journalId`. + + [Journals](https://docs.codat.io/sync-for-payables-api#/schemas/Journal) are used to record all the financial transactions of a company. + + Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=journals) for integrations that support getting a specific journal. + + Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/sync-for-payables-api#/operations/refresh-company-data). + + + :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.GetJournalRequest) + request = cast(operations.GetJournalRequest, request) + + req = self.build_request( + method="GET", + path="/companies/{companyId}/data/journals/{journalId}", + 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-journal", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=[ + "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[shared.Journal]) + if utils.match_response( + http_res, + ["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 get_async( + self, + *, + request: Union[ + operations.GetJournalRequest, operations.GetJournalRequestTypedDict + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.Journal]: + r"""Get journal + + The *Get journal* endpoint returns a single journal for a given `journalId`. + + [Journals](https://docs.codat.io/sync-for-payables-api#/schemas/Journal) are used to record all the financial transactions of a company. + + Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=journals) for integrations that support getting a specific journal. + + Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/sync-for-payables-api#/operations/refresh-company-data). + + + :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.GetJournalRequest) + request = cast(operations.GetJournalRequest, request) + + req = self.build_request_async( + method="GET", + path="/companies/{companyId}/data/journals/{journalId}", + 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-journal", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=[ + "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[shared.Journal]) + if utils.match_response( + http_res, + ["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 get_create_model( + self, + *, + request: Union[ + operations.GetCreateJournalModelRequest, + operations.GetCreateJournalModelRequestTypedDict, + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.PushOption]: + r"""Get create journal model + + The *Get create journal model* endpoint returns the expected data for the request payload when creating a [journal](https://docs.codat.io/sync-for-payables-api#/schemas/Journal) for a given company and integration. + + [Journals](https://docs.codat.io/sync-for-payables-api#/schemas/Journal) are used to record all the financial transactions of a company. + + **Integration-specific behaviour** + + See the *response examples* for integration-specific indicative models. + + Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=journals) for integrations that support creating a journal. + + + :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.GetCreateJournalModelRequest) + request = cast(operations.GetCreateJournalModelRequest, request) + + req = self.build_request( + method="GET", + path="/companies/{companyId}/connections/{connectionId}/options/journals", + 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-journal-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.GetCreateJournalModelRequest, + operations.GetCreateJournalModelRequestTypedDict, + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.PushOption]: + r"""Get create journal model + + The *Get create journal model* endpoint returns the expected data for the request payload when creating a [journal](https://docs.codat.io/sync-for-payables-api#/schemas/Journal) for a given company and integration. + + [Journals](https://docs.codat.io/sync-for-payables-api#/schemas/Journal) are used to record all the financial transactions of a company. + + **Integration-specific behaviour** + + See the *response examples* for integration-specific indicative models. + + Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=journals) for integrations that support creating a journal. + + + :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.GetCreateJournalModelRequest) + request = cast(operations.GetCreateJournalModelRequest, request) + + req = self.build_request_async( + method="GET", + path="/companies/{companyId}/connections/{connectionId}/options/journals", + 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-journal-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 list( + self, + *, + request: Union[ + operations.ListJournalsRequest, operations.ListJournalsRequestTypedDict + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.Journals]: + r"""List journals + + The *List journals* endpoint returns a list of [journals](https://docs.codat.io/sync-for-payables-api#/schemas/Journal) for a given company's connection. + + [Journals](https://docs.codat.io/sync-for-payables-api#/schemas/Journal) are used to record all the financial transactions of a company. + + Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/sync-for-payables-api#/operations/refresh-company-data). + + + :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.ListJournalsRequest) + request = cast(operations.ListJournalsRequest, request) + + req = self.build_request( + method="GET", + path="/companies/{companyId}/data/journals", + 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="list-journals", + 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[shared.Journals]) + 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 list_async( + self, + *, + request: Union[ + operations.ListJournalsRequest, operations.ListJournalsRequestTypedDict + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.Journals]: + r"""List journals + + The *List journals* endpoint returns a list of [journals](https://docs.codat.io/sync-for-payables-api#/schemas/Journal) for a given company's connection. + + [Journals](https://docs.codat.io/sync-for-payables-api#/schemas/Journal) are used to record all the financial transactions of a company. + + Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/sync-for-payables-api#/operations/refresh-company-data). + + + :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.ListJournalsRequest) + request = cast(operations.ListJournalsRequest, request) + + req = self.build_request_async( + method="GET", + path="/companies/{companyId}/data/journals", + 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="list-journals", + 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[shared.Journals]) + 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, + ) diff --git a/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/manage_data.py b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/manage_data.py new file mode 100644 index 000000000..2dd79c9dd --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/manage_data.py @@ -0,0 +1,1078 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from .basesdk import BaseSDK +from codat_sync_for_payables_version_1 import utils +from codat_sync_for_payables_version_1._hooks import HookContext +from codat_sync_for_payables_version_1.models import errors, operations, shared +from codat_sync_for_payables_version_1.types import BaseModel, OptionalNullable, UNSET +from typing import Any, Optional, Union, cast + + +class ManageData(BaseSDK): + r"""Control how data is retrieved from an integration.""" + + def get( + self, + *, + request: Union[ + operations.GetDataStatusRequest, operations.GetDataStatusRequestTypedDict + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[operations.GetDataStatusDataStatuses]: + r"""Get data status + + Get the state of each data type for a company + + :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.GetDataStatusRequest) + request = cast(operations.GetDataStatusRequest, request) + + req = self.build_request( + method="GET", + path="/companies/{companyId}/dataStatus", + 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-data-status", + 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[operations.GetDataStatusDataStatuses] + ) + 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_async( + self, + *, + request: Union[ + operations.GetDataStatusRequest, operations.GetDataStatusRequestTypedDict + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[operations.GetDataStatusDataStatuses]: + r"""Get data status + + Get the state of each data type for a company + + :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.GetDataStatusRequest) + request = cast(operations.GetDataStatusRequest, request) + + req = self.build_request_async( + method="GET", + path="/companies/{companyId}/dataStatus", + 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-data-status", + 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[operations.GetDataStatusDataStatuses] + ) + 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_pull_operation( + self, + *, + request: Union[ + operations.GetPullOperationRequest, + operations.GetPullOperationRequestTypedDict, + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.PullOperation]: + r"""Get pull operation + + Retrieve information about a single dataset or pull operation. + + :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.GetPullOperationRequest) + request = cast(operations.GetPullOperationRequest, request) + + req = self.build_request( + method="GET", + path="/companies/{companyId}/data/history/{datasetId}", + 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-pull-operation", + 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.PullOperation]) + 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_pull_operation_async( + self, + *, + request: Union[ + operations.GetPullOperationRequest, + operations.GetPullOperationRequestTypedDict, + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.PullOperation]: + r"""Get pull operation + + Retrieve information about a single dataset or pull operation. + + :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.GetPullOperationRequest) + request = cast(operations.GetPullOperationRequest, request) + + req = self.build_request_async( + method="GET", + path="/companies/{companyId}/data/history/{datasetId}", + 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-pull-operation", + 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.PullOperation]) + 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_pull_operations( + self, + *, + request: Union[ + operations.ListPullOperationsRequest, + operations.ListPullOperationsRequestTypedDict, + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.PullOperations]: + r"""List pull operations + + Gets the pull operation history (datasets) for a given company. + + :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.ListPullOperationsRequest) + request = cast(operations.ListPullOperationsRequest, request) + + req = self.build_request( + method="GET", + path="/companies/{companyId}/data/history", + 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="list-pull-operations", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=[ + "400", + "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.PullOperations]) + if utils.match_response( + http_res, + ["400", "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 list_pull_operations_async( + self, + *, + request: Union[ + operations.ListPullOperationsRequest, + operations.ListPullOperationsRequestTypedDict, + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.PullOperations]: + r"""List pull operations + + Gets the pull operation history (datasets) for a given company. + + :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.ListPullOperationsRequest) + request = cast(operations.ListPullOperationsRequest, request) + + req = self.build_request_async( + method="GET", + path="/companies/{companyId}/data/history", + 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="list-pull-operations", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=[ + "400", + "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.PullOperations]) + if utils.match_response( + http_res, + ["400", "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 refresh_all_data_types( + self, + *, + request: Union[ + operations.RefreshAllDataTypesRequest, + operations.RefreshAllDataTypesRequestTypedDict, + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ): + r"""Refresh all data + + Refreshes all data types with `fetch on first link` set to `true` for a given company. + + This is an asynchronous operation, and will bring updated data into Codat from the linked integration for you to view. + + [Read more](https://docs.codat.io/core-concepts/data-type-settings) about data type settings and `fetch on first link`. + + :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.RefreshAllDataTypesRequest) + request = cast(operations.RefreshAllDataTypesRequest, request) + + req = self.build_request( + method="POST", + path="/companies/{companyId}/data/all", + 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="refresh-all-data-types", + 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, "204", "*"): + return + 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 refresh_all_data_types_async( + self, + *, + request: Union[ + operations.RefreshAllDataTypesRequest, + operations.RefreshAllDataTypesRequestTypedDict, + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ): + r"""Refresh all data + + Refreshes all data types with `fetch on first link` set to `true` for a given company. + + This is an asynchronous operation, and will bring updated data into Codat from the linked integration for you to view. + + [Read more](https://docs.codat.io/core-concepts/data-type-settings) about data type settings and `fetch on first link`. + + :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.RefreshAllDataTypesRequest) + request = cast(operations.RefreshAllDataTypesRequest, request) + + req = self.build_request_async( + method="POST", + path="/companies/{companyId}/data/all", + 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="refresh-all-data-types", + 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, "204", "*"): + return + 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 refresh_data_type( + self, + *, + request: Union[ + operations.RefreshDataTypeRequest, + operations.RefreshDataTypeRequestTypedDict, + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.PullOperation]: + r"""Refresh data type + + Refreshes a given data type for a given company. + + This is an asynchronous operation, and will bring updated data into Codat from the linked integration for you to view. + + :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.RefreshDataTypeRequest) + request = cast(operations.RefreshDataTypeRequest, request) + + req = self.build_request( + method="POST", + path="/companies/{companyId}/data/queue/{dataType}", + 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="refresh-data-type", + 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.PullOperation]) + 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 refresh_data_type_async( + self, + *, + request: Union[ + operations.RefreshDataTypeRequest, + operations.RefreshDataTypeRequestTypedDict, + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.PullOperation]: + r"""Refresh data type + + Refreshes a given data type for a given company. + + This is an asynchronous operation, and will bring updated data into Codat from the linked integration for you to view. + + :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.RefreshDataTypeRequest) + request = cast(operations.RefreshDataTypeRequest, request) + + req = self.build_request_async( + method="POST", + path="/companies/{companyId}/data/queue/{dataType}", + 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="refresh-data-type", + 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.PullOperation]) + 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, + ) diff --git a/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/errors/__init__.py b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/errors/__init__.py new file mode 100644 index 000000000..f056b05a6 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/errors/__init__.py @@ -0,0 +1,6 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from .errormessage import ErrorMessage, ErrorMessageData +from .sdkerror import SDKError + +__all__ = ["ErrorMessage", "ErrorMessageData", "SDKError"] diff --git a/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/errors/errormessage.py b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/errors/errormessage.py new file mode 100644 index 000000000..48f0b390f --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/errors/errormessage.py @@ -0,0 +1,52 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from codat_sync_for_payables_version_1 import utils +from codat_sync_for_payables_version_1.models.shared import ( + errorvalidation as shared_errorvalidation, +) +from codat_sync_for_payables_version_1.types import BaseModel, OptionalNullable, UNSET +import pydantic +from typing import Optional +from typing_extensions import Annotated + + +class ErrorMessageData(BaseModel): + can_be_retried: Annotated[Optional[str], pydantic.Field(alias="canBeRetried")] = ( + None + ) + r"""`True` if the error occurred transiently and can be retried.""" + + correlation_id: Annotated[Optional[str], pydantic.Field(alias="correlationId")] = ( + None + ) + r"""Unique identifier used to propagate to all downstream services and determine the source of the error.""" + + detailed_error_code: Annotated[ + Optional[int], pydantic.Field(alias="detailedErrorCode") + ] = None + r"""Machine readable error code used to automate processes based on the code returned.""" + + error: Optional[str] = None + r"""A brief description of the error.""" + + service: Optional[str] = None + r"""Codat's service the returned the error.""" + + status_code: Annotated[Optional[int], pydantic.Field(alias="statusCode")] = None + r"""The HTTP status code returned by the error.""" + + validation: OptionalNullable[shared_errorvalidation.ErrorValidation] = UNSET + r"""A human-readable object describing validation decisions Codat has made. If an operation has failed because of validation errors, they will be detailed here.""" + + +class ErrorMessage(Exception): + r"""Your `query` parameter was not correctly formed""" + + data: ErrorMessageData + + def __init__(self, data: ErrorMessageData): + self.data = data + + def __str__(self) -> str: + return utils.marshal_json(self.data, ErrorMessageData) diff --git a/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/errors/sdkerror.py b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/errors/sdkerror.py new file mode 100644 index 000000000..03216cbf5 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/errors/sdkerror.py @@ -0,0 +1,22 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from dataclasses import dataclass +from typing import Optional +import httpx + + +@dataclass +class SDKError(Exception): + """Represents an error returned by the API.""" + + message: str + status_code: int = -1 + body: str = "" + raw_response: Optional[httpx.Response] = None + + def __str__(self): + body = "" + if len(self.body) > 0: + body = f"\n{self.body}" + + return f"{self.message}: Status {self.status_code}{body}" diff --git a/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/operations/__init__.py b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/operations/__init__.py new file mode 100644 index 000000000..09312bc18 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/operations/__init__.py @@ -0,0 +1,305 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from .create_account import CreateAccountRequest, CreateAccountRequestTypedDict +from .create_bank_account import ( + CreateBankAccountRequest, + CreateBankAccountRequestTypedDict, +) +from .create_bill import CreateBillRequest, CreateBillRequestTypedDict +from .create_bill_credit_note import ( + CreateBillCreditNoteRequest, + CreateBillCreditNoteRequestTypedDict, +) +from .create_bill_payment import ( + CreateBillPaymentRequest, + CreateBillPaymentRequestTypedDict, +) +from .create_connection import ( + CreateConnectionRequest, + CreateConnectionRequestBody, + CreateConnectionRequestBodyTypedDict, + CreateConnectionRequestTypedDict, +) +from .create_journal import CreateJournalRequest, CreateJournalRequestTypedDict +from .create_journal_entry import ( + CreateJournalEntryRequest, + CreateJournalEntryRequestTypedDict, +) +from .create_supplier import CreateSupplierRequest, CreateSupplierRequestTypedDict +from .delete_bill import DeleteBillRequest, DeleteBillRequestTypedDict +from .delete_bill_attachment import ( + DeleteBillAttachmentRequest, + DeleteBillAttachmentRequestTypedDict, +) +from .delete_billpayment import ( + DeleteBillPaymentRequest, + DeleteBillPaymentRequestTypedDict, +) +from .delete_company import DeleteCompanyRequest, DeleteCompanyRequestTypedDict +from .delete_connection import DeleteConnectionRequest, DeleteConnectionRequestTypedDict +from .download_bill_attachment import ( + DownloadBillAttachmentRequest, + DownloadBillAttachmentRequestTypedDict, +) +from .get_account import GetAccountRequest, GetAccountRequestTypedDict +from .get_accounting_profile import ( + GetAccountingProfileRequest, + GetAccountingProfileRequestTypedDict, +) +from .get_bill import GetBillRequest, GetBillRequestTypedDict +from .get_bill_attachment import ( + GetBillAttachmentRequest, + GetBillAttachmentRequestTypedDict, +) +from .get_bill_credit_note import ( + GetBillCreditNoteRequest, + GetBillCreditNoteRequestTypedDict, +) +from .get_bill_payments import GetBillPaymentsRequest, GetBillPaymentsRequestTypedDict +from .get_company import GetCompanyRequest, GetCompanyRequestTypedDict +from .get_connection import GetConnectionRequest, GetConnectionRequestTypedDict +from .get_create_account_model import ( + GetCreateAccountModelRequest, + GetCreateAccountModelRequestTypedDict, +) +from .get_create_bankaccounts_model import ( + GetCreateBankAccountsModelRequest, + GetCreateBankAccountsModelRequestTypedDict, +) +from .get_create_billpayment_model import ( + GetCreateBillPaymentModelRequest, + GetCreateBillPaymentModelRequestTypedDict, +) +from .get_create_journal_model import ( + GetCreateJournalModelRequest, + GetCreateJournalModelRequestTypedDict, +) +from .get_create_journalentry_model import ( + GetCreateJournalEntryModelRequest, + GetCreateJournalEntryModelRequestTypedDict, +) +from .get_create_update_bill_model import ( + GetCreateUpdateBillModelRequest, + GetCreateUpdateBillModelRequestTypedDict, +) +from .get_create_update_billcreditnote_model import ( + GetCreateUpdateBillCreditNoteModelRequest, + GetCreateUpdateBillCreditNoteModelRequestTypedDict, +) +from .get_create_update_supplier_model import ( + GetCreateUpdateSupplierModelRequest, + GetCreateUpdateSupplierModelRequestTypedDict, +) +from .get_data_status import ( + GetDataStatusDataStatuses, + GetDataStatusDataStatusesTypedDict, + GetDataStatusRequest, + GetDataStatusRequestTypedDict, +) +from .get_journal import GetJournalRequest, GetJournalRequestTypedDict +from .get_payment_method import ( + GetPaymentMethodRequest, + GetPaymentMethodRequestTypedDict, +) +from .get_pull_operation import ( + GetPullOperationRequest, + GetPullOperationRequestTypedDict, +) +from .get_push_operation import ( + GetPushOperationRequest, + GetPushOperationRequestTypedDict, +) +from .get_supplier import GetSupplierRequest, GetSupplierRequestTypedDict +from .get_tax_rate import GetTaxRateRequest, GetTaxRateRequestTypedDict +from .get_tracking_category import ( + GetTrackingCategoryRequest, + GetTrackingCategoryRequestTypedDict, +) +from .list_accounts import ListAccountsRequest, ListAccountsRequestTypedDict +from .list_bill_attachments import ( + ListBillAttachmentsRequest, + ListBillAttachmentsRequestTypedDict, +) +from .list_bill_credit_notes import ( + ListBillCreditNotesRequest, + ListBillCreditNotesRequestTypedDict, +) +from .list_bill_payments import ( + ListBillPaymentsRequest, + ListBillPaymentsRequestTypedDict, +) +from .list_bills import ListBillsRequest, ListBillsRequestTypedDict +from .list_companies import ListCompaniesRequest, ListCompaniesRequestTypedDict +from .list_connections import ListConnectionsRequest, ListConnectionsRequestTypedDict +from .list_journals import ListJournalsRequest, ListJournalsRequestTypedDict +from .list_payment_methods import ( + ListPaymentMethodsRequest, + ListPaymentMethodsRequestTypedDict, +) +from .list_pull_operations import ( + ListPullOperationsRequest, + ListPullOperationsRequestTypedDict, +) +from .list_push_operations import ( + ListPushOperationsRequest, + ListPushOperationsRequestTypedDict, +) +from .list_suppliers import ListSuppliersRequest, ListSuppliersRequestTypedDict +from .list_tax_rates import ListTaxRatesRequest, ListTaxRatesRequestTypedDict +from .list_tracking_categories import ( + ListTrackingCategoriesRequest, + ListTrackingCategoriesRequestTypedDict, +) +from .refresh_all_data_types import ( + RefreshAllDataTypesRequest, + RefreshAllDataTypesRequestTypedDict, +) +from .refresh_data_type import RefreshDataTypeRequest, RefreshDataTypeRequestTypedDict +from .unlink_connection import ( + UnlinkConnectionRequest, + UnlinkConnectionRequestTypedDict, + UnlinkConnectionUpdateConnection, + UnlinkConnectionUpdateConnectionTypedDict, +) +from .update_bill import UpdateBillRequest, UpdateBillRequestTypedDict +from .update_bill_credit_note import ( + UpdateBillCreditNoteRequest, + UpdateBillCreditNoteRequestTypedDict, +) +from .update_company import UpdateCompanyRequest, UpdateCompanyRequestTypedDict +from .update_supplier import UpdateSupplierRequest, UpdateSupplierRequestTypedDict +from .upload_bill_attachment import ( + UploadBillAttachmentRequest, + UploadBillAttachmentRequestTypedDict, +) + +__all__ = [ + "CreateAccountRequest", + "CreateAccountRequestTypedDict", + "CreateBankAccountRequest", + "CreateBankAccountRequestTypedDict", + "CreateBillCreditNoteRequest", + "CreateBillCreditNoteRequestTypedDict", + "CreateBillPaymentRequest", + "CreateBillPaymentRequestTypedDict", + "CreateBillRequest", + "CreateBillRequestTypedDict", + "CreateConnectionRequest", + "CreateConnectionRequestBody", + "CreateConnectionRequestBodyTypedDict", + "CreateConnectionRequestTypedDict", + "CreateJournalEntryRequest", + "CreateJournalEntryRequestTypedDict", + "CreateJournalRequest", + "CreateJournalRequestTypedDict", + "CreateSupplierRequest", + "CreateSupplierRequestTypedDict", + "DeleteBillAttachmentRequest", + "DeleteBillAttachmentRequestTypedDict", + "DeleteBillPaymentRequest", + "DeleteBillPaymentRequestTypedDict", + "DeleteBillRequest", + "DeleteBillRequestTypedDict", + "DeleteCompanyRequest", + "DeleteCompanyRequestTypedDict", + "DeleteConnectionRequest", + "DeleteConnectionRequestTypedDict", + "DownloadBillAttachmentRequest", + "DownloadBillAttachmentRequestTypedDict", + "GetAccountRequest", + "GetAccountRequestTypedDict", + "GetAccountingProfileRequest", + "GetAccountingProfileRequestTypedDict", + "GetBillAttachmentRequest", + "GetBillAttachmentRequestTypedDict", + "GetBillCreditNoteRequest", + "GetBillCreditNoteRequestTypedDict", + "GetBillPaymentsRequest", + "GetBillPaymentsRequestTypedDict", + "GetBillRequest", + "GetBillRequestTypedDict", + "GetCompanyRequest", + "GetCompanyRequestTypedDict", + "GetConnectionRequest", + "GetConnectionRequestTypedDict", + "GetCreateAccountModelRequest", + "GetCreateAccountModelRequestTypedDict", + "GetCreateBankAccountsModelRequest", + "GetCreateBankAccountsModelRequestTypedDict", + "GetCreateBillPaymentModelRequest", + "GetCreateBillPaymentModelRequestTypedDict", + "GetCreateJournalEntryModelRequest", + "GetCreateJournalEntryModelRequestTypedDict", + "GetCreateJournalModelRequest", + "GetCreateJournalModelRequestTypedDict", + "GetCreateUpdateBillCreditNoteModelRequest", + "GetCreateUpdateBillCreditNoteModelRequestTypedDict", + "GetCreateUpdateBillModelRequest", + "GetCreateUpdateBillModelRequestTypedDict", + "GetCreateUpdateSupplierModelRequest", + "GetCreateUpdateSupplierModelRequestTypedDict", + "GetDataStatusDataStatuses", + "GetDataStatusDataStatusesTypedDict", + "GetDataStatusRequest", + "GetDataStatusRequestTypedDict", + "GetJournalRequest", + "GetJournalRequestTypedDict", + "GetPaymentMethodRequest", + "GetPaymentMethodRequestTypedDict", + "GetPullOperationRequest", + "GetPullOperationRequestTypedDict", + "GetPushOperationRequest", + "GetPushOperationRequestTypedDict", + "GetSupplierRequest", + "GetSupplierRequestTypedDict", + "GetTaxRateRequest", + "GetTaxRateRequestTypedDict", + "GetTrackingCategoryRequest", + "GetTrackingCategoryRequestTypedDict", + "ListAccountsRequest", + "ListAccountsRequestTypedDict", + "ListBillAttachmentsRequest", + "ListBillAttachmentsRequestTypedDict", + "ListBillCreditNotesRequest", + "ListBillCreditNotesRequestTypedDict", + "ListBillPaymentsRequest", + "ListBillPaymentsRequestTypedDict", + "ListBillsRequest", + "ListBillsRequestTypedDict", + "ListCompaniesRequest", + "ListCompaniesRequestTypedDict", + "ListConnectionsRequest", + "ListConnectionsRequestTypedDict", + "ListJournalsRequest", + "ListJournalsRequestTypedDict", + "ListPaymentMethodsRequest", + "ListPaymentMethodsRequestTypedDict", + "ListPullOperationsRequest", + "ListPullOperationsRequestTypedDict", + "ListPushOperationsRequest", + "ListPushOperationsRequestTypedDict", + "ListSuppliersRequest", + "ListSuppliersRequestTypedDict", + "ListTaxRatesRequest", + "ListTaxRatesRequestTypedDict", + "ListTrackingCategoriesRequest", + "ListTrackingCategoriesRequestTypedDict", + "RefreshAllDataTypesRequest", + "RefreshAllDataTypesRequestTypedDict", + "RefreshDataTypeRequest", + "RefreshDataTypeRequestTypedDict", + "UnlinkConnectionRequest", + "UnlinkConnectionRequestTypedDict", + "UnlinkConnectionUpdateConnection", + "UnlinkConnectionUpdateConnectionTypedDict", + "UpdateBillCreditNoteRequest", + "UpdateBillCreditNoteRequestTypedDict", + "UpdateBillRequest", + "UpdateBillRequestTypedDict", + "UpdateCompanyRequest", + "UpdateCompanyRequestTypedDict", + "UpdateSupplierRequest", + "UpdateSupplierRequestTypedDict", + "UploadBillAttachmentRequest", + "UploadBillAttachmentRequestTypedDict", +] diff --git a/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/operations/create_account.py b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/operations/create_account.py new file mode 100644 index 000000000..de014704c --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/operations/create_account.py @@ -0,0 +1,54 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from codat_sync_for_payables_version_1.models.shared import ( + accountprototype as shared_accountprototype, +) +from codat_sync_for_payables_version_1.types import BaseModel +from codat_sync_for_payables_version_1.utils import ( + FieldMetadata, + PathParamMetadata, + QueryParamMetadata, + RequestMetadata, +) +import pydantic +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class CreateAccountRequestTypedDict(TypedDict): + company_id: str + r"""Unique identifier for a company.""" + connection_id: str + r"""Unique identifier for a connection.""" + account_prototype: NotRequired[shared_accountprototype.AccountPrototypeTypedDict] + timeout_in_minutes: NotRequired[int] + r"""Time limit for the push operation to complete before it is timed out.""" + + +class CreateAccountRequest(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.""" + + account_prototype: Annotated[ + Optional[shared_accountprototype.AccountPrototype], + FieldMetadata(request=RequestMetadata(media_type="application/json")), + ] = None + + timeout_in_minutes: Annotated[ + Optional[int], + pydantic.Field(alias="timeoutInMinutes"), + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = None + r"""Time limit for the push operation to complete before it is timed out.""" diff --git a/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/operations/create_bank_account.py b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/operations/create_bank_account.py new file mode 100644 index 000000000..1d242e6b3 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/operations/create_bank_account.py @@ -0,0 +1,56 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from codat_sync_for_payables_version_1.models.shared import ( + bankaccountprototype as shared_bankaccountprototype, +) +from codat_sync_for_payables_version_1.types import BaseModel +from codat_sync_for_payables_version_1.utils import ( + FieldMetadata, + PathParamMetadata, + QueryParamMetadata, + RequestMetadata, +) +import pydantic +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class CreateBankAccountRequestTypedDict(TypedDict): + company_id: str + r"""Unique identifier for a company.""" + connection_id: str + r"""Unique identifier for a connection.""" + bank_account_prototype: NotRequired[ + shared_bankaccountprototype.BankAccountPrototypeTypedDict + ] + timeout_in_minutes: NotRequired[int] + r"""Time limit for the push operation to complete before it is timed out.""" + + +class CreateBankAccountRequest(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.""" + + bank_account_prototype: Annotated[ + Optional[shared_bankaccountprototype.BankAccountPrototype], + FieldMetadata(request=RequestMetadata(media_type="application/json")), + ] = None + + timeout_in_minutes: Annotated[ + Optional[int], + pydantic.Field(alias="timeoutInMinutes"), + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = None + r"""Time limit for the push operation to complete before it is timed out.""" diff --git a/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/operations/create_bill.py b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/operations/create_bill.py new file mode 100644 index 000000000..7813af6c5 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/operations/create_bill.py @@ -0,0 +1,89 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from codat_sync_for_payables_version_1.models.shared import bill as shared_bill +from codat_sync_for_payables_version_1.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from codat_sync_for_payables_version_1.utils import ( + FieldMetadata, + PathParamMetadata, + QueryParamMetadata, + RequestMetadata, +) +import pydantic +from pydantic import model_serializer +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class CreateBillRequestTypedDict(TypedDict): + company_id: str + r"""Unique identifier for a company.""" + connection_id: str + r"""Unique identifier for a connection.""" + bill: NotRequired[Nullable[shared_bill.BillTypedDict]] + timeout_in_minutes: NotRequired[int] + r"""Time limit for the push operation to complete before it is timed out.""" + + +class CreateBillRequest(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.""" + + bill: Annotated[ + OptionalNullable[shared_bill.Bill], + FieldMetadata(request=RequestMetadata(media_type="application/json")), + ] = UNSET + + timeout_in_minutes: Annotated[ + Optional[int], + pydantic.Field(alias="timeoutInMinutes"), + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = None + r"""Time limit for the push operation to complete before it is timed out.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = ["Bill", "timeoutInMinutes"] + nullable_fields = ["Bill"] + null_default_fields = [] + + serialized = handler(self) + + m = {} + + for n, f in self.model_fields.items(): + k = f.alias or n + val = serialized.get(k) + serialized.pop(k, None) + + optional_nullable = k in optional_fields and k in nullable_fields + is_set = ( + self.__pydantic_fields_set__.intersection({n}) + or k in null_default_fields + ) # pylint: disable=no-member + + if val is not None and val != UNSET_SENTINEL: + m[k] = val + elif val != UNSET_SENTINEL and ( + not k in optional_fields or (optional_nullable and is_set) + ): + m[k] = val + + return m diff --git a/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/operations/create_bill_credit_note.py b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/operations/create_bill_credit_note.py new file mode 100644 index 000000000..baffa6ebc --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/operations/create_bill_credit_note.py @@ -0,0 +1,93 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from codat_sync_for_payables_version_1.models.shared import ( + billcreditnote as shared_billcreditnote, +) +from codat_sync_for_payables_version_1.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from codat_sync_for_payables_version_1.utils import ( + FieldMetadata, + PathParamMetadata, + QueryParamMetadata, + RequestMetadata, +) +import pydantic +from pydantic import model_serializer +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class CreateBillCreditNoteRequestTypedDict(TypedDict): + company_id: str + r"""Unique identifier for a company.""" + connection_id: str + r"""Unique identifier for a connection.""" + bill_credit_note: NotRequired[ + Nullable[shared_billcreditnote.BillCreditNoteTypedDict] + ] + timeout_in_minutes: NotRequired[int] + r"""Time limit for the push operation to complete before it is timed out.""" + + +class CreateBillCreditNoteRequest(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.""" + + bill_credit_note: Annotated[ + OptionalNullable[shared_billcreditnote.BillCreditNote], + FieldMetadata(request=RequestMetadata(media_type="application/json")), + ] = UNSET + + timeout_in_minutes: Annotated[ + Optional[int], + pydantic.Field(alias="timeoutInMinutes"), + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = None + r"""Time limit for the push operation to complete before it is timed out.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = ["BillCreditNote", "timeoutInMinutes"] + nullable_fields = ["BillCreditNote"] + null_default_fields = [] + + serialized = handler(self) + + m = {} + + for n, f in self.model_fields.items(): + k = f.alias or n + val = serialized.get(k) + serialized.pop(k, None) + + optional_nullable = k in optional_fields and k in nullable_fields + is_set = ( + self.__pydantic_fields_set__.intersection({n}) + or k in null_default_fields + ) # pylint: disable=no-member + + if val is not None and val != UNSET_SENTINEL: + m[k] = val + elif val != UNSET_SENTINEL and ( + not k in optional_fields or (optional_nullable and is_set) + ): + m[k] = val + + return m diff --git a/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/operations/create_bill_payment.py b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/operations/create_bill_payment.py new file mode 100644 index 000000000..b9178f45c --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/operations/create_bill_payment.py @@ -0,0 +1,91 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from codat_sync_for_payables_version_1.models.shared import ( + billpayment as shared_billpayment, +) +from codat_sync_for_payables_version_1.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from codat_sync_for_payables_version_1.utils import ( + FieldMetadata, + PathParamMetadata, + QueryParamMetadata, + RequestMetadata, +) +import pydantic +from pydantic import model_serializer +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class CreateBillPaymentRequestTypedDict(TypedDict): + company_id: str + r"""Unique identifier for a company.""" + connection_id: str + r"""Unique identifier for a connection.""" + bill_payment: NotRequired[Nullable[shared_billpayment.BillPaymentTypedDict]] + timeout_in_minutes: NotRequired[int] + r"""Time limit for the push operation to complete before it is timed out.""" + + +class CreateBillPaymentRequest(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.""" + + bill_payment: Annotated[ + OptionalNullable[shared_billpayment.BillPayment], + FieldMetadata(request=RequestMetadata(media_type="application/json")), + ] = UNSET + + timeout_in_minutes: Annotated[ + Optional[int], + pydantic.Field(alias="timeoutInMinutes"), + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = None + r"""Time limit for the push operation to complete before it is timed out.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = ["BillPayment", "timeoutInMinutes"] + nullable_fields = ["BillPayment"] + null_default_fields = [] + + serialized = handler(self) + + m = {} + + for n, f in self.model_fields.items(): + k = f.alias or n + val = serialized.get(k) + serialized.pop(k, None) + + optional_nullable = k in optional_fields and k in nullable_fields + is_set = ( + self.__pydantic_fields_set__.intersection({n}) + or k in null_default_fields + ) # pylint: disable=no-member + + if val is not None and val != UNSET_SENTINEL: + m[k] = val + elif val != UNSET_SENTINEL and ( + not k in optional_fields or (optional_nullable and is_set) + ): + m[k] = val + + return m diff --git a/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/operations/create_connection.py b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/operations/create_connection.py new file mode 100644 index 000000000..cd1755735 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/operations/create_connection.py @@ -0,0 +1,42 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from codat_sync_for_payables_version_1.types import BaseModel +from codat_sync_for_payables_version_1.utils import ( + FieldMetadata, + PathParamMetadata, + RequestMetadata, +) +import pydantic +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class CreateConnectionRequestBodyTypedDict(TypedDict): + platform_key: NotRequired[str] + r"""A unique 4-letter key to represent a platform in each integration. View [accounting](https://docs.codat.io/integrations/accounting/overview#platform-keys), [banking](https://docs.codat.io/integrations/banking/overview#platform-keys), and [commerce](https://docs.codat.io/integrations/commerce/overview#platform-keys) platform keys.""" + + +class CreateConnectionRequestBody(BaseModel): + platform_key: Annotated[Optional[str], pydantic.Field(alias="platformKey")] = None + r"""A unique 4-letter key to represent a platform in each integration. View [accounting](https://docs.codat.io/integrations/accounting/overview#platform-keys), [banking](https://docs.codat.io/integrations/banking/overview#platform-keys), and [commerce](https://docs.codat.io/integrations/commerce/overview#platform-keys) platform keys.""" + + +class CreateConnectionRequestTypedDict(TypedDict): + company_id: str + r"""Unique identifier for a company.""" + request_body: NotRequired[CreateConnectionRequestBodyTypedDict] + + +class CreateConnectionRequest(BaseModel): + company_id: Annotated[ + str, + pydantic.Field(alias="companyId"), + FieldMetadata(path=PathParamMetadata(style="simple", explode=False)), + ] + r"""Unique identifier for a company.""" + + request_body: Annotated[ + Optional[CreateConnectionRequestBody], + FieldMetadata(request=RequestMetadata(media_type="application/json")), + ] = None diff --git a/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/operations/create_journal.py b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/operations/create_journal.py new file mode 100644 index 000000000..bfb873518 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/operations/create_journal.py @@ -0,0 +1,54 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from codat_sync_for_payables_version_1.models.shared import ( + journalprototype as shared_journalprototype, +) +from codat_sync_for_payables_version_1.types import BaseModel +from codat_sync_for_payables_version_1.utils import ( + FieldMetadata, + PathParamMetadata, + QueryParamMetadata, + RequestMetadata, +) +import pydantic +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class CreateJournalRequestTypedDict(TypedDict): + company_id: str + r"""Unique identifier for a company.""" + connection_id: str + r"""Unique identifier for a connection.""" + journal_prototype: NotRequired[shared_journalprototype.JournalPrototypeTypedDict] + timeout_in_minutes: NotRequired[int] + r"""Time limit for the push operation to complete before it is timed out.""" + + +class CreateJournalRequest(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.""" + + journal_prototype: Annotated[ + Optional[shared_journalprototype.JournalPrototype], + FieldMetadata(request=RequestMetadata(media_type="application/json")), + ] = None + + timeout_in_minutes: Annotated[ + Optional[int], + pydantic.Field(alias="timeoutInMinutes"), + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = None + r"""Time limit for the push operation to complete before it is timed out.""" diff --git a/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/operations/create_journal_entry.py b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/operations/create_journal_entry.py new file mode 100644 index 000000000..e687c8851 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/operations/create_journal_entry.py @@ -0,0 +1,91 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from codat_sync_for_payables_version_1.models.shared import ( + journalentry as shared_journalentry, +) +from codat_sync_for_payables_version_1.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from codat_sync_for_payables_version_1.utils import ( + FieldMetadata, + PathParamMetadata, + QueryParamMetadata, + RequestMetadata, +) +import pydantic +from pydantic import model_serializer +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class CreateJournalEntryRequestTypedDict(TypedDict): + company_id: str + r"""Unique identifier for a company.""" + connection_id: str + r"""Unique identifier for a connection.""" + journal_entry: NotRequired[Nullable[shared_journalentry.JournalEntryTypedDict]] + timeout_in_minutes: NotRequired[int] + r"""Time limit for the push operation to complete before it is timed out.""" + + +class CreateJournalEntryRequest(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.""" + + journal_entry: Annotated[ + OptionalNullable[shared_journalentry.JournalEntry], + FieldMetadata(request=RequestMetadata(media_type="application/json")), + ] = UNSET + + timeout_in_minutes: Annotated[ + Optional[int], + pydantic.Field(alias="timeoutInMinutes"), + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = None + r"""Time limit for the push operation to complete before it is timed out.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = ["JournalEntry", "timeoutInMinutes"] + nullable_fields = ["JournalEntry"] + null_default_fields = [] + + serialized = handler(self) + + m = {} + + for n, f in self.model_fields.items(): + k = f.alias or n + val = serialized.get(k) + serialized.pop(k, None) + + optional_nullable = k in optional_fields and k in nullable_fields + is_set = ( + self.__pydantic_fields_set__.intersection({n}) + or k in null_default_fields + ) # pylint: disable=no-member + + if val is not None and val != UNSET_SENTINEL: + m[k] = val + elif val != UNSET_SENTINEL and ( + not k in optional_fields or (optional_nullable and is_set) + ): + m[k] = val + + return m diff --git a/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/operations/create_supplier.py b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/operations/create_supplier.py new file mode 100644 index 000000000..a0d05c2c0 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/operations/create_supplier.py @@ -0,0 +1,89 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from codat_sync_for_payables_version_1.models.shared import supplier as shared_supplier +from codat_sync_for_payables_version_1.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from codat_sync_for_payables_version_1.utils import ( + FieldMetadata, + PathParamMetadata, + QueryParamMetadata, + RequestMetadata, +) +import pydantic +from pydantic import model_serializer +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class CreateSupplierRequestTypedDict(TypedDict): + company_id: str + r"""Unique identifier for a company.""" + connection_id: str + r"""Unique identifier for a connection.""" + supplier: NotRequired[Nullable[shared_supplier.SupplierTypedDict]] + timeout_in_minutes: NotRequired[int] + r"""Time limit for the push operation to complete before it is timed out.""" + + +class CreateSupplierRequest(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.""" + + supplier: Annotated[ + OptionalNullable[shared_supplier.Supplier], + FieldMetadata(request=RequestMetadata(media_type="application/json")), + ] = UNSET + + timeout_in_minutes: Annotated[ + Optional[int], + pydantic.Field(alias="timeoutInMinutes"), + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = None + r"""Time limit for the push operation to complete before it is timed out.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = ["Supplier", "timeoutInMinutes"] + nullable_fields = ["Supplier"] + null_default_fields = [] + + serialized = handler(self) + + m = {} + + for n, f in self.model_fields.items(): + k = f.alias or n + val = serialized.get(k) + serialized.pop(k, None) + + optional_nullable = k in optional_fields and k in nullable_fields + is_set = ( + self.__pydantic_fields_set__.intersection({n}) + or k in null_default_fields + ) # pylint: disable=no-member + + if val is not None and val != UNSET_SENTINEL: + m[k] = val + elif val != UNSET_SENTINEL and ( + not k in optional_fields or (optional_nullable and is_set) + ): + m[k] = val + + return m diff --git a/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/operations/delete_bill.py b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/operations/delete_bill.py new file mode 100644 index 000000000..acb1d8ad2 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/operations/delete_bill.py @@ -0,0 +1,39 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from codat_sync_for_payables_version_1.types import BaseModel +from codat_sync_for_payables_version_1.utils import FieldMetadata, PathParamMetadata +import pydantic +from typing_extensions import Annotated, TypedDict + + +class DeleteBillRequestTypedDict(TypedDict): + bill_id: str + r"""Unique identifier for a bill.""" + company_id: str + r"""Unique identifier for a company.""" + connection_id: str + r"""Unique identifier for a connection.""" + + +class DeleteBillRequest(BaseModel): + bill_id: Annotated[ + str, + pydantic.Field(alias="billId"), + FieldMetadata(path=PathParamMetadata(style="simple", explode=False)), + ] + r"""Unique identifier for a bill.""" + + 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/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/operations/delete_bill_attachment.py b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/operations/delete_bill_attachment.py new file mode 100644 index 000000000..c9b4b1a49 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/operations/delete_bill_attachment.py @@ -0,0 +1,48 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from codat_sync_for_payables_version_1.types import BaseModel +from codat_sync_for_payables_version_1.utils import FieldMetadata, PathParamMetadata +import pydantic +from typing_extensions import Annotated, TypedDict + + +class DeleteBillAttachmentRequestTypedDict(TypedDict): + attachment_id: str + r"""Unique identifier for an attachment.""" + bill_id: str + r"""Unique identifier for a bill.""" + company_id: str + r"""Unique identifier for a company.""" + connection_id: str + r"""Unique identifier for a connection.""" + + +class DeleteBillAttachmentRequest(BaseModel): + attachment_id: Annotated[ + str, + pydantic.Field(alias="attachmentId"), + FieldMetadata(path=PathParamMetadata(style="simple", explode=False)), + ] + r"""Unique identifier for an attachment.""" + + bill_id: Annotated[ + str, + pydantic.Field(alias="billId"), + FieldMetadata(path=PathParamMetadata(style="simple", explode=False)), + ] + r"""Unique identifier for a bill.""" + + 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/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/operations/delete_billpayment.py b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/operations/delete_billpayment.py new file mode 100644 index 000000000..662f24aa2 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/operations/delete_billpayment.py @@ -0,0 +1,39 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from codat_sync_for_payables_version_1.types import BaseModel +from codat_sync_for_payables_version_1.utils import FieldMetadata, PathParamMetadata +import pydantic +from typing_extensions import Annotated, TypedDict + + +class DeleteBillPaymentRequestTypedDict(TypedDict): + bill_payment_id: str + r"""Unique identifier for a bill payment.""" + company_id: str + r"""Unique identifier for a company.""" + connection_id: str + r"""Unique identifier for a connection.""" + + +class DeleteBillPaymentRequest(BaseModel): + bill_payment_id: Annotated[ + str, + pydantic.Field(alias="billPaymentId"), + FieldMetadata(path=PathParamMetadata(style="simple", explode=False)), + ] + r"""Unique identifier for a bill payment.""" + + 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/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/operations/delete_company.py b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/operations/delete_company.py new file mode 100644 index 000000000..bf980fb1d --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/operations/delete_company.py @@ -0,0 +1,21 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from codat_sync_for_payables_version_1.types import BaseModel +from codat_sync_for_payables_version_1.utils import FieldMetadata, PathParamMetadata +import pydantic +from typing_extensions import Annotated, TypedDict + + +class DeleteCompanyRequestTypedDict(TypedDict): + company_id: str + r"""Unique identifier for a company.""" + + +class DeleteCompanyRequest(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/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/operations/delete_connection.py b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/operations/delete_connection.py new file mode 100644 index 000000000..7696308f7 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/operations/delete_connection.py @@ -0,0 +1,30 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from codat_sync_for_payables_version_1.types import BaseModel +from codat_sync_for_payables_version_1.utils import FieldMetadata, PathParamMetadata +import pydantic +from typing_extensions import Annotated, TypedDict + + +class DeleteConnectionRequestTypedDict(TypedDict): + company_id: str + r"""Unique identifier for a company.""" + connection_id: str + r"""Unique identifier for a connection.""" + + +class DeleteConnectionRequest(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.""" diff --git a/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/operations/download_bill_attachment.py b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/operations/download_bill_attachment.py new file mode 100644 index 000000000..7b28dafa0 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/operations/download_bill_attachment.py @@ -0,0 +1,48 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from codat_sync_for_payables_version_1.types import BaseModel +from codat_sync_for_payables_version_1.utils import FieldMetadata, PathParamMetadata +import pydantic +from typing_extensions import Annotated, TypedDict + + +class DownloadBillAttachmentRequestTypedDict(TypedDict): + attachment_id: str + r"""Unique identifier for an attachment.""" + bill_id: str + r"""Unique identifier for a bill.""" + company_id: str + r"""Unique identifier for a company.""" + connection_id: str + r"""Unique identifier for a connection.""" + + +class DownloadBillAttachmentRequest(BaseModel): + attachment_id: Annotated[ + str, + pydantic.Field(alias="attachmentId"), + FieldMetadata(path=PathParamMetadata(style="simple", explode=False)), + ] + r"""Unique identifier for an attachment.""" + + bill_id: Annotated[ + str, + pydantic.Field(alias="billId"), + FieldMetadata(path=PathParamMetadata(style="simple", explode=False)), + ] + r"""Unique identifier for a bill.""" + + 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/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/operations/get_account.py b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/operations/get_account.py new file mode 100644 index 000000000..4528506b8 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/operations/get_account.py @@ -0,0 +1,30 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from codat_sync_for_payables_version_1.types import BaseModel +from codat_sync_for_payables_version_1.utils import FieldMetadata, PathParamMetadata +import pydantic +from typing_extensions import Annotated, TypedDict + + +class GetAccountRequestTypedDict(TypedDict): + account_id: str + r"""Unique identifier for an account.""" + company_id: str + r"""Unique identifier for a company.""" + + +class GetAccountRequest(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.""" diff --git a/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/operations/get_accounting_profile.py b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/operations/get_accounting_profile.py new file mode 100644 index 000000000..a7f058dbc --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/operations/get_accounting_profile.py @@ -0,0 +1,21 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from codat_sync_for_payables_version_1.types import BaseModel +from codat_sync_for_payables_version_1.utils import FieldMetadata, PathParamMetadata +import pydantic +from typing_extensions import Annotated, TypedDict + + +class GetAccountingProfileRequestTypedDict(TypedDict): + company_id: str + r"""Unique identifier for a company.""" + + +class GetAccountingProfileRequest(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/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/operations/get_bill.py b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/operations/get_bill.py new file mode 100644 index 000000000..c1dc3c2e8 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/operations/get_bill.py @@ -0,0 +1,30 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from codat_sync_for_payables_version_1.types import BaseModel +from codat_sync_for_payables_version_1.utils import FieldMetadata, PathParamMetadata +import pydantic +from typing_extensions import Annotated, TypedDict + + +class GetBillRequestTypedDict(TypedDict): + bill_id: str + r"""Unique identifier for a bill.""" + company_id: str + r"""Unique identifier for a company.""" + + +class GetBillRequest(BaseModel): + bill_id: Annotated[ + str, + pydantic.Field(alias="billId"), + FieldMetadata(path=PathParamMetadata(style="simple", explode=False)), + ] + r"""Unique identifier for a bill.""" + + company_id: Annotated[ + str, + pydantic.Field(alias="companyId"), + FieldMetadata(path=PathParamMetadata(style="simple", explode=False)), + ] + r"""Unique identifier for a company.""" diff --git a/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/operations/get_bill_attachment.py b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/operations/get_bill_attachment.py new file mode 100644 index 000000000..50c79c552 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/operations/get_bill_attachment.py @@ -0,0 +1,48 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from codat_sync_for_payables_version_1.types import BaseModel +from codat_sync_for_payables_version_1.utils import FieldMetadata, PathParamMetadata +import pydantic +from typing_extensions import Annotated, TypedDict + + +class GetBillAttachmentRequestTypedDict(TypedDict): + attachment_id: str + r"""Unique identifier for an attachment.""" + bill_id: str + r"""Unique identifier for a bill.""" + company_id: str + r"""Unique identifier for a company.""" + connection_id: str + r"""Unique identifier for a connection.""" + + +class GetBillAttachmentRequest(BaseModel): + attachment_id: Annotated[ + str, + pydantic.Field(alias="attachmentId"), + FieldMetadata(path=PathParamMetadata(style="simple", explode=False)), + ] + r"""Unique identifier for an attachment.""" + + bill_id: Annotated[ + str, + pydantic.Field(alias="billId"), + FieldMetadata(path=PathParamMetadata(style="simple", explode=False)), + ] + r"""Unique identifier for a bill.""" + + 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/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/operations/get_bill_credit_note.py b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/operations/get_bill_credit_note.py new file mode 100644 index 000000000..15794bec9 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/operations/get_bill_credit_note.py @@ -0,0 +1,30 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from codat_sync_for_payables_version_1.types import BaseModel +from codat_sync_for_payables_version_1.utils import FieldMetadata, PathParamMetadata +import pydantic +from typing_extensions import Annotated, TypedDict + + +class GetBillCreditNoteRequestTypedDict(TypedDict): + bill_credit_note_id: str + r"""Unique identifier for a bill credit note.""" + company_id: str + r"""Unique identifier for a company.""" + + +class GetBillCreditNoteRequest(BaseModel): + bill_credit_note_id: Annotated[ + str, + pydantic.Field(alias="billCreditNoteId"), + FieldMetadata(path=PathParamMetadata(style="simple", explode=False)), + ] + r"""Unique identifier for a bill credit note.""" + + company_id: Annotated[ + str, + pydantic.Field(alias="companyId"), + FieldMetadata(path=PathParamMetadata(style="simple", explode=False)), + ] + r"""Unique identifier for a company.""" diff --git a/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/operations/get_bill_payments.py b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/operations/get_bill_payments.py new file mode 100644 index 000000000..bfa2c15a8 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/operations/get_bill_payments.py @@ -0,0 +1,30 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from codat_sync_for_payables_version_1.types import BaseModel +from codat_sync_for_payables_version_1.utils import FieldMetadata, PathParamMetadata +import pydantic +from typing_extensions import Annotated, TypedDict + + +class GetBillPaymentsRequestTypedDict(TypedDict): + bill_payment_id: str + r"""Unique identifier for a bill payment.""" + company_id: str + r"""Unique identifier for a company.""" + + +class GetBillPaymentsRequest(BaseModel): + bill_payment_id: Annotated[ + str, + pydantic.Field(alias="billPaymentId"), + FieldMetadata(path=PathParamMetadata(style="simple", explode=False)), + ] + r"""Unique identifier for a bill payment.""" + + company_id: Annotated[ + str, + pydantic.Field(alias="companyId"), + FieldMetadata(path=PathParamMetadata(style="simple", explode=False)), + ] + r"""Unique identifier for a company.""" diff --git a/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/operations/get_company.py b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/operations/get_company.py new file mode 100644 index 000000000..1ce6d9dd8 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/operations/get_company.py @@ -0,0 +1,21 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from codat_sync_for_payables_version_1.types import BaseModel +from codat_sync_for_payables_version_1.utils import FieldMetadata, PathParamMetadata +import pydantic +from typing_extensions import Annotated, TypedDict + + +class GetCompanyRequestTypedDict(TypedDict): + company_id: str + r"""Unique identifier for a company.""" + + +class GetCompanyRequest(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/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/operations/get_connection.py b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/operations/get_connection.py new file mode 100644 index 000000000..ada4a96e6 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/operations/get_connection.py @@ -0,0 +1,30 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from codat_sync_for_payables_version_1.types import BaseModel +from codat_sync_for_payables_version_1.utils import FieldMetadata, PathParamMetadata +import pydantic +from typing_extensions import Annotated, TypedDict + + +class GetConnectionRequestTypedDict(TypedDict): + company_id: str + r"""Unique identifier for a company.""" + connection_id: str + r"""Unique identifier for a connection.""" + + +class GetConnectionRequest(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.""" diff --git a/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/operations/get_create_account_model.py b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/operations/get_create_account_model.py new file mode 100644 index 000000000..0a49100c2 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/operations/get_create_account_model.py @@ -0,0 +1,30 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from codat_sync_for_payables_version_1.types import BaseModel +from codat_sync_for_payables_version_1.utils import FieldMetadata, PathParamMetadata +import pydantic +from typing_extensions import Annotated, TypedDict + + +class GetCreateAccountModelRequestTypedDict(TypedDict): + company_id: str + r"""Unique identifier for a company.""" + connection_id: str + r"""Unique identifier for a connection.""" + + +class GetCreateAccountModelRequest(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.""" diff --git a/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/operations/get_create_bankaccounts_model.py b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/operations/get_create_bankaccounts_model.py new file mode 100644 index 000000000..dda1676e0 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/operations/get_create_bankaccounts_model.py @@ -0,0 +1,30 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from codat_sync_for_payables_version_1.types import BaseModel +from codat_sync_for_payables_version_1.utils import FieldMetadata, PathParamMetadata +import pydantic +from typing_extensions import Annotated, TypedDict + + +class GetCreateBankAccountsModelRequestTypedDict(TypedDict): + company_id: str + r"""Unique identifier for a company.""" + connection_id: str + r"""Unique identifier for a connection.""" + + +class GetCreateBankAccountsModelRequest(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.""" diff --git a/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/operations/get_create_billpayment_model.py b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/operations/get_create_billpayment_model.py new file mode 100644 index 000000000..f31f2f14f --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/operations/get_create_billpayment_model.py @@ -0,0 +1,30 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from codat_sync_for_payables_version_1.types import BaseModel +from codat_sync_for_payables_version_1.utils import FieldMetadata, PathParamMetadata +import pydantic +from typing_extensions import Annotated, TypedDict + + +class GetCreateBillPaymentModelRequestTypedDict(TypedDict): + company_id: str + r"""Unique identifier for a company.""" + connection_id: str + r"""Unique identifier for a connection.""" + + +class GetCreateBillPaymentModelRequest(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.""" diff --git a/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/operations/get_create_journal_model.py b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/operations/get_create_journal_model.py new file mode 100644 index 000000000..2e490e7f3 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/operations/get_create_journal_model.py @@ -0,0 +1,30 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from codat_sync_for_payables_version_1.types import BaseModel +from codat_sync_for_payables_version_1.utils import FieldMetadata, PathParamMetadata +import pydantic +from typing_extensions import Annotated, TypedDict + + +class GetCreateJournalModelRequestTypedDict(TypedDict): + company_id: str + r"""Unique identifier for a company.""" + connection_id: str + r"""Unique identifier for a connection.""" + + +class GetCreateJournalModelRequest(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.""" diff --git a/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/operations/get_create_journalentry_model.py b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/operations/get_create_journalentry_model.py new file mode 100644 index 000000000..90544d1a8 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/operations/get_create_journalentry_model.py @@ -0,0 +1,30 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from codat_sync_for_payables_version_1.types import BaseModel +from codat_sync_for_payables_version_1.utils import FieldMetadata, PathParamMetadata +import pydantic +from typing_extensions import Annotated, TypedDict + + +class GetCreateJournalEntryModelRequestTypedDict(TypedDict): + company_id: str + r"""Unique identifier for a company.""" + connection_id: str + r"""Unique identifier for a connection.""" + + +class GetCreateJournalEntryModelRequest(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.""" diff --git a/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/operations/get_create_update_bill_model.py b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/operations/get_create_update_bill_model.py new file mode 100644 index 000000000..797256d76 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/operations/get_create_update_bill_model.py @@ -0,0 +1,30 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from codat_sync_for_payables_version_1.types import BaseModel +from codat_sync_for_payables_version_1.utils import FieldMetadata, PathParamMetadata +import pydantic +from typing_extensions import Annotated, TypedDict + + +class GetCreateUpdateBillModelRequestTypedDict(TypedDict): + company_id: str + r"""Unique identifier for a company.""" + connection_id: str + r"""Unique identifier for a connection.""" + + +class GetCreateUpdateBillModelRequest(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.""" diff --git a/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/operations/get_create_update_billcreditnote_model.py b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/operations/get_create_update_billcreditnote_model.py new file mode 100644 index 000000000..41b45da01 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/operations/get_create_update_billcreditnote_model.py @@ -0,0 +1,30 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from codat_sync_for_payables_version_1.types import BaseModel +from codat_sync_for_payables_version_1.utils import FieldMetadata, PathParamMetadata +import pydantic +from typing_extensions import Annotated, TypedDict + + +class GetCreateUpdateBillCreditNoteModelRequestTypedDict(TypedDict): + company_id: str + r"""Unique identifier for a company.""" + connection_id: str + r"""Unique identifier for a connection.""" + + +class GetCreateUpdateBillCreditNoteModelRequest(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.""" diff --git a/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/operations/get_create_update_supplier_model.py b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/operations/get_create_update_supplier_model.py new file mode 100644 index 000000000..650cc3e55 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/operations/get_create_update_supplier_model.py @@ -0,0 +1,30 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from codat_sync_for_payables_version_1.types import BaseModel +from codat_sync_for_payables_version_1.utils import FieldMetadata, PathParamMetadata +import pydantic +from typing_extensions import Annotated, TypedDict + + +class GetCreateUpdateSupplierModelRequestTypedDict(TypedDict): + company_id: str + r"""Unique identifier for a company.""" + connection_id: str + r"""Unique identifier for a connection.""" + + +class GetCreateUpdateSupplierModelRequest(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.""" diff --git a/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/operations/get_data_status.py b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/operations/get_data_status.py new file mode 100644 index 000000000..2f1ad29d7 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/operations/get_data_status.py @@ -0,0 +1,333 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from codat_sync_for_payables_version_1.models.shared import ( + datastatus as shared_datastatus, +) +from codat_sync_for_payables_version_1.types import BaseModel +from codat_sync_for_payables_version_1.utils import FieldMetadata, PathParamMetadata +import pydantic +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class GetDataStatusRequestTypedDict(TypedDict): + company_id: str + r"""Unique identifier for a company.""" + + +class GetDataStatusRequest(BaseModel): + company_id: Annotated[ + str, + pydantic.Field(alias="companyId"), + FieldMetadata(path=PathParamMetadata(style="simple", explode=False)), + ] + r"""Unique identifier for a company.""" + + +class GetDataStatusDataStatusesTypedDict(TypedDict): + r"""OK""" + + account_transactions: NotRequired[shared_datastatus.DataStatusTypedDict] + r"""Describes the state of data in the Codat cache for a company and data type""" + balance_sheet: NotRequired[shared_datastatus.DataStatusTypedDict] + r"""Describes the state of data in the Codat cache for a company and data type""" + bank_accounts: NotRequired[shared_datastatus.DataStatusTypedDict] + r"""Describes the state of data in the Codat cache for a company and data type""" + bank_transactions: NotRequired[shared_datastatus.DataStatusTypedDict] + r"""Describes the state of data in the Codat cache for a company and data type""" + banking_account_balances: NotRequired[shared_datastatus.DataStatusTypedDict] + r"""Describes the state of data in the Codat cache for a company and data type""" + banking_accounts: NotRequired[shared_datastatus.DataStatusTypedDict] + r"""Describes the state of data in the Codat cache for a company and data type""" + banking_transaction_categories: NotRequired[shared_datastatus.DataStatusTypedDict] + r"""Describes the state of data in the Codat cache for a company and data type""" + banking_transactions: NotRequired[shared_datastatus.DataStatusTypedDict] + r"""Describes the state of data in the Codat cache for a company and data type""" + bill_credit_notes: NotRequired[shared_datastatus.DataStatusTypedDict] + r"""Describes the state of data in the Codat cache for a company and data type""" + bill_payments: NotRequired[shared_datastatus.DataStatusTypedDict] + r"""Describes the state of data in the Codat cache for a company and data type""" + bills: NotRequired[shared_datastatus.DataStatusTypedDict] + r"""Describes the state of data in the Codat cache for a company and data type""" + cash_flow_statement: NotRequired[shared_datastatus.DataStatusTypedDict] + r"""Describes the state of data in the Codat cache for a company and data type""" + chart_of_accounts: NotRequired[shared_datastatus.DataStatusTypedDict] + r"""Describes the state of data in the Codat cache for a company and data type""" + commerce_company_info: NotRequired[shared_datastatus.DataStatusTypedDict] + r"""Describes the state of data in the Codat cache for a company and data type""" + commerce_customers: NotRequired[shared_datastatus.DataStatusTypedDict] + r"""Describes the state of data in the Codat cache for a company and data type""" + commerce_disputes: NotRequired[shared_datastatus.DataStatusTypedDict] + r"""Describes the state of data in the Codat cache for a company and data type""" + commerce_locations: NotRequired[shared_datastatus.DataStatusTypedDict] + r"""Describes the state of data in the Codat cache for a company and data type""" + commerce_orders: NotRequired[shared_datastatus.DataStatusTypedDict] + r"""Describes the state of data in the Codat cache for a company and data type""" + commerce_payment_methods: NotRequired[shared_datastatus.DataStatusTypedDict] + r"""Describes the state of data in the Codat cache for a company and data type""" + commerce_payments: NotRequired[shared_datastatus.DataStatusTypedDict] + r"""Describes the state of data in the Codat cache for a company and data type""" + commerce_product_categories: NotRequired[shared_datastatus.DataStatusTypedDict] + r"""Describes the state of data in the Codat cache for a company and data type""" + commerce_products: NotRequired[shared_datastatus.DataStatusTypedDict] + r"""Describes the state of data in the Codat cache for a company and data type""" + commerce_tax_components: NotRequired[shared_datastatus.DataStatusTypedDict] + r"""Describes the state of data in the Codat cache for a company and data type""" + commerce_transactions: NotRequired[shared_datastatus.DataStatusTypedDict] + r"""Describes the state of data in the Codat cache for a company and data type""" + company: NotRequired[shared_datastatus.DataStatusTypedDict] + r"""Describes the state of data in the Codat cache for a company and data type""" + credit_notes: NotRequired[shared_datastatus.DataStatusTypedDict] + r"""Describes the state of data in the Codat cache for a company and data type""" + customers: NotRequired[shared_datastatus.DataStatusTypedDict] + r"""Describes the state of data in the Codat cache for a company and data type""" + direct_costs: NotRequired[shared_datastatus.DataStatusTypedDict] + r"""Describes the state of data in the Codat cache for a company and data type""" + direct_incomes: NotRequired[shared_datastatus.DataStatusTypedDict] + r"""Describes the state of data in the Codat cache for a company and data type""" + invoices: NotRequired[shared_datastatus.DataStatusTypedDict] + r"""Describes the state of data in the Codat cache for a company and data type""" + item_receipts: NotRequired[shared_datastatus.DataStatusTypedDict] + r"""Describes the state of data in the Codat cache for a company and data type""" + items: NotRequired[shared_datastatus.DataStatusTypedDict] + r"""Describes the state of data in the Codat cache for a company and data type""" + journal_entries: NotRequired[shared_datastatus.DataStatusTypedDict] + r"""Describes the state of data in the Codat cache for a company and data type""" + journals: NotRequired[shared_datastatus.DataStatusTypedDict] + r"""Describes the state of data in the Codat cache for a company and data type""" + payment_methods: NotRequired[shared_datastatus.DataStatusTypedDict] + r"""Describes the state of data in the Codat cache for a company and data type""" + payments: NotRequired[shared_datastatus.DataStatusTypedDict] + r"""Describes the state of data in the Codat cache for a company and data type""" + profit_and_loss: NotRequired[shared_datastatus.DataStatusTypedDict] + r"""Describes the state of data in the Codat cache for a company and data type""" + purchase_orders: NotRequired[shared_datastatus.DataStatusTypedDict] + r"""Describes the state of data in the Codat cache for a company and data type""" + sales_orders: NotRequired[shared_datastatus.DataStatusTypedDict] + r"""Describes the state of data in the Codat cache for a company and data type""" + suppliers: NotRequired[shared_datastatus.DataStatusTypedDict] + r"""Describes the state of data in the Codat cache for a company and data type""" + tax_rates: NotRequired[shared_datastatus.DataStatusTypedDict] + r"""Describes the state of data in the Codat cache for a company and data type""" + tracking_categories: NotRequired[shared_datastatus.DataStatusTypedDict] + r"""Describes the state of data in the Codat cache for a company and data type""" + transfers: NotRequired[shared_datastatus.DataStatusTypedDict] + r"""Describes the state of data in the Codat cache for a company and data type""" + + +class GetDataStatusDataStatuses(BaseModel): + r"""OK""" + + account_transactions: Annotated[ + Optional[shared_datastatus.DataStatus], + pydantic.Field(alias="accountTransactions"), + ] = None + r"""Describes the state of data in the Codat cache for a company and data type""" + + balance_sheet: Annotated[ + Optional[shared_datastatus.DataStatus], pydantic.Field(alias="balanceSheet") + ] = None + r"""Describes the state of data in the Codat cache for a company and data type""" + + bank_accounts: Annotated[ + Optional[shared_datastatus.DataStatus], pydantic.Field(alias="bankAccounts") + ] = None + r"""Describes the state of data in the Codat cache for a company and data type""" + + bank_transactions: Annotated[ + Optional[shared_datastatus.DataStatus], pydantic.Field(alias="bankTransactions") + ] = None + r"""Describes the state of data in the Codat cache for a company and data type""" + + banking_account_balances: Annotated[ + Optional[shared_datastatus.DataStatus], + pydantic.Field(alias="banking-accountBalances"), + ] = None + r"""Describes the state of data in the Codat cache for a company and data type""" + + banking_accounts: Annotated[ + Optional[shared_datastatus.DataStatus], pydantic.Field(alias="banking-accounts") + ] = None + r"""Describes the state of data in the Codat cache for a company and data type""" + + banking_transaction_categories: Annotated[ + Optional[shared_datastatus.DataStatus], + pydantic.Field(alias="banking-transactionCategories"), + ] = None + r"""Describes the state of data in the Codat cache for a company and data type""" + + banking_transactions: Annotated[ + Optional[shared_datastatus.DataStatus], + pydantic.Field(alias="banking-transactions"), + ] = None + r"""Describes the state of data in the Codat cache for a company and data type""" + + bill_credit_notes: Annotated[ + Optional[shared_datastatus.DataStatus], pydantic.Field(alias="billCreditNotes") + ] = None + r"""Describes the state of data in the Codat cache for a company and data type""" + + bill_payments: Annotated[ + Optional[shared_datastatus.DataStatus], pydantic.Field(alias="billPayments") + ] = None + r"""Describes the state of data in the Codat cache for a company and data type""" + + bills: Optional[shared_datastatus.DataStatus] = None + r"""Describes the state of data in the Codat cache for a company and data type""" + + cash_flow_statement: Annotated[ + Optional[shared_datastatus.DataStatus], + pydantic.Field(alias="cashFlowStatement"), + ] = None + r"""Describes the state of data in the Codat cache for a company and data type""" + + chart_of_accounts: Annotated[ + Optional[shared_datastatus.DataStatus], pydantic.Field(alias="chartOfAccounts") + ] = None + r"""Describes the state of data in the Codat cache for a company and data type""" + + commerce_company_info: Annotated[ + Optional[shared_datastatus.DataStatus], + pydantic.Field(alias="commerce-companyInfo"), + ] = None + r"""Describes the state of data in the Codat cache for a company and data type""" + + commerce_customers: Annotated[ + Optional[shared_datastatus.DataStatus], + pydantic.Field(alias="commerce-customers"), + ] = None + r"""Describes the state of data in the Codat cache for a company and data type""" + + commerce_disputes: Annotated[ + Optional[shared_datastatus.DataStatus], + pydantic.Field(alias="commerce-disputes"), + ] = None + r"""Describes the state of data in the Codat cache for a company and data type""" + + commerce_locations: Annotated[ + Optional[shared_datastatus.DataStatus], + pydantic.Field(alias="commerce-locations"), + ] = None + r"""Describes the state of data in the Codat cache for a company and data type""" + + commerce_orders: Annotated[ + Optional[shared_datastatus.DataStatus], pydantic.Field(alias="commerce-orders") + ] = None + r"""Describes the state of data in the Codat cache for a company and data type""" + + commerce_payment_methods: Annotated[ + Optional[shared_datastatus.DataStatus], + pydantic.Field(alias="commerce-paymentMethods"), + ] = None + r"""Describes the state of data in the Codat cache for a company and data type""" + + commerce_payments: Annotated[ + Optional[shared_datastatus.DataStatus], + pydantic.Field(alias="commerce-payments"), + ] = None + r"""Describes the state of data in the Codat cache for a company and data type""" + + commerce_product_categories: Annotated[ + Optional[shared_datastatus.DataStatus], + pydantic.Field(alias="commerce-productCategories"), + ] = None + r"""Describes the state of data in the Codat cache for a company and data type""" + + commerce_products: Annotated[ + Optional[shared_datastatus.DataStatus], + pydantic.Field(alias="commerce-products"), + ] = None + r"""Describes the state of data in the Codat cache for a company and data type""" + + commerce_tax_components: Annotated[ + Optional[shared_datastatus.DataStatus], + pydantic.Field(alias="commerce-taxComponents"), + ] = None + r"""Describes the state of data in the Codat cache for a company and data type""" + + commerce_transactions: Annotated[ + Optional[shared_datastatus.DataStatus], + pydantic.Field(alias="commerce-transactions"), + ] = None + r"""Describes the state of data in the Codat cache for a company and data type""" + + company: Optional[shared_datastatus.DataStatus] = None + r"""Describes the state of data in the Codat cache for a company and data type""" + + credit_notes: Annotated[ + Optional[shared_datastatus.DataStatus], pydantic.Field(alias="creditNotes") + ] = None + r"""Describes the state of data in the Codat cache for a company and data type""" + + customers: Optional[shared_datastatus.DataStatus] = None + r"""Describes the state of data in the Codat cache for a company and data type""" + + direct_costs: Annotated[ + Optional[shared_datastatus.DataStatus], pydantic.Field(alias="directCosts") + ] = None + r"""Describes the state of data in the Codat cache for a company and data type""" + + direct_incomes: Annotated[ + Optional[shared_datastatus.DataStatus], pydantic.Field(alias="directIncomes") + ] = None + r"""Describes the state of data in the Codat cache for a company and data type""" + + invoices: Optional[shared_datastatus.DataStatus] = None + r"""Describes the state of data in the Codat cache for a company and data type""" + + item_receipts: Annotated[ + Optional[shared_datastatus.DataStatus], pydantic.Field(alias="itemReceipts") + ] = None + r"""Describes the state of data in the Codat cache for a company and data type""" + + items: Optional[shared_datastatus.DataStatus] = None + r"""Describes the state of data in the Codat cache for a company and data type""" + + journal_entries: Annotated[ + Optional[shared_datastatus.DataStatus], pydantic.Field(alias="journalEntries") + ] = None + r"""Describes the state of data in the Codat cache for a company and data type""" + + journals: Optional[shared_datastatus.DataStatus] = None + r"""Describes the state of data in the Codat cache for a company and data type""" + + payment_methods: Annotated[ + Optional[shared_datastatus.DataStatus], pydantic.Field(alias="paymentMethods") + ] = None + r"""Describes the state of data in the Codat cache for a company and data type""" + + payments: Optional[shared_datastatus.DataStatus] = None + r"""Describes the state of data in the Codat cache for a company and data type""" + + profit_and_loss: Annotated[ + Optional[shared_datastatus.DataStatus], pydantic.Field(alias="profitAndLoss") + ] = None + r"""Describes the state of data in the Codat cache for a company and data type""" + + purchase_orders: Annotated[ + Optional[shared_datastatus.DataStatus], pydantic.Field(alias="purchaseOrders") + ] = None + r"""Describes the state of data in the Codat cache for a company and data type""" + + sales_orders: Annotated[ + Optional[shared_datastatus.DataStatus], pydantic.Field(alias="salesOrders") + ] = None + r"""Describes the state of data in the Codat cache for a company and data type""" + + suppliers: Optional[shared_datastatus.DataStatus] = None + r"""Describes the state of data in the Codat cache for a company and data type""" + + tax_rates: Annotated[ + Optional[shared_datastatus.DataStatus], pydantic.Field(alias="taxRates") + ] = None + r"""Describes the state of data in the Codat cache for a company and data type""" + + tracking_categories: Annotated[ + Optional[shared_datastatus.DataStatus], + pydantic.Field(alias="trackingCategories"), + ] = None + r"""Describes the state of data in the Codat cache for a company and data type""" + + transfers: Optional[shared_datastatus.DataStatus] = None + r"""Describes the state of data in the Codat cache for a company and data type""" diff --git a/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/operations/get_journal.py b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/operations/get_journal.py new file mode 100644 index 000000000..cb4f8ce24 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/operations/get_journal.py @@ -0,0 +1,30 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from codat_sync_for_payables_version_1.types import BaseModel +from codat_sync_for_payables_version_1.utils import FieldMetadata, PathParamMetadata +import pydantic +from typing_extensions import Annotated, TypedDict + + +class GetJournalRequestTypedDict(TypedDict): + company_id: str + r"""Unique identifier for a company.""" + journal_id: str + r"""Unique identifier for a journal.""" + + +class GetJournalRequest(BaseModel): + company_id: Annotated[ + str, + pydantic.Field(alias="companyId"), + FieldMetadata(path=PathParamMetadata(style="simple", explode=False)), + ] + r"""Unique identifier for a company.""" + + journal_id: Annotated[ + str, + pydantic.Field(alias="journalId"), + FieldMetadata(path=PathParamMetadata(style="simple", explode=False)), + ] + r"""Unique identifier for a journal.""" diff --git a/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/operations/get_payment_method.py b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/operations/get_payment_method.py new file mode 100644 index 000000000..b83b017ee --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/operations/get_payment_method.py @@ -0,0 +1,30 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from codat_sync_for_payables_version_1.types import BaseModel +from codat_sync_for_payables_version_1.utils import FieldMetadata, PathParamMetadata +import pydantic +from typing_extensions import Annotated, TypedDict + + +class GetPaymentMethodRequestTypedDict(TypedDict): + company_id: str + r"""Unique identifier for a company.""" + payment_method_id: str + r"""Unique identifier for a payment method.""" + + +class GetPaymentMethodRequest(BaseModel): + company_id: Annotated[ + str, + pydantic.Field(alias="companyId"), + FieldMetadata(path=PathParamMetadata(style="simple", explode=False)), + ] + r"""Unique identifier for a company.""" + + payment_method_id: Annotated[ + str, + pydantic.Field(alias="paymentMethodId"), + FieldMetadata(path=PathParamMetadata(style="simple", explode=False)), + ] + r"""Unique identifier for a payment method.""" diff --git a/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/operations/get_pull_operation.py b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/operations/get_pull_operation.py new file mode 100644 index 000000000..88a233713 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/operations/get_pull_operation.py @@ -0,0 +1,30 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from codat_sync_for_payables_version_1.types import BaseModel +from codat_sync_for_payables_version_1.utils import FieldMetadata, PathParamMetadata +import pydantic +from typing_extensions import Annotated, TypedDict + + +class GetPullOperationRequestTypedDict(TypedDict): + company_id: str + r"""Unique identifier for a company.""" + dataset_id: str + r"""Unique identifier for the dataset that completed its sync.""" + + +class GetPullOperationRequest(BaseModel): + company_id: Annotated[ + str, + pydantic.Field(alias="companyId"), + FieldMetadata(path=PathParamMetadata(style="simple", explode=False)), + ] + r"""Unique identifier for a company.""" + + dataset_id: Annotated[ + str, + pydantic.Field(alias="datasetId"), + FieldMetadata(path=PathParamMetadata(style="simple", explode=False)), + ] + r"""Unique identifier for the dataset that completed its sync.""" diff --git a/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/operations/get_push_operation.py b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/operations/get_push_operation.py new file mode 100644 index 000000000..9c975ff9b --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/operations/get_push_operation.py @@ -0,0 +1,30 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from codat_sync_for_payables_version_1.types import BaseModel +from codat_sync_for_payables_version_1.utils import FieldMetadata, PathParamMetadata +import pydantic +from typing_extensions import Annotated, TypedDict + + +class GetPushOperationRequestTypedDict(TypedDict): + company_id: str + r"""Unique identifier for a company.""" + push_operation_key: str + r"""Push operation key.""" + + +class GetPushOperationRequest(BaseModel): + company_id: Annotated[ + str, + pydantic.Field(alias="companyId"), + FieldMetadata(path=PathParamMetadata(style="simple", explode=False)), + ] + r"""Unique identifier for a company.""" + + push_operation_key: Annotated[ + str, + pydantic.Field(alias="pushOperationKey"), + FieldMetadata(path=PathParamMetadata(style="simple", explode=False)), + ] + r"""Push operation key.""" diff --git a/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/operations/get_supplier.py b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/operations/get_supplier.py new file mode 100644 index 000000000..05b7a6fb4 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/operations/get_supplier.py @@ -0,0 +1,30 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from codat_sync_for_payables_version_1.types import BaseModel +from codat_sync_for_payables_version_1.utils import FieldMetadata, PathParamMetadata +import pydantic +from typing_extensions import Annotated, TypedDict + + +class GetSupplierRequestTypedDict(TypedDict): + company_id: str + r"""Unique identifier for a company.""" + supplier_id: str + r"""Unique identifier for a supplier.""" + + +class GetSupplierRequest(BaseModel): + company_id: Annotated[ + str, + pydantic.Field(alias="companyId"), + FieldMetadata(path=PathParamMetadata(style="simple", explode=False)), + ] + r"""Unique identifier for a company.""" + + supplier_id: Annotated[ + str, + pydantic.Field(alias="supplierId"), + FieldMetadata(path=PathParamMetadata(style="simple", explode=False)), + ] + r"""Unique identifier for a supplier.""" diff --git a/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/operations/get_tax_rate.py b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/operations/get_tax_rate.py new file mode 100644 index 000000000..e69960f24 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/operations/get_tax_rate.py @@ -0,0 +1,30 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from codat_sync_for_payables_version_1.types import BaseModel +from codat_sync_for_payables_version_1.utils import FieldMetadata, PathParamMetadata +import pydantic +from typing_extensions import Annotated, TypedDict + + +class GetTaxRateRequestTypedDict(TypedDict): + company_id: str + r"""Unique identifier for a company.""" + tax_rate_id: str + r"""Unique identifier for a tax rate.""" + + +class GetTaxRateRequest(BaseModel): + company_id: Annotated[ + str, + pydantic.Field(alias="companyId"), + FieldMetadata(path=PathParamMetadata(style="simple", explode=False)), + ] + r"""Unique identifier for a company.""" + + tax_rate_id: Annotated[ + str, + pydantic.Field(alias="taxRateId"), + FieldMetadata(path=PathParamMetadata(style="simple", explode=False)), + ] + r"""Unique identifier for a tax rate.""" diff --git a/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/operations/get_tracking_category.py b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/operations/get_tracking_category.py new file mode 100644 index 000000000..c6165d1d8 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/operations/get_tracking_category.py @@ -0,0 +1,30 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from codat_sync_for_payables_version_1.types import BaseModel +from codat_sync_for_payables_version_1.utils import FieldMetadata, PathParamMetadata +import pydantic +from typing_extensions import Annotated, TypedDict + + +class GetTrackingCategoryRequestTypedDict(TypedDict): + company_id: str + r"""Unique identifier for a company.""" + tracking_category_id: str + r"""Unique identifier for a tracking category.""" + + +class GetTrackingCategoryRequest(BaseModel): + company_id: Annotated[ + str, + pydantic.Field(alias="companyId"), + FieldMetadata(path=PathParamMetadata(style="simple", explode=False)), + ] + r"""Unique identifier for a company.""" + + tracking_category_id: Annotated[ + str, + pydantic.Field(alias="trackingCategoryId"), + FieldMetadata(path=PathParamMetadata(style="simple", explode=False)), + ] + r"""Unique identifier for a tracking category.""" diff --git a/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/operations/list_accounts.py b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/operations/list_accounts.py new file mode 100644 index 000000000..3528221fa --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/operations/list_accounts.py @@ -0,0 +1,60 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from codat_sync_for_payables_version_1.types import BaseModel +from codat_sync_for_payables_version_1.utils import ( + FieldMetadata, + PathParamMetadata, + QueryParamMetadata, +) +import pydantic +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class ListAccountsRequestTypedDict(TypedDict): + company_id: str + r"""Unique identifier for a company.""" + order_by: NotRequired[str] + r"""Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results).""" + page: NotRequired[int] + r"""Page number. [Read more](https://docs.codat.io/using-the-api/paging).""" + page_size: NotRequired[int] + r"""Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging).""" + query: NotRequired[str] + r"""Codat query string. [Read more](https://docs.codat.io/using-the-api/querying).""" + + +class ListAccountsRequest(BaseModel): + company_id: Annotated[ + str, + pydantic.Field(alias="companyId"), + FieldMetadata(path=PathParamMetadata(style="simple", explode=False)), + ] + r"""Unique identifier for a company.""" + + order_by: Annotated[ + Optional[str], + pydantic.Field(alias="orderBy"), + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = None + r"""Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results).""" + + page: Annotated[ + Optional[int], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = 1 + r"""Page number. [Read more](https://docs.codat.io/using-the-api/paging).""" + + page_size: Annotated[ + Optional[int], + pydantic.Field(alias="pageSize"), + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = 100 + r"""Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging).""" + + query: Annotated[ + Optional[str], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = None + r"""Codat query string. [Read more](https://docs.codat.io/using-the-api/querying).""" diff --git a/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/operations/list_bill_attachments.py b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/operations/list_bill_attachments.py new file mode 100644 index 000000000..c2f94a178 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/operations/list_bill_attachments.py @@ -0,0 +1,39 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from codat_sync_for_payables_version_1.types import BaseModel +from codat_sync_for_payables_version_1.utils import FieldMetadata, PathParamMetadata +import pydantic +from typing_extensions import Annotated, TypedDict + + +class ListBillAttachmentsRequestTypedDict(TypedDict): + bill_id: str + r"""Unique identifier for a bill.""" + company_id: str + r"""Unique identifier for a company.""" + connection_id: str + r"""Unique identifier for a connection.""" + + +class ListBillAttachmentsRequest(BaseModel): + bill_id: Annotated[ + str, + pydantic.Field(alias="billId"), + FieldMetadata(path=PathParamMetadata(style="simple", explode=False)), + ] + r"""Unique identifier for a bill.""" + + 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/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/operations/list_bill_credit_notes.py b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/operations/list_bill_credit_notes.py new file mode 100644 index 000000000..135fdc115 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/operations/list_bill_credit_notes.py @@ -0,0 +1,60 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from codat_sync_for_payables_version_1.types import BaseModel +from codat_sync_for_payables_version_1.utils import ( + FieldMetadata, + PathParamMetadata, + QueryParamMetadata, +) +import pydantic +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class ListBillCreditNotesRequestTypedDict(TypedDict): + company_id: str + r"""Unique identifier for a company.""" + order_by: NotRequired[str] + r"""Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results).""" + page: NotRequired[int] + r"""Page number. [Read more](https://docs.codat.io/using-the-api/paging).""" + page_size: NotRequired[int] + r"""Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging).""" + query: NotRequired[str] + r"""Codat query string. [Read more](https://docs.codat.io/using-the-api/querying).""" + + +class ListBillCreditNotesRequest(BaseModel): + company_id: Annotated[ + str, + pydantic.Field(alias="companyId"), + FieldMetadata(path=PathParamMetadata(style="simple", explode=False)), + ] + r"""Unique identifier for a company.""" + + order_by: Annotated[ + Optional[str], + pydantic.Field(alias="orderBy"), + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = None + r"""Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results).""" + + page: Annotated[ + Optional[int], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = 1 + r"""Page number. [Read more](https://docs.codat.io/using-the-api/paging).""" + + page_size: Annotated[ + Optional[int], + pydantic.Field(alias="pageSize"), + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = 100 + r"""Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging).""" + + query: Annotated[ + Optional[str], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = None + r"""Codat query string. [Read more](https://docs.codat.io/using-the-api/querying).""" diff --git a/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/operations/list_bill_payments.py b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/operations/list_bill_payments.py new file mode 100644 index 000000000..8c09e1a1e --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/operations/list_bill_payments.py @@ -0,0 +1,60 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from codat_sync_for_payables_version_1.types import BaseModel +from codat_sync_for_payables_version_1.utils import ( + FieldMetadata, + PathParamMetadata, + QueryParamMetadata, +) +import pydantic +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class ListBillPaymentsRequestTypedDict(TypedDict): + company_id: str + r"""Unique identifier for a company.""" + order_by: NotRequired[str] + r"""Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results).""" + page: NotRequired[int] + r"""Page number. [Read more](https://docs.codat.io/using-the-api/paging).""" + page_size: NotRequired[int] + r"""Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging).""" + query: NotRequired[str] + r"""Codat query string. [Read more](https://docs.codat.io/using-the-api/querying).""" + + +class ListBillPaymentsRequest(BaseModel): + company_id: Annotated[ + str, + pydantic.Field(alias="companyId"), + FieldMetadata(path=PathParamMetadata(style="simple", explode=False)), + ] + r"""Unique identifier for a company.""" + + order_by: Annotated[ + Optional[str], + pydantic.Field(alias="orderBy"), + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = None + r"""Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results).""" + + page: Annotated[ + Optional[int], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = 1 + r"""Page number. [Read more](https://docs.codat.io/using-the-api/paging).""" + + page_size: Annotated[ + Optional[int], + pydantic.Field(alias="pageSize"), + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = 100 + r"""Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging).""" + + query: Annotated[ + Optional[str], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = None + r"""Codat query string. [Read more](https://docs.codat.io/using-the-api/querying).""" diff --git a/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/operations/list_bills.py b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/operations/list_bills.py new file mode 100644 index 000000000..57dcc54f1 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/operations/list_bills.py @@ -0,0 +1,60 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from codat_sync_for_payables_version_1.types import BaseModel +from codat_sync_for_payables_version_1.utils import ( + FieldMetadata, + PathParamMetadata, + QueryParamMetadata, +) +import pydantic +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class ListBillsRequestTypedDict(TypedDict): + company_id: str + r"""Unique identifier for a company.""" + order_by: NotRequired[str] + r"""Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results).""" + page: NotRequired[int] + r"""Page number. [Read more](https://docs.codat.io/using-the-api/paging).""" + page_size: NotRequired[int] + r"""Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging).""" + query: NotRequired[str] + r"""Codat query string. [Read more](https://docs.codat.io/using-the-api/querying).""" + + +class ListBillsRequest(BaseModel): + company_id: Annotated[ + str, + pydantic.Field(alias="companyId"), + FieldMetadata(path=PathParamMetadata(style="simple", explode=False)), + ] + r"""Unique identifier for a company.""" + + order_by: Annotated[ + Optional[str], + pydantic.Field(alias="orderBy"), + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = None + r"""Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results).""" + + page: Annotated[ + Optional[int], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = 1 + r"""Page number. [Read more](https://docs.codat.io/using-the-api/paging).""" + + page_size: Annotated[ + Optional[int], + pydantic.Field(alias="pageSize"), + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = 100 + r"""Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging).""" + + query: Annotated[ + Optional[str], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = None + r"""Codat query string. [Read more](https://docs.codat.io/using-the-api/querying).""" diff --git a/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/operations/list_companies.py b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/operations/list_companies.py new file mode 100644 index 000000000..ed0e4c7fb --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/operations/list_companies.py @@ -0,0 +1,47 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from codat_sync_for_payables_version_1.types import BaseModel +from codat_sync_for_payables_version_1.utils import FieldMetadata, QueryParamMetadata +import pydantic +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class ListCompaniesRequestTypedDict(TypedDict): + order_by: NotRequired[str] + r"""Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results).""" + page: NotRequired[int] + r"""Page number. [Read more](https://docs.codat.io/using-the-api/paging).""" + page_size: NotRequired[int] + r"""Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging).""" + query: NotRequired[str] + r"""Codat query string. [Read more](https://docs.codat.io/using-the-api/querying).""" + + +class ListCompaniesRequest(BaseModel): + order_by: Annotated[ + Optional[str], + pydantic.Field(alias="orderBy"), + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = None + r"""Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results).""" + + page: Annotated[ + Optional[int], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = 1 + r"""Page number. [Read more](https://docs.codat.io/using-the-api/paging).""" + + page_size: Annotated[ + Optional[int], + pydantic.Field(alias="pageSize"), + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = 100 + r"""Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging).""" + + query: Annotated[ + Optional[str], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = None + r"""Codat query string. [Read more](https://docs.codat.io/using-the-api/querying).""" diff --git a/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/operations/list_connections.py b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/operations/list_connections.py new file mode 100644 index 000000000..5d58d8b97 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/operations/list_connections.py @@ -0,0 +1,60 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from codat_sync_for_payables_version_1.types import BaseModel +from codat_sync_for_payables_version_1.utils import ( + FieldMetadata, + PathParamMetadata, + QueryParamMetadata, +) +import pydantic +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class ListConnectionsRequestTypedDict(TypedDict): + company_id: str + r"""Unique identifier for a company.""" + order_by: NotRequired[str] + r"""Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results).""" + page: NotRequired[int] + r"""Page number. [Read more](https://docs.codat.io/using-the-api/paging).""" + page_size: NotRequired[int] + r"""Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging).""" + query: NotRequired[str] + r"""Codat query string. [Read more](https://docs.codat.io/using-the-api/querying).""" + + +class ListConnectionsRequest(BaseModel): + company_id: Annotated[ + str, + pydantic.Field(alias="companyId"), + FieldMetadata(path=PathParamMetadata(style="simple", explode=False)), + ] + r"""Unique identifier for a company.""" + + order_by: Annotated[ + Optional[str], + pydantic.Field(alias="orderBy"), + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = None + r"""Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results).""" + + page: Annotated[ + Optional[int], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = 1 + r"""Page number. [Read more](https://docs.codat.io/using-the-api/paging).""" + + page_size: Annotated[ + Optional[int], + pydantic.Field(alias="pageSize"), + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = 100 + r"""Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging).""" + + query: Annotated[ + Optional[str], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = None + r"""Codat query string. [Read more](https://docs.codat.io/using-the-api/querying).""" diff --git a/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/operations/list_journals.py b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/operations/list_journals.py new file mode 100644 index 000000000..082df49d6 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/operations/list_journals.py @@ -0,0 +1,60 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from codat_sync_for_payables_version_1.types import BaseModel +from codat_sync_for_payables_version_1.utils import ( + FieldMetadata, + PathParamMetadata, + QueryParamMetadata, +) +import pydantic +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class ListJournalsRequestTypedDict(TypedDict): + company_id: str + r"""Unique identifier for a company.""" + order_by: NotRequired[str] + r"""Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results).""" + page: NotRequired[int] + r"""Page number. [Read more](https://docs.codat.io/using-the-api/paging).""" + page_size: NotRequired[int] + r"""Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging).""" + query: NotRequired[str] + r"""Codat query string. [Read more](https://docs.codat.io/using-the-api/querying).""" + + +class ListJournalsRequest(BaseModel): + company_id: Annotated[ + str, + pydantic.Field(alias="companyId"), + FieldMetadata(path=PathParamMetadata(style="simple", explode=False)), + ] + r"""Unique identifier for a company.""" + + order_by: Annotated[ + Optional[str], + pydantic.Field(alias="orderBy"), + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = None + r"""Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results).""" + + page: Annotated[ + Optional[int], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = 1 + r"""Page number. [Read more](https://docs.codat.io/using-the-api/paging).""" + + page_size: Annotated[ + Optional[int], + pydantic.Field(alias="pageSize"), + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = 100 + r"""Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging).""" + + query: Annotated[ + Optional[str], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = None + r"""Codat query string. [Read more](https://docs.codat.io/using-the-api/querying).""" diff --git a/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/operations/list_payment_methods.py b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/operations/list_payment_methods.py new file mode 100644 index 000000000..598288fca --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/operations/list_payment_methods.py @@ -0,0 +1,60 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from codat_sync_for_payables_version_1.types import BaseModel +from codat_sync_for_payables_version_1.utils import ( + FieldMetadata, + PathParamMetadata, + QueryParamMetadata, +) +import pydantic +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class ListPaymentMethodsRequestTypedDict(TypedDict): + company_id: str + r"""Unique identifier for a company.""" + order_by: NotRequired[str] + r"""Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results).""" + page: NotRequired[int] + r"""Page number. [Read more](https://docs.codat.io/using-the-api/paging).""" + page_size: NotRequired[int] + r"""Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging).""" + query: NotRequired[str] + r"""Codat query string. [Read more](https://docs.codat.io/using-the-api/querying).""" + + +class ListPaymentMethodsRequest(BaseModel): + company_id: Annotated[ + str, + pydantic.Field(alias="companyId"), + FieldMetadata(path=PathParamMetadata(style="simple", explode=False)), + ] + r"""Unique identifier for a company.""" + + order_by: Annotated[ + Optional[str], + pydantic.Field(alias="orderBy"), + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = None + r"""Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results).""" + + page: Annotated[ + Optional[int], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = 1 + r"""Page number. [Read more](https://docs.codat.io/using-the-api/paging).""" + + page_size: Annotated[ + Optional[int], + pydantic.Field(alias="pageSize"), + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = 100 + r"""Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging).""" + + query: Annotated[ + Optional[str], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = None + r"""Codat query string. [Read more](https://docs.codat.io/using-the-api/querying).""" diff --git a/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/operations/list_pull_operations.py b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/operations/list_pull_operations.py new file mode 100644 index 000000000..c6f689c18 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/operations/list_pull_operations.py @@ -0,0 +1,60 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from codat_sync_for_payables_version_1.types import BaseModel +from codat_sync_for_payables_version_1.utils import ( + FieldMetadata, + PathParamMetadata, + QueryParamMetadata, +) +import pydantic +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class ListPullOperationsRequestTypedDict(TypedDict): + company_id: str + r"""Unique identifier for a company.""" + order_by: NotRequired[str] + r"""Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results).""" + page: NotRequired[int] + r"""Page number. [Read more](https://docs.codat.io/using-the-api/paging).""" + page_size: NotRequired[int] + r"""Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging).""" + query: NotRequired[str] + r"""Codat query string. [Read more](https://docs.codat.io/using-the-api/querying).""" + + +class ListPullOperationsRequest(BaseModel): + company_id: Annotated[ + str, + pydantic.Field(alias="companyId"), + FieldMetadata(path=PathParamMetadata(style="simple", explode=False)), + ] + r"""Unique identifier for a company.""" + + order_by: Annotated[ + Optional[str], + pydantic.Field(alias="orderBy"), + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = None + r"""Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results).""" + + page: Annotated[ + Optional[int], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = 1 + r"""Page number. [Read more](https://docs.codat.io/using-the-api/paging).""" + + page_size: Annotated[ + Optional[int], + pydantic.Field(alias="pageSize"), + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = 100 + r"""Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging).""" + + query: Annotated[ + Optional[str], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = None + r"""Codat query string. [Read more](https://docs.codat.io/using-the-api/querying).""" diff --git a/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/operations/list_push_operations.py b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/operations/list_push_operations.py new file mode 100644 index 000000000..a70a429b6 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/operations/list_push_operations.py @@ -0,0 +1,60 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from codat_sync_for_payables_version_1.types import BaseModel +from codat_sync_for_payables_version_1.utils import ( + FieldMetadata, + PathParamMetadata, + QueryParamMetadata, +) +import pydantic +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class ListPushOperationsRequestTypedDict(TypedDict): + company_id: str + r"""Unique identifier for a company.""" + order_by: NotRequired[str] + r"""Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results).""" + page: NotRequired[int] + r"""Page number. [Read more](https://docs.codat.io/using-the-api/paging).""" + page_size: NotRequired[int] + r"""Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging).""" + query: NotRequired[str] + r"""Codat query string. [Read more](https://docs.codat.io/using-the-api/querying).""" + + +class ListPushOperationsRequest(BaseModel): + company_id: Annotated[ + str, + pydantic.Field(alias="companyId"), + FieldMetadata(path=PathParamMetadata(style="simple", explode=False)), + ] + r"""Unique identifier for a company.""" + + order_by: Annotated[ + Optional[str], + pydantic.Field(alias="orderBy"), + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = None + r"""Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results).""" + + page: Annotated[ + Optional[int], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = 1 + r"""Page number. [Read more](https://docs.codat.io/using-the-api/paging).""" + + page_size: Annotated[ + Optional[int], + pydantic.Field(alias="pageSize"), + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = 100 + r"""Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging).""" + + query: Annotated[ + Optional[str], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = None + r"""Codat query string. [Read more](https://docs.codat.io/using-the-api/querying).""" diff --git a/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/operations/list_suppliers.py b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/operations/list_suppliers.py new file mode 100644 index 000000000..ceccdeabe --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/operations/list_suppliers.py @@ -0,0 +1,60 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from codat_sync_for_payables_version_1.types import BaseModel +from codat_sync_for_payables_version_1.utils import ( + FieldMetadata, + PathParamMetadata, + QueryParamMetadata, +) +import pydantic +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class ListSuppliersRequestTypedDict(TypedDict): + company_id: str + r"""Unique identifier for a company.""" + order_by: NotRequired[str] + r"""Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results).""" + page: NotRequired[int] + r"""Page number. [Read more](https://docs.codat.io/using-the-api/paging).""" + page_size: NotRequired[int] + r"""Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging).""" + query: NotRequired[str] + r"""Codat query string. [Read more](https://docs.codat.io/using-the-api/querying).""" + + +class ListSuppliersRequest(BaseModel): + company_id: Annotated[ + str, + pydantic.Field(alias="companyId"), + FieldMetadata(path=PathParamMetadata(style="simple", explode=False)), + ] + r"""Unique identifier for a company.""" + + order_by: Annotated[ + Optional[str], + pydantic.Field(alias="orderBy"), + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = None + r"""Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results).""" + + page: Annotated[ + Optional[int], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = 1 + r"""Page number. [Read more](https://docs.codat.io/using-the-api/paging).""" + + page_size: Annotated[ + Optional[int], + pydantic.Field(alias="pageSize"), + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = 100 + r"""Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging).""" + + query: Annotated[ + Optional[str], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = None + r"""Codat query string. [Read more](https://docs.codat.io/using-the-api/querying).""" diff --git a/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/operations/list_tax_rates.py b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/operations/list_tax_rates.py new file mode 100644 index 000000000..02481e524 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/operations/list_tax_rates.py @@ -0,0 +1,60 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from codat_sync_for_payables_version_1.types import BaseModel +from codat_sync_for_payables_version_1.utils import ( + FieldMetadata, + PathParamMetadata, + QueryParamMetadata, +) +import pydantic +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class ListTaxRatesRequestTypedDict(TypedDict): + company_id: str + r"""Unique identifier for a company.""" + order_by: NotRequired[str] + r"""Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results).""" + page: NotRequired[int] + r"""Page number. [Read more](https://docs.codat.io/using-the-api/paging).""" + page_size: NotRequired[int] + r"""Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging).""" + query: NotRequired[str] + r"""Codat query string. [Read more](https://docs.codat.io/using-the-api/querying).""" + + +class ListTaxRatesRequest(BaseModel): + company_id: Annotated[ + str, + pydantic.Field(alias="companyId"), + FieldMetadata(path=PathParamMetadata(style="simple", explode=False)), + ] + r"""Unique identifier for a company.""" + + order_by: Annotated[ + Optional[str], + pydantic.Field(alias="orderBy"), + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = None + r"""Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results).""" + + page: Annotated[ + Optional[int], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = 1 + r"""Page number. [Read more](https://docs.codat.io/using-the-api/paging).""" + + page_size: Annotated[ + Optional[int], + pydantic.Field(alias="pageSize"), + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = 100 + r"""Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging).""" + + query: Annotated[ + Optional[str], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = None + r"""Codat query string. [Read more](https://docs.codat.io/using-the-api/querying).""" diff --git a/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/operations/list_tracking_categories.py b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/operations/list_tracking_categories.py new file mode 100644 index 000000000..faca74885 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/operations/list_tracking_categories.py @@ -0,0 +1,60 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from codat_sync_for_payables_version_1.types import BaseModel +from codat_sync_for_payables_version_1.utils import ( + FieldMetadata, + PathParamMetadata, + QueryParamMetadata, +) +import pydantic +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class ListTrackingCategoriesRequestTypedDict(TypedDict): + company_id: str + r"""Unique identifier for a company.""" + order_by: NotRequired[str] + r"""Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results).""" + page: NotRequired[int] + r"""Page number. [Read more](https://docs.codat.io/using-the-api/paging).""" + page_size: NotRequired[int] + r"""Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging).""" + query: NotRequired[str] + r"""Codat query string. [Read more](https://docs.codat.io/using-the-api/querying).""" + + +class ListTrackingCategoriesRequest(BaseModel): + company_id: Annotated[ + str, + pydantic.Field(alias="companyId"), + FieldMetadata(path=PathParamMetadata(style="simple", explode=False)), + ] + r"""Unique identifier for a company.""" + + order_by: Annotated[ + Optional[str], + pydantic.Field(alias="orderBy"), + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = None + r"""Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results).""" + + page: Annotated[ + Optional[int], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = 1 + r"""Page number. [Read more](https://docs.codat.io/using-the-api/paging).""" + + page_size: Annotated[ + Optional[int], + pydantic.Field(alias="pageSize"), + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = 100 + r"""Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging).""" + + query: Annotated[ + Optional[str], + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = None + r"""Codat query string. [Read more](https://docs.codat.io/using-the-api/querying).""" diff --git a/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/operations/refresh_all_data_types.py b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/operations/refresh_all_data_types.py new file mode 100644 index 000000000..c26195b69 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/operations/refresh_all_data_types.py @@ -0,0 +1,21 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from codat_sync_for_payables_version_1.types import BaseModel +from codat_sync_for_payables_version_1.utils import FieldMetadata, PathParamMetadata +import pydantic +from typing_extensions import Annotated, TypedDict + + +class RefreshAllDataTypesRequestTypedDict(TypedDict): + company_id: str + r"""Unique identifier for a company.""" + + +class RefreshAllDataTypesRequest(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/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/operations/refresh_data_type.py b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/operations/refresh_data_type.py new file mode 100644 index 000000000..3a877d3a4 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/operations/refresh_data_type.py @@ -0,0 +1,47 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from codat_sync_for_payables_version_1.models.shared import ( + schema_datatype as shared_schema_datatype, +) +from codat_sync_for_payables_version_1.types import BaseModel +from codat_sync_for_payables_version_1.utils import ( + FieldMetadata, + PathParamMetadata, + QueryParamMetadata, +) +import pydantic +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class RefreshDataTypeRequestTypedDict(TypedDict): + company_id: str + r"""Unique identifier for a company.""" + data_type: shared_schema_datatype.SchemaDataType + r"""The key of a Codat data type""" + connection_id: NotRequired[str] + r"""Optionally, provide a data connection id to only queue pull operations on that connection.""" + + +class RefreshDataTypeRequest(BaseModel): + company_id: Annotated[ + str, + pydantic.Field(alias="companyId"), + FieldMetadata(path=PathParamMetadata(style="simple", explode=False)), + ] + r"""Unique identifier for a company.""" + + data_type: Annotated[ + shared_schema_datatype.SchemaDataType, + pydantic.Field(alias="dataType"), + FieldMetadata(path=PathParamMetadata(style="simple", explode=False)), + ] + r"""The key of a Codat data type""" + + connection_id: Annotated[ + Optional[str], + pydantic.Field(alias="connectionId"), + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = None + r"""Optionally, provide a data connection id to only queue pull operations on that connection.""" diff --git a/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/operations/unlink_connection.py b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/operations/unlink_connection.py new file mode 100644 index 000000000..6a869957b --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/operations/unlink_connection.py @@ -0,0 +1,54 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from codat_sync_for_payables_version_1.models.shared import ( + dataconnectionstatus as shared_dataconnectionstatus, +) +from codat_sync_for_payables_version_1.types import BaseModel +from codat_sync_for_payables_version_1.utils import ( + FieldMetadata, + PathParamMetadata, + RequestMetadata, +) +import pydantic +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class UnlinkConnectionUpdateConnectionTypedDict(TypedDict): + status: NotRequired[shared_dataconnectionstatus.DataConnectionStatus] + r"""The current authorization status of the data connection.""" + + +class UnlinkConnectionUpdateConnection(BaseModel): + status: Optional[shared_dataconnectionstatus.DataConnectionStatus] = None + r"""The current authorization status of the data connection.""" + + +class UnlinkConnectionRequestTypedDict(TypedDict): + company_id: str + r"""Unique identifier for a company.""" + connection_id: str + r"""Unique identifier for a connection.""" + request_body: NotRequired[UnlinkConnectionUpdateConnectionTypedDict] + + +class UnlinkConnectionRequest(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[UnlinkConnectionUpdateConnection], + FieldMetadata(request=RequestMetadata(media_type="application/json")), + ] = None diff --git a/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/operations/update_bill.py b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/operations/update_bill.py new file mode 100644 index 000000000..344da905b --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/operations/update_bill.py @@ -0,0 +1,107 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from codat_sync_for_payables_version_1.models.shared import bill as shared_bill +from codat_sync_for_payables_version_1.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from codat_sync_for_payables_version_1.utils import ( + FieldMetadata, + PathParamMetadata, + QueryParamMetadata, + RequestMetadata, +) +import pydantic +from pydantic import model_serializer +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class UpdateBillRequestTypedDict(TypedDict): + bill_id: str + r"""Unique identifier for a bill.""" + company_id: str + r"""Unique identifier for a company.""" + connection_id: str + r"""Unique identifier for a connection.""" + bill: NotRequired[Nullable[shared_bill.BillTypedDict]] + force_update: NotRequired[bool] + r"""When updating data in the destination platform Codat checks the `sourceModifiedDate` against the `lastupdated` date from the accounting software, if they're different Codat will return an error suggesting you should initiate another pull of the data. If this is set to `true` then the update will override this check.""" + timeout_in_minutes: NotRequired[int] + r"""Time limit for the push operation to complete before it is timed out.""" + + +class UpdateBillRequest(BaseModel): + bill_id: Annotated[ + str, + pydantic.Field(alias="billId"), + FieldMetadata(path=PathParamMetadata(style="simple", explode=False)), + ] + r"""Unique identifier for a bill.""" + + 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.""" + + bill: Annotated[ + OptionalNullable[shared_bill.Bill], + FieldMetadata(request=RequestMetadata(media_type="application/json")), + ] = UNSET + + force_update: Annotated[ + Optional[bool], + pydantic.Field(alias="forceUpdate"), + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = False + r"""When updating data in the destination platform Codat checks the `sourceModifiedDate` against the `lastupdated` date from the accounting software, if they're different Codat will return an error suggesting you should initiate another pull of the data. If this is set to `true` then the update will override this check.""" + + timeout_in_minutes: Annotated[ + Optional[int], + pydantic.Field(alias="timeoutInMinutes"), + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = None + r"""Time limit for the push operation to complete before it is timed out.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = ["Bill", "forceUpdate", "timeoutInMinutes"] + nullable_fields = ["Bill"] + null_default_fields = [] + + serialized = handler(self) + + m = {} + + for n, f in self.model_fields.items(): + k = f.alias or n + val = serialized.get(k) + serialized.pop(k, None) + + optional_nullable = k in optional_fields and k in nullable_fields + is_set = ( + self.__pydantic_fields_set__.intersection({n}) + or k in null_default_fields + ) # pylint: disable=no-member + + if val is not None and val != UNSET_SENTINEL: + m[k] = val + elif val != UNSET_SENTINEL and ( + not k in optional_fields or (optional_nullable and is_set) + ): + m[k] = val + + return m diff --git a/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/operations/update_bill_credit_note.py b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/operations/update_bill_credit_note.py new file mode 100644 index 000000000..41e4106bf --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/operations/update_bill_credit_note.py @@ -0,0 +1,111 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from codat_sync_for_payables_version_1.models.shared import ( + billcreditnote as shared_billcreditnote, +) +from codat_sync_for_payables_version_1.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from codat_sync_for_payables_version_1.utils import ( + FieldMetadata, + PathParamMetadata, + QueryParamMetadata, + RequestMetadata, +) +import pydantic +from pydantic import model_serializer +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class UpdateBillCreditNoteRequestTypedDict(TypedDict): + bill_credit_note_id: str + r"""Unique identifier for a bill credit note.""" + company_id: str + r"""Unique identifier for a company.""" + connection_id: str + r"""Unique identifier for a connection.""" + bill_credit_note: NotRequired[ + Nullable[shared_billcreditnote.BillCreditNoteTypedDict] + ] + force_update: NotRequired[bool] + r"""When updating data in the destination platform Codat checks the `sourceModifiedDate` against the `lastupdated` date from the accounting software, if they're different Codat will return an error suggesting you should initiate another pull of the data. If this is set to `true` then the update will override this check.""" + timeout_in_minutes: NotRequired[int] + r"""Time limit for the push operation to complete before it is timed out.""" + + +class UpdateBillCreditNoteRequest(BaseModel): + bill_credit_note_id: Annotated[ + str, + pydantic.Field(alias="billCreditNoteId"), + FieldMetadata(path=PathParamMetadata(style="simple", explode=False)), + ] + r"""Unique identifier for a bill credit note.""" + + 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.""" + + bill_credit_note: Annotated[ + OptionalNullable[shared_billcreditnote.BillCreditNote], + FieldMetadata(request=RequestMetadata(media_type="application/json")), + ] = UNSET + + force_update: Annotated[ + Optional[bool], + pydantic.Field(alias="forceUpdate"), + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = False + r"""When updating data in the destination platform Codat checks the `sourceModifiedDate` against the `lastupdated` date from the accounting software, if they're different Codat will return an error suggesting you should initiate another pull of the data. If this is set to `true` then the update will override this check.""" + + timeout_in_minutes: Annotated[ + Optional[int], + pydantic.Field(alias="timeoutInMinutes"), + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = None + r"""Time limit for the push operation to complete before it is timed out.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = ["BillCreditNote", "forceUpdate", "timeoutInMinutes"] + nullable_fields = ["BillCreditNote"] + null_default_fields = [] + + serialized = handler(self) + + m = {} + + for n, f in self.model_fields.items(): + k = f.alias or n + val = serialized.get(k) + serialized.pop(k, None) + + optional_nullable = k in optional_fields and k in nullable_fields + is_set = ( + self.__pydantic_fields_set__.intersection({n}) + or k in null_default_fields + ) # pylint: disable=no-member + + if val is not None and val != UNSET_SENTINEL: + m[k] = val + elif val != UNSET_SENTINEL and ( + not k in optional_fields or (optional_nullable and is_set) + ): + m[k] = val + + return m diff --git a/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/operations/update_company.py b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/operations/update_company.py new file mode 100644 index 000000000..55ee076dd --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/operations/update_company.py @@ -0,0 +1,37 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from codat_sync_for_payables_version_1.models.shared import ( + companyrequestbody as shared_companyrequestbody, +) +from codat_sync_for_payables_version_1.types import BaseModel +from codat_sync_for_payables_version_1.utils import ( + FieldMetadata, + PathParamMetadata, + RequestMetadata, +) +import pydantic +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class UpdateCompanyRequestTypedDict(TypedDict): + company_id: str + r"""Unique identifier for a company.""" + company_request_body: NotRequired[ + shared_companyrequestbody.CompanyRequestBodyTypedDict + ] + + +class UpdateCompanyRequest(BaseModel): + company_id: Annotated[ + str, + pydantic.Field(alias="companyId"), + FieldMetadata(path=PathParamMetadata(style="simple", explode=False)), + ] + r"""Unique identifier for a company.""" + + company_request_body: Annotated[ + Optional[shared_companyrequestbody.CompanyRequestBody], + FieldMetadata(request=RequestMetadata(media_type="application/json")), + ] = None diff --git a/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/operations/update_supplier.py b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/operations/update_supplier.py new file mode 100644 index 000000000..c6689f7b8 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/operations/update_supplier.py @@ -0,0 +1,107 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from codat_sync_for_payables_version_1.models.shared import supplier as shared_supplier +from codat_sync_for_payables_version_1.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from codat_sync_for_payables_version_1.utils import ( + FieldMetadata, + PathParamMetadata, + QueryParamMetadata, + RequestMetadata, +) +import pydantic +from pydantic import model_serializer +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class UpdateSupplierRequestTypedDict(TypedDict): + company_id: str + r"""Unique identifier for a company.""" + connection_id: str + r"""Unique identifier for a connection.""" + supplier_id: str + r"""Unique identifier for a supplier.""" + supplier: NotRequired[Nullable[shared_supplier.SupplierTypedDict]] + force_update: NotRequired[bool] + r"""When updating data in the destination platform Codat checks the `sourceModifiedDate` against the `lastupdated` date from the accounting software, if they're different Codat will return an error suggesting you should initiate another pull of the data. If this is set to `true` then the update will override this check.""" + timeout_in_minutes: NotRequired[int] + r"""Time limit for the push operation to complete before it is timed out.""" + + +class UpdateSupplierRequest(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.""" + + supplier_id: Annotated[ + str, + pydantic.Field(alias="supplierId"), + FieldMetadata(path=PathParamMetadata(style="simple", explode=False)), + ] + r"""Unique identifier for a supplier.""" + + supplier: Annotated[ + OptionalNullable[shared_supplier.Supplier], + FieldMetadata(request=RequestMetadata(media_type="application/json")), + ] = UNSET + + force_update: Annotated[ + Optional[bool], + pydantic.Field(alias="forceUpdate"), + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = False + r"""When updating data in the destination platform Codat checks the `sourceModifiedDate` against the `lastupdated` date from the accounting software, if they're different Codat will return an error suggesting you should initiate another pull of the data. If this is set to `true` then the update will override this check.""" + + timeout_in_minutes: Annotated[ + Optional[int], + pydantic.Field(alias="timeoutInMinutes"), + FieldMetadata(query=QueryParamMetadata(style="form", explode=True)), + ] = None + r"""Time limit for the push operation to complete before it is timed out.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = ["Supplier", "forceUpdate", "timeoutInMinutes"] + nullable_fields = ["Supplier"] + null_default_fields = [] + + serialized = handler(self) + + m = {} + + for n, f in self.model_fields.items(): + k = f.alias or n + val = serialized.get(k) + serialized.pop(k, None) + + optional_nullable = k in optional_fields and k in nullable_fields + is_set = ( + self.__pydantic_fields_set__.intersection({n}) + or k in null_default_fields + ) # pylint: disable=no-member + + if val is not None and val != UNSET_SENTINEL: + m[k] = val + elif val != UNSET_SENTINEL and ( + not k in optional_fields or (optional_nullable and is_set) + ): + m[k] = val + + return m diff --git a/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/operations/upload_bill_attachment.py b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/operations/upload_bill_attachment.py new file mode 100644 index 000000000..03447b9c6 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/operations/upload_bill_attachment.py @@ -0,0 +1,53 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from codat_sync_for_payables_version_1.models.shared import ( + attachmentupload as shared_attachmentupload, +) +from codat_sync_for_payables_version_1.types import BaseModel +from codat_sync_for_payables_version_1.utils import ( + FieldMetadata, + PathParamMetadata, + RequestMetadata, +) +import pydantic +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class UploadBillAttachmentRequestTypedDict(TypedDict): + bill_id: str + r"""Unique identifier for a bill.""" + company_id: str + r"""Unique identifier for a company.""" + connection_id: str + r"""Unique identifier for a connection.""" + attachment_upload: NotRequired[shared_attachmentupload.AttachmentUploadTypedDict] + + +class UploadBillAttachmentRequest(BaseModel): + bill_id: Annotated[ + str, + pydantic.Field(alias="billId"), + FieldMetadata(path=PathParamMetadata(style="simple", explode=False)), + ] + r"""Unique identifier for a bill.""" + + 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.""" + + attachment_upload: Annotated[ + Optional[shared_attachmentupload.AttachmentUpload], + FieldMetadata(request=RequestMetadata(media_type="multipart/form-data")), + ] = None diff --git a/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/__init__.py b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/__init__.py new file mode 100644 index 000000000..28c2e563c --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/__init__.py @@ -0,0 +1,607 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from .account import ( + Account, + AccountTypedDict, + AccountValidDataTypeLinks, + AccountValidDataTypeLinksTypedDict, +) +from .accountingaddresstype import AccountingAddressType +from .accountprototype import ( + AccountPrototype, + AccountPrototypeTypedDict, + ValidDataTypeLinks, + ValidDataTypeLinksTypedDict, +) +from .accountref import AccountRef, AccountRefTypedDict +from .accounts import Accounts, AccountsTypedDict +from .accountstatus import AccountStatus +from .accounttype import AccountType +from .address import Address, AddressTypedDict +from .attachment import Attachment, AttachmentTypedDict +from .attachments import Attachments, AttachmentsTypedDict +from .attachmentupload import AttachmentUpload, AttachmentUploadTypedDict +from .bankaccountcreateresponse import ( + AccountingBankAccount, + AccountingBankAccountTypedDict, + BankAccountCreateResponse, + BankAccountCreateResponseBankAccountType, + BankAccountCreateResponseTypedDict, +) +from .bankaccountprototype import ( + BankAccountPrototype, + BankAccountPrototypeTypedDict, + BankAccountType, +) +from .bankaccountstatus import BankAccountStatus +from .bill import ( + AccountingPaymentAllocation, + AccountingPaymentAllocationTypedDict, + Bill, + BillAllocation, + BillAllocationTypedDict, + BillTypedDict, + PurchaseOrderReference, + PurchaseOrderReferenceTypedDict, + WithholdingTax, + WithholdingTaxTypedDict, +) +from .billcreditnote import ( + BillCreditNote, + BillCreditNoteTypedDict, + RecordReference, + RecordReferenceTypedDict, +) +from .billcreditnotelineitem import ( + BillCreditNoteLineItem, + BillCreditNoteLineItemAccountingProjectReference, + BillCreditNoteLineItemAccountingProjectReferenceTypedDict, + BillCreditNoteLineItemCustomerRef, + BillCreditNoteLineItemCustomerRefTypedDict, + BillCreditNoteLineItemTracking, + BillCreditNoteLineItemTrackingTypedDict, + BillCreditNoteLineItemTypedDict, + ItemReference, + ItemReferenceTypedDict, +) +from .billcreditnotes import BillCreditNotes, BillCreditNotesTypedDict +from .billcreditnotestatus import BillCreditNoteStatus +from .billedtotype import BilledToType +from .billlineitem import ( + BillLineItem, + BillLineItemDataType, + BillLineItemTypedDict, + RecordLineReference, + RecordLineReferenceTypedDict, +) +from .billpayment import BillPayment, BillPaymentTypedDict +from .billpaymentline import BillPaymentLine, BillPaymentLineTypedDict +from .billpaymentlinelink import BillPaymentLineLink, BillPaymentLineLinkTypedDict +from .billpaymentlinelinktype import BillPaymentLineLinkType +from .billpayments import BillPayments, BillPaymentsTypedDict +from .bills import Bills, BillsTypedDict +from .billstatus import BillStatus +from .clientratelimitreachedwebhook import ( + ClientRateLimitReachedWebhook, + ClientRateLimitReachedWebhookTypedDict, +) +from .clientratelimitreachedwebhookdata import ( + ClientRateLimitReachedWebhookData, + ClientRateLimitReachedWebhookDataTypedDict, +) +from .clientratelimitresetwebhook import ( + ClientRateLimitResetWebhook, + ClientRateLimitResetWebhookTypedDict, +) +from .clientratelimitresetwebhookdata import ( + ClientRateLimitResetWebhookData, + ClientRateLimitResetWebhookDataTypedDict, +) +from .clientratelimitwebhook import ( + ClientRateLimitWebhook, + ClientRateLimitWebhookTypedDict, +) +from .clientratelimitwebhookpayload import ( + ClientRateLimitWebhookPayload, + ClientRateLimitWebhookPayloadTypedDict, +) +from .codatfile import CodatFile, CodatFileTypedDict +from .companies import Companies, CompaniesTypedDict +from .company import Company, CompanyTags, CompanyTagsTypedDict, CompanyTypedDict +from .companyinfo import CompanyInfo, CompanyInfoTypedDict +from .companyrequestbody import CompanyRequestBody, CompanyRequestBodyTypedDict +from .connection import Connection, ConnectionTypedDict, SourceType +from .connections import Connections, ConnectionsTypedDict +from .createaccountresponse import ( + AccountingAccount, + AccountingAccountTypedDict, + CreateAccountResponse, + CreateAccountResponseTypedDict, + CreateAccountResponseValidDataTypeLinks, + CreateAccountResponseValidDataTypeLinksTypedDict, +) +from .createbillcreditnoteresponse import ( + AccountingBillCreditNote, + AccountingBillCreditNoteTypedDict, + CreateBillCreditNoteResponse, + CreateBillCreditNoteResponseRecordReference, + CreateBillCreditNoteResponseRecordReferenceTypedDict, + CreateBillCreditNoteResponseTypedDict, +) +from .createbillpaymentresponse import ( + AccountingBillPayment, + AccountingBillPaymentTypedDict, + CreateBillPaymentResponse, + CreateBillPaymentResponseTypedDict, +) +from .createbillresponse import ( + AccountingBill, + AccountingBillTypedDict, + CreateBillResponse, + CreateBillResponseAccountingPaymentAllocation, + CreateBillResponseAccountingPaymentAllocationTypedDict, + CreateBillResponseAllocation, + CreateBillResponseAllocationTypedDict, + CreateBillResponsePurchaseOrderReference, + CreateBillResponsePurchaseOrderReferenceTypedDict, + CreateBillResponseTypedDict, + CreateBillResponseWithholdingTax, + CreateBillResponseWithholdingTaxTypedDict, +) +from .createjournalentryresponse import ( + AccountingJournalEntry, + AccountingJournalEntryTypedDict, + CreateJournalEntryResponse, + CreateJournalEntryResponseTypedDict, +) +from .createjournalresponse import ( + AccountingJournal, + AccountingJournalTypedDict, + CreateJournalResponse, + CreateJournalResponseTypedDict, +) +from .createsupplierresponse import ( + AccountingSupplier, + AccountingSupplierTypedDict, + CreateSupplierResponse, + CreateSupplierResponseTypedDict, +) +from .dataconnectionerror import ( + DataConnectionError, + DataConnectionErrorTypedDict, + ErrorStatus, +) +from .dataconnectionstatus import DataConnectionStatus +from .datastatus import DataStatus, DataStatusTypedDict, DataTypes +from .datatype import DataType +from .errorvalidation import ErrorValidation, ErrorValidationTypedDict +from .errorvalidationitem import ErrorValidationItem, ErrorValidationItemTypedDict +from .halref import HalRef, HalRefTypedDict +from .itemref import ItemRef, ItemRefTypedDict +from .items import Allocation, AllocationTypedDict, Items, ItemsTypedDict +from .journal import Journal, JournalTypedDict +from .journalentry import JournalEntry, JournalEntryTypedDict +from .journalentryrecordref import ( + JournalEntryRecordRef, + JournalEntryRecordRefDataType, + JournalEntryRecordRefTypedDict, +) +from .journalline import ( + ContactReference, + ContactReferenceTypedDict, + JournalLine, + JournalLineDataType, + JournalLineTracking, + JournalLineTrackingTypedDict, + JournalLineTypedDict, +) +from .journalprototype import JournalPrototype, JournalPrototypeTypedDict +from .journalref import JournalRef, JournalRefTypedDict +from .journals import Journals, JournalsTypedDict +from .journalstatus import JournalStatus +from .links import Links, LinksTypedDict +from .metadata import Metadata, MetadataTypedDict +from .paymentallocationpayment import ( + PaymentAllocationPayment, + PaymentAllocationPaymentTypedDict, +) +from .paymentmethod import PaymentMethod, PaymentMethodStatus, PaymentMethodTypedDict +from .paymentmethodref import PaymentMethodRef, PaymentMethodRefTypedDict +from .paymentmethods import PaymentMethods, PaymentMethodsTypedDict +from .paymentmethodtype import PaymentMethodType +from .phonenumber import PhoneNumber, PhoneNumberTypedDict +from .phonenumbertype import PhoneNumberType +from .propertie_status import PropertieStatus +from .pulloperation import DatasetStatus, PullOperation, PullOperationTypedDict +from .pulloperations import PullOperations, PullOperationsTypedDict +from .pushchangetype import PushChangeType +from .pushfieldvalidation import PushFieldValidation, PushFieldValidationTypedDict +from .pushoperation import PushOperation, PushOperationTypedDict +from .pushoperationchange import PushOperationChange, PushOperationChangeTypedDict +from .pushoperationref import PushOperationRef, PushOperationRefTypedDict +from .pushoperations import PushOperations, PushOperationsTypedDict +from .pushoperationstatus import PushOperationStatus +from .pushoption import PushOption, PushOptionTypedDict +from .pushoptionchoice import PushOptionChoice, PushOptionChoiceTypedDict +from .pushoptionproperty import PushOptionProperty, PushOptionPropertyTypedDict +from .pushoptiontype import PushOptionType +from .pushvalidationinfo import PushValidationInfo, PushValidationInfoTypedDict +from .schema_datatype import SchemaDataType +from .security import Security, SecurityTypedDict +from .status import Status +from .supplementaldata import SupplementalData, SupplementalDataTypedDict +from .supplier import Supplier, SupplierTypedDict +from .supplierref import SupplierRef, SupplierRefTypedDict +from .suppliers import Suppliers, SuppliersTypedDict +from .supplierstatus import SupplierStatus +from .tags import Tags, TagsTypedDict +from .taxrate import TaxRate, TaxRateTypedDict +from .taxratecomponent import TaxRateComponent, TaxRateComponentTypedDict +from .taxrateref import TaxRateRef, TaxRateRefTypedDict +from .taxrates import TaxRates, TaxRatesTypedDict +from .taxratestatus import TaxRateStatus +from .tracking import ( + AccountingProjectReference, + AccountingProjectReferenceTypedDict, + CustomerRef, + CustomerRefTypedDict, + Tracking, + TrackingTypedDict, +) +from .trackingcategories import TrackingCategories, TrackingCategoriesTypedDict +from .trackingcategory import TrackingCategory, TrackingCategoryTypedDict +from .trackingcategoryref import TrackingCategoryRef, TrackingCategoryRefTypedDict +from .trackingcategorytree import TrackingCategoryTree, TrackingCategoryTreeTypedDict +from .trackingrecordref import ( + TrackingRecordRef, + TrackingRecordRefDataType, + TrackingRecordRefTypedDict, +) +from .updatebillcreditnoteresponse import ( + UpdateBillCreditNoteResponse, + UpdateBillCreditNoteResponseAccountingBillCreditNote, + UpdateBillCreditNoteResponseAccountingBillCreditNoteTypedDict, + UpdateBillCreditNoteResponseRecordReference, + UpdateBillCreditNoteResponseRecordReferenceTypedDict, + UpdateBillCreditNoteResponseTypedDict, +) +from .updatebillresponse import ( + UpdateBillResponse, + UpdateBillResponseAccountingBill, + UpdateBillResponseAccountingBillTypedDict, + UpdateBillResponseAccountingPaymentAllocation, + UpdateBillResponseAccountingPaymentAllocationTypedDict, + UpdateBillResponseAllocation, + UpdateBillResponseAllocationTypedDict, + UpdateBillResponsePurchaseOrderReference, + UpdateBillResponsePurchaseOrderReferenceTypedDict, + UpdateBillResponseTypedDict, + UpdateBillResponseWithholdingTax, + UpdateBillResponseWithholdingTaxTypedDict, +) +from .updatesupplierresponse import ( + UpdateSupplierResponse, + UpdateSupplierResponseAccountingSupplier, + UpdateSupplierResponseAccountingSupplierTypedDict, + UpdateSupplierResponseTypedDict, +) +from .validation import Validation, ValidationTypedDict +from .validationitem import ValidationItem, ValidationItemTypedDict +from .validdatatypelink_items import ( + ValidDatatypeLinkItems, + ValidDatatypeLinkItemsTypedDict, +) +from .weblink import Type, WebLink, WebLinkTypedDict +from .withholdingtax_items import WithholdingTaxItems, WithholdingTaxItemsTypedDict +from .zero import Zero, ZeroDataType, ZeroTypedDict + +__all__ = [ + "Account", + "AccountPrototype", + "AccountPrototypeTypedDict", + "AccountRef", + "AccountRefTypedDict", + "AccountStatus", + "AccountType", + "AccountTypedDict", + "AccountValidDataTypeLinks", + "AccountValidDataTypeLinksTypedDict", + "AccountingAccount", + "AccountingAccountTypedDict", + "AccountingAddressType", + "AccountingBankAccount", + "AccountingBankAccountTypedDict", + "AccountingBill", + "AccountingBillCreditNote", + "AccountingBillCreditNoteTypedDict", + "AccountingBillPayment", + "AccountingBillPaymentTypedDict", + "AccountingBillTypedDict", + "AccountingJournal", + "AccountingJournalEntry", + "AccountingJournalEntryTypedDict", + "AccountingJournalTypedDict", + "AccountingPaymentAllocation", + "AccountingPaymentAllocationTypedDict", + "AccountingProjectReference", + "AccountingProjectReferenceTypedDict", + "AccountingSupplier", + "AccountingSupplierTypedDict", + "Accounts", + "AccountsTypedDict", + "Address", + "AddressTypedDict", + "Allocation", + "AllocationTypedDict", + "Attachment", + "AttachmentTypedDict", + "AttachmentUpload", + "AttachmentUploadTypedDict", + "Attachments", + "AttachmentsTypedDict", + "BankAccountCreateResponse", + "BankAccountCreateResponseBankAccountType", + "BankAccountCreateResponseTypedDict", + "BankAccountPrototype", + "BankAccountPrototypeTypedDict", + "BankAccountStatus", + "BankAccountType", + "Bill", + "BillAllocation", + "BillAllocationTypedDict", + "BillCreditNote", + "BillCreditNoteLineItem", + "BillCreditNoteLineItemAccountingProjectReference", + "BillCreditNoteLineItemAccountingProjectReferenceTypedDict", + "BillCreditNoteLineItemCustomerRef", + "BillCreditNoteLineItemCustomerRefTypedDict", + "BillCreditNoteLineItemTracking", + "BillCreditNoteLineItemTrackingTypedDict", + "BillCreditNoteLineItemTypedDict", + "BillCreditNoteStatus", + "BillCreditNoteTypedDict", + "BillCreditNotes", + "BillCreditNotesTypedDict", + "BillLineItem", + "BillLineItemDataType", + "BillLineItemTypedDict", + "BillPayment", + "BillPaymentLine", + "BillPaymentLineLink", + "BillPaymentLineLinkType", + "BillPaymentLineLinkTypedDict", + "BillPaymentLineTypedDict", + "BillPaymentTypedDict", + "BillPayments", + "BillPaymentsTypedDict", + "BillStatus", + "BillTypedDict", + "BilledToType", + "Bills", + "BillsTypedDict", + "ClientRateLimitReachedWebhook", + "ClientRateLimitReachedWebhookData", + "ClientRateLimitReachedWebhookDataTypedDict", + "ClientRateLimitReachedWebhookTypedDict", + "ClientRateLimitResetWebhook", + "ClientRateLimitResetWebhookData", + "ClientRateLimitResetWebhookDataTypedDict", + "ClientRateLimitResetWebhookTypedDict", + "ClientRateLimitWebhook", + "ClientRateLimitWebhookPayload", + "ClientRateLimitWebhookPayloadTypedDict", + "ClientRateLimitWebhookTypedDict", + "CodatFile", + "CodatFileTypedDict", + "Companies", + "CompaniesTypedDict", + "Company", + "CompanyInfo", + "CompanyInfoTypedDict", + "CompanyRequestBody", + "CompanyRequestBodyTypedDict", + "CompanyTags", + "CompanyTagsTypedDict", + "CompanyTypedDict", + "Connection", + "ConnectionTypedDict", + "Connections", + "ConnectionsTypedDict", + "ContactReference", + "ContactReferenceTypedDict", + "CreateAccountResponse", + "CreateAccountResponseTypedDict", + "CreateAccountResponseValidDataTypeLinks", + "CreateAccountResponseValidDataTypeLinksTypedDict", + "CreateBillCreditNoteResponse", + "CreateBillCreditNoteResponseRecordReference", + "CreateBillCreditNoteResponseRecordReferenceTypedDict", + "CreateBillCreditNoteResponseTypedDict", + "CreateBillPaymentResponse", + "CreateBillPaymentResponseTypedDict", + "CreateBillResponse", + "CreateBillResponseAccountingPaymentAllocation", + "CreateBillResponseAccountingPaymentAllocationTypedDict", + "CreateBillResponseAllocation", + "CreateBillResponseAllocationTypedDict", + "CreateBillResponsePurchaseOrderReference", + "CreateBillResponsePurchaseOrderReferenceTypedDict", + "CreateBillResponseTypedDict", + "CreateBillResponseWithholdingTax", + "CreateBillResponseWithholdingTaxTypedDict", + "CreateJournalEntryResponse", + "CreateJournalEntryResponseTypedDict", + "CreateJournalResponse", + "CreateJournalResponseTypedDict", + "CreateSupplierResponse", + "CreateSupplierResponseTypedDict", + "CustomerRef", + "CustomerRefTypedDict", + "DataConnectionError", + "DataConnectionErrorTypedDict", + "DataConnectionStatus", + "DataStatus", + "DataStatusTypedDict", + "DataType", + "DataTypes", + "DatasetStatus", + "ErrorStatus", + "ErrorValidation", + "ErrorValidationItem", + "ErrorValidationItemTypedDict", + "ErrorValidationTypedDict", + "HalRef", + "HalRefTypedDict", + "ItemRef", + "ItemRefTypedDict", + "ItemReference", + "ItemReferenceTypedDict", + "Items", + "ItemsTypedDict", + "Journal", + "JournalEntry", + "JournalEntryRecordRef", + "JournalEntryRecordRefDataType", + "JournalEntryRecordRefTypedDict", + "JournalEntryTypedDict", + "JournalLine", + "JournalLineDataType", + "JournalLineTracking", + "JournalLineTrackingTypedDict", + "JournalLineTypedDict", + "JournalPrototype", + "JournalPrototypeTypedDict", + "JournalRef", + "JournalRefTypedDict", + "JournalStatus", + "JournalTypedDict", + "Journals", + "JournalsTypedDict", + "Links", + "LinksTypedDict", + "Metadata", + "MetadataTypedDict", + "PaymentAllocationPayment", + "PaymentAllocationPaymentTypedDict", + "PaymentMethod", + "PaymentMethodRef", + "PaymentMethodRefTypedDict", + "PaymentMethodStatus", + "PaymentMethodType", + "PaymentMethodTypedDict", + "PaymentMethods", + "PaymentMethodsTypedDict", + "PhoneNumber", + "PhoneNumberType", + "PhoneNumberTypedDict", + "PropertieStatus", + "PullOperation", + "PullOperationTypedDict", + "PullOperations", + "PullOperationsTypedDict", + "PurchaseOrderReference", + "PurchaseOrderReferenceTypedDict", + "PushChangeType", + "PushFieldValidation", + "PushFieldValidationTypedDict", + "PushOperation", + "PushOperationChange", + "PushOperationChangeTypedDict", + "PushOperationRef", + "PushOperationRefTypedDict", + "PushOperationStatus", + "PushOperationTypedDict", + "PushOperations", + "PushOperationsTypedDict", + "PushOption", + "PushOptionChoice", + "PushOptionChoiceTypedDict", + "PushOptionProperty", + "PushOptionPropertyTypedDict", + "PushOptionType", + "PushOptionTypedDict", + "PushValidationInfo", + "PushValidationInfoTypedDict", + "RecordLineReference", + "RecordLineReferenceTypedDict", + "RecordReference", + "RecordReferenceTypedDict", + "SchemaDataType", + "Security", + "SecurityTypedDict", + "SourceType", + "Status", + "SupplementalData", + "SupplementalDataTypedDict", + "Supplier", + "SupplierRef", + "SupplierRefTypedDict", + "SupplierStatus", + "SupplierTypedDict", + "Suppliers", + "SuppliersTypedDict", + "Tags", + "TagsTypedDict", + "TaxRate", + "TaxRateComponent", + "TaxRateComponentTypedDict", + "TaxRateRef", + "TaxRateRefTypedDict", + "TaxRateStatus", + "TaxRateTypedDict", + "TaxRates", + "TaxRatesTypedDict", + "Tracking", + "TrackingCategories", + "TrackingCategoriesTypedDict", + "TrackingCategory", + "TrackingCategoryRef", + "TrackingCategoryRefTypedDict", + "TrackingCategoryTree", + "TrackingCategoryTreeTypedDict", + "TrackingCategoryTypedDict", + "TrackingRecordRef", + "TrackingRecordRefDataType", + "TrackingRecordRefTypedDict", + "TrackingTypedDict", + "Type", + "UpdateBillCreditNoteResponse", + "UpdateBillCreditNoteResponseAccountingBillCreditNote", + "UpdateBillCreditNoteResponseAccountingBillCreditNoteTypedDict", + "UpdateBillCreditNoteResponseRecordReference", + "UpdateBillCreditNoteResponseRecordReferenceTypedDict", + "UpdateBillCreditNoteResponseTypedDict", + "UpdateBillResponse", + "UpdateBillResponseAccountingBill", + "UpdateBillResponseAccountingBillTypedDict", + "UpdateBillResponseAccountingPaymentAllocation", + "UpdateBillResponseAccountingPaymentAllocationTypedDict", + "UpdateBillResponseAllocation", + "UpdateBillResponseAllocationTypedDict", + "UpdateBillResponsePurchaseOrderReference", + "UpdateBillResponsePurchaseOrderReferenceTypedDict", + "UpdateBillResponseTypedDict", + "UpdateBillResponseWithholdingTax", + "UpdateBillResponseWithholdingTaxTypedDict", + "UpdateSupplierResponse", + "UpdateSupplierResponseAccountingSupplier", + "UpdateSupplierResponseAccountingSupplierTypedDict", + "UpdateSupplierResponseTypedDict", + "ValidDataTypeLinks", + "ValidDataTypeLinksTypedDict", + "ValidDatatypeLinkItems", + "ValidDatatypeLinkItemsTypedDict", + "Validation", + "ValidationItem", + "ValidationItemTypedDict", + "ValidationTypedDict", + "WebLink", + "WebLinkTypedDict", + "WithholdingTax", + "WithholdingTaxItems", + "WithholdingTaxItemsTypedDict", + "WithholdingTaxTypedDict", + "Zero", + "ZeroDataType", + "ZeroTypedDict", +] diff --git a/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/account.py b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/account.py new file mode 100644 index 000000000..bf50ca60f --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/account.py @@ -0,0 +1,403 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .accountstatus import AccountStatus +from .accounttype import AccountType +from .metadata import Metadata, MetadataTypedDict +from .supplementaldata import SupplementalData, SupplementalDataTypedDict +from codat_sync_for_payables_version_1.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from codat_sync_for_payables_version_1.utils import serialize_decimal, validate_decimal +from decimal import Decimal +import pydantic +from pydantic import model_serializer +from pydantic.functional_serializers import PlainSerializer +from pydantic.functional_validators import BeforeValidator +from typing import List, Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class AccountValidDataTypeLinksTypedDict(TypedDict): + r"""When querying Codat's data model, some data types return `validDatatypeLinks` metadata in the JSON response. This indicates where that object can be used as a reference—a _valid link_—when creating or updating other data. + + For example, `validDatatypeLinks` might indicate the following references: + + - Which tax rates are valid to use on the line item of a bill. + - Which items can be used when creating an invoice. + + You can use `validDatatypeLinks` to present your SMB customers with only valid choices when selecting objects from a list, for example. + + ## `validDatatypeLinks` example + + The following example uses the `Accounting.Accounts` data type. It shows that, on the linked integration, this account is valid as the account on a payment or bill payment; and as the account referenced on the line item of a direct income or direct cost. Because there is no valid link to Invoices or Bills, using this account on those data types will result in an error. + + ```json validDatatypeLinks for an account + { + \"id\": \"bd9e85e0-0478-433d-ae9f-0b3c4f04bfe4\", + \"nominalCode\": \"090\", + \"name\": \"Business Bank Account\", + #... + \"validDatatypeLinks\": [ + { + \"property\": \"Id\", + \"links\": [ + \"Payment.AccountRef.Id\", + \"BillPayment.AccountRef.Id\", + \"DirectIncome.LineItems.AccountRef.Id\", + \"DirectCost.LineItems.AccountRef.Id\" + ] + } + ] + } + ``` + + + + ## Support for `validDatatypeLinks` + + Codat currently supports `validDatatypeLinks` for some data types on our Xero, QuickBooks Online, QuickBooks Desktop, Exact (NL), and Sage Business Cloud integrations. + + If you'd like us to extend support to more data types or integrations, suggest or vote for this on our Product Roadmap. + """ + + links: NotRequired[Nullable[List[str]]] + r"""Supported `dataTypes` that the record can be linked to.""" + property: NotRequired[Nullable[str]] + r"""The property from the account that can be linked.""" + + +class AccountValidDataTypeLinks(BaseModel): + r"""When querying Codat's data model, some data types return `validDatatypeLinks` metadata in the JSON response. This indicates where that object can be used as a reference—a _valid link_—when creating or updating other data. + + For example, `validDatatypeLinks` might indicate the following references: + + - Which tax rates are valid to use on the line item of a bill. + - Which items can be used when creating an invoice. + + You can use `validDatatypeLinks` to present your SMB customers with only valid choices when selecting objects from a list, for example. + + ## `validDatatypeLinks` example + + The following example uses the `Accounting.Accounts` data type. It shows that, on the linked integration, this account is valid as the account on a payment or bill payment; and as the account referenced on the line item of a direct income or direct cost. Because there is no valid link to Invoices or Bills, using this account on those data types will result in an error. + + ```json validDatatypeLinks for an account + { + \"id\": \"bd9e85e0-0478-433d-ae9f-0b3c4f04bfe4\", + \"nominalCode\": \"090\", + \"name\": \"Business Bank Account\", + #... + \"validDatatypeLinks\": [ + { + \"property\": \"Id\", + \"links\": [ + \"Payment.AccountRef.Id\", + \"BillPayment.AccountRef.Id\", + \"DirectIncome.LineItems.AccountRef.Id\", + \"DirectCost.LineItems.AccountRef.Id\" + ] + } + ] + } + ``` + + + + ## Support for `validDatatypeLinks` + + Codat currently supports `validDatatypeLinks` for some data types on our Xero, QuickBooks Online, QuickBooks Desktop, Exact (NL), and Sage Business Cloud integrations. + + If you'd like us to extend support to more data types or integrations, suggest or vote for this on our Product Roadmap. + """ + + links: OptionalNullable[List[str]] = UNSET + r"""Supported `dataTypes` that the record can be linked to.""" + + property: OptionalNullable[str] = UNSET + r"""The property from the account that can be linked.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = ["links", "property"] + nullable_fields = ["links", "property"] + null_default_fields = [] + + serialized = handler(self) + + m = {} + + for n, f in self.model_fields.items(): + k = f.alias or n + val = serialized.get(k) + serialized.pop(k, None) + + optional_nullable = k in optional_fields and k in nullable_fields + is_set = ( + self.__pydantic_fields_set__.intersection({n}) + or k in null_default_fields + ) # pylint: disable=no-member + + if val is not None and val != UNSET_SENTINEL: + m[k] = val + elif val != UNSET_SENTINEL and ( + not k in optional_fields or (optional_nullable and is_set) + ): + m[k] = val + + return m + + +class AccountTypedDict(TypedDict): + r"""> **Language tip:** Accounts are also referred to as **chart of accounts**, **nominal accounts**, and **general ledger**. + + View the coverage for accounts in the Data coverage explorer. + + ## Overview + + Accounts are the categories a business uses to record accounting transactions. From the Accounts endpoints, you can retrieve a list of all accounts for a specified company. + + The categories for an account include: + * Asset + * Expense + * Income + * Liability + * Equity. + + The same account may have a different category based on the integration it is used in. For example, a current account (known as checking in the US) should be categorized as `Asset.Current` for Xero, and `Asset.Bank.Checking` for QuickBooks Online. + + At the same time, each integration may have its own requirements to the categories. For example, a Paypal account in Xero is of the `Asset.Bank` category and therefore requires additional properties to be provided. + + To determine the list of allowed categories for a specific integration, you can: + - Follow our [Create, update, delete data](https://docs.codat.io/using-the-api/push) guide and use the [Get create account model](https://docs.codat.io/sync-for-payables-api#/operations/get-create-chartOfAccounts-model). + - Refer to the integration's own documentation. + + > **Accounts with no category** + > + > If an account is pulled from the chart of accounts and its nominal code does not lie within the category layout for the company's accounts, then the **type** is `Unknown`. The **fullyQualifiedCategory** and **fullyQualifiedName** fields return `null`. + > + > This approach gives a true representation of the company's accounts whilst preventing distorting financials such as a company's profit and loss and balance sheet reports. + """ + + currency: NotRequired[str] + r"""The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + + ## Unknown currencies + + In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + + There are only a very small number of edge cases where this currency code is returned by the Codat system. + """ + current_balance: NotRequired[Nullable[Decimal]] + r"""Current balance in the account.""" + description: NotRequired[Nullable[str]] + r"""Description for the account.""" + fully_qualified_category: NotRequired[Nullable[str]] + r"""Full category of the account. + + For example, `Liability.Current` or `Income.Revenue`. To determine a list of possible categories for each integration, see our examples, follow our [Create, update, delete data](https://docs.codat.io/using-the-api/push) guide, or refer to the integration's own documentation. + """ + fully_qualified_name: NotRequired[Nullable[str]] + r"""Full name of the account, for example: + - `Cash On Hand` + - `Rents Held In Trust` + - `Fixed Asset` + """ + id: NotRequired[str] + r"""Identifier for the account, unique for the company.""" + is_bank_account: NotRequired[bool] + r"""Confirms whether the account is a bank account or not.""" + metadata: NotRequired[MetadataTypedDict] + modified_date: NotRequired[str] + name: NotRequired[Nullable[str]] + r"""Name of the account.""" + nominal_code: NotRequired[Nullable[str]] + r"""Reference given to each nominal account for a business. It ensures money is allocated to the correct account. This code isn't a unique identifier in the Codat system.""" + source_modified_date: NotRequired[str] + status: NotRequired[AccountStatus] + r"""Status of the account""" + supplemental_data: NotRequired[SupplementalDataTypedDict] + r"""Supplemental data is additional data you can include in our standard data types. + + It is referenced as a configured dynamic key value pair that is unique to the accounting software. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. + """ + type: NotRequired[AccountType] + r"""Type of account""" + valid_datatype_links: NotRequired[ + Nullable[List[AccountValidDataTypeLinksTypedDict]] + ] + r"""The validDatatypeLinks can be used to determine whether an account can be correctly mapped to another object; for example, accounts with a `type` of `income` might only support being used on an Invoice and Direct Income. For more information, see [Valid Data Type Links](/sync-for-payables-api#/schemas/ValidDataTypeLinks).""" + + +class Account(BaseModel): + r"""> **Language tip:** Accounts are also referred to as **chart of accounts**, **nominal accounts**, and **general ledger**. + + View the coverage for accounts in the Data coverage explorer. + + ## Overview + + Accounts are the categories a business uses to record accounting transactions. From the Accounts endpoints, you can retrieve a list of all accounts for a specified company. + + The categories for an account include: + * Asset + * Expense + * Income + * Liability + * Equity. + + The same account may have a different category based on the integration it is used in. For example, a current account (known as checking in the US) should be categorized as `Asset.Current` for Xero, and `Asset.Bank.Checking` for QuickBooks Online. + + At the same time, each integration may have its own requirements to the categories. For example, a Paypal account in Xero is of the `Asset.Bank` category and therefore requires additional properties to be provided. + + To determine the list of allowed categories for a specific integration, you can: + - Follow our [Create, update, delete data](https://docs.codat.io/using-the-api/push) guide and use the [Get create account model](https://docs.codat.io/sync-for-payables-api#/operations/get-create-chartOfAccounts-model). + - Refer to the integration's own documentation. + + > **Accounts with no category** + > + > If an account is pulled from the chart of accounts and its nominal code does not lie within the category layout for the company's accounts, then the **type** is `Unknown`. The **fullyQualifiedCategory** and **fullyQualifiedName** fields return `null`. + > + > This approach gives a true representation of the company's accounts whilst preventing distorting financials such as a company's profit and loss and balance sheet reports. + """ + + currency: Optional[str] = None + r"""The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + + ## Unknown currencies + + In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + + There are only a very small number of edge cases where this currency code is returned by the Codat system. + """ + + current_balance: Annotated[ + Annotated[ + OptionalNullable[Decimal], + BeforeValidator(validate_decimal), + PlainSerializer(serialize_decimal(False)), + ], + pydantic.Field(alias="currentBalance"), + ] = UNSET + r"""Current balance in the account.""" + + description: OptionalNullable[str] = UNSET + r"""Description for the account.""" + + fully_qualified_category: Annotated[ + OptionalNullable[str], pydantic.Field(alias="fullyQualifiedCategory") + ] = UNSET + r"""Full category of the account. + + For example, `Liability.Current` or `Income.Revenue`. To determine a list of possible categories for each integration, see our examples, follow our [Create, update, delete data](https://docs.codat.io/using-the-api/push) guide, or refer to the integration's own documentation. + """ + + fully_qualified_name: Annotated[ + OptionalNullable[str], pydantic.Field(alias="fullyQualifiedName") + ] = UNSET + r"""Full name of the account, for example: + - `Cash On Hand` + - `Rents Held In Trust` + - `Fixed Asset` + """ + + id: Optional[str] = None + r"""Identifier for the account, unique for the company.""" + + is_bank_account: Annotated[ + Optional[bool], pydantic.Field(alias="isBankAccount") + ] = None + r"""Confirms whether the account is a bank account or not.""" + + metadata: Optional[Metadata] = None + + modified_date: Annotated[Optional[str], pydantic.Field(alias="modifiedDate")] = None + + name: OptionalNullable[str] = UNSET + r"""Name of the account.""" + + nominal_code: Annotated[ + OptionalNullable[str], pydantic.Field(alias="nominalCode") + ] = UNSET + r"""Reference given to each nominal account for a business. It ensures money is allocated to the correct account. This code isn't a unique identifier in the Codat system.""" + + source_modified_date: Annotated[ + Optional[str], pydantic.Field(alias="sourceModifiedDate") + ] = None + + status: Optional[AccountStatus] = None + r"""Status of the account""" + + supplemental_data: Annotated[ + Optional[SupplementalData], pydantic.Field(alias="supplementalData") + ] = None + r"""Supplemental data is additional data you can include in our standard data types. + + It is referenced as a configured dynamic key value pair that is unique to the accounting software. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. + """ + + type: Optional[AccountType] = None + r"""Type of account""" + + valid_datatype_links: Annotated[ + OptionalNullable[List[AccountValidDataTypeLinks]], + pydantic.Field(alias="validDatatypeLinks"), + ] = UNSET + r"""The validDatatypeLinks can be used to determine whether an account can be correctly mapped to another object; for example, accounts with a `type` of `income` might only support being used on an Invoice and Direct Income. For more information, see [Valid Data Type Links](/sync-for-payables-api#/schemas/ValidDataTypeLinks).""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = [ + "currency", + "currentBalance", + "description", + "fullyQualifiedCategory", + "fullyQualifiedName", + "id", + "isBankAccount", + "metadata", + "modifiedDate", + "name", + "nominalCode", + "sourceModifiedDate", + "status", + "supplementalData", + "type", + "validDatatypeLinks", + ] + nullable_fields = [ + "currentBalance", + "description", + "fullyQualifiedCategory", + "fullyQualifiedName", + "name", + "nominalCode", + "validDatatypeLinks", + ] + null_default_fields = [] + + serialized = handler(self) + + m = {} + + for n, f in self.model_fields.items(): + k = f.alias or n + val = serialized.get(k) + serialized.pop(k, None) + + optional_nullable = k in optional_fields and k in nullable_fields + is_set = ( + self.__pydantic_fields_set__.intersection({n}) + or k in null_default_fields + ) # pylint: disable=no-member + + if val is not None and val != UNSET_SENTINEL: + m[k] = val + elif val != UNSET_SENTINEL and ( + not k in optional_fields or (optional_nullable and is_set) + ): + m[k] = val + + return m diff --git a/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/accountingaddresstype.py b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/accountingaddresstype.py new file mode 100644 index 000000000..4d5a97871 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/accountingaddresstype.py @@ -0,0 +1,12 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from enum import Enum + + +class AccountingAddressType(str, Enum): + r"""The type of the address""" + + UNKNOWN = "Unknown" + BILLING = "Billing" + DELIVERY = "Delivery" diff --git a/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/accountprototype.py b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/accountprototype.py new file mode 100644 index 000000000..5aa5ba1f3 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/accountprototype.py @@ -0,0 +1,320 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .accountstatus import AccountStatus +from .accounttype import AccountType +from .supplementaldata import SupplementalData, SupplementalDataTypedDict +from codat_sync_for_payables_version_1.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from codat_sync_for_payables_version_1.utils import serialize_decimal, validate_decimal +from decimal import Decimal +import pydantic +from pydantic import model_serializer +from pydantic.functional_serializers import PlainSerializer +from pydantic.functional_validators import BeforeValidator +from typing import List, Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class ValidDataTypeLinksTypedDict(TypedDict): + r"""When querying Codat's data model, some data types return `validDatatypeLinks` metadata in the JSON response. This indicates where that object can be used as a reference—a _valid link_—when creating or updating other data. + + For example, `validDatatypeLinks` might indicate the following references: + + - Which tax rates are valid to use on the line item of a bill. + - Which items can be used when creating an invoice. + + You can use `validDatatypeLinks` to present your SMB customers with only valid choices when selecting objects from a list, for example. + + ## `validDatatypeLinks` example + + The following example uses the `Accounting.Accounts` data type. It shows that, on the linked integration, this account is valid as the account on a payment or bill payment; and as the account referenced on the line item of a direct income or direct cost. Because there is no valid link to Invoices or Bills, using this account on those data types will result in an error. + + ```json validDatatypeLinks for an account + { + \"id\": \"bd9e85e0-0478-433d-ae9f-0b3c4f04bfe4\", + \"nominalCode\": \"090\", + \"name\": \"Business Bank Account\", + #... + \"validDatatypeLinks\": [ + { + \"property\": \"Id\", + \"links\": [ + \"Payment.AccountRef.Id\", + \"BillPayment.AccountRef.Id\", + \"DirectIncome.LineItems.AccountRef.Id\", + \"DirectCost.LineItems.AccountRef.Id\" + ] + } + ] + } + ``` + + + + ## Support for `validDatatypeLinks` + + Codat currently supports `validDatatypeLinks` for some data types on our Xero, QuickBooks Online, QuickBooks Desktop, Exact (NL), and Sage Business Cloud integrations. + + If you'd like us to extend support to more data types or integrations, suggest or vote for this on our Product Roadmap. + """ + + links: NotRequired[Nullable[List[str]]] + r"""Supported `dataTypes` that the record can be linked to.""" + property: NotRequired[Nullable[str]] + r"""The property from the account that can be linked.""" + + +class ValidDataTypeLinks(BaseModel): + r"""When querying Codat's data model, some data types return `validDatatypeLinks` metadata in the JSON response. This indicates where that object can be used as a reference—a _valid link_—when creating or updating other data. + + For example, `validDatatypeLinks` might indicate the following references: + + - Which tax rates are valid to use on the line item of a bill. + - Which items can be used when creating an invoice. + + You can use `validDatatypeLinks` to present your SMB customers with only valid choices when selecting objects from a list, for example. + + ## `validDatatypeLinks` example + + The following example uses the `Accounting.Accounts` data type. It shows that, on the linked integration, this account is valid as the account on a payment or bill payment; and as the account referenced on the line item of a direct income or direct cost. Because there is no valid link to Invoices or Bills, using this account on those data types will result in an error. + + ```json validDatatypeLinks for an account + { + \"id\": \"bd9e85e0-0478-433d-ae9f-0b3c4f04bfe4\", + \"nominalCode\": \"090\", + \"name\": \"Business Bank Account\", + #... + \"validDatatypeLinks\": [ + { + \"property\": \"Id\", + \"links\": [ + \"Payment.AccountRef.Id\", + \"BillPayment.AccountRef.Id\", + \"DirectIncome.LineItems.AccountRef.Id\", + \"DirectCost.LineItems.AccountRef.Id\" + ] + } + ] + } + ``` + + + + ## Support for `validDatatypeLinks` + + Codat currently supports `validDatatypeLinks` for some data types on our Xero, QuickBooks Online, QuickBooks Desktop, Exact (NL), and Sage Business Cloud integrations. + + If you'd like us to extend support to more data types or integrations, suggest or vote for this on our Product Roadmap. + """ + + links: OptionalNullable[List[str]] = UNSET + r"""Supported `dataTypes` that the record can be linked to.""" + + property: OptionalNullable[str] = UNSET + r"""The property from the account that can be linked.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = ["links", "property"] + nullable_fields = ["links", "property"] + null_default_fields = [] + + serialized = handler(self) + + m = {} + + for n, f in self.model_fields.items(): + k = f.alias or n + val = serialized.get(k) + serialized.pop(k, None) + + optional_nullable = k in optional_fields and k in nullable_fields + is_set = ( + self.__pydantic_fields_set__.intersection({n}) + or k in null_default_fields + ) # pylint: disable=no-member + + if val is not None and val != UNSET_SENTINEL: + m[k] = val + elif val != UNSET_SENTINEL and ( + not k in optional_fields or (optional_nullable and is_set) + ): + m[k] = val + + return m + + +class AccountPrototypeTypedDict(TypedDict): + currency: NotRequired[str] + r"""The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + + ## Unknown currencies + + In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + + There are only a very small number of edge cases where this currency code is returned by the Codat system. + """ + current_balance: NotRequired[Nullable[Decimal]] + r"""Current balance in the account.""" + description: NotRequired[Nullable[str]] + r"""Description for the account.""" + fully_qualified_category: NotRequired[Nullable[str]] + r"""Full category of the account. + + For example, `Liability.Current` or `Income.Revenue`. To determine a list of possible categories for each integration, see our examples, follow our [Create, update, delete data](https://docs.codat.io/using-the-api/push) guide, or refer to the integration's own documentation. + """ + fully_qualified_name: NotRequired[Nullable[str]] + r"""Full name of the account, for example: + - `Cash On Hand` + - `Rents Held In Trust` + - `Fixed Asset` + """ + is_bank_account: NotRequired[bool] + r"""Confirms whether the account is a bank account or not.""" + name: NotRequired[Nullable[str]] + r"""Name of the account.""" + nominal_code: NotRequired[Nullable[str]] + r"""Reference given to each nominal account for a business. It ensures money is allocated to the correct account. This code isn't a unique identifier in the Codat system.""" + status: NotRequired[AccountStatus] + r"""Status of the account""" + supplemental_data: NotRequired[SupplementalDataTypedDict] + r"""Supplemental data is additional data you can include in our standard data types. + + It is referenced as a configured dynamic key value pair that is unique to the accounting software. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. + """ + type: NotRequired[AccountType] + r"""Type of account""" + valid_datatype_links: NotRequired[Nullable[List[ValidDataTypeLinksTypedDict]]] + r"""The validDatatypeLinks can be used to determine whether an account can be correctly mapped to another object; for example, accounts with a `type` of `income` might only support being used on an Invoice and Direct Income. For more information, see [Valid Data Type Links](/sync-for-payables-api#/schemas/ValidDataTypeLinks).""" + + +class AccountPrototype(BaseModel): + currency: Optional[str] = None + r"""The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + + ## Unknown currencies + + In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + + There are only a very small number of edge cases where this currency code is returned by the Codat system. + """ + + current_balance: Annotated[ + Annotated[ + OptionalNullable[Decimal], + BeforeValidator(validate_decimal), + PlainSerializer(serialize_decimal(False)), + ], + pydantic.Field(alias="currentBalance"), + ] = UNSET + r"""Current balance in the account.""" + + description: OptionalNullable[str] = UNSET + r"""Description for the account.""" + + fully_qualified_category: Annotated[ + OptionalNullable[str], pydantic.Field(alias="fullyQualifiedCategory") + ] = UNSET + r"""Full category of the account. + + For example, `Liability.Current` or `Income.Revenue`. To determine a list of possible categories for each integration, see our examples, follow our [Create, update, delete data](https://docs.codat.io/using-the-api/push) guide, or refer to the integration's own documentation. + """ + + fully_qualified_name: Annotated[ + OptionalNullable[str], pydantic.Field(alias="fullyQualifiedName") + ] = UNSET + r"""Full name of the account, for example: + - `Cash On Hand` + - `Rents Held In Trust` + - `Fixed Asset` + """ + + is_bank_account: Annotated[ + Optional[bool], pydantic.Field(alias="isBankAccount") + ] = None + r"""Confirms whether the account is a bank account or not.""" + + name: OptionalNullable[str] = UNSET + r"""Name of the account.""" + + nominal_code: Annotated[ + OptionalNullable[str], pydantic.Field(alias="nominalCode") + ] = UNSET + r"""Reference given to each nominal account for a business. It ensures money is allocated to the correct account. This code isn't a unique identifier in the Codat system.""" + + status: Optional[AccountStatus] = None + r"""Status of the account""" + + supplemental_data: Annotated[ + Optional[SupplementalData], pydantic.Field(alias="supplementalData") + ] = None + r"""Supplemental data is additional data you can include in our standard data types. + + It is referenced as a configured dynamic key value pair that is unique to the accounting software. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. + """ + + type: Optional[AccountType] = None + r"""Type of account""" + + valid_datatype_links: Annotated[ + OptionalNullable[List[ValidDataTypeLinks]], + pydantic.Field(alias="validDatatypeLinks"), + ] = UNSET + r"""The validDatatypeLinks can be used to determine whether an account can be correctly mapped to another object; for example, accounts with a `type` of `income` might only support being used on an Invoice and Direct Income. For more information, see [Valid Data Type Links](/sync-for-payables-api#/schemas/ValidDataTypeLinks).""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = [ + "currency", + "currentBalance", + "description", + "fullyQualifiedCategory", + "fullyQualifiedName", + "isBankAccount", + "name", + "nominalCode", + "status", + "supplementalData", + "type", + "validDatatypeLinks", + ] + nullable_fields = [ + "currentBalance", + "description", + "fullyQualifiedCategory", + "fullyQualifiedName", + "name", + "nominalCode", + "validDatatypeLinks", + ] + null_default_fields = [] + + serialized = handler(self) + + m = {} + + for n, f in self.model_fields.items(): + k = f.alias or n + val = serialized.get(k) + serialized.pop(k, None) + + optional_nullable = k in optional_fields and k in nullable_fields + is_set = ( + self.__pydantic_fields_set__.intersection({n}) + or k in null_default_fields + ) # pylint: disable=no-member + + if val is not None and val != UNSET_SENTINEL: + m[k] = val + elif val != UNSET_SENTINEL and ( + not k in optional_fields or (optional_nullable and is_set) + ): + m[k] = val + + return m diff --git a/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/accountref.py b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/accountref.py new file mode 100644 index 000000000..23a4cf52b --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/accountref.py @@ -0,0 +1,25 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from codat_sync_for_payables_version_1.types import BaseModel +from typing import Optional +from typing_extensions import NotRequired, TypedDict + + +class AccountRefTypedDict(TypedDict): + r"""Data types that reference an account, for example bill and invoice line items, use an accountRef that includes the ID and name of the linked account.""" + + id: NotRequired[str] + r"""'id' from the Accounts data type.""" + name: NotRequired[str] + r"""'name' from the Accounts data type.""" + + +class AccountRef(BaseModel): + r"""Data types that reference an account, for example bill and invoice line items, use an accountRef that includes the ID and name of the linked account.""" + + id: Optional[str] = None + r"""'id' from the Accounts data type.""" + + name: Optional[str] = None + r"""'name' from the Accounts data type.""" diff --git a/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/accounts.py b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/accounts.py new file mode 100644 index 000000000..cdf610a07 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/accounts.py @@ -0,0 +1,35 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .account import Account, AccountTypedDict +from .links import Links, LinksTypedDict +from codat_sync_for_payables_version_1.types import BaseModel +import pydantic +from typing import List, Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class AccountsTypedDict(TypedDict): + links: LinksTypedDict + page_number: int + r"""Current page number.""" + page_size: int + r"""Number of items to return in results array.""" + total_results: int + r"""Total number of items.""" + results: NotRequired[List[AccountTypedDict]] + + +class Accounts(BaseModel): + links: Annotated[Links, pydantic.Field(alias="_links")] + + page_number: Annotated[int, pydantic.Field(alias="pageNumber")] + r"""Current page number.""" + + page_size: Annotated[int, pydantic.Field(alias="pageSize")] + r"""Number of items to return in results array.""" + + total_results: Annotated[int, pydantic.Field(alias="totalResults")] + r"""Total number of items.""" + + results: Optional[List[Account]] = None diff --git a/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/accountstatus.py b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/accountstatus.py new file mode 100644 index 000000000..2ae331abc --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/accountstatus.py @@ -0,0 +1,13 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from enum import Enum + + +class AccountStatus(str, Enum): + r"""Status of the account""" + + UNKNOWN = "Unknown" + ACTIVE = "Active" + ARCHIVED = "Archived" + PENDING = "Pending" diff --git a/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/accounttype.py b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/accounttype.py new file mode 100644 index 000000000..b893d55ba --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/accounttype.py @@ -0,0 +1,15 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from enum import Enum + + +class AccountType(str, Enum): + r"""Type of account""" + + UNKNOWN = "Unknown" + ASSET = "Asset" + EXPENSE = "Expense" + INCOME = "Income" + LIABILITY = "Liability" + EQUITY = "Equity" diff --git a/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/address.py b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/address.py new file mode 100644 index 000000000..aaab73cd9 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/address.py @@ -0,0 +1,86 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .accountingaddresstype import AccountingAddressType +from codat_sync_for_payables_version_1.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +import pydantic +from pydantic import model_serializer +from typing_extensions import Annotated, NotRequired, TypedDict + + +class AddressTypedDict(TypedDict): + type: AccountingAddressType + r"""The type of the address""" + city: NotRequired[Nullable[str]] + r"""City of the customer address.""" + country: NotRequired[Nullable[str]] + r"""Country of the customer address.""" + line1: NotRequired[Nullable[str]] + r"""Line 1 of the customer address.""" + line2: NotRequired[Nullable[str]] + r"""Line 2 of the customer address.""" + postal_code: NotRequired[Nullable[str]] + r"""Postal code or zip code.""" + region: NotRequired[Nullable[str]] + r"""Region of the customer address.""" + + +class Address(BaseModel): + type: AccountingAddressType + r"""The type of the address""" + + city: OptionalNullable[str] = UNSET + r"""City of the customer address.""" + + country: OptionalNullable[str] = UNSET + r"""Country of the customer address.""" + + line1: OptionalNullable[str] = UNSET + r"""Line 1 of the customer address.""" + + line2: OptionalNullable[str] = UNSET + r"""Line 2 of the customer address.""" + + postal_code: Annotated[ + OptionalNullable[str], pydantic.Field(alias="postalCode") + ] = UNSET + r"""Postal code or zip code.""" + + region: OptionalNullable[str] = UNSET + r"""Region of the customer address.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = ["city", "country", "line1", "line2", "postalCode", "region"] + nullable_fields = ["city", "country", "line1", "line2", "postalCode", "region"] + null_default_fields = [] + + serialized = handler(self) + + m = {} + + for n, f in self.model_fields.items(): + k = f.alias or n + val = serialized.get(k) + serialized.pop(k, None) + + optional_nullable = k in optional_fields and k in nullable_fields + is_set = ( + self.__pydantic_fields_set__.intersection({n}) + or k in null_default_fields + ) # pylint: disable=no-member + + if val is not None and val != UNSET_SENTINEL: + m[k] = val + elif val != UNSET_SENTINEL and ( + not k in optional_fields or (optional_nullable and is_set) + ): + m[k] = val + + return m diff --git a/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/attachment.py b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/attachment.py new file mode 100644 index 000000000..23e20e61e --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/attachment.py @@ -0,0 +1,188 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from codat_sync_for_payables_version_1.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +import pydantic +from pydantic import model_serializer +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class AttachmentTypedDict(TypedDict): + r"""The Codat API supports pulling and pushing of file attachments for invoices, bills, direct costs, and direct incomes. + + > **Retrieving attachments** + > + > If a company is authorized, you can query the Codat API to read, download, and upload attachments without requiring a fresh sync of data. + + Unlike other data types, Codat doesn't support [sync settings](https://docs.codat.io/knowledge-base/advanced-sync-settings) for attachments. + + Note that different integrations have different requirements to file size and extension of attachments. + + | Integration | File size | File extension | + |-------------------|-----------|--------------------------------------------------------------------------------------------------------------------------------------------------------------| + | Xero | 4 MB | 7Z, BMP, CSV, DOC, DOCX, EML, GIF, JPEG, JPG, KEYNOTE, MSG, NUMBERS, ODF, ODS, ODT, PAGES, PDF, PNG, PPT, PPTX, RAR, RTF, TIF, TIFF, TXT, XLS, XLSX, ZIP | + | QuickBooks Online | 100 MB | AI, CSV, DOC, DOCX, EPS, GIF, JPEG, JPG, ODS, PAGES, PDF, PNG, RTF, TIF, TXT, XLS, XLSX, XML | + | NetSuite | 100 MB | BMP, CSV, XLS, XLSX, JSON, PDF, PJPG, PJPEG, PNG, TXT, SVG, TIF, TIFF, DOC, DOCX, ZIP | + | Dynamics 365 Business Central | 350 MB | Dynamics do not explicitly outline which file types are supported but they do state here that \"You can attach any type of file, such as text, image, or video files\". | + + View the coverage for each integration in the Data coverage explorer. + + """ + + content_type: NotRequired[Nullable[str]] + r"""File type of the attachment. This is represented by appending the file type to the [IETF standard file naming requirements](https://tools.ietf.org/html/rfc6838). For example, for a jpeg file the output is **image/jpeg**. + + Supported file types vary per platform. + """ + date_created: 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: + + ``` + 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. + """ + file_size: NotRequired[Nullable[int]] + r"""File size in bytes. For example, if this reads **46153**, then the file size is 46kb.""" + id: NotRequired[str] + r"""Identifier for the attachment, unique for the company in the accounting software.""" + include_when_sent: NotRequired[bool] + r"""If `true`, then the attachment is included with the associated invoice, bill or direct costs when it is printed, emailed, or sent to a customer, if the underlying accounting software allows this.""" + modified_date: NotRequired[str] + name: NotRequired[Nullable[str]] + r"""Name of the attachment file.""" + source_modified_date: NotRequired[str] + + +class Attachment(BaseModel): + r"""The Codat API supports pulling and pushing of file attachments for invoices, bills, direct costs, and direct incomes. + + > **Retrieving attachments** + > + > If a company is authorized, you can query the Codat API to read, download, and upload attachments without requiring a fresh sync of data. + + Unlike other data types, Codat doesn't support [sync settings](https://docs.codat.io/knowledge-base/advanced-sync-settings) for attachments. + + Note that different integrations have different requirements to file size and extension of attachments. + + | Integration | File size | File extension | + |-------------------|-----------|--------------------------------------------------------------------------------------------------------------------------------------------------------------| + | Xero | 4 MB | 7Z, BMP, CSV, DOC, DOCX, EML, GIF, JPEG, JPG, KEYNOTE, MSG, NUMBERS, ODF, ODS, ODT, PAGES, PDF, PNG, PPT, PPTX, RAR, RTF, TIF, TIFF, TXT, XLS, XLSX, ZIP | + | QuickBooks Online | 100 MB | AI, CSV, DOC, DOCX, EPS, GIF, JPEG, JPG, ODS, PAGES, PDF, PNG, RTF, TIF, TXT, XLS, XLSX, XML | + | NetSuite | 100 MB | BMP, CSV, XLS, XLSX, JSON, PDF, PJPG, PJPEG, PNG, TXT, SVG, TIF, TIFF, DOC, DOCX, ZIP | + | Dynamics 365 Business Central | 350 MB | Dynamics do not explicitly outline which file types are supported but they do state here that \"You can attach any type of file, such as text, image, or video files\". | + + View the coverage for each integration in the Data coverage explorer. + + """ + + content_type: Annotated[ + OptionalNullable[str], pydantic.Field(alias="contentType") + ] = UNSET + r"""File type of the attachment. This is represented by appending the file type to the [IETF standard file naming requirements](https://tools.ietf.org/html/rfc6838). For example, for a jpeg file the output is **image/jpeg**. + + Supported file types vary per platform. + """ + + date_created: Annotated[Optional[str], pydantic.Field(alias="dateCreated")] = 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: + + ``` + 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. + """ + + file_size: Annotated[OptionalNullable[int], pydantic.Field(alias="fileSize")] = ( + UNSET + ) + r"""File size in bytes. For example, if this reads **46153**, then the file size is 46kb.""" + + id: Optional[str] = None + r"""Identifier for the attachment, unique for the company in the accounting software.""" + + include_when_sent: Annotated[ + Optional[bool], pydantic.Field(alias="includeWhenSent") + ] = None + r"""If `true`, then the attachment is included with the associated invoice, bill or direct costs when it is printed, emailed, or sent to a customer, if the underlying accounting software allows this.""" + + modified_date: Annotated[Optional[str], pydantic.Field(alias="modifiedDate")] = None + + name: OptionalNullable[str] = UNSET + r"""Name of the attachment file.""" + + source_modified_date: Annotated[ + Optional[str], pydantic.Field(alias="sourceModifiedDate") + ] = None + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = [ + "contentType", + "dateCreated", + "fileSize", + "id", + "includeWhenSent", + "modifiedDate", + "name", + "sourceModifiedDate", + ] + nullable_fields = ["contentType", "fileSize", "name"] + null_default_fields = [] + + serialized = handler(self) + + m = {} + + for n, f in self.model_fields.items(): + k = f.alias or n + val = serialized.get(k) + serialized.pop(k, None) + + optional_nullable = k in optional_fields and k in nullable_fields + is_set = ( + self.__pydantic_fields_set__.intersection({n}) + or k in null_default_fields + ) # pylint: disable=no-member + + if val is not None and val != UNSET_SENTINEL: + m[k] = val + elif val != UNSET_SENTINEL and ( + not k in optional_fields or (optional_nullable and is_set) + ): + m[k] = val + + return m diff --git a/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/attachments.py b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/attachments.py new file mode 100644 index 000000000..604f8e098 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/attachments.py @@ -0,0 +1,52 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .attachment import Attachment, AttachmentTypedDict +from codat_sync_for_payables_version_1.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from pydantic import model_serializer +from typing import List +from typing_extensions import NotRequired, TypedDict + + +class AttachmentsTypedDict(TypedDict): + attachments: NotRequired[Nullable[List[AttachmentTypedDict]]] + + +class Attachments(BaseModel): + attachments: OptionalNullable[List[Attachment]] = UNSET + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = ["attachments"] + nullable_fields = ["attachments"] + null_default_fields = [] + + serialized = handler(self) + + m = {} + + for n, f in self.model_fields.items(): + k = f.alias or n + val = serialized.get(k) + serialized.pop(k, None) + + optional_nullable = k in optional_fields and k in nullable_fields + is_set = ( + self.__pydantic_fields_set__.intersection({n}) + or k in null_default_fields + ) # pylint: disable=no-member + + if val is not None and val != UNSET_SENTINEL: + m[k] = val + elif val != UNSET_SENTINEL and ( + not k in optional_fields or (optional_nullable and is_set) + ): + m[k] = val + + return m diff --git a/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/attachmentupload.py b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/attachmentupload.py new file mode 100644 index 000000000..f6f8486dd --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/attachmentupload.py @@ -0,0 +1,22 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .codatfile import CodatFile, CodatFileTypedDict +from codat_sync_for_payables_version_1.types import BaseModel +from codat_sync_for_payables_version_1.utils import FieldMetadata, MultipartFormMetadata +import pydantic +from typing_extensions import Annotated, TypedDict + + +class AttachmentUploadTypedDict(TypedDict): + file: CodatFileTypedDict + r"""The file to be uploaded as an attachment.""" + + +class AttachmentUpload(BaseModel): + file: Annotated[ + CodatFile, + pydantic.Field(alias=""), + FieldMetadata(multipart=MultipartFormMetadata(file=True)), + ] + r"""The file to be uploaded as an attachment.""" diff --git a/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/bankaccountcreateresponse.py b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/bankaccountcreateresponse.py new file mode 100644 index 000000000..4a2b92475 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/bankaccountcreateresponse.py @@ -0,0 +1,514 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .bankaccountstatus import BankAccountStatus +from .datatype import DataType +from .metadata import Metadata, MetadataTypedDict +from .pushoperationchange import PushOperationChange, PushOperationChangeTypedDict +from .pushoperationstatus import PushOperationStatus +from .supplementaldata import SupplementalData, SupplementalDataTypedDict +from .validation import Validation, ValidationTypedDict +from codat_sync_for_payables_version_1.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from codat_sync_for_payables_version_1.utils import serialize_decimal, validate_decimal +from decimal import Decimal +from enum import Enum +import pydantic +from pydantic import model_serializer +from pydantic.functional_serializers import PlainSerializer +from pydantic.functional_validators import BeforeValidator +from typing import List, Optional +from typing_extensions import Annotated, NotRequired, TypedDict, deprecated + + +class BankAccountCreateResponseBankAccountType(str, Enum): + r"""The type of transactions and balances on the account. + For Credit accounts, positive balances are liabilities, and positive transactions **reduce** liabilities. + For Debit accounts, positive balances are assets, and positive transactions **increase** assets. + """ + + UNKNOWN = "Unknown" + CREDIT = "Credit" + DEBIT = "Debit" + + +@deprecated( + "warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible." +) +class AccountingBankAccountTypedDict(TypedDict): + r"""> **Accessing Bank Accounts through Banking API** + > + > This datatype was originally used for accessing bank account data both in accounting integrations and open banking aggregators. + > + > To view bank account data through the Banking API, please refer to the new datatype [here](https://docs.codat.io/sync-for-payables-api#/schemas/Account) + + > View the coverage for bank accounts in the Data coverage explorer. + + ## Overview + + A list of bank accounts associated with a company and a specific data connection. + + Bank accounts data includes: + * The name and ID of the account in the accounting software. + * The currency and balance of the account. + * The sort code and account number. + """ + + account_name: NotRequired[Nullable[str]] + r"""Name of the bank account in the accounting software.""" + account_number: NotRequired[Nullable[str]] + r"""Account number for the bank account. + + Xero integrations + Only a UK account number shows for bank accounts with GBP currency and a combined total of sort code and account number that equals 14 digits, For non-GBP accounts, the full bank account number is populated. + + FreeAgent integrations + For Credit accounts, only the last four digits are required. For other types, the field is optional. + """ + account_type: NotRequired[BankAccountCreateResponseBankAccountType] + r"""The type of transactions and balances on the account. + For Credit accounts, positive balances are liabilities, and positive transactions **reduce** liabilities. + For Debit accounts, positive balances are assets, and positive transactions **increase** assets. + """ + available_balance: NotRequired[Nullable[Decimal]] + r"""Total available balance of the bank account as reported by the underlying data source. This may take into account overdrafts or pending transactions for example.""" + balance: NotRequired[Nullable[Decimal]] + r"""Balance of the bank account.""" + currency: NotRequired[str] + r"""The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + + ## Unknown currencies + + In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + + There are only a very small number of edge cases where this currency code is returned by the Codat system. + """ + i_ban: NotRequired[Nullable[str]] + r"""International bank account number of the account. Often used when making or receiving international payments.""" + id: NotRequired[str] + r"""Identifier for the account, unique for the company in the accounting software.""" + institution: NotRequired[Nullable[str]] + r"""The institution of the bank account.""" + metadata: NotRequired[MetadataTypedDict] + modified_date: NotRequired[str] + nominal_code: NotRequired[Nullable[str]] + r"""Code used to identify each nominal account for a business.""" + overdraft_limit: NotRequired[Nullable[Decimal]] + r"""Pre-arranged overdraft limit of the account. + + The value is always positive. For example, an overdraftLimit of `1000` means that the balance of the account can go down to `-1000`. + """ + sort_code: NotRequired[Nullable[str]] + r"""Sort code for the bank account. + + Xero integrations + The sort code is only displayed when the currency = GBP and the sort code and account number sum to 14 digits. For non-GBP accounts, this field is not populated. + """ + source_modified_date: NotRequired[str] + status: NotRequired[BankAccountStatus] + r"""Status of the bank account.""" + supplemental_data: NotRequired[SupplementalDataTypedDict] + r"""Supplemental data is additional data you can include in our standard data types. + + It is referenced as a configured dynamic key value pair that is unique to the accounting software. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. + """ + + +@deprecated( + "warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible." +) +class AccountingBankAccount(BaseModel): + r"""> **Accessing Bank Accounts through Banking API** + > + > This datatype was originally used for accessing bank account data both in accounting integrations and open banking aggregators. + > + > To view bank account data through the Banking API, please refer to the new datatype [here](https://docs.codat.io/sync-for-payables-api#/schemas/Account) + + > View the coverage for bank accounts in the Data coverage explorer. + + ## Overview + + A list of bank accounts associated with a company and a specific data connection. + + Bank accounts data includes: + * The name and ID of the account in the accounting software. + * The currency and balance of the account. + * The sort code and account number. + """ + + account_name: Annotated[ + OptionalNullable[str], pydantic.Field(alias="accountName") + ] = UNSET + r"""Name of the bank account in the accounting software.""" + + account_number: Annotated[ + OptionalNullable[str], pydantic.Field(alias="accountNumber") + ] = UNSET + r"""Account number for the bank account. + + Xero integrations + Only a UK account number shows for bank accounts with GBP currency and a combined total of sort code and account number that equals 14 digits, For non-GBP accounts, the full bank account number is populated. + + FreeAgent integrations + For Credit accounts, only the last four digits are required. For other types, the field is optional. + """ + + account_type: Annotated[ + Optional[BankAccountCreateResponseBankAccountType], + pydantic.Field(alias="accountType"), + ] = None + r"""The type of transactions and balances on the account. + For Credit accounts, positive balances are liabilities, and positive transactions **reduce** liabilities. + For Debit accounts, positive balances are assets, and positive transactions **increase** assets. + """ + + available_balance: Annotated[ + Annotated[ + OptionalNullable[Decimal], + BeforeValidator(validate_decimal), + PlainSerializer(serialize_decimal(False)), + ], + pydantic.Field(alias="availableBalance"), + ] = UNSET + r"""Total available balance of the bank account as reported by the underlying data source. This may take into account overdrafts or pending transactions for example.""" + + balance: Annotated[ + OptionalNullable[Decimal], + BeforeValidator(validate_decimal), + PlainSerializer(serialize_decimal(False)), + ] = UNSET + r"""Balance of the bank account.""" + + currency: Optional[str] = None + r"""The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + + ## Unknown currencies + + In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + + There are only a very small number of edge cases where this currency code is returned by the Codat system. + """ + + i_ban: Annotated[OptionalNullable[str], pydantic.Field(alias="iBan")] = UNSET + r"""International bank account number of the account. Often used when making or receiving international payments.""" + + id: Optional[str] = None + r"""Identifier for the account, unique for the company in the accounting software.""" + + institution: OptionalNullable[str] = UNSET + r"""The institution of the bank account.""" + + metadata: Optional[Metadata] = None + + modified_date: Annotated[Optional[str], pydantic.Field(alias="modifiedDate")] = None + + nominal_code: Annotated[ + OptionalNullable[str], pydantic.Field(alias="nominalCode") + ] = UNSET + r"""Code used to identify each nominal account for a business.""" + + overdraft_limit: Annotated[ + Annotated[ + OptionalNullable[Decimal], + BeforeValidator(validate_decimal), + PlainSerializer(serialize_decimal(False)), + ], + pydantic.Field(alias="overdraftLimit"), + ] = UNSET + r"""Pre-arranged overdraft limit of the account. + + The value is always positive. For example, an overdraftLimit of `1000` means that the balance of the account can go down to `-1000`. + """ + + sort_code: Annotated[OptionalNullable[str], pydantic.Field(alias="sortCode")] = ( + UNSET + ) + r"""Sort code for the bank account. + + Xero integrations + The sort code is only displayed when the currency = GBP and the sort code and account number sum to 14 digits. For non-GBP accounts, this field is not populated. + """ + + source_modified_date: Annotated[ + Optional[str], pydantic.Field(alias="sourceModifiedDate") + ] = None + + status: Optional[BankAccountStatus] = None + r"""Status of the bank account.""" + + supplemental_data: Annotated[ + Optional[SupplementalData], pydantic.Field(alias="supplementalData") + ] = None + r"""Supplemental data is additional data you can include in our standard data types. + + It is referenced as a configured dynamic key value pair that is unique to the accounting software. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. + """ + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = [ + "accountName", + "accountNumber", + "accountType", + "availableBalance", + "balance", + "currency", + "iBan", + "id", + "institution", + "metadata", + "modifiedDate", + "nominalCode", + "overdraftLimit", + "sortCode", + "sourceModifiedDate", + "status", + "supplementalData", + ] + nullable_fields = [ + "accountName", + "accountNumber", + "availableBalance", + "balance", + "iBan", + "institution", + "nominalCode", + "overdraftLimit", + "sortCode", + ] + null_default_fields = [] + + serialized = handler(self) + + m = {} + + for n, f in self.model_fields.items(): + k = f.alias or n + val = serialized.get(k) + serialized.pop(k, None) + + optional_nullable = k in optional_fields and k in nullable_fields + is_set = ( + self.__pydantic_fields_set__.intersection({n}) + or k in null_default_fields + ) # pylint: disable=no-member + + if val is not None and val != UNSET_SENTINEL: + m[k] = val + elif val != UNSET_SENTINEL and ( + not k in optional_fields or (optional_nullable and is_set) + ): + m[k] = val + + return m + + +class BankAccountCreateResponseTypedDict(TypedDict): + company_id: str + r"""Unique identifier for your SMB in Codat.""" + data_connection_key: str + r"""Unique identifier for a company's data connection.""" + push_operation_key: str + r"""A unique identifier generated by Codat to represent this single push operation. This identifier can be used to track the status of the push, and should be persisted.""" + requested_on_utc: 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: + + ``` + 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. + """ + status: PushOperationStatus + r"""The current status of the push operation.""" + status_code: int + r"""Push status code.""" + changes: NotRequired[Nullable[List[PushOperationChangeTypedDict]]] + r"""Contains a single entry that communicates which record has changed and the manner in which it changed.""" + completed_on_utc: 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: + + ``` + 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. + """ + data: NotRequired[Nullable[AccountingBankAccountTypedDict]] + data_type: NotRequired[DataType] + r"""Available data types""" + error_message: NotRequired[Nullable[str]] + r"""A message about the error.""" + timeout_in_minutes: NotRequired[Nullable[int]] + r"""Number of minutes the push operation must complete within before it times out.""" + timeout_in_seconds: NotRequired[Nullable[int]] + r"""Number of seconds the push operation must complete within before it times out.""" + validation: NotRequired[ValidationTypedDict] + r"""A human-readable object describing validation decisions Codat has made when pushing data into the platform. If a push has failed because of validation errors, they will be detailed here.""" + + +class BankAccountCreateResponse(BaseModel): + company_id: Annotated[str, pydantic.Field(alias="companyId")] + r"""Unique identifier for your SMB in Codat.""" + + data_connection_key: Annotated[str, pydantic.Field(alias="dataConnectionKey")] + r"""Unique identifier for a company's data connection.""" + + push_operation_key: Annotated[str, pydantic.Field(alias="pushOperationKey")] + r"""A unique identifier generated by Codat to represent this single push operation. This identifier can be used to track the status of the push, and should be persisted.""" + + requested_on_utc: Annotated[str, pydantic.Field(alias="requestedOnUtc")] + 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: + + ``` + 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. + """ + + status: PushOperationStatus + r"""The current status of the push operation.""" + + status_code: Annotated[int, pydantic.Field(alias="statusCode")] + r"""Push status code.""" + + changes: OptionalNullable[List[PushOperationChange]] = UNSET + r"""Contains a single entry that communicates which record has changed and the manner in which it changed.""" + + completed_on_utc: Annotated[ + Optional[str], pydantic.Field(alias="completedOnUtc") + ] = 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: + + ``` + 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. + """ + + data: OptionalNullable[AccountingBankAccount] = UNSET + + data_type: Annotated[Optional[DataType], pydantic.Field(alias="dataType")] = None + r"""Available data types""" + + error_message: Annotated[ + OptionalNullable[str], pydantic.Field(alias="errorMessage") + ] = UNSET + r"""A message about the error.""" + + timeout_in_minutes: Annotated[ + OptionalNullable[int], pydantic.Field(alias="timeoutInMinutes") + ] = UNSET + r"""Number of minutes the push operation must complete within before it times out.""" + + timeout_in_seconds: Annotated[ + OptionalNullable[int], + pydantic.Field( + deprecated="warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible.", + alias="timeoutInSeconds", + ), + ] = UNSET + r"""Number of seconds the push operation must complete within before it times out.""" + + validation: Optional[Validation] = None + r"""A human-readable object describing validation decisions Codat has made when pushing data into the platform. If a push has failed because of validation errors, they will be detailed here.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = [ + "changes", + "completedOnUtc", + "data", + "dataType", + "errorMessage", + "timeoutInMinutes", + "timeoutInSeconds", + "validation", + ] + nullable_fields = [ + "changes", + "data", + "errorMessage", + "timeoutInMinutes", + "timeoutInSeconds", + ] + null_default_fields = [] + + serialized = handler(self) + + m = {} + + for n, f in self.model_fields.items(): + k = f.alias or n + val = serialized.get(k) + serialized.pop(k, None) + + optional_nullable = k in optional_fields and k in nullable_fields + is_set = ( + self.__pydantic_fields_set__.intersection({n}) + or k in null_default_fields + ) # pylint: disable=no-member + + if val is not None and val != UNSET_SENTINEL: + m[k] = val + elif val != UNSET_SENTINEL and ( + not k in optional_fields or (optional_nullable and is_set) + ): + m[k] = val + + return m diff --git a/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/bankaccountprototype.py b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/bankaccountprototype.py new file mode 100644 index 000000000..663b7c821 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/bankaccountprototype.py @@ -0,0 +1,225 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .bankaccountstatus import BankAccountStatus +from codat_sync_for_payables_version_1.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from codat_sync_for_payables_version_1.utils import serialize_decimal, validate_decimal +from decimal import Decimal +from enum import Enum +import pydantic +from pydantic import model_serializer +from pydantic.functional_serializers import PlainSerializer +from pydantic.functional_validators import BeforeValidator +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class BankAccountType(str, Enum): + r"""The type of transactions and balances on the account. + For Credit accounts, positive balances are liabilities, and positive transactions **reduce** liabilities. + For Debit accounts, positive balances are assets, and positive transactions **increase** assets. + """ + + UNKNOWN = "Unknown" + CREDIT = "Credit" + DEBIT = "Debit" + + +class BankAccountPrototypeTypedDict(TypedDict): + account_name: NotRequired[Nullable[str]] + r"""Name of the bank account in the accounting software.""" + account_number: NotRequired[Nullable[str]] + r"""Account number for the bank account. + + Xero integrations + Only a UK account number shows for bank accounts with GBP currency and a combined total of sort code and account number that equals 14 digits, For non-GBP accounts, the full bank account number is populated. + + FreeAgent integrations + For Credit accounts, only the last four digits are required. For other types, the field is optional. + """ + account_type: NotRequired[BankAccountType] + r"""The type of transactions and balances on the account. + For Credit accounts, positive balances are liabilities, and positive transactions **reduce** liabilities. + For Debit accounts, positive balances are assets, and positive transactions **increase** assets. + """ + available_balance: NotRequired[Nullable[Decimal]] + r"""Total available balance of the bank account as reported by the underlying data source. This may take into account overdrafts or pending transactions for example.""" + balance: NotRequired[Nullable[Decimal]] + r"""Balance of the bank account.""" + currency: NotRequired[str] + r"""The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + + ## Unknown currencies + + In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + + There are only a very small number of edge cases where this currency code is returned by the Codat system. + """ + i_ban: NotRequired[Nullable[str]] + r"""International bank account number of the account. Often used when making or receiving international payments.""" + institution: NotRequired[Nullable[str]] + r"""The institution of the bank account.""" + nominal_code: NotRequired[Nullable[str]] + r"""Code used to identify each nominal account for a business.""" + overdraft_limit: NotRequired[Nullable[Decimal]] + r"""Pre-arranged overdraft limit of the account. + + The value is always positive. For example, an overdraftLimit of `1000` means that the balance of the account can go down to `-1000`. + """ + sort_code: NotRequired[Nullable[str]] + r"""Sort code for the bank account. + + Xero integrations + The sort code is only displayed when the currency = GBP and the sort code and account number sum to 14 digits. For non-GBP accounts, this field is not populated. + """ + status: NotRequired[BankAccountStatus] + r"""Status of the bank account.""" + + +class BankAccountPrototype(BaseModel): + account_name: Annotated[ + OptionalNullable[str], pydantic.Field(alias="accountName") + ] = UNSET + r"""Name of the bank account in the accounting software.""" + + account_number: Annotated[ + OptionalNullable[str], pydantic.Field(alias="accountNumber") + ] = UNSET + r"""Account number for the bank account. + + Xero integrations + Only a UK account number shows for bank accounts with GBP currency and a combined total of sort code and account number that equals 14 digits, For non-GBP accounts, the full bank account number is populated. + + FreeAgent integrations + For Credit accounts, only the last four digits are required. For other types, the field is optional. + """ + + account_type: Annotated[ + Optional[BankAccountType], pydantic.Field(alias="accountType") + ] = None + r"""The type of transactions and balances on the account. + For Credit accounts, positive balances are liabilities, and positive transactions **reduce** liabilities. + For Debit accounts, positive balances are assets, and positive transactions **increase** assets. + """ + + available_balance: Annotated[ + Annotated[ + OptionalNullable[Decimal], + BeforeValidator(validate_decimal), + PlainSerializer(serialize_decimal(False)), + ], + pydantic.Field(alias="availableBalance"), + ] = UNSET + r"""Total available balance of the bank account as reported by the underlying data source. This may take into account overdrafts or pending transactions for example.""" + + balance: Annotated[ + OptionalNullable[Decimal], + BeforeValidator(validate_decimal), + PlainSerializer(serialize_decimal(False)), + ] = UNSET + r"""Balance of the bank account.""" + + currency: Optional[str] = None + r"""The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + + ## Unknown currencies + + In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + + There are only a very small number of edge cases where this currency code is returned by the Codat system. + """ + + i_ban: Annotated[OptionalNullable[str], pydantic.Field(alias="iBan")] = UNSET + r"""International bank account number of the account. Often used when making or receiving international payments.""" + + institution: OptionalNullable[str] = UNSET + r"""The institution of the bank account.""" + + nominal_code: Annotated[ + OptionalNullable[str], pydantic.Field(alias="nominalCode") + ] = UNSET + r"""Code used to identify each nominal account for a business.""" + + overdraft_limit: Annotated[ + Annotated[ + OptionalNullable[Decimal], + BeforeValidator(validate_decimal), + PlainSerializer(serialize_decimal(False)), + ], + pydantic.Field(alias="overdraftLimit"), + ] = UNSET + r"""Pre-arranged overdraft limit of the account. + + The value is always positive. For example, an overdraftLimit of `1000` means that the balance of the account can go down to `-1000`. + """ + + sort_code: Annotated[OptionalNullable[str], pydantic.Field(alias="sortCode")] = ( + UNSET + ) + r"""Sort code for the bank account. + + Xero integrations + The sort code is only displayed when the currency = GBP and the sort code and account number sum to 14 digits. For non-GBP accounts, this field is not populated. + """ + + status: Optional[BankAccountStatus] = None + r"""Status of the bank account.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = [ + "accountName", + "accountNumber", + "accountType", + "availableBalance", + "balance", + "currency", + "iBan", + "institution", + "nominalCode", + "overdraftLimit", + "sortCode", + "status", + ] + nullable_fields = [ + "accountName", + "accountNumber", + "availableBalance", + "balance", + "iBan", + "institution", + "nominalCode", + "overdraftLimit", + "sortCode", + ] + null_default_fields = [] + + serialized = handler(self) + + m = {} + + for n, f in self.model_fields.items(): + k = f.alias or n + val = serialized.get(k) + serialized.pop(k, None) + + optional_nullable = k in optional_fields and k in nullable_fields + is_set = ( + self.__pydantic_fields_set__.intersection({n}) + or k in null_default_fields + ) # pylint: disable=no-member + + if val is not None and val != UNSET_SENTINEL: + m[k] = val + elif val != UNSET_SENTINEL and ( + not k in optional_fields or (optional_nullable and is_set) + ): + m[k] = val + + return m diff --git a/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/bankaccountstatus.py b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/bankaccountstatus.py new file mode 100644 index 000000000..be857f929 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/bankaccountstatus.py @@ -0,0 +1,13 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from enum import Enum + + +class BankAccountStatus(str, Enum): + r"""Status of the bank account.""" + + UNKNOWN = "Unknown" + ACTIVE = "Active" + ARCHIVED = "Archived" + PENDING = "Pending" diff --git a/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/bill.py b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/bill.py new file mode 100644 index 000000000..4ba58724a --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/bill.py @@ -0,0 +1,622 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .billlineitem import BillLineItem, BillLineItemTypedDict +from .billstatus import BillStatus +from .metadata import Metadata, MetadataTypedDict +from .paymentallocationpayment import ( + PaymentAllocationPayment, + PaymentAllocationPaymentTypedDict, +) +from .supplementaldata import SupplementalData, SupplementalDataTypedDict +from .supplierref import SupplierRef, SupplierRefTypedDict +from codat_sync_for_payables_version_1.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from codat_sync_for_payables_version_1.utils import serialize_decimal, validate_decimal +from decimal import Decimal +import pydantic +from pydantic import model_serializer +from pydantic.functional_serializers import PlainSerializer +from pydantic.functional_validators import BeforeValidator +from typing import List, Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class BillAllocationTypedDict(TypedDict): + allocated_on_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: + + ``` + 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. + """ + currency: NotRequired[str] + r"""The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + + ## Unknown currencies + + In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + + There are only a very small number of edge cases where this currency code is returned by the Codat system. + """ + currency_rate: NotRequired[Nullable[Decimal]] + r"""Rate to convert the total amount of the payment into the base currency for the company at the time of the payment. + + Currency rates in Codat are implemented as the multiple of foreign currency units to each base currency unit. + + It is not possible to perform the currency conversion with two or more non-base currencies participating in the transaction. For example, if a company's base currency is USD, and it has a bill issued in EUR, then the bill payment must happen in USD or EUR. + + Where the currency rate is provided by the underlying accounting software, it will be available from Codat with the same precision (up to a maximum of 9 decimal places). + + For accounting software which do not provide an explicit currency rate, it is calculated as `baseCurrency / foreignCurrency` and will be returned to 9 decimal places. + + ## Examples with base currency of GBP + + | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (GBP) | + | :--------------- | :------------- | :------------ | :------------------------- | + | **USD** | $20 | 0.781 | £15.62 | + | **EUR** | €20 | 0.885 | £17.70 | + | **RUB** | ₽20 | 0.011 | £0.22 | + + ## Examples with base currency of USD + + | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (USD) | + | :--------------- | :------------- | :------------ | :------------------------- | + | **GBP** | £20 | 1.277 | $25.54 | + | **EUR** | €20 | 1.134 | $22.68 | + | **RUB** | ₽20 | 0.015 | $0.30 | + + + ### Integration-specific details + + | Integration | Scenario | System behavior | + |-------------------|-------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------| + | QuickBooks Online | Transaction currency differs from base currency | If currency rate value is left `null`, a rate of 1 will be used by QBO by default. To override this, specify a currencyRate in the request body. | + """ + total_amount: NotRequired[Decimal] + r"""The total amount that has been allocated.""" + + +class BillAllocation(BaseModel): + allocated_on_date: Annotated[ + Optional[str], pydantic.Field(alias="allocatedOnDate") + ] = 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: + + ``` + 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. + """ + + currency: Optional[str] = None + r"""The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + + ## Unknown currencies + + In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + + There are only a very small number of edge cases where this currency code is returned by the Codat system. + """ + + currency_rate: Annotated[ + Annotated[ + OptionalNullable[Decimal], + BeforeValidator(validate_decimal), + PlainSerializer(serialize_decimal(False)), + ], + pydantic.Field(alias="currencyRate"), + ] = UNSET + r"""Rate to convert the total amount of the payment into the base currency for the company at the time of the payment. + + Currency rates in Codat are implemented as the multiple of foreign currency units to each base currency unit. + + It is not possible to perform the currency conversion with two or more non-base currencies participating in the transaction. For example, if a company's base currency is USD, and it has a bill issued in EUR, then the bill payment must happen in USD or EUR. + + Where the currency rate is provided by the underlying accounting software, it will be available from Codat with the same precision (up to a maximum of 9 decimal places). + + For accounting software which do not provide an explicit currency rate, it is calculated as `baseCurrency / foreignCurrency` and will be returned to 9 decimal places. + + ## Examples with base currency of GBP + + | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (GBP) | + | :--------------- | :------------- | :------------ | :------------------------- | + | **USD** | $20 | 0.781 | £15.62 | + | **EUR** | €20 | 0.885 | £17.70 | + | **RUB** | ₽20 | 0.011 | £0.22 | + + ## Examples with base currency of USD + + | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (USD) | + | :--------------- | :------------- | :------------ | :------------------------- | + | **GBP** | £20 | 1.277 | $25.54 | + | **EUR** | €20 | 1.134 | $22.68 | + | **RUB** | ₽20 | 0.015 | $0.30 | + + + ### Integration-specific details + + | Integration | Scenario | System behavior | + |-------------------|-------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------| + | QuickBooks Online | Transaction currency differs from base currency | If currency rate value is left `null`, a rate of 1 will be used by QBO by default. To override this, specify a currencyRate in the request body. | + """ + + total_amount: Annotated[ + Annotated[ + Optional[Decimal], + BeforeValidator(validate_decimal), + PlainSerializer(serialize_decimal(False)), + ], + pydantic.Field(alias="totalAmount"), + ] = None + r"""The total amount that has been allocated.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = ["allocatedOnDate", "currency", "currencyRate", "totalAmount"] + nullable_fields = ["currencyRate"] + null_default_fields = [] + + serialized = handler(self) + + m = {} + + for n, f in self.model_fields.items(): + k = f.alias or n + val = serialized.get(k) + serialized.pop(k, None) + + optional_nullable = k in optional_fields and k in nullable_fields + is_set = ( + self.__pydantic_fields_set__.intersection({n}) + or k in null_default_fields + ) # pylint: disable=no-member + + if val is not None and val != UNSET_SENTINEL: + m[k] = val + elif val != UNSET_SENTINEL and ( + not k in optional_fields or (optional_nullable and is_set) + ): + m[k] = val + + return m + + +class AccountingPaymentAllocationTypedDict(TypedDict): + allocation: BillAllocationTypedDict + payment: PaymentAllocationPaymentTypedDict + + +class AccountingPaymentAllocation(BaseModel): + allocation: BillAllocation + + payment: PaymentAllocationPayment + + +class PurchaseOrderReferenceTypedDict(TypedDict): + id: NotRequired[str] + r"""Identifier for the purchase order, unique for the company in the accounting software.""" + purchase_order_number: NotRequired[Nullable[str]] + r"""Friendly reference for the purchase order, commonly generated by the accounting software.""" + + +class PurchaseOrderReference(BaseModel): + id: Optional[str] = None + r"""Identifier for the purchase order, unique for the company in the accounting software.""" + + purchase_order_number: Annotated[ + OptionalNullable[str], pydantic.Field(alias="purchaseOrderNumber") + ] = UNSET + r"""Friendly reference for the purchase order, commonly generated by the accounting software.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = ["id", "purchaseOrderNumber"] + nullable_fields = ["purchaseOrderNumber"] + null_default_fields = [] + + serialized = handler(self) + + m = {} + + for n, f in self.model_fields.items(): + k = f.alias or n + val = serialized.get(k) + serialized.pop(k, None) + + optional_nullable = k in optional_fields and k in nullable_fields + is_set = ( + self.__pydantic_fields_set__.intersection({n}) + or k in null_default_fields + ) # pylint: disable=no-member + + if val is not None and val != UNSET_SENTINEL: + m[k] = val + elif val != UNSET_SENTINEL and ( + not k in optional_fields or (optional_nullable and is_set) + ): + m[k] = val + + return m + + +class WithholdingTaxTypedDict(TypedDict): + amount: Decimal + r"""Amount of tax withheld.""" + name: str + r"""Name assigned to withheld tax.""" + + +class WithholdingTax(BaseModel): + amount: Annotated[ + Decimal, + BeforeValidator(validate_decimal), + PlainSerializer(serialize_decimal(False)), + ] + r"""Amount of tax withheld.""" + + name: str + r"""Name assigned to withheld tax.""" + + +class BillTypedDict(TypedDict): + r"""> **Invoices or bills?** + > + > We distinguish between invoices where the company *owes money* vs. *is owed money*. If the company has received an invoice, and owes money to someone else (accounts payable) we call this a Bill. + > + > See [Invoices](https://docs.codat.io/sync-for-payables-api#/schemas/Invoice) for the accounts receivable equivalent of bills. + + View the coverage for bills in the Data coverage explorer. + + ## Overview + + In Codat, a bill contains details of: + * When the bill was recorded in the accounting system. + * How much the bill is for and the currency of the amount. + * Who the bill was received from — the *supplier*. + * What the bill is for — the *line items*. + + Some accounting software give a separate name to purchases where the payment is made immediately, such as something bought with a credit card or online payment. One example of this would be QuickBooks Online's *expenses*. + + You can find these types of transactions in our [Direct costs](https://docs.codat.io/sync-for-payables-api#/schemas/DirectCost) data model. + """ + + issue_date: str + status: BillStatus + r"""Current state of the bill.""" + sub_total: Decimal + r"""Total amount of the bill, excluding any taxes.""" + tax_amount: Decimal + r"""Amount of tax on the bill.""" + total_amount: Decimal + r"""Amount of the bill, including tax.""" + amount_due: NotRequired[Nullable[Decimal]] + r"""Amount outstanding on the bill.""" + currency: NotRequired[str] + r"""The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + + ## Unknown currencies + + In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + + There are only a very small number of edge cases where this currency code is returned by the Codat system. + """ + currency_rate: NotRequired[Nullable[Decimal]] + r"""Rate to convert the total amount of the payment into the base currency for the company at the time of the payment. + + Currency rates in Codat are implemented as the multiple of foreign currency units to each base currency unit. + + It is not possible to perform the currency conversion with two or more non-base currencies participating in the transaction. For example, if a company's base currency is USD, and it has a bill issued in EUR, then the bill payment must happen in USD or EUR. + + Where the currency rate is provided by the underlying accounting software, it will be available from Codat with the same precision (up to a maximum of 9 decimal places). + + For accounting software which do not provide an explicit currency rate, it is calculated as `baseCurrency / foreignCurrency` and will be returned to 9 decimal places. + + ## Examples with base currency of GBP + + | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (GBP) | + | :--------------- | :------------- | :------------ | :------------------------- | + | **USD** | $20 | 0.781 | £15.62 | + | **EUR** | €20 | 0.885 | £17.70 | + | **RUB** | ₽20 | 0.011 | £0.22 | + + ## Examples with base currency of USD + + | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (USD) | + | :--------------- | :------------- | :------------ | :------------------------- | + | **GBP** | £20 | 1.277 | $25.54 | + | **EUR** | €20 | 1.134 | $22.68 | + | **RUB** | ₽20 | 0.015 | $0.30 | + + + ### Integration-specific details + + | Integration | Scenario | System behavior | + |-------------------|-------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------| + | QuickBooks Online | Transaction currency differs from base currency | If currency rate value is left `null`, a rate of 1 will be used by QBO by default. To override this, specify a currencyRate in the request body. | + """ + due_date: NotRequired[str] + id: NotRequired[str] + r"""Identifier for the bill, unique for the company in the accounting software.""" + line_items: NotRequired[Nullable[List[BillLineItemTypedDict]]] + r"""Array of Bill line items.""" + metadata: NotRequired[MetadataTypedDict] + modified_date: NotRequired[str] + note: NotRequired[Nullable[str]] + r"""Any private, company notes about the bill, such as payment information.""" + payment_allocations: NotRequired[ + Nullable[List[AccountingPaymentAllocationTypedDict]] + ] + r"""An array of payment allocations.""" + purchase_order_refs: NotRequired[Nullable[List[PurchaseOrderReferenceTypedDict]]] + reference: NotRequired[Nullable[str]] + r"""User-friendly reference for the bill.""" + source_modified_date: NotRequired[str] + supplemental_data: NotRequired[SupplementalDataTypedDict] + r"""Supplemental data is additional data you can include in our standard data types. + + It is referenced as a configured dynamic key value pair that is unique to the accounting software. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. + """ + supplier_ref: NotRequired[SupplierRefTypedDict] + r"""Reference to the supplier the record relates to.""" + withholding_tax: NotRequired[Nullable[List[WithholdingTaxTypedDict]]] + + +class Bill(BaseModel): + r"""> **Invoices or bills?** + > + > We distinguish between invoices where the company *owes money* vs. *is owed money*. If the company has received an invoice, and owes money to someone else (accounts payable) we call this a Bill. + > + > See [Invoices](https://docs.codat.io/sync-for-payables-api#/schemas/Invoice) for the accounts receivable equivalent of bills. + + View the coverage for bills in the Data coverage explorer. + + ## Overview + + In Codat, a bill contains details of: + * When the bill was recorded in the accounting system. + * How much the bill is for and the currency of the amount. + * Who the bill was received from — the *supplier*. + * What the bill is for — the *line items*. + + Some accounting software give a separate name to purchases where the payment is made immediately, such as something bought with a credit card or online payment. One example of this would be QuickBooks Online's *expenses*. + + You can find these types of transactions in our [Direct costs](https://docs.codat.io/sync-for-payables-api#/schemas/DirectCost) data model. + """ + + issue_date: Annotated[str, pydantic.Field(alias="issueDate")] + + status: BillStatus + r"""Current state of the bill.""" + + sub_total: Annotated[ + Annotated[ + Decimal, + BeforeValidator(validate_decimal), + PlainSerializer(serialize_decimal(False)), + ], + pydantic.Field(alias="subTotal"), + ] + r"""Total amount of the bill, excluding any taxes.""" + + tax_amount: Annotated[ + Annotated[ + Decimal, + BeforeValidator(validate_decimal), + PlainSerializer(serialize_decimal(False)), + ], + pydantic.Field(alias="taxAmount"), + ] + r"""Amount of tax on the bill.""" + + total_amount: Annotated[ + Annotated[ + Decimal, + BeforeValidator(validate_decimal), + PlainSerializer(serialize_decimal(False)), + ], + pydantic.Field(alias="totalAmount"), + ] + r"""Amount of the bill, including tax.""" + + amount_due: Annotated[ + Annotated[ + OptionalNullable[Decimal], + BeforeValidator(validate_decimal), + PlainSerializer(serialize_decimal(False)), + ], + pydantic.Field(alias="amountDue"), + ] = UNSET + r"""Amount outstanding on the bill.""" + + currency: Optional[str] = None + r"""The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + + ## Unknown currencies + + In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + + There are only a very small number of edge cases where this currency code is returned by the Codat system. + """ + + currency_rate: Annotated[ + Annotated[ + OptionalNullable[Decimal], + BeforeValidator(validate_decimal), + PlainSerializer(serialize_decimal(False)), + ], + pydantic.Field(alias="currencyRate"), + ] = UNSET + r"""Rate to convert the total amount of the payment into the base currency for the company at the time of the payment. + + Currency rates in Codat are implemented as the multiple of foreign currency units to each base currency unit. + + It is not possible to perform the currency conversion with two or more non-base currencies participating in the transaction. For example, if a company's base currency is USD, and it has a bill issued in EUR, then the bill payment must happen in USD or EUR. + + Where the currency rate is provided by the underlying accounting software, it will be available from Codat with the same precision (up to a maximum of 9 decimal places). + + For accounting software which do not provide an explicit currency rate, it is calculated as `baseCurrency / foreignCurrency` and will be returned to 9 decimal places. + + ## Examples with base currency of GBP + + | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (GBP) | + | :--------------- | :------------- | :------------ | :------------------------- | + | **USD** | $20 | 0.781 | £15.62 | + | **EUR** | €20 | 0.885 | £17.70 | + | **RUB** | ₽20 | 0.011 | £0.22 | + + ## Examples with base currency of USD + + | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (USD) | + | :--------------- | :------------- | :------------ | :------------------------- | + | **GBP** | £20 | 1.277 | $25.54 | + | **EUR** | €20 | 1.134 | $22.68 | + | **RUB** | ₽20 | 0.015 | $0.30 | + + + ### Integration-specific details + + | Integration | Scenario | System behavior | + |-------------------|-------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------| + | QuickBooks Online | Transaction currency differs from base currency | If currency rate value is left `null`, a rate of 1 will be used by QBO by default. To override this, specify a currencyRate in the request body. | + """ + + due_date: Annotated[Optional[str], pydantic.Field(alias="dueDate")] = None + + id: Optional[str] = None + r"""Identifier for the bill, unique for the company in the accounting software.""" + + line_items: Annotated[ + OptionalNullable[List[BillLineItem]], pydantic.Field(alias="lineItems") + ] = UNSET + r"""Array of Bill line items.""" + + metadata: Optional[Metadata] = None + + modified_date: Annotated[Optional[str], pydantic.Field(alias="modifiedDate")] = None + + note: OptionalNullable[str] = UNSET + r"""Any private, company notes about the bill, such as payment information.""" + + payment_allocations: Annotated[ + OptionalNullable[List[AccountingPaymentAllocation]], + pydantic.Field(alias="paymentAllocations"), + ] = UNSET + r"""An array of payment allocations.""" + + purchase_order_refs: Annotated[ + OptionalNullable[List[PurchaseOrderReference]], + pydantic.Field(alias="purchaseOrderRefs"), + ] = UNSET + + reference: OptionalNullable[str] = UNSET + r"""User-friendly reference for the bill.""" + + source_modified_date: Annotated[ + Optional[str], pydantic.Field(alias="sourceModifiedDate") + ] = None + + supplemental_data: Annotated[ + Optional[SupplementalData], pydantic.Field(alias="supplementalData") + ] = None + r"""Supplemental data is additional data you can include in our standard data types. + + It is referenced as a configured dynamic key value pair that is unique to the accounting software. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. + """ + + supplier_ref: Annotated[ + Optional[SupplierRef], pydantic.Field(alias="supplierRef") + ] = None + r"""Reference to the supplier the record relates to.""" + + withholding_tax: Annotated[ + OptionalNullable[List[WithholdingTax]], pydantic.Field(alias="withholdingTax") + ] = UNSET + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = [ + "amountDue", + "currency", + "currencyRate", + "dueDate", + "id", + "lineItems", + "metadata", + "modifiedDate", + "note", + "paymentAllocations", + "purchaseOrderRefs", + "reference", + "sourceModifiedDate", + "supplementalData", + "supplierRef", + "withholdingTax", + ] + nullable_fields = [ + "amountDue", + "currencyRate", + "lineItems", + "note", + "paymentAllocations", + "purchaseOrderRefs", + "reference", + "withholdingTax", + ] + null_default_fields = [] + + serialized = handler(self) + + m = {} + + for n, f in self.model_fields.items(): + k = f.alias or n + val = serialized.get(k) + serialized.pop(k, None) + + optional_nullable = k in optional_fields and k in nullable_fields + is_set = ( + self.__pydantic_fields_set__.intersection({n}) + or k in null_default_fields + ) # pylint: disable=no-member + + if val is not None and val != UNSET_SENTINEL: + m[k] = val + elif val != UNSET_SENTINEL and ( + not k in optional_fields or (optional_nullable and is_set) + ): + m[k] = val + + return m diff --git a/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/billcreditnote.py b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/billcreditnote.py new file mode 100644 index 000000000..cae8a553e --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/billcreditnote.py @@ -0,0 +1,486 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .billcreditnotelineitem import ( + BillCreditNoteLineItem, + BillCreditNoteLineItemTypedDict, +) +from .billcreditnotestatus import BillCreditNoteStatus +from .items import Items, ItemsTypedDict +from .metadata import Metadata, MetadataTypedDict +from .supplementaldata import SupplementalData, SupplementalDataTypedDict +from .supplierref import SupplierRef, SupplierRefTypedDict +from .withholdingtax_items import WithholdingTaxItems, WithholdingTaxItemsTypedDict +from codat_sync_for_payables_version_1.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from codat_sync_for_payables_version_1.utils import serialize_decimal, validate_decimal +from decimal import Decimal +import pydantic +from pydantic import model_serializer +from pydantic.functional_serializers import PlainSerializer +from pydantic.functional_validators import BeforeValidator +from typing import List, Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class RecordReferenceTypedDict(TypedDict): + r"""Links the current record to the underlying record or data type that created it. + + For example, if a journal entry is generated based on an invoice, this property allows you to connect the journal entry to the underlying invoice in our data model. + """ + + data_type: NotRequired[str] + r"""Allowed name of the 'dataType'.""" + id: NotRequired[str] + r"""'id' of the underlying record or data type.""" + + +class RecordReference(BaseModel): + r"""Links the current record to the underlying record or data type that created it. + + For example, if a journal entry is generated based on an invoice, this property allows you to connect the journal entry to the underlying invoice in our data model. + """ + + data_type: Annotated[Optional[str], pydantic.Field(alias="dataType")] = None + r"""Allowed name of the 'dataType'.""" + + id: Optional[str] = None + r"""'id' of the underlying record or data type.""" + + +class BillCreditNoteTypedDict(TypedDict): + r"""> **Bill credit notes or credit notes?** + > + > In Codat, bill credit notes represent accounts payable only. For accounts receivable, see [Credit notes](https://docs.codat.io/sync-for-payables-api#/schemas/CreditNote). + + View the coverage for bill credit notes in the Data coverage explorer. + + ## Overview + + A bill credit note is issued by a supplier for the purpose of recording credit. For example, if a supplier was unable to fulfil an order that was placed by a business, or delivered damaged goods, they would issue a bill credit note. A bill credit note reduces the amount a business owes to the supplier. It can be refunded to the business or used to pay off future bills. + + In the Codat API, a bill credit note is an accounts payable record issued by a [supplier](https://docs.codat.io/sync-for-payables-api#/schemas/Supplier). + + A bill credit note includes details of: + * The original and remaining credit. + * Any allocations of the credit against other records, such as [bills](https://docs.codat.io/sync-for-payables-api#/schemas/Bill). + * The supplier that issued the bill credit note. + """ + + discount_percentage: Decimal + r"""Percentage rate of any discount applied to the bill credit note.""" + status: BillCreditNoteStatus + r"""Current state of the bill credit note""" + sub_total: Decimal + r"""Total amount of the bill credit note, including discounts but excluding tax.""" + total_amount: Decimal + r"""Total amount of credit that has been applied to the business' account with the supplier, including discounts and tax.""" + total_discount: Decimal + r"""Total value of any discounts applied.""" + total_tax_amount: Decimal + r"""Amount of tax included in the bill credit note.""" + allocated_on_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: + + ``` + 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. + """ + bill_credit_note_number: NotRequired[Nullable[str]] + r"""Friendly reference for the bill credit note.""" + created_from_refs: NotRequired[Nullable[List[RecordReferenceTypedDict]]] + r"""An array of records the credit note was created from.""" + currency: NotRequired[str] + r"""The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + + ## Unknown currencies + + In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + + There are only a very small number of edge cases where this currency code is returned by the Codat system. + """ + currency_rate: NotRequired[Nullable[Decimal]] + r"""Rate to convert the total amount of the payment into the base currency for the company at the time of the payment. + + Currency rates in Codat are implemented as the multiple of foreign currency units to each base currency unit. + + It is not possible to perform the currency conversion with two or more non-base currencies participating in the transaction. For example, if a company's base currency is USD, and it has a bill issued in EUR, then the bill payment must happen in USD or EUR. + + Where the currency rate is provided by the underlying accounting software, it will be available from Codat with the same precision (up to a maximum of 9 decimal places). + + For accounting software which do not provide an explicit currency rate, it is calculated as `baseCurrency / foreignCurrency` and will be returned to 9 decimal places. + + ## Examples with base currency of GBP + + | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (GBP) | + | :--------------- | :------------- | :------------ | :------------------------- | + | **USD** | $20 | 0.781 | £15.62 | + | **EUR** | €20 | 0.885 | £17.70 | + | **RUB** | ₽20 | 0.011 | £0.22 | + + ## Examples with base currency of USD + + | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (USD) | + | :--------------- | :------------- | :------------ | :------------------------- | + | **GBP** | £20 | 1.277 | $25.54 | + | **EUR** | €20 | 1.134 | $22.68 | + | **RUB** | ₽20 | 0.015 | $0.30 | + + + ### Integration-specific details + + | Integration | Scenario | System behavior | + |-------------------|-------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------| + | QuickBooks Online | Transaction currency differs from base currency | If currency rate value is left `null`, a rate of 1 will be used by QBO by default. To override this, specify a currencyRate in the request body. | + """ + id: NotRequired[str] + r"""Identifier for the bill credit note that is unique to a company in the accounting software.""" + issue_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: + + ``` + 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. + """ + line_items: NotRequired[Nullable[List[BillCreditNoteLineItemTypedDict]]] + r"""An array of line""" + metadata: NotRequired[MetadataTypedDict] + modified_date: NotRequired[str] + note: NotRequired[Nullable[str]] + r"""Any additional information about the bill credit note.""" + payment_allocations: NotRequired[Nullable[List[ItemsTypedDict]]] + r"""An array of payment allocations.""" + remaining_credit: NotRequired[Decimal] + r"""Amount of the bill credit note that is still outstanding.""" + source_modified_date: NotRequired[str] + supplemental_data: NotRequired[SupplementalDataTypedDict] + r"""Supplemental data is additional data you can include in our standard data types. + + It is referenced as a configured dynamic key value pair that is unique to the accounting software. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. + """ + supplier_ref: NotRequired[SupplierRefTypedDict] + r"""Reference to the supplier the record relates to.""" + withholding_tax: NotRequired[Nullable[List[WithholdingTaxItemsTypedDict]]] + + +class BillCreditNote(BaseModel): + r"""> **Bill credit notes or credit notes?** + > + > In Codat, bill credit notes represent accounts payable only. For accounts receivable, see [Credit notes](https://docs.codat.io/sync-for-payables-api#/schemas/CreditNote). + + View the coverage for bill credit notes in the Data coverage explorer. + + ## Overview + + A bill credit note is issued by a supplier for the purpose of recording credit. For example, if a supplier was unable to fulfil an order that was placed by a business, or delivered damaged goods, they would issue a bill credit note. A bill credit note reduces the amount a business owes to the supplier. It can be refunded to the business or used to pay off future bills. + + In the Codat API, a bill credit note is an accounts payable record issued by a [supplier](https://docs.codat.io/sync-for-payables-api#/schemas/Supplier). + + A bill credit note includes details of: + * The original and remaining credit. + * Any allocations of the credit against other records, such as [bills](https://docs.codat.io/sync-for-payables-api#/schemas/Bill). + * The supplier that issued the bill credit note. + """ + + discount_percentage: Annotated[ + Annotated[ + Decimal, + BeforeValidator(validate_decimal), + PlainSerializer(serialize_decimal(False)), + ], + pydantic.Field(alias="discountPercentage"), + ] + r"""Percentage rate of any discount applied to the bill credit note.""" + + status: BillCreditNoteStatus + r"""Current state of the bill credit note""" + + sub_total: Annotated[ + Annotated[ + Decimal, + BeforeValidator(validate_decimal), + PlainSerializer(serialize_decimal(False)), + ], + pydantic.Field(alias="subTotal"), + ] + r"""Total amount of the bill credit note, including discounts but excluding tax.""" + + total_amount: Annotated[ + Annotated[ + Decimal, + BeforeValidator(validate_decimal), + PlainSerializer(serialize_decimal(False)), + ], + pydantic.Field(alias="totalAmount"), + ] + r"""Total amount of credit that has been applied to the business' account with the supplier, including discounts and tax.""" + + total_discount: Annotated[ + Annotated[ + Decimal, + BeforeValidator(validate_decimal), + PlainSerializer(serialize_decimal(False)), + ], + pydantic.Field(alias="totalDiscount"), + ] + r"""Total value of any discounts applied.""" + + total_tax_amount: Annotated[ + Annotated[ + Decimal, + BeforeValidator(validate_decimal), + PlainSerializer(serialize_decimal(False)), + ], + pydantic.Field(alias="totalTaxAmount"), + ] + r"""Amount of tax included in the bill credit note.""" + + allocated_on_date: Annotated[ + Optional[str], pydantic.Field(alias="allocatedOnDate") + ] = 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: + + ``` + 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. + """ + + bill_credit_note_number: Annotated[ + OptionalNullable[str], pydantic.Field(alias="billCreditNoteNumber") + ] = UNSET + r"""Friendly reference for the bill credit note.""" + + created_from_refs: Annotated[ + OptionalNullable[List[RecordReference]], pydantic.Field(alias="createdFromRefs") + ] = UNSET + r"""An array of records the credit note was created from.""" + + currency: Optional[str] = None + r"""The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + + ## Unknown currencies + + In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + + There are only a very small number of edge cases where this currency code is returned by the Codat system. + """ + + currency_rate: Annotated[ + Annotated[ + OptionalNullable[Decimal], + BeforeValidator(validate_decimal), + PlainSerializer(serialize_decimal(False)), + ], + pydantic.Field(alias="currencyRate"), + ] = UNSET + r"""Rate to convert the total amount of the payment into the base currency for the company at the time of the payment. + + Currency rates in Codat are implemented as the multiple of foreign currency units to each base currency unit. + + It is not possible to perform the currency conversion with two or more non-base currencies participating in the transaction. For example, if a company's base currency is USD, and it has a bill issued in EUR, then the bill payment must happen in USD or EUR. + + Where the currency rate is provided by the underlying accounting software, it will be available from Codat with the same precision (up to a maximum of 9 decimal places). + + For accounting software which do not provide an explicit currency rate, it is calculated as `baseCurrency / foreignCurrency` and will be returned to 9 decimal places. + + ## Examples with base currency of GBP + + | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (GBP) | + | :--------------- | :------------- | :------------ | :------------------------- | + | **USD** | $20 | 0.781 | £15.62 | + | **EUR** | €20 | 0.885 | £17.70 | + | **RUB** | ₽20 | 0.011 | £0.22 | + + ## Examples with base currency of USD + + | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (USD) | + | :--------------- | :------------- | :------------ | :------------------------- | + | **GBP** | £20 | 1.277 | $25.54 | + | **EUR** | €20 | 1.134 | $22.68 | + | **RUB** | ₽20 | 0.015 | $0.30 | + + + ### Integration-specific details + + | Integration | Scenario | System behavior | + |-------------------|-------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------| + | QuickBooks Online | Transaction currency differs from base currency | If currency rate value is left `null`, a rate of 1 will be used by QBO by default. To override this, specify a currencyRate in the request body. | + """ + + id: Optional[str] = None + r"""Identifier for the bill credit note that is unique to a company in the accounting software.""" + + issue_date: Annotated[Optional[str], pydantic.Field(alias="issueDate")] = 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: + + ``` + 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. + """ + + line_items: Annotated[ + OptionalNullable[List[BillCreditNoteLineItem]], + pydantic.Field(alias="lineItems"), + ] = UNSET + r"""An array of line""" + + metadata: Optional[Metadata] = None + + modified_date: Annotated[Optional[str], pydantic.Field(alias="modifiedDate")] = None + + note: OptionalNullable[str] = UNSET + r"""Any additional information about the bill credit note.""" + + payment_allocations: Annotated[ + OptionalNullable[List[Items]], pydantic.Field(alias="paymentAllocations") + ] = UNSET + r"""An array of payment allocations.""" + + remaining_credit: Annotated[ + Annotated[ + Optional[Decimal], + BeforeValidator(validate_decimal), + PlainSerializer(serialize_decimal(False)), + ], + pydantic.Field(alias="remainingCredit"), + ] = None + r"""Amount of the bill credit note that is still outstanding.""" + + source_modified_date: Annotated[ + Optional[str], pydantic.Field(alias="sourceModifiedDate") + ] = None + + supplemental_data: Annotated[ + Optional[SupplementalData], pydantic.Field(alias="supplementalData") + ] = None + r"""Supplemental data is additional data you can include in our standard data types. + + It is referenced as a configured dynamic key value pair that is unique to the accounting software. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. + """ + + supplier_ref: Annotated[ + Optional[SupplierRef], pydantic.Field(alias="supplierRef") + ] = None + r"""Reference to the supplier the record relates to.""" + + withholding_tax: Annotated[ + OptionalNullable[List[WithholdingTaxItems]], + pydantic.Field(alias="withholdingTax"), + ] = UNSET + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = [ + "allocatedOnDate", + "billCreditNoteNumber", + "createdFromRefs", + "currency", + "currencyRate", + "id", + "issueDate", + "lineItems", + "metadata", + "modifiedDate", + "note", + "paymentAllocations", + "remainingCredit", + "sourceModifiedDate", + "supplementalData", + "supplierRef", + "withholdingTax", + ] + nullable_fields = [ + "billCreditNoteNumber", + "createdFromRefs", + "currencyRate", + "lineItems", + "note", + "paymentAllocations", + "withholdingTax", + ] + null_default_fields = [] + + serialized = handler(self) + + m = {} + + for n, f in self.model_fields.items(): + k = f.alias or n + val = serialized.get(k) + serialized.pop(k, None) + + optional_nullable = k in optional_fields and k in nullable_fields + is_set = ( + self.__pydantic_fields_set__.intersection({n}) + or k in null_default_fields + ) # pylint: disable=no-member + + if val is not None and val != UNSET_SENTINEL: + m[k] = val + elif val != UNSET_SENTINEL and ( + not k in optional_fields or (optional_nullable and is_set) + ): + m[k] = val + + return m diff --git a/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/billcreditnotelineitem.py b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/billcreditnotelineitem.py new file mode 100644 index 000000000..b47177d9b --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/billcreditnotelineitem.py @@ -0,0 +1,418 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .accountref import AccountRef, AccountRefTypedDict +from .billedtotype import BilledToType +from .taxrateref import TaxRateRef, TaxRateRefTypedDict +from .trackingcategoryref import TrackingCategoryRef, TrackingCategoryRefTypedDict +from .zero import Zero, ZeroTypedDict +from codat_sync_for_payables_version_1.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from codat_sync_for_payables_version_1.utils import serialize_decimal, validate_decimal +from decimal import Decimal +import pydantic +from pydantic import model_serializer +from pydantic.functional_serializers import PlainSerializer +from pydantic.functional_validators import BeforeValidator +from typing import List, Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class ItemReferenceTypedDict(TypedDict): + r"""Reference to the item the line is linked to.""" + + id: str + r"""Unique identifier for the item in the accounting software.""" + name: NotRequired[Nullable[str]] + r"""Name of the item in the accounting software.""" + + +class ItemReference(BaseModel): + r"""Reference to the item the line is linked to.""" + + id: str + r"""Unique identifier for the item in the accounting software.""" + + name: OptionalNullable[str] = UNSET + r"""Name of the item in the accounting software.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = ["name"] + nullable_fields = ["name"] + null_default_fields = [] + + serialized = handler(self) + + m = {} + + for n, f in self.model_fields.items(): + k = f.alias or n + val = serialized.get(k) + serialized.pop(k, None) + + optional_nullable = k in optional_fields and k in nullable_fields + is_set = ( + self.__pydantic_fields_set__.intersection({n}) + or k in null_default_fields + ) # pylint: disable=no-member + + if val is not None and val != UNSET_SENTINEL: + m[k] = val + elif val != UNSET_SENTINEL and ( + not k in optional_fields or (optional_nullable and is_set) + ): + m[k] = val + + return m + + +class BillCreditNoteLineItemCustomerRefTypedDict(TypedDict): + id: str + r"""`id` from the Customers data type""" + company_name: NotRequired[Nullable[str]] + r"""`customerName` from the Customer data type""" + + +class BillCreditNoteLineItemCustomerRef(BaseModel): + id: str + r"""`id` from the Customers data type""" + + company_name: Annotated[ + OptionalNullable[str], pydantic.Field(alias="companyName") + ] = UNSET + r"""`customerName` from the Customer data type""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = ["companyName"] + nullable_fields = ["companyName"] + null_default_fields = [] + + serialized = handler(self) + + m = {} + + for n, f in self.model_fields.items(): + k = f.alias or n + val = serialized.get(k) + serialized.pop(k, None) + + optional_nullable = k in optional_fields and k in nullable_fields + is_set = ( + self.__pydantic_fields_set__.intersection({n}) + or k in null_default_fields + ) # pylint: disable=no-member + + if val is not None and val != UNSET_SENTINEL: + m[k] = val + elif val != UNSET_SENTINEL and ( + not k in optional_fields or (optional_nullable and is_set) + ): + m[k] = val + + return m + + +class BillCreditNoteLineItemAccountingProjectReferenceTypedDict(TypedDict): + id: str + r"""Unique identifier to the project reference.""" + name: NotRequired[Nullable[str]] + r"""The project's name.""" + + +class BillCreditNoteLineItemAccountingProjectReference(BaseModel): + id: str + r"""Unique identifier to the project reference.""" + + name: OptionalNullable[str] = UNSET + r"""The project's name.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = ["name"] + nullable_fields = ["name"] + null_default_fields = [] + + serialized = handler(self) + + m = {} + + for n, f in self.model_fields.items(): + k = f.alias or n + val = serialized.get(k) + serialized.pop(k, None) + + optional_nullable = k in optional_fields and k in nullable_fields + is_set = ( + self.__pydantic_fields_set__.intersection({n}) + or k in null_default_fields + ) # pylint: disable=no-member + + if val is not None and val != UNSET_SENTINEL: + m[k] = val + elif val != UNSET_SENTINEL and ( + not k in optional_fields or (optional_nullable and is_set) + ): + m[k] = val + + return m + + +class BillCreditNoteLineItemTrackingTypedDict(TypedDict): + r"""Categories, and a project and customer, against which the item is tracked.""" + + category_refs: List[TrackingCategoryRefTypedDict] + is_billed_to: BilledToType + r"""Defines if the invoice or credit note is billed/rebilled to a project or customer.""" + is_rebilled_to: BilledToType + r"""Defines if the invoice or credit note is billed/rebilled to a project or customer.""" + customer_ref: NotRequired[BillCreditNoteLineItemCustomerRefTypedDict] + project_ref: NotRequired[BillCreditNoteLineItemAccountingProjectReferenceTypedDict] + + +class BillCreditNoteLineItemTracking(BaseModel): + r"""Categories, and a project and customer, against which the item is tracked.""" + + category_refs: Annotated[ + List[TrackingCategoryRef], pydantic.Field(alias="categoryRefs") + ] + + is_billed_to: Annotated[BilledToType, pydantic.Field(alias="isBilledTo")] + r"""Defines if the invoice or credit note is billed/rebilled to a project or customer.""" + + is_rebilled_to: Annotated[BilledToType, pydantic.Field(alias="isRebilledTo")] + r"""Defines if the invoice or credit note is billed/rebilled to a project or customer.""" + + customer_ref: Annotated[ + Optional[BillCreditNoteLineItemCustomerRef], pydantic.Field(alias="customerRef") + ] = None + + project_ref: Annotated[ + Optional[BillCreditNoteLineItemAccountingProjectReference], + pydantic.Field(alias="projectRef"), + ] = None + + +class BillCreditNoteLineItemTypedDict(TypedDict): + quantity: Decimal + r"""Number of units of the goods or service for which credit has been received.""" + unit_amount: Decimal + r"""Unit price of the goods or service.""" + account_ref: NotRequired[AccountRefTypedDict] + r"""Data types that reference an account, for example bill and invoice line items, use an accountRef that includes the ID and name of the linked account.""" + created_from_line_ref: NotRequired[ZeroTypedDict] + r"""Links the current record line to the underlying record line that created it. + + For example, if a bill is generated from a purchase order, this property allows you to connect the bill line item to the purchase order line item in our data model. + """ + description: NotRequired[Nullable[str]] + r"""Friendly name of each line item. For example, the goods or service for which credit has been received.""" + discount_amount: NotRequired[Nullable[Decimal]] + r"""Value of any discounts applied.""" + discount_percentage: NotRequired[Nullable[Decimal]] + r"""Percentage rate of any discount applied to the line item.""" + item_ref: NotRequired[ItemReferenceTypedDict] + r"""Reference to the item the line is linked to.""" + sub_total: NotRequired[Nullable[Decimal]] + r"""Amount of credit associated with the line item, including discounts but excluding tax.""" + tax_amount: NotRequired[Nullable[Decimal]] + r"""Amount of tax associated with the line item.""" + tax_rate_ref: NotRequired[TaxRateRefTypedDict] + r"""Data types that reference a tax rate, for example invoice and bill line items, use a taxRateRef that includes the ID and name of the linked tax rate. + + Found on: + + - Bill line items + - Bill Credit Note line items + - Credit Note line items + - Direct incomes line items + - Invoice line items + - Items + """ + total_amount: NotRequired[Nullable[Decimal]] + r"""Total amount of the line item, including discounts and tax.""" + tracking: NotRequired[BillCreditNoteLineItemTrackingTypedDict] + r"""Categories, and a project and customer, against which the item is tracked.""" + tracking_category_refs: NotRequired[Nullable[List[TrackingCategoryRefTypedDict]]] + r"""Reference to the tracking categories to which the line item is linked.""" + unit_of_measurement: NotRequired[Nullable[str]] + r"""The measurement which defines a unit for this item (e.g. 'kilogram', 'litre').""" + + +class BillCreditNoteLineItem(BaseModel): + quantity: Annotated[ + Decimal, + BeforeValidator(validate_decimal), + PlainSerializer(serialize_decimal(False)), + ] + r"""Number of units of the goods or service for which credit has been received.""" + + unit_amount: Annotated[ + Annotated[ + Decimal, + BeforeValidator(validate_decimal), + PlainSerializer(serialize_decimal(False)), + ], + pydantic.Field(alias="unitAmount"), + ] + r"""Unit price of the goods or service.""" + + account_ref: Annotated[Optional[AccountRef], pydantic.Field(alias="accountRef")] = ( + None + ) + r"""Data types that reference an account, for example bill and invoice line items, use an accountRef that includes the ID and name of the linked account.""" + + created_from_line_ref: Annotated[ + Optional[Zero], pydantic.Field(alias="createdFromLineRef") + ] = None + r"""Links the current record line to the underlying record line that created it. + + For example, if a bill is generated from a purchase order, this property allows you to connect the bill line item to the purchase order line item in our data model. + """ + + description: OptionalNullable[str] = UNSET + r"""Friendly name of each line item. For example, the goods or service for which credit has been received.""" + + discount_amount: Annotated[ + Annotated[ + OptionalNullable[Decimal], + BeforeValidator(validate_decimal), + PlainSerializer(serialize_decimal(False)), + ], + pydantic.Field(alias="discountAmount"), + ] = UNSET + r"""Value of any discounts applied.""" + + discount_percentage: Annotated[ + Annotated[ + OptionalNullable[Decimal], + BeforeValidator(validate_decimal), + PlainSerializer(serialize_decimal(False)), + ], + pydantic.Field(alias="discountPercentage"), + ] = UNSET + r"""Percentage rate of any discount applied to the line item.""" + + item_ref: Annotated[Optional[ItemReference], pydantic.Field(alias="itemRef")] = None + r"""Reference to the item the line is linked to.""" + + sub_total: Annotated[ + Annotated[ + OptionalNullable[Decimal], + BeforeValidator(validate_decimal), + PlainSerializer(serialize_decimal(False)), + ], + pydantic.Field(alias="subTotal"), + ] = UNSET + r"""Amount of credit associated with the line item, including discounts but excluding tax.""" + + tax_amount: Annotated[ + Annotated[ + OptionalNullable[Decimal], + BeforeValidator(validate_decimal), + PlainSerializer(serialize_decimal(False)), + ], + pydantic.Field(alias="taxAmount"), + ] = UNSET + r"""Amount of tax associated with the line item.""" + + tax_rate_ref: Annotated[ + Optional[TaxRateRef], pydantic.Field(alias="taxRateRef") + ] = None + r"""Data types that reference a tax rate, for example invoice and bill line items, use a taxRateRef that includes the ID and name of the linked tax rate. + + Found on: + + - Bill line items + - Bill Credit Note line items + - Credit Note line items + - Direct incomes line items + - Invoice line items + - Items + """ + + total_amount: Annotated[ + Annotated[ + OptionalNullable[Decimal], + BeforeValidator(validate_decimal), + PlainSerializer(serialize_decimal(False)), + ], + pydantic.Field(alias="totalAmount"), + ] = UNSET + r"""Total amount of the line item, including discounts and tax.""" + + tracking: Optional[BillCreditNoteLineItemTracking] = None + r"""Categories, and a project and customer, against which the item is tracked.""" + + tracking_category_refs: Annotated[ + OptionalNullable[List[TrackingCategoryRef]], + pydantic.Field( + deprecated="warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible.", + alias="trackingCategoryRefs", + ), + ] = UNSET + r"""Reference to the tracking categories to which the line item is linked.""" + + unit_of_measurement: Annotated[ + OptionalNullable[str], pydantic.Field(alias="unitOfMeasurement") + ] = UNSET + r"""The measurement which defines a unit for this item (e.g. 'kilogram', 'litre').""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = [ + "accountRef", + "createdFromLineRef", + "description", + "discountAmount", + "discountPercentage", + "itemRef", + "subTotal", + "taxAmount", + "taxRateRef", + "totalAmount", + "tracking", + "trackingCategoryRefs", + "unitOfMeasurement", + ] + nullable_fields = [ + "description", + "discountAmount", + "discountPercentage", + "subTotal", + "taxAmount", + "totalAmount", + "trackingCategoryRefs", + "unitOfMeasurement", + ] + null_default_fields = [] + + serialized = handler(self) + + m = {} + + for n, f in self.model_fields.items(): + k = f.alias or n + val = serialized.get(k) + serialized.pop(k, None) + + optional_nullable = k in optional_fields and k in nullable_fields + is_set = ( + self.__pydantic_fields_set__.intersection({n}) + or k in null_default_fields + ) # pylint: disable=no-member + + if val is not None and val != UNSET_SENTINEL: + m[k] = val + elif val != UNSET_SENTINEL and ( + not k in optional_fields or (optional_nullable and is_set) + ): + m[k] = val + + return m diff --git a/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/billcreditnotes.py b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/billcreditnotes.py new file mode 100644 index 000000000..440ea339a --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/billcreditnotes.py @@ -0,0 +1,35 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .billcreditnote import BillCreditNote, BillCreditNoteTypedDict +from .links import Links, LinksTypedDict +from codat_sync_for_payables_version_1.types import BaseModel +import pydantic +from typing import List, Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class BillCreditNotesTypedDict(TypedDict): + links: LinksTypedDict + page_number: int + r"""Current page number.""" + page_size: int + r"""Number of items to return in results array.""" + total_results: int + r"""Total number of items.""" + results: NotRequired[List[BillCreditNoteTypedDict]] + + +class BillCreditNotes(BaseModel): + links: Annotated[Links, pydantic.Field(alias="_links")] + + page_number: Annotated[int, pydantic.Field(alias="pageNumber")] + r"""Current page number.""" + + page_size: Annotated[int, pydantic.Field(alias="pageSize")] + r"""Number of items to return in results array.""" + + total_results: Annotated[int, pydantic.Field(alias="totalResults")] + r"""Total number of items.""" + + results: Optional[List[BillCreditNote]] = None diff --git a/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/billcreditnotestatus.py b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/billcreditnotestatus.py new file mode 100644 index 000000000..271203f0e --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/billcreditnotestatus.py @@ -0,0 +1,15 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from enum import Enum + + +class BillCreditNoteStatus(str, Enum): + r"""Current state of the bill credit note""" + + UNKNOWN = "Unknown" + DRAFT = "Draft" + SUBMITTED = "Submitted" + PAID = "Paid" + VOID = "Void" + PARTIALLY_PAID = "PartiallyPaid" diff --git a/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/billedtotype.py b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/billedtotype.py new file mode 100644 index 000000000..d5c914d9e --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/billedtotype.py @@ -0,0 +1,13 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from enum import Enum + + +class BilledToType(str, Enum): + r"""Defines if the invoice or credit note is billed/rebilled to a project or customer.""" + + UNKNOWN = "Unknown" + NOT_APPLICABLE = "NotApplicable" + CUSTOMER = "Customer" + PROJECT = "Project" diff --git a/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/billlineitem.py b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/billlineitem.py new file mode 100644 index 000000000..70bc02efc --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/billlineitem.py @@ -0,0 +1,288 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .accountref import AccountRef, AccountRefTypedDict +from .itemref import ItemRef, ItemRefTypedDict +from .taxrateref import TaxRateRef, TaxRateRefTypedDict +from .tracking import Tracking, TrackingTypedDict +from .trackingcategoryref import TrackingCategoryRef, TrackingCategoryRefTypedDict +from codat_sync_for_payables_version_1.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from codat_sync_for_payables_version_1.utils import serialize_decimal, validate_decimal +from decimal import Decimal +from enum import Enum +import pydantic +from pydantic import model_serializer +from pydantic.functional_serializers import PlainSerializer +from pydantic.functional_validators import BeforeValidator +from typing import List, Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class BillLineItemDataType(str, Enum): + r"""Allowed name of the 'dataType'.""" + + PURCHASE_ORDERS = "purchaseOrders" + BILLS = "bills" + + +class RecordLineReferenceTypedDict(TypedDict): + r"""Reference to the purchase order line this line was generated from.""" + + data_type: NotRequired[BillLineItemDataType] + r"""Allowed name of the 'dataType'.""" + id: NotRequired[str] + r"""'id' of the underlying record.""" + line_number: NotRequired[str] + r"""Line number of the underlying record.""" + + +class RecordLineReference(BaseModel): + r"""Reference to the purchase order line this line was generated from.""" + + data_type: Annotated[ + Optional[BillLineItemDataType], pydantic.Field(alias="dataType") + ] = None + r"""Allowed name of the 'dataType'.""" + + id: Optional[str] = None + r"""'id' of the underlying record.""" + + line_number: Annotated[Optional[str], pydantic.Field(alias="lineNumber")] = None + r"""Line number of the underlying record.""" + + +class BillLineItemTypedDict(TypedDict): + quantity: Decimal + r"""Number of units of goods or services received.""" + unit_amount: Decimal + r"""Price of each unit of goods or services.""" + account_ref: NotRequired[AccountRefTypedDict] + r"""Data types that reference an account, for example bill and invoice line items, use an accountRef that includes the ID and name of the linked account.""" + description: NotRequired[Nullable[str]] + r"""Friendly name of the goods or services received.""" + discount_amount: NotRequired[Nullable[Decimal]] + r"""Numerical value of any discounts applied. + + Do not use to apply discounts in Oracle NetSuite—see Oracle NetSuite integration reference. + """ + discount_percentage: NotRequired[Nullable[Decimal]] + r"""Percentage rate of any discount applied to the bill.""" + is_direct_cost: NotRequired[bool] + r"""The bill is a direct cost if `True`.""" + item_ref: NotRequired[ItemRefTypedDict] + r"""Reference to the item the line is linked to.""" + line_number: NotRequired[Nullable[str]] + r"""The bill line's number.""" + purchase_order_line_ref: NotRequired[RecordLineReferenceTypedDict] + sub_total: NotRequired[Nullable[Decimal]] + r"""Amount of the line, inclusive of discounts but exclusive of tax.""" + tax_amount: NotRequired[Nullable[Decimal]] + r"""Amount of tax for the line.""" + tax_rate_ref: NotRequired[TaxRateRefTypedDict] + r"""Data types that reference a tax rate, for example invoice and bill line items, use a taxRateRef that includes the ID and name of the linked tax rate. + + Found on: + + - Bill line items + - Bill Credit Note line items + - Credit Note line items + - Direct incomes line items + - Invoice line items + - Items + """ + total_amount: NotRequired[Nullable[Decimal]] + r"""Total amount of the line, including tax.""" + tracking: NotRequired[TrackingTypedDict] + r"""Categories, and a project and customer, against which the item is tracked.""" + tracking_category_refs: NotRequired[Nullable[List[TrackingCategoryRefTypedDict]]] + r"""Collection of categories against which this item is tracked.""" + unit_of_measurement: NotRequired[Nullable[str]] + r"""The measurement which defines a unit for this item (e.g. 'kilogram', 'litre').""" + + +class BillLineItem(BaseModel): + quantity: Annotated[ + Decimal, + BeforeValidator(validate_decimal), + PlainSerializer(serialize_decimal(False)), + ] + r"""Number of units of goods or services received.""" + + unit_amount: Annotated[ + Annotated[ + Decimal, + BeforeValidator(validate_decimal), + PlainSerializer(serialize_decimal(False)), + ], + pydantic.Field(alias="unitAmount"), + ] + r"""Price of each unit of goods or services.""" + + account_ref: Annotated[Optional[AccountRef], pydantic.Field(alias="accountRef")] = ( + None + ) + r"""Data types that reference an account, for example bill and invoice line items, use an accountRef that includes the ID and name of the linked account.""" + + description: OptionalNullable[str] = UNSET + r"""Friendly name of the goods or services received.""" + + discount_amount: Annotated[ + Annotated[ + OptionalNullable[Decimal], + BeforeValidator(validate_decimal), + PlainSerializer(serialize_decimal(False)), + ], + pydantic.Field(alias="discountAmount"), + ] = UNSET + r"""Numerical value of any discounts applied. + + Do not use to apply discounts in Oracle NetSuite—see Oracle NetSuite integration reference. + """ + + discount_percentage: Annotated[ + Annotated[ + OptionalNullable[Decimal], + BeforeValidator(validate_decimal), + PlainSerializer(serialize_decimal(False)), + ], + pydantic.Field(alias="discountPercentage"), + ] = UNSET + r"""Percentage rate of any discount applied to the bill.""" + + is_direct_cost: Annotated[Optional[bool], pydantic.Field(alias="isDirectCost")] = ( + None + ) + r"""The bill is a direct cost if `True`.""" + + item_ref: Annotated[Optional[ItemRef], pydantic.Field(alias="itemRef")] = None + r"""Reference to the item the line is linked to.""" + + line_number: Annotated[ + OptionalNullable[str], pydantic.Field(alias="lineNumber") + ] = UNSET + r"""The bill line's number.""" + + purchase_order_line_ref: Annotated[ + Optional[RecordLineReference], pydantic.Field(alias="purchaseOrderLineRef") + ] = None + + sub_total: Annotated[ + Annotated[ + OptionalNullable[Decimal], + BeforeValidator(validate_decimal), + PlainSerializer(serialize_decimal(False)), + ], + pydantic.Field(alias="subTotal"), + ] = UNSET + r"""Amount of the line, inclusive of discounts but exclusive of tax.""" + + tax_amount: Annotated[ + Annotated[ + OptionalNullable[Decimal], + BeforeValidator(validate_decimal), + PlainSerializer(serialize_decimal(False)), + ], + pydantic.Field(alias="taxAmount"), + ] = UNSET + r"""Amount of tax for the line.""" + + tax_rate_ref: Annotated[ + Optional[TaxRateRef], pydantic.Field(alias="taxRateRef") + ] = None + r"""Data types that reference a tax rate, for example invoice and bill line items, use a taxRateRef that includes the ID and name of the linked tax rate. + + Found on: + + - Bill line items + - Bill Credit Note line items + - Credit Note line items + - Direct incomes line items + - Invoice line items + - Items + """ + + total_amount: Annotated[ + Annotated[ + OptionalNullable[Decimal], + BeforeValidator(validate_decimal), + PlainSerializer(serialize_decimal(False)), + ], + pydantic.Field(alias="totalAmount"), + ] = UNSET + r"""Total amount of the line, including tax.""" + + tracking: Optional[Tracking] = None + r"""Categories, and a project and customer, against which the item is tracked.""" + + tracking_category_refs: Annotated[ + OptionalNullable[List[TrackingCategoryRef]], + pydantic.Field(alias="trackingCategoryRefs"), + ] = UNSET + r"""Collection of categories against which this item is tracked.""" + + unit_of_measurement: Annotated[ + OptionalNullable[str], pydantic.Field(alias="unitOfMeasurement") + ] = UNSET + r"""The measurement which defines a unit for this item (e.g. 'kilogram', 'litre').""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = [ + "accountRef", + "description", + "discountAmount", + "discountPercentage", + "isDirectCost", + "itemRef", + "lineNumber", + "purchaseOrderLineRef", + "subTotal", + "taxAmount", + "taxRateRef", + "totalAmount", + "tracking", + "trackingCategoryRefs", + "unitOfMeasurement", + ] + nullable_fields = [ + "description", + "discountAmount", + "discountPercentage", + "lineNumber", + "subTotal", + "taxAmount", + "totalAmount", + "trackingCategoryRefs", + "unitOfMeasurement", + ] + null_default_fields = [] + + serialized = handler(self) + + m = {} + + for n, f in self.model_fields.items(): + k = f.alias or n + val = serialized.get(k) + serialized.pop(k, None) + + optional_nullable = k in optional_fields and k in nullable_fields + is_set = ( + self.__pydantic_fields_set__.intersection({n}) + or k in null_default_fields + ) # pylint: disable=no-member + + if val is not None and val != UNSET_SENTINEL: + m[k] = val + elif val != UNSET_SENTINEL and ( + not k in optional_fields or (optional_nullable and is_set) + ): + m[k] = val + + return m diff --git a/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/billpayment.py b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/billpayment.py new file mode 100644 index 000000000..6ad5d7653 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/billpayment.py @@ -0,0 +1,535 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .accountref import AccountRef, AccountRefTypedDict +from .billpaymentline import BillPaymentLine, BillPaymentLineTypedDict +from .metadata import Metadata, MetadataTypedDict +from .paymentmethodref import PaymentMethodRef, PaymentMethodRefTypedDict +from .supplementaldata import SupplementalData, SupplementalDataTypedDict +from .supplierref import SupplierRef, SupplierRefTypedDict +from codat_sync_for_payables_version_1.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from codat_sync_for_payables_version_1.utils import serialize_decimal, validate_decimal +from decimal import Decimal +import pydantic +from pydantic import model_serializer +from pydantic.functional_serializers import PlainSerializer +from pydantic.functional_validators import BeforeValidator +from typing import List, Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class BillPaymentTypedDict(TypedDict): + r"""> **Bill payments or payments?** + > + > We distinguish between transactions where the company received money vs. paid money. If the transaction represents a company spending money (accounts payable) we call this a Bill payment. + > + > See [payments](https://docs.codat.io/sync-for-payables-api#/schemas/Payment) for the accounts receivable equivalent of Bill payments, which covers [invoices](https://docs.codat.io/sync-for-payables-api#/schemas/Invoice) and [credit notes](https://docs.codat.io/sync-for-payables-api#/schemas/CreditNote). + + > View the coverage for bill payments in the Data coverage explorer. + + ## Overview + + Bill payments include all accounts payable transaction data ([bills](https://docs.codat.io/sync-for-payables-api#/schemas/Bill) and [credit notes against bills](https://docs.codat.io/sync-for-payables-api#/schemas/BillCreditNote)). + + A bill payment in Codat usually represents an allocation of money within any customer accounts payable account. This includes, but is not strictly limited to: + + - A payment made against a bill — for example, a credit card payment, cheque payment, or cash payment. + - An allocation of a supplier's credit note to a bill or perhaps a refund. + - A bill payment made directly to an accounts payable account. This could be an overpayment or a prepayment, or a refund of a payment made directly to an accounts payable account. + + Depending on the bill payments which are allowed by the underlying accounting software, some of these types may be combined. Please see the example data section for samples of what these cases look like. + + In Codat, a bill payment contains details of: + + - When the bill payment was recorded in the accounting system. + - How much it is for and in the currency. + - Who the payment has been paid to, the _supplier_. + - The types of bill payments, the _line items_. + + Some accounting software give a separate name to purchases where the payment is made immediately, such as something bought with a credit card or online payment. One example of this would be QuickBooks Online's _expenses_. You can find these types of transactions in our [Direct costs](https://docs.codat.io/sync-for-payables-api#/schemas/DirectCost) data model. + + Bill payments is a child data type of [account transactions](https://docs.codat.io/sync-for-payables-api#/schemas/AccountTransaction). + + --- + + ## Bill payment types + + ### Payment of a bill + + A payment paying a single bill should have the following properties: + + - A `totalAmount` indicating the amount of the bill that was paid. This is always positive. + - A `lines` array containing one element with the following properties: + - An `amount` equal to the `totalAmount` above. + - A `links` array containing one element with the following properties: + - A `type` indicating the type of link, in this case a `Bill`. + - An `id` containing the ID of the bill that was paid. + - An amount of `-totalAmount` (negative `totalAmount`), indicating that the entirety of the paid amount is allocated to the bill. + + ### Payment of multiple bills + + It is possible for one payment to pay multiple bills. This can be represented using two possible formats, depending on how the supplier keeps their books: + + 1. The payment has multiple entries in its **lines** array, one for each bill that is paid. Each line will follow the above example for paying a bill, and the rules detailed in the data model. + 2. The payment has a line with multiple links to each bill. This occurs when the proportion of the original payment allocated to each bill is not available. + + Each line is the same as those described above, with the **amount** indicating how much of the payment is allocated to the bill. The **amount** on the lines sum to the **totalAmount** on the payment. + + > Pushing batch payments to Xero + > + > When pushing a single bill payment to Xero to pay multiple bills, only the first format is supported—multiple entries in the payment **lines** array. + + ### Payments and refunds on account + + A payment on account, that is a payment that doesn’t pay a specific bill, has one entry in its lines array. + + The line has the following properties: + + - A **totalAmount** indicating the amount paid by a supplier or refunded to them by a company. A payment to the supplier is always negative. A refund is always positive. + - A **links** array containing one element with the following properties: + - A **type** indicating the type of link. For a payment this is `PaymentOnAccount`. For a refund this is `Refund`. + - The **id** containing the ID of the supplier. + - An amount for the link is `0` **totalAmount** or the amount of the payment or refund. + + It is possible to have a payment that is part on account and part allocated to a bill. Each line should follow the examples above. + + ### Using a credit note to pay a bill + + The payment of a bill using a credit note has one entry in its `lines` array. This **line** has the following properties: + + - An **amount** indicating the amount of money moved, which in this case is `0`, as the credit note and bill allocation must balance each other. + - A **links** array containing two elements: + - The first link has: + - A **type** indicating the type of link, in this case a `Bill`. + - An **id** containing the ID of the bill that was paid. + - The second link has: + - A **type** indicating the type of link, in this case a `CreditNote`. + - An **id** containing the ID of the credit note used by this payment. + + The **amount** field on the **line** equals the **totalAmount** on the payment. + + ### Refunding a credit note + + A bill payment refunding a credit note has one entry in its **lines** array. This line has the following properties: + + - An **amount** indicating the amount of the credit note that was refunded. This is always negative, indicating that it is a refund. + - A **links** array containing one element with the following properties: + - A **type** indicating the type of `link`, in this case a `CreditNote`. + - An **id** containing the ID of the credit note that was refunded. + + The **totalAmount** field on the payment equals the line's **amount** field. These are both negative, as this is money leaving accounts payable. + + ### Refunding a payment + + If a payment is refunded, for example, when a company overpaid a bill and the overpayment is returned, there are two payment records: + + - One for the incoming overpayment. + - Another for the outgoing refund. + + The payment issuing the refund is identified by the fact that the **totalAmount** is negative. This payment has one entry in its lines array that have the following properties: + + - An **amount** indicating the amount that was refunded. This is always negative. + - A **links** array containing one element with the following properties: + - A **type** indicating the type of a the link, in this case a `BillPayment`. + - An **id** containing the ID of the payment that was refunded. + + The **amount** field on the line equals the **totalAmount** on the payment and is negative as this is money leaving accounts payable. + + The payment that was refunded can be identified as it has a line where the `amount` on its `line` is positive and the type of the link is `Refund`. This payment may have several entries in its **lines** array if it was partly used to pay an bill. For example, a £1,050 payment paying a £1,000 bill with a refund of £50 has two lines: + + - One for £1,000 linked to the bill that was paid + - Another for £50 linked to the payment that refunded the over payment. This link is of type `Refund` but the ID corresponds to a bill payment. + + The line linked to the bill payment has the following properties: + + - An **amount** indicating the amount that was refunded. This is positive as its money that was added to accounts payable, but is balanced out by the negative amount of the refund. + - A **links** array containing one element with the following properties: + - A **type** indicating the type of the link, in this case a `Refund`. + - An **id** containing the ID of the payment that refunded this line. + + > Linked payments + > + > Not all accounting software support linked payments in this way. In these platforms you may see a payment on account and a refund on account. + + ## Foreign currencies + + There are two types of currency rate that are detailed in the bill payments data type: + + Payment currency rate: + + - Base currency of the accounts payable account. + - Foreign currency of the bill payment. + + Payment line link currency rate: + + - Base currency of the item that the link represents. + - Foreign currency of the payment. + + These two rates allow the calculation of currency loss or gain for any of the transactions affected by the payment lines. The second rate is used when a bill payment is applied to an item in a currency that does not match either: + + - The base currency for the accounts payable account. + - The currency of the item. + + """ + + date_: str + account_ref: NotRequired[AccountRefTypedDict] + r"""Data types that reference an account, for example bill and invoice line items, use an accountRef that includes the ID and name of the linked account.""" + currency: NotRequired[str] + currency_rate: NotRequired[Nullable[Decimal]] + r"""Rate to convert the total amount of the payment into the base currency for the company at the time of the payment. + + Currency rates in Codat are implemented as the multiple of foreign currency units to each base currency unit. + + It is not possible to perform the currency conversion with two or more non-base currencies participating in the transaction. For example, if a company's base currency is USD, and it has a bill issued in EUR, then the bill payment must happen in USD or EUR. + + Where the currency rate is provided by the underlying accounting software, it will be available from Codat with the same precision (up to a maximum of 9 decimal places). + + For accounting software which do not provide an explicit currency rate, it is calculated as `baseCurrency / foreignCurrency` and will be returned to 9 decimal places. + + ## Examples with base currency of GBP + + | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (GBP) | + | :--------------- | :------------- | :------------ | :------------------------- | + | **USD** | $20 | 0.781 | £15.62 | + | **EUR** | €20 | 0.885 | £17.70 | + | **RUB** | ₽20 | 0.011 | £0.22 | + + ## Examples with base currency of USD + + | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (USD) | + | :--------------- | :------------- | :------------ | :------------------------- | + | **GBP** | £20 | 1.277 | $25.54 | + | **EUR** | €20 | 1.134 | $22.68 | + | **RUB** | ₽20 | 0.015 | $0.30 | + + + ### Integration-specific details + + | Integration | Scenario | System behavior | + |-------------------|-------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------| + | QuickBooks Online | Transaction currency differs from base currency | If currency rate value is left `null`, a rate of 1 will be used by QBO by default. To override this, specify a currencyRate in the request body. | + """ + id: NotRequired[str] + r"""Identifier for the bill payment, unique for the company in the accounting software.""" + lines: NotRequired[Nullable[List[BillPaymentLineTypedDict]]] + r"""An array of bill payment lines.""" + metadata: NotRequired[MetadataTypedDict] + modified_date: NotRequired[str] + note: NotRequired[Nullable[str]] + r"""Additional information associated with the payment.""" + payment_method_ref: NotRequired[PaymentMethodRefTypedDict] + reference: NotRequired[Nullable[str]] + r"""Additional information associated with the payment.""" + source_modified_date: NotRequired[str] + supplemental_data: NotRequired[SupplementalDataTypedDict] + r"""Supplemental data is additional data you can include in our standard data types. + + It is referenced as a configured dynamic key value pair that is unique to the accounting software. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. + """ + supplier_ref: NotRequired[SupplierRefTypedDict] + total_amount: NotRequired[Decimal] + r"""Amount of the payment in the payment currency. This value never changes and represents the amount of money that is paid into the supplier's account.""" + + +class BillPayment(BaseModel): + r"""> **Bill payments or payments?** + > + > We distinguish between transactions where the company received money vs. paid money. If the transaction represents a company spending money (accounts payable) we call this a Bill payment. + > + > See [payments](https://docs.codat.io/sync-for-payables-api#/schemas/Payment) for the accounts receivable equivalent of Bill payments, which covers [invoices](https://docs.codat.io/sync-for-payables-api#/schemas/Invoice) and [credit notes](https://docs.codat.io/sync-for-payables-api#/schemas/CreditNote). + + > View the coverage for bill payments in the Data coverage explorer. + + ## Overview + + Bill payments include all accounts payable transaction data ([bills](https://docs.codat.io/sync-for-payables-api#/schemas/Bill) and [credit notes against bills](https://docs.codat.io/sync-for-payables-api#/schemas/BillCreditNote)). + + A bill payment in Codat usually represents an allocation of money within any customer accounts payable account. This includes, but is not strictly limited to: + + - A payment made against a bill — for example, a credit card payment, cheque payment, or cash payment. + - An allocation of a supplier's credit note to a bill or perhaps a refund. + - A bill payment made directly to an accounts payable account. This could be an overpayment or a prepayment, or a refund of a payment made directly to an accounts payable account. + + Depending on the bill payments which are allowed by the underlying accounting software, some of these types may be combined. Please see the example data section for samples of what these cases look like. + + In Codat, a bill payment contains details of: + + - When the bill payment was recorded in the accounting system. + - How much it is for and in the currency. + - Who the payment has been paid to, the _supplier_. + - The types of bill payments, the _line items_. + + Some accounting software give a separate name to purchases where the payment is made immediately, such as something bought with a credit card or online payment. One example of this would be QuickBooks Online's _expenses_. You can find these types of transactions in our [Direct costs](https://docs.codat.io/sync-for-payables-api#/schemas/DirectCost) data model. + + Bill payments is a child data type of [account transactions](https://docs.codat.io/sync-for-payables-api#/schemas/AccountTransaction). + + --- + + ## Bill payment types + + ### Payment of a bill + + A payment paying a single bill should have the following properties: + + - A `totalAmount` indicating the amount of the bill that was paid. This is always positive. + - A `lines` array containing one element with the following properties: + - An `amount` equal to the `totalAmount` above. + - A `links` array containing one element with the following properties: + - A `type` indicating the type of link, in this case a `Bill`. + - An `id` containing the ID of the bill that was paid. + - An amount of `-totalAmount` (negative `totalAmount`), indicating that the entirety of the paid amount is allocated to the bill. + + ### Payment of multiple bills + + It is possible for one payment to pay multiple bills. This can be represented using two possible formats, depending on how the supplier keeps their books: + + 1. The payment has multiple entries in its **lines** array, one for each bill that is paid. Each line will follow the above example for paying a bill, and the rules detailed in the data model. + 2. The payment has a line with multiple links to each bill. This occurs when the proportion of the original payment allocated to each bill is not available. + + Each line is the same as those described above, with the **amount** indicating how much of the payment is allocated to the bill. The **amount** on the lines sum to the **totalAmount** on the payment. + + > Pushing batch payments to Xero + > + > When pushing a single bill payment to Xero to pay multiple bills, only the first format is supported—multiple entries in the payment **lines** array. + + ### Payments and refunds on account + + A payment on account, that is a payment that doesn’t pay a specific bill, has one entry in its lines array. + + The line has the following properties: + + - A **totalAmount** indicating the amount paid by a supplier or refunded to them by a company. A payment to the supplier is always negative. A refund is always positive. + - A **links** array containing one element with the following properties: + - A **type** indicating the type of link. For a payment this is `PaymentOnAccount`. For a refund this is `Refund`. + - The **id** containing the ID of the supplier. + - An amount for the link is `0` **totalAmount** or the amount of the payment or refund. + + It is possible to have a payment that is part on account and part allocated to a bill. Each line should follow the examples above. + + ### Using a credit note to pay a bill + + The payment of a bill using a credit note has one entry in its `lines` array. This **line** has the following properties: + + - An **amount** indicating the amount of money moved, which in this case is `0`, as the credit note and bill allocation must balance each other. + - A **links** array containing two elements: + - The first link has: + - A **type** indicating the type of link, in this case a `Bill`. + - An **id** containing the ID of the bill that was paid. + - The second link has: + - A **type** indicating the type of link, in this case a `CreditNote`. + - An **id** containing the ID of the credit note used by this payment. + + The **amount** field on the **line** equals the **totalAmount** on the payment. + + ### Refunding a credit note + + A bill payment refunding a credit note has one entry in its **lines** array. This line has the following properties: + + - An **amount** indicating the amount of the credit note that was refunded. This is always negative, indicating that it is a refund. + - A **links** array containing one element with the following properties: + - A **type** indicating the type of `link`, in this case a `CreditNote`. + - An **id** containing the ID of the credit note that was refunded. + + The **totalAmount** field on the payment equals the line's **amount** field. These are both negative, as this is money leaving accounts payable. + + ### Refunding a payment + + If a payment is refunded, for example, when a company overpaid a bill and the overpayment is returned, there are two payment records: + + - One for the incoming overpayment. + - Another for the outgoing refund. + + The payment issuing the refund is identified by the fact that the **totalAmount** is negative. This payment has one entry in its lines array that have the following properties: + + - An **amount** indicating the amount that was refunded. This is always negative. + - A **links** array containing one element with the following properties: + - A **type** indicating the type of a the link, in this case a `BillPayment`. + - An **id** containing the ID of the payment that was refunded. + + The **amount** field on the line equals the **totalAmount** on the payment and is negative as this is money leaving accounts payable. + + The payment that was refunded can be identified as it has a line where the `amount` on its `line` is positive and the type of the link is `Refund`. This payment may have several entries in its **lines** array if it was partly used to pay an bill. For example, a £1,050 payment paying a £1,000 bill with a refund of £50 has two lines: + + - One for £1,000 linked to the bill that was paid + - Another for £50 linked to the payment that refunded the over payment. This link is of type `Refund` but the ID corresponds to a bill payment. + + The line linked to the bill payment has the following properties: + + - An **amount** indicating the amount that was refunded. This is positive as its money that was added to accounts payable, but is balanced out by the negative amount of the refund. + - A **links** array containing one element with the following properties: + - A **type** indicating the type of the link, in this case a `Refund`. + - An **id** containing the ID of the payment that refunded this line. + + > Linked payments + > + > Not all accounting software support linked payments in this way. In these platforms you may see a payment on account and a refund on account. + + ## Foreign currencies + + There are two types of currency rate that are detailed in the bill payments data type: + + Payment currency rate: + + - Base currency of the accounts payable account. + - Foreign currency of the bill payment. + + Payment line link currency rate: + + - Base currency of the item that the link represents. + - Foreign currency of the payment. + + These two rates allow the calculation of currency loss or gain for any of the transactions affected by the payment lines. The second rate is used when a bill payment is applied to an item in a currency that does not match either: + + - The base currency for the accounts payable account. + - The currency of the item. + + """ + + date_: Annotated[str, pydantic.Field(alias="date")] + + account_ref: Annotated[Optional[AccountRef], pydantic.Field(alias="accountRef")] = ( + None + ) + r"""Data types that reference an account, for example bill and invoice line items, use an accountRef that includes the ID and name of the linked account.""" + + currency: Optional[str] = None + + currency_rate: Annotated[ + Annotated[ + OptionalNullable[Decimal], + BeforeValidator(validate_decimal), + PlainSerializer(serialize_decimal(False)), + ], + pydantic.Field(alias="currencyRate"), + ] = UNSET + r"""Rate to convert the total amount of the payment into the base currency for the company at the time of the payment. + + Currency rates in Codat are implemented as the multiple of foreign currency units to each base currency unit. + + It is not possible to perform the currency conversion with two or more non-base currencies participating in the transaction. For example, if a company's base currency is USD, and it has a bill issued in EUR, then the bill payment must happen in USD or EUR. + + Where the currency rate is provided by the underlying accounting software, it will be available from Codat with the same precision (up to a maximum of 9 decimal places). + + For accounting software which do not provide an explicit currency rate, it is calculated as `baseCurrency / foreignCurrency` and will be returned to 9 decimal places. + + ## Examples with base currency of GBP + + | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (GBP) | + | :--------------- | :------------- | :------------ | :------------------------- | + | **USD** | $20 | 0.781 | £15.62 | + | **EUR** | €20 | 0.885 | £17.70 | + | **RUB** | ₽20 | 0.011 | £0.22 | + + ## Examples with base currency of USD + + | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (USD) | + | :--------------- | :------------- | :------------ | :------------------------- | + | **GBP** | £20 | 1.277 | $25.54 | + | **EUR** | €20 | 1.134 | $22.68 | + | **RUB** | ₽20 | 0.015 | $0.30 | + + + ### Integration-specific details + + | Integration | Scenario | System behavior | + |-------------------|-------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------| + | QuickBooks Online | Transaction currency differs from base currency | If currency rate value is left `null`, a rate of 1 will be used by QBO by default. To override this, specify a currencyRate in the request body. | + """ + + id: Optional[str] = None + r"""Identifier for the bill payment, unique for the company in the accounting software.""" + + lines: OptionalNullable[List[BillPaymentLine]] = UNSET + r"""An array of bill payment lines.""" + + metadata: Optional[Metadata] = None + + modified_date: Annotated[Optional[str], pydantic.Field(alias="modifiedDate")] = None + + note: OptionalNullable[str] = UNSET + r"""Additional information associated with the payment.""" + + payment_method_ref: Annotated[ + Optional[PaymentMethodRef], pydantic.Field(alias="paymentMethodRef") + ] = None + + reference: OptionalNullable[str] = UNSET + r"""Additional information associated with the payment.""" + + source_modified_date: Annotated[ + Optional[str], pydantic.Field(alias="sourceModifiedDate") + ] = None + + supplemental_data: Annotated[ + Optional[SupplementalData], pydantic.Field(alias="supplementalData") + ] = None + r"""Supplemental data is additional data you can include in our standard data types. + + It is referenced as a configured dynamic key value pair that is unique to the accounting software. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. + """ + + supplier_ref: Annotated[ + Optional[SupplierRef], pydantic.Field(alias="supplierRef") + ] = None + + total_amount: Annotated[ + Annotated[ + Optional[Decimal], + BeforeValidator(validate_decimal), + PlainSerializer(serialize_decimal(False)), + ], + pydantic.Field(alias="totalAmount"), + ] = None + r"""Amount of the payment in the payment currency. This value never changes and represents the amount of money that is paid into the supplier's account.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = [ + "accountRef", + "currency", + "currencyRate", + "id", + "lines", + "metadata", + "modifiedDate", + "note", + "paymentMethodRef", + "reference", + "sourceModifiedDate", + "supplementalData", + "supplierRef", + "totalAmount", + ] + nullable_fields = ["currencyRate", "lines", "note", "reference"] + null_default_fields = [] + + serialized = handler(self) + + m = {} + + for n, f in self.model_fields.items(): + k = f.alias or n + val = serialized.get(k) + serialized.pop(k, None) + + optional_nullable = k in optional_fields and k in nullable_fields + is_set = ( + self.__pydantic_fields_set__.intersection({n}) + or k in null_default_fields + ) # pylint: disable=no-member + + if val is not None and val != UNSET_SENTINEL: + m[k] = val + elif val != UNSET_SENTINEL and ( + not k in optional_fields or (optional_nullable and is_set) + ): + m[k] = val + + return m diff --git a/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/billpaymentline.py b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/billpaymentline.py new file mode 100644 index 000000000..35fc626fc --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/billpaymentline.py @@ -0,0 +1,111 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .billpaymentlinelink import BillPaymentLineLink, BillPaymentLineLinkTypedDict +from codat_sync_for_payables_version_1.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from codat_sync_for_payables_version_1.utils import serialize_decimal, validate_decimal +from decimal import Decimal +import pydantic +from pydantic import model_serializer +from pydantic.functional_serializers import PlainSerializer +from pydantic.functional_validators import BeforeValidator +from typing import List, Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class BillPaymentLineTypedDict(TypedDict): + amount: Decimal + r"""Amount in the bill payment currency.""" + allocated_on_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: + + ``` + 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. + """ + links: NotRequired[Nullable[List[BillPaymentLineLinkTypedDict]]] + + +class BillPaymentLine(BaseModel): + amount: Annotated[ + Decimal, + BeforeValidator(validate_decimal), + PlainSerializer(serialize_decimal(False)), + ] + r"""Amount in the bill payment currency.""" + + allocated_on_date: Annotated[ + Optional[str], pydantic.Field(alias="allocatedOnDate") + ] = 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: + + ``` + 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. + """ + + links: OptionalNullable[List[BillPaymentLineLink]] = UNSET + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = ["allocatedOnDate", "links"] + nullable_fields = ["links"] + null_default_fields = [] + + serialized = handler(self) + + m = {} + + for n, f in self.model_fields.items(): + k = f.alias or n + val = serialized.get(k) + serialized.pop(k, None) + + optional_nullable = k in optional_fields and k in nullable_fields + is_set = ( + self.__pydantic_fields_set__.intersection({n}) + or k in null_default_fields + ) # pylint: disable=no-member + + if val is not None and val != UNSET_SENTINEL: + m[k] = val + elif val != UNSET_SENTINEL and ( + not k in optional_fields or (optional_nullable and is_set) + ): + m[k] = val + + return m diff --git a/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/billpaymentlinelink.py b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/billpaymentlinelink.py new file mode 100644 index 000000000..0e3f87840 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/billpaymentlinelink.py @@ -0,0 +1,156 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .billpaymentlinelinktype import BillPaymentLineLinkType +from codat_sync_for_payables_version_1.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from codat_sync_for_payables_version_1.utils import serialize_decimal, validate_decimal +from decimal import Decimal +import pydantic +from pydantic import model_serializer +from pydantic.functional_serializers import PlainSerializer +from pydantic.functional_validators import BeforeValidator +from typing_extensions import Annotated, NotRequired, TypedDict + + +class BillPaymentLineLinkTypedDict(TypedDict): + type: BillPaymentLineLinkType + r"""Types of links to bill payment lines.""" + amount: NotRequired[Nullable[Decimal]] + r"""Amount by which the balance of the linked entity is altered, in the currency of the linked entity. + + - A negative link amount reduces the outstanding amount on the accounts payable account. + - A positive link amount increases the outstanding amount on the accounts payable account. + """ + currency_rate: NotRequired[Nullable[Decimal]] + r"""Rate to convert the total amount of the payment into the base currency for the company at the time of the payment. + + Currency rates in Codat are implemented as the multiple of foreign currency units to each base currency unit. + + It is not possible to perform the currency conversion with two or more non-base currencies participating in the transaction. For example, if a company's base currency is USD, and it has a bill issued in EUR, then the bill payment must happen in USD or EUR. + + Where the currency rate is provided by the underlying accounting software, it will be available from Codat with the same precision (up to a maximum of 9 decimal places). + + For accounting software which do not provide an explicit currency rate, it is calculated as `baseCurrency / foreignCurrency` and will be returned to 9 decimal places. + + ## Examples with base currency of GBP + + | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (GBP) | + | :--------------- | :------------- | :------------ | :------------------------- | + | **USD** | $20 | 0.781 | £15.62 | + | **EUR** | €20 | 0.885 | £17.70 | + | **RUB** | ₽20 | 0.011 | £0.22 | + + ## Examples with base currency of USD + + | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (USD) | + | :--------------- | :------------- | :------------ | :------------------------- | + | **GBP** | £20 | 1.277 | $25.54 | + | **EUR** | €20 | 1.134 | $22.68 | + | **RUB** | ₽20 | 0.015 | $0.30 | + + + ### Integration-specific details + + | Integration | Scenario | System behavior | + |-------------------|-------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------| + | QuickBooks Online | Transaction currency differs from base currency | If currency rate value is left `null`, a rate of 1 will be used by QBO by default. To override this, specify a currencyRate in the request body. | + """ + id: NotRequired[Nullable[str]] + r"""Unique identifier of the transaction represented by the link.""" + + +class BillPaymentLineLink(BaseModel): + type: BillPaymentLineLinkType + r"""Types of links to bill payment lines.""" + + amount: Annotated[ + OptionalNullable[Decimal], + BeforeValidator(validate_decimal), + PlainSerializer(serialize_decimal(False)), + ] = UNSET + r"""Amount by which the balance of the linked entity is altered, in the currency of the linked entity. + + - A negative link amount reduces the outstanding amount on the accounts payable account. + - A positive link amount increases the outstanding amount on the accounts payable account. + """ + + currency_rate: Annotated[ + Annotated[ + OptionalNullable[Decimal], + BeforeValidator(validate_decimal), + PlainSerializer(serialize_decimal(False)), + ], + pydantic.Field(alias="currencyRate"), + ] = UNSET + r"""Rate to convert the total amount of the payment into the base currency for the company at the time of the payment. + + Currency rates in Codat are implemented as the multiple of foreign currency units to each base currency unit. + + It is not possible to perform the currency conversion with two or more non-base currencies participating in the transaction. For example, if a company's base currency is USD, and it has a bill issued in EUR, then the bill payment must happen in USD or EUR. + + Where the currency rate is provided by the underlying accounting software, it will be available from Codat with the same precision (up to a maximum of 9 decimal places). + + For accounting software which do not provide an explicit currency rate, it is calculated as `baseCurrency / foreignCurrency` and will be returned to 9 decimal places. + + ## Examples with base currency of GBP + + | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (GBP) | + | :--------------- | :------------- | :------------ | :------------------------- | + | **USD** | $20 | 0.781 | £15.62 | + | **EUR** | €20 | 0.885 | £17.70 | + | **RUB** | ₽20 | 0.011 | £0.22 | + + ## Examples with base currency of USD + + | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (USD) | + | :--------------- | :------------- | :------------ | :------------------------- | + | **GBP** | £20 | 1.277 | $25.54 | + | **EUR** | €20 | 1.134 | $22.68 | + | **RUB** | ₽20 | 0.015 | $0.30 | + + + ### Integration-specific details + + | Integration | Scenario | System behavior | + |-------------------|-------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------| + | QuickBooks Online | Transaction currency differs from base currency | If currency rate value is left `null`, a rate of 1 will be used by QBO by default. To override this, specify a currencyRate in the request body. | + """ + + id: OptionalNullable[str] = UNSET + r"""Unique identifier of the transaction represented by the link.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = ["amount", "currencyRate", "id"] + nullable_fields = ["amount", "currencyRate", "id"] + null_default_fields = [] + + serialized = handler(self) + + m = {} + + for n, f in self.model_fields.items(): + k = f.alias or n + val = serialized.get(k) + serialized.pop(k, None) + + optional_nullable = k in optional_fields and k in nullable_fields + is_set = ( + self.__pydantic_fields_set__.intersection({n}) + or k in null_default_fields + ) # pylint: disable=no-member + + if val is not None and val != UNSET_SENTINEL: + m[k] = val + elif val != UNSET_SENTINEL and ( + not k in optional_fields or (optional_nullable and is_set) + ): + m[k] = val + + return m diff --git a/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/billpaymentlinelinktype.py b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/billpaymentlinelinktype.py new file mode 100644 index 000000000..b898e3700 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/billpaymentlinelinktype.py @@ -0,0 +1,19 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from enum import Enum + + +class BillPaymentLineLinkType(str, Enum): + r"""Types of links to bill payment lines.""" + + UNKNOWN = "Unknown" + UNLINKED = "Unlinked" + BILL = "Bill" + OTHER = "Other" + CREDIT_NOTE = "CreditNote" + BILL_PAYMENT = "BillPayment" + PAYMENT_ON_ACCOUNT = "PaymentOnAccount" + REFUND = "Refund" + MANUAL_JOURNAL = "ManualJournal" + DISCOUNT = "Discount" diff --git a/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/billpayments.py b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/billpayments.py new file mode 100644 index 000000000..e3f87fb98 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/billpayments.py @@ -0,0 +1,35 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .billpayment import BillPayment, BillPaymentTypedDict +from .links import Links, LinksTypedDict +from codat_sync_for_payables_version_1.types import BaseModel +import pydantic +from typing import List, Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class BillPaymentsTypedDict(TypedDict): + links: LinksTypedDict + page_number: int + r"""Current page number.""" + page_size: int + r"""Number of items to return in results array.""" + total_results: int + r"""Total number of items.""" + results: NotRequired[List[BillPaymentTypedDict]] + + +class BillPayments(BaseModel): + links: Annotated[Links, pydantic.Field(alias="_links")] + + page_number: Annotated[int, pydantic.Field(alias="pageNumber")] + r"""Current page number.""" + + page_size: Annotated[int, pydantic.Field(alias="pageSize")] + r"""Number of items to return in results array.""" + + total_results: Annotated[int, pydantic.Field(alias="totalResults")] + r"""Total number of items.""" + + results: Optional[List[BillPayment]] = None diff --git a/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/bills.py b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/bills.py new file mode 100644 index 000000000..7760cb096 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/bills.py @@ -0,0 +1,35 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .bill import Bill, BillTypedDict +from .links import Links, LinksTypedDict +from codat_sync_for_payables_version_1.types import BaseModel +import pydantic +from typing import List, Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class BillsTypedDict(TypedDict): + links: LinksTypedDict + page_number: int + r"""Current page number.""" + page_size: int + r"""Number of items to return in results array.""" + total_results: int + r"""Total number of items.""" + results: NotRequired[List[BillTypedDict]] + + +class Bills(BaseModel): + links: Annotated[Links, pydantic.Field(alias="_links")] + + page_number: Annotated[int, pydantic.Field(alias="pageNumber")] + r"""Current page number.""" + + page_size: Annotated[int, pydantic.Field(alias="pageSize")] + r"""Number of items to return in results array.""" + + total_results: Annotated[int, pydantic.Field(alias="totalResults")] + r"""Total number of items.""" + + results: Optional[List[Bill]] = None diff --git a/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/billstatus.py b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/billstatus.py new file mode 100644 index 000000000..ed31a143f --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/billstatus.py @@ -0,0 +1,15 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from enum import Enum + + +class BillStatus(str, Enum): + r"""Current state of the bill.""" + + UNKNOWN = "Unknown" + OPEN = "Open" + PARTIALLY_PAID = "PartiallyPaid" + PAID = "Paid" + VOID = "Void" + DRAFT = "Draft" diff --git a/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/clientratelimitreachedwebhook.py b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/clientratelimitreachedwebhook.py new file mode 100644 index 000000000..ebef3ccef --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/clientratelimitreachedwebhook.py @@ -0,0 +1,61 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .clientratelimitreachedwebhookdata import ( + ClientRateLimitReachedWebhookData, + ClientRateLimitReachedWebhookDataTypedDict, +) +from codat_sync_for_payables_version_1.types import BaseModel +import pydantic +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class ClientRateLimitReachedWebhookTypedDict(TypedDict): + r"""Webhook request body for a client that has reached their rate limit.""" + + alert_id: NotRequired[str] + r"""Unique identifier of the webhook event.""" + client_id: NotRequired[str] + r"""Unique identifier for your client in Codat.""" + client_name: NotRequired[str] + r"""Name of your client in Codat.""" + data: NotRequired[ClientRateLimitReachedWebhookDataTypedDict] + message: NotRequired[str] + r"""A human-readable message about the webhook.""" + rule_id: NotRequired[str] + r"""Unique identifier for the rule.""" + rule_type: NotRequired[str] + r"""The type of rule.""" + + +class ClientRateLimitReachedWebhook(BaseModel): + r"""Webhook request body for a client that has reached their rate limit.""" + + alert_id: Annotated[Optional[str], pydantic.Field(alias="AlertId")] = None + r"""Unique identifier of the webhook event.""" + + client_id: Annotated[Optional[str], pydantic.Field(alias="ClientId")] = None + r"""Unique identifier for your client in Codat.""" + + client_name: Annotated[Optional[str], pydantic.Field(alias="ClientName")] = None + r"""Name of your client in Codat.""" + + data: Annotated[ + Optional[ClientRateLimitReachedWebhookData], pydantic.Field(alias="Data") + ] = None + + message: Annotated[Optional[str], pydantic.Field(alias="Message")] = None + r"""A human-readable message about the webhook.""" + + rule_id: Annotated[ + Optional[str], + pydantic.Field( + deprecated="warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible.", + alias="RuleId", + ), + ] = None + r"""Unique identifier for the rule.""" + + rule_type: Annotated[Optional[str], pydantic.Field(alias="RuleType")] = None + r"""The type of rule.""" diff --git a/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/clientratelimitreachedwebhookdata.py b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/clientratelimitreachedwebhookdata.py new file mode 100644 index 000000000..cd201e21f --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/clientratelimitreachedwebhookdata.py @@ -0,0 +1,60 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from codat_sync_for_payables_version_1.types import BaseModel +import pydantic +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class ClientRateLimitReachedWebhookDataTypedDict(TypedDict): + daily_quota: NotRequired[int] + r"""The number of available requests per day.""" + expires_utc: 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: + + ``` + 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. + """ + + +class ClientRateLimitReachedWebhookData(BaseModel): + daily_quota: Annotated[Optional[int], pydantic.Field(alias="DailyQuota")] = None + r"""The number of available requests per day.""" + + expires_utc: Annotated[Optional[str], pydantic.Field(alias="ExpiresUtc")] = 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: + + ``` + 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. + """ diff --git a/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/clientratelimitresetwebhook.py b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/clientratelimitresetwebhook.py new file mode 100644 index 000000000..762052ab6 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/clientratelimitresetwebhook.py @@ -0,0 +1,61 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .clientratelimitresetwebhookdata import ( + ClientRateLimitResetWebhookData, + ClientRateLimitResetWebhookDataTypedDict, +) +from codat_sync_for_payables_version_1.types import BaseModel +import pydantic +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class ClientRateLimitResetWebhookTypedDict(TypedDict): + r"""Webhook request body for a client that has had their rate limit reset.""" + + alert_id: NotRequired[str] + r"""Unique identifier of the webhook event.""" + client_id: NotRequired[str] + r"""Unique identifier for your client in Codat.""" + client_name: NotRequired[str] + r"""Name of your client in Codat.""" + data: NotRequired[ClientRateLimitResetWebhookDataTypedDict] + message: NotRequired[str] + r"""A human-readable message about the webhook.""" + rule_id: NotRequired[str] + r"""Unique identifier for the rule.""" + rule_type: NotRequired[str] + r"""The type of rule.""" + + +class ClientRateLimitResetWebhook(BaseModel): + r"""Webhook request body for a client that has had their rate limit reset.""" + + alert_id: Annotated[Optional[str], pydantic.Field(alias="AlertId")] = None + r"""Unique identifier of the webhook event.""" + + client_id: Annotated[Optional[str], pydantic.Field(alias="ClientId")] = None + r"""Unique identifier for your client in Codat.""" + + client_name: Annotated[Optional[str], pydantic.Field(alias="ClientName")] = None + r"""Name of your client in Codat.""" + + data: Annotated[ + Optional[ClientRateLimitResetWebhookData], pydantic.Field(alias="Data") + ] = None + + message: Annotated[Optional[str], pydantic.Field(alias="Message")] = None + r"""A human-readable message about the webhook.""" + + rule_id: Annotated[ + Optional[str], + pydantic.Field( + deprecated="warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible.", + alias="RuleId", + ), + ] = None + r"""Unique identifier for the rule.""" + + rule_type: Annotated[Optional[str], pydantic.Field(alias="RuleType")] = None + r"""The type of rule.""" diff --git a/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/clientratelimitresetwebhookdata.py b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/clientratelimitresetwebhookdata.py new file mode 100644 index 000000000..2da49567d --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/clientratelimitresetwebhookdata.py @@ -0,0 +1,109 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from codat_sync_for_payables_version_1.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +import pydantic +from pydantic import model_serializer +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class ClientRateLimitResetWebhookDataTypedDict(TypedDict): + daily_quota: NotRequired[int] + r"""The number of available requests per day.""" + expires_utc: 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: + + ``` + 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. + """ + quota_remaining: NotRequired[Nullable[int]] + r"""Total number of requests remaining for your client.""" + reset_reason: NotRequired[str] + r"""The reason for your rate limit quota being reset.""" + + +class ClientRateLimitResetWebhookData(BaseModel): + daily_quota: Annotated[Optional[int], pydantic.Field(alias="DailyQuota")] = None + r"""The number of available requests per day.""" + + expires_utc: Annotated[Optional[str], pydantic.Field(alias="ExpiresUtc")] = 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: + + ``` + 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. + """ + + quota_remaining: Annotated[ + OptionalNullable[int], pydantic.Field(alias="QuotaRemaining") + ] = UNSET + r"""Total number of requests remaining for your client.""" + + reset_reason: Annotated[Optional[str], pydantic.Field(alias="ResetReason")] = None + r"""The reason for your rate limit quota being reset.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = ["DailyQuota", "ExpiresUtc", "QuotaRemaining", "ResetReason"] + nullable_fields = ["QuotaRemaining"] + null_default_fields = [] + + serialized = handler(self) + + m = {} + + for n, f in self.model_fields.items(): + k = f.alias or n + val = serialized.get(k) + serialized.pop(k, None) + + optional_nullable = k in optional_fields and k in nullable_fields + is_set = ( + self.__pydantic_fields_set__.intersection({n}) + or k in null_default_fields + ) # pylint: disable=no-member + + if val is not None and val != UNSET_SENTINEL: + m[k] = val + elif val != UNSET_SENTINEL and ( + not k in optional_fields or (optional_nullable and is_set) + ): + m[k] = val + + return m diff --git a/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/clientratelimitwebhook.py b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/clientratelimitwebhook.py new file mode 100644 index 000000000..968de8afa --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/clientratelimitwebhook.py @@ -0,0 +1,74 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .clientratelimitwebhookpayload import ( + ClientRateLimitWebhookPayload, + ClientRateLimitWebhookPayloadTypedDict, +) +from codat_sync_for_payables_version_1.types import BaseModel +import pydantic +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class ClientRateLimitWebhookTypedDict(TypedDict): + event_type: NotRequired[str] + r"""The type of event.""" + generated_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: + + ``` + 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. + """ + id: NotRequired[str] + r"""Unique identifier of the event.""" + payload: NotRequired[ClientRateLimitWebhookPayloadTypedDict] + + +class ClientRateLimitWebhook(BaseModel): + event_type: Annotated[Optional[str], pydantic.Field(alias="eventType")] = None + r"""The type of event.""" + + generated_date: Annotated[Optional[str], pydantic.Field(alias="generatedDate")] = ( + 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: + + ``` + 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. + """ + + id: Optional[str] = None + r"""Unique identifier of the event.""" + + payload: Optional[ClientRateLimitWebhookPayload] = None diff --git a/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/clientratelimitwebhookpayload.py b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/clientratelimitwebhookpayload.py new file mode 100644 index 000000000..ff6d7daf3 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/clientratelimitwebhookpayload.py @@ -0,0 +1,67 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from codat_sync_for_payables_version_1.types import BaseModel +import pydantic +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class ClientRateLimitWebhookPayloadTypedDict(TypedDict): + daily_quota: NotRequired[int] + r"""The number of available requests per day.""" + expiry_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: + + ``` + 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. + """ + quota_remaining: NotRequired[int] + r"""Total number of requests remaining for your client.""" + + +class ClientRateLimitWebhookPayload(BaseModel): + daily_quota: Annotated[Optional[int], pydantic.Field(alias="dailyQuota")] = None + r"""The number of available requests per day.""" + + expiry_date: Annotated[Optional[str], pydantic.Field(alias="expiryDate")] = 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: + + ``` + 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. + """ + + quota_remaining: Annotated[ + Optional[int], pydantic.Field(alias="quotaRemaining") + ] = None + r"""Total number of requests remaining for your client.""" diff --git a/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/codatfile.py b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/codatfile.py new file mode 100644 index 000000000..737357d52 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/codatfile.py @@ -0,0 +1,33 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from codat_sync_for_payables_version_1.types import BaseModel +from codat_sync_for_payables_version_1.utils import FieldMetadata, MultipartFormMetadata +import io +import pydantic +from typing import IO, Optional, Union +from typing_extensions import Annotated, NotRequired, TypedDict + + +class CodatFileTypedDict(TypedDict): + content: Union[bytes, IO[bytes], io.BufferedReader] + file_name: str + content_type: NotRequired[str] + + +class CodatFile(BaseModel): + content: Annotated[ + Union[bytes, IO[bytes], io.BufferedReader], + pydantic.Field(alias=""), + FieldMetadata(multipart=MultipartFormMetadata(content=True)), + ] + + file_name: Annotated[ + str, pydantic.Field(alias="fileName"), FieldMetadata(multipart=True) + ] + + content_type: Annotated[ + Optional[str], + pydantic.Field(alias="Content-Type"), + FieldMetadata(multipart=True), + ] = None diff --git a/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/companies.py b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/companies.py new file mode 100644 index 000000000..426c135d8 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/companies.py @@ -0,0 +1,35 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .company import Company, CompanyTypedDict +from .links import Links, LinksTypedDict +from codat_sync_for_payables_version_1.types import BaseModel +import pydantic +from typing import List, Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class CompaniesTypedDict(TypedDict): + links: LinksTypedDict + page_number: int + r"""Current page number.""" + page_size: int + r"""Number of items to return in results array.""" + total_results: int + r"""Total number of items.""" + results: NotRequired[List[CompanyTypedDict]] + + +class Companies(BaseModel): + links: Annotated[Links, pydantic.Field(alias="_links")] + + page_number: Annotated[int, pydantic.Field(alias="pageNumber")] + r"""Current page number.""" + + page_size: Annotated[int, pydantic.Field(alias="pageSize")] + r"""Number of items to return in results array.""" + + total_results: Annotated[int, pydantic.Field(alias="totalResults")] + r"""Total number of items.""" + + results: Optional[List[Company]] = None diff --git a/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/company.py b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/company.py new file mode 100644 index 000000000..a77bd956f --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/company.py @@ -0,0 +1,208 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .connection import Connection, ConnectionTypedDict +from codat_sync_for_payables_version_1.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +import pydantic +from pydantic import model_serializer +from typing import List, Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class CompanyTagsTypedDict(TypedDict): + r"""A collection of user-defined key-value pairs that store custom metadata against the company.""" + + +class CompanyTags(BaseModel): + r"""A collection of user-defined key-value pairs that store custom metadata against the company.""" + + +class CompanyTypedDict(TypedDict): + r"""In Codat, a company represents a business sharing access to their data. Each company can have multiple [connections](https://docs.codat.io/sync-for-payables-api#/schemas/Connection) to different data sources such as one connection to [Xero](https://docs.codat.io/integrations/accounting/xero/accounting-xero) for accounting data, two connections to [Plaid](https://docs.codat.io/integrations/banking/plaid/banking-plaid) for two bank accounts and a connection to [Zettle](https://docs.codat.io/integrations/commerce/zettle/commerce-zettle) for POS data. + + Typically each company is one of your customers. + + When you create a company, you can specify a `name` and we will automatically generate a unique `id` for the company. You can also add a `description` to store any additional information about the company. + """ + + id: str + r"""Unique identifier for your SMB in Codat.""" + name: str + r"""The name of the company""" + redirect: str + r"""The `redirect` [Link URL](https://docs.codat.io/auth-flow/authorize-hosted-link) enabling the customer to start their auth flow journey for the company.""" + created: 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: + + ``` + 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. + """ + created_by_user_name: NotRequired[Nullable[str]] + r"""Name of user that created the company in Codat.""" + data_connections: NotRequired[List[ConnectionTypedDict]] + description: NotRequired[str] + r"""Additional information about the company. This can be used to store foreign IDs, references, etc.""" + last_sync: 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: + + ``` + 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. + """ + products: NotRequired[List[str]] + r"""An array of products that are currently enabled for the company.""" + tags: NotRequired[CompanyTagsTypedDict] + r"""A collection of user-defined key-value pairs that store custom metadata against the company.""" + + +class Company(BaseModel): + r"""In Codat, a company represents a business sharing access to their data. Each company can have multiple [connections](https://docs.codat.io/sync-for-payables-api#/schemas/Connection) to different data sources such as one connection to [Xero](https://docs.codat.io/integrations/accounting/xero/accounting-xero) for accounting data, two connections to [Plaid](https://docs.codat.io/integrations/banking/plaid/banking-plaid) for two bank accounts and a connection to [Zettle](https://docs.codat.io/integrations/commerce/zettle/commerce-zettle) for POS data. + + Typically each company is one of your customers. + + When you create a company, you can specify a `name` and we will automatically generate a unique `id` for the company. You can also add a `description` to store any additional information about the company. + """ + + id: str + r"""Unique identifier for your SMB in Codat.""" + + name: str + r"""The name of the company""" + + redirect: str + r"""The `redirect` [Link URL](https://docs.codat.io/auth-flow/authorize-hosted-link) enabling the customer to start their auth flow journey for the company.""" + + created: Optional[str] = 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: + + ``` + 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. + """ + + created_by_user_name: Annotated[ + OptionalNullable[str], pydantic.Field(alias="createdByUserName") + ] = UNSET + r"""Name of user that created the company in Codat.""" + + data_connections: Annotated[ + Optional[List[Connection]], pydantic.Field(alias="dataConnections") + ] = None + + description: Optional[str] = None + r"""Additional information about the company. This can be used to store foreign IDs, references, etc.""" + + last_sync: Annotated[Optional[str], pydantic.Field(alias="lastSync")] = 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: + + ``` + 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. + """ + + products: Optional[List[str]] = None + r"""An array of products that are currently enabled for the company.""" + + tags: Optional[CompanyTags] = None + r"""A collection of user-defined key-value pairs that store custom metadata against the company.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = [ + "created", + "createdByUserName", + "dataConnections", + "description", + "lastSync", + "products", + "tags", + ] + nullable_fields = ["createdByUserName"] + null_default_fields = [] + + serialized = handler(self) + + m = {} + + for n, f in self.model_fields.items(): + k = f.alias or n + val = serialized.get(k) + serialized.pop(k, None) + + optional_nullable = k in optional_fields and k in nullable_fields + is_set = ( + self.__pydantic_fields_set__.intersection({n}) + or k in null_default_fields + ) # pylint: disable=no-member + + if val is not None and val != UNSET_SENTINEL: + m[k] = val + elif val != UNSET_SENTINEL and ( + not k in optional_fields or (optional_nullable and is_set) + ): + m[k] = val + + return m diff --git a/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/companyinfo.py b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/companyinfo.py new file mode 100644 index 000000000..aa005a9aa --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/companyinfo.py @@ -0,0 +1,317 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .address import Address, AddressTypedDict +from .phonenumber import PhoneNumber, PhoneNumberTypedDict +from .supplementaldata import SupplementalData, SupplementalDataTypedDict +from .weblink import WebLink, WebLinkTypedDict +from codat_sync_for_payables_version_1.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +import pydantic +from pydantic import model_serializer +from typing import Dict, List, Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class CompanyInfoTypedDict(TypedDict): + r"""> View the coverage for company profile in the Data coverage explorer. + + Company info provides standard details about a linked company such as their address, phone number, and company registration. + + > **Company information or companies?** + > + > Company profile is standard information that is held in the accounting software about a company. `Companies` is an endpoint that lists businesses in the Codat system that have linked and shared their data sources. + """ + + accounting_platform_ref: NotRequired[Nullable[str]] + r"""Identifier or reference for the company in the accounting software.""" + addresses: NotRequired[Nullable[List[AddressTypedDict]]] + r"""An array of Addresses.""" + base_currency: NotRequired[Nullable[str]] + r"""Currency set in the accounting software of the linked company. Used by the currency rate.""" + company_legal_name: NotRequired[Nullable[str]] + r"""Registered legal name of the linked company.""" + company_name: NotRequired[Nullable[str]] + r"""Name of the linked company.""" + created_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: + + ``` + 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. + """ + financial_year_start_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: + + ``` + 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. + """ + ledger_lock_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: + + ``` + 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. + """ + phone_numbers: NotRequired[Nullable[List[PhoneNumberTypedDict]]] + r"""An array of phone numbers.""" + registration_number: NotRequired[Nullable[str]] + r"""Registration number given to the linked company by the companies authority in the country of origin. In the UK this is Companies House.""" + source_urls: NotRequired[Nullable[Dict[str, str]]] + r"""URL addresses for the accounting source. + + For example, for Xero integrations two URLs are returned. These have many potential use cases, such as [deep linking](https://developer.xero.com/documentation/api-guides/deep-link-xero). + """ + supplemental_data: NotRequired[SupplementalDataTypedDict] + r"""Supplemental data is additional data you can include in our standard data types. + + It is referenced as a configured dynamic key value pair that is unique to the accounting software. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. + """ + tax_number: NotRequired[Nullable[str]] + r"""Company tax number.""" + web_links: NotRequired[Nullable[List[WebLinkTypedDict]]] + r"""An array of weblinks.""" + + +class CompanyInfo(BaseModel): + r"""> View the coverage for company profile in the Data coverage explorer. + + Company info provides standard details about a linked company such as their address, phone number, and company registration. + + > **Company information or companies?** + > + > Company profile is standard information that is held in the accounting software about a company. `Companies` is an endpoint that lists businesses in the Codat system that have linked and shared their data sources. + """ + + accounting_platform_ref: Annotated[ + OptionalNullable[str], pydantic.Field(alias="accountingPlatformRef") + ] = UNSET + r"""Identifier or reference for the company in the accounting software.""" + + addresses: OptionalNullable[List[Address]] = UNSET + r"""An array of Addresses.""" + + base_currency: Annotated[ + OptionalNullable[str], pydantic.Field(alias="baseCurrency") + ] = UNSET + r"""Currency set in the accounting software of the linked company. Used by the currency rate.""" + + company_legal_name: Annotated[ + OptionalNullable[str], pydantic.Field(alias="companyLegalName") + ] = UNSET + r"""Registered legal name of the linked company.""" + + company_name: Annotated[ + OptionalNullable[str], pydantic.Field(alias="companyName") + ] = UNSET + r"""Name of the linked company.""" + + created_date: Annotated[Optional[str], pydantic.Field(alias="createdDate")] = 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: + + ``` + 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. + """ + + financial_year_start_date: Annotated[ + Optional[str], pydantic.Field(alias="financialYearStartDate") + ] = 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: + + ``` + 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. + """ + + ledger_lock_date: Annotated[ + Optional[str], pydantic.Field(alias="ledgerLockDate") + ] = 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: + + ``` + 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. + """ + + phone_numbers: Annotated[ + OptionalNullable[List[PhoneNumber]], pydantic.Field(alias="phoneNumbers") + ] = UNSET + r"""An array of phone numbers.""" + + registration_number: Annotated[ + OptionalNullable[str], pydantic.Field(alias="registrationNumber") + ] = UNSET + r"""Registration number given to the linked company by the companies authority in the country of origin. In the UK this is Companies House.""" + + source_urls: Annotated[ + OptionalNullable[Dict[str, str]], pydantic.Field(alias="sourceUrls") + ] = UNSET + r"""URL addresses for the accounting source. + + For example, for Xero integrations two URLs are returned. These have many potential use cases, such as [deep linking](https://developer.xero.com/documentation/api-guides/deep-link-xero). + """ + + supplemental_data: Annotated[ + Optional[SupplementalData], pydantic.Field(alias="supplementalData") + ] = None + r"""Supplemental data is additional data you can include in our standard data types. + + It is referenced as a configured dynamic key value pair that is unique to the accounting software. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. + """ + + tax_number: Annotated[OptionalNullable[str], pydantic.Field(alias="taxNumber")] = ( + UNSET + ) + r"""Company tax number.""" + + web_links: Annotated[ + OptionalNullable[List[WebLink]], pydantic.Field(alias="webLinks") + ] = UNSET + r"""An array of weblinks.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = [ + "accountingPlatformRef", + "addresses", + "baseCurrency", + "companyLegalName", + "companyName", + "createdDate", + "financialYearStartDate", + "ledgerLockDate", + "phoneNumbers", + "registrationNumber", + "sourceUrls", + "supplementalData", + "taxNumber", + "webLinks", + ] + nullable_fields = [ + "accountingPlatformRef", + "addresses", + "baseCurrency", + "companyLegalName", + "companyName", + "phoneNumbers", + "registrationNumber", + "sourceUrls", + "taxNumber", + "webLinks", + ] + null_default_fields = [] + + serialized = handler(self) + + m = {} + + for n, f in self.model_fields.items(): + k = f.alias or n + val = serialized.get(k) + serialized.pop(k, None) + + optional_nullable = k in optional_fields and k in nullable_fields + is_set = ( + self.__pydantic_fields_set__.intersection({n}) + or k in null_default_fields + ) # pylint: disable=no-member + + if val is not None and val != UNSET_SENTINEL: + m[k] = val + elif val != UNSET_SENTINEL and ( + not k in optional_fields or (optional_nullable and is_set) + ): + m[k] = val + + return m diff --git a/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/companyrequestbody.py b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/companyrequestbody.py new file mode 100644 index 000000000..5244d89ac --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/companyrequestbody.py @@ -0,0 +1,27 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .tags import Tags, TagsTypedDict +from codat_sync_for_payables_version_1.types import BaseModel +from typing import Optional +from typing_extensions import NotRequired, TypedDict + + +class CompanyRequestBodyTypedDict(TypedDict): + name: str + r"""Name of company being connected.""" + description: NotRequired[str] + r"""Additional information about the company. This can be used to store foreign IDs, references, etc.""" + tags: NotRequired[TagsTypedDict] + r"""A collection of user-defined key-value pairs that store custom metadata against the company.""" + + +class CompanyRequestBody(BaseModel): + name: str + r"""Name of company being connected.""" + + description: Optional[str] = None + r"""Additional information about the company. This can be used to store foreign IDs, references, etc.""" + + tags: Optional[Tags] = None + r"""A collection of user-defined key-value pairs that store custom metadata against the company.""" diff --git a/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/connection.py b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/connection.py new file mode 100644 index 000000000..d760ea4bc --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/connection.py @@ -0,0 +1,225 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .dataconnectionerror import DataConnectionError, DataConnectionErrorTypedDict +from .dataconnectionstatus import DataConnectionStatus +from codat_sync_for_payables_version_1.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from enum import Enum +import pydantic +from pydantic import model_serializer +from typing import Dict, List, Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class SourceType(str, Enum): + r"""The type of platform of the connection.""" + + ACCOUNTING = "Accounting" + BANKING = "Banking" + BANK_FEED = "BankFeed" + COMMERCE = "Commerce" + EXPENSE = "Expense" + OTHER = "Other" + UNKNOWN = "Unknown" + + +class ConnectionTypedDict(TypedDict): + r"""A connection represents a [company's](https://docs.codat.io/sync-for-payables-api#/schemas/Company) connection to a data source and allows you to synchronize data (pull and/or push) with that source. + + A company can have multiple data connections depending on the type of data source it is connecting to. For example, a single company can link to: + + - [Accounting data](https://docs.codat.io/accounting-api/overview) - 1 active connection. + - [Banking data](https://docs.codat.io/banking-api/overview) - Multiple active connections. + - [Commerce data](https://docs.codat.io/commerce-api/overview) - Multiple active connections. + Any combination of accounting, banking, and commerce data connections is allowed. + + Before you can use a data connection to pull or push data, the company must grant you access to their business data by [linking the connection](https://docs.codat.io/auth-flow/overview). + """ + + created: 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: + + ``` + 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. + """ + id: str + r"""Unique identifier for a company's data connection.""" + integration_id: str + r"""A Codat ID representing the integration.""" + integration_key: str + r"""A unique four-character ID that identifies the platform of the company's data connection. This ensures continuity if the platform changes its name in the future.""" + link_url: str + r"""The link URL your customers can use to authorize access to their business application.""" + platform_name: str + r"""Name of integration connected to company.""" + source_id: str + r"""A source-specific ID used to distinguish between different sources originating from the same data connection. In general, a data connection is a single data source. However, for TrueLayer, `sourceId` is associated with a specific bank and has a many-to-one relationship with the `integrationId`.""" + source_type: SourceType + r"""The type of platform of the connection.""" + status: DataConnectionStatus + r"""The current authorization status of the data connection.""" + connection_info: NotRequired[Nullable[Dict[str, str]]] + data_connection_errors: NotRequired[Nullable[List[DataConnectionErrorTypedDict]]] + last_sync: 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: + + ``` + 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. + """ + + +class Connection(BaseModel): + r"""A connection represents a [company's](https://docs.codat.io/sync-for-payables-api#/schemas/Company) connection to a data source and allows you to synchronize data (pull and/or push) with that source. + + A company can have multiple data connections depending on the type of data source it is connecting to. For example, a single company can link to: + + - [Accounting data](https://docs.codat.io/accounting-api/overview) - 1 active connection. + - [Banking data](https://docs.codat.io/banking-api/overview) - Multiple active connections. + - [Commerce data](https://docs.codat.io/commerce-api/overview) - Multiple active connections. + Any combination of accounting, banking, and commerce data connections is allowed. + + Before you can use a data connection to pull or push data, the company must grant you access to their business data by [linking the connection](https://docs.codat.io/auth-flow/overview). + """ + + created: 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: + + ``` + 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. + """ + + id: str + r"""Unique identifier for a company's data connection.""" + + integration_id: Annotated[str, pydantic.Field(alias="integrationId")] + r"""A Codat ID representing the integration.""" + + integration_key: Annotated[str, pydantic.Field(alias="integrationKey")] + r"""A unique four-character ID that identifies the platform of the company's data connection. This ensures continuity if the platform changes its name in the future.""" + + link_url: Annotated[str, pydantic.Field(alias="linkUrl")] + r"""The link URL your customers can use to authorize access to their business application.""" + + platform_name: Annotated[str, pydantic.Field(alias="platformName")] + r"""Name of integration connected to company.""" + + source_id: Annotated[str, pydantic.Field(alias="sourceId")] + r"""A source-specific ID used to distinguish between different sources originating from the same data connection. In general, a data connection is a single data source. However, for TrueLayer, `sourceId` is associated with a specific bank and has a many-to-one relationship with the `integrationId`.""" + + source_type: Annotated[SourceType, pydantic.Field(alias="sourceType")] + r"""The type of platform of the connection.""" + + status: DataConnectionStatus + r"""The current authorization status of the data connection.""" + + connection_info: Annotated[ + OptionalNullable[Dict[str, str]], pydantic.Field(alias="connectionInfo") + ] = UNSET + + data_connection_errors: Annotated[ + OptionalNullable[List[DataConnectionError]], + pydantic.Field(alias="dataConnectionErrors"), + ] = UNSET + + last_sync: Annotated[Optional[str], pydantic.Field(alias="lastSync")] = 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: + + ``` + 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. + """ + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = ["connectionInfo", "dataConnectionErrors", "lastSync"] + nullable_fields = ["connectionInfo", "dataConnectionErrors"] + null_default_fields = [] + + serialized = handler(self) + + m = {} + + for n, f in self.model_fields.items(): + k = f.alias or n + val = serialized.get(k) + serialized.pop(k, None) + + optional_nullable = k in optional_fields and k in nullable_fields + is_set = ( + self.__pydantic_fields_set__.intersection({n}) + or k in null_default_fields + ) # pylint: disable=no-member + + if val is not None and val != UNSET_SENTINEL: + m[k] = val + elif val != UNSET_SENTINEL and ( + not k in optional_fields or (optional_nullable and is_set) + ): + m[k] = val + + return m diff --git a/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/connections.py b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/connections.py new file mode 100644 index 000000000..7a9f148d6 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/connections.py @@ -0,0 +1,35 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .connection import Connection, ConnectionTypedDict +from .links import Links, LinksTypedDict +from codat_sync_for_payables_version_1.types import BaseModel +import pydantic +from typing import List, Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class ConnectionsTypedDict(TypedDict): + links: LinksTypedDict + page_number: int + r"""Current page number.""" + page_size: int + r"""Number of items to return in results array.""" + total_results: int + r"""Total number of items.""" + results: NotRequired[List[ConnectionTypedDict]] + + +class Connections(BaseModel): + links: Annotated[Links, pydantic.Field(alias="_links")] + + page_number: Annotated[int, pydantic.Field(alias="pageNumber")] + r"""Current page number.""" + + page_size: Annotated[int, pydantic.Field(alias="pageSize")] + r"""Number of items to return in results array.""" + + total_results: Annotated[int, pydantic.Field(alias="totalResults")] + r"""Total number of items.""" + + results: Optional[List[Connection]] = None diff --git a/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/createaccountresponse.py b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/createaccountresponse.py new file mode 100644 index 000000000..5bd0cb8d7 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/createaccountresponse.py @@ -0,0 +1,619 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .accountstatus import AccountStatus +from .accounttype import AccountType +from .datatype import DataType +from .metadata import Metadata, MetadataTypedDict +from .pushoperationchange import PushOperationChange, PushOperationChangeTypedDict +from .pushoperationstatus import PushOperationStatus +from .supplementaldata import SupplementalData, SupplementalDataTypedDict +from .validation import Validation, ValidationTypedDict +from codat_sync_for_payables_version_1.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from codat_sync_for_payables_version_1.utils import serialize_decimal, validate_decimal +from decimal import Decimal +import pydantic +from pydantic import model_serializer +from pydantic.functional_serializers import PlainSerializer +from pydantic.functional_validators import BeforeValidator +from typing import List, Optional +from typing_extensions import Annotated, NotRequired, TypedDict, deprecated + + +class CreateAccountResponseValidDataTypeLinksTypedDict(TypedDict): + r"""When querying Codat's data model, some data types return `validDatatypeLinks` metadata in the JSON response. This indicates where that object can be used as a reference—a _valid link_—when creating or updating other data. + + For example, `validDatatypeLinks` might indicate the following references: + + - Which tax rates are valid to use on the line item of a bill. + - Which items can be used when creating an invoice. + + You can use `validDatatypeLinks` to present your SMB customers with only valid choices when selecting objects from a list, for example. + + ## `validDatatypeLinks` example + + The following example uses the `Accounting.Accounts` data type. It shows that, on the linked integration, this account is valid as the account on a payment or bill payment; and as the account referenced on the line item of a direct income or direct cost. Because there is no valid link to Invoices or Bills, using this account on those data types will result in an error. + + ```json validDatatypeLinks for an account + { + \"id\": \"bd9e85e0-0478-433d-ae9f-0b3c4f04bfe4\", + \"nominalCode\": \"090\", + \"name\": \"Business Bank Account\", + #... + \"validDatatypeLinks\": [ + { + \"property\": \"Id\", + \"links\": [ + \"Payment.AccountRef.Id\", + \"BillPayment.AccountRef.Id\", + \"DirectIncome.LineItems.AccountRef.Id\", + \"DirectCost.LineItems.AccountRef.Id\" + ] + } + ] + } + ``` + + + + ## Support for `validDatatypeLinks` + + Codat currently supports `validDatatypeLinks` for some data types on our Xero, QuickBooks Online, QuickBooks Desktop, Exact (NL), and Sage Business Cloud integrations. + + If you'd like us to extend support to more data types or integrations, suggest or vote for this on our Product Roadmap. + """ + + links: NotRequired[Nullable[List[str]]] + r"""Supported `dataTypes` that the record can be linked to.""" + property: NotRequired[Nullable[str]] + r"""The property from the account that can be linked.""" + + +class CreateAccountResponseValidDataTypeLinks(BaseModel): + r"""When querying Codat's data model, some data types return `validDatatypeLinks` metadata in the JSON response. This indicates where that object can be used as a reference—a _valid link_—when creating or updating other data. + + For example, `validDatatypeLinks` might indicate the following references: + + - Which tax rates are valid to use on the line item of a bill. + - Which items can be used when creating an invoice. + + You can use `validDatatypeLinks` to present your SMB customers with only valid choices when selecting objects from a list, for example. + + ## `validDatatypeLinks` example + + The following example uses the `Accounting.Accounts` data type. It shows that, on the linked integration, this account is valid as the account on a payment or bill payment; and as the account referenced on the line item of a direct income or direct cost. Because there is no valid link to Invoices or Bills, using this account on those data types will result in an error. + + ```json validDatatypeLinks for an account + { + \"id\": \"bd9e85e0-0478-433d-ae9f-0b3c4f04bfe4\", + \"nominalCode\": \"090\", + \"name\": \"Business Bank Account\", + #... + \"validDatatypeLinks\": [ + { + \"property\": \"Id\", + \"links\": [ + \"Payment.AccountRef.Id\", + \"BillPayment.AccountRef.Id\", + \"DirectIncome.LineItems.AccountRef.Id\", + \"DirectCost.LineItems.AccountRef.Id\" + ] + } + ] + } + ``` + + + + ## Support for `validDatatypeLinks` + + Codat currently supports `validDatatypeLinks` for some data types on our Xero, QuickBooks Online, QuickBooks Desktop, Exact (NL), and Sage Business Cloud integrations. + + If you'd like us to extend support to more data types or integrations, suggest or vote for this on our Product Roadmap. + """ + + links: OptionalNullable[List[str]] = UNSET + r"""Supported `dataTypes` that the record can be linked to.""" + + property: OptionalNullable[str] = UNSET + r"""The property from the account that can be linked.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = ["links", "property"] + nullable_fields = ["links", "property"] + null_default_fields = [] + + serialized = handler(self) + + m = {} + + for n, f in self.model_fields.items(): + k = f.alias or n + val = serialized.get(k) + serialized.pop(k, None) + + optional_nullable = k in optional_fields and k in nullable_fields + is_set = ( + self.__pydantic_fields_set__.intersection({n}) + or k in null_default_fields + ) # pylint: disable=no-member + + if val is not None and val != UNSET_SENTINEL: + m[k] = val + elif val != UNSET_SENTINEL and ( + not k in optional_fields or (optional_nullable and is_set) + ): + m[k] = val + + return m + + +@deprecated( + "warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible." +) +class AccountingAccountTypedDict(TypedDict): + r"""> **Language tip:** Accounts are also referred to as **chart of accounts**, **nominal accounts**, and **general ledger**. + + View the coverage for accounts in the Data coverage explorer. + + ## Overview + + Accounts are the categories a business uses to record accounting transactions. From the Accounts endpoints, you can retrieve a list of all accounts for a specified company. + + The categories for an account include: + * Asset + * Expense + * Income + * Liability + * Equity. + + The same account may have a different category based on the integration it is used in. For example, a current account (known as checking in the US) should be categorized as `Asset.Current` for Xero, and `Asset.Bank.Checking` for QuickBooks Online. + + At the same time, each integration may have its own requirements to the categories. For example, a Paypal account in Xero is of the `Asset.Bank` category and therefore requires additional properties to be provided. + + To determine the list of allowed categories for a specific integration, you can: + - Follow our [Create, update, delete data](https://docs.codat.io/using-the-api/push) guide and use the [Get create account model](https://docs.codat.io/sync-for-payables-api#/operations/get-create-chartOfAccounts-model). + - Refer to the integration's own documentation. + + > **Accounts with no category** + > + > If an account is pulled from the chart of accounts and its nominal code does not lie within the category layout for the company's accounts, then the **type** is `Unknown`. The **fullyQualifiedCategory** and **fullyQualifiedName** fields return `null`. + > + > This approach gives a true representation of the company's accounts whilst preventing distorting financials such as a company's profit and loss and balance sheet reports. + """ + + currency: NotRequired[str] + r"""The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + + ## Unknown currencies + + In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + + There are only a very small number of edge cases where this currency code is returned by the Codat system. + """ + current_balance: NotRequired[Nullable[Decimal]] + r"""Current balance in the account.""" + description: NotRequired[Nullable[str]] + r"""Description for the account.""" + fully_qualified_category: NotRequired[Nullable[str]] + r"""Full category of the account. + + For example, `Liability.Current` or `Income.Revenue`. To determine a list of possible categories for each integration, see our examples, follow our [Create, update, delete data](https://docs.codat.io/using-the-api/push) guide, or refer to the integration's own documentation. + """ + fully_qualified_name: NotRequired[Nullable[str]] + r"""Full name of the account, for example: + - `Cash On Hand` + - `Rents Held In Trust` + - `Fixed Asset` + """ + id: NotRequired[str] + r"""Identifier for the account, unique for the company.""" + is_bank_account: NotRequired[bool] + r"""Confirms whether the account is a bank account or not.""" + metadata: NotRequired[MetadataTypedDict] + modified_date: NotRequired[str] + name: NotRequired[Nullable[str]] + r"""Name of the account.""" + nominal_code: NotRequired[Nullable[str]] + r"""Reference given to each nominal account for a business. It ensures money is allocated to the correct account. This code isn't a unique identifier in the Codat system.""" + source_modified_date: NotRequired[str] + status: NotRequired[AccountStatus] + r"""Status of the account""" + supplemental_data: NotRequired[SupplementalDataTypedDict] + r"""Supplemental data is additional data you can include in our standard data types. + + It is referenced as a configured dynamic key value pair that is unique to the accounting software. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. + """ + type: NotRequired[AccountType] + r"""Type of account""" + valid_datatype_links: NotRequired[ + Nullable[List[CreateAccountResponseValidDataTypeLinksTypedDict]] + ] + r"""The validDatatypeLinks can be used to determine whether an account can be correctly mapped to another object; for example, accounts with a `type` of `income` might only support being used on an Invoice and Direct Income. For more information, see [Valid Data Type Links](/sync-for-payables-api#/schemas/ValidDataTypeLinks).""" + + +@deprecated( + "warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible." +) +class AccountingAccount(BaseModel): + r"""> **Language tip:** Accounts are also referred to as **chart of accounts**, **nominal accounts**, and **general ledger**. + + View the coverage for accounts in the Data coverage explorer. + + ## Overview + + Accounts are the categories a business uses to record accounting transactions. From the Accounts endpoints, you can retrieve a list of all accounts for a specified company. + + The categories for an account include: + * Asset + * Expense + * Income + * Liability + * Equity. + + The same account may have a different category based on the integration it is used in. For example, a current account (known as checking in the US) should be categorized as `Asset.Current` for Xero, and `Asset.Bank.Checking` for QuickBooks Online. + + At the same time, each integration may have its own requirements to the categories. For example, a Paypal account in Xero is of the `Asset.Bank` category and therefore requires additional properties to be provided. + + To determine the list of allowed categories for a specific integration, you can: + - Follow our [Create, update, delete data](https://docs.codat.io/using-the-api/push) guide and use the [Get create account model](https://docs.codat.io/sync-for-payables-api#/operations/get-create-chartOfAccounts-model). + - Refer to the integration's own documentation. + + > **Accounts with no category** + > + > If an account is pulled from the chart of accounts and its nominal code does not lie within the category layout for the company's accounts, then the **type** is `Unknown`. The **fullyQualifiedCategory** and **fullyQualifiedName** fields return `null`. + > + > This approach gives a true representation of the company's accounts whilst preventing distorting financials such as a company's profit and loss and balance sheet reports. + """ + + currency: Optional[str] = None + r"""The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + + ## Unknown currencies + + In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + + There are only a very small number of edge cases where this currency code is returned by the Codat system. + """ + + current_balance: Annotated[ + Annotated[ + OptionalNullable[Decimal], + BeforeValidator(validate_decimal), + PlainSerializer(serialize_decimal(False)), + ], + pydantic.Field(alias="currentBalance"), + ] = UNSET + r"""Current balance in the account.""" + + description: OptionalNullable[str] = UNSET + r"""Description for the account.""" + + fully_qualified_category: Annotated[ + OptionalNullable[str], pydantic.Field(alias="fullyQualifiedCategory") + ] = UNSET + r"""Full category of the account. + + For example, `Liability.Current` or `Income.Revenue`. To determine a list of possible categories for each integration, see our examples, follow our [Create, update, delete data](https://docs.codat.io/using-the-api/push) guide, or refer to the integration's own documentation. + """ + + fully_qualified_name: Annotated[ + OptionalNullable[str], pydantic.Field(alias="fullyQualifiedName") + ] = UNSET + r"""Full name of the account, for example: + - `Cash On Hand` + - `Rents Held In Trust` + - `Fixed Asset` + """ + + id: Optional[str] = None + r"""Identifier for the account, unique for the company.""" + + is_bank_account: Annotated[ + Optional[bool], pydantic.Field(alias="isBankAccount") + ] = None + r"""Confirms whether the account is a bank account or not.""" + + metadata: Optional[Metadata] = None + + modified_date: Annotated[Optional[str], pydantic.Field(alias="modifiedDate")] = None + + name: OptionalNullable[str] = UNSET + r"""Name of the account.""" + + nominal_code: Annotated[ + OptionalNullable[str], pydantic.Field(alias="nominalCode") + ] = UNSET + r"""Reference given to each nominal account for a business. It ensures money is allocated to the correct account. This code isn't a unique identifier in the Codat system.""" + + source_modified_date: Annotated[ + Optional[str], pydantic.Field(alias="sourceModifiedDate") + ] = None + + status: Optional[AccountStatus] = None + r"""Status of the account""" + + supplemental_data: Annotated[ + Optional[SupplementalData], pydantic.Field(alias="supplementalData") + ] = None + r"""Supplemental data is additional data you can include in our standard data types. + + It is referenced as a configured dynamic key value pair that is unique to the accounting software. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. + """ + + type: Optional[AccountType] = None + r"""Type of account""" + + valid_datatype_links: Annotated[ + OptionalNullable[List[CreateAccountResponseValidDataTypeLinks]], + pydantic.Field(alias="validDatatypeLinks"), + ] = UNSET + r"""The validDatatypeLinks can be used to determine whether an account can be correctly mapped to another object; for example, accounts with a `type` of `income` might only support being used on an Invoice and Direct Income. For more information, see [Valid Data Type Links](/sync-for-payables-api#/schemas/ValidDataTypeLinks).""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = [ + "currency", + "currentBalance", + "description", + "fullyQualifiedCategory", + "fullyQualifiedName", + "id", + "isBankAccount", + "metadata", + "modifiedDate", + "name", + "nominalCode", + "sourceModifiedDate", + "status", + "supplementalData", + "type", + "validDatatypeLinks", + ] + nullable_fields = [ + "currentBalance", + "description", + "fullyQualifiedCategory", + "fullyQualifiedName", + "name", + "nominalCode", + "validDatatypeLinks", + ] + null_default_fields = [] + + serialized = handler(self) + + m = {} + + for n, f in self.model_fields.items(): + k = f.alias or n + val = serialized.get(k) + serialized.pop(k, None) + + optional_nullable = k in optional_fields and k in nullable_fields + is_set = ( + self.__pydantic_fields_set__.intersection({n}) + or k in null_default_fields + ) # pylint: disable=no-member + + if val is not None and val != UNSET_SENTINEL: + m[k] = val + elif val != UNSET_SENTINEL and ( + not k in optional_fields or (optional_nullable and is_set) + ): + m[k] = val + + return m + + +class CreateAccountResponseTypedDict(TypedDict): + company_id: str + r"""Unique identifier for your SMB in Codat.""" + data_connection_key: str + r"""Unique identifier for a company's data connection.""" + push_operation_key: str + r"""A unique identifier generated by Codat to represent this single push operation. This identifier can be used to track the status of the push, and should be persisted.""" + requested_on_utc: 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: + + ``` + 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. + """ + status: PushOperationStatus + r"""The current status of the push operation.""" + status_code: int + r"""Push status code.""" + changes: NotRequired[Nullable[List[PushOperationChangeTypedDict]]] + r"""Contains a single entry that communicates which record has changed and the manner in which it changed.""" + completed_on_utc: 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: + + ``` + 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. + """ + data: NotRequired[Nullable[AccountingAccountTypedDict]] + data_type: NotRequired[DataType] + r"""Available data types""" + error_message: NotRequired[Nullable[str]] + r"""A message about the error.""" + timeout_in_minutes: NotRequired[Nullable[int]] + r"""Number of minutes the push operation must complete within before it times out.""" + timeout_in_seconds: NotRequired[Nullable[int]] + r"""Number of seconds the push operation must complete within before it times out.""" + validation: NotRequired[ValidationTypedDict] + r"""A human-readable object describing validation decisions Codat has made when pushing data into the platform. If a push has failed because of validation errors, they will be detailed here.""" + + +class CreateAccountResponse(BaseModel): + company_id: Annotated[str, pydantic.Field(alias="companyId")] + r"""Unique identifier for your SMB in Codat.""" + + data_connection_key: Annotated[str, pydantic.Field(alias="dataConnectionKey")] + r"""Unique identifier for a company's data connection.""" + + push_operation_key: Annotated[str, pydantic.Field(alias="pushOperationKey")] + r"""A unique identifier generated by Codat to represent this single push operation. This identifier can be used to track the status of the push, and should be persisted.""" + + requested_on_utc: Annotated[str, pydantic.Field(alias="requestedOnUtc")] + 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: + + ``` + 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. + """ + + status: PushOperationStatus + r"""The current status of the push operation.""" + + status_code: Annotated[int, pydantic.Field(alias="statusCode")] + r"""Push status code.""" + + changes: OptionalNullable[List[PushOperationChange]] = UNSET + r"""Contains a single entry that communicates which record has changed and the manner in which it changed.""" + + completed_on_utc: Annotated[ + Optional[str], pydantic.Field(alias="completedOnUtc") + ] = 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: + + ``` + 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. + """ + + data: OptionalNullable[AccountingAccount] = UNSET + + data_type: Annotated[Optional[DataType], pydantic.Field(alias="dataType")] = None + r"""Available data types""" + + error_message: Annotated[ + OptionalNullable[str], pydantic.Field(alias="errorMessage") + ] = UNSET + r"""A message about the error.""" + + timeout_in_minutes: Annotated[ + OptionalNullable[int], pydantic.Field(alias="timeoutInMinutes") + ] = UNSET + r"""Number of minutes the push operation must complete within before it times out.""" + + timeout_in_seconds: Annotated[ + OptionalNullable[int], + pydantic.Field( + deprecated="warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible.", + alias="timeoutInSeconds", + ), + ] = UNSET + r"""Number of seconds the push operation must complete within before it times out.""" + + validation: Optional[Validation] = None + r"""A human-readable object describing validation decisions Codat has made when pushing data into the platform. If a push has failed because of validation errors, they will be detailed here.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = [ + "changes", + "completedOnUtc", + "data", + "dataType", + "errorMessage", + "timeoutInMinutes", + "timeoutInSeconds", + "validation", + ] + nullable_fields = [ + "changes", + "data", + "errorMessage", + "timeoutInMinutes", + "timeoutInSeconds", + ] + null_default_fields = [] + + serialized = handler(self) + + m = {} + + for n, f in self.model_fields.items(): + k = f.alias or n + val = serialized.get(k) + serialized.pop(k, None) + + optional_nullable = k in optional_fields and k in nullable_fields + is_set = ( + self.__pydantic_fields_set__.intersection({n}) + or k in null_default_fields + ) # pylint: disable=no-member + + if val is not None and val != UNSET_SENTINEL: + m[k] = val + elif val != UNSET_SENTINEL and ( + not k in optional_fields or (optional_nullable and is_set) + ): + m[k] = val + + return m diff --git a/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/createbillcreditnoteresponse.py b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/createbillcreditnoteresponse.py new file mode 100644 index 000000000..60c6bc5b8 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/createbillcreditnoteresponse.py @@ -0,0 +1,705 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .billcreditnotelineitem import ( + BillCreditNoteLineItem, + BillCreditNoteLineItemTypedDict, +) +from .billcreditnotestatus import BillCreditNoteStatus +from .datatype import DataType +from .items import Items, ItemsTypedDict +from .metadata import Metadata, MetadataTypedDict +from .pushoperationchange import PushOperationChange, PushOperationChangeTypedDict +from .pushoperationstatus import PushOperationStatus +from .supplementaldata import SupplementalData, SupplementalDataTypedDict +from .supplierref import SupplierRef, SupplierRefTypedDict +from .validation import Validation, ValidationTypedDict +from .withholdingtax_items import WithholdingTaxItems, WithholdingTaxItemsTypedDict +from codat_sync_for_payables_version_1.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from codat_sync_for_payables_version_1.utils import serialize_decimal, validate_decimal +from decimal import Decimal +import pydantic +from pydantic import model_serializer +from pydantic.functional_serializers import PlainSerializer +from pydantic.functional_validators import BeforeValidator +from typing import List, Optional +from typing_extensions import Annotated, NotRequired, TypedDict, deprecated + + +class CreateBillCreditNoteResponseRecordReferenceTypedDict(TypedDict): + r"""Links the current record to the underlying record or data type that created it. + + For example, if a journal entry is generated based on an invoice, this property allows you to connect the journal entry to the underlying invoice in our data model. + """ + + data_type: NotRequired[str] + r"""Allowed name of the 'dataType'.""" + id: NotRequired[str] + r"""'id' of the underlying record or data type.""" + + +class CreateBillCreditNoteResponseRecordReference(BaseModel): + r"""Links the current record to the underlying record or data type that created it. + + For example, if a journal entry is generated based on an invoice, this property allows you to connect the journal entry to the underlying invoice in our data model. + """ + + data_type: Annotated[Optional[str], pydantic.Field(alias="dataType")] = None + r"""Allowed name of the 'dataType'.""" + + id: Optional[str] = None + r"""'id' of the underlying record or data type.""" + + +@deprecated( + "warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible." +) +class AccountingBillCreditNoteTypedDict(TypedDict): + r"""> **Bill credit notes or credit notes?** + > + > In Codat, bill credit notes represent accounts payable only. For accounts receivable, see [Credit notes](https://docs.codat.io/sync-for-payables-api#/schemas/CreditNote). + + View the coverage for bill credit notes in the Data coverage explorer. + + ## Overview + + A bill credit note is issued by a supplier for the purpose of recording credit. For example, if a supplier was unable to fulfil an order that was placed by a business, or delivered damaged goods, they would issue a bill credit note. A bill credit note reduces the amount a business owes to the supplier. It can be refunded to the business or used to pay off future bills. + + In the Codat API, a bill credit note is an accounts payable record issued by a [supplier](https://docs.codat.io/sync-for-payables-api#/schemas/Supplier). + + A bill credit note includes details of: + * The original and remaining credit. + * Any allocations of the credit against other records, such as [bills](https://docs.codat.io/sync-for-payables-api#/schemas/Bill). + * The supplier that issued the bill credit note. + """ + + discount_percentage: Decimal + r"""Percentage rate of any discount applied to the bill credit note.""" + status: BillCreditNoteStatus + r"""Current state of the bill credit note""" + sub_total: Decimal + r"""Total amount of the bill credit note, including discounts but excluding tax.""" + total_amount: Decimal + r"""Total amount of credit that has been applied to the business' account with the supplier, including discounts and tax.""" + total_discount: Decimal + r"""Total value of any discounts applied.""" + total_tax_amount: Decimal + r"""Amount of tax included in the bill credit note.""" + allocated_on_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: + + ``` + 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. + """ + bill_credit_note_number: NotRequired[Nullable[str]] + r"""Friendly reference for the bill credit note.""" + created_from_refs: NotRequired[ + Nullable[List[CreateBillCreditNoteResponseRecordReferenceTypedDict]] + ] + r"""An array of records the credit note was created from.""" + currency: NotRequired[str] + r"""The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + + ## Unknown currencies + + In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + + There are only a very small number of edge cases where this currency code is returned by the Codat system. + """ + currency_rate: NotRequired[Nullable[Decimal]] + r"""Rate to convert the total amount of the payment into the base currency for the company at the time of the payment. + + Currency rates in Codat are implemented as the multiple of foreign currency units to each base currency unit. + + It is not possible to perform the currency conversion with two or more non-base currencies participating in the transaction. For example, if a company's base currency is USD, and it has a bill issued in EUR, then the bill payment must happen in USD or EUR. + + Where the currency rate is provided by the underlying accounting software, it will be available from Codat with the same precision (up to a maximum of 9 decimal places). + + For accounting software which do not provide an explicit currency rate, it is calculated as `baseCurrency / foreignCurrency` and will be returned to 9 decimal places. + + ## Examples with base currency of GBP + + | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (GBP) | + | :--------------- | :------------- | :------------ | :------------------------- | + | **USD** | $20 | 0.781 | £15.62 | + | **EUR** | €20 | 0.885 | £17.70 | + | **RUB** | ₽20 | 0.011 | £0.22 | + + ## Examples with base currency of USD + + | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (USD) | + | :--------------- | :------------- | :------------ | :------------------------- | + | **GBP** | £20 | 1.277 | $25.54 | + | **EUR** | €20 | 1.134 | $22.68 | + | **RUB** | ₽20 | 0.015 | $0.30 | + + + ### Integration-specific details + + | Integration | Scenario | System behavior | + |-------------------|-------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------| + | QuickBooks Online | Transaction currency differs from base currency | If currency rate value is left `null`, a rate of 1 will be used by QBO by default. To override this, specify a currencyRate in the request body. | + """ + id: NotRequired[str] + r"""Identifier for the bill credit note that is unique to a company in the accounting software.""" + issue_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: + + ``` + 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. + """ + line_items: NotRequired[Nullable[List[BillCreditNoteLineItemTypedDict]]] + r"""An array of line""" + metadata: NotRequired[MetadataTypedDict] + modified_date: NotRequired[str] + note: NotRequired[Nullable[str]] + r"""Any additional information about the bill credit note.""" + payment_allocations: NotRequired[Nullable[List[ItemsTypedDict]]] + r"""An array of payment allocations.""" + remaining_credit: NotRequired[Decimal] + r"""Amount of the bill credit note that is still outstanding.""" + source_modified_date: NotRequired[str] + supplemental_data: NotRequired[SupplementalDataTypedDict] + r"""Supplemental data is additional data you can include in our standard data types. + + It is referenced as a configured dynamic key value pair that is unique to the accounting software. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. + """ + supplier_ref: NotRequired[SupplierRefTypedDict] + r"""Reference to the supplier the record relates to.""" + withholding_tax: NotRequired[Nullable[List[WithholdingTaxItemsTypedDict]]] + + +@deprecated( + "warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible." +) +class AccountingBillCreditNote(BaseModel): + r"""> **Bill credit notes or credit notes?** + > + > In Codat, bill credit notes represent accounts payable only. For accounts receivable, see [Credit notes](https://docs.codat.io/sync-for-payables-api#/schemas/CreditNote). + + View the coverage for bill credit notes in the Data coverage explorer. + + ## Overview + + A bill credit note is issued by a supplier for the purpose of recording credit. For example, if a supplier was unable to fulfil an order that was placed by a business, or delivered damaged goods, they would issue a bill credit note. A bill credit note reduces the amount a business owes to the supplier. It can be refunded to the business or used to pay off future bills. + + In the Codat API, a bill credit note is an accounts payable record issued by a [supplier](https://docs.codat.io/sync-for-payables-api#/schemas/Supplier). + + A bill credit note includes details of: + * The original and remaining credit. + * Any allocations of the credit against other records, such as [bills](https://docs.codat.io/sync-for-payables-api#/schemas/Bill). + * The supplier that issued the bill credit note. + """ + + discount_percentage: Annotated[ + Annotated[ + Decimal, + BeforeValidator(validate_decimal), + PlainSerializer(serialize_decimal(False)), + ], + pydantic.Field(alias="discountPercentage"), + ] + r"""Percentage rate of any discount applied to the bill credit note.""" + + status: BillCreditNoteStatus + r"""Current state of the bill credit note""" + + sub_total: Annotated[ + Annotated[ + Decimal, + BeforeValidator(validate_decimal), + PlainSerializer(serialize_decimal(False)), + ], + pydantic.Field(alias="subTotal"), + ] + r"""Total amount of the bill credit note, including discounts but excluding tax.""" + + total_amount: Annotated[ + Annotated[ + Decimal, + BeforeValidator(validate_decimal), + PlainSerializer(serialize_decimal(False)), + ], + pydantic.Field(alias="totalAmount"), + ] + r"""Total amount of credit that has been applied to the business' account with the supplier, including discounts and tax.""" + + total_discount: Annotated[ + Annotated[ + Decimal, + BeforeValidator(validate_decimal), + PlainSerializer(serialize_decimal(False)), + ], + pydantic.Field(alias="totalDiscount"), + ] + r"""Total value of any discounts applied.""" + + total_tax_amount: Annotated[ + Annotated[ + Decimal, + BeforeValidator(validate_decimal), + PlainSerializer(serialize_decimal(False)), + ], + pydantic.Field(alias="totalTaxAmount"), + ] + r"""Amount of tax included in the bill credit note.""" + + allocated_on_date: Annotated[ + Optional[str], pydantic.Field(alias="allocatedOnDate") + ] = 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: + + ``` + 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. + """ + + bill_credit_note_number: Annotated[ + OptionalNullable[str], pydantic.Field(alias="billCreditNoteNumber") + ] = UNSET + r"""Friendly reference for the bill credit note.""" + + created_from_refs: Annotated[ + OptionalNullable[List[CreateBillCreditNoteResponseRecordReference]], + pydantic.Field(alias="createdFromRefs"), + ] = UNSET + r"""An array of records the credit note was created from.""" + + currency: Optional[str] = None + r"""The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + + ## Unknown currencies + + In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + + There are only a very small number of edge cases where this currency code is returned by the Codat system. + """ + + currency_rate: Annotated[ + Annotated[ + OptionalNullable[Decimal], + BeforeValidator(validate_decimal), + PlainSerializer(serialize_decimal(False)), + ], + pydantic.Field(alias="currencyRate"), + ] = UNSET + r"""Rate to convert the total amount of the payment into the base currency for the company at the time of the payment. + + Currency rates in Codat are implemented as the multiple of foreign currency units to each base currency unit. + + It is not possible to perform the currency conversion with two or more non-base currencies participating in the transaction. For example, if a company's base currency is USD, and it has a bill issued in EUR, then the bill payment must happen in USD or EUR. + + Where the currency rate is provided by the underlying accounting software, it will be available from Codat with the same precision (up to a maximum of 9 decimal places). + + For accounting software which do not provide an explicit currency rate, it is calculated as `baseCurrency / foreignCurrency` and will be returned to 9 decimal places. + + ## Examples with base currency of GBP + + | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (GBP) | + | :--------------- | :------------- | :------------ | :------------------------- | + | **USD** | $20 | 0.781 | £15.62 | + | **EUR** | €20 | 0.885 | £17.70 | + | **RUB** | ₽20 | 0.011 | £0.22 | + + ## Examples with base currency of USD + + | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (USD) | + | :--------------- | :------------- | :------------ | :------------------------- | + | **GBP** | £20 | 1.277 | $25.54 | + | **EUR** | €20 | 1.134 | $22.68 | + | **RUB** | ₽20 | 0.015 | $0.30 | + + + ### Integration-specific details + + | Integration | Scenario | System behavior | + |-------------------|-------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------| + | QuickBooks Online | Transaction currency differs from base currency | If currency rate value is left `null`, a rate of 1 will be used by QBO by default. To override this, specify a currencyRate in the request body. | + """ + + id: Optional[str] = None + r"""Identifier for the bill credit note that is unique to a company in the accounting software.""" + + issue_date: Annotated[Optional[str], pydantic.Field(alias="issueDate")] = 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: + + ``` + 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. + """ + + line_items: Annotated[ + OptionalNullable[List[BillCreditNoteLineItem]], + pydantic.Field(alias="lineItems"), + ] = UNSET + r"""An array of line""" + + metadata: Optional[Metadata] = None + + modified_date: Annotated[Optional[str], pydantic.Field(alias="modifiedDate")] = None + + note: OptionalNullable[str] = UNSET + r"""Any additional information about the bill credit note.""" + + payment_allocations: Annotated[ + OptionalNullable[List[Items]], pydantic.Field(alias="paymentAllocations") + ] = UNSET + r"""An array of payment allocations.""" + + remaining_credit: Annotated[ + Annotated[ + Optional[Decimal], + BeforeValidator(validate_decimal), + PlainSerializer(serialize_decimal(False)), + ], + pydantic.Field(alias="remainingCredit"), + ] = None + r"""Amount of the bill credit note that is still outstanding.""" + + source_modified_date: Annotated[ + Optional[str], pydantic.Field(alias="sourceModifiedDate") + ] = None + + supplemental_data: Annotated[ + Optional[SupplementalData], pydantic.Field(alias="supplementalData") + ] = None + r"""Supplemental data is additional data you can include in our standard data types. + + It is referenced as a configured dynamic key value pair that is unique to the accounting software. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. + """ + + supplier_ref: Annotated[ + Optional[SupplierRef], pydantic.Field(alias="supplierRef") + ] = None + r"""Reference to the supplier the record relates to.""" + + withholding_tax: Annotated[ + OptionalNullable[List[WithholdingTaxItems]], + pydantic.Field(alias="withholdingTax"), + ] = UNSET + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = [ + "allocatedOnDate", + "billCreditNoteNumber", + "createdFromRefs", + "currency", + "currencyRate", + "id", + "issueDate", + "lineItems", + "metadata", + "modifiedDate", + "note", + "paymentAllocations", + "remainingCredit", + "sourceModifiedDate", + "supplementalData", + "supplierRef", + "withholdingTax", + ] + nullable_fields = [ + "billCreditNoteNumber", + "createdFromRefs", + "currencyRate", + "lineItems", + "note", + "paymentAllocations", + "withholdingTax", + ] + null_default_fields = [] + + serialized = handler(self) + + m = {} + + for n, f in self.model_fields.items(): + k = f.alias or n + val = serialized.get(k) + serialized.pop(k, None) + + optional_nullable = k in optional_fields and k in nullable_fields + is_set = ( + self.__pydantic_fields_set__.intersection({n}) + or k in null_default_fields + ) # pylint: disable=no-member + + if val is not None and val != UNSET_SENTINEL: + m[k] = val + elif val != UNSET_SENTINEL and ( + not k in optional_fields or (optional_nullable and is_set) + ): + m[k] = val + + return m + + +class CreateBillCreditNoteResponseTypedDict(TypedDict): + company_id: str + r"""Unique identifier for your SMB in Codat.""" + data_connection_key: str + r"""Unique identifier for a company's data connection.""" + push_operation_key: str + r"""A unique identifier generated by Codat to represent this single push operation. This identifier can be used to track the status of the push, and should be persisted.""" + requested_on_utc: 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: + + ``` + 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. + """ + status: PushOperationStatus + r"""The current status of the push operation.""" + status_code: int + r"""Push status code.""" + changes: NotRequired[Nullable[List[PushOperationChangeTypedDict]]] + r"""Contains a single entry that communicates which record has changed and the manner in which it changed.""" + completed_on_utc: 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: + + ``` + 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. + """ + data: NotRequired[Nullable[AccountingBillCreditNoteTypedDict]] + data_type: NotRequired[DataType] + r"""Available data types""" + error_message: NotRequired[Nullable[str]] + r"""A message about the error.""" + timeout_in_minutes: NotRequired[Nullable[int]] + r"""Number of minutes the push operation must complete within before it times out.""" + timeout_in_seconds: NotRequired[Nullable[int]] + r"""Number of seconds the push operation must complete within before it times out.""" + validation: NotRequired[ValidationTypedDict] + r"""A human-readable object describing validation decisions Codat has made when pushing data into the platform. If a push has failed because of validation errors, they will be detailed here.""" + + +class CreateBillCreditNoteResponse(BaseModel): + company_id: Annotated[str, pydantic.Field(alias="companyId")] + r"""Unique identifier for your SMB in Codat.""" + + data_connection_key: Annotated[str, pydantic.Field(alias="dataConnectionKey")] + r"""Unique identifier for a company's data connection.""" + + push_operation_key: Annotated[str, pydantic.Field(alias="pushOperationKey")] + r"""A unique identifier generated by Codat to represent this single push operation. This identifier can be used to track the status of the push, and should be persisted.""" + + requested_on_utc: Annotated[str, pydantic.Field(alias="requestedOnUtc")] + 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: + + ``` + 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. + """ + + status: PushOperationStatus + r"""The current status of the push operation.""" + + status_code: Annotated[int, pydantic.Field(alias="statusCode")] + r"""Push status code.""" + + changes: OptionalNullable[List[PushOperationChange]] = UNSET + r"""Contains a single entry that communicates which record has changed and the manner in which it changed.""" + + completed_on_utc: Annotated[ + Optional[str], pydantic.Field(alias="completedOnUtc") + ] = 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: + + ``` + 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. + """ + + data: OptionalNullable[AccountingBillCreditNote] = UNSET + + data_type: Annotated[Optional[DataType], pydantic.Field(alias="dataType")] = None + r"""Available data types""" + + error_message: Annotated[ + OptionalNullable[str], pydantic.Field(alias="errorMessage") + ] = UNSET + r"""A message about the error.""" + + timeout_in_minutes: Annotated[ + OptionalNullable[int], pydantic.Field(alias="timeoutInMinutes") + ] = UNSET + r"""Number of minutes the push operation must complete within before it times out.""" + + timeout_in_seconds: Annotated[ + OptionalNullable[int], + pydantic.Field( + deprecated="warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible.", + alias="timeoutInSeconds", + ), + ] = UNSET + r"""Number of seconds the push operation must complete within before it times out.""" + + validation: Optional[Validation] = None + r"""A human-readable object describing validation decisions Codat has made when pushing data into the platform. If a push has failed because of validation errors, they will be detailed here.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = [ + "changes", + "completedOnUtc", + "data", + "dataType", + "errorMessage", + "timeoutInMinutes", + "timeoutInSeconds", + "validation", + ] + nullable_fields = [ + "changes", + "data", + "errorMessage", + "timeoutInMinutes", + "timeoutInSeconds", + ] + null_default_fields = [] + + serialized = handler(self) + + m = {} + + for n, f in self.model_fields.items(): + k = f.alias or n + val = serialized.get(k) + serialized.pop(k, None) + + optional_nullable = k in optional_fields and k in nullable_fields + is_set = ( + self.__pydantic_fields_set__.intersection({n}) + or k in null_default_fields + ) # pylint: disable=no-member + + if val is not None and val != UNSET_SENTINEL: + m[k] = val + elif val != UNSET_SENTINEL and ( + not k in optional_fields or (optional_nullable and is_set) + ): + m[k] = val + + return m diff --git a/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/createbillpaymentresponse.py b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/createbillpaymentresponse.py new file mode 100644 index 000000000..d966235b9 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/createbillpaymentresponse.py @@ -0,0 +1,751 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .accountref import AccountRef, AccountRefTypedDict +from .billpaymentline import BillPaymentLine, BillPaymentLineTypedDict +from .datatype import DataType +from .metadata import Metadata, MetadataTypedDict +from .paymentmethodref import PaymentMethodRef, PaymentMethodRefTypedDict +from .pushoperationchange import PushOperationChange, PushOperationChangeTypedDict +from .pushoperationstatus import PushOperationStatus +from .supplementaldata import SupplementalData, SupplementalDataTypedDict +from .supplierref import SupplierRef, SupplierRefTypedDict +from .validation import Validation, ValidationTypedDict +from codat_sync_for_payables_version_1.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from codat_sync_for_payables_version_1.utils import serialize_decimal, validate_decimal +from decimal import Decimal +import pydantic +from pydantic import model_serializer +from pydantic.functional_serializers import PlainSerializer +from pydantic.functional_validators import BeforeValidator +from typing import List, Optional +from typing_extensions import Annotated, NotRequired, TypedDict, deprecated + + +@deprecated( + "warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible." +) +class AccountingBillPaymentTypedDict(TypedDict): + r"""> **Bill payments or payments?** + > + > We distinguish between transactions where the company received money vs. paid money. If the transaction represents a company spending money (accounts payable) we call this a Bill payment. + > + > See [payments](https://docs.codat.io/sync-for-payables-api#/schemas/Payment) for the accounts receivable equivalent of Bill payments, which covers [invoices](https://docs.codat.io/sync-for-payables-api#/schemas/Invoice) and [credit notes](https://docs.codat.io/sync-for-payables-api#/schemas/CreditNote). + + > View the coverage for bill payments in the Data coverage explorer. + + ## Overview + + Bill payments include all accounts payable transaction data ([bills](https://docs.codat.io/sync-for-payables-api#/schemas/Bill) and [credit notes against bills](https://docs.codat.io/sync-for-payables-api#/schemas/BillCreditNote)). + + A bill payment in Codat usually represents an allocation of money within any customer accounts payable account. This includes, but is not strictly limited to: + + - A payment made against a bill — for example, a credit card payment, cheque payment, or cash payment. + - An allocation of a supplier's credit note to a bill or perhaps a refund. + - A bill payment made directly to an accounts payable account. This could be an overpayment or a prepayment, or a refund of a payment made directly to an accounts payable account. + + Depending on the bill payments which are allowed by the underlying accounting software, some of these types may be combined. Please see the example data section for samples of what these cases look like. + + In Codat, a bill payment contains details of: + + - When the bill payment was recorded in the accounting system. + - How much it is for and in the currency. + - Who the payment has been paid to, the _supplier_. + - The types of bill payments, the _line items_. + + Some accounting software give a separate name to purchases where the payment is made immediately, such as something bought with a credit card or online payment. One example of this would be QuickBooks Online's _expenses_. You can find these types of transactions in our [Direct costs](https://docs.codat.io/sync-for-payables-api#/schemas/DirectCost) data model. + + Bill payments is a child data type of [account transactions](https://docs.codat.io/sync-for-payables-api#/schemas/AccountTransaction). + + --- + + ## Bill payment types + + ### Payment of a bill + + A payment paying a single bill should have the following properties: + + - A `totalAmount` indicating the amount of the bill that was paid. This is always positive. + - A `lines` array containing one element with the following properties: + - An `amount` equal to the `totalAmount` above. + - A `links` array containing one element with the following properties: + - A `type` indicating the type of link, in this case a `Bill`. + - An `id` containing the ID of the bill that was paid. + - An amount of `-totalAmount` (negative `totalAmount`), indicating that the entirety of the paid amount is allocated to the bill. + + ### Payment of multiple bills + + It is possible for one payment to pay multiple bills. This can be represented using two possible formats, depending on how the supplier keeps their books: + + 1. The payment has multiple entries in its **lines** array, one for each bill that is paid. Each line will follow the above example for paying a bill, and the rules detailed in the data model. + 2. The payment has a line with multiple links to each bill. This occurs when the proportion of the original payment allocated to each bill is not available. + + Each line is the same as those described above, with the **amount** indicating how much of the payment is allocated to the bill. The **amount** on the lines sum to the **totalAmount** on the payment. + + > Pushing batch payments to Xero + > + > When pushing a single bill payment to Xero to pay multiple bills, only the first format is supported—multiple entries in the payment **lines** array. + + ### Payments and refunds on account + + A payment on account, that is a payment that doesn’t pay a specific bill, has one entry in its lines array. + + The line has the following properties: + + - A **totalAmount** indicating the amount paid by a supplier or refunded to them by a company. A payment to the supplier is always negative. A refund is always positive. + - A **links** array containing one element with the following properties: + - A **type** indicating the type of link. For a payment this is `PaymentOnAccount`. For a refund this is `Refund`. + - The **id** containing the ID of the supplier. + - An amount for the link is `0` **totalAmount** or the amount of the payment or refund. + + It is possible to have a payment that is part on account and part allocated to a bill. Each line should follow the examples above. + + ### Using a credit note to pay a bill + + The payment of a bill using a credit note has one entry in its `lines` array. This **line** has the following properties: + + - An **amount** indicating the amount of money moved, which in this case is `0`, as the credit note and bill allocation must balance each other. + - A **links** array containing two elements: + - The first link has: + - A **type** indicating the type of link, in this case a `Bill`. + - An **id** containing the ID of the bill that was paid. + - The second link has: + - A **type** indicating the type of link, in this case a `CreditNote`. + - An **id** containing the ID of the credit note used by this payment. + + The **amount** field on the **line** equals the **totalAmount** on the payment. + + ### Refunding a credit note + + A bill payment refunding a credit note has one entry in its **lines** array. This line has the following properties: + + - An **amount** indicating the amount of the credit note that was refunded. This is always negative, indicating that it is a refund. + - A **links** array containing one element with the following properties: + - A **type** indicating the type of `link`, in this case a `CreditNote`. + - An **id** containing the ID of the credit note that was refunded. + + The **totalAmount** field on the payment equals the line's **amount** field. These are both negative, as this is money leaving accounts payable. + + ### Refunding a payment + + If a payment is refunded, for example, when a company overpaid a bill and the overpayment is returned, there are two payment records: + + - One for the incoming overpayment. + - Another for the outgoing refund. + + The payment issuing the refund is identified by the fact that the **totalAmount** is negative. This payment has one entry in its lines array that have the following properties: + + - An **amount** indicating the amount that was refunded. This is always negative. + - A **links** array containing one element with the following properties: + - A **type** indicating the type of a the link, in this case a `BillPayment`. + - An **id** containing the ID of the payment that was refunded. + + The **amount** field on the line equals the **totalAmount** on the payment and is negative as this is money leaving accounts payable. + + The payment that was refunded can be identified as it has a line where the `amount` on its `line` is positive and the type of the link is `Refund`. This payment may have several entries in its **lines** array if it was partly used to pay an bill. For example, a £1,050 payment paying a £1,000 bill with a refund of £50 has two lines: + + - One for £1,000 linked to the bill that was paid + - Another for £50 linked to the payment that refunded the over payment. This link is of type `Refund` but the ID corresponds to a bill payment. + + The line linked to the bill payment has the following properties: + + - An **amount** indicating the amount that was refunded. This is positive as its money that was added to accounts payable, but is balanced out by the negative amount of the refund. + - A **links** array containing one element with the following properties: + - A **type** indicating the type of the link, in this case a `Refund`. + - An **id** containing the ID of the payment that refunded this line. + + > Linked payments + > + > Not all accounting software support linked payments in this way. In these platforms you may see a payment on account and a refund on account. + + ## Foreign currencies + + There are two types of currency rate that are detailed in the bill payments data type: + + Payment currency rate: + + - Base currency of the accounts payable account. + - Foreign currency of the bill payment. + + Payment line link currency rate: + + - Base currency of the item that the link represents. + - Foreign currency of the payment. + + These two rates allow the calculation of currency loss or gain for any of the transactions affected by the payment lines. The second rate is used when a bill payment is applied to an item in a currency that does not match either: + + - The base currency for the accounts payable account. + - The currency of the item. + + """ + + date_: str + account_ref: NotRequired[AccountRefTypedDict] + r"""Data types that reference an account, for example bill and invoice line items, use an accountRef that includes the ID and name of the linked account.""" + currency: NotRequired[str] + currency_rate: NotRequired[Nullable[Decimal]] + r"""Rate to convert the total amount of the payment into the base currency for the company at the time of the payment. + + Currency rates in Codat are implemented as the multiple of foreign currency units to each base currency unit. + + It is not possible to perform the currency conversion with two or more non-base currencies participating in the transaction. For example, if a company's base currency is USD, and it has a bill issued in EUR, then the bill payment must happen in USD or EUR. + + Where the currency rate is provided by the underlying accounting software, it will be available from Codat with the same precision (up to a maximum of 9 decimal places). + + For accounting software which do not provide an explicit currency rate, it is calculated as `baseCurrency / foreignCurrency` and will be returned to 9 decimal places. + + ## Examples with base currency of GBP + + | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (GBP) | + | :--------------- | :------------- | :------------ | :------------------------- | + | **USD** | $20 | 0.781 | £15.62 | + | **EUR** | €20 | 0.885 | £17.70 | + | **RUB** | ₽20 | 0.011 | £0.22 | + + ## Examples with base currency of USD + + | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (USD) | + | :--------------- | :------------- | :------------ | :------------------------- | + | **GBP** | £20 | 1.277 | $25.54 | + | **EUR** | €20 | 1.134 | $22.68 | + | **RUB** | ₽20 | 0.015 | $0.30 | + + + ### Integration-specific details + + | Integration | Scenario | System behavior | + |-------------------|-------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------| + | QuickBooks Online | Transaction currency differs from base currency | If currency rate value is left `null`, a rate of 1 will be used by QBO by default. To override this, specify a currencyRate in the request body. | + """ + id: NotRequired[str] + r"""Identifier for the bill payment, unique for the company in the accounting software.""" + lines: NotRequired[Nullable[List[BillPaymentLineTypedDict]]] + r"""An array of bill payment lines.""" + metadata: NotRequired[MetadataTypedDict] + modified_date: NotRequired[str] + note: NotRequired[Nullable[str]] + r"""Additional information associated with the payment.""" + payment_method_ref: NotRequired[PaymentMethodRefTypedDict] + reference: NotRequired[Nullable[str]] + r"""Additional information associated with the payment.""" + source_modified_date: NotRequired[str] + supplemental_data: NotRequired[SupplementalDataTypedDict] + r"""Supplemental data is additional data you can include in our standard data types. + + It is referenced as a configured dynamic key value pair that is unique to the accounting software. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. + """ + supplier_ref: NotRequired[SupplierRefTypedDict] + total_amount: NotRequired[Decimal] + r"""Amount of the payment in the payment currency. This value never changes and represents the amount of money that is paid into the supplier's account.""" + + +@deprecated( + "warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible." +) +class AccountingBillPayment(BaseModel): + r"""> **Bill payments or payments?** + > + > We distinguish between transactions where the company received money vs. paid money. If the transaction represents a company spending money (accounts payable) we call this a Bill payment. + > + > See [payments](https://docs.codat.io/sync-for-payables-api#/schemas/Payment) for the accounts receivable equivalent of Bill payments, which covers [invoices](https://docs.codat.io/sync-for-payables-api#/schemas/Invoice) and [credit notes](https://docs.codat.io/sync-for-payables-api#/schemas/CreditNote). + + > View the coverage for bill payments in the Data coverage explorer. + + ## Overview + + Bill payments include all accounts payable transaction data ([bills](https://docs.codat.io/sync-for-payables-api#/schemas/Bill) and [credit notes against bills](https://docs.codat.io/sync-for-payables-api#/schemas/BillCreditNote)). + + A bill payment in Codat usually represents an allocation of money within any customer accounts payable account. This includes, but is not strictly limited to: + + - A payment made against a bill — for example, a credit card payment, cheque payment, or cash payment. + - An allocation of a supplier's credit note to a bill or perhaps a refund. + - A bill payment made directly to an accounts payable account. This could be an overpayment or a prepayment, or a refund of a payment made directly to an accounts payable account. + + Depending on the bill payments which are allowed by the underlying accounting software, some of these types may be combined. Please see the example data section for samples of what these cases look like. + + In Codat, a bill payment contains details of: + + - When the bill payment was recorded in the accounting system. + - How much it is for and in the currency. + - Who the payment has been paid to, the _supplier_. + - The types of bill payments, the _line items_. + + Some accounting software give a separate name to purchases where the payment is made immediately, such as something bought with a credit card or online payment. One example of this would be QuickBooks Online's _expenses_. You can find these types of transactions in our [Direct costs](https://docs.codat.io/sync-for-payables-api#/schemas/DirectCost) data model. + + Bill payments is a child data type of [account transactions](https://docs.codat.io/sync-for-payables-api#/schemas/AccountTransaction). + + --- + + ## Bill payment types + + ### Payment of a bill + + A payment paying a single bill should have the following properties: + + - A `totalAmount` indicating the amount of the bill that was paid. This is always positive. + - A `lines` array containing one element with the following properties: + - An `amount` equal to the `totalAmount` above. + - A `links` array containing one element with the following properties: + - A `type` indicating the type of link, in this case a `Bill`. + - An `id` containing the ID of the bill that was paid. + - An amount of `-totalAmount` (negative `totalAmount`), indicating that the entirety of the paid amount is allocated to the bill. + + ### Payment of multiple bills + + It is possible for one payment to pay multiple bills. This can be represented using two possible formats, depending on how the supplier keeps their books: + + 1. The payment has multiple entries in its **lines** array, one for each bill that is paid. Each line will follow the above example for paying a bill, and the rules detailed in the data model. + 2. The payment has a line with multiple links to each bill. This occurs when the proportion of the original payment allocated to each bill is not available. + + Each line is the same as those described above, with the **amount** indicating how much of the payment is allocated to the bill. The **amount** on the lines sum to the **totalAmount** on the payment. + + > Pushing batch payments to Xero + > + > When pushing a single bill payment to Xero to pay multiple bills, only the first format is supported—multiple entries in the payment **lines** array. + + ### Payments and refunds on account + + A payment on account, that is a payment that doesn’t pay a specific bill, has one entry in its lines array. + + The line has the following properties: + + - A **totalAmount** indicating the amount paid by a supplier or refunded to them by a company. A payment to the supplier is always negative. A refund is always positive. + - A **links** array containing one element with the following properties: + - A **type** indicating the type of link. For a payment this is `PaymentOnAccount`. For a refund this is `Refund`. + - The **id** containing the ID of the supplier. + - An amount for the link is `0` **totalAmount** or the amount of the payment or refund. + + It is possible to have a payment that is part on account and part allocated to a bill. Each line should follow the examples above. + + ### Using a credit note to pay a bill + + The payment of a bill using a credit note has one entry in its `lines` array. This **line** has the following properties: + + - An **amount** indicating the amount of money moved, which in this case is `0`, as the credit note and bill allocation must balance each other. + - A **links** array containing two elements: + - The first link has: + - A **type** indicating the type of link, in this case a `Bill`. + - An **id** containing the ID of the bill that was paid. + - The second link has: + - A **type** indicating the type of link, in this case a `CreditNote`. + - An **id** containing the ID of the credit note used by this payment. + + The **amount** field on the **line** equals the **totalAmount** on the payment. + + ### Refunding a credit note + + A bill payment refunding a credit note has one entry in its **lines** array. This line has the following properties: + + - An **amount** indicating the amount of the credit note that was refunded. This is always negative, indicating that it is a refund. + - A **links** array containing one element with the following properties: + - A **type** indicating the type of `link`, in this case a `CreditNote`. + - An **id** containing the ID of the credit note that was refunded. + + The **totalAmount** field on the payment equals the line's **amount** field. These are both negative, as this is money leaving accounts payable. + + ### Refunding a payment + + If a payment is refunded, for example, when a company overpaid a bill and the overpayment is returned, there are two payment records: + + - One for the incoming overpayment. + - Another for the outgoing refund. + + The payment issuing the refund is identified by the fact that the **totalAmount** is negative. This payment has one entry in its lines array that have the following properties: + + - An **amount** indicating the amount that was refunded. This is always negative. + - A **links** array containing one element with the following properties: + - A **type** indicating the type of a the link, in this case a `BillPayment`. + - An **id** containing the ID of the payment that was refunded. + + The **amount** field on the line equals the **totalAmount** on the payment and is negative as this is money leaving accounts payable. + + The payment that was refunded can be identified as it has a line where the `amount` on its `line` is positive and the type of the link is `Refund`. This payment may have several entries in its **lines** array if it was partly used to pay an bill. For example, a £1,050 payment paying a £1,000 bill with a refund of £50 has two lines: + + - One for £1,000 linked to the bill that was paid + - Another for £50 linked to the payment that refunded the over payment. This link is of type `Refund` but the ID corresponds to a bill payment. + + The line linked to the bill payment has the following properties: + + - An **amount** indicating the amount that was refunded. This is positive as its money that was added to accounts payable, but is balanced out by the negative amount of the refund. + - A **links** array containing one element with the following properties: + - A **type** indicating the type of the link, in this case a `Refund`. + - An **id** containing the ID of the payment that refunded this line. + + > Linked payments + > + > Not all accounting software support linked payments in this way. In these platforms you may see a payment on account and a refund on account. + + ## Foreign currencies + + There are two types of currency rate that are detailed in the bill payments data type: + + Payment currency rate: + + - Base currency of the accounts payable account. + - Foreign currency of the bill payment. + + Payment line link currency rate: + + - Base currency of the item that the link represents. + - Foreign currency of the payment. + + These two rates allow the calculation of currency loss or gain for any of the transactions affected by the payment lines. The second rate is used when a bill payment is applied to an item in a currency that does not match either: + + - The base currency for the accounts payable account. + - The currency of the item. + + """ + + date_: Annotated[str, pydantic.Field(alias="date")] + + account_ref: Annotated[Optional[AccountRef], pydantic.Field(alias="accountRef")] = ( + None + ) + r"""Data types that reference an account, for example bill and invoice line items, use an accountRef that includes the ID and name of the linked account.""" + + currency: Optional[str] = None + + currency_rate: Annotated[ + Annotated[ + OptionalNullable[Decimal], + BeforeValidator(validate_decimal), + PlainSerializer(serialize_decimal(False)), + ], + pydantic.Field(alias="currencyRate"), + ] = UNSET + r"""Rate to convert the total amount of the payment into the base currency for the company at the time of the payment. + + Currency rates in Codat are implemented as the multiple of foreign currency units to each base currency unit. + + It is not possible to perform the currency conversion with two or more non-base currencies participating in the transaction. For example, if a company's base currency is USD, and it has a bill issued in EUR, then the bill payment must happen in USD or EUR. + + Where the currency rate is provided by the underlying accounting software, it will be available from Codat with the same precision (up to a maximum of 9 decimal places). + + For accounting software which do not provide an explicit currency rate, it is calculated as `baseCurrency / foreignCurrency` and will be returned to 9 decimal places. + + ## Examples with base currency of GBP + + | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (GBP) | + | :--------------- | :------------- | :------------ | :------------------------- | + | **USD** | $20 | 0.781 | £15.62 | + | **EUR** | €20 | 0.885 | £17.70 | + | **RUB** | ₽20 | 0.011 | £0.22 | + + ## Examples with base currency of USD + + | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (USD) | + | :--------------- | :------------- | :------------ | :------------------------- | + | **GBP** | £20 | 1.277 | $25.54 | + | **EUR** | €20 | 1.134 | $22.68 | + | **RUB** | ₽20 | 0.015 | $0.30 | + + + ### Integration-specific details + + | Integration | Scenario | System behavior | + |-------------------|-------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------| + | QuickBooks Online | Transaction currency differs from base currency | If currency rate value is left `null`, a rate of 1 will be used by QBO by default. To override this, specify a currencyRate in the request body. | + """ + + id: Optional[str] = None + r"""Identifier for the bill payment, unique for the company in the accounting software.""" + + lines: OptionalNullable[List[BillPaymentLine]] = UNSET + r"""An array of bill payment lines.""" + + metadata: Optional[Metadata] = None + + modified_date: Annotated[Optional[str], pydantic.Field(alias="modifiedDate")] = None + + note: OptionalNullable[str] = UNSET + r"""Additional information associated with the payment.""" + + payment_method_ref: Annotated[ + Optional[PaymentMethodRef], pydantic.Field(alias="paymentMethodRef") + ] = None + + reference: OptionalNullable[str] = UNSET + r"""Additional information associated with the payment.""" + + source_modified_date: Annotated[ + Optional[str], pydantic.Field(alias="sourceModifiedDate") + ] = None + + supplemental_data: Annotated[ + Optional[SupplementalData], pydantic.Field(alias="supplementalData") + ] = None + r"""Supplemental data is additional data you can include in our standard data types. + + It is referenced as a configured dynamic key value pair that is unique to the accounting software. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. + """ + + supplier_ref: Annotated[ + Optional[SupplierRef], pydantic.Field(alias="supplierRef") + ] = None + + total_amount: Annotated[ + Annotated[ + Optional[Decimal], + BeforeValidator(validate_decimal), + PlainSerializer(serialize_decimal(False)), + ], + pydantic.Field(alias="totalAmount"), + ] = None + r"""Amount of the payment in the payment currency. This value never changes and represents the amount of money that is paid into the supplier's account.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = [ + "accountRef", + "currency", + "currencyRate", + "id", + "lines", + "metadata", + "modifiedDate", + "note", + "paymentMethodRef", + "reference", + "sourceModifiedDate", + "supplementalData", + "supplierRef", + "totalAmount", + ] + nullable_fields = ["currencyRate", "lines", "note", "reference"] + null_default_fields = [] + + serialized = handler(self) + + m = {} + + for n, f in self.model_fields.items(): + k = f.alias or n + val = serialized.get(k) + serialized.pop(k, None) + + optional_nullable = k in optional_fields and k in nullable_fields + is_set = ( + self.__pydantic_fields_set__.intersection({n}) + or k in null_default_fields + ) # pylint: disable=no-member + + if val is not None and val != UNSET_SENTINEL: + m[k] = val + elif val != UNSET_SENTINEL and ( + not k in optional_fields or (optional_nullable and is_set) + ): + m[k] = val + + return m + + +class CreateBillPaymentResponseTypedDict(TypedDict): + company_id: str + r"""Unique identifier for your SMB in Codat.""" + data_connection_key: str + r"""Unique identifier for a company's data connection.""" + push_operation_key: str + r"""A unique identifier generated by Codat to represent this single push operation. This identifier can be used to track the status of the push, and should be persisted.""" + requested_on_utc: 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: + + ``` + 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. + """ + status: PushOperationStatus + r"""The current status of the push operation.""" + status_code: int + r"""Push status code.""" + changes: NotRequired[Nullable[List[PushOperationChangeTypedDict]]] + r"""Contains a single entry that communicates which record has changed and the manner in which it changed.""" + completed_on_utc: 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: + + ``` + 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. + """ + data: NotRequired[Nullable[AccountingBillPaymentTypedDict]] + data_type: NotRequired[DataType] + r"""Available data types""" + error_message: NotRequired[Nullable[str]] + r"""A message about the error.""" + timeout_in_minutes: NotRequired[Nullable[int]] + r"""Number of minutes the push operation must complete within before it times out.""" + timeout_in_seconds: NotRequired[Nullable[int]] + r"""Number of seconds the push operation must complete within before it times out.""" + validation: NotRequired[ValidationTypedDict] + r"""A human-readable object describing validation decisions Codat has made when pushing data into the platform. If a push has failed because of validation errors, they will be detailed here.""" + + +class CreateBillPaymentResponse(BaseModel): + company_id: Annotated[str, pydantic.Field(alias="companyId")] + r"""Unique identifier for your SMB in Codat.""" + + data_connection_key: Annotated[str, pydantic.Field(alias="dataConnectionKey")] + r"""Unique identifier for a company's data connection.""" + + push_operation_key: Annotated[str, pydantic.Field(alias="pushOperationKey")] + r"""A unique identifier generated by Codat to represent this single push operation. This identifier can be used to track the status of the push, and should be persisted.""" + + requested_on_utc: Annotated[str, pydantic.Field(alias="requestedOnUtc")] + 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: + + ``` + 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. + """ + + status: PushOperationStatus + r"""The current status of the push operation.""" + + status_code: Annotated[int, pydantic.Field(alias="statusCode")] + r"""Push status code.""" + + changes: OptionalNullable[List[PushOperationChange]] = UNSET + r"""Contains a single entry that communicates which record has changed and the manner in which it changed.""" + + completed_on_utc: Annotated[ + Optional[str], pydantic.Field(alias="completedOnUtc") + ] = 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: + + ``` + 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. + """ + + data: OptionalNullable[AccountingBillPayment] = UNSET + + data_type: Annotated[Optional[DataType], pydantic.Field(alias="dataType")] = None + r"""Available data types""" + + error_message: Annotated[ + OptionalNullable[str], pydantic.Field(alias="errorMessage") + ] = UNSET + r"""A message about the error.""" + + timeout_in_minutes: Annotated[ + OptionalNullable[int], pydantic.Field(alias="timeoutInMinutes") + ] = UNSET + r"""Number of minutes the push operation must complete within before it times out.""" + + timeout_in_seconds: Annotated[ + OptionalNullable[int], + pydantic.Field( + deprecated="warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible.", + alias="timeoutInSeconds", + ), + ] = UNSET + r"""Number of seconds the push operation must complete within before it times out.""" + + validation: Optional[Validation] = None + r"""A human-readable object describing validation decisions Codat has made when pushing data into the platform. If a push has failed because of validation errors, they will be detailed here.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = [ + "changes", + "completedOnUtc", + "data", + "dataType", + "errorMessage", + "timeoutInMinutes", + "timeoutInSeconds", + "validation", + ] + nullable_fields = [ + "changes", + "data", + "errorMessage", + "timeoutInMinutes", + "timeoutInSeconds", + ] + null_default_fields = [] + + serialized = handler(self) + + m = {} + + for n, f in self.model_fields.items(): + k = f.alias or n + val = serialized.get(k) + serialized.pop(k, None) + + optional_nullable = k in optional_fields and k in nullable_fields + is_set = ( + self.__pydantic_fields_set__.intersection({n}) + or k in null_default_fields + ) # pylint: disable=no-member + + if val is not None and val != UNSET_SENTINEL: + m[k] = val + elif val != UNSET_SENTINEL and ( + not k in optional_fields or (optional_nullable and is_set) + ): + m[k] = val + + return m diff --git a/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/createbillresponse.py b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/createbillresponse.py new file mode 100644 index 000000000..8d3bb97aa --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/createbillresponse.py @@ -0,0 +1,843 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .billlineitem import BillLineItem, BillLineItemTypedDict +from .billstatus import BillStatus +from .datatype import DataType +from .metadata import Metadata, MetadataTypedDict +from .paymentallocationpayment import ( + PaymentAllocationPayment, + PaymentAllocationPaymentTypedDict, +) +from .pushoperationchange import PushOperationChange, PushOperationChangeTypedDict +from .pushoperationstatus import PushOperationStatus +from .supplementaldata import SupplementalData, SupplementalDataTypedDict +from .supplierref import SupplierRef, SupplierRefTypedDict +from .validation import Validation, ValidationTypedDict +from codat_sync_for_payables_version_1.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from codat_sync_for_payables_version_1.utils import serialize_decimal, validate_decimal +from decimal import Decimal +import pydantic +from pydantic import model_serializer +from pydantic.functional_serializers import PlainSerializer +from pydantic.functional_validators import BeforeValidator +from typing import List, Optional +from typing_extensions import Annotated, NotRequired, TypedDict, deprecated + + +class CreateBillResponseAllocationTypedDict(TypedDict): + allocated_on_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: + + ``` + 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. + """ + currency: NotRequired[str] + r"""The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + + ## Unknown currencies + + In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + + There are only a very small number of edge cases where this currency code is returned by the Codat system. + """ + currency_rate: NotRequired[Nullable[Decimal]] + r"""Rate to convert the total amount of the payment into the base currency for the company at the time of the payment. + + Currency rates in Codat are implemented as the multiple of foreign currency units to each base currency unit. + + It is not possible to perform the currency conversion with two or more non-base currencies participating in the transaction. For example, if a company's base currency is USD, and it has a bill issued in EUR, then the bill payment must happen in USD or EUR. + + Where the currency rate is provided by the underlying accounting software, it will be available from Codat with the same precision (up to a maximum of 9 decimal places). + + For accounting software which do not provide an explicit currency rate, it is calculated as `baseCurrency / foreignCurrency` and will be returned to 9 decimal places. + + ## Examples with base currency of GBP + + | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (GBP) | + | :--------------- | :------------- | :------------ | :------------------------- | + | **USD** | $20 | 0.781 | £15.62 | + | **EUR** | €20 | 0.885 | £17.70 | + | **RUB** | ₽20 | 0.011 | £0.22 | + + ## Examples with base currency of USD + + | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (USD) | + | :--------------- | :------------- | :------------ | :------------------------- | + | **GBP** | £20 | 1.277 | $25.54 | + | **EUR** | €20 | 1.134 | $22.68 | + | **RUB** | ₽20 | 0.015 | $0.30 | + + + ### Integration-specific details + + | Integration | Scenario | System behavior | + |-------------------|-------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------| + | QuickBooks Online | Transaction currency differs from base currency | If currency rate value is left `null`, a rate of 1 will be used by QBO by default. To override this, specify a currencyRate in the request body. | + """ + total_amount: NotRequired[Decimal] + r"""The total amount that has been allocated.""" + + +class CreateBillResponseAllocation(BaseModel): + allocated_on_date: Annotated[ + Optional[str], pydantic.Field(alias="allocatedOnDate") + ] = 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: + + ``` + 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. + """ + + currency: Optional[str] = None + r"""The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + + ## Unknown currencies + + In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + + There are only a very small number of edge cases where this currency code is returned by the Codat system. + """ + + currency_rate: Annotated[ + Annotated[ + OptionalNullable[Decimal], + BeforeValidator(validate_decimal), + PlainSerializer(serialize_decimal(False)), + ], + pydantic.Field(alias="currencyRate"), + ] = UNSET + r"""Rate to convert the total amount of the payment into the base currency for the company at the time of the payment. + + Currency rates in Codat are implemented as the multiple of foreign currency units to each base currency unit. + + It is not possible to perform the currency conversion with two or more non-base currencies participating in the transaction. For example, if a company's base currency is USD, and it has a bill issued in EUR, then the bill payment must happen in USD or EUR. + + Where the currency rate is provided by the underlying accounting software, it will be available from Codat with the same precision (up to a maximum of 9 decimal places). + + For accounting software which do not provide an explicit currency rate, it is calculated as `baseCurrency / foreignCurrency` and will be returned to 9 decimal places. + + ## Examples with base currency of GBP + + | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (GBP) | + | :--------------- | :------------- | :------------ | :------------------------- | + | **USD** | $20 | 0.781 | £15.62 | + | **EUR** | €20 | 0.885 | £17.70 | + | **RUB** | ₽20 | 0.011 | £0.22 | + + ## Examples with base currency of USD + + | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (USD) | + | :--------------- | :------------- | :------------ | :------------------------- | + | **GBP** | £20 | 1.277 | $25.54 | + | **EUR** | €20 | 1.134 | $22.68 | + | **RUB** | ₽20 | 0.015 | $0.30 | + + + ### Integration-specific details + + | Integration | Scenario | System behavior | + |-------------------|-------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------| + | QuickBooks Online | Transaction currency differs from base currency | If currency rate value is left `null`, a rate of 1 will be used by QBO by default. To override this, specify a currencyRate in the request body. | + """ + + total_amount: Annotated[ + Annotated[ + Optional[Decimal], + BeforeValidator(validate_decimal), + PlainSerializer(serialize_decimal(False)), + ], + pydantic.Field(alias="totalAmount"), + ] = None + r"""The total amount that has been allocated.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = ["allocatedOnDate", "currency", "currencyRate", "totalAmount"] + nullable_fields = ["currencyRate"] + null_default_fields = [] + + serialized = handler(self) + + m = {} + + for n, f in self.model_fields.items(): + k = f.alias or n + val = serialized.get(k) + serialized.pop(k, None) + + optional_nullable = k in optional_fields and k in nullable_fields + is_set = ( + self.__pydantic_fields_set__.intersection({n}) + or k in null_default_fields + ) # pylint: disable=no-member + + if val is not None and val != UNSET_SENTINEL: + m[k] = val + elif val != UNSET_SENTINEL and ( + not k in optional_fields or (optional_nullable and is_set) + ): + m[k] = val + + return m + + +class CreateBillResponseAccountingPaymentAllocationTypedDict(TypedDict): + allocation: CreateBillResponseAllocationTypedDict + payment: PaymentAllocationPaymentTypedDict + + +class CreateBillResponseAccountingPaymentAllocation(BaseModel): + allocation: CreateBillResponseAllocation + + payment: PaymentAllocationPayment + + +class CreateBillResponsePurchaseOrderReferenceTypedDict(TypedDict): + id: NotRequired[str] + r"""Identifier for the purchase order, unique for the company in the accounting software.""" + purchase_order_number: NotRequired[Nullable[str]] + r"""Friendly reference for the purchase order, commonly generated by the accounting software.""" + + +class CreateBillResponsePurchaseOrderReference(BaseModel): + id: Optional[str] = None + r"""Identifier for the purchase order, unique for the company in the accounting software.""" + + purchase_order_number: Annotated[ + OptionalNullable[str], pydantic.Field(alias="purchaseOrderNumber") + ] = UNSET + r"""Friendly reference for the purchase order, commonly generated by the accounting software.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = ["id", "purchaseOrderNumber"] + nullable_fields = ["purchaseOrderNumber"] + null_default_fields = [] + + serialized = handler(self) + + m = {} + + for n, f in self.model_fields.items(): + k = f.alias or n + val = serialized.get(k) + serialized.pop(k, None) + + optional_nullable = k in optional_fields and k in nullable_fields + is_set = ( + self.__pydantic_fields_set__.intersection({n}) + or k in null_default_fields + ) # pylint: disable=no-member + + if val is not None and val != UNSET_SENTINEL: + m[k] = val + elif val != UNSET_SENTINEL and ( + not k in optional_fields or (optional_nullable and is_set) + ): + m[k] = val + + return m + + +class CreateBillResponseWithholdingTaxTypedDict(TypedDict): + amount: Decimal + r"""Amount of tax withheld.""" + name: str + r"""Name assigned to withheld tax.""" + + +class CreateBillResponseWithholdingTax(BaseModel): + amount: Annotated[ + Decimal, + BeforeValidator(validate_decimal), + PlainSerializer(serialize_decimal(False)), + ] + r"""Amount of tax withheld.""" + + name: str + r"""Name assigned to withheld tax.""" + + +@deprecated( + "warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible." +) +class AccountingBillTypedDict(TypedDict): + r"""> **Invoices or bills?** + > + > We distinguish between invoices where the company *owes money* vs. *is owed money*. If the company has received an invoice, and owes money to someone else (accounts payable) we call this a Bill. + > + > See [Invoices](https://docs.codat.io/sync-for-payables-api#/schemas/Invoice) for the accounts receivable equivalent of bills. + + View the coverage for bills in the Data coverage explorer. + + ## Overview + + In Codat, a bill contains details of: + * When the bill was recorded in the accounting system. + * How much the bill is for and the currency of the amount. + * Who the bill was received from — the *supplier*. + * What the bill is for — the *line items*. + + Some accounting software give a separate name to purchases where the payment is made immediately, such as something bought with a credit card or online payment. One example of this would be QuickBooks Online's *expenses*. + + You can find these types of transactions in our [Direct costs](https://docs.codat.io/sync-for-payables-api#/schemas/DirectCost) data model. + """ + + issue_date: str + status: BillStatus + r"""Current state of the bill.""" + sub_total: Decimal + r"""Total amount of the bill, excluding any taxes.""" + tax_amount: Decimal + r"""Amount of tax on the bill.""" + total_amount: Decimal + r"""Amount of the bill, including tax.""" + amount_due: NotRequired[Nullable[Decimal]] + r"""Amount outstanding on the bill.""" + currency: NotRequired[str] + r"""The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + + ## Unknown currencies + + In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + + There are only a very small number of edge cases where this currency code is returned by the Codat system. + """ + currency_rate: NotRequired[Nullable[Decimal]] + r"""Rate to convert the total amount of the payment into the base currency for the company at the time of the payment. + + Currency rates in Codat are implemented as the multiple of foreign currency units to each base currency unit. + + It is not possible to perform the currency conversion with two or more non-base currencies participating in the transaction. For example, if a company's base currency is USD, and it has a bill issued in EUR, then the bill payment must happen in USD or EUR. + + Where the currency rate is provided by the underlying accounting software, it will be available from Codat with the same precision (up to a maximum of 9 decimal places). + + For accounting software which do not provide an explicit currency rate, it is calculated as `baseCurrency / foreignCurrency` and will be returned to 9 decimal places. + + ## Examples with base currency of GBP + + | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (GBP) | + | :--------------- | :------------- | :------------ | :------------------------- | + | **USD** | $20 | 0.781 | £15.62 | + | **EUR** | €20 | 0.885 | £17.70 | + | **RUB** | ₽20 | 0.011 | £0.22 | + + ## Examples with base currency of USD + + | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (USD) | + | :--------------- | :------------- | :------------ | :------------------------- | + | **GBP** | £20 | 1.277 | $25.54 | + | **EUR** | €20 | 1.134 | $22.68 | + | **RUB** | ₽20 | 0.015 | $0.30 | + + + ### Integration-specific details + + | Integration | Scenario | System behavior | + |-------------------|-------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------| + | QuickBooks Online | Transaction currency differs from base currency | If currency rate value is left `null`, a rate of 1 will be used by QBO by default. To override this, specify a currencyRate in the request body. | + """ + due_date: NotRequired[str] + id: NotRequired[str] + r"""Identifier for the bill, unique for the company in the accounting software.""" + line_items: NotRequired[Nullable[List[BillLineItemTypedDict]]] + r"""Array of Bill line items.""" + metadata: NotRequired[MetadataTypedDict] + modified_date: NotRequired[str] + note: NotRequired[Nullable[str]] + r"""Any private, company notes about the bill, such as payment information.""" + payment_allocations: NotRequired[ + Nullable[List[CreateBillResponseAccountingPaymentAllocationTypedDict]] + ] + r"""An array of payment allocations.""" + purchase_order_refs: NotRequired[ + Nullable[List[CreateBillResponsePurchaseOrderReferenceTypedDict]] + ] + reference: NotRequired[Nullable[str]] + r"""User-friendly reference for the bill.""" + source_modified_date: NotRequired[str] + supplemental_data: NotRequired[SupplementalDataTypedDict] + r"""Supplemental data is additional data you can include in our standard data types. + + It is referenced as a configured dynamic key value pair that is unique to the accounting software. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. + """ + supplier_ref: NotRequired[SupplierRefTypedDict] + r"""Reference to the supplier the record relates to.""" + withholding_tax: NotRequired[ + Nullable[List[CreateBillResponseWithholdingTaxTypedDict]] + ] + + +@deprecated( + "warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible." +) +class AccountingBill(BaseModel): + r"""> **Invoices or bills?** + > + > We distinguish between invoices where the company *owes money* vs. *is owed money*. If the company has received an invoice, and owes money to someone else (accounts payable) we call this a Bill. + > + > See [Invoices](https://docs.codat.io/sync-for-payables-api#/schemas/Invoice) for the accounts receivable equivalent of bills. + + View the coverage for bills in the Data coverage explorer. + + ## Overview + + In Codat, a bill contains details of: + * When the bill was recorded in the accounting system. + * How much the bill is for and the currency of the amount. + * Who the bill was received from — the *supplier*. + * What the bill is for — the *line items*. + + Some accounting software give a separate name to purchases where the payment is made immediately, such as something bought with a credit card or online payment. One example of this would be QuickBooks Online's *expenses*. + + You can find these types of transactions in our [Direct costs](https://docs.codat.io/sync-for-payables-api#/schemas/DirectCost) data model. + """ + + issue_date: Annotated[str, pydantic.Field(alias="issueDate")] + + status: BillStatus + r"""Current state of the bill.""" + + sub_total: Annotated[ + Annotated[ + Decimal, + BeforeValidator(validate_decimal), + PlainSerializer(serialize_decimal(False)), + ], + pydantic.Field(alias="subTotal"), + ] + r"""Total amount of the bill, excluding any taxes.""" + + tax_amount: Annotated[ + Annotated[ + Decimal, + BeforeValidator(validate_decimal), + PlainSerializer(serialize_decimal(False)), + ], + pydantic.Field(alias="taxAmount"), + ] + r"""Amount of tax on the bill.""" + + total_amount: Annotated[ + Annotated[ + Decimal, + BeforeValidator(validate_decimal), + PlainSerializer(serialize_decimal(False)), + ], + pydantic.Field(alias="totalAmount"), + ] + r"""Amount of the bill, including tax.""" + + amount_due: Annotated[ + Annotated[ + OptionalNullable[Decimal], + BeforeValidator(validate_decimal), + PlainSerializer(serialize_decimal(False)), + ], + pydantic.Field(alias="amountDue"), + ] = UNSET + r"""Amount outstanding on the bill.""" + + currency: Optional[str] = None + r"""The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + + ## Unknown currencies + + In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + + There are only a very small number of edge cases where this currency code is returned by the Codat system. + """ + + currency_rate: Annotated[ + Annotated[ + OptionalNullable[Decimal], + BeforeValidator(validate_decimal), + PlainSerializer(serialize_decimal(False)), + ], + pydantic.Field(alias="currencyRate"), + ] = UNSET + r"""Rate to convert the total amount of the payment into the base currency for the company at the time of the payment. + + Currency rates in Codat are implemented as the multiple of foreign currency units to each base currency unit. + + It is not possible to perform the currency conversion with two or more non-base currencies participating in the transaction. For example, if a company's base currency is USD, and it has a bill issued in EUR, then the bill payment must happen in USD or EUR. + + Where the currency rate is provided by the underlying accounting software, it will be available from Codat with the same precision (up to a maximum of 9 decimal places). + + For accounting software which do not provide an explicit currency rate, it is calculated as `baseCurrency / foreignCurrency` and will be returned to 9 decimal places. + + ## Examples with base currency of GBP + + | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (GBP) | + | :--------------- | :------------- | :------------ | :------------------------- | + | **USD** | $20 | 0.781 | £15.62 | + | **EUR** | €20 | 0.885 | £17.70 | + | **RUB** | ₽20 | 0.011 | £0.22 | + + ## Examples with base currency of USD + + | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (USD) | + | :--------------- | :------------- | :------------ | :------------------------- | + | **GBP** | £20 | 1.277 | $25.54 | + | **EUR** | €20 | 1.134 | $22.68 | + | **RUB** | ₽20 | 0.015 | $0.30 | + + + ### Integration-specific details + + | Integration | Scenario | System behavior | + |-------------------|-------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------| + | QuickBooks Online | Transaction currency differs from base currency | If currency rate value is left `null`, a rate of 1 will be used by QBO by default. To override this, specify a currencyRate in the request body. | + """ + + due_date: Annotated[Optional[str], pydantic.Field(alias="dueDate")] = None + + id: Optional[str] = None + r"""Identifier for the bill, unique for the company in the accounting software.""" + + line_items: Annotated[ + OptionalNullable[List[BillLineItem]], pydantic.Field(alias="lineItems") + ] = UNSET + r"""Array of Bill line items.""" + + metadata: Optional[Metadata] = None + + modified_date: Annotated[Optional[str], pydantic.Field(alias="modifiedDate")] = None + + note: OptionalNullable[str] = UNSET + r"""Any private, company notes about the bill, such as payment information.""" + + payment_allocations: Annotated[ + OptionalNullable[List[CreateBillResponseAccountingPaymentAllocation]], + pydantic.Field(alias="paymentAllocations"), + ] = UNSET + r"""An array of payment allocations.""" + + purchase_order_refs: Annotated[ + OptionalNullable[List[CreateBillResponsePurchaseOrderReference]], + pydantic.Field(alias="purchaseOrderRefs"), + ] = UNSET + + reference: OptionalNullable[str] = UNSET + r"""User-friendly reference for the bill.""" + + source_modified_date: Annotated[ + Optional[str], pydantic.Field(alias="sourceModifiedDate") + ] = None + + supplemental_data: Annotated[ + Optional[SupplementalData], pydantic.Field(alias="supplementalData") + ] = None + r"""Supplemental data is additional data you can include in our standard data types. + + It is referenced as a configured dynamic key value pair that is unique to the accounting software. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. + """ + + supplier_ref: Annotated[ + Optional[SupplierRef], pydantic.Field(alias="supplierRef") + ] = None + r"""Reference to the supplier the record relates to.""" + + withholding_tax: Annotated[ + OptionalNullable[List[CreateBillResponseWithholdingTax]], + pydantic.Field(alias="withholdingTax"), + ] = UNSET + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = [ + "amountDue", + "currency", + "currencyRate", + "dueDate", + "id", + "lineItems", + "metadata", + "modifiedDate", + "note", + "paymentAllocations", + "purchaseOrderRefs", + "reference", + "sourceModifiedDate", + "supplementalData", + "supplierRef", + "withholdingTax", + ] + nullable_fields = [ + "amountDue", + "currencyRate", + "lineItems", + "note", + "paymentAllocations", + "purchaseOrderRefs", + "reference", + "withholdingTax", + ] + null_default_fields = [] + + serialized = handler(self) + + m = {} + + for n, f in self.model_fields.items(): + k = f.alias or n + val = serialized.get(k) + serialized.pop(k, None) + + optional_nullable = k in optional_fields and k in nullable_fields + is_set = ( + self.__pydantic_fields_set__.intersection({n}) + or k in null_default_fields + ) # pylint: disable=no-member + + if val is not None and val != UNSET_SENTINEL: + m[k] = val + elif val != UNSET_SENTINEL and ( + not k in optional_fields or (optional_nullable and is_set) + ): + m[k] = val + + return m + + +class CreateBillResponseTypedDict(TypedDict): + company_id: str + r"""Unique identifier for your SMB in Codat.""" + data_connection_key: str + r"""Unique identifier for a company's data connection.""" + push_operation_key: str + r"""A unique identifier generated by Codat to represent this single push operation. This identifier can be used to track the status of the push, and should be persisted.""" + requested_on_utc: 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: + + ``` + 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. + """ + status: PushOperationStatus + r"""The current status of the push operation.""" + status_code: int + r"""Push status code.""" + changes: NotRequired[Nullable[List[PushOperationChangeTypedDict]]] + r"""Contains a single entry that communicates which record has changed and the manner in which it changed.""" + completed_on_utc: 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: + + ``` + 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. + """ + data: NotRequired[Nullable[AccountingBillTypedDict]] + data_type: NotRequired[DataType] + r"""Available data types""" + error_message: NotRequired[Nullable[str]] + r"""A message about the error.""" + timeout_in_minutes: NotRequired[Nullable[int]] + r"""Number of minutes the push operation must complete within before it times out.""" + timeout_in_seconds: NotRequired[Nullable[int]] + r"""Number of seconds the push operation must complete within before it times out.""" + validation: NotRequired[ValidationTypedDict] + r"""A human-readable object describing validation decisions Codat has made when pushing data into the platform. If a push has failed because of validation errors, they will be detailed here.""" + + +class CreateBillResponse(BaseModel): + company_id: Annotated[str, pydantic.Field(alias="companyId")] + r"""Unique identifier for your SMB in Codat.""" + + data_connection_key: Annotated[str, pydantic.Field(alias="dataConnectionKey")] + r"""Unique identifier for a company's data connection.""" + + push_operation_key: Annotated[str, pydantic.Field(alias="pushOperationKey")] + r"""A unique identifier generated by Codat to represent this single push operation. This identifier can be used to track the status of the push, and should be persisted.""" + + requested_on_utc: Annotated[str, pydantic.Field(alias="requestedOnUtc")] + 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: + + ``` + 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. + """ + + status: PushOperationStatus + r"""The current status of the push operation.""" + + status_code: Annotated[int, pydantic.Field(alias="statusCode")] + r"""Push status code.""" + + changes: OptionalNullable[List[PushOperationChange]] = UNSET + r"""Contains a single entry that communicates which record has changed and the manner in which it changed.""" + + completed_on_utc: Annotated[ + Optional[str], pydantic.Field(alias="completedOnUtc") + ] = 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: + + ``` + 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. + """ + + data: OptionalNullable[AccountingBill] = UNSET + + data_type: Annotated[Optional[DataType], pydantic.Field(alias="dataType")] = None + r"""Available data types""" + + error_message: Annotated[ + OptionalNullable[str], pydantic.Field(alias="errorMessage") + ] = UNSET + r"""A message about the error.""" + + timeout_in_minutes: Annotated[ + OptionalNullable[int], pydantic.Field(alias="timeoutInMinutes") + ] = UNSET + r"""Number of minutes the push operation must complete within before it times out.""" + + timeout_in_seconds: Annotated[ + OptionalNullable[int], + pydantic.Field( + deprecated="warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible.", + alias="timeoutInSeconds", + ), + ] = UNSET + r"""Number of seconds the push operation must complete within before it times out.""" + + validation: Optional[Validation] = None + r"""A human-readable object describing validation decisions Codat has made when pushing data into the platform. If a push has failed because of validation errors, they will be detailed here.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = [ + "changes", + "completedOnUtc", + "data", + "dataType", + "errorMessage", + "timeoutInMinutes", + "timeoutInSeconds", + "validation", + ] + nullable_fields = [ + "changes", + "data", + "errorMessage", + "timeoutInMinutes", + "timeoutInSeconds", + ] + null_default_fields = [] + + serialized = handler(self) + + m = {} + + for n, f in self.model_fields.items(): + k = f.alias or n + val = serialized.get(k) + serialized.pop(k, None) + + optional_nullable = k in optional_fields and k in nullable_fields + is_set = ( + self.__pydantic_fields_set__.intersection({n}) + or k in null_default_fields + ) # pylint: disable=no-member + + if val is not None and val != UNSET_SENTINEL: + m[k] = val + elif val != UNSET_SENTINEL and ( + not k in optional_fields or (optional_nullable and is_set) + ): + m[k] = val + + return m diff --git a/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/createjournalentryresponse.py b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/createjournalentryresponse.py new file mode 100644 index 000000000..39a634a4a --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/createjournalentryresponse.py @@ -0,0 +1,515 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .datatype import DataType +from .journalentryrecordref import JournalEntryRecordRef, JournalEntryRecordRefTypedDict +from .journalline import JournalLine, JournalLineTypedDict +from .journalref import JournalRef, JournalRefTypedDict +from .metadata import Metadata, MetadataTypedDict +from .pushoperationchange import PushOperationChange, PushOperationChangeTypedDict +from .pushoperationstatus import PushOperationStatus +from .supplementaldata import SupplementalData, SupplementalDataTypedDict +from .validation import Validation, ValidationTypedDict +from codat_sync_for_payables_version_1.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +import pydantic +from pydantic import model_serializer +from typing import List, Optional +from typing_extensions import Annotated, NotRequired, TypedDict, deprecated + + +@deprecated( + "warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible." +) +class AccountingJournalEntryTypedDict(TypedDict): + r"""> **Language tip:** For the top-level record of a company's financial transactions, refer to the [Journals](https://docs.codat.io/sync-for-payables-api#/schemas/Journal) data type + + > View the coverage for journal entries in the Data coverage explorer. + + ## Overview + + A journal entry report shows the entries made in a company's general ledger, or [accounts](https://docs.codat.io/sync-for-payables-api#/schemas/Account), when transactions are approved. The journal line items for each journal entry should balance. + + A journal entry line item is a single transaction line on the journal entry. For example: + + - When a journal entry is recording a receipt of cash, the credit to accounts receivable and the debit to cash are separate line items. + - When a company needs to recognise revenue from an annual contract on a monthly basis, on receipt of cash for month one, they make a debit to deferred income and a credit to revenue. + + In Codat a journal entry contains details of: + + - The date on which the entry was created and posted. + - Itemised lines, including amounts and currency. + - A reference to the associated accounts. + - A reference to the underlying record. For example, the invoice, bill, or other data type that triggered the posting of the journal entry to the general ledger. + + > **Pushing journal entries** + > Codat only supports journal entries in the base currency of the company that are pushed into accounts denominated in the same base currency. + """ + + created_on: 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: + + ``` + 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. + """ + description: NotRequired[Nullable[str]] + r"""Optional description of the journal entry.""" + id: NotRequired[str] + r"""Unique identifier of the journal entry for the company in the accounting software.""" + journal_lines: NotRequired[Nullable[List[JournalLineTypedDict]]] + r"""An array of journal lines.""" + journal_ref: NotRequired[JournalRefTypedDict] + r"""Links journal entries to the relevant journal in accounting integrations that use multi-book accounting (multiple journals).""" + metadata: NotRequired[MetadataTypedDict] + modified_date: NotRequired[str] + posted_on: 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: + + ``` + 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. + """ + record_ref: NotRequired[JournalEntryRecordRefTypedDict] + r"""Links a journal entry to the underlying record that created it.""" + source_modified_date: NotRequired[str] + supplemental_data: NotRequired[SupplementalDataTypedDict] + r"""Supplemental data is additional data you can include in our standard data types. + + It is referenced as a configured dynamic key value pair that is unique to the accounting software. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. + """ + updated_on: 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: + + ``` + 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. + """ + + +@deprecated( + "warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible." +) +class AccountingJournalEntry(BaseModel): + r"""> **Language tip:** For the top-level record of a company's financial transactions, refer to the [Journals](https://docs.codat.io/sync-for-payables-api#/schemas/Journal) data type + + > View the coverage for journal entries in the Data coverage explorer. + + ## Overview + + A journal entry report shows the entries made in a company's general ledger, or [accounts](https://docs.codat.io/sync-for-payables-api#/schemas/Account), when transactions are approved. The journal line items for each journal entry should balance. + + A journal entry line item is a single transaction line on the journal entry. For example: + + - When a journal entry is recording a receipt of cash, the credit to accounts receivable and the debit to cash are separate line items. + - When a company needs to recognise revenue from an annual contract on a monthly basis, on receipt of cash for month one, they make a debit to deferred income and a credit to revenue. + + In Codat a journal entry contains details of: + + - The date on which the entry was created and posted. + - Itemised lines, including amounts and currency. + - A reference to the associated accounts. + - A reference to the underlying record. For example, the invoice, bill, or other data type that triggered the posting of the journal entry to the general ledger. + + > **Pushing journal entries** + > Codat only supports journal entries in the base currency of the company that are pushed into accounts denominated in the same base currency. + """ + + created_on: Annotated[Optional[str], pydantic.Field(alias="createdOn")] = 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: + + ``` + 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. + """ + + description: OptionalNullable[str] = UNSET + r"""Optional description of the journal entry.""" + + id: Optional[str] = None + r"""Unique identifier of the journal entry for the company in the accounting software.""" + + journal_lines: Annotated[ + OptionalNullable[List[JournalLine]], pydantic.Field(alias="journalLines") + ] = UNSET + r"""An array of journal lines.""" + + journal_ref: Annotated[Optional[JournalRef], pydantic.Field(alias="journalRef")] = ( + None + ) + r"""Links journal entries to the relevant journal in accounting integrations that use multi-book accounting (multiple journals).""" + + metadata: Optional[Metadata] = None + + modified_date: Annotated[Optional[str], pydantic.Field(alias="modifiedDate")] = None + + posted_on: Annotated[Optional[str], pydantic.Field(alias="postedOn")] = 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: + + ``` + 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. + """ + + record_ref: Annotated[ + Optional[JournalEntryRecordRef], pydantic.Field(alias="recordRef") + ] = None + r"""Links a journal entry to the underlying record that created it.""" + + source_modified_date: Annotated[ + Optional[str], pydantic.Field(alias="sourceModifiedDate") + ] = None + + supplemental_data: Annotated[ + Optional[SupplementalData], pydantic.Field(alias="supplementalData") + ] = None + r"""Supplemental data is additional data you can include in our standard data types. + + It is referenced as a configured dynamic key value pair that is unique to the accounting software. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. + """ + + updated_on: Annotated[Optional[str], pydantic.Field(alias="updatedOn")] = 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: + + ``` + 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. + """ + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = [ + "createdOn", + "description", + "id", + "journalLines", + "journalRef", + "metadata", + "modifiedDate", + "postedOn", + "recordRef", + "sourceModifiedDate", + "supplementalData", + "updatedOn", + ] + nullable_fields = ["description", "journalLines"] + null_default_fields = [] + + serialized = handler(self) + + m = {} + + for n, f in self.model_fields.items(): + k = f.alias or n + val = serialized.get(k) + serialized.pop(k, None) + + optional_nullable = k in optional_fields and k in nullable_fields + is_set = ( + self.__pydantic_fields_set__.intersection({n}) + or k in null_default_fields + ) # pylint: disable=no-member + + if val is not None and val != UNSET_SENTINEL: + m[k] = val + elif val != UNSET_SENTINEL and ( + not k in optional_fields or (optional_nullable and is_set) + ): + m[k] = val + + return m + + +class CreateJournalEntryResponseTypedDict(TypedDict): + company_id: str + r"""Unique identifier for your SMB in Codat.""" + data_connection_key: str + r"""Unique identifier for a company's data connection.""" + push_operation_key: str + r"""A unique identifier generated by Codat to represent this single push operation. This identifier can be used to track the status of the push, and should be persisted.""" + requested_on_utc: 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: + + ``` + 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. + """ + status: PushOperationStatus + r"""The current status of the push operation.""" + status_code: int + r"""Push status code.""" + changes: NotRequired[Nullable[List[PushOperationChangeTypedDict]]] + r"""Contains a single entry that communicates which record has changed and the manner in which it changed.""" + completed_on_utc: 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: + + ``` + 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. + """ + data: NotRequired[Nullable[AccountingJournalEntryTypedDict]] + data_type: NotRequired[DataType] + r"""Available data types""" + error_message: NotRequired[Nullable[str]] + r"""A message about the error.""" + timeout_in_minutes: NotRequired[Nullable[int]] + r"""Number of minutes the push operation must complete within before it times out.""" + timeout_in_seconds: NotRequired[Nullable[int]] + r"""Number of seconds the push operation must complete within before it times out.""" + validation: NotRequired[ValidationTypedDict] + r"""A human-readable object describing validation decisions Codat has made when pushing data into the platform. If a push has failed because of validation errors, they will be detailed here.""" + + +class CreateJournalEntryResponse(BaseModel): + company_id: Annotated[str, pydantic.Field(alias="companyId")] + r"""Unique identifier for your SMB in Codat.""" + + data_connection_key: Annotated[str, pydantic.Field(alias="dataConnectionKey")] + r"""Unique identifier for a company's data connection.""" + + push_operation_key: Annotated[str, pydantic.Field(alias="pushOperationKey")] + r"""A unique identifier generated by Codat to represent this single push operation. This identifier can be used to track the status of the push, and should be persisted.""" + + requested_on_utc: Annotated[str, pydantic.Field(alias="requestedOnUtc")] + 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: + + ``` + 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. + """ + + status: PushOperationStatus + r"""The current status of the push operation.""" + + status_code: Annotated[int, pydantic.Field(alias="statusCode")] + r"""Push status code.""" + + changes: OptionalNullable[List[PushOperationChange]] = UNSET + r"""Contains a single entry that communicates which record has changed and the manner in which it changed.""" + + completed_on_utc: Annotated[ + Optional[str], pydantic.Field(alias="completedOnUtc") + ] = 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: + + ``` + 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. + """ + + data: OptionalNullable[AccountingJournalEntry] = UNSET + + data_type: Annotated[Optional[DataType], pydantic.Field(alias="dataType")] = None + r"""Available data types""" + + error_message: Annotated[ + OptionalNullable[str], pydantic.Field(alias="errorMessage") + ] = UNSET + r"""A message about the error.""" + + timeout_in_minutes: Annotated[ + OptionalNullable[int], pydantic.Field(alias="timeoutInMinutes") + ] = UNSET + r"""Number of minutes the push operation must complete within before it times out.""" + + timeout_in_seconds: Annotated[ + OptionalNullable[int], + pydantic.Field( + deprecated="warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible.", + alias="timeoutInSeconds", + ), + ] = UNSET + r"""Number of seconds the push operation must complete within before it times out.""" + + validation: Optional[Validation] = None + r"""A human-readable object describing validation decisions Codat has made when pushing data into the platform. If a push has failed because of validation errors, they will be detailed here.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = [ + "changes", + "completedOnUtc", + "data", + "dataType", + "errorMessage", + "timeoutInMinutes", + "timeoutInSeconds", + "validation", + ] + nullable_fields = [ + "changes", + "data", + "errorMessage", + "timeoutInMinutes", + "timeoutInSeconds", + ] + null_default_fields = [] + + serialized = handler(self) + + m = {} + + for n, f in self.model_fields.items(): + k = f.alias or n + val = serialized.get(k) + serialized.pop(k, None) + + optional_nullable = k in optional_fields and k in nullable_fields + is_set = ( + self.__pydantic_fields_set__.intersection({n}) + or k in null_default_fields + ) # pylint: disable=no-member + + if val is not None and val != UNSET_SENTINEL: + m[k] = val + elif val != UNSET_SENTINEL and ( + not k in optional_fields or (optional_nullable and is_set) + ): + m[k] = val + + return m diff --git a/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/createjournalresponse.py b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/createjournalresponse.py new file mode 100644 index 000000000..5e068bab8 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/createjournalresponse.py @@ -0,0 +1,430 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .datatype import DataType +from .journalstatus import JournalStatus +from .metadata import Metadata, MetadataTypedDict +from .pushoperationchange import PushOperationChange, PushOperationChangeTypedDict +from .pushoperationstatus import PushOperationStatus +from .validation import Validation, ValidationTypedDict +from codat_sync_for_payables_version_1.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +import pydantic +from pydantic import model_serializer +from typing import List, Optional +from typing_extensions import Annotated, NotRequired, TypedDict, deprecated + + +@deprecated( + "warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible." +) +class AccountingJournalTypedDict(TypedDict): + r"""> **Language tip:** For line items, or individual transactions, of a company's financial documents, refer to the [Journal entries](https://docs.codat.io/sync-for-payables-api#/schemas/JournalEntry) data type + + > View the coverage for journals in the Data coverage explorer. + + ## Overview + + In accounting software, journals are used to record all the financial transactions of a company. Each transaction in a journal is represented by a separate [journal entry](https://docs.codat.io/sync-for-payables-api#/schemas/JournalEntry). These entries are used to create the general ledger, which is then used to create the financial statements of a business. + + When a company records all their transactions in a single journal, it can become large and difficult to maintain and track. This is why large companies often use multiple journals (also known as subjournals) to categorize and manage journal entries. + + Such journals can be divided into two categories: + + - Special journals: journals used to record specific types of transactions; for example, a purchases journal, a sales journal, or a cash management journal. + - General journals: journals used to record transactions that fall outside the scope of the special journals. + + Multiple journals or subjournals are used in the following Codat integrations: + + - [Sage Intacct](https://docs.codat.io/integrations/accounting/sage-intacct/accounting-sage-intacct) (mandatory) + - [Exact Online](https://docs.codat.io/integrations/accounting/exact-online/accounting-exact-online) (mandatory) + - [Oracle NetSuite](https://docs.codat.io/integrations/accounting/netsuite/accounting-netsuite) (optional) + + > When pushing journal entries to an accounting software that doesn’t support multiple journals (multi-book accounting), the entries will be linked to the platform-generic journal. The Journals data type will only include one object. + + """ + + created_on: 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: + + ``` + 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. + """ + has_children: NotRequired[bool] + r"""If the journal has child journals, this value is true. If it doesn’t, it is false.""" + id: NotRequired[str] + r"""Journal ID.""" + journal_code: NotRequired[Nullable[str]] + r"""Native journal number or code.""" + metadata: NotRequired[MetadataTypedDict] + modified_date: NotRequired[str] + name: NotRequired[Nullable[str]] + r"""Journal name. + The maximum length for a journal name is 256 characters. All characters above that number will be truncated. + """ + parent_id: NotRequired[Nullable[str]] + r"""Parent journal ID. + If the journal is a parent journal, this value is not present. + """ + source_modified_date: NotRequired[str] + status: NotRequired[JournalStatus] + r"""Current journal status.""" + type: NotRequired[Nullable[str]] + r"""The type of the journal.""" + + +@deprecated( + "warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible." +) +class AccountingJournal(BaseModel): + r"""> **Language tip:** For line items, or individual transactions, of a company's financial documents, refer to the [Journal entries](https://docs.codat.io/sync-for-payables-api#/schemas/JournalEntry) data type + + > View the coverage for journals in the Data coverage explorer. + + ## Overview + + In accounting software, journals are used to record all the financial transactions of a company. Each transaction in a journal is represented by a separate [journal entry](https://docs.codat.io/sync-for-payables-api#/schemas/JournalEntry). These entries are used to create the general ledger, which is then used to create the financial statements of a business. + + When a company records all their transactions in a single journal, it can become large and difficult to maintain and track. This is why large companies often use multiple journals (also known as subjournals) to categorize and manage journal entries. + + Such journals can be divided into two categories: + + - Special journals: journals used to record specific types of transactions; for example, a purchases journal, a sales journal, or a cash management journal. + - General journals: journals used to record transactions that fall outside the scope of the special journals. + + Multiple journals or subjournals are used in the following Codat integrations: + + - [Sage Intacct](https://docs.codat.io/integrations/accounting/sage-intacct/accounting-sage-intacct) (mandatory) + - [Exact Online](https://docs.codat.io/integrations/accounting/exact-online/accounting-exact-online) (mandatory) + - [Oracle NetSuite](https://docs.codat.io/integrations/accounting/netsuite/accounting-netsuite) (optional) + + > When pushing journal entries to an accounting software that doesn’t support multiple journals (multi-book accounting), the entries will be linked to the platform-generic journal. The Journals data type will only include one object. + + """ + + created_on: Annotated[Optional[str], pydantic.Field(alias="createdOn")] = 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: + + ``` + 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. + """ + + has_children: Annotated[Optional[bool], pydantic.Field(alias="hasChildren")] = None + r"""If the journal has child journals, this value is true. If it doesn’t, it is false.""" + + id: Optional[str] = None + r"""Journal ID.""" + + journal_code: Annotated[ + OptionalNullable[str], pydantic.Field(alias="journalCode") + ] = UNSET + r"""Native journal number or code.""" + + metadata: Optional[Metadata] = None + + modified_date: Annotated[Optional[str], pydantic.Field(alias="modifiedDate")] = None + + name: OptionalNullable[str] = UNSET + r"""Journal name. + The maximum length for a journal name is 256 characters. All characters above that number will be truncated. + """ + + parent_id: Annotated[OptionalNullable[str], pydantic.Field(alias="parentId")] = ( + UNSET + ) + r"""Parent journal ID. + If the journal is a parent journal, this value is not present. + """ + + source_modified_date: Annotated[ + Optional[str], pydantic.Field(alias="sourceModifiedDate") + ] = None + + status: Optional[JournalStatus] = None + r"""Current journal status.""" + + type: OptionalNullable[str] = UNSET + r"""The type of the journal.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = [ + "createdOn", + "hasChildren", + "id", + "journalCode", + "metadata", + "modifiedDate", + "name", + "parentId", + "sourceModifiedDate", + "status", + "type", + ] + nullable_fields = ["journalCode", "name", "parentId", "type"] + null_default_fields = [] + + serialized = handler(self) + + m = {} + + for n, f in self.model_fields.items(): + k = f.alias or n + val = serialized.get(k) + serialized.pop(k, None) + + optional_nullable = k in optional_fields and k in nullable_fields + is_set = ( + self.__pydantic_fields_set__.intersection({n}) + or k in null_default_fields + ) # pylint: disable=no-member + + if val is not None and val != UNSET_SENTINEL: + m[k] = val + elif val != UNSET_SENTINEL and ( + not k in optional_fields or (optional_nullable and is_set) + ): + m[k] = val + + return m + + +class CreateJournalResponseTypedDict(TypedDict): + company_id: str + r"""Unique identifier for your SMB in Codat.""" + data_connection_key: str + r"""Unique identifier for a company's data connection.""" + push_operation_key: str + r"""A unique identifier generated by Codat to represent this single push operation. This identifier can be used to track the status of the push, and should be persisted.""" + requested_on_utc: 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: + + ``` + 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. + """ + status: PushOperationStatus + r"""The current status of the push operation.""" + status_code: int + r"""Push status code.""" + changes: NotRequired[Nullable[List[PushOperationChangeTypedDict]]] + r"""Contains a single entry that communicates which record has changed and the manner in which it changed.""" + completed_on_utc: 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: + + ``` + 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. + """ + data: NotRequired[Nullable[AccountingJournalTypedDict]] + data_type: NotRequired[DataType] + r"""Available data types""" + error_message: NotRequired[Nullable[str]] + r"""A message about the error.""" + timeout_in_minutes: NotRequired[Nullable[int]] + r"""Number of minutes the push operation must complete within before it times out.""" + timeout_in_seconds: NotRequired[Nullable[int]] + r"""Number of seconds the push operation must complete within before it times out.""" + validation: NotRequired[ValidationTypedDict] + r"""A human-readable object describing validation decisions Codat has made when pushing data into the platform. If a push has failed because of validation errors, they will be detailed here.""" + + +class CreateJournalResponse(BaseModel): + company_id: Annotated[str, pydantic.Field(alias="companyId")] + r"""Unique identifier for your SMB in Codat.""" + + data_connection_key: Annotated[str, pydantic.Field(alias="dataConnectionKey")] + r"""Unique identifier for a company's data connection.""" + + push_operation_key: Annotated[str, pydantic.Field(alias="pushOperationKey")] + r"""A unique identifier generated by Codat to represent this single push operation. This identifier can be used to track the status of the push, and should be persisted.""" + + requested_on_utc: Annotated[str, pydantic.Field(alias="requestedOnUtc")] + 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: + + ``` + 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. + """ + + status: PushOperationStatus + r"""The current status of the push operation.""" + + status_code: Annotated[int, pydantic.Field(alias="statusCode")] + r"""Push status code.""" + + changes: OptionalNullable[List[PushOperationChange]] = UNSET + r"""Contains a single entry that communicates which record has changed and the manner in which it changed.""" + + completed_on_utc: Annotated[ + Optional[str], pydantic.Field(alias="completedOnUtc") + ] = 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: + + ``` + 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. + """ + + data: OptionalNullable[AccountingJournal] = UNSET + + data_type: Annotated[Optional[DataType], pydantic.Field(alias="dataType")] = None + r"""Available data types""" + + error_message: Annotated[ + OptionalNullable[str], pydantic.Field(alias="errorMessage") + ] = UNSET + r"""A message about the error.""" + + timeout_in_minutes: Annotated[ + OptionalNullable[int], pydantic.Field(alias="timeoutInMinutes") + ] = UNSET + r"""Number of minutes the push operation must complete within before it times out.""" + + timeout_in_seconds: Annotated[ + OptionalNullable[int], + pydantic.Field( + deprecated="warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible.", + alias="timeoutInSeconds", + ), + ] = UNSET + r"""Number of seconds the push operation must complete within before it times out.""" + + validation: Optional[Validation] = None + r"""A human-readable object describing validation decisions Codat has made when pushing data into the platform. If a push has failed because of validation errors, they will be detailed here.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = [ + "changes", + "completedOnUtc", + "data", + "dataType", + "errorMessage", + "timeoutInMinutes", + "timeoutInSeconds", + "validation", + ] + nullable_fields = [ + "changes", + "data", + "errorMessage", + "timeoutInMinutes", + "timeoutInSeconds", + ] + null_default_fields = [] + + serialized = handler(self) + + m = {} + + for n, f in self.model_fields.items(): + k = f.alias or n + val = serialized.get(k) + serialized.pop(k, None) + + optional_nullable = k in optional_fields and k in nullable_fields + is_set = ( + self.__pydantic_fields_set__.intersection({n}) + or k in null_default_fields + ) # pylint: disable=no-member + + if val is not None and val != UNSET_SENTINEL: + m[k] = val + elif val != UNSET_SENTINEL and ( + not k in optional_fields or (optional_nullable and is_set) + ): + m[k] = val + + return m diff --git a/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/createsupplierresponse.py b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/createsupplierresponse.py new file mode 100644 index 000000000..b0b38403f --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/createsupplierresponse.py @@ -0,0 +1,392 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .address import Address, AddressTypedDict +from .datatype import DataType +from .metadata import Metadata, MetadataTypedDict +from .pushoperationchange import PushOperationChange, PushOperationChangeTypedDict +from .pushoperationstatus import PushOperationStatus +from .supplementaldata import SupplementalData, SupplementalDataTypedDict +from .supplierstatus import SupplierStatus +from .validation import Validation, ValidationTypedDict +from codat_sync_for_payables_version_1.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +import pydantic +from pydantic import model_serializer +from typing import List, Optional +from typing_extensions import Annotated, NotRequired, TypedDict, deprecated + + +@deprecated( + "warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible." +) +class AccountingSupplierTypedDict(TypedDict): + r"""> View the coverage for suppliers in the Data coverage explorer. + + ## Overview + + From the **Suppliers** endpoints, you can retrieve a list of [all the suppliers for a company](https://docs.codat.io/sync-for-payables-api#/operations/list-suppliers). Suppliers' data links to accounts payable [bills](https://docs.codat.io/sync-for-payables-api#/schemas/Bill). + """ + + status: SupplierStatus + r"""Status of the supplier.""" + addresses: NotRequired[Nullable[List[AddressTypedDict]]] + r"""An array of Addresses.""" + contact_name: NotRequired[Nullable[str]] + r"""Name of the main contact for the supplier.""" + default_currency: NotRequired[Nullable[str]] + r"""Default currency the supplier's transactional data is recorded in.""" + email_address: NotRequired[Nullable[str]] + r"""Email address that the supplier may be contacted on.""" + id: NotRequired[str] + r"""Identifier for the supplier, unique to the company in the accounting software.""" + metadata: NotRequired[MetadataTypedDict] + modified_date: NotRequired[str] + phone: NotRequired[Nullable[str]] + r"""Phone number that the supplier may be contacted on.""" + registration_number: NotRequired[Nullable[str]] + r"""Company number of the supplier. In the UK, this is typically the company registration number issued by Companies House.""" + source_modified_date: NotRequired[str] + supplemental_data: NotRequired[SupplementalDataTypedDict] + r"""Supplemental data is additional data you can include in our standard data types. + + It is referenced as a configured dynamic key value pair that is unique to the accounting software. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. + """ + supplier_name: NotRequired[Nullable[str]] + r"""Name of the supplier as recorded in the accounting system, typically the company name.""" + tax_number: NotRequired[Nullable[str]] + r"""Supplier's company tax number.""" + + +@deprecated( + "warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible." +) +class AccountingSupplier(BaseModel): + r"""> View the coverage for suppliers in the Data coverage explorer. + + ## Overview + + From the **Suppliers** endpoints, you can retrieve a list of [all the suppliers for a company](https://docs.codat.io/sync-for-payables-api#/operations/list-suppliers). Suppliers' data links to accounts payable [bills](https://docs.codat.io/sync-for-payables-api#/schemas/Bill). + """ + + status: SupplierStatus + r"""Status of the supplier.""" + + addresses: OptionalNullable[List[Address]] = UNSET + r"""An array of Addresses.""" + + contact_name: Annotated[ + OptionalNullable[str], pydantic.Field(alias="contactName") + ] = UNSET + r"""Name of the main contact for the supplier.""" + + default_currency: Annotated[ + OptionalNullable[str], pydantic.Field(alias="defaultCurrency") + ] = UNSET + r"""Default currency the supplier's transactional data is recorded in.""" + + email_address: Annotated[ + OptionalNullable[str], pydantic.Field(alias="emailAddress") + ] = UNSET + r"""Email address that the supplier may be contacted on.""" + + id: Optional[str] = None + r"""Identifier for the supplier, unique to the company in the accounting software.""" + + metadata: Optional[Metadata] = None + + modified_date: Annotated[Optional[str], pydantic.Field(alias="modifiedDate")] = None + + phone: OptionalNullable[str] = UNSET + r"""Phone number that the supplier may be contacted on.""" + + registration_number: Annotated[ + OptionalNullable[str], pydantic.Field(alias="registrationNumber") + ] = UNSET + r"""Company number of the supplier. In the UK, this is typically the company registration number issued by Companies House.""" + + source_modified_date: Annotated[ + Optional[str], pydantic.Field(alias="sourceModifiedDate") + ] = None + + supplemental_data: Annotated[ + Optional[SupplementalData], pydantic.Field(alias="supplementalData") + ] = None + r"""Supplemental data is additional data you can include in our standard data types. + + It is referenced as a configured dynamic key value pair that is unique to the accounting software. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. + """ + + supplier_name: Annotated[ + OptionalNullable[str], pydantic.Field(alias="supplierName") + ] = UNSET + r"""Name of the supplier as recorded in the accounting system, typically the company name.""" + + tax_number: Annotated[OptionalNullable[str], pydantic.Field(alias="taxNumber")] = ( + UNSET + ) + r"""Supplier's company tax number.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = [ + "addresses", + "contactName", + "defaultCurrency", + "emailAddress", + "id", + "metadata", + "modifiedDate", + "phone", + "registrationNumber", + "sourceModifiedDate", + "supplementalData", + "supplierName", + "taxNumber", + ] + nullable_fields = [ + "addresses", + "contactName", + "defaultCurrency", + "emailAddress", + "phone", + "registrationNumber", + "supplierName", + "taxNumber", + ] + null_default_fields = [] + + serialized = handler(self) + + m = {} + + for n, f in self.model_fields.items(): + k = f.alias or n + val = serialized.get(k) + serialized.pop(k, None) + + optional_nullable = k in optional_fields and k in nullable_fields + is_set = ( + self.__pydantic_fields_set__.intersection({n}) + or k in null_default_fields + ) # pylint: disable=no-member + + if val is not None and val != UNSET_SENTINEL: + m[k] = val + elif val != UNSET_SENTINEL and ( + not k in optional_fields or (optional_nullable and is_set) + ): + m[k] = val + + return m + + +class CreateSupplierResponseTypedDict(TypedDict): + company_id: str + r"""Unique identifier for your SMB in Codat.""" + data_connection_key: str + r"""Unique identifier for a company's data connection.""" + push_operation_key: str + r"""A unique identifier generated by Codat to represent this single push operation. This identifier can be used to track the status of the push, and should be persisted.""" + requested_on_utc: 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: + + ``` + 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. + """ + status: PushOperationStatus + r"""The current status of the push operation.""" + status_code: int + r"""Push status code.""" + changes: NotRequired[Nullable[List[PushOperationChangeTypedDict]]] + r"""Contains a single entry that communicates which record has changed and the manner in which it changed.""" + completed_on_utc: 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: + + ``` + 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. + """ + data: NotRequired[Nullable[AccountingSupplierTypedDict]] + data_type: NotRequired[DataType] + r"""Available data types""" + error_message: NotRequired[Nullable[str]] + r"""A message about the error.""" + timeout_in_minutes: NotRequired[Nullable[int]] + r"""Number of minutes the push operation must complete within before it times out.""" + timeout_in_seconds: NotRequired[Nullable[int]] + r"""Number of seconds the push operation must complete within before it times out.""" + validation: NotRequired[ValidationTypedDict] + r"""A human-readable object describing validation decisions Codat has made when pushing data into the platform. If a push has failed because of validation errors, they will be detailed here.""" + + +class CreateSupplierResponse(BaseModel): + company_id: Annotated[str, pydantic.Field(alias="companyId")] + r"""Unique identifier for your SMB in Codat.""" + + data_connection_key: Annotated[str, pydantic.Field(alias="dataConnectionKey")] + r"""Unique identifier for a company's data connection.""" + + push_operation_key: Annotated[str, pydantic.Field(alias="pushOperationKey")] + r"""A unique identifier generated by Codat to represent this single push operation. This identifier can be used to track the status of the push, and should be persisted.""" + + requested_on_utc: Annotated[str, pydantic.Field(alias="requestedOnUtc")] + 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: + + ``` + 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. + """ + + status: PushOperationStatus + r"""The current status of the push operation.""" + + status_code: Annotated[int, pydantic.Field(alias="statusCode")] + r"""Push status code.""" + + changes: OptionalNullable[List[PushOperationChange]] = UNSET + r"""Contains a single entry that communicates which record has changed and the manner in which it changed.""" + + completed_on_utc: Annotated[ + Optional[str], pydantic.Field(alias="completedOnUtc") + ] = 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: + + ``` + 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. + """ + + data: OptionalNullable[AccountingSupplier] = UNSET + + data_type: Annotated[Optional[DataType], pydantic.Field(alias="dataType")] = None + r"""Available data types""" + + error_message: Annotated[ + OptionalNullable[str], pydantic.Field(alias="errorMessage") + ] = UNSET + r"""A message about the error.""" + + timeout_in_minutes: Annotated[ + OptionalNullable[int], pydantic.Field(alias="timeoutInMinutes") + ] = UNSET + r"""Number of minutes the push operation must complete within before it times out.""" + + timeout_in_seconds: Annotated[ + OptionalNullable[int], + pydantic.Field( + deprecated="warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible.", + alias="timeoutInSeconds", + ), + ] = UNSET + r"""Number of seconds the push operation must complete within before it times out.""" + + validation: Optional[Validation] = None + r"""A human-readable object describing validation decisions Codat has made when pushing data into the platform. If a push has failed because of validation errors, they will be detailed here.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = [ + "changes", + "completedOnUtc", + "data", + "dataType", + "errorMessage", + "timeoutInMinutes", + "timeoutInSeconds", + "validation", + ] + nullable_fields = [ + "changes", + "data", + "errorMessage", + "timeoutInMinutes", + "timeoutInSeconds", + ] + null_default_fields = [] + + serialized = handler(self) + + m = {} + + for n, f in self.model_fields.items(): + k = f.alias or n + val = serialized.get(k) + serialized.pop(k, None) + + optional_nullable = k in optional_fields and k in nullable_fields + is_set = ( + self.__pydantic_fields_set__.intersection({n}) + or k in null_default_fields + ) # pylint: disable=no-member + + if val is not None and val != UNSET_SENTINEL: + m[k] = val + elif val != UNSET_SENTINEL and ( + not k in optional_fields or (optional_nullable and is_set) + ): + m[k] = val + + return m diff --git a/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/dataconnectionerror.py b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/dataconnectionerror.py new file mode 100644 index 000000000..2f137bb16 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/dataconnectionerror.py @@ -0,0 +1,174 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from codat_sync_for_payables_version_1.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from enum import Enum +import pydantic +from pydantic import model_serializer +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class ErrorStatus(str, Enum): + r"""The current status of a transient error. Null statuses indicate that the error is not transient.""" + + ACTIVE = "Active" + RESOLVED = "Resolved" + + +class DataConnectionErrorTypedDict(TypedDict): + error_message: NotRequired[str] + r"""A message about a error returned by Codat.""" + errored_on_utc: 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: + + ``` + 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. + """ + resolved_on_utc: 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: + + ``` + 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. + """ + status: NotRequired[Nullable[ErrorStatus]] + r"""The current status of a transient error. Null statuses indicate that the error is not transient.""" + status_code: NotRequired[str] + r"""The HTTP status code returned by the source platform when the error occurred.""" + status_text: NotRequired[str] + r"""A non-numeric status code/text returned by the source platform when the error occurred.""" + + +class DataConnectionError(BaseModel): + error_message: Annotated[Optional[str], pydantic.Field(alias="errorMessage")] = None + r"""A message about a error returned by Codat.""" + + errored_on_utc: Annotated[Optional[str], pydantic.Field(alias="erroredOnUtc")] = ( + 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: + + ``` + 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. + """ + + resolved_on_utc: Annotated[Optional[str], pydantic.Field(alias="resolvedOnUtc")] = ( + 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: + + ``` + 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. + """ + + status: OptionalNullable[ErrorStatus] = UNSET + r"""The current status of a transient error. Null statuses indicate that the error is not transient.""" + + status_code: Annotated[Optional[str], pydantic.Field(alias="statusCode")] = None + r"""The HTTP status code returned by the source platform when the error occurred.""" + + status_text: Annotated[Optional[str], pydantic.Field(alias="statusText")] = None + r"""A non-numeric status code/text returned by the source platform when the error occurred.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = [ + "errorMessage", + "erroredOnUtc", + "resolvedOnUtc", + "status", + "statusCode", + "statusText", + ] + nullable_fields = ["status"] + null_default_fields = [] + + serialized = handler(self) + + m = {} + + for n, f in self.model_fields.items(): + k = f.alias or n + val = serialized.get(k) + serialized.pop(k, None) + + optional_nullable = k in optional_fields and k in nullable_fields + is_set = ( + self.__pydantic_fields_set__.intersection({n}) + or k in null_default_fields + ) # pylint: disable=no-member + + if val is not None and val != UNSET_SENTINEL: + m[k] = val + elif val != UNSET_SENTINEL and ( + not k in optional_fields or (optional_nullable and is_set) + ): + m[k] = val + + return m diff --git a/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/dataconnectionstatus.py b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/dataconnectionstatus.py new file mode 100644 index 000000000..a97f7be30 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/dataconnectionstatus.py @@ -0,0 +1,13 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from enum import Enum + + +class DataConnectionStatus(str, Enum): + r"""The current authorization status of the data connection.""" + + PENDING_AUTH = "PendingAuth" + LINKED = "Linked" + UNLINKED = "Unlinked" + DEAUTHORIZED = "Deauthorized" diff --git a/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/datastatus.py b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/datastatus.py new file mode 100644 index 000000000..8961dc4a4 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/datastatus.py @@ -0,0 +1,133 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .propertie_status import PropertieStatus +from codat_sync_for_payables_version_1.types import BaseModel +from enum import Enum +import pydantic +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class DataTypes(str, Enum): + r"""Available data types""" + + ACCOUNT_TRANSACTIONS = "accountTransactions" + BALANCE_SHEET = "balanceSheet" + BANK_ACCOUNTS = "bankAccounts" + BANK_TRANSACTIONS = "bankTransactions" + BILL_CREDIT_NOTES = "billCreditNotes" + BILL_PAYMENTS = "billPayments" + BILLS = "bills" + CASH_FLOW_STATEMENT = "cashFlowStatement" + CHART_OF_ACCOUNTS = "chartOfAccounts" + COMPANY = "company" + CREDIT_NOTES = "creditNotes" + CUSTOMERS = "customers" + DIRECT_COSTS = "directCosts" + DIRECT_INCOMES = "directIncomes" + INVOICES = "invoices" + ITEM_RECEIPTS = "itemReceipts" + ITEMS = "items" + JOURNAL_ENTRIES = "journalEntries" + JOURNALS = "journals" + PAYMENT_METHODS = "paymentMethods" + PAYMENTS = "payments" + PROFIT_AND_LOSS = "profitAndLoss" + PURCHASE_ORDERS = "purchaseOrders" + SALES_ORDERS = "salesOrders" + SUPPLIERS = "suppliers" + TAX_RATES = "taxRates" + TRACKING_CATEGORIES = "trackingCategories" + TRANSFERS = "transfers" + BANKING_ACCOUNT_BALANCES = "banking-accountBalances" + BANKING_ACCOUNTS = "banking-accounts" + BANKING_TRANSACTION_CATEGORIES = "banking-transactionCategories" + BANKING_TRANSACTIONS = "banking-transactions" + COMMERCE_COMPANY_INFO = "commerce-companyInfo" + COMMERCE_CUSTOMERS = "commerce-customers" + COMMERCE_DISPUTES = "commerce-disputes" + COMMERCE_LOCATIONS = "commerce-locations" + COMMERCE_ORDERS = "commerce-orders" + COMMERCE_PAYMENT_METHODS = "commerce-paymentMethods" + COMMERCE_PAYMENTS = "commerce-payments" + COMMERCE_PRODUCT_CATEGORIES = "commerce-productCategories" + COMMERCE_PRODUCTS = "commerce-products" + COMMERCE_TAX_COMPONENTS = "commerce-taxComponents" + COMMERCE_TRANSACTIONS = "commerce-transactions" + + +class DataStatusTypedDict(TypedDict): + r"""Describes the state of data in the Codat cache for a company and data type""" + + current_status: PropertieStatus + r"""The current status of the dataset.""" + data_type: DataTypes + r"""Available data types""" + last_successful_sync: 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: + + ``` + 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. + """ + latest_successful_sync_id: NotRequired[str] + r"""Unique identifier for the most recent successful sync of data type.""" + latest_sync_id: NotRequired[str] + r"""Unique identifier for most recent sync of data type.""" + + +class DataStatus(BaseModel): + r"""Describes the state of data in the Codat cache for a company and data type""" + + current_status: Annotated[PropertieStatus, pydantic.Field(alias="currentStatus")] + r"""The current status of the dataset.""" + + data_type: Annotated[DataTypes, pydantic.Field(alias="dataType")] + r"""Available data types""" + + last_successful_sync: Annotated[str, pydantic.Field(alias="lastSuccessfulSync")] + 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: + + ``` + 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. + """ + + latest_successful_sync_id: Annotated[ + Optional[str], pydantic.Field(alias="latestSuccessfulSyncId") + ] = None + r"""Unique identifier for the most recent successful sync of data type.""" + + latest_sync_id: Annotated[Optional[str], pydantic.Field(alias="latestSyncId")] = ( + None + ) + r"""Unique identifier for most recent sync of data type.""" diff --git a/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/datatype.py b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/datatype.py new file mode 100644 index 000000000..e0aff6fb8 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/datatype.py @@ -0,0 +1,52 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from enum import Enum + + +class DataType(str, Enum): + r"""Available data types""" + + ACCOUNT_TRANSACTIONS = "accountTransactions" + BALANCE_SHEET = "balanceSheet" + BANK_ACCOUNTS = "bankAccounts" + BANK_TRANSACTIONS = "bankTransactions" + BILL_CREDIT_NOTES = "billCreditNotes" + BILL_PAYMENTS = "billPayments" + BILLS = "bills" + CASH_FLOW_STATEMENT = "cashFlowStatement" + CHART_OF_ACCOUNTS = "chartOfAccounts" + COMPANY = "company" + CREDIT_NOTES = "creditNotes" + CUSTOMERS = "customers" + DIRECT_COSTS = "directCosts" + DIRECT_INCOMES = "directIncomes" + INVOICES = "invoices" + ITEM_RECEIPTS = "itemReceipts" + ITEMS = "items" + JOURNAL_ENTRIES = "journalEntries" + JOURNALS = "journals" + PAYMENT_METHODS = "paymentMethods" + PAYMENTS = "payments" + PROFIT_AND_LOSS = "profitAndLoss" + PURCHASE_ORDERS = "purchaseOrders" + SALES_ORDERS = "salesOrders" + SUPPLIERS = "suppliers" + TAX_RATES = "taxRates" + TRACKING_CATEGORIES = "trackingCategories" + TRANSFERS = "transfers" + BANKING_ACCOUNT_BALANCES = "banking-accountBalances" + BANKING_ACCOUNTS = "banking-accounts" + BANKING_TRANSACTION_CATEGORIES = "banking-transactionCategories" + BANKING_TRANSACTIONS = "banking-transactions" + COMMERCE_COMPANY_INFO = "commerce-companyInfo" + COMMERCE_CUSTOMERS = "commerce-customers" + COMMERCE_DISPUTES = "commerce-disputes" + COMMERCE_LOCATIONS = "commerce-locations" + COMMERCE_ORDERS = "commerce-orders" + COMMERCE_PAYMENT_METHODS = "commerce-paymentMethods" + COMMERCE_PAYMENTS = "commerce-payments" + COMMERCE_PRODUCT_CATEGORIES = "commerce-productCategories" + COMMERCE_PRODUCTS = "commerce-products" + COMMERCE_TAX_COMPONENTS = "commerce-taxComponents" + COMMERCE_TRANSACTIONS = "commerce-transactions" diff --git a/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/errorvalidation.py b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/errorvalidation.py new file mode 100644 index 000000000..d40642b52 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/errorvalidation.py @@ -0,0 +1,59 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .errorvalidationitem import ErrorValidationItem, ErrorValidationItemTypedDict +from codat_sync_for_payables_version_1.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from pydantic import model_serializer +from typing import List +from typing_extensions import NotRequired, TypedDict + + +class ErrorValidationTypedDict(TypedDict): + r"""A human-readable object describing validation decisions Codat has made. If an operation has failed because of validation errors, they will be detailed here.""" + + errors: NotRequired[Nullable[List[ErrorValidationItemTypedDict]]] + warnings: NotRequired[Nullable[List[ErrorValidationItemTypedDict]]] + + +class ErrorValidation(BaseModel): + r"""A human-readable object describing validation decisions Codat has made. If an operation has failed because of validation errors, they will be detailed here.""" + + errors: OptionalNullable[List[ErrorValidationItem]] = UNSET + + warnings: OptionalNullable[List[ErrorValidationItem]] = UNSET + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = ["errors", "warnings"] + nullable_fields = ["errors", "warnings"] + null_default_fields = [] + + serialized = handler(self) + + m = {} + + for n, f in self.model_fields.items(): + k = f.alias or n + val = serialized.get(k) + serialized.pop(k, None) + + optional_nullable = k in optional_fields and k in nullable_fields + is_set = ( + self.__pydantic_fields_set__.intersection({n}) + or k in null_default_fields + ) # pylint: disable=no-member + + if val is not None and val != UNSET_SENTINEL: + m[k] = val + elif val != UNSET_SENTINEL and ( + not k in optional_fields or (optional_nullable and is_set) + ): + m[k] = val + + return m diff --git a/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/errorvalidationitem.py b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/errorvalidationitem.py new file mode 100644 index 000000000..2b7e87a2f --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/errorvalidationitem.py @@ -0,0 +1,65 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from codat_sync_for_payables_version_1.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +import pydantic +from pydantic import model_serializer +from typing_extensions import Annotated, NotRequired, TypedDict + + +class ErrorValidationItemTypedDict(TypedDict): + item_id: NotRequired[Nullable[str]] + r"""Unique identifier for a validation item.""" + message: NotRequired[Nullable[str]] + r"""A message outlining validation item's issue.""" + validator_name: NotRequired[Nullable[str]] + r"""Name of validator.""" + + +class ErrorValidationItem(BaseModel): + item_id: Annotated[OptionalNullable[str], pydantic.Field(alias="itemId")] = UNSET + r"""Unique identifier for a validation item.""" + + message: OptionalNullable[str] = UNSET + r"""A message outlining validation item's issue.""" + + validator_name: Annotated[ + OptionalNullable[str], pydantic.Field(alias="validatorName") + ] = UNSET + r"""Name of validator.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = ["itemId", "message", "validatorName"] + nullable_fields = ["itemId", "message", "validatorName"] + null_default_fields = [] + + serialized = handler(self) + + m = {} + + for n, f in self.model_fields.items(): + k = f.alias or n + val = serialized.get(k) + serialized.pop(k, None) + + optional_nullable = k in optional_fields and k in nullable_fields + is_set = ( + self.__pydantic_fields_set__.intersection({n}) + or k in null_default_fields + ) # pylint: disable=no-member + + if val is not None and val != UNSET_SENTINEL: + m[k] = val + elif val != UNSET_SENTINEL and ( + not k in optional_fields or (optional_nullable and is_set) + ): + m[k] = val + + return m diff --git a/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/halref.py b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/halref.py new file mode 100644 index 000000000..f1c45f354 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/halref.py @@ -0,0 +1,16 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from codat_sync_for_payables_version_1.types import BaseModel +from typing import Optional +from typing_extensions import NotRequired, TypedDict + + +class HalRefTypedDict(TypedDict): + href: NotRequired[str] + r"""Uri hypertext reference.""" + + +class HalRef(BaseModel): + href: Optional[str] = None + r"""Uri hypertext reference.""" diff --git a/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/itemref.py b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/itemref.py new file mode 100644 index 000000000..1f1bc049b --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/itemref.py @@ -0,0 +1,61 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from codat_sync_for_payables_version_1.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from pydantic import model_serializer +from typing_extensions import NotRequired, TypedDict + + +class ItemRefTypedDict(TypedDict): + r"""Reference to the item the line is linked to.""" + + id: str + r"""Unique identifier for the item in the accounting software.""" + name: NotRequired[Nullable[str]] + r"""Name of the item in the accounting software.""" + + +class ItemRef(BaseModel): + r"""Reference to the item the line is linked to.""" + + id: str + r"""Unique identifier for the item in the accounting software.""" + + name: OptionalNullable[str] = UNSET + r"""Name of the item in the accounting software.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = ["name"] + nullable_fields = ["name"] + null_default_fields = [] + + serialized = handler(self) + + m = {} + + for n, f in self.model_fields.items(): + k = f.alias or n + val = serialized.get(k) + serialized.pop(k, None) + + optional_nullable = k in optional_fields and k in nullable_fields + is_set = ( + self.__pydantic_fields_set__.intersection({n}) + or k in null_default_fields + ) # pylint: disable=no-member + + if val is not None and val != UNSET_SENTINEL: + m[k] = val + elif val != UNSET_SENTINEL and ( + not k in optional_fields or (optional_nullable and is_set) + ): + m[k] = val + + return m diff --git a/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/items.py b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/items.py new file mode 100644 index 000000000..66894fe1b --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/items.py @@ -0,0 +1,220 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .paymentallocationpayment import ( + PaymentAllocationPayment, + PaymentAllocationPaymentTypedDict, +) +from codat_sync_for_payables_version_1.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from codat_sync_for_payables_version_1.utils import serialize_decimal, validate_decimal +from decimal import Decimal +import pydantic +from pydantic import model_serializer +from pydantic.functional_serializers import PlainSerializer +from pydantic.functional_validators import BeforeValidator +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class AllocationTypedDict(TypedDict): + allocated_on_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: + + ``` + 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. + """ + currency: NotRequired[str] + r"""The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + + ## Unknown currencies + + In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + + There are only a very small number of edge cases where this currency code is returned by the Codat system. + """ + currency_rate: NotRequired[Nullable[Decimal]] + r"""Rate to convert the total amount of the payment into the base currency for the company at the time of the payment. + + Currency rates in Codat are implemented as the multiple of foreign currency units to each base currency unit. + + It is not possible to perform the currency conversion with two or more non-base currencies participating in the transaction. For example, if a company's base currency is USD, and it has a bill issued in EUR, then the bill payment must happen in USD or EUR. + + Where the currency rate is provided by the underlying accounting software, it will be available from Codat with the same precision (up to a maximum of 9 decimal places). + + For accounting software which do not provide an explicit currency rate, it is calculated as `baseCurrency / foreignCurrency` and will be returned to 9 decimal places. + + ## Examples with base currency of GBP + + | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (GBP) | + | :--------------- | :------------- | :------------ | :------------------------- | + | **USD** | $20 | 0.781 | £15.62 | + | **EUR** | €20 | 0.885 | £17.70 | + | **RUB** | ₽20 | 0.011 | £0.22 | + + ## Examples with base currency of USD + + | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (USD) | + | :--------------- | :------------- | :------------ | :------------------------- | + | **GBP** | £20 | 1.277 | $25.54 | + | **EUR** | €20 | 1.134 | $22.68 | + | **RUB** | ₽20 | 0.015 | $0.30 | + + + ### Integration-specific details + + | Integration | Scenario | System behavior | + |-------------------|-------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------| + | QuickBooks Online | Transaction currency differs from base currency | If currency rate value is left `null`, a rate of 1 will be used by QBO by default. To override this, specify a currencyRate in the request body. | + """ + total_amount: NotRequired[Decimal] + r"""The total amount that has been allocated.""" + + +class Allocation(BaseModel): + allocated_on_date: Annotated[ + Optional[str], pydantic.Field(alias="allocatedOnDate") + ] = 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: + + ``` + 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. + """ + + currency: Optional[str] = None + r"""The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + + ## Unknown currencies + + In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + + There are only a very small number of edge cases where this currency code is returned by the Codat system. + """ + + currency_rate: Annotated[ + Annotated[ + OptionalNullable[Decimal], + BeforeValidator(validate_decimal), + PlainSerializer(serialize_decimal(False)), + ], + pydantic.Field(alias="currencyRate"), + ] = UNSET + r"""Rate to convert the total amount of the payment into the base currency for the company at the time of the payment. + + Currency rates in Codat are implemented as the multiple of foreign currency units to each base currency unit. + + It is not possible to perform the currency conversion with two or more non-base currencies participating in the transaction. For example, if a company's base currency is USD, and it has a bill issued in EUR, then the bill payment must happen in USD or EUR. + + Where the currency rate is provided by the underlying accounting software, it will be available from Codat with the same precision (up to a maximum of 9 decimal places). + + For accounting software which do not provide an explicit currency rate, it is calculated as `baseCurrency / foreignCurrency` and will be returned to 9 decimal places. + + ## Examples with base currency of GBP + + | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (GBP) | + | :--------------- | :------------- | :------------ | :------------------------- | + | **USD** | $20 | 0.781 | £15.62 | + | **EUR** | €20 | 0.885 | £17.70 | + | **RUB** | ₽20 | 0.011 | £0.22 | + + ## Examples with base currency of USD + + | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (USD) | + | :--------------- | :------------- | :------------ | :------------------------- | + | **GBP** | £20 | 1.277 | $25.54 | + | **EUR** | €20 | 1.134 | $22.68 | + | **RUB** | ₽20 | 0.015 | $0.30 | + + + ### Integration-specific details + + | Integration | Scenario | System behavior | + |-------------------|-------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------| + | QuickBooks Online | Transaction currency differs from base currency | If currency rate value is left `null`, a rate of 1 will be used by QBO by default. To override this, specify a currencyRate in the request body. | + """ + + total_amount: Annotated[ + Annotated[ + Optional[Decimal], + BeforeValidator(validate_decimal), + PlainSerializer(serialize_decimal(False)), + ], + pydantic.Field(alias="totalAmount"), + ] = None + r"""The total amount that has been allocated.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = ["allocatedOnDate", "currency", "currencyRate", "totalAmount"] + nullable_fields = ["currencyRate"] + null_default_fields = [] + + serialized = handler(self) + + m = {} + + for n, f in self.model_fields.items(): + k = f.alias or n + val = serialized.get(k) + serialized.pop(k, None) + + optional_nullable = k in optional_fields and k in nullable_fields + is_set = ( + self.__pydantic_fields_set__.intersection({n}) + or k in null_default_fields + ) # pylint: disable=no-member + + if val is not None and val != UNSET_SENTINEL: + m[k] = val + elif val != UNSET_SENTINEL and ( + not k in optional_fields or (optional_nullable and is_set) + ): + m[k] = val + + return m + + +class ItemsTypedDict(TypedDict): + allocation: AllocationTypedDict + payment: PaymentAllocationPaymentTypedDict + + +class Items(BaseModel): + allocation: Allocation + + payment: PaymentAllocationPayment diff --git a/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/journal.py b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/journal.py new file mode 100644 index 000000000..df104d796 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/journal.py @@ -0,0 +1,214 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .journalstatus import JournalStatus +from .metadata import Metadata, MetadataTypedDict +from codat_sync_for_payables_version_1.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +import pydantic +from pydantic import model_serializer +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class JournalTypedDict(TypedDict): + r"""> **Language tip:** For line items, or individual transactions, of a company's financial documents, refer to the [Journal entries](https://docs.codat.io/sync-for-payables-api#/schemas/JournalEntry) data type + + > View the coverage for journals in the Data coverage explorer. + + ## Overview + + In accounting software, journals are used to record all the financial transactions of a company. Each transaction in a journal is represented by a separate [journal entry](https://docs.codat.io/sync-for-payables-api#/schemas/JournalEntry). These entries are used to create the general ledger, which is then used to create the financial statements of a business. + + When a company records all their transactions in a single journal, it can become large and difficult to maintain and track. This is why large companies often use multiple journals (also known as subjournals) to categorize and manage journal entries. + + Such journals can be divided into two categories: + + - Special journals: journals used to record specific types of transactions; for example, a purchases journal, a sales journal, or a cash management journal. + - General journals: journals used to record transactions that fall outside the scope of the special journals. + + Multiple journals or subjournals are used in the following Codat integrations: + + - [Sage Intacct](https://docs.codat.io/integrations/accounting/sage-intacct/accounting-sage-intacct) (mandatory) + - [Exact Online](https://docs.codat.io/integrations/accounting/exact-online/accounting-exact-online) (mandatory) + - [Oracle NetSuite](https://docs.codat.io/integrations/accounting/netsuite/accounting-netsuite) (optional) + + > When pushing journal entries to an accounting software that doesn’t support multiple journals (multi-book accounting), the entries will be linked to the platform-generic journal. The Journals data type will only include one object. + + """ + + created_on: 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: + + ``` + 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. + """ + has_children: NotRequired[bool] + r"""If the journal has child journals, this value is true. If it doesn’t, it is false.""" + id: NotRequired[str] + r"""Journal ID.""" + journal_code: NotRequired[Nullable[str]] + r"""Native journal number or code.""" + metadata: NotRequired[MetadataTypedDict] + modified_date: NotRequired[str] + name: NotRequired[Nullable[str]] + r"""Journal name. + The maximum length for a journal name is 256 characters. All characters above that number will be truncated. + """ + parent_id: NotRequired[Nullable[str]] + r"""Parent journal ID. + If the journal is a parent journal, this value is not present. + """ + source_modified_date: NotRequired[str] + status: NotRequired[JournalStatus] + r"""Current journal status.""" + type: NotRequired[Nullable[str]] + r"""The type of the journal.""" + + +class Journal(BaseModel): + r"""> **Language tip:** For line items, or individual transactions, of a company's financial documents, refer to the [Journal entries](https://docs.codat.io/sync-for-payables-api#/schemas/JournalEntry) data type + + > View the coverage for journals in the Data coverage explorer. + + ## Overview + + In accounting software, journals are used to record all the financial transactions of a company. Each transaction in a journal is represented by a separate [journal entry](https://docs.codat.io/sync-for-payables-api#/schemas/JournalEntry). These entries are used to create the general ledger, which is then used to create the financial statements of a business. + + When a company records all their transactions in a single journal, it can become large and difficult to maintain and track. This is why large companies often use multiple journals (also known as subjournals) to categorize and manage journal entries. + + Such journals can be divided into two categories: + + - Special journals: journals used to record specific types of transactions; for example, a purchases journal, a sales journal, or a cash management journal. + - General journals: journals used to record transactions that fall outside the scope of the special journals. + + Multiple journals or subjournals are used in the following Codat integrations: + + - [Sage Intacct](https://docs.codat.io/integrations/accounting/sage-intacct/accounting-sage-intacct) (mandatory) + - [Exact Online](https://docs.codat.io/integrations/accounting/exact-online/accounting-exact-online) (mandatory) + - [Oracle NetSuite](https://docs.codat.io/integrations/accounting/netsuite/accounting-netsuite) (optional) + + > When pushing journal entries to an accounting software that doesn’t support multiple journals (multi-book accounting), the entries will be linked to the platform-generic journal. The Journals data type will only include one object. + + """ + + created_on: Annotated[Optional[str], pydantic.Field(alias="createdOn")] = 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: + + ``` + 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. + """ + + has_children: Annotated[Optional[bool], pydantic.Field(alias="hasChildren")] = None + r"""If the journal has child journals, this value is true. If it doesn’t, it is false.""" + + id: Optional[str] = None + r"""Journal ID.""" + + journal_code: Annotated[ + OptionalNullable[str], pydantic.Field(alias="journalCode") + ] = UNSET + r"""Native journal number or code.""" + + metadata: Optional[Metadata] = None + + modified_date: Annotated[Optional[str], pydantic.Field(alias="modifiedDate")] = None + + name: OptionalNullable[str] = UNSET + r"""Journal name. + The maximum length for a journal name is 256 characters. All characters above that number will be truncated. + """ + + parent_id: Annotated[OptionalNullable[str], pydantic.Field(alias="parentId")] = ( + UNSET + ) + r"""Parent journal ID. + If the journal is a parent journal, this value is not present. + """ + + source_modified_date: Annotated[ + Optional[str], pydantic.Field(alias="sourceModifiedDate") + ] = None + + status: Optional[JournalStatus] = None + r"""Current journal status.""" + + type: OptionalNullable[str] = UNSET + r"""The type of the journal.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = [ + "createdOn", + "hasChildren", + "id", + "journalCode", + "metadata", + "modifiedDate", + "name", + "parentId", + "sourceModifiedDate", + "status", + "type", + ] + nullable_fields = ["journalCode", "name", "parentId", "type"] + null_default_fields = [] + + serialized = handler(self) + + m = {} + + for n, f in self.model_fields.items(): + k = f.alias or n + val = serialized.get(k) + serialized.pop(k, None) + + optional_nullable = k in optional_fields and k in nullable_fields + is_set = ( + self.__pydantic_fields_set__.intersection({n}) + or k in null_default_fields + ) # pylint: disable=no-member + + if val is not None and val != UNSET_SENTINEL: + m[k] = val + elif val != UNSET_SENTINEL and ( + not k in optional_fields or (optional_nullable and is_set) + ): + m[k] = val + + return m diff --git a/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/journalentry.py b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/journalentry.py new file mode 100644 index 000000000..d0757edac --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/journalentry.py @@ -0,0 +1,299 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .journalentryrecordref import JournalEntryRecordRef, JournalEntryRecordRefTypedDict +from .journalline import JournalLine, JournalLineTypedDict +from .journalref import JournalRef, JournalRefTypedDict +from .metadata import Metadata, MetadataTypedDict +from .supplementaldata import SupplementalData, SupplementalDataTypedDict +from codat_sync_for_payables_version_1.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +import pydantic +from pydantic import model_serializer +from typing import List, Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class JournalEntryTypedDict(TypedDict): + r"""> **Language tip:** For the top-level record of a company's financial transactions, refer to the [Journals](https://docs.codat.io/sync-for-payables-api#/schemas/Journal) data type + + > View the coverage for journal entries in the Data coverage explorer. + + ## Overview + + A journal entry report shows the entries made in a company's general ledger, or [accounts](https://docs.codat.io/sync-for-payables-api#/schemas/Account), when transactions are approved. The journal line items for each journal entry should balance. + + A journal entry line item is a single transaction line on the journal entry. For example: + + - When a journal entry is recording a receipt of cash, the credit to accounts receivable and the debit to cash are separate line items. + - When a company needs to recognise revenue from an annual contract on a monthly basis, on receipt of cash for month one, they make a debit to deferred income and a credit to revenue. + + In Codat a journal entry contains details of: + + - The date on which the entry was created and posted. + - Itemised lines, including amounts and currency. + - A reference to the associated accounts. + - A reference to the underlying record. For example, the invoice, bill, or other data type that triggered the posting of the journal entry to the general ledger. + + > **Pushing journal entries** + > Codat only supports journal entries in the base currency of the company that are pushed into accounts denominated in the same base currency. + """ + + created_on: 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: + + ``` + 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. + """ + description: NotRequired[Nullable[str]] + r"""Optional description of the journal entry.""" + id: NotRequired[str] + r"""Unique identifier of the journal entry for the company in the accounting software.""" + journal_lines: NotRequired[Nullable[List[JournalLineTypedDict]]] + r"""An array of journal lines.""" + journal_ref: NotRequired[JournalRefTypedDict] + r"""Links journal entries to the relevant journal in accounting integrations that use multi-book accounting (multiple journals).""" + metadata: NotRequired[MetadataTypedDict] + modified_date: NotRequired[str] + posted_on: 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: + + ``` + 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. + """ + record_ref: NotRequired[JournalEntryRecordRefTypedDict] + r"""Links a journal entry to the underlying record that created it.""" + source_modified_date: NotRequired[str] + supplemental_data: NotRequired[SupplementalDataTypedDict] + r"""Supplemental data is additional data you can include in our standard data types. + + It is referenced as a configured dynamic key value pair that is unique to the accounting software. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. + """ + updated_on: 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: + + ``` + 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. + """ + + +class JournalEntry(BaseModel): + r"""> **Language tip:** For the top-level record of a company's financial transactions, refer to the [Journals](https://docs.codat.io/sync-for-payables-api#/schemas/Journal) data type + + > View the coverage for journal entries in the Data coverage explorer. + + ## Overview + + A journal entry report shows the entries made in a company's general ledger, or [accounts](https://docs.codat.io/sync-for-payables-api#/schemas/Account), when transactions are approved. The journal line items for each journal entry should balance. + + A journal entry line item is a single transaction line on the journal entry. For example: + + - When a journal entry is recording a receipt of cash, the credit to accounts receivable and the debit to cash are separate line items. + - When a company needs to recognise revenue from an annual contract on a monthly basis, on receipt of cash for month one, they make a debit to deferred income and a credit to revenue. + + In Codat a journal entry contains details of: + + - The date on which the entry was created and posted. + - Itemised lines, including amounts and currency. + - A reference to the associated accounts. + - A reference to the underlying record. For example, the invoice, bill, or other data type that triggered the posting of the journal entry to the general ledger. + + > **Pushing journal entries** + > Codat only supports journal entries in the base currency of the company that are pushed into accounts denominated in the same base currency. + """ + + created_on: Annotated[Optional[str], pydantic.Field(alias="createdOn")] = 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: + + ``` + 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. + """ + + description: OptionalNullable[str] = UNSET + r"""Optional description of the journal entry.""" + + id: Optional[str] = None + r"""Unique identifier of the journal entry for the company in the accounting software.""" + + journal_lines: Annotated[ + OptionalNullable[List[JournalLine]], pydantic.Field(alias="journalLines") + ] = UNSET + r"""An array of journal lines.""" + + journal_ref: Annotated[Optional[JournalRef], pydantic.Field(alias="journalRef")] = ( + None + ) + r"""Links journal entries to the relevant journal in accounting integrations that use multi-book accounting (multiple journals).""" + + metadata: Optional[Metadata] = None + + modified_date: Annotated[Optional[str], pydantic.Field(alias="modifiedDate")] = None + + posted_on: Annotated[Optional[str], pydantic.Field(alias="postedOn")] = 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: + + ``` + 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. + """ + + record_ref: Annotated[ + Optional[JournalEntryRecordRef], pydantic.Field(alias="recordRef") + ] = None + r"""Links a journal entry to the underlying record that created it.""" + + source_modified_date: Annotated[ + Optional[str], pydantic.Field(alias="sourceModifiedDate") + ] = None + + supplemental_data: Annotated[ + Optional[SupplementalData], pydantic.Field(alias="supplementalData") + ] = None + r"""Supplemental data is additional data you can include in our standard data types. + + It is referenced as a configured dynamic key value pair that is unique to the accounting software. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. + """ + + updated_on: Annotated[Optional[str], pydantic.Field(alias="updatedOn")] = 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: + + ``` + 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. + """ + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = [ + "createdOn", + "description", + "id", + "journalLines", + "journalRef", + "metadata", + "modifiedDate", + "postedOn", + "recordRef", + "sourceModifiedDate", + "supplementalData", + "updatedOn", + ] + nullable_fields = ["description", "journalLines"] + null_default_fields = [] + + serialized = handler(self) + + m = {} + + for n, f in self.model_fields.items(): + k = f.alias or n + val = serialized.get(k) + serialized.pop(k, None) + + optional_nullable = k in optional_fields and k in nullable_fields + is_set = ( + self.__pydantic_fields_set__.intersection({n}) + or k in null_default_fields + ) # pylint: disable=no-member + + if val is not None and val != UNSET_SENTINEL: + m[k] = val + elif val != UNSET_SENTINEL and ( + not k in optional_fields or (optional_nullable and is_set) + ): + m[k] = val + + return m diff --git a/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/journalentryrecordref.py b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/journalentryrecordref.py new file mode 100644 index 000000000..a2e2cd20c --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/journalentryrecordref.py @@ -0,0 +1,45 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from codat_sync_for_payables_version_1.types import BaseModel +from enum import Enum +import pydantic +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class JournalEntryRecordRefDataType(str, Enum): + r"""Name of underlying data type.""" + + BANK_TRANSACTIONS = "bankTransactions" + BILL_CREDIT_NOTES = "billCreditNotes" + BILL_PAYMENTS = "billPayments" + BILLS = "bills" + CREDIT_NOTES = "creditNotes" + DIRECT_COSTS = "directCosts" + DIRECT_INCOMES = "directIncomes" + INVOICES = "invoices" + JOURNAL_ENTRIES = "journalEntries" + PAYMENTS = "payments" + TRANSFERS = "transfers" + + +class JournalEntryRecordRefTypedDict(TypedDict): + r"""Links a journal entry to the underlying record that created it.""" + + data_type: NotRequired[JournalEntryRecordRefDataType] + r"""Name of underlying data type.""" + id: NotRequired[str] + r"""'id' of the underlying record or data type.""" + + +class JournalEntryRecordRef(BaseModel): + r"""Links a journal entry to the underlying record that created it.""" + + data_type: Annotated[ + Optional[JournalEntryRecordRefDataType], pydantic.Field(alias="dataType") + ] = None + r"""Name of underlying data type.""" + + id: Optional[str] = None + r"""'id' of the underlying record or data type.""" diff --git a/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/journalline.py b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/journalline.py new file mode 100644 index 000000000..dd686340f --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/journalline.py @@ -0,0 +1,199 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .accountref import AccountRef, AccountRefTypedDict +from .trackingrecordref import TrackingRecordRef, TrackingRecordRefTypedDict +from codat_sync_for_payables_version_1.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from codat_sync_for_payables_version_1.utils import serialize_decimal, validate_decimal +from decimal import Decimal +from enum import Enum +import pydantic +from pydantic import model_serializer +from pydantic.functional_serializers import PlainSerializer +from pydantic.functional_validators import BeforeValidator +from typing import List, Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class JournalLineDataType(str, Enum): + r"""Allowed name of the 'dataType'.""" + + CUSTOMERS = "customers" + SUPPLIERS = "suppliers" + + +class ContactReferenceTypedDict(TypedDict): + id: str + r"""Unique identifier for a customer or supplier.""" + data_type: NotRequired[Nullable[JournalLineDataType]] + r"""Allowed name of the 'dataType'.""" + + +class ContactReference(BaseModel): + id: str + r"""Unique identifier for a customer or supplier.""" + + data_type: Annotated[ + OptionalNullable[JournalLineDataType], pydantic.Field(alias="dataType") + ] = UNSET + r"""Allowed name of the 'dataType'.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = ["dataType"] + nullable_fields = ["dataType"] + null_default_fields = [] + + serialized = handler(self) + + m = {} + + for n, f in self.model_fields.items(): + k = f.alias or n + val = serialized.get(k) + serialized.pop(k, None) + + optional_nullable = k in optional_fields and k in nullable_fields + is_set = ( + self.__pydantic_fields_set__.intersection({n}) + or k in null_default_fields + ) # pylint: disable=no-member + + if val is not None and val != UNSET_SENTINEL: + m[k] = val + elif val != UNSET_SENTINEL and ( + not k in optional_fields or (optional_nullable and is_set) + ): + m[k] = val + + return m + + +class JournalLineTrackingTypedDict(TypedDict): + r"""List of record refs associated with the tracking information for the line (eg to a Tracking Category, or customer etc.)""" + + record_refs: NotRequired[Nullable[List[TrackingRecordRefTypedDict]]] + + +class JournalLineTracking(BaseModel): + r"""List of record refs associated with the tracking information for the line (eg to a Tracking Category, or customer etc.)""" + + record_refs: Annotated[ + OptionalNullable[List[TrackingRecordRef]], pydantic.Field(alias="recordRefs") + ] = UNSET + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = ["recordRefs"] + nullable_fields = ["recordRefs"] + null_default_fields = [] + + serialized = handler(self) + + m = {} + + for n, f in self.model_fields.items(): + k = f.alias or n + val = serialized.get(k) + serialized.pop(k, None) + + optional_nullable = k in optional_fields and k in nullable_fields + is_set = ( + self.__pydantic_fields_set__.intersection({n}) + or k in null_default_fields + ) # pylint: disable=no-member + + if val is not None and val != UNSET_SENTINEL: + m[k] = val + elif val != UNSET_SENTINEL and ( + not k in optional_fields or (optional_nullable and is_set) + ): + m[k] = val + + return m + + +class JournalLineTypedDict(TypedDict): + net_amount: Decimal + r"""Amount for the journal line. Debit entries are considered positive, and credit entries are considered negative.""" + account_ref: NotRequired[AccountRefTypedDict] + r"""Data types that reference an account, for example bill and invoice line items, use an accountRef that includes the ID and name of the linked account.""" + contact_ref: NotRequired[ContactReferenceTypedDict] + currency: NotRequired[Nullable[str]] + r"""Currency for the journal line item.""" + description: NotRequired[Nullable[str]] + r"""Description of the journal line item.""" + tracking: NotRequired[JournalLineTrackingTypedDict] + r"""List of record refs associated with the tracking information for the line (eg to a Tracking Category, or customer etc.)""" + + +class JournalLine(BaseModel): + net_amount: Annotated[ + Annotated[ + Decimal, + BeforeValidator(validate_decimal), + PlainSerializer(serialize_decimal(False)), + ], + pydantic.Field(alias="netAmount"), + ] + r"""Amount for the journal line. Debit entries are considered positive, and credit entries are considered negative.""" + + account_ref: Annotated[Optional[AccountRef], pydantic.Field(alias="accountRef")] = ( + None + ) + r"""Data types that reference an account, for example bill and invoice line items, use an accountRef that includes the ID and name of the linked account.""" + + contact_ref: Annotated[ + Optional[ContactReference], pydantic.Field(alias="contactRef") + ] = None + + currency: OptionalNullable[str] = UNSET + r"""Currency for the journal line item.""" + + description: OptionalNullable[str] = UNSET + r"""Description of the journal line item.""" + + tracking: Optional[JournalLineTracking] = None + r"""List of record refs associated with the tracking information for the line (eg to a Tracking Category, or customer etc.)""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = [ + "accountRef", + "contactRef", + "currency", + "description", + "tracking", + ] + nullable_fields = ["currency", "description"] + null_default_fields = [] + + serialized = handler(self) + + m = {} + + for n, f in self.model_fields.items(): + k = f.alias or n + val = serialized.get(k) + serialized.pop(k, None) + + optional_nullable = k in optional_fields and k in nullable_fields + is_set = ( + self.__pydantic_fields_set__.intersection({n}) + or k in null_default_fields + ) # pylint: disable=no-member + + if val is not None and val != UNSET_SENTINEL: + m[k] = val + elif val != UNSET_SENTINEL and ( + not k in optional_fields or (optional_nullable and is_set) + ): + m[k] = val + + return m diff --git a/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/journalprototype.py b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/journalprototype.py new file mode 100644 index 000000000..6f81a3de2 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/journalprototype.py @@ -0,0 +1,143 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .journalstatus import JournalStatus +from codat_sync_for_payables_version_1.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +import pydantic +from pydantic import model_serializer +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class JournalPrototypeTypedDict(TypedDict): + created_on: 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: + + ``` + 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. + """ + has_children: NotRequired[bool] + r"""If the journal has child journals, this value is true. If it doesn’t, it is false.""" + journal_code: NotRequired[Nullable[str]] + r"""Native journal number or code.""" + name: NotRequired[Nullable[str]] + r"""Journal name. + The maximum length for a journal name is 256 characters. All characters above that number will be truncated. + """ + parent_id: NotRequired[Nullable[str]] + r"""Parent journal ID. + If the journal is a parent journal, this value is not present. + """ + status: NotRequired[JournalStatus] + r"""Current journal status.""" + type: NotRequired[Nullable[str]] + r"""The type of the journal.""" + + +class JournalPrototype(BaseModel): + created_on: Annotated[Optional[str], pydantic.Field(alias="createdOn")] = 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: + + ``` + 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. + """ + + has_children: Annotated[Optional[bool], pydantic.Field(alias="hasChildren")] = None + r"""If the journal has child journals, this value is true. If it doesn’t, it is false.""" + + journal_code: Annotated[ + OptionalNullable[str], pydantic.Field(alias="journalCode") + ] = UNSET + r"""Native journal number or code.""" + + name: OptionalNullable[str] = UNSET + r"""Journal name. + The maximum length for a journal name is 256 characters. All characters above that number will be truncated. + """ + + parent_id: Annotated[OptionalNullable[str], pydantic.Field(alias="parentId")] = ( + UNSET + ) + r"""Parent journal ID. + If the journal is a parent journal, this value is not present. + """ + + status: Optional[JournalStatus] = None + r"""Current journal status.""" + + type: OptionalNullable[str] = UNSET + r"""The type of the journal.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = [ + "createdOn", + "hasChildren", + "journalCode", + "name", + "parentId", + "status", + "type", + ] + nullable_fields = ["journalCode", "name", "parentId", "type"] + null_default_fields = [] + + serialized = handler(self) + + m = {} + + for n, f in self.model_fields.items(): + k = f.alias or n + val = serialized.get(k) + serialized.pop(k, None) + + optional_nullable = k in optional_fields and k in nullable_fields + is_set = ( + self.__pydantic_fields_set__.intersection({n}) + or k in null_default_fields + ) # pylint: disable=no-member + + if val is not None and val != UNSET_SENTINEL: + m[k] = val + elif val != UNSET_SENTINEL and ( + not k in optional_fields or (optional_nullable and is_set) + ): + m[k] = val + + return m diff --git a/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/journalref.py b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/journalref.py new file mode 100644 index 000000000..0841061cd --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/journalref.py @@ -0,0 +1,61 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from codat_sync_for_payables_version_1.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from pydantic import model_serializer +from typing_extensions import NotRequired, TypedDict + + +class JournalRefTypedDict(TypedDict): + r"""Links journal entries to the relevant journal in accounting integrations that use multi-book accounting (multiple journals).""" + + id: str + r"""GUID of the underlying journal.""" + name: NotRequired[Nullable[str]] + r"""Name of journal""" + + +class JournalRef(BaseModel): + r"""Links journal entries to the relevant journal in accounting integrations that use multi-book accounting (multiple journals).""" + + id: str + r"""GUID of the underlying journal.""" + + name: OptionalNullable[str] = UNSET + r"""Name of journal""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = ["name"] + nullable_fields = ["name"] + null_default_fields = [] + + serialized = handler(self) + + m = {} + + for n, f in self.model_fields.items(): + k = f.alias or n + val = serialized.get(k) + serialized.pop(k, None) + + optional_nullable = k in optional_fields and k in nullable_fields + is_set = ( + self.__pydantic_fields_set__.intersection({n}) + or k in null_default_fields + ) # pylint: disable=no-member + + if val is not None and val != UNSET_SENTINEL: + m[k] = val + elif val != UNSET_SENTINEL and ( + not k in optional_fields or (optional_nullable and is_set) + ): + m[k] = val + + return m diff --git a/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/journals.py b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/journals.py new file mode 100644 index 000000000..7565ae0f7 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/journals.py @@ -0,0 +1,35 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .journal import Journal, JournalTypedDict +from .links import Links, LinksTypedDict +from codat_sync_for_payables_version_1.types import BaseModel +import pydantic +from typing import List, Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class JournalsTypedDict(TypedDict): + links: LinksTypedDict + page_number: int + r"""Current page number.""" + page_size: int + r"""Number of items to return in results array.""" + total_results: int + r"""Total number of items.""" + results: NotRequired[List[JournalTypedDict]] + + +class Journals(BaseModel): + links: Annotated[Links, pydantic.Field(alias="_links")] + + page_number: Annotated[int, pydantic.Field(alias="pageNumber")] + r"""Current page number.""" + + page_size: Annotated[int, pydantic.Field(alias="pageSize")] + r"""Number of items to return in results array.""" + + total_results: Annotated[int, pydantic.Field(alias="totalResults")] + r"""Total number of items.""" + + results: Optional[List[Journal]] = None diff --git a/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/journalstatus.py b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/journalstatus.py new file mode 100644 index 000000000..4cbadd55d --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/journalstatus.py @@ -0,0 +1,12 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from enum import Enum + + +class JournalStatus(str, Enum): + r"""Current journal status.""" + + UNKNOWN = "Unknown" + ACTIVE = "Active" + ARCHIVED = "Archived" diff --git a/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/links.py b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/links.py new file mode 100644 index 000000000..f279adc3d --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/links.py @@ -0,0 +1,25 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .halref import HalRef, HalRefTypedDict +from codat_sync_for_payables_version_1.types import BaseModel +import pydantic +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class LinksTypedDict(TypedDict): + current: HalRefTypedDict + self_: HalRefTypedDict + next: NotRequired[HalRefTypedDict] + previous: NotRequired[HalRefTypedDict] + + +class Links(BaseModel): + current: HalRef + + self_: Annotated[HalRef, pydantic.Field(alias="self")] + + next: Optional[HalRef] = None + + previous: Optional[HalRef] = None diff --git a/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/metadata.py b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/metadata.py new file mode 100644 index 000000000..b716099d9 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/metadata.py @@ -0,0 +1,55 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from codat_sync_for_payables_version_1.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +import pydantic +from pydantic import model_serializer +from typing_extensions import Annotated, NotRequired, TypedDict + + +class MetadataTypedDict(TypedDict): + is_deleted: NotRequired[Nullable[bool]] + r"""Indicates whether the record has been deleted in the third-party system this record originated from.""" + + +class Metadata(BaseModel): + is_deleted: Annotated[OptionalNullable[bool], pydantic.Field(alias="isDeleted")] = ( + UNSET + ) + r"""Indicates whether the record has been deleted in the third-party system this record originated from.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = ["isDeleted"] + nullable_fields = ["isDeleted"] + null_default_fields = [] + + serialized = handler(self) + + m = {} + + for n, f in self.model_fields.items(): + k = f.alias or n + val = serialized.get(k) + serialized.pop(k, None) + + optional_nullable = k in optional_fields and k in nullable_fields + is_set = ( + self.__pydantic_fields_set__.intersection({n}) + or k in null_default_fields + ) # pylint: disable=no-member + + if val is not None and val != UNSET_SENTINEL: + m[k] = val + elif val != UNSET_SENTINEL and ( + not k in optional_fields or (optional_nullable and is_set) + ): + m[k] = val + + return m diff --git a/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/paymentallocationpayment.py b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/paymentallocationpayment.py new file mode 100644 index 000000000..cdc2650d4 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/paymentallocationpayment.py @@ -0,0 +1,235 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .accountref import AccountRef, AccountRefTypedDict +from codat_sync_for_payables_version_1.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from codat_sync_for_payables_version_1.utils import serialize_decimal, validate_decimal +from decimal import Decimal +import pydantic +from pydantic import model_serializer +from pydantic.functional_serializers import PlainSerializer +from pydantic.functional_validators import BeforeValidator +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class PaymentAllocationPaymentTypedDict(TypedDict): + account_ref: NotRequired[AccountRefTypedDict] + r"""Data types that reference an account, for example bill and invoice line items, use an accountRef that includes the ID and name of the linked account.""" + currency: NotRequired[str] + r"""The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + + ## Unknown currencies + + In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + + There are only a very small number of edge cases where this currency code is returned by the Codat system. + """ + currency_rate: NotRequired[Nullable[Decimal]] + r"""Rate to convert the total amount of the payment into the base currency for the company at the time of the payment. + + Currency rates in Codat are implemented as the multiple of foreign currency units to each base currency unit. + + It is not possible to perform the currency conversion with two or more non-base currencies participating in the transaction. For example, if a company's base currency is USD, and it has a bill issued in EUR, then the bill payment must happen in USD or EUR. + + Where the currency rate is provided by the underlying accounting software, it will be available from Codat with the same precision (up to a maximum of 9 decimal places). + + For accounting software which do not provide an explicit currency rate, it is calculated as `baseCurrency / foreignCurrency` and will be returned to 9 decimal places. + + ## Examples with base currency of GBP + + | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (GBP) | + | :--------------- | :------------- | :------------ | :------------------------- | + | **USD** | $20 | 0.781 | £15.62 | + | **EUR** | €20 | 0.885 | £17.70 | + | **RUB** | ₽20 | 0.011 | £0.22 | + + ## Examples with base currency of USD + + | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (USD) | + | :--------------- | :------------- | :------------ | :------------------------- | + | **GBP** | £20 | 1.277 | $25.54 | + | **EUR** | €20 | 1.134 | $22.68 | + | **RUB** | ₽20 | 0.015 | $0.30 | + + + ### Integration-specific details + + | Integration | Scenario | System behavior | + |-------------------|-------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------| + | QuickBooks Online | Transaction currency differs from base currency | If currency rate value is left `null`, a rate of 1 will be used by QBO by default. To override this, specify a currencyRate in the request body. | + """ + id: NotRequired[str] + r"""Identifier of the allocated payment.""" + note: NotRequired[Nullable[str]] + r"""Notes attached to the allocated payment.""" + paid_on_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: + + ``` + 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. + """ + reference: NotRequired[Nullable[str]] + r"""Reference to the allocated payment.""" + total_amount: NotRequired[Decimal] + r"""Total amount that was paid.""" + + +class PaymentAllocationPayment(BaseModel): + account_ref: Annotated[Optional[AccountRef], pydantic.Field(alias="accountRef")] = ( + None + ) + r"""Data types that reference an account, for example bill and invoice line items, use an accountRef that includes the ID and name of the linked account.""" + + currency: Optional[str] = None + r"""The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + + ## Unknown currencies + + In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + + There are only a very small number of edge cases where this currency code is returned by the Codat system. + """ + + currency_rate: Annotated[ + Annotated[ + OptionalNullable[Decimal], + BeforeValidator(validate_decimal), + PlainSerializer(serialize_decimal(False)), + ], + pydantic.Field(alias="currencyRate"), + ] = UNSET + r"""Rate to convert the total amount of the payment into the base currency for the company at the time of the payment. + + Currency rates in Codat are implemented as the multiple of foreign currency units to each base currency unit. + + It is not possible to perform the currency conversion with two or more non-base currencies participating in the transaction. For example, if a company's base currency is USD, and it has a bill issued in EUR, then the bill payment must happen in USD or EUR. + + Where the currency rate is provided by the underlying accounting software, it will be available from Codat with the same precision (up to a maximum of 9 decimal places). + + For accounting software which do not provide an explicit currency rate, it is calculated as `baseCurrency / foreignCurrency` and will be returned to 9 decimal places. + + ## Examples with base currency of GBP + + | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (GBP) | + | :--------------- | :------------- | :------------ | :------------------------- | + | **USD** | $20 | 0.781 | £15.62 | + | **EUR** | €20 | 0.885 | £17.70 | + | **RUB** | ₽20 | 0.011 | £0.22 | + + ## Examples with base currency of USD + + | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (USD) | + | :--------------- | :------------- | :------------ | :------------------------- | + | **GBP** | £20 | 1.277 | $25.54 | + | **EUR** | €20 | 1.134 | $22.68 | + | **RUB** | ₽20 | 0.015 | $0.30 | + + + ### Integration-specific details + + | Integration | Scenario | System behavior | + |-------------------|-------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------| + | QuickBooks Online | Transaction currency differs from base currency | If currency rate value is left `null`, a rate of 1 will be used by QBO by default. To override this, specify a currencyRate in the request body. | + """ + + id: Optional[str] = None + r"""Identifier of the allocated payment.""" + + note: OptionalNullable[str] = UNSET + r"""Notes attached to the allocated payment.""" + + paid_on_date: Annotated[Optional[str], pydantic.Field(alias="paidOnDate")] = 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: + + ``` + 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. + """ + + reference: OptionalNullable[str] = UNSET + r"""Reference to the allocated payment.""" + + total_amount: Annotated[ + Annotated[ + Optional[Decimal], + BeforeValidator(validate_decimal), + PlainSerializer(serialize_decimal(False)), + ], + pydantic.Field(alias="totalAmount"), + ] = None + r"""Total amount that was paid.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = [ + "accountRef", + "currency", + "currencyRate", + "id", + "note", + "paidOnDate", + "reference", + "totalAmount", + ] + nullable_fields = ["currencyRate", "note", "reference"] + null_default_fields = [] + + serialized = handler(self) + + m = {} + + for n, f in self.model_fields.items(): + k = f.alias or n + val = serialized.get(k) + serialized.pop(k, None) + + optional_nullable = k in optional_fields and k in nullable_fields + is_set = ( + self.__pydantic_fields_set__.intersection({n}) + or k in null_default_fields + ) # pylint: disable=no-member + + if val is not None and val != UNSET_SENTINEL: + m[k] = val + elif val != UNSET_SENTINEL and ( + not k in optional_fields or (optional_nullable and is_set) + ): + m[k] = val + + return m diff --git a/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/paymentmethod.py b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/paymentmethod.py new file mode 100644 index 000000000..3a0d18a49 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/paymentmethod.py @@ -0,0 +1,113 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .metadata import Metadata, MetadataTypedDict +from .paymentmethodtype import PaymentMethodType +from codat_sync_for_payables_version_1.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from enum import Enum +import pydantic +from pydantic import model_serializer +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class PaymentMethodStatus(str, Enum): + r"""Status of the Payment Method.""" + + UNKNOWN = "Unknown" + ACTIVE = "Active" + ARCHIVED = "Archived" + + +class PaymentMethodTypedDict(TypedDict): + r"""> View the coverage for payment methods in the Data coverage explorer. + + ## Overview + + A Payment Method represents the payment method(s) used to pay a Bill. Payment Methods are referenced on [Bill Payments](https://docs.codat.io/sync-for-payables-api#/schemas/BillPayment) and [Payments](https://docs.codat.io/sync-for-payables-api#/schemas/Payment). + """ + + id: NotRequired[str] + r"""Unique identifier for the payment method.""" + metadata: NotRequired[MetadataTypedDict] + modified_date: NotRequired[str] + name: NotRequired[Nullable[str]] + r"""Name of the payment method.""" + source_modified_date: NotRequired[str] + status: NotRequired[PaymentMethodStatus] + r"""Status of the Payment Method.""" + type: NotRequired[PaymentMethodType] + r"""Method of payment.""" + + +class PaymentMethod(BaseModel): + r"""> View the coverage for payment methods in the Data coverage explorer. + + ## Overview + + A Payment Method represents the payment method(s) used to pay a Bill. Payment Methods are referenced on [Bill Payments](https://docs.codat.io/sync-for-payables-api#/schemas/BillPayment) and [Payments](https://docs.codat.io/sync-for-payables-api#/schemas/Payment). + """ + + id: Optional[str] = None + r"""Unique identifier for the payment method.""" + + metadata: Optional[Metadata] = None + + modified_date: Annotated[Optional[str], pydantic.Field(alias="modifiedDate")] = None + + name: OptionalNullable[str] = UNSET + r"""Name of the payment method.""" + + source_modified_date: Annotated[ + Optional[str], pydantic.Field(alias="sourceModifiedDate") + ] = None + + status: Optional[PaymentMethodStatus] = None + r"""Status of the Payment Method.""" + + type: Optional[PaymentMethodType] = None + r"""Method of payment.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = [ + "id", + "metadata", + "modifiedDate", + "name", + "sourceModifiedDate", + "status", + "type", + ] + nullable_fields = ["name"] + null_default_fields = [] + + serialized = handler(self) + + m = {} + + for n, f in self.model_fields.items(): + k = f.alias or n + val = serialized.get(k) + serialized.pop(k, None) + + optional_nullable = k in optional_fields and k in nullable_fields + is_set = ( + self.__pydantic_fields_set__.intersection({n}) + or k in null_default_fields + ) # pylint: disable=no-member + + if val is not None and val != UNSET_SENTINEL: + m[k] = val + elif val != UNSET_SENTINEL and ( + not k in optional_fields or (optional_nullable and is_set) + ): + m[k] = val + + return m diff --git a/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/paymentmethodref.py b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/paymentmethodref.py new file mode 100644 index 000000000..720395f33 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/paymentmethodref.py @@ -0,0 +1,25 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from codat_sync_for_payables_version_1.types import BaseModel +from typing import Optional +from typing_extensions import NotRequired, TypedDict + + +class PaymentMethodRefTypedDict(TypedDict): + r"""The Payment Method to which the payment is linked in the accounting software.""" + + id: str + r"""The unique identifier of the location being referenced.""" + name: NotRequired[str] + r"""Name of the location being referenced.""" + + +class PaymentMethodRef(BaseModel): + r"""The Payment Method to which the payment is linked in the accounting software.""" + + id: str + r"""The unique identifier of the location being referenced.""" + + name: Optional[str] = None + r"""Name of the location being referenced.""" diff --git a/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/paymentmethods.py b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/paymentmethods.py new file mode 100644 index 000000000..05698fa42 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/paymentmethods.py @@ -0,0 +1,35 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .links import Links, LinksTypedDict +from .paymentmethod import PaymentMethod, PaymentMethodTypedDict +from codat_sync_for_payables_version_1.types import BaseModel +import pydantic +from typing import List, Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class PaymentMethodsTypedDict(TypedDict): + links: LinksTypedDict + page_number: int + r"""Current page number.""" + page_size: int + r"""Number of items to return in results array.""" + total_results: int + r"""Total number of items.""" + results: NotRequired[List[PaymentMethodTypedDict]] + + +class PaymentMethods(BaseModel): + links: Annotated[Links, pydantic.Field(alias="_links")] + + page_number: Annotated[int, pydantic.Field(alias="pageNumber")] + r"""Current page number.""" + + page_size: Annotated[int, pydantic.Field(alias="pageSize")] + r"""Number of items to return in results array.""" + + total_results: Annotated[int, pydantic.Field(alias="totalResults")] + r"""Total number of items.""" + + results: Optional[List[PaymentMethod]] = None diff --git a/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/paymentmethodtype.py b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/paymentmethodtype.py new file mode 100644 index 000000000..c4a4f97b2 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/paymentmethodtype.py @@ -0,0 +1,16 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from enum import Enum + + +class PaymentMethodType(str, Enum): + r"""Method of payment.""" + + UNKNOWN = "Unknown" + CASH = "Cash" + CHECK = "Check" + CREDIT_CARD = "CreditCard" + DEBIT_CARD = "DebitCard" + BANK_TRANSFER = "BankTransfer" + OTHER = "Other" diff --git a/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/phonenumber.py b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/phonenumber.py new file mode 100644 index 000000000..479ae6ab7 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/phonenumber.py @@ -0,0 +1,58 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .phonenumbertype import PhoneNumberType +from codat_sync_for_payables_version_1.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from pydantic import model_serializer +from typing_extensions import NotRequired, TypedDict + + +class PhoneNumberTypedDict(TypedDict): + type: PhoneNumberType + r"""The type of phone number""" + number: NotRequired[Nullable[str]] + r"""A phone number.""" + + +class PhoneNumber(BaseModel): + type: PhoneNumberType + r"""The type of phone number""" + + number: OptionalNullable[str] = UNSET + r"""A phone number.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = ["number"] + nullable_fields = ["number"] + null_default_fields = [] + + serialized = handler(self) + + m = {} + + for n, f in self.model_fields.items(): + k = f.alias or n + val = serialized.get(k) + serialized.pop(k, None) + + optional_nullable = k in optional_fields and k in nullable_fields + is_set = ( + self.__pydantic_fields_set__.intersection({n}) + or k in null_default_fields + ) # pylint: disable=no-member + + if val is not None and val != UNSET_SENTINEL: + m[k] = val + elif val != UNSET_SENTINEL and ( + not k in optional_fields or (optional_nullable and is_set) + ): + m[k] = val + + return m diff --git a/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/phonenumbertype.py b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/phonenumbertype.py new file mode 100644 index 000000000..a8b448eb0 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/phonenumbertype.py @@ -0,0 +1,14 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from enum import Enum + + +class PhoneNumberType(str, Enum): + r"""The type of phone number""" + + PRIMARY = "Primary" + LANDLINE = "Landline" + MOBILE = "Mobile" + FAX = "Fax" + UNKNOWN = "Unknown" diff --git a/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/propertie_status.py b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/propertie_status.py new file mode 100644 index 000000000..de3d67f8b --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/propertie_status.py @@ -0,0 +1,30 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from enum import Enum + + +class PropertieStatus(str, Enum): + r"""The current status of the dataset.""" + + INITIAL = "Initial" + QUEUED = "Queued" + FETCHING = "Fetching" + MAP_QUEUED = "MapQueued" + MAPPING = "Mapping" + COMPLETE = "Complete" + FETCH_ERROR = "FetchError" + MAP_ERROR = "MapError" + INTERNAL_ERROR = "InternalError" + PROCESSING_QUEUED = "ProcessingQueued" + PROCESSING = "Processing" + PROCESSING_ERROR = "ProcessingError" + VALIDATION_QUEUED = "ValidationQueued" + VALIDATING = "Validating" + VALIDATION_ERROR = "ValidationError" + AUTH_ERROR = "AuthError" + CANCELLED = "Cancelled" + NOT_SUPPORTED = "NotSupported" + RATE_LIMIT_ERROR = "RateLimitError" + PERMISSIONS_ERROR = "PermissionsError" + PREREQUISITE_NOT_MET = "PrerequisiteNotMet" diff --git a/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/pulloperation.py b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/pulloperation.py new file mode 100644 index 000000000..1831eaa0f --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/pulloperation.py @@ -0,0 +1,224 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from codat_sync_for_payables_version_1.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from enum import Enum +import pydantic +from pydantic import model_serializer +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class DatasetStatus(str, Enum): + r"""The current status of the dataset.""" + + INITIAL = "Initial" + QUEUED = "Queued" + FETCHING = "Fetching" + MAP_QUEUED = "MapQueued" + MAPPING = "Mapping" + COMPLETE = "Complete" + FETCH_ERROR = "FetchError" + MAP_ERROR = "MapError" + INTERNAL_ERROR = "InternalError" + PROCESSING_QUEUED = "ProcessingQueued" + PROCESSING = "Processing" + PROCESSING_ERROR = "ProcessingError" + VALIDATION_QUEUED = "ValidationQueued" + VALIDATING = "Validating" + VALIDATION_ERROR = "ValidationError" + AUTH_ERROR = "AuthError" + CANCELLED = "Cancelled" + NOT_SUPPORTED = "NotSupported" + RATE_LIMIT_ERROR = "RateLimitError" + PERMISSIONS_ERROR = "PermissionsError" + PREREQUISITE_NOT_MET = "PrerequisiteNotMet" + + +class PullOperationTypedDict(TypedDict): + r"""Information about a queued, in progress or completed pull operation. + *Formally called `dataset`* + """ + + company_id: str + r"""Unique identifier of the company associated to this pull operation.""" + connection_id: str + r"""Unique identifier of the connection associated to this pull operation.""" + data_type: str + r"""The data type you are requesting in a pull operation.""" + id: str + r"""Unique identifier of the pull operation.""" + is_completed: bool + r"""`True` if the pull operation is completed successfully. The `isCompleted` property is not queryable. To filter failed pull operations, query by `status!=Complete&&status!=NotSupported` instead.""" + is_errored: bool + r"""`True` if the pull operation entered an error state.""" + progress: int + r"""An integer signifying the progress of the pull operation.""" + requested: 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: + + ``` + 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. + """ + status: DatasetStatus + r"""The current status of the dataset.""" + completed: 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: + + ``` + 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. + """ + error_message: NotRequired[Nullable[str]] + r"""A message about a transient or persistent error returned by Codat or the source platform.""" + status_description: NotRequired[Nullable[str]] + r"""Additional information about the dataset status.""" + + +class PullOperation(BaseModel): + r"""Information about a queued, in progress or completed pull operation. + *Formally called `dataset`* + """ + + company_id: Annotated[str, pydantic.Field(alias="companyId")] + r"""Unique identifier of the company associated to this pull operation.""" + + connection_id: Annotated[str, pydantic.Field(alias="connectionId")] + r"""Unique identifier of the connection associated to this pull operation.""" + + data_type: Annotated[str, pydantic.Field(alias="dataType")] + r"""The data type you are requesting in a pull operation.""" + + id: str + r"""Unique identifier of the pull operation.""" + + is_completed: Annotated[bool, pydantic.Field(alias="isCompleted")] + r"""`True` if the pull operation is completed successfully. The `isCompleted` property is not queryable. To filter failed pull operations, query by `status!=Complete&&status!=NotSupported` instead.""" + + is_errored: Annotated[bool, pydantic.Field(alias="isErrored")] + r"""`True` if the pull operation entered an error state.""" + + progress: int + r"""An integer signifying the progress of the pull operation.""" + + requested: 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: + + ``` + 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. + """ + + status: DatasetStatus + r"""The current status of the dataset.""" + + completed: Optional[str] = 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: + + ``` + 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. + """ + + error_message: Annotated[ + OptionalNullable[str], pydantic.Field(alias="errorMessage") + ] = UNSET + r"""A message about a transient or persistent error returned by Codat or the source platform.""" + + status_description: Annotated[ + OptionalNullable[str], pydantic.Field(alias="statusDescription") + ] = UNSET + r"""Additional information about the dataset status.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = ["completed", "errorMessage", "statusDescription"] + nullable_fields = ["errorMessage", "statusDescription"] + null_default_fields = [] + + serialized = handler(self) + + m = {} + + for n, f in self.model_fields.items(): + k = f.alias or n + val = serialized.get(k) + serialized.pop(k, None) + + optional_nullable = k in optional_fields and k in nullable_fields + is_set = ( + self.__pydantic_fields_set__.intersection({n}) + or k in null_default_fields + ) # pylint: disable=no-member + + if val is not None and val != UNSET_SENTINEL: + m[k] = val + elif val != UNSET_SENTINEL and ( + not k in optional_fields or (optional_nullable and is_set) + ): + m[k] = val + + return m diff --git a/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/pulloperations.py b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/pulloperations.py new file mode 100644 index 000000000..9a6fd67a3 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/pulloperations.py @@ -0,0 +1,35 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .links import Links, LinksTypedDict +from .pulloperation import PullOperation, PullOperationTypedDict +from codat_sync_for_payables_version_1.types import BaseModel +import pydantic +from typing import List, Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class PullOperationsTypedDict(TypedDict): + links: LinksTypedDict + page_number: int + r"""Current page number.""" + page_size: int + r"""Number of items to return in results array.""" + total_results: int + r"""Total number of items.""" + results: NotRequired[List[PullOperationTypedDict]] + + +class PullOperations(BaseModel): + links: Annotated[Links, pydantic.Field(alias="_links")] + + page_number: Annotated[int, pydantic.Field(alias="pageNumber")] + r"""Current page number.""" + + page_size: Annotated[int, pydantic.Field(alias="pageSize")] + r"""Number of items to return in results array.""" + + total_results: Annotated[int, pydantic.Field(alias="totalResults")] + r"""Total number of items.""" + + results: Optional[List[PullOperation]] = None diff --git a/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/pushchangetype.py b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/pushchangetype.py new file mode 100644 index 000000000..76371e9e3 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/pushchangetype.py @@ -0,0 +1,14 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from enum import Enum + + +class PushChangeType(str, Enum): + r"""Type of change being applied to record in third party platform.""" + + UNKNOWN = "Unknown" + CREATED = "Created" + MODIFIED = "Modified" + DELETED = "Deleted" + ATTACHMENT_UPLOADED = "AttachmentUploaded" diff --git a/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/pushfieldvalidation.py b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/pushfieldvalidation.py new file mode 100644 index 000000000..318749eef --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/pushfieldvalidation.py @@ -0,0 +1,63 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from codat_sync_for_payables_version_1.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from pydantic import model_serializer +from typing import Optional +from typing_extensions import NotRequired, TypedDict + + +class PushFieldValidationTypedDict(TypedDict): + details: str + r"""Details on the validation issue.""" + field: NotRequired[str] + r"""Field name that resulted in the validation issue.""" + ref: NotRequired[Nullable[str]] + r"""Unique reference identifier for the validation issue.""" + + +class PushFieldValidation(BaseModel): + details: str + r"""Details on the validation issue.""" + + field: Optional[str] = None + r"""Field name that resulted in the validation issue.""" + + ref: OptionalNullable[str] = UNSET + r"""Unique reference identifier for the validation issue.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = ["field", "ref"] + nullable_fields = ["ref"] + null_default_fields = [] + + serialized = handler(self) + + m = {} + + for n, f in self.model_fields.items(): + k = f.alias or n + val = serialized.get(k) + serialized.pop(k, None) + + optional_nullable = k in optional_fields and k in nullable_fields + is_set = ( + self.__pydantic_fields_set__.intersection({n}) + or k in null_default_fields + ) # pylint: disable=no-member + + if val is not None and val != UNSET_SENTINEL: + m[k] = val + elif val != UNSET_SENTINEL and ( + not k in optional_fields or (optional_nullable and is_set) + ): + m[k] = val + + return m diff --git a/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/pushoperation.py b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/pushoperation.py new file mode 100644 index 000000000..323761591 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/pushoperation.py @@ -0,0 +1,219 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .datatype import DataType +from .pushoperationchange import PushOperationChange, PushOperationChangeTypedDict +from .pushoperationstatus import PushOperationStatus +from .validation import Validation, ValidationTypedDict +from codat_sync_for_payables_version_1.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +import pydantic +from pydantic import model_serializer +from typing import List, Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class PushOperationTypedDict(TypedDict): + company_id: str + r"""Unique identifier for your SMB in Codat.""" + data_connection_key: str + r"""Unique identifier for a company's data connection.""" + push_operation_key: str + r"""A unique identifier generated by Codat to represent this single push operation. This identifier can be used to track the status of the push, and should be persisted.""" + requested_on_utc: 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: + + ``` + 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. + """ + status: PushOperationStatus + r"""The current status of the push operation.""" + status_code: int + r"""Push status code.""" + changes: NotRequired[Nullable[List[PushOperationChangeTypedDict]]] + r"""Contains a single entry that communicates which record has changed and the manner in which it changed.""" + completed_on_utc: 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: + + ``` + 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. + """ + data_type: NotRequired[DataType] + r"""Available data types""" + error_message: NotRequired[Nullable[str]] + r"""A message about the error.""" + timeout_in_minutes: NotRequired[Nullable[int]] + r"""Number of minutes the push operation must complete within before it times out.""" + timeout_in_seconds: NotRequired[Nullable[int]] + r"""Number of seconds the push operation must complete within before it times out.""" + validation: NotRequired[ValidationTypedDict] + r"""A human-readable object describing validation decisions Codat has made when pushing data into the platform. If a push has failed because of validation errors, they will be detailed here.""" + + +class PushOperation(BaseModel): + company_id: Annotated[str, pydantic.Field(alias="companyId")] + r"""Unique identifier for your SMB in Codat.""" + + data_connection_key: Annotated[str, pydantic.Field(alias="dataConnectionKey")] + r"""Unique identifier for a company's data connection.""" + + push_operation_key: Annotated[str, pydantic.Field(alias="pushOperationKey")] + r"""A unique identifier generated by Codat to represent this single push operation. This identifier can be used to track the status of the push, and should be persisted.""" + + requested_on_utc: Annotated[str, pydantic.Field(alias="requestedOnUtc")] + 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: + + ``` + 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. + """ + + status: PushOperationStatus + r"""The current status of the push operation.""" + + status_code: Annotated[int, pydantic.Field(alias="statusCode")] + r"""Push status code.""" + + changes: OptionalNullable[List[PushOperationChange]] = UNSET + r"""Contains a single entry that communicates which record has changed and the manner in which it changed.""" + + completed_on_utc: Annotated[ + Optional[str], pydantic.Field(alias="completedOnUtc") + ] = 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: + + ``` + 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. + """ + + data_type: Annotated[Optional[DataType], pydantic.Field(alias="dataType")] = None + r"""Available data types""" + + error_message: Annotated[ + OptionalNullable[str], pydantic.Field(alias="errorMessage") + ] = UNSET + r"""A message about the error.""" + + timeout_in_minutes: Annotated[ + OptionalNullable[int], pydantic.Field(alias="timeoutInMinutes") + ] = UNSET + r"""Number of minutes the push operation must complete within before it times out.""" + + timeout_in_seconds: Annotated[ + OptionalNullable[int], + pydantic.Field( + deprecated="warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible.", + alias="timeoutInSeconds", + ), + ] = UNSET + r"""Number of seconds the push operation must complete within before it times out.""" + + validation: Optional[Validation] = None + r"""A human-readable object describing validation decisions Codat has made when pushing data into the platform. If a push has failed because of validation errors, they will be detailed here.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = [ + "changes", + "completedOnUtc", + "dataType", + "errorMessage", + "timeoutInMinutes", + "timeoutInSeconds", + "validation", + ] + nullable_fields = [ + "changes", + "errorMessage", + "timeoutInMinutes", + "timeoutInSeconds", + ] + null_default_fields = [] + + serialized = handler(self) + + m = {} + + for n, f in self.model_fields.items(): + k = f.alias or n + val = serialized.get(k) + serialized.pop(k, None) + + optional_nullable = k in optional_fields and k in nullable_fields + is_set = ( + self.__pydantic_fields_set__.intersection({n}) + or k in null_default_fields + ) # pylint: disable=no-member + + if val is not None and val != UNSET_SENTINEL: + m[k] = val + elif val != UNSET_SENTINEL and ( + not k in optional_fields or (optional_nullable and is_set) + ): + m[k] = val + + return m diff --git a/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/pushoperationchange.py b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/pushoperationchange.py new file mode 100644 index 000000000..f0a055e8d --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/pushoperationchange.py @@ -0,0 +1,68 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .pushchangetype import PushChangeType +from .pushoperationref import PushOperationRef, PushOperationRefTypedDict +from codat_sync_for_payables_version_1.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +import pydantic +from pydantic import model_serializer +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class PushOperationChangeTypedDict(TypedDict): + attachment_id: NotRequired[Nullable[str]] + r"""Unique identifier for the attachment created otherwise null.""" + record_ref: NotRequired[PushOperationRefTypedDict] + type: NotRequired[PushChangeType] + r"""Type of change being applied to record in third party platform.""" + + +class PushOperationChange(BaseModel): + attachment_id: Annotated[ + OptionalNullable[str], pydantic.Field(alias="attachmentId") + ] = UNSET + r"""Unique identifier for the attachment created otherwise null.""" + + record_ref: Annotated[ + Optional[PushOperationRef], pydantic.Field(alias="recordRef") + ] = None + + type: Optional[PushChangeType] = None + r"""Type of change being applied to record in third party platform.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = ["attachmentId", "recordRef", "type"] + nullable_fields = ["attachmentId"] + null_default_fields = [] + + serialized = handler(self) + + m = {} + + for n, f in self.model_fields.items(): + k = f.alias or n + val = serialized.get(k) + serialized.pop(k, None) + + optional_nullable = k in optional_fields and k in nullable_fields + is_set = ( + self.__pydantic_fields_set__.intersection({n}) + or k in null_default_fields + ) # pylint: disable=no-member + + if val is not None and val != UNSET_SENTINEL: + m[k] = val + elif val != UNSET_SENTINEL and ( + not k in optional_fields or (optional_nullable and is_set) + ): + m[k] = val + + return m diff --git a/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/pushoperationref.py b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/pushoperationref.py new file mode 100644 index 000000000..758267020 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/pushoperationref.py @@ -0,0 +1,23 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .datatype import DataType +from codat_sync_for_payables_version_1.types import BaseModel +import pydantic +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class PushOperationRefTypedDict(TypedDict): + data_type: NotRequired[DataType] + r"""Available data types""" + id: NotRequired[str] + r"""Unique identifier for a push operation.""" + + +class PushOperationRef(BaseModel): + data_type: Annotated[Optional[DataType], pydantic.Field(alias="dataType")] = None + r"""Available data types""" + + id: Optional[str] = None + r"""Unique identifier for a push operation.""" diff --git a/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/pushoperations.py b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/pushoperations.py new file mode 100644 index 000000000..e0fd92427 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/pushoperations.py @@ -0,0 +1,35 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .links import Links, LinksTypedDict +from .pushoperation import PushOperation, PushOperationTypedDict +from codat_sync_for_payables_version_1.types import BaseModel +import pydantic +from typing import List, Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class PushOperationsTypedDict(TypedDict): + links: LinksTypedDict + page_number: int + r"""Current page number.""" + page_size: int + r"""Number of items to return in results array.""" + total_results: int + r"""Total number of items.""" + results: NotRequired[List[PushOperationTypedDict]] + + +class PushOperations(BaseModel): + links: Annotated[Links, pydantic.Field(alias="_links")] + + page_number: Annotated[int, pydantic.Field(alias="pageNumber")] + r"""Current page number.""" + + page_size: Annotated[int, pydantic.Field(alias="pageSize")] + r"""Number of items to return in results array.""" + + total_results: Annotated[int, pydantic.Field(alias="totalResults")] + r"""Total number of items.""" + + results: Optional[List[PushOperation]] = None diff --git a/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/pushoperationstatus.py b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/pushoperationstatus.py new file mode 100644 index 000000000..09fa8b1f2 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/pushoperationstatus.py @@ -0,0 +1,13 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from enum import Enum + + +class PushOperationStatus(str, Enum): + r"""The current status of the push operation.""" + + PENDING = "Pending" + FAILED = "Failed" + SUCCESS = "Success" + TIMED_OUT = "TimedOut" diff --git a/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/pushoption.py b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/pushoption.py new file mode 100644 index 000000000..1ee42a7b8 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/pushoption.py @@ -0,0 +1,82 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .pushoptionchoice import PushOptionChoice, PushOptionChoiceTypedDict +from .pushoptionproperty import PushOptionProperty, PushOptionPropertyTypedDict +from .pushoptiontype import PushOptionType +from .pushvalidationinfo import PushValidationInfo, PushValidationInfoTypedDict +from codat_sync_for_payables_version_1.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +import pydantic +from pydantic import model_serializer +from typing import Dict, List, Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class PushOptionTypedDict(TypedDict): + display_name: str + r"""The property's display name.""" + required: bool + r"""The property is required if `True`.""" + type: PushOptionType + r"""The option type.""" + description: NotRequired[str] + r"""A description of the property.""" + options: NotRequired[Nullable[List[PushOptionChoiceTypedDict]]] + properties: NotRequired[Nullable[Dict[str, PushOptionPropertyTypedDict]]] + validation: NotRequired[PushValidationInfoTypedDict] + + +class PushOption(BaseModel): + display_name: Annotated[str, pydantic.Field(alias="displayName")] + r"""The property's display name.""" + + required: bool + r"""The property is required if `True`.""" + + type: PushOptionType + r"""The option type.""" + + description: Optional[str] = None + r"""A description of the property.""" + + options: OptionalNullable[List[PushOptionChoice]] = UNSET + + properties: OptionalNullable[Dict[str, PushOptionProperty]] = UNSET + + validation: Optional[PushValidationInfo] = None + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = ["description", "options", "properties", "validation"] + nullable_fields = ["options", "properties"] + null_default_fields = [] + + serialized = handler(self) + + m = {} + + for n, f in self.model_fields.items(): + k = f.alias or n + val = serialized.get(k) + serialized.pop(k, None) + + optional_nullable = k in optional_fields and k in nullable_fields + is_set = ( + self.__pydantic_fields_set__.intersection({n}) + or k in null_default_fields + ) # pylint: disable=no-member + + if val is not None and val != UNSET_SENTINEL: + m[k] = val + elif val != UNSET_SENTINEL and ( + not k in optional_fields or (optional_nullable and is_set) + ): + m[k] = val + + return m diff --git a/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/pushoptionchoice.py b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/pushoptionchoice.py new file mode 100644 index 000000000..946f01e5e --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/pushoptionchoice.py @@ -0,0 +1,38 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .pushoptiontype import PushOptionType +from codat_sync_for_payables_version_1.types import BaseModel +import pydantic +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class PushOptionChoiceTypedDict(TypedDict): + description: NotRequired[str] + r"""A description of the property.""" + display_name: NotRequired[str] + r"""The property's display name.""" + required: NotRequired[bool] + r"""The property is required if `True`.""" + type: NotRequired[PushOptionType] + r"""The option type.""" + value: NotRequired[str] + r"""Allowed value for field.""" + + +class PushOptionChoice(BaseModel): + description: Optional[str] = None + r"""A description of the property.""" + + display_name: Annotated[Optional[str], pydantic.Field(alias="displayName")] = None + r"""The property's display name.""" + + required: Optional[bool] = None + r"""The property is required if `True`.""" + + type: Optional[PushOptionType] = None + r"""The option type.""" + + value: Optional[str] = None + r"""Allowed value for field.""" diff --git a/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/pushoptionproperty.py b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/pushoptionproperty.py new file mode 100644 index 000000000..f357b8f32 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/pushoptionproperty.py @@ -0,0 +1,81 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .pushoptionchoice import PushOptionChoice, PushOptionChoiceTypedDict +from .pushoptiontype import PushOptionType +from .pushvalidationinfo import PushValidationInfo, PushValidationInfoTypedDict +from codat_sync_for_payables_version_1.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +import pydantic +from pydantic import model_serializer +from typing import Dict, List, Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class PushOptionPropertyTypedDict(TypedDict): + description: str + r"""A description of the property.""" + display_name: str + r"""The property's display name.""" + required: bool + r"""The property is required if `True`.""" + type: PushOptionType + r"""The option type.""" + options: NotRequired[Nullable[List[PushOptionChoiceTypedDict]]] + properties: NotRequired[Nullable[Dict[str, PushOptionPropertyTypedDict]]] + validation: NotRequired[PushValidationInfoTypedDict] + + +class PushOptionProperty(BaseModel): + description: str + r"""A description of the property.""" + + display_name: Annotated[str, pydantic.Field(alias="displayName")] + r"""The property's display name.""" + + required: bool + r"""The property is required if `True`.""" + + type: PushOptionType + r"""The option type.""" + + options: OptionalNullable[List[PushOptionChoice]] = UNSET + + properties: OptionalNullable[Dict[str, PushOptionProperty]] = UNSET + + validation: Optional[PushValidationInfo] = None + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = ["options", "properties", "validation"] + nullable_fields = ["options", "properties"] + null_default_fields = [] + + serialized = handler(self) + + m = {} + + for n, f in self.model_fields.items(): + k = f.alias or n + val = serialized.get(k) + serialized.pop(k, None) + + optional_nullable = k in optional_fields and k in nullable_fields + is_set = ( + self.__pydantic_fields_set__.intersection({n}) + or k in null_default_fields + ) # pylint: disable=no-member + + if val is not None and val != UNSET_SENTINEL: + m[k] = val + elif val != UNSET_SENTINEL and ( + not k in optional_fields or (optional_nullable and is_set) + ): + m[k] = val + + return m diff --git a/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/pushoptiontype.py b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/pushoptiontype.py new file mode 100644 index 000000000..c9c246f2a --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/pushoptiontype.py @@ -0,0 +1,17 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from enum import Enum + + +class PushOptionType(str, Enum): + r"""The option type.""" + + ARRAY = "Array" + OBJECT = "Object" + STRING = "String" + NUMBER = "Number" + BOOLEAN = "Boolean" + DATE_TIME = "DateTime" + FILE = "File" + MULTI_PART = "MultiPart" diff --git a/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/pushvalidationinfo.py b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/pushvalidationinfo.py new file mode 100644 index 000000000..31c445026 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/pushvalidationinfo.py @@ -0,0 +1,55 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .pushfieldvalidation import PushFieldValidation, PushFieldValidationTypedDict +from codat_sync_for_payables_version_1.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from pydantic import model_serializer +from typing import List +from typing_extensions import NotRequired, TypedDict + + +class PushValidationInfoTypedDict(TypedDict): + information: NotRequired[Nullable[List[PushFieldValidationTypedDict]]] + warnings: NotRequired[Nullable[List[PushFieldValidationTypedDict]]] + + +class PushValidationInfo(BaseModel): + information: OptionalNullable[List[PushFieldValidation]] = UNSET + + warnings: OptionalNullable[List[PushFieldValidation]] = UNSET + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = ["information", "warnings"] + nullable_fields = ["information", "warnings"] + null_default_fields = [] + + serialized = handler(self) + + m = {} + + for n, f in self.model_fields.items(): + k = f.alias or n + val = serialized.get(k) + serialized.pop(k, None) + + optional_nullable = k in optional_fields and k in nullable_fields + is_set = ( + self.__pydantic_fields_set__.intersection({n}) + or k in null_default_fields + ) # pylint: disable=no-member + + if val is not None and val != UNSET_SENTINEL: + m[k] = val + elif val != UNSET_SENTINEL and ( + not k in optional_fields or (optional_nullable and is_set) + ): + m[k] = val + + return m diff --git a/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/schema_datatype.py b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/schema_datatype.py new file mode 100644 index 000000000..aa72f531c --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/schema_datatype.py @@ -0,0 +1,52 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from enum import Enum + + +class SchemaDataType(str, Enum): + r"""Available data types""" + + ACCOUNT_TRANSACTIONS = "accountTransactions" + BALANCE_SHEET = "balanceSheet" + BANK_ACCOUNTS = "bankAccounts" + BANK_TRANSACTIONS = "bankTransactions" + BILL_CREDIT_NOTES = "billCreditNotes" + BILL_PAYMENTS = "billPayments" + BILLS = "bills" + CASH_FLOW_STATEMENT = "cashFlowStatement" + CHART_OF_ACCOUNTS = "chartOfAccounts" + COMPANY = "company" + CREDIT_NOTES = "creditNotes" + CUSTOMERS = "customers" + DIRECT_COSTS = "directCosts" + DIRECT_INCOMES = "directIncomes" + INVOICES = "invoices" + ITEM_RECEIPTS = "itemReceipts" + ITEMS = "items" + JOURNAL_ENTRIES = "journalEntries" + JOURNALS = "journals" + PAYMENT_METHODS = "paymentMethods" + PAYMENTS = "payments" + PROFIT_AND_LOSS = "profitAndLoss" + PURCHASE_ORDERS = "purchaseOrders" + SALES_ORDERS = "salesOrders" + SUPPLIERS = "suppliers" + TAX_RATES = "taxRates" + TRACKING_CATEGORIES = "trackingCategories" + TRANSFERS = "transfers" + BANKING_ACCOUNT_BALANCES = "banking-accountBalances" + BANKING_ACCOUNTS = "banking-accounts" + BANKING_TRANSACTION_CATEGORIES = "banking-transactionCategories" + BANKING_TRANSACTIONS = "banking-transactions" + COMMERCE_COMPANY_INFO = "commerce-companyInfo" + COMMERCE_CUSTOMERS = "commerce-customers" + COMMERCE_DISPUTES = "commerce-disputes" + COMMERCE_LOCATIONS = "commerce-locations" + COMMERCE_ORDERS = "commerce-orders" + COMMERCE_PAYMENT_METHODS = "commerce-paymentMethods" + COMMERCE_PAYMENTS = "commerce-payments" + COMMERCE_PRODUCT_CATEGORIES = "commerce-productCategories" + COMMERCE_PRODUCTS = "commerce-products" + COMMERCE_TAX_COMPONENTS = "commerce-taxComponents" + COMMERCE_TRANSACTIONS = "commerce-transactions" diff --git a/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/security.py b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/security.py new file mode 100644 index 000000000..5e66a99c7 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/security.py @@ -0,0 +1,24 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from codat_sync_for_payables_version_1.types import BaseModel +from codat_sync_for_payables_version_1.utils import FieldMetadata, SecurityMetadata +from typing_extensions import Annotated, TypedDict + + +class SecurityTypedDict(TypedDict): + auth_header: str + + +class Security(BaseModel): + auth_header: Annotated[ + str, + FieldMetadata( + security=SecurityMetadata( + scheme=True, + scheme_type="apiKey", + sub_type="header", + field_name="Authorization", + ) + ), + ] diff --git a/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/status.py b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/status.py new file mode 100644 index 000000000..18afe049d --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/status.py @@ -0,0 +1,12 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from enum import Enum + + +class Status(str, Enum): + r"""Current state of the tracking category.""" + + UNKNOWN = "Unknown" + ACTIVE = "Active" + ARCHIVED = "Archived" diff --git a/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/supplementaldata.py b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/supplementaldata.py new file mode 100644 index 000000000..1aea1666d --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/supplementaldata.py @@ -0,0 +1,61 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from codat_sync_for_payables_version_1.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from pydantic import model_serializer +from typing import Any, Dict +from typing_extensions import NotRequired, TypedDict + + +class SupplementalDataTypedDict(TypedDict): + r"""Supplemental data is additional data you can include in our standard data types. + + It is referenced as a configured dynamic key value pair that is unique to the accounting software. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. + """ + + content: NotRequired[Nullable[Dict[str, Dict[str, Any]]]] + + +class SupplementalData(BaseModel): + r"""Supplemental data is additional data you can include in our standard data types. + + It is referenced as a configured dynamic key value pair that is unique to the accounting software. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. + """ + + content: OptionalNullable[Dict[str, Dict[str, Any]]] = UNSET + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = ["content"] + nullable_fields = ["content"] + null_default_fields = [] + + serialized = handler(self) + + m = {} + + for n, f in self.model_fields.items(): + k = f.alias or n + val = serialized.get(k) + serialized.pop(k, None) + + optional_nullable = k in optional_fields and k in nullable_fields + is_set = ( + self.__pydantic_fields_set__.intersection({n}) + or k in null_default_fields + ) # pylint: disable=no-member + + if val is not None and val != UNSET_SENTINEL: + m[k] = val + elif val != UNSET_SENTINEL and ( + not k in optional_fields or (optional_nullable and is_set) + ): + m[k] = val + + return m diff --git a/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/supplier.py b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/supplier.py new file mode 100644 index 000000000..444e5c3e2 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/supplier.py @@ -0,0 +1,176 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .address import Address, AddressTypedDict +from .metadata import Metadata, MetadataTypedDict +from .supplementaldata import SupplementalData, SupplementalDataTypedDict +from .supplierstatus import SupplierStatus +from codat_sync_for_payables_version_1.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +import pydantic +from pydantic import model_serializer +from typing import List, Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class SupplierTypedDict(TypedDict): + r"""> View the coverage for suppliers in the Data coverage explorer. + + ## Overview + + From the **Suppliers** endpoints, you can retrieve a list of [all the suppliers for a company](https://docs.codat.io/sync-for-payables-api#/operations/list-suppliers). Suppliers' data links to accounts payable [bills](https://docs.codat.io/sync-for-payables-api#/schemas/Bill). + """ + + status: SupplierStatus + r"""Status of the supplier.""" + addresses: NotRequired[Nullable[List[AddressTypedDict]]] + r"""An array of Addresses.""" + contact_name: NotRequired[Nullable[str]] + r"""Name of the main contact for the supplier.""" + default_currency: NotRequired[Nullable[str]] + r"""Default currency the supplier's transactional data is recorded in.""" + email_address: NotRequired[Nullable[str]] + r"""Email address that the supplier may be contacted on.""" + id: NotRequired[str] + r"""Identifier for the supplier, unique to the company in the accounting software.""" + metadata: NotRequired[MetadataTypedDict] + modified_date: NotRequired[str] + phone: NotRequired[Nullable[str]] + r"""Phone number that the supplier may be contacted on.""" + registration_number: NotRequired[Nullable[str]] + r"""Company number of the supplier. In the UK, this is typically the company registration number issued by Companies House.""" + source_modified_date: NotRequired[str] + supplemental_data: NotRequired[SupplementalDataTypedDict] + r"""Supplemental data is additional data you can include in our standard data types. + + It is referenced as a configured dynamic key value pair that is unique to the accounting software. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. + """ + supplier_name: NotRequired[Nullable[str]] + r"""Name of the supplier as recorded in the accounting system, typically the company name.""" + tax_number: NotRequired[Nullable[str]] + r"""Supplier's company tax number.""" + + +class Supplier(BaseModel): + r"""> View the coverage for suppliers in the Data coverage explorer. + + ## Overview + + From the **Suppliers** endpoints, you can retrieve a list of [all the suppliers for a company](https://docs.codat.io/sync-for-payables-api#/operations/list-suppliers). Suppliers' data links to accounts payable [bills](https://docs.codat.io/sync-for-payables-api#/schemas/Bill). + """ + + status: SupplierStatus + r"""Status of the supplier.""" + + addresses: OptionalNullable[List[Address]] = UNSET + r"""An array of Addresses.""" + + contact_name: Annotated[ + OptionalNullable[str], pydantic.Field(alias="contactName") + ] = UNSET + r"""Name of the main contact for the supplier.""" + + default_currency: Annotated[ + OptionalNullable[str], pydantic.Field(alias="defaultCurrency") + ] = UNSET + r"""Default currency the supplier's transactional data is recorded in.""" + + email_address: Annotated[ + OptionalNullable[str], pydantic.Field(alias="emailAddress") + ] = UNSET + r"""Email address that the supplier may be contacted on.""" + + id: Optional[str] = None + r"""Identifier for the supplier, unique to the company in the accounting software.""" + + metadata: Optional[Metadata] = None + + modified_date: Annotated[Optional[str], pydantic.Field(alias="modifiedDate")] = None + + phone: OptionalNullable[str] = UNSET + r"""Phone number that the supplier may be contacted on.""" + + registration_number: Annotated[ + OptionalNullable[str], pydantic.Field(alias="registrationNumber") + ] = UNSET + r"""Company number of the supplier. In the UK, this is typically the company registration number issued by Companies House.""" + + source_modified_date: Annotated[ + Optional[str], pydantic.Field(alias="sourceModifiedDate") + ] = None + + supplemental_data: Annotated[ + Optional[SupplementalData], pydantic.Field(alias="supplementalData") + ] = None + r"""Supplemental data is additional data you can include in our standard data types. + + It is referenced as a configured dynamic key value pair that is unique to the accounting software. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. + """ + + supplier_name: Annotated[ + OptionalNullable[str], pydantic.Field(alias="supplierName") + ] = UNSET + r"""Name of the supplier as recorded in the accounting system, typically the company name.""" + + tax_number: Annotated[OptionalNullable[str], pydantic.Field(alias="taxNumber")] = ( + UNSET + ) + r"""Supplier's company tax number.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = [ + "addresses", + "contactName", + "defaultCurrency", + "emailAddress", + "id", + "metadata", + "modifiedDate", + "phone", + "registrationNumber", + "sourceModifiedDate", + "supplementalData", + "supplierName", + "taxNumber", + ] + nullable_fields = [ + "addresses", + "contactName", + "defaultCurrency", + "emailAddress", + "phone", + "registrationNumber", + "supplierName", + "taxNumber", + ] + null_default_fields = [] + + serialized = handler(self) + + m = {} + + for n, f in self.model_fields.items(): + k = f.alias or n + val = serialized.get(k) + serialized.pop(k, None) + + optional_nullable = k in optional_fields and k in nullable_fields + is_set = ( + self.__pydantic_fields_set__.intersection({n}) + or k in null_default_fields + ) # pylint: disable=no-member + + if val is not None and val != UNSET_SENTINEL: + m[k] = val + elif val != UNSET_SENTINEL and ( + not k in optional_fields or (optional_nullable and is_set) + ): + m[k] = val + + return m diff --git a/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/supplierref.py b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/supplierref.py new file mode 100644 index 000000000..5871ca77b --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/supplierref.py @@ -0,0 +1,64 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from codat_sync_for_payables_version_1.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +import pydantic +from pydantic import model_serializer +from typing_extensions import Annotated, NotRequired, TypedDict + + +class SupplierRefTypedDict(TypedDict): + r"""Reference to the supplier the record relates to.""" + + id: str + r"""The supplier's unique ID""" + supplier_name: NotRequired[Nullable[str]] + r"""The supplier's name""" + + +class SupplierRef(BaseModel): + r"""Reference to the supplier the record relates to.""" + + id: str + r"""The supplier's unique ID""" + + supplier_name: Annotated[ + OptionalNullable[str], pydantic.Field(alias="supplierName") + ] = UNSET + r"""The supplier's name""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = ["supplierName"] + nullable_fields = ["supplierName"] + null_default_fields = [] + + serialized = handler(self) + + m = {} + + for n, f in self.model_fields.items(): + k = f.alias or n + val = serialized.get(k) + serialized.pop(k, None) + + optional_nullable = k in optional_fields and k in nullable_fields + is_set = ( + self.__pydantic_fields_set__.intersection({n}) + or k in null_default_fields + ) # pylint: disable=no-member + + if val is not None and val != UNSET_SENTINEL: + m[k] = val + elif val != UNSET_SENTINEL and ( + not k in optional_fields or (optional_nullable and is_set) + ): + m[k] = val + + return m diff --git a/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/suppliers.py b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/suppliers.py new file mode 100644 index 000000000..c1101577d --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/suppliers.py @@ -0,0 +1,35 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .links import Links, LinksTypedDict +from .supplier import Supplier, SupplierTypedDict +from codat_sync_for_payables_version_1.types import BaseModel +import pydantic +from typing import List, Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class SuppliersTypedDict(TypedDict): + links: LinksTypedDict + page_number: int + r"""Current page number.""" + page_size: int + r"""Number of items to return in results array.""" + total_results: int + r"""Total number of items.""" + results: NotRequired[List[SupplierTypedDict]] + + +class Suppliers(BaseModel): + links: Annotated[Links, pydantic.Field(alias="_links")] + + page_number: Annotated[int, pydantic.Field(alias="pageNumber")] + r"""Current page number.""" + + page_size: Annotated[int, pydantic.Field(alias="pageSize")] + r"""Number of items to return in results array.""" + + total_results: Annotated[int, pydantic.Field(alias="totalResults")] + r"""Total number of items.""" + + results: Optional[List[Supplier]] = None diff --git a/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/supplierstatus.py b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/supplierstatus.py new file mode 100644 index 000000000..0f7785837 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/supplierstatus.py @@ -0,0 +1,12 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from enum import Enum + + +class SupplierStatus(str, Enum): + r"""Status of the supplier.""" + + UNKNOWN = "Unknown" + ACTIVE = "Active" + ARCHIVED = "Archived" diff --git a/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/tags.py b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/tags.py new file mode 100644 index 000000000..65235eebc --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/tags.py @@ -0,0 +1,13 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from codat_sync_for_payables_version_1.types import BaseModel +from typing_extensions import TypedDict + + +class TagsTypedDict(TypedDict): + r"""A collection of user-defined key-value pairs that store custom metadata against the company.""" + + +class Tags(BaseModel): + r"""A collection of user-defined key-value pairs that store custom metadata against the company.""" diff --git a/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/taxrate.py b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/taxrate.py new file mode 100644 index 000000000..1f9082940 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/taxrate.py @@ -0,0 +1,210 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .metadata import Metadata, MetadataTypedDict +from .supplementaldata import SupplementalData, SupplementalDataTypedDict +from .taxratecomponent import TaxRateComponent, TaxRateComponentTypedDict +from .taxratestatus import TaxRateStatus +from .validdatatypelink_items import ( + ValidDatatypeLinkItems, + ValidDatatypeLinkItemsTypedDict, +) +from codat_sync_for_payables_version_1.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from codat_sync_for_payables_version_1.utils import serialize_decimal, validate_decimal +from decimal import Decimal +import pydantic +from pydantic import model_serializer +from pydantic.functional_serializers import PlainSerializer +from pydantic.functional_validators import BeforeValidator +from typing import List, Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class TaxRateTypedDict(TypedDict): + r"""> View the coverage for tax rates in the Data coverage explorer. + + ## Overview + + Accounting systems typically store a set of taxes and associated rates within the accounting software. This means that users don't have to look up or remember the rates for each type of tax. For example, applying the tax \"UK sales VAT\" to line items of an invoice adds the correct rate of 20%. + + ### Tax components + + In some cases, a tax is made up of multiple sub taxes, often called _components_ of the tax. For example, you may have an item that is charged a tax rate called \"City import tax (8%)\" that has two components: + + - A city tax of 5% + - An import tax of 3% + + > **Effective tax rates** + > - Where there are multiple components of a tax, each component may be calculated on the original amount and added together. Alternatively, one tax may be calculated on the sub-total of the original amount plus another tax, which is referred to as _compounding_. When there is compounding, the effective tax rate is the rate that, if applied to the original amount, would result in the total amount of tax with compounding. + > + > **Example:** + > A tax has two components. Both components have a rate of 10%, and one component is compound. In this case, there is a total tax rate of 20% but an effective tax rate of 21%. + > + > - For QuickBooks Online, Codat doesn't use compound rates. Instead, the calculated effective tax rate for each component is shown. This means that the effective and total rates are the same because the total tax rate is a sum of the component rates. + """ + + code: NotRequired[Nullable[str]] + r"""Code for the tax rate from the accounting software.""" + components: NotRequired[Nullable[List[TaxRateComponentTypedDict]]] + effective_tax_rate: NotRequired[Nullable[Decimal]] + r"""See Effective tax rates description.""" + id: NotRequired[str] + r"""Identifier for the tax rate, unique for the company in the accounting software.""" + metadata: NotRequired[MetadataTypedDict] + modified_date: NotRequired[str] + name: NotRequired[Nullable[str]] + r"""Codat-augmented name of the tax rate in the accounting software.""" + source_modified_date: NotRequired[str] + status: NotRequired[TaxRateStatus] + r"""Status of the tax rate in the accounting software. + - `Active` - An active tax rate in use by a company. + - `Archived` - A tax rate that has been archived or is inactive in the accounting software. + - `Unknown` - Where the status of the tax rate cannot be determined from the underlying platform. + """ + supplemental_data: NotRequired[SupplementalDataTypedDict] + r"""Supplemental data is additional data you can include in our standard data types. + + It is referenced as a configured dynamic key value pair that is unique to the accounting software. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. + """ + total_tax_rate: NotRequired[Nullable[Decimal]] + r"""Total (not compounded) sum of the components of a tax rate.""" + valid_datatype_links: NotRequired[Nullable[List[ValidDatatypeLinkItemsTypedDict]]] + + +class TaxRate(BaseModel): + r"""> View the coverage for tax rates in the Data coverage explorer. + + ## Overview + + Accounting systems typically store a set of taxes and associated rates within the accounting software. This means that users don't have to look up or remember the rates for each type of tax. For example, applying the tax \"UK sales VAT\" to line items of an invoice adds the correct rate of 20%. + + ### Tax components + + In some cases, a tax is made up of multiple sub taxes, often called _components_ of the tax. For example, you may have an item that is charged a tax rate called \"City import tax (8%)\" that has two components: + + - A city tax of 5% + - An import tax of 3% + + > **Effective tax rates** + > - Where there are multiple components of a tax, each component may be calculated on the original amount and added together. Alternatively, one tax may be calculated on the sub-total of the original amount plus another tax, which is referred to as _compounding_. When there is compounding, the effective tax rate is the rate that, if applied to the original amount, would result in the total amount of tax with compounding. + > + > **Example:** + > A tax has two components. Both components have a rate of 10%, and one component is compound. In this case, there is a total tax rate of 20% but an effective tax rate of 21%. + > + > - For QuickBooks Online, Codat doesn't use compound rates. Instead, the calculated effective tax rate for each component is shown. This means that the effective and total rates are the same because the total tax rate is a sum of the component rates. + """ + + code: OptionalNullable[str] = UNSET + r"""Code for the tax rate from the accounting software.""" + + components: OptionalNullable[List[TaxRateComponent]] = UNSET + + effective_tax_rate: Annotated[ + Annotated[ + OptionalNullable[Decimal], + BeforeValidator(validate_decimal), + PlainSerializer(serialize_decimal(False)), + ], + pydantic.Field(alias="effectiveTaxRate"), + ] = UNSET + r"""See Effective tax rates description.""" + + id: Optional[str] = None + r"""Identifier for the tax rate, unique for the company in the accounting software.""" + + metadata: Optional[Metadata] = None + + modified_date: Annotated[Optional[str], pydantic.Field(alias="modifiedDate")] = None + + name: OptionalNullable[str] = UNSET + r"""Codat-augmented name of the tax rate in the accounting software.""" + + source_modified_date: Annotated[ + Optional[str], pydantic.Field(alias="sourceModifiedDate") + ] = None + + status: Optional[TaxRateStatus] = None + r"""Status of the tax rate in the accounting software. + - `Active` - An active tax rate in use by a company. + - `Archived` - A tax rate that has been archived or is inactive in the accounting software. + - `Unknown` - Where the status of the tax rate cannot be determined from the underlying platform. + """ + + supplemental_data: Annotated[ + Optional[SupplementalData], pydantic.Field(alias="supplementalData") + ] = None + r"""Supplemental data is additional data you can include in our standard data types. + + It is referenced as a configured dynamic key value pair that is unique to the accounting software. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. + """ + + total_tax_rate: Annotated[ + Annotated[ + OptionalNullable[Decimal], + BeforeValidator(validate_decimal), + PlainSerializer(serialize_decimal(False)), + ], + pydantic.Field(alias="totalTaxRate"), + ] = UNSET + r"""Total (not compounded) sum of the components of a tax rate.""" + + valid_datatype_links: Annotated[ + OptionalNullable[List[ValidDatatypeLinkItems]], + pydantic.Field(alias="validDatatypeLinks"), + ] = UNSET + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = [ + "code", + "components", + "effectiveTaxRate", + "id", + "metadata", + "modifiedDate", + "name", + "sourceModifiedDate", + "status", + "supplementalData", + "totalTaxRate", + "validDatatypeLinks", + ] + nullable_fields = [ + "code", + "components", + "effectiveTaxRate", + "name", + "totalTaxRate", + "validDatatypeLinks", + ] + null_default_fields = [] + + serialized = handler(self) + + m = {} + + for n, f in self.model_fields.items(): + k = f.alias or n + val = serialized.get(k) + serialized.pop(k, None) + + optional_nullable = k in optional_fields and k in nullable_fields + is_set = ( + self.__pydantic_fields_set__.intersection({n}) + or k in null_default_fields + ) # pylint: disable=no-member + + if val is not None and val != UNSET_SENTINEL: + m[k] = val + elif val != UNSET_SENTINEL and ( + not k in optional_fields or (optional_nullable and is_set) + ): + m[k] = val + + return m diff --git a/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/taxratecomponent.py b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/taxratecomponent.py new file mode 100644 index 000000000..4643e383d --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/taxratecomponent.py @@ -0,0 +1,75 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from codat_sync_for_payables_version_1.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from codat_sync_for_payables_version_1.utils import serialize_decimal, validate_decimal +from decimal import Decimal +import pydantic +from pydantic import model_serializer +from pydantic.functional_serializers import PlainSerializer +from pydantic.functional_validators import BeforeValidator +from typing_extensions import Annotated, NotRequired, TypedDict + + +class TaxRateComponentTypedDict(TypedDict): + r"""A tax rate can be made up of multiple sub taxes, often called components of the tax.""" + + is_compound: bool + r"""A flag to indicate with the tax is calculated using the principle of compounding.""" + name: NotRequired[Nullable[str]] + r"""Name of the tax rate component.""" + rate: NotRequired[Nullable[Decimal]] + r"""The rate of the tax rate component, usually a percentage.""" + + +class TaxRateComponent(BaseModel): + r"""A tax rate can be made up of multiple sub taxes, often called components of the tax.""" + + is_compound: Annotated[bool, pydantic.Field(alias="isCompound")] + r"""A flag to indicate with the tax is calculated using the principle of compounding.""" + + name: OptionalNullable[str] = UNSET + r"""Name of the tax rate component.""" + + rate: Annotated[ + OptionalNullable[Decimal], + BeforeValidator(validate_decimal), + PlainSerializer(serialize_decimal(False)), + ] = UNSET + r"""The rate of the tax rate component, usually a percentage.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = ["name", "rate"] + nullable_fields = ["name", "rate"] + null_default_fields = [] + + serialized = handler(self) + + m = {} + + for n, f in self.model_fields.items(): + k = f.alias or n + val = serialized.get(k) + serialized.pop(k, None) + + optional_nullable = k in optional_fields and k in nullable_fields + is_set = ( + self.__pydantic_fields_set__.intersection({n}) + or k in null_default_fields + ) # pylint: disable=no-member + + if val is not None and val != UNSET_SENTINEL: + m[k] = val + elif val != UNSET_SENTINEL and ( + not k in optional_fields or (optional_nullable and is_set) + ): + m[k] = val + + return m diff --git a/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/taxrateref.py b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/taxrateref.py new file mode 100644 index 000000000..fa5d45b7f --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/taxrateref.py @@ -0,0 +1,62 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from codat_sync_for_payables_version_1.types import BaseModel +from codat_sync_for_payables_version_1.utils import serialize_decimal, validate_decimal +from decimal import Decimal +import pydantic +from pydantic.functional_serializers import PlainSerializer +from pydantic.functional_validators import BeforeValidator +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class TaxRateRefTypedDict(TypedDict): + r"""Data types that reference a tax rate, for example invoice and bill line items, use a taxRateRef that includes the ID and name of the linked tax rate. + + Found on: + + - Bill line items + - Bill Credit Note line items + - Credit Note line items + - Direct incomes line items + - Invoice line items + - Items + """ + + effective_tax_rate: NotRequired[Decimal] + r"""Applicable tax rate.""" + id: NotRequired[str] + r"""Unique identifier for the tax rate in the accounting software.""" + name: NotRequired[str] + r"""Name of the tax rate in the accounting software.""" + + +class TaxRateRef(BaseModel): + r"""Data types that reference a tax rate, for example invoice and bill line items, use a taxRateRef that includes the ID and name of the linked tax rate. + + Found on: + + - Bill line items + - Bill Credit Note line items + - Credit Note line items + - Direct incomes line items + - Invoice line items + - Items + """ + + effective_tax_rate: Annotated[ + Annotated[ + Optional[Decimal], + BeforeValidator(validate_decimal), + PlainSerializer(serialize_decimal(False)), + ], + pydantic.Field(alias="effectiveTaxRate"), + ] = None + r"""Applicable tax rate.""" + + id: Optional[str] = None + r"""Unique identifier for the tax rate in the accounting software.""" + + name: Optional[str] = None + r"""Name of the tax rate in the accounting software.""" diff --git a/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/taxrates.py b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/taxrates.py new file mode 100644 index 000000000..a982a12e3 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/taxrates.py @@ -0,0 +1,35 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .links import Links, LinksTypedDict +from .taxrate import TaxRate, TaxRateTypedDict +from codat_sync_for_payables_version_1.types import BaseModel +import pydantic +from typing import List, Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class TaxRatesTypedDict(TypedDict): + links: LinksTypedDict + page_number: int + r"""Current page number.""" + page_size: int + r"""Number of items to return in results array.""" + total_results: int + r"""Total number of items.""" + results: NotRequired[List[TaxRateTypedDict]] + + +class TaxRates(BaseModel): + links: Annotated[Links, pydantic.Field(alias="_links")] + + page_number: Annotated[int, pydantic.Field(alias="pageNumber")] + r"""Current page number.""" + + page_size: Annotated[int, pydantic.Field(alias="pageSize")] + r"""Number of items to return in results array.""" + + total_results: Annotated[int, pydantic.Field(alias="totalResults")] + r"""Total number of items.""" + + results: Optional[List[TaxRate]] = None diff --git a/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/taxratestatus.py b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/taxratestatus.py new file mode 100644 index 000000000..75af79afa --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/taxratestatus.py @@ -0,0 +1,16 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from enum import Enum + + +class TaxRateStatus(str, Enum): + r"""Status of the tax rate in the accounting software. + - `Active` - An active tax rate in use by a company. + - `Archived` - A tax rate that has been archived or is inactive in the accounting software. + - `Unknown` - Where the status of the tax rate cannot be determined from the underlying platform. + """ + + UNKNOWN = "Unknown" + ACTIVE = "Active" + ARCHIVED = "Archived" diff --git a/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/tracking.py b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/tracking.py new file mode 100644 index 000000000..eaf0ad048 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/tracking.py @@ -0,0 +1,142 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .billedtotype import BilledToType +from .trackingcategoryref import TrackingCategoryRef, TrackingCategoryRefTypedDict +from codat_sync_for_payables_version_1.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +import pydantic +from pydantic import model_serializer +from typing import List, Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class CustomerRefTypedDict(TypedDict): + id: str + r"""`id` from the Customers data type""" + company_name: NotRequired[Nullable[str]] + r"""`customerName` from the Customer data type""" + + +class CustomerRef(BaseModel): + id: str + r"""`id` from the Customers data type""" + + company_name: Annotated[ + OptionalNullable[str], pydantic.Field(alias="companyName") + ] = UNSET + r"""`customerName` from the Customer data type""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = ["companyName"] + nullable_fields = ["companyName"] + null_default_fields = [] + + serialized = handler(self) + + m = {} + + for n, f in self.model_fields.items(): + k = f.alias or n + val = serialized.get(k) + serialized.pop(k, None) + + optional_nullable = k in optional_fields and k in nullable_fields + is_set = ( + self.__pydantic_fields_set__.intersection({n}) + or k in null_default_fields + ) # pylint: disable=no-member + + if val is not None and val != UNSET_SENTINEL: + m[k] = val + elif val != UNSET_SENTINEL and ( + not k in optional_fields or (optional_nullable and is_set) + ): + m[k] = val + + return m + + +class AccountingProjectReferenceTypedDict(TypedDict): + id: str + r"""Unique identifier to the project reference.""" + name: NotRequired[Nullable[str]] + r"""The project's name.""" + + +class AccountingProjectReference(BaseModel): + id: str + r"""Unique identifier to the project reference.""" + + name: OptionalNullable[str] = UNSET + r"""The project's name.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = ["name"] + nullable_fields = ["name"] + null_default_fields = [] + + serialized = handler(self) + + m = {} + + for n, f in self.model_fields.items(): + k = f.alias or n + val = serialized.get(k) + serialized.pop(k, None) + + optional_nullable = k in optional_fields and k in nullable_fields + is_set = ( + self.__pydantic_fields_set__.intersection({n}) + or k in null_default_fields + ) # pylint: disable=no-member + + if val is not None and val != UNSET_SENTINEL: + m[k] = val + elif val != UNSET_SENTINEL and ( + not k in optional_fields or (optional_nullable and is_set) + ): + m[k] = val + + return m + + +class TrackingTypedDict(TypedDict): + r"""Categories, and a project and customer, against which the item is tracked.""" + + category_refs: List[TrackingCategoryRefTypedDict] + is_billed_to: BilledToType + r"""Defines if the invoice or credit note is billed/rebilled to a project or customer.""" + is_rebilled_to: BilledToType + r"""Defines if the invoice or credit note is billed/rebilled to a project or customer.""" + customer_ref: NotRequired[CustomerRefTypedDict] + project_ref: NotRequired[AccountingProjectReferenceTypedDict] + + +class Tracking(BaseModel): + r"""Categories, and a project and customer, against which the item is tracked.""" + + category_refs: Annotated[ + List[TrackingCategoryRef], pydantic.Field(alias="categoryRefs") + ] + + is_billed_to: Annotated[BilledToType, pydantic.Field(alias="isBilledTo")] + r"""Defines if the invoice or credit note is billed/rebilled to a project or customer.""" + + is_rebilled_to: Annotated[BilledToType, pydantic.Field(alias="isRebilledTo")] + r"""Defines if the invoice or credit note is billed/rebilled to a project or customer.""" + + customer_ref: Annotated[ + Optional[CustomerRef], pydantic.Field(alias="customerRef") + ] = None + + project_ref: Annotated[ + Optional[AccountingProjectReference], pydantic.Field(alias="projectRef") + ] = None diff --git a/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/trackingcategories.py b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/trackingcategories.py new file mode 100644 index 000000000..4d55fd639 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/trackingcategories.py @@ -0,0 +1,35 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .links import Links, LinksTypedDict +from .trackingcategory import TrackingCategory, TrackingCategoryTypedDict +from codat_sync_for_payables_version_1.types import BaseModel +import pydantic +from typing import List, Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class TrackingCategoriesTypedDict(TypedDict): + links: LinksTypedDict + page_number: int + r"""Current page number.""" + page_size: int + r"""Number of items to return in results array.""" + total_results: int + r"""Total number of items.""" + results: NotRequired[List[TrackingCategoryTypedDict]] + + +class TrackingCategories(BaseModel): + links: Annotated[Links, pydantic.Field(alias="_links")] + + page_number: Annotated[int, pydantic.Field(alias="pageNumber")] + r"""Current page number.""" + + page_size: Annotated[int, pydantic.Field(alias="pageSize")] + r"""Number of items to return in results array.""" + + total_results: Annotated[int, pydantic.Field(alias="totalResults")] + r"""Total number of items.""" + + results: Optional[List[TrackingCategory]] = None diff --git a/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/trackingcategory.py b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/trackingcategory.py new file mode 100644 index 000000000..8ccd2d68e --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/trackingcategory.py @@ -0,0 +1,358 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .metadata import Metadata, MetadataTypedDict +from .status import Status +from codat_sync_for_payables_version_1.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +import pydantic +from pydantic import model_serializer +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class TrackingCategoryTypedDict(TypedDict): + r"""Details of a category used for tracking transactions. + + > Language tip + > + > Parameters used to track types of spend in various parts of an organization can be called **dimensions**, **projects**, **classes**, or **locations** in different accounting software. In Codat, we refer to these as tracking categories. + + View the coverage for tracking categories in the Data coverage explorer. + + ## Overview + + Tracking categories are used to monitor cost centres and control budgets that sit outside the standard chart of accounts. Customers may use tracking categories to group together and track the income and costs of specific departments, projects, locations or customers. + + From their accounting system, customers can: + + - Create and maintain tracking categories and tracking category types. + - View all tracking categories that are available for use. + - View the relationships between the categories. + - Assign invoices, bills, credit notes, or bill credit notes to one or more categories. + - View the categories that a transaction belongs to. + - View all transactions in a tracking category. + + ### Tracking categories per platform + + Review the platform-specific tracking categories that Codat supports, and the level they are assigned to in the source platform. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
PlatformTracking categoryTracking level
Dynamics 365DimensionsLine item
FreshbooksExpense categoriesLine item
MYOBCategoriesTransaction
NetsuiteClassesLine item
LocationsLine item
DepartmentsLine item
Custom segmentsLine item
QuickBooks DesktopClassesLine item or transaction level
LocationsTransaction
QuickBooks OnlineClassesLine item or transaction level
LocationsTransaction
Sage 200Cost centersLine item
DepartmentsLine item
Analysis codesTransaction
Sage 50DepartmentsLine item
CostcodesLine item
ProjectsLine item
Sage IntacctDimensionsLine item
XeroTracking categoriesLine item
+ + > **Example use case** + > + > Monitor the budget for your annual conference using a tracking category called 'AnnualConference2020' with the **type** set to **Costing**. + + If a tracking category has a parent category, the ID of that parent category is displayed. There is also a `hasChildren` field that shows whether there are child subcategories nested beneath. + """ + + has_children: NotRequired[bool] + r"""Boolean value indicating whether this category has SubCategories.""" + id: NotRequired[Nullable[str]] + r"""The identifier for the item, unique per tracking category.""" + metadata: NotRequired[MetadataTypedDict] + modified_date: NotRequired[str] + name: NotRequired[Nullable[str]] + r"""The name of the tracking category.""" + parent_id: NotRequired[Nullable[str]] + r"""The identifier for this item's immediate parent.""" + source_modified_date: NotRequired[str] + status: NotRequired[Status] + r"""Current state of the tracking category.""" + + +class TrackingCategory(BaseModel): + r"""Details of a category used for tracking transactions. + + > Language tip + > + > Parameters used to track types of spend in various parts of an organization can be called **dimensions**, **projects**, **classes**, or **locations** in different accounting software. In Codat, we refer to these as tracking categories. + + View the coverage for tracking categories in the Data coverage explorer. + + ## Overview + + Tracking categories are used to monitor cost centres and control budgets that sit outside the standard chart of accounts. Customers may use tracking categories to group together and track the income and costs of specific departments, projects, locations or customers. + + From their accounting system, customers can: + + - Create and maintain tracking categories and tracking category types. + - View all tracking categories that are available for use. + - View the relationships between the categories. + - Assign invoices, bills, credit notes, or bill credit notes to one or more categories. + - View the categories that a transaction belongs to. + - View all transactions in a tracking category. + + ### Tracking categories per platform + + Review the platform-specific tracking categories that Codat supports, and the level they are assigned to in the source platform. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
PlatformTracking categoryTracking level
Dynamics 365DimensionsLine item
FreshbooksExpense categoriesLine item
MYOBCategoriesTransaction
NetsuiteClassesLine item
LocationsLine item
DepartmentsLine item
Custom segmentsLine item
QuickBooks DesktopClassesLine item or transaction level
LocationsTransaction
QuickBooks OnlineClassesLine item or transaction level
LocationsTransaction
Sage 200Cost centersLine item
DepartmentsLine item
Analysis codesTransaction
Sage 50DepartmentsLine item
CostcodesLine item
ProjectsLine item
Sage IntacctDimensionsLine item
XeroTracking categoriesLine item
+ + > **Example use case** + > + > Monitor the budget for your annual conference using a tracking category called 'AnnualConference2020' with the **type** set to **Costing**. + + If a tracking category has a parent category, the ID of that parent category is displayed. There is also a `hasChildren` field that shows whether there are child subcategories nested beneath. + """ + + has_children: Annotated[Optional[bool], pydantic.Field(alias="hasChildren")] = None + r"""Boolean value indicating whether this category has SubCategories.""" + + id: OptionalNullable[str] = UNSET + r"""The identifier for the item, unique per tracking category.""" + + metadata: Optional[Metadata] = None + + modified_date: Annotated[Optional[str], pydantic.Field(alias="modifiedDate")] = None + + name: OptionalNullable[str] = UNSET + r"""The name of the tracking category.""" + + parent_id: Annotated[OptionalNullable[str], pydantic.Field(alias="parentId")] = ( + UNSET + ) + r"""The identifier for this item's immediate parent.""" + + source_modified_date: Annotated[ + Optional[str], pydantic.Field(alias="sourceModifiedDate") + ] = None + + status: Optional[Status] = None + r"""Current state of the tracking category.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = [ + "hasChildren", + "id", + "metadata", + "modifiedDate", + "name", + "parentId", + "sourceModifiedDate", + "status", + ] + nullable_fields = ["id", "name", "parentId"] + null_default_fields = [] + + serialized = handler(self) + + m = {} + + for n, f in self.model_fields.items(): + k = f.alias or n + val = serialized.get(k) + serialized.pop(k, None) + + optional_nullable = k in optional_fields and k in nullable_fields + is_set = ( + self.__pydantic_fields_set__.intersection({n}) + or k in null_default_fields + ) # pylint: disable=no-member + + if val is not None and val != UNSET_SENTINEL: + m[k] = val + elif val != UNSET_SENTINEL and ( + not k in optional_fields or (optional_nullable and is_set) + ): + m[k] = val + + return m diff --git a/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/trackingcategoryref.py b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/trackingcategoryref.py new file mode 100644 index 000000000..b99ed7be4 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/trackingcategoryref.py @@ -0,0 +1,67 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from codat_sync_for_payables_version_1.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from pydantic import model_serializer +from typing_extensions import NotRequired, TypedDict, deprecated + + +@deprecated( + "warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible." +) +class TrackingCategoryRefTypedDict(TypedDict): + r"""References a category against which the item is tracked.""" + + id: str + r"""Unique identifier to the tracking category.""" + name: NotRequired[Nullable[str]] + r"""Name of tracking category.""" + + +@deprecated( + "warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible." +) +class TrackingCategoryRef(BaseModel): + r"""References a category against which the item is tracked.""" + + id: str + r"""Unique identifier to the tracking category.""" + + name: OptionalNullable[str] = UNSET + r"""Name of tracking category.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = ["name"] + nullable_fields = ["name"] + null_default_fields = [] + + serialized = handler(self) + + m = {} + + for n, f in self.model_fields.items(): + k = f.alias or n + val = serialized.get(k) + serialized.pop(k, None) + + optional_nullable = k in optional_fields and k in nullable_fields + is_set = ( + self.__pydantic_fields_set__.intersection({n}) + or k in null_default_fields + ) # pylint: disable=no-member + + if val is not None and val != UNSET_SENTINEL: + m[k] = val + elif val != UNSET_SENTINEL and ( + not k in optional_fields or (optional_nullable and is_set) + ): + m[k] = val + + return m diff --git a/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/trackingcategorytree.py b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/trackingcategorytree.py new file mode 100644 index 000000000..507b1608b --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/trackingcategorytree.py @@ -0,0 +1,111 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .metadata import Metadata, MetadataTypedDict +from .status import Status +from codat_sync_for_payables_version_1.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +import pydantic +from pydantic import model_serializer +from typing import List, Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class TrackingCategoryTreeTypedDict(TypedDict): + r"""The full structure of a specific tracking category including any child or subcategories.""" + + has_children: NotRequired[bool] + r"""Boolean value indicating whether this category has SubCategories""" + id: NotRequired[Nullable[str]] + r"""The identifier for the item, unique per tracking category""" + metadata: NotRequired[MetadataTypedDict] + modified_date: NotRequired[str] + name: NotRequired[Nullable[str]] + r"""The name of the tracking category""" + parent_id: NotRequired[Nullable[str]] + r"""The identifier for this item's immediate parent""" + source_modified_date: NotRequired[str] + status: NotRequired[Status] + r"""Current state of the tracking category.""" + sub_categories: NotRequired[Nullable[List[TrackingCategoryTreeTypedDict]]] + r"""A collection of subcategories that are nested beneath this category.""" + + +class TrackingCategoryTree(BaseModel): + r"""The full structure of a specific tracking category including any child or subcategories.""" + + has_children: Annotated[Optional[bool], pydantic.Field(alias="hasChildren")] = None + r"""Boolean value indicating whether this category has SubCategories""" + + id: OptionalNullable[str] = UNSET + r"""The identifier for the item, unique per tracking category""" + + metadata: Optional[Metadata] = None + + modified_date: Annotated[Optional[str], pydantic.Field(alias="modifiedDate")] = None + + name: OptionalNullable[str] = UNSET + r"""The name of the tracking category""" + + parent_id: Annotated[OptionalNullable[str], pydantic.Field(alias="parentId")] = ( + UNSET + ) + r"""The identifier for this item's immediate parent""" + + source_modified_date: Annotated[ + Optional[str], pydantic.Field(alias="sourceModifiedDate") + ] = None + + status: Optional[Status] = None + r"""Current state of the tracking category.""" + + sub_categories: Annotated[ + OptionalNullable[List[TrackingCategoryTree]], + pydantic.Field(alias="subCategories"), + ] = UNSET + r"""A collection of subcategories that are nested beneath this category.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = [ + "hasChildren", + "id", + "metadata", + "modifiedDate", + "name", + "parentId", + "sourceModifiedDate", + "status", + "subCategories", + ] + nullable_fields = ["id", "name", "parentId", "subCategories"] + null_default_fields = [] + + serialized = handler(self) + + m = {} + + for n, f in self.model_fields.items(): + k = f.alias or n + val = serialized.get(k) + serialized.pop(k, None) + + optional_nullable = k in optional_fields and k in nullable_fields + is_set = ( + self.__pydantic_fields_set__.intersection({n}) + or k in null_default_fields + ) # pylint: disable=no-member + + if val is not None and val != UNSET_SENTINEL: + m[k] = val + elif val != UNSET_SENTINEL and ( + not k in optional_fields or (optional_nullable and is_set) + ): + m[k] = val + + return m diff --git a/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/trackingrecordref.py b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/trackingrecordref.py new file mode 100644 index 000000000..e2818815f --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/trackingrecordref.py @@ -0,0 +1,37 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from codat_sync_for_payables_version_1.types import BaseModel +from enum import Enum +import pydantic +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class TrackingRecordRefDataType(str, Enum): + r"""Name of underlying data type.""" + + CUSTOMERS = "customers" + SUPPLIERS = "suppliers" + TRACKING_CATEGORIES = "trackingCategories" + + +class TrackingRecordRefTypedDict(TypedDict): + r"""Links to the customer or tracking category.""" + + data_type: NotRequired[TrackingRecordRefDataType] + r"""Name of underlying data type.""" + id: NotRequired[str] + r"""'id' of the underlying record or data type.""" + + +class TrackingRecordRef(BaseModel): + r"""Links to the customer or tracking category.""" + + data_type: Annotated[ + Optional[TrackingRecordRefDataType], pydantic.Field(alias="dataType") + ] = None + r"""Name of underlying data type.""" + + id: Optional[str] = None + r"""'id' of the underlying record or data type.""" diff --git a/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/updatebillcreditnoteresponse.py b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/updatebillcreditnoteresponse.py new file mode 100644 index 000000000..a6cc65f06 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/updatebillcreditnoteresponse.py @@ -0,0 +1,707 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .billcreditnotelineitem import ( + BillCreditNoteLineItem, + BillCreditNoteLineItemTypedDict, +) +from .billcreditnotestatus import BillCreditNoteStatus +from .datatype import DataType +from .items import Items, ItemsTypedDict +from .metadata import Metadata, MetadataTypedDict +from .pushoperationchange import PushOperationChange, PushOperationChangeTypedDict +from .pushoperationstatus import PushOperationStatus +from .supplementaldata import SupplementalData, SupplementalDataTypedDict +from .supplierref import SupplierRef, SupplierRefTypedDict +from .validation import Validation, ValidationTypedDict +from .withholdingtax_items import WithholdingTaxItems, WithholdingTaxItemsTypedDict +from codat_sync_for_payables_version_1.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from codat_sync_for_payables_version_1.utils import serialize_decimal, validate_decimal +from decimal import Decimal +import pydantic +from pydantic import model_serializer +from pydantic.functional_serializers import PlainSerializer +from pydantic.functional_validators import BeforeValidator +from typing import List, Optional +from typing_extensions import Annotated, NotRequired, TypedDict, deprecated + + +class UpdateBillCreditNoteResponseRecordReferenceTypedDict(TypedDict): + r"""Links the current record to the underlying record or data type that created it. + + For example, if a journal entry is generated based on an invoice, this property allows you to connect the journal entry to the underlying invoice in our data model. + """ + + data_type: NotRequired[str] + r"""Allowed name of the 'dataType'.""" + id: NotRequired[str] + r"""'id' of the underlying record or data type.""" + + +class UpdateBillCreditNoteResponseRecordReference(BaseModel): + r"""Links the current record to the underlying record or data type that created it. + + For example, if a journal entry is generated based on an invoice, this property allows you to connect the journal entry to the underlying invoice in our data model. + """ + + data_type: Annotated[Optional[str], pydantic.Field(alias="dataType")] = None + r"""Allowed name of the 'dataType'.""" + + id: Optional[str] = None + r"""'id' of the underlying record or data type.""" + + +@deprecated( + "warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible." +) +class UpdateBillCreditNoteResponseAccountingBillCreditNoteTypedDict(TypedDict): + r"""> **Bill credit notes or credit notes?** + > + > In Codat, bill credit notes represent accounts payable only. For accounts receivable, see [Credit notes](https://docs.codat.io/sync-for-payables-api#/schemas/CreditNote). + + View the coverage for bill credit notes in the Data coverage explorer. + + ## Overview + + A bill credit note is issued by a supplier for the purpose of recording credit. For example, if a supplier was unable to fulfil an order that was placed by a business, or delivered damaged goods, they would issue a bill credit note. A bill credit note reduces the amount a business owes to the supplier. It can be refunded to the business or used to pay off future bills. + + In the Codat API, a bill credit note is an accounts payable record issued by a [supplier](https://docs.codat.io/sync-for-payables-api#/schemas/Supplier). + + A bill credit note includes details of: + * The original and remaining credit. + * Any allocations of the credit against other records, such as [bills](https://docs.codat.io/sync-for-payables-api#/schemas/Bill). + * The supplier that issued the bill credit note. + """ + + discount_percentage: Decimal + r"""Percentage rate of any discount applied to the bill credit note.""" + status: BillCreditNoteStatus + r"""Current state of the bill credit note""" + sub_total: Decimal + r"""Total amount of the bill credit note, including discounts but excluding tax.""" + total_amount: Decimal + r"""Total amount of credit that has been applied to the business' account with the supplier, including discounts and tax.""" + total_discount: Decimal + r"""Total value of any discounts applied.""" + total_tax_amount: Decimal + r"""Amount of tax included in the bill credit note.""" + allocated_on_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: + + ``` + 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. + """ + bill_credit_note_number: NotRequired[Nullable[str]] + r"""Friendly reference for the bill credit note.""" + created_from_refs: NotRequired[ + Nullable[List[UpdateBillCreditNoteResponseRecordReferenceTypedDict]] + ] + r"""An array of records the credit note was created from.""" + currency: NotRequired[str] + r"""The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + + ## Unknown currencies + + In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + + There are only a very small number of edge cases where this currency code is returned by the Codat system. + """ + currency_rate: NotRequired[Nullable[Decimal]] + r"""Rate to convert the total amount of the payment into the base currency for the company at the time of the payment. + + Currency rates in Codat are implemented as the multiple of foreign currency units to each base currency unit. + + It is not possible to perform the currency conversion with two or more non-base currencies participating in the transaction. For example, if a company's base currency is USD, and it has a bill issued in EUR, then the bill payment must happen in USD or EUR. + + Where the currency rate is provided by the underlying accounting software, it will be available from Codat with the same precision (up to a maximum of 9 decimal places). + + For accounting software which do not provide an explicit currency rate, it is calculated as `baseCurrency / foreignCurrency` and will be returned to 9 decimal places. + + ## Examples with base currency of GBP + + | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (GBP) | + | :--------------- | :------------- | :------------ | :------------------------- | + | **USD** | $20 | 0.781 | £15.62 | + | **EUR** | €20 | 0.885 | £17.70 | + | **RUB** | ₽20 | 0.011 | £0.22 | + + ## Examples with base currency of USD + + | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (USD) | + | :--------------- | :------------- | :------------ | :------------------------- | + | **GBP** | £20 | 1.277 | $25.54 | + | **EUR** | €20 | 1.134 | $22.68 | + | **RUB** | ₽20 | 0.015 | $0.30 | + + + ### Integration-specific details + + | Integration | Scenario | System behavior | + |-------------------|-------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------| + | QuickBooks Online | Transaction currency differs from base currency | If currency rate value is left `null`, a rate of 1 will be used by QBO by default. To override this, specify a currencyRate in the request body. | + """ + id: NotRequired[str] + r"""Identifier for the bill credit note that is unique to a company in the accounting software.""" + issue_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: + + ``` + 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. + """ + line_items: NotRequired[Nullable[List[BillCreditNoteLineItemTypedDict]]] + r"""An array of line""" + metadata: NotRequired[MetadataTypedDict] + modified_date: NotRequired[str] + note: NotRequired[Nullable[str]] + r"""Any additional information about the bill credit note.""" + payment_allocations: NotRequired[Nullable[List[ItemsTypedDict]]] + r"""An array of payment allocations.""" + remaining_credit: NotRequired[Decimal] + r"""Amount of the bill credit note that is still outstanding.""" + source_modified_date: NotRequired[str] + supplemental_data: NotRequired[SupplementalDataTypedDict] + r"""Supplemental data is additional data you can include in our standard data types. + + It is referenced as a configured dynamic key value pair that is unique to the accounting software. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. + """ + supplier_ref: NotRequired[SupplierRefTypedDict] + r"""Reference to the supplier the record relates to.""" + withholding_tax: NotRequired[Nullable[List[WithholdingTaxItemsTypedDict]]] + + +@deprecated( + "warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible." +) +class UpdateBillCreditNoteResponseAccountingBillCreditNote(BaseModel): + r"""> **Bill credit notes or credit notes?** + > + > In Codat, bill credit notes represent accounts payable only. For accounts receivable, see [Credit notes](https://docs.codat.io/sync-for-payables-api#/schemas/CreditNote). + + View the coverage for bill credit notes in the Data coverage explorer. + + ## Overview + + A bill credit note is issued by a supplier for the purpose of recording credit. For example, if a supplier was unable to fulfil an order that was placed by a business, or delivered damaged goods, they would issue a bill credit note. A bill credit note reduces the amount a business owes to the supplier. It can be refunded to the business or used to pay off future bills. + + In the Codat API, a bill credit note is an accounts payable record issued by a [supplier](https://docs.codat.io/sync-for-payables-api#/schemas/Supplier). + + A bill credit note includes details of: + * The original and remaining credit. + * Any allocations of the credit against other records, such as [bills](https://docs.codat.io/sync-for-payables-api#/schemas/Bill). + * The supplier that issued the bill credit note. + """ + + discount_percentage: Annotated[ + Annotated[ + Decimal, + BeforeValidator(validate_decimal), + PlainSerializer(serialize_decimal(False)), + ], + pydantic.Field(alias="discountPercentage"), + ] + r"""Percentage rate of any discount applied to the bill credit note.""" + + status: BillCreditNoteStatus + r"""Current state of the bill credit note""" + + sub_total: Annotated[ + Annotated[ + Decimal, + BeforeValidator(validate_decimal), + PlainSerializer(serialize_decimal(False)), + ], + pydantic.Field(alias="subTotal"), + ] + r"""Total amount of the bill credit note, including discounts but excluding tax.""" + + total_amount: Annotated[ + Annotated[ + Decimal, + BeforeValidator(validate_decimal), + PlainSerializer(serialize_decimal(False)), + ], + pydantic.Field(alias="totalAmount"), + ] + r"""Total amount of credit that has been applied to the business' account with the supplier, including discounts and tax.""" + + total_discount: Annotated[ + Annotated[ + Decimal, + BeforeValidator(validate_decimal), + PlainSerializer(serialize_decimal(False)), + ], + pydantic.Field(alias="totalDiscount"), + ] + r"""Total value of any discounts applied.""" + + total_tax_amount: Annotated[ + Annotated[ + Decimal, + BeforeValidator(validate_decimal), + PlainSerializer(serialize_decimal(False)), + ], + pydantic.Field(alias="totalTaxAmount"), + ] + r"""Amount of tax included in the bill credit note.""" + + allocated_on_date: Annotated[ + Optional[str], pydantic.Field(alias="allocatedOnDate") + ] = 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: + + ``` + 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. + """ + + bill_credit_note_number: Annotated[ + OptionalNullable[str], pydantic.Field(alias="billCreditNoteNumber") + ] = UNSET + r"""Friendly reference for the bill credit note.""" + + created_from_refs: Annotated[ + OptionalNullable[List[UpdateBillCreditNoteResponseRecordReference]], + pydantic.Field(alias="createdFromRefs"), + ] = UNSET + r"""An array of records the credit note was created from.""" + + currency: Optional[str] = None + r"""The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + + ## Unknown currencies + + In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + + There are only a very small number of edge cases where this currency code is returned by the Codat system. + """ + + currency_rate: Annotated[ + Annotated[ + OptionalNullable[Decimal], + BeforeValidator(validate_decimal), + PlainSerializer(serialize_decimal(False)), + ], + pydantic.Field(alias="currencyRate"), + ] = UNSET + r"""Rate to convert the total amount of the payment into the base currency for the company at the time of the payment. + + Currency rates in Codat are implemented as the multiple of foreign currency units to each base currency unit. + + It is not possible to perform the currency conversion with two or more non-base currencies participating in the transaction. For example, if a company's base currency is USD, and it has a bill issued in EUR, then the bill payment must happen in USD or EUR. + + Where the currency rate is provided by the underlying accounting software, it will be available from Codat with the same precision (up to a maximum of 9 decimal places). + + For accounting software which do not provide an explicit currency rate, it is calculated as `baseCurrency / foreignCurrency` and will be returned to 9 decimal places. + + ## Examples with base currency of GBP + + | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (GBP) | + | :--------------- | :------------- | :------------ | :------------------------- | + | **USD** | $20 | 0.781 | £15.62 | + | **EUR** | €20 | 0.885 | £17.70 | + | **RUB** | ₽20 | 0.011 | £0.22 | + + ## Examples with base currency of USD + + | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (USD) | + | :--------------- | :------------- | :------------ | :------------------------- | + | **GBP** | £20 | 1.277 | $25.54 | + | **EUR** | €20 | 1.134 | $22.68 | + | **RUB** | ₽20 | 0.015 | $0.30 | + + + ### Integration-specific details + + | Integration | Scenario | System behavior | + |-------------------|-------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------| + | QuickBooks Online | Transaction currency differs from base currency | If currency rate value is left `null`, a rate of 1 will be used by QBO by default. To override this, specify a currencyRate in the request body. | + """ + + id: Optional[str] = None + r"""Identifier for the bill credit note that is unique to a company in the accounting software.""" + + issue_date: Annotated[Optional[str], pydantic.Field(alias="issueDate")] = 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: + + ``` + 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. + """ + + line_items: Annotated[ + OptionalNullable[List[BillCreditNoteLineItem]], + pydantic.Field(alias="lineItems"), + ] = UNSET + r"""An array of line""" + + metadata: Optional[Metadata] = None + + modified_date: Annotated[Optional[str], pydantic.Field(alias="modifiedDate")] = None + + note: OptionalNullable[str] = UNSET + r"""Any additional information about the bill credit note.""" + + payment_allocations: Annotated[ + OptionalNullable[List[Items]], pydantic.Field(alias="paymentAllocations") + ] = UNSET + r"""An array of payment allocations.""" + + remaining_credit: Annotated[ + Annotated[ + Optional[Decimal], + BeforeValidator(validate_decimal), + PlainSerializer(serialize_decimal(False)), + ], + pydantic.Field(alias="remainingCredit"), + ] = None + r"""Amount of the bill credit note that is still outstanding.""" + + source_modified_date: Annotated[ + Optional[str], pydantic.Field(alias="sourceModifiedDate") + ] = None + + supplemental_data: Annotated[ + Optional[SupplementalData], pydantic.Field(alias="supplementalData") + ] = None + r"""Supplemental data is additional data you can include in our standard data types. + + It is referenced as a configured dynamic key value pair that is unique to the accounting software. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. + """ + + supplier_ref: Annotated[ + Optional[SupplierRef], pydantic.Field(alias="supplierRef") + ] = None + r"""Reference to the supplier the record relates to.""" + + withholding_tax: Annotated[ + OptionalNullable[List[WithholdingTaxItems]], + pydantic.Field(alias="withholdingTax"), + ] = UNSET + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = [ + "allocatedOnDate", + "billCreditNoteNumber", + "createdFromRefs", + "currency", + "currencyRate", + "id", + "issueDate", + "lineItems", + "metadata", + "modifiedDate", + "note", + "paymentAllocations", + "remainingCredit", + "sourceModifiedDate", + "supplementalData", + "supplierRef", + "withholdingTax", + ] + nullable_fields = [ + "billCreditNoteNumber", + "createdFromRefs", + "currencyRate", + "lineItems", + "note", + "paymentAllocations", + "withholdingTax", + ] + null_default_fields = [] + + serialized = handler(self) + + m = {} + + for n, f in self.model_fields.items(): + k = f.alias or n + val = serialized.get(k) + serialized.pop(k, None) + + optional_nullable = k in optional_fields and k in nullable_fields + is_set = ( + self.__pydantic_fields_set__.intersection({n}) + or k in null_default_fields + ) # pylint: disable=no-member + + if val is not None and val != UNSET_SENTINEL: + m[k] = val + elif val != UNSET_SENTINEL and ( + not k in optional_fields or (optional_nullable and is_set) + ): + m[k] = val + + return m + + +class UpdateBillCreditNoteResponseTypedDict(TypedDict): + company_id: str + r"""Unique identifier for your SMB in Codat.""" + data_connection_key: str + r"""Unique identifier for a company's data connection.""" + push_operation_key: str + r"""A unique identifier generated by Codat to represent this single push operation. This identifier can be used to track the status of the push, and should be persisted.""" + requested_on_utc: 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: + + ``` + 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. + """ + status: PushOperationStatus + r"""The current status of the push operation.""" + status_code: int + r"""Push status code.""" + changes: NotRequired[Nullable[List[PushOperationChangeTypedDict]]] + r"""Contains a single entry that communicates which record has changed and the manner in which it changed.""" + completed_on_utc: 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: + + ``` + 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. + """ + data: NotRequired[ + Nullable[UpdateBillCreditNoteResponseAccountingBillCreditNoteTypedDict] + ] + data_type: NotRequired[DataType] + r"""Available data types""" + error_message: NotRequired[Nullable[str]] + r"""A message about the error.""" + timeout_in_minutes: NotRequired[Nullable[int]] + r"""Number of minutes the push operation must complete within before it times out.""" + timeout_in_seconds: NotRequired[Nullable[int]] + r"""Number of seconds the push operation must complete within before it times out.""" + validation: NotRequired[ValidationTypedDict] + r"""A human-readable object describing validation decisions Codat has made when pushing data into the platform. If a push has failed because of validation errors, they will be detailed here.""" + + +class UpdateBillCreditNoteResponse(BaseModel): + company_id: Annotated[str, pydantic.Field(alias="companyId")] + r"""Unique identifier for your SMB in Codat.""" + + data_connection_key: Annotated[str, pydantic.Field(alias="dataConnectionKey")] + r"""Unique identifier for a company's data connection.""" + + push_operation_key: Annotated[str, pydantic.Field(alias="pushOperationKey")] + r"""A unique identifier generated by Codat to represent this single push operation. This identifier can be used to track the status of the push, and should be persisted.""" + + requested_on_utc: Annotated[str, pydantic.Field(alias="requestedOnUtc")] + 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: + + ``` + 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. + """ + + status: PushOperationStatus + r"""The current status of the push operation.""" + + status_code: Annotated[int, pydantic.Field(alias="statusCode")] + r"""Push status code.""" + + changes: OptionalNullable[List[PushOperationChange]] = UNSET + r"""Contains a single entry that communicates which record has changed and the manner in which it changed.""" + + completed_on_utc: Annotated[ + Optional[str], pydantic.Field(alias="completedOnUtc") + ] = 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: + + ``` + 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. + """ + + data: OptionalNullable[UpdateBillCreditNoteResponseAccountingBillCreditNote] = UNSET + + data_type: Annotated[Optional[DataType], pydantic.Field(alias="dataType")] = None + r"""Available data types""" + + error_message: Annotated[ + OptionalNullable[str], pydantic.Field(alias="errorMessage") + ] = UNSET + r"""A message about the error.""" + + timeout_in_minutes: Annotated[ + OptionalNullable[int], pydantic.Field(alias="timeoutInMinutes") + ] = UNSET + r"""Number of minutes the push operation must complete within before it times out.""" + + timeout_in_seconds: Annotated[ + OptionalNullable[int], + pydantic.Field( + deprecated="warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible.", + alias="timeoutInSeconds", + ), + ] = UNSET + r"""Number of seconds the push operation must complete within before it times out.""" + + validation: Optional[Validation] = None + r"""A human-readable object describing validation decisions Codat has made when pushing data into the platform. If a push has failed because of validation errors, they will be detailed here.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = [ + "changes", + "completedOnUtc", + "data", + "dataType", + "errorMessage", + "timeoutInMinutes", + "timeoutInSeconds", + "validation", + ] + nullable_fields = [ + "changes", + "data", + "errorMessage", + "timeoutInMinutes", + "timeoutInSeconds", + ] + null_default_fields = [] + + serialized = handler(self) + + m = {} + + for n, f in self.model_fields.items(): + k = f.alias or n + val = serialized.get(k) + serialized.pop(k, None) + + optional_nullable = k in optional_fields and k in nullable_fields + is_set = ( + self.__pydantic_fields_set__.intersection({n}) + or k in null_default_fields + ) # pylint: disable=no-member + + if val is not None and val != UNSET_SENTINEL: + m[k] = val + elif val != UNSET_SENTINEL and ( + not k in optional_fields or (optional_nullable and is_set) + ): + m[k] = val + + return m diff --git a/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/updatebillresponse.py b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/updatebillresponse.py new file mode 100644 index 000000000..81eb02dac --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/updatebillresponse.py @@ -0,0 +1,843 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .billlineitem import BillLineItem, BillLineItemTypedDict +from .billstatus import BillStatus +from .datatype import DataType +from .metadata import Metadata, MetadataTypedDict +from .paymentallocationpayment import ( + PaymentAllocationPayment, + PaymentAllocationPaymentTypedDict, +) +from .pushoperationchange import PushOperationChange, PushOperationChangeTypedDict +from .pushoperationstatus import PushOperationStatus +from .supplementaldata import SupplementalData, SupplementalDataTypedDict +from .supplierref import SupplierRef, SupplierRefTypedDict +from .validation import Validation, ValidationTypedDict +from codat_sync_for_payables_version_1.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from codat_sync_for_payables_version_1.utils import serialize_decimal, validate_decimal +from decimal import Decimal +import pydantic +from pydantic import model_serializer +from pydantic.functional_serializers import PlainSerializer +from pydantic.functional_validators import BeforeValidator +from typing import List, Optional +from typing_extensions import Annotated, NotRequired, TypedDict, deprecated + + +class UpdateBillResponseAllocationTypedDict(TypedDict): + allocated_on_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: + + ``` + 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. + """ + currency: NotRequired[str] + r"""The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + + ## Unknown currencies + + In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + + There are only a very small number of edge cases where this currency code is returned by the Codat system. + """ + currency_rate: NotRequired[Nullable[Decimal]] + r"""Rate to convert the total amount of the payment into the base currency for the company at the time of the payment. + + Currency rates in Codat are implemented as the multiple of foreign currency units to each base currency unit. + + It is not possible to perform the currency conversion with two or more non-base currencies participating in the transaction. For example, if a company's base currency is USD, and it has a bill issued in EUR, then the bill payment must happen in USD or EUR. + + Where the currency rate is provided by the underlying accounting software, it will be available from Codat with the same precision (up to a maximum of 9 decimal places). + + For accounting software which do not provide an explicit currency rate, it is calculated as `baseCurrency / foreignCurrency` and will be returned to 9 decimal places. + + ## Examples with base currency of GBP + + | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (GBP) | + | :--------------- | :------------- | :------------ | :------------------------- | + | **USD** | $20 | 0.781 | £15.62 | + | **EUR** | €20 | 0.885 | £17.70 | + | **RUB** | ₽20 | 0.011 | £0.22 | + + ## Examples with base currency of USD + + | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (USD) | + | :--------------- | :------------- | :------------ | :------------------------- | + | **GBP** | £20 | 1.277 | $25.54 | + | **EUR** | €20 | 1.134 | $22.68 | + | **RUB** | ₽20 | 0.015 | $0.30 | + + + ### Integration-specific details + + | Integration | Scenario | System behavior | + |-------------------|-------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------| + | QuickBooks Online | Transaction currency differs from base currency | If currency rate value is left `null`, a rate of 1 will be used by QBO by default. To override this, specify a currencyRate in the request body. | + """ + total_amount: NotRequired[Decimal] + r"""The total amount that has been allocated.""" + + +class UpdateBillResponseAllocation(BaseModel): + allocated_on_date: Annotated[ + Optional[str], pydantic.Field(alias="allocatedOnDate") + ] = 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: + + ``` + 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. + """ + + currency: Optional[str] = None + r"""The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + + ## Unknown currencies + + In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + + There are only a very small number of edge cases where this currency code is returned by the Codat system. + """ + + currency_rate: Annotated[ + Annotated[ + OptionalNullable[Decimal], + BeforeValidator(validate_decimal), + PlainSerializer(serialize_decimal(False)), + ], + pydantic.Field(alias="currencyRate"), + ] = UNSET + r"""Rate to convert the total amount of the payment into the base currency for the company at the time of the payment. + + Currency rates in Codat are implemented as the multiple of foreign currency units to each base currency unit. + + It is not possible to perform the currency conversion with two or more non-base currencies participating in the transaction. For example, if a company's base currency is USD, and it has a bill issued in EUR, then the bill payment must happen in USD or EUR. + + Where the currency rate is provided by the underlying accounting software, it will be available from Codat with the same precision (up to a maximum of 9 decimal places). + + For accounting software which do not provide an explicit currency rate, it is calculated as `baseCurrency / foreignCurrency` and will be returned to 9 decimal places. + + ## Examples with base currency of GBP + + | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (GBP) | + | :--------------- | :------------- | :------------ | :------------------------- | + | **USD** | $20 | 0.781 | £15.62 | + | **EUR** | €20 | 0.885 | £17.70 | + | **RUB** | ₽20 | 0.011 | £0.22 | + + ## Examples with base currency of USD + + | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (USD) | + | :--------------- | :------------- | :------------ | :------------------------- | + | **GBP** | £20 | 1.277 | $25.54 | + | **EUR** | €20 | 1.134 | $22.68 | + | **RUB** | ₽20 | 0.015 | $0.30 | + + + ### Integration-specific details + + | Integration | Scenario | System behavior | + |-------------------|-------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------| + | QuickBooks Online | Transaction currency differs from base currency | If currency rate value is left `null`, a rate of 1 will be used by QBO by default. To override this, specify a currencyRate in the request body. | + """ + + total_amount: Annotated[ + Annotated[ + Optional[Decimal], + BeforeValidator(validate_decimal), + PlainSerializer(serialize_decimal(False)), + ], + pydantic.Field(alias="totalAmount"), + ] = None + r"""The total amount that has been allocated.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = ["allocatedOnDate", "currency", "currencyRate", "totalAmount"] + nullable_fields = ["currencyRate"] + null_default_fields = [] + + serialized = handler(self) + + m = {} + + for n, f in self.model_fields.items(): + k = f.alias or n + val = serialized.get(k) + serialized.pop(k, None) + + optional_nullable = k in optional_fields and k in nullable_fields + is_set = ( + self.__pydantic_fields_set__.intersection({n}) + or k in null_default_fields + ) # pylint: disable=no-member + + if val is not None and val != UNSET_SENTINEL: + m[k] = val + elif val != UNSET_SENTINEL and ( + not k in optional_fields or (optional_nullable and is_set) + ): + m[k] = val + + return m + + +class UpdateBillResponseAccountingPaymentAllocationTypedDict(TypedDict): + allocation: UpdateBillResponseAllocationTypedDict + payment: PaymentAllocationPaymentTypedDict + + +class UpdateBillResponseAccountingPaymentAllocation(BaseModel): + allocation: UpdateBillResponseAllocation + + payment: PaymentAllocationPayment + + +class UpdateBillResponsePurchaseOrderReferenceTypedDict(TypedDict): + id: NotRequired[str] + r"""Identifier for the purchase order, unique for the company in the accounting software.""" + purchase_order_number: NotRequired[Nullable[str]] + r"""Friendly reference for the purchase order, commonly generated by the accounting software.""" + + +class UpdateBillResponsePurchaseOrderReference(BaseModel): + id: Optional[str] = None + r"""Identifier for the purchase order, unique for the company in the accounting software.""" + + purchase_order_number: Annotated[ + OptionalNullable[str], pydantic.Field(alias="purchaseOrderNumber") + ] = UNSET + r"""Friendly reference for the purchase order, commonly generated by the accounting software.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = ["id", "purchaseOrderNumber"] + nullable_fields = ["purchaseOrderNumber"] + null_default_fields = [] + + serialized = handler(self) + + m = {} + + for n, f in self.model_fields.items(): + k = f.alias or n + val = serialized.get(k) + serialized.pop(k, None) + + optional_nullable = k in optional_fields and k in nullable_fields + is_set = ( + self.__pydantic_fields_set__.intersection({n}) + or k in null_default_fields + ) # pylint: disable=no-member + + if val is not None and val != UNSET_SENTINEL: + m[k] = val + elif val != UNSET_SENTINEL and ( + not k in optional_fields or (optional_nullable and is_set) + ): + m[k] = val + + return m + + +class UpdateBillResponseWithholdingTaxTypedDict(TypedDict): + amount: Decimal + r"""Amount of tax withheld.""" + name: str + r"""Name assigned to withheld tax.""" + + +class UpdateBillResponseWithholdingTax(BaseModel): + amount: Annotated[ + Decimal, + BeforeValidator(validate_decimal), + PlainSerializer(serialize_decimal(False)), + ] + r"""Amount of tax withheld.""" + + name: str + r"""Name assigned to withheld tax.""" + + +@deprecated( + "warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible." +) +class UpdateBillResponseAccountingBillTypedDict(TypedDict): + r"""> **Invoices or bills?** + > + > We distinguish between invoices where the company *owes money* vs. *is owed money*. If the company has received an invoice, and owes money to someone else (accounts payable) we call this a Bill. + > + > See [Invoices](https://docs.codat.io/sync-for-payables-api#/schemas/Invoice) for the accounts receivable equivalent of bills. + + View the coverage for bills in the Data coverage explorer. + + ## Overview + + In Codat, a bill contains details of: + * When the bill was recorded in the accounting system. + * How much the bill is for and the currency of the amount. + * Who the bill was received from — the *supplier*. + * What the bill is for — the *line items*. + + Some accounting software give a separate name to purchases where the payment is made immediately, such as something bought with a credit card or online payment. One example of this would be QuickBooks Online's *expenses*. + + You can find these types of transactions in our [Direct costs](https://docs.codat.io/sync-for-payables-api#/schemas/DirectCost) data model. + """ + + issue_date: str + status: BillStatus + r"""Current state of the bill.""" + sub_total: Decimal + r"""Total amount of the bill, excluding any taxes.""" + tax_amount: Decimal + r"""Amount of tax on the bill.""" + total_amount: Decimal + r"""Amount of the bill, including tax.""" + amount_due: NotRequired[Nullable[Decimal]] + r"""Amount outstanding on the bill.""" + currency: NotRequired[str] + r"""The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + + ## Unknown currencies + + In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + + There are only a very small number of edge cases where this currency code is returned by the Codat system. + """ + currency_rate: NotRequired[Nullable[Decimal]] + r"""Rate to convert the total amount of the payment into the base currency for the company at the time of the payment. + + Currency rates in Codat are implemented as the multiple of foreign currency units to each base currency unit. + + It is not possible to perform the currency conversion with two or more non-base currencies participating in the transaction. For example, if a company's base currency is USD, and it has a bill issued in EUR, then the bill payment must happen in USD or EUR. + + Where the currency rate is provided by the underlying accounting software, it will be available from Codat with the same precision (up to a maximum of 9 decimal places). + + For accounting software which do not provide an explicit currency rate, it is calculated as `baseCurrency / foreignCurrency` and will be returned to 9 decimal places. + + ## Examples with base currency of GBP + + | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (GBP) | + | :--------------- | :------------- | :------------ | :------------------------- | + | **USD** | $20 | 0.781 | £15.62 | + | **EUR** | €20 | 0.885 | £17.70 | + | **RUB** | ₽20 | 0.011 | £0.22 | + + ## Examples with base currency of USD + + | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (USD) | + | :--------------- | :------------- | :------------ | :------------------------- | + | **GBP** | £20 | 1.277 | $25.54 | + | **EUR** | €20 | 1.134 | $22.68 | + | **RUB** | ₽20 | 0.015 | $0.30 | + + + ### Integration-specific details + + | Integration | Scenario | System behavior | + |-------------------|-------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------| + | QuickBooks Online | Transaction currency differs from base currency | If currency rate value is left `null`, a rate of 1 will be used by QBO by default. To override this, specify a currencyRate in the request body. | + """ + due_date: NotRequired[str] + id: NotRequired[str] + r"""Identifier for the bill, unique for the company in the accounting software.""" + line_items: NotRequired[Nullable[List[BillLineItemTypedDict]]] + r"""Array of Bill line items.""" + metadata: NotRequired[MetadataTypedDict] + modified_date: NotRequired[str] + note: NotRequired[Nullable[str]] + r"""Any private, company notes about the bill, such as payment information.""" + payment_allocations: NotRequired[ + Nullable[List[UpdateBillResponseAccountingPaymentAllocationTypedDict]] + ] + r"""An array of payment allocations.""" + purchase_order_refs: NotRequired[ + Nullable[List[UpdateBillResponsePurchaseOrderReferenceTypedDict]] + ] + reference: NotRequired[Nullable[str]] + r"""User-friendly reference for the bill.""" + source_modified_date: NotRequired[str] + supplemental_data: NotRequired[SupplementalDataTypedDict] + r"""Supplemental data is additional data you can include in our standard data types. + + It is referenced as a configured dynamic key value pair that is unique to the accounting software. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. + """ + supplier_ref: NotRequired[SupplierRefTypedDict] + r"""Reference to the supplier the record relates to.""" + withholding_tax: NotRequired[ + Nullable[List[UpdateBillResponseWithholdingTaxTypedDict]] + ] + + +@deprecated( + "warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible." +) +class UpdateBillResponseAccountingBill(BaseModel): + r"""> **Invoices or bills?** + > + > We distinguish between invoices where the company *owes money* vs. *is owed money*. If the company has received an invoice, and owes money to someone else (accounts payable) we call this a Bill. + > + > See [Invoices](https://docs.codat.io/sync-for-payables-api#/schemas/Invoice) for the accounts receivable equivalent of bills. + + View the coverage for bills in the Data coverage explorer. + + ## Overview + + In Codat, a bill contains details of: + * When the bill was recorded in the accounting system. + * How much the bill is for and the currency of the amount. + * Who the bill was received from — the *supplier*. + * What the bill is for — the *line items*. + + Some accounting software give a separate name to purchases where the payment is made immediately, such as something bought with a credit card or online payment. One example of this would be QuickBooks Online's *expenses*. + + You can find these types of transactions in our [Direct costs](https://docs.codat.io/sync-for-payables-api#/schemas/DirectCost) data model. + """ + + issue_date: Annotated[str, pydantic.Field(alias="issueDate")] + + status: BillStatus + r"""Current state of the bill.""" + + sub_total: Annotated[ + Annotated[ + Decimal, + BeforeValidator(validate_decimal), + PlainSerializer(serialize_decimal(False)), + ], + pydantic.Field(alias="subTotal"), + ] + r"""Total amount of the bill, excluding any taxes.""" + + tax_amount: Annotated[ + Annotated[ + Decimal, + BeforeValidator(validate_decimal), + PlainSerializer(serialize_decimal(False)), + ], + pydantic.Field(alias="taxAmount"), + ] + r"""Amount of tax on the bill.""" + + total_amount: Annotated[ + Annotated[ + Decimal, + BeforeValidator(validate_decimal), + PlainSerializer(serialize_decimal(False)), + ], + pydantic.Field(alias="totalAmount"), + ] + r"""Amount of the bill, including tax.""" + + amount_due: Annotated[ + Annotated[ + OptionalNullable[Decimal], + BeforeValidator(validate_decimal), + PlainSerializer(serialize_decimal(False)), + ], + pydantic.Field(alias="amountDue"), + ] = UNSET + r"""Amount outstanding on the bill.""" + + currency: Optional[str] = None + r"""The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. + + ## Unknown currencies + + In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. + + There are only a very small number of edge cases where this currency code is returned by the Codat system. + """ + + currency_rate: Annotated[ + Annotated[ + OptionalNullable[Decimal], + BeforeValidator(validate_decimal), + PlainSerializer(serialize_decimal(False)), + ], + pydantic.Field(alias="currencyRate"), + ] = UNSET + r"""Rate to convert the total amount of the payment into the base currency for the company at the time of the payment. + + Currency rates in Codat are implemented as the multiple of foreign currency units to each base currency unit. + + It is not possible to perform the currency conversion with two or more non-base currencies participating in the transaction. For example, if a company's base currency is USD, and it has a bill issued in EUR, then the bill payment must happen in USD or EUR. + + Where the currency rate is provided by the underlying accounting software, it will be available from Codat with the same precision (up to a maximum of 9 decimal places). + + For accounting software which do not provide an explicit currency rate, it is calculated as `baseCurrency / foreignCurrency` and will be returned to 9 decimal places. + + ## Examples with base currency of GBP + + | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (GBP) | + | :--------------- | :------------- | :------------ | :------------------------- | + | **USD** | $20 | 0.781 | £15.62 | + | **EUR** | €20 | 0.885 | £17.70 | + | **RUB** | ₽20 | 0.011 | £0.22 | + + ## Examples with base currency of USD + + | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (USD) | + | :--------------- | :------------- | :------------ | :------------------------- | + | **GBP** | £20 | 1.277 | $25.54 | + | **EUR** | €20 | 1.134 | $22.68 | + | **RUB** | ₽20 | 0.015 | $0.30 | + + + ### Integration-specific details + + | Integration | Scenario | System behavior | + |-------------------|-------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------| + | QuickBooks Online | Transaction currency differs from base currency | If currency rate value is left `null`, a rate of 1 will be used by QBO by default. To override this, specify a currencyRate in the request body. | + """ + + due_date: Annotated[Optional[str], pydantic.Field(alias="dueDate")] = None + + id: Optional[str] = None + r"""Identifier for the bill, unique for the company in the accounting software.""" + + line_items: Annotated[ + OptionalNullable[List[BillLineItem]], pydantic.Field(alias="lineItems") + ] = UNSET + r"""Array of Bill line items.""" + + metadata: Optional[Metadata] = None + + modified_date: Annotated[Optional[str], pydantic.Field(alias="modifiedDate")] = None + + note: OptionalNullable[str] = UNSET + r"""Any private, company notes about the bill, such as payment information.""" + + payment_allocations: Annotated[ + OptionalNullable[List[UpdateBillResponseAccountingPaymentAllocation]], + pydantic.Field(alias="paymentAllocations"), + ] = UNSET + r"""An array of payment allocations.""" + + purchase_order_refs: Annotated[ + OptionalNullable[List[UpdateBillResponsePurchaseOrderReference]], + pydantic.Field(alias="purchaseOrderRefs"), + ] = UNSET + + reference: OptionalNullable[str] = UNSET + r"""User-friendly reference for the bill.""" + + source_modified_date: Annotated[ + Optional[str], pydantic.Field(alias="sourceModifiedDate") + ] = None + + supplemental_data: Annotated[ + Optional[SupplementalData], pydantic.Field(alias="supplementalData") + ] = None + r"""Supplemental data is additional data you can include in our standard data types. + + It is referenced as a configured dynamic key value pair that is unique to the accounting software. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. + """ + + supplier_ref: Annotated[ + Optional[SupplierRef], pydantic.Field(alias="supplierRef") + ] = None + r"""Reference to the supplier the record relates to.""" + + withholding_tax: Annotated[ + OptionalNullable[List[UpdateBillResponseWithholdingTax]], + pydantic.Field(alias="withholdingTax"), + ] = UNSET + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = [ + "amountDue", + "currency", + "currencyRate", + "dueDate", + "id", + "lineItems", + "metadata", + "modifiedDate", + "note", + "paymentAllocations", + "purchaseOrderRefs", + "reference", + "sourceModifiedDate", + "supplementalData", + "supplierRef", + "withholdingTax", + ] + nullable_fields = [ + "amountDue", + "currencyRate", + "lineItems", + "note", + "paymentAllocations", + "purchaseOrderRefs", + "reference", + "withholdingTax", + ] + null_default_fields = [] + + serialized = handler(self) + + m = {} + + for n, f in self.model_fields.items(): + k = f.alias or n + val = serialized.get(k) + serialized.pop(k, None) + + optional_nullable = k in optional_fields and k in nullable_fields + is_set = ( + self.__pydantic_fields_set__.intersection({n}) + or k in null_default_fields + ) # pylint: disable=no-member + + if val is not None and val != UNSET_SENTINEL: + m[k] = val + elif val != UNSET_SENTINEL and ( + not k in optional_fields or (optional_nullable and is_set) + ): + m[k] = val + + return m + + +class UpdateBillResponseTypedDict(TypedDict): + company_id: str + r"""Unique identifier for your SMB in Codat.""" + data_connection_key: str + r"""Unique identifier for a company's data connection.""" + push_operation_key: str + r"""A unique identifier generated by Codat to represent this single push operation. This identifier can be used to track the status of the push, and should be persisted.""" + requested_on_utc: 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: + + ``` + 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. + """ + status: PushOperationStatus + r"""The current status of the push operation.""" + status_code: int + r"""Push status code.""" + changes: NotRequired[Nullable[List[PushOperationChangeTypedDict]]] + r"""Contains a single entry that communicates which record has changed and the manner in which it changed.""" + completed_on_utc: 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: + + ``` + 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. + """ + data: NotRequired[Nullable[UpdateBillResponseAccountingBillTypedDict]] + data_type: NotRequired[DataType] + r"""Available data types""" + error_message: NotRequired[Nullable[str]] + r"""A message about the error.""" + timeout_in_minutes: NotRequired[Nullable[int]] + r"""Number of minutes the push operation must complete within before it times out.""" + timeout_in_seconds: NotRequired[Nullable[int]] + r"""Number of seconds the push operation must complete within before it times out.""" + validation: NotRequired[ValidationTypedDict] + r"""A human-readable object describing validation decisions Codat has made when pushing data into the platform. If a push has failed because of validation errors, they will be detailed here.""" + + +class UpdateBillResponse(BaseModel): + company_id: Annotated[str, pydantic.Field(alias="companyId")] + r"""Unique identifier for your SMB in Codat.""" + + data_connection_key: Annotated[str, pydantic.Field(alias="dataConnectionKey")] + r"""Unique identifier for a company's data connection.""" + + push_operation_key: Annotated[str, pydantic.Field(alias="pushOperationKey")] + r"""A unique identifier generated by Codat to represent this single push operation. This identifier can be used to track the status of the push, and should be persisted.""" + + requested_on_utc: Annotated[str, pydantic.Field(alias="requestedOnUtc")] + 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: + + ``` + 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. + """ + + status: PushOperationStatus + r"""The current status of the push operation.""" + + status_code: Annotated[int, pydantic.Field(alias="statusCode")] + r"""Push status code.""" + + changes: OptionalNullable[List[PushOperationChange]] = UNSET + r"""Contains a single entry that communicates which record has changed and the manner in which it changed.""" + + completed_on_utc: Annotated[ + Optional[str], pydantic.Field(alias="completedOnUtc") + ] = 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: + + ``` + 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. + """ + + data: OptionalNullable[UpdateBillResponseAccountingBill] = UNSET + + data_type: Annotated[Optional[DataType], pydantic.Field(alias="dataType")] = None + r"""Available data types""" + + error_message: Annotated[ + OptionalNullable[str], pydantic.Field(alias="errorMessage") + ] = UNSET + r"""A message about the error.""" + + timeout_in_minutes: Annotated[ + OptionalNullable[int], pydantic.Field(alias="timeoutInMinutes") + ] = UNSET + r"""Number of minutes the push operation must complete within before it times out.""" + + timeout_in_seconds: Annotated[ + OptionalNullable[int], + pydantic.Field( + deprecated="warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible.", + alias="timeoutInSeconds", + ), + ] = UNSET + r"""Number of seconds the push operation must complete within before it times out.""" + + validation: Optional[Validation] = None + r"""A human-readable object describing validation decisions Codat has made when pushing data into the platform. If a push has failed because of validation errors, they will be detailed here.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = [ + "changes", + "completedOnUtc", + "data", + "dataType", + "errorMessage", + "timeoutInMinutes", + "timeoutInSeconds", + "validation", + ] + nullable_fields = [ + "changes", + "data", + "errorMessage", + "timeoutInMinutes", + "timeoutInSeconds", + ] + null_default_fields = [] + + serialized = handler(self) + + m = {} + + for n, f in self.model_fields.items(): + k = f.alias or n + val = serialized.get(k) + serialized.pop(k, None) + + optional_nullable = k in optional_fields and k in nullable_fields + is_set = ( + self.__pydantic_fields_set__.intersection({n}) + or k in null_default_fields + ) # pylint: disable=no-member + + if val is not None and val != UNSET_SENTINEL: + m[k] = val + elif val != UNSET_SENTINEL and ( + not k in optional_fields or (optional_nullable and is_set) + ): + m[k] = val + + return m diff --git a/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/updatesupplierresponse.py b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/updatesupplierresponse.py new file mode 100644 index 000000000..607ff2d2f --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/updatesupplierresponse.py @@ -0,0 +1,392 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .address import Address, AddressTypedDict +from .datatype import DataType +from .metadata import Metadata, MetadataTypedDict +from .pushoperationchange import PushOperationChange, PushOperationChangeTypedDict +from .pushoperationstatus import PushOperationStatus +from .supplementaldata import SupplementalData, SupplementalDataTypedDict +from .supplierstatus import SupplierStatus +from .validation import Validation, ValidationTypedDict +from codat_sync_for_payables_version_1.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +import pydantic +from pydantic import model_serializer +from typing import List, Optional +from typing_extensions import Annotated, NotRequired, TypedDict, deprecated + + +@deprecated( + "warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible." +) +class UpdateSupplierResponseAccountingSupplierTypedDict(TypedDict): + r"""> View the coverage for suppliers in the Data coverage explorer. + + ## Overview + + From the **Suppliers** endpoints, you can retrieve a list of [all the suppliers for a company](https://docs.codat.io/sync-for-payables-api#/operations/list-suppliers). Suppliers' data links to accounts payable [bills](https://docs.codat.io/sync-for-payables-api#/schemas/Bill). + """ + + status: SupplierStatus + r"""Status of the supplier.""" + addresses: NotRequired[Nullable[List[AddressTypedDict]]] + r"""An array of Addresses.""" + contact_name: NotRequired[Nullable[str]] + r"""Name of the main contact for the supplier.""" + default_currency: NotRequired[Nullable[str]] + r"""Default currency the supplier's transactional data is recorded in.""" + email_address: NotRequired[Nullable[str]] + r"""Email address that the supplier may be contacted on.""" + id: NotRequired[str] + r"""Identifier for the supplier, unique to the company in the accounting software.""" + metadata: NotRequired[MetadataTypedDict] + modified_date: NotRequired[str] + phone: NotRequired[Nullable[str]] + r"""Phone number that the supplier may be contacted on.""" + registration_number: NotRequired[Nullable[str]] + r"""Company number of the supplier. In the UK, this is typically the company registration number issued by Companies House.""" + source_modified_date: NotRequired[str] + supplemental_data: NotRequired[SupplementalDataTypedDict] + r"""Supplemental data is additional data you can include in our standard data types. + + It is referenced as a configured dynamic key value pair that is unique to the accounting software. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. + """ + supplier_name: NotRequired[Nullable[str]] + r"""Name of the supplier as recorded in the accounting system, typically the company name.""" + tax_number: NotRequired[Nullable[str]] + r"""Supplier's company tax number.""" + + +@deprecated( + "warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible." +) +class UpdateSupplierResponseAccountingSupplier(BaseModel): + r"""> View the coverage for suppliers in the Data coverage explorer. + + ## Overview + + From the **Suppliers** endpoints, you can retrieve a list of [all the suppliers for a company](https://docs.codat.io/sync-for-payables-api#/operations/list-suppliers). Suppliers' data links to accounts payable [bills](https://docs.codat.io/sync-for-payables-api#/schemas/Bill). + """ + + status: SupplierStatus + r"""Status of the supplier.""" + + addresses: OptionalNullable[List[Address]] = UNSET + r"""An array of Addresses.""" + + contact_name: Annotated[ + OptionalNullable[str], pydantic.Field(alias="contactName") + ] = UNSET + r"""Name of the main contact for the supplier.""" + + default_currency: Annotated[ + OptionalNullable[str], pydantic.Field(alias="defaultCurrency") + ] = UNSET + r"""Default currency the supplier's transactional data is recorded in.""" + + email_address: Annotated[ + OptionalNullable[str], pydantic.Field(alias="emailAddress") + ] = UNSET + r"""Email address that the supplier may be contacted on.""" + + id: Optional[str] = None + r"""Identifier for the supplier, unique to the company in the accounting software.""" + + metadata: Optional[Metadata] = None + + modified_date: Annotated[Optional[str], pydantic.Field(alias="modifiedDate")] = None + + phone: OptionalNullable[str] = UNSET + r"""Phone number that the supplier may be contacted on.""" + + registration_number: Annotated[ + OptionalNullable[str], pydantic.Field(alias="registrationNumber") + ] = UNSET + r"""Company number of the supplier. In the UK, this is typically the company registration number issued by Companies House.""" + + source_modified_date: Annotated[ + Optional[str], pydantic.Field(alias="sourceModifiedDate") + ] = None + + supplemental_data: Annotated[ + Optional[SupplementalData], pydantic.Field(alias="supplementalData") + ] = None + r"""Supplemental data is additional data you can include in our standard data types. + + It is referenced as a configured dynamic key value pair that is unique to the accounting software. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. + """ + + supplier_name: Annotated[ + OptionalNullable[str], pydantic.Field(alias="supplierName") + ] = UNSET + r"""Name of the supplier as recorded in the accounting system, typically the company name.""" + + tax_number: Annotated[OptionalNullable[str], pydantic.Field(alias="taxNumber")] = ( + UNSET + ) + r"""Supplier's company tax number.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = [ + "addresses", + "contactName", + "defaultCurrency", + "emailAddress", + "id", + "metadata", + "modifiedDate", + "phone", + "registrationNumber", + "sourceModifiedDate", + "supplementalData", + "supplierName", + "taxNumber", + ] + nullable_fields = [ + "addresses", + "contactName", + "defaultCurrency", + "emailAddress", + "phone", + "registrationNumber", + "supplierName", + "taxNumber", + ] + null_default_fields = [] + + serialized = handler(self) + + m = {} + + for n, f in self.model_fields.items(): + k = f.alias or n + val = serialized.get(k) + serialized.pop(k, None) + + optional_nullable = k in optional_fields and k in nullable_fields + is_set = ( + self.__pydantic_fields_set__.intersection({n}) + or k in null_default_fields + ) # pylint: disable=no-member + + if val is not None and val != UNSET_SENTINEL: + m[k] = val + elif val != UNSET_SENTINEL and ( + not k in optional_fields or (optional_nullable and is_set) + ): + m[k] = val + + return m + + +class UpdateSupplierResponseTypedDict(TypedDict): + company_id: str + r"""Unique identifier for your SMB in Codat.""" + data_connection_key: str + r"""Unique identifier for a company's data connection.""" + push_operation_key: str + r"""A unique identifier generated by Codat to represent this single push operation. This identifier can be used to track the status of the push, and should be persisted.""" + requested_on_utc: 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: + + ``` + 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. + """ + status: PushOperationStatus + r"""The current status of the push operation.""" + status_code: int + r"""Push status code.""" + changes: NotRequired[Nullable[List[PushOperationChangeTypedDict]]] + r"""Contains a single entry that communicates which record has changed and the manner in which it changed.""" + completed_on_utc: 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: + + ``` + 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. + """ + data: NotRequired[Nullable[UpdateSupplierResponseAccountingSupplierTypedDict]] + data_type: NotRequired[DataType] + r"""Available data types""" + error_message: NotRequired[Nullable[str]] + r"""A message about the error.""" + timeout_in_minutes: NotRequired[Nullable[int]] + r"""Number of minutes the push operation must complete within before it times out.""" + timeout_in_seconds: NotRequired[Nullable[int]] + r"""Number of seconds the push operation must complete within before it times out.""" + validation: NotRequired[ValidationTypedDict] + r"""A human-readable object describing validation decisions Codat has made when pushing data into the platform. If a push has failed because of validation errors, they will be detailed here.""" + + +class UpdateSupplierResponse(BaseModel): + company_id: Annotated[str, pydantic.Field(alias="companyId")] + r"""Unique identifier for your SMB in Codat.""" + + data_connection_key: Annotated[str, pydantic.Field(alias="dataConnectionKey")] + r"""Unique identifier for a company's data connection.""" + + push_operation_key: Annotated[str, pydantic.Field(alias="pushOperationKey")] + r"""A unique identifier generated by Codat to represent this single push operation. This identifier can be used to track the status of the push, and should be persisted.""" + + requested_on_utc: Annotated[str, pydantic.Field(alias="requestedOnUtc")] + 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: + + ``` + 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. + """ + + status: PushOperationStatus + r"""The current status of the push operation.""" + + status_code: Annotated[int, pydantic.Field(alias="statusCode")] + r"""Push status code.""" + + changes: OptionalNullable[List[PushOperationChange]] = UNSET + r"""Contains a single entry that communicates which record has changed and the manner in which it changed.""" + + completed_on_utc: Annotated[ + Optional[str], pydantic.Field(alias="completedOnUtc") + ] = 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: + + ``` + 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. + """ + + data: OptionalNullable[UpdateSupplierResponseAccountingSupplier] = UNSET + + data_type: Annotated[Optional[DataType], pydantic.Field(alias="dataType")] = None + r"""Available data types""" + + error_message: Annotated[ + OptionalNullable[str], pydantic.Field(alias="errorMessage") + ] = UNSET + r"""A message about the error.""" + + timeout_in_minutes: Annotated[ + OptionalNullable[int], pydantic.Field(alias="timeoutInMinutes") + ] = UNSET + r"""Number of minutes the push operation must complete within before it times out.""" + + timeout_in_seconds: Annotated[ + OptionalNullable[int], + pydantic.Field( + deprecated="warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible.", + alias="timeoutInSeconds", + ), + ] = UNSET + r"""Number of seconds the push operation must complete within before it times out.""" + + validation: Optional[Validation] = None + r"""A human-readable object describing validation decisions Codat has made when pushing data into the platform. If a push has failed because of validation errors, they will be detailed here.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = [ + "changes", + "completedOnUtc", + "data", + "dataType", + "errorMessage", + "timeoutInMinutes", + "timeoutInSeconds", + "validation", + ] + nullable_fields = [ + "changes", + "data", + "errorMessage", + "timeoutInMinutes", + "timeoutInSeconds", + ] + null_default_fields = [] + + serialized = handler(self) + + m = {} + + for n, f in self.model_fields.items(): + k = f.alias or n + val = serialized.get(k) + serialized.pop(k, None) + + optional_nullable = k in optional_fields and k in nullable_fields + is_set = ( + self.__pydantic_fields_set__.intersection({n}) + or k in null_default_fields + ) # pylint: disable=no-member + + if val is not None and val != UNSET_SENTINEL: + m[k] = val + elif val != UNSET_SENTINEL and ( + not k in optional_fields or (optional_nullable and is_set) + ): + m[k] = val + + return m diff --git a/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/validation.py b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/validation.py new file mode 100644 index 000000000..491c540f3 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/validation.py @@ -0,0 +1,59 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .validationitem import ValidationItem, ValidationItemTypedDict +from codat_sync_for_payables_version_1.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from pydantic import model_serializer +from typing import List +from typing_extensions import NotRequired, TypedDict + + +class ValidationTypedDict(TypedDict): + r"""A human-readable object describing validation decisions Codat has made when pushing data into the platform. If a push has failed because of validation errors, they will be detailed here.""" + + errors: NotRequired[Nullable[List[ValidationItemTypedDict]]] + warnings: NotRequired[Nullable[List[ValidationItemTypedDict]]] + + +class Validation(BaseModel): + r"""A human-readable object describing validation decisions Codat has made when pushing data into the platform. If a push has failed because of validation errors, they will be detailed here.""" + + errors: OptionalNullable[List[ValidationItem]] = UNSET + + warnings: OptionalNullable[List[ValidationItem]] = UNSET + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = ["errors", "warnings"] + nullable_fields = ["errors", "warnings"] + null_default_fields = [] + + serialized = handler(self) + + m = {} + + for n, f in self.model_fields.items(): + k = f.alias or n + val = serialized.get(k) + serialized.pop(k, None) + + optional_nullable = k in optional_fields and k in nullable_fields + is_set = ( + self.__pydantic_fields_set__.intersection({n}) + or k in null_default_fields + ) # pylint: disable=no-member + + if val is not None and val != UNSET_SENTINEL: + m[k] = val + elif val != UNSET_SENTINEL and ( + not k in optional_fields or (optional_nullable and is_set) + ): + m[k] = val + + return m diff --git a/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/validationitem.py b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/validationitem.py new file mode 100644 index 000000000..bd9a0b679 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/validationitem.py @@ -0,0 +1,65 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from codat_sync_for_payables_version_1.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +import pydantic +from pydantic import model_serializer +from typing_extensions import Annotated, NotRequired, TypedDict + + +class ValidationItemTypedDict(TypedDict): + item_id: NotRequired[Nullable[str]] + r"""Unique identifier for a validation item.""" + message: NotRequired[Nullable[str]] + r"""A message outlining validation item's issue.""" + validator_name: NotRequired[Nullable[str]] + r"""Name of validator.""" + + +class ValidationItem(BaseModel): + item_id: Annotated[OptionalNullable[str], pydantic.Field(alias="itemId")] = UNSET + r"""Unique identifier for a validation item.""" + + message: OptionalNullable[str] = UNSET + r"""A message outlining validation item's issue.""" + + validator_name: Annotated[ + OptionalNullable[str], pydantic.Field(alias="validatorName") + ] = UNSET + r"""Name of validator.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = ["itemId", "message", "validatorName"] + nullable_fields = ["itemId", "message", "validatorName"] + null_default_fields = [] + + serialized = handler(self) + + m = {} + + for n, f in self.model_fields.items(): + k = f.alias or n + val = serialized.get(k) + serialized.pop(k, None) + + optional_nullable = k in optional_fields and k in nullable_fields + is_set = ( + self.__pydantic_fields_set__.intersection({n}) + or k in null_default_fields + ) # pylint: disable=no-member + + if val is not None and val != UNSET_SENTINEL: + m[k] = val + elif val != UNSET_SENTINEL and ( + not k in optional_fields or (optional_nullable and is_set) + ): + m[k] = val + + return m diff --git a/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/validdatatypelink_items.py b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/validdatatypelink_items.py new file mode 100644 index 000000000..e26968c1c --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/validdatatypelink_items.py @@ -0,0 +1,142 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from codat_sync_for_payables_version_1.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from pydantic import model_serializer +from typing import List +from typing_extensions import NotRequired, TypedDict + + +class ValidDatatypeLinkItemsTypedDict(TypedDict): + r"""When querying Codat's data model, some data types return `validDatatypeLinks` metadata in the JSON response. This indicates where that object can be used as a reference—a _valid link_—when creating or updating other data. + + For example, `validDatatypeLinks` might indicate the following references: + + - Which tax rates are valid to use on the line item of a bill. + - Which items can be used when creating an invoice. + + You can use `validDatatypeLinks` to present your SMB customers with only valid choices when selecting objects from a list, for example. + + ## `validDatatypeLinks` example + + The following example uses the `Accounting.Accounts` data type. It shows that, on the linked integration, this account is valid as the account on a payment or bill payment; and as the account referenced on the line item of a direct income or direct cost. Because there is no valid link to Invoices or Bills, using this account on those data types will result in an error. + + ```json validDatatypeLinks for an account + { + \"id\": \"bd9e85e0-0478-433d-ae9f-0b3c4f04bfe4\", + \"nominalCode\": \"090\", + \"name\": \"Business Bank Account\", + #... + \"validDatatypeLinks\": [ + { + \"property\": \"Id\", + \"links\": [ + \"Payment.AccountRef.Id\", + \"BillPayment.AccountRef.Id\", + \"DirectIncome.LineItems.AccountRef.Id\", + \"DirectCost.LineItems.AccountRef.Id\" + ] + } + ] + } + ``` + + + + ## Support for `validDatatypeLinks` + + Codat currently supports `validDatatypeLinks` for some data types on our Xero, QuickBooks Online, QuickBooks Desktop, Exact (NL), and Sage Business Cloud integrations. + + If you'd like us to extend support to more data types or integrations, suggest or vote for this on our Product Roadmap. + """ + + links: NotRequired[Nullable[List[str]]] + r"""Supported `dataTypes` that the record can be linked to.""" + property: NotRequired[Nullable[str]] + r"""The property from the account that can be linked.""" + + +class ValidDatatypeLinkItems(BaseModel): + r"""When querying Codat's data model, some data types return `validDatatypeLinks` metadata in the JSON response. This indicates where that object can be used as a reference—a _valid link_—when creating or updating other data. + + For example, `validDatatypeLinks` might indicate the following references: + + - Which tax rates are valid to use on the line item of a bill. + - Which items can be used when creating an invoice. + + You can use `validDatatypeLinks` to present your SMB customers with only valid choices when selecting objects from a list, for example. + + ## `validDatatypeLinks` example + + The following example uses the `Accounting.Accounts` data type. It shows that, on the linked integration, this account is valid as the account on a payment or bill payment; and as the account referenced on the line item of a direct income or direct cost. Because there is no valid link to Invoices or Bills, using this account on those data types will result in an error. + + ```json validDatatypeLinks for an account + { + \"id\": \"bd9e85e0-0478-433d-ae9f-0b3c4f04bfe4\", + \"nominalCode\": \"090\", + \"name\": \"Business Bank Account\", + #... + \"validDatatypeLinks\": [ + { + \"property\": \"Id\", + \"links\": [ + \"Payment.AccountRef.Id\", + \"BillPayment.AccountRef.Id\", + \"DirectIncome.LineItems.AccountRef.Id\", + \"DirectCost.LineItems.AccountRef.Id\" + ] + } + ] + } + ``` + + + + ## Support for `validDatatypeLinks` + + Codat currently supports `validDatatypeLinks` for some data types on our Xero, QuickBooks Online, QuickBooks Desktop, Exact (NL), and Sage Business Cloud integrations. + + If you'd like us to extend support to more data types or integrations, suggest or vote for this on our Product Roadmap. + """ + + links: OptionalNullable[List[str]] = UNSET + r"""Supported `dataTypes` that the record can be linked to.""" + + property: OptionalNullable[str] = UNSET + r"""The property from the account that can be linked.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = ["links", "property"] + nullable_fields = ["links", "property"] + null_default_fields = [] + + serialized = handler(self) + + m = {} + + for n, f in self.model_fields.items(): + k = f.alias or n + val = serialized.get(k) + serialized.pop(k, None) + + optional_nullable = k in optional_fields and k in nullable_fields + is_set = ( + self.__pydantic_fields_set__.intersection({n}) + or k in null_default_fields + ) # pylint: disable=no-member + + if val is not None and val != UNSET_SENTINEL: + m[k] = val + elif val != UNSET_SENTINEL and ( + not k in optional_fields or (optional_nullable and is_set) + ): + m[k] = val + + return m diff --git a/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/weblink.py b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/weblink.py new file mode 100644 index 000000000..d11ca39d7 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/weblink.py @@ -0,0 +1,34 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from codat_sync_for_payables_version_1.types import BaseModel +from enum import Enum +from typing import Optional +from typing_extensions import NotRequired, TypedDict + + +class Type(str, Enum): + r"""The type of the weblink.""" + + WEBSITE = "Website" + SOCIAL = "Social" + UNKNOWN = "Unknown" + + +class WebLinkTypedDict(TypedDict): + r"""Weblink associated with the company.""" + + type: NotRequired[Type] + r"""The type of the weblink.""" + url: NotRequired[str] + r"""The full URL for the weblink.""" + + +class WebLink(BaseModel): + r"""Weblink associated with the company.""" + + type: Optional[Type] = None + r"""The type of the weblink.""" + + url: Optional[str] = None + r"""The full URL for the weblink.""" diff --git a/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/withholdingtax_items.py b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/withholdingtax_items.py new file mode 100644 index 000000000..5863b27ba --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/withholdingtax_items.py @@ -0,0 +1,28 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from codat_sync_for_payables_version_1.types import BaseModel +from codat_sync_for_payables_version_1.utils import serialize_decimal, validate_decimal +from decimal import Decimal +from pydantic.functional_serializers import PlainSerializer +from pydantic.functional_validators import BeforeValidator +from typing_extensions import Annotated, TypedDict + + +class WithholdingTaxItemsTypedDict(TypedDict): + amount: Decimal + r"""Amount of tax withheld.""" + name: str + r"""Name assigned to withheld tax.""" + + +class WithholdingTaxItems(BaseModel): + amount: Annotated[ + Decimal, + BeforeValidator(validate_decimal), + PlainSerializer(serialize_decimal(False)), + ] + r"""Amount of tax withheld.""" + + name: str + r"""Name assigned to withheld tax.""" diff --git a/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/zero.py b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/zero.py new file mode 100644 index 000000000..ca9c38811 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/models/shared/zero.py @@ -0,0 +1,47 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from codat_sync_for_payables_version_1.types import BaseModel +from enum import Enum +import pydantic +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class ZeroDataType(str, Enum): + r"""Allowed name of the 'dataType'.""" + + PURCHASE_ORDERS = "purchaseOrders" + BILLS = "bills" + + +class ZeroTypedDict(TypedDict): + r"""Links the current record line to the underlying record line that created it. + + For example, if a bill is generated from a purchase order, this property allows you to connect the bill line item to the purchase order line item in our data model. + """ + + data_type: NotRequired[ZeroDataType] + r"""Allowed name of the 'dataType'.""" + id: NotRequired[str] + r"""'id' of the underlying record.""" + line_number: NotRequired[str] + r"""Line number of the underlying record.""" + + +class Zero(BaseModel): + r"""Links the current record line to the underlying record line that created it. + + For example, if a bill is generated from a purchase order, this property allows you to connect the bill line item to the purchase order line item in our data model. + """ + + data_type: Annotated[Optional[ZeroDataType], pydantic.Field(alias="dataType")] = ( + None + ) + r"""Allowed name of the 'dataType'.""" + + id: Optional[str] = None + r"""'id' of the underlying record.""" + + line_number: Annotated[Optional[str], pydantic.Field(alias="lineNumber")] = None + r"""Line number of the underlying record.""" diff --git a/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/payment_methods.py b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/payment_methods.py new file mode 100644 index 000000000..579fee7ea --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/payment_methods.py @@ -0,0 +1,462 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from .basesdk import BaseSDK +from codat_sync_for_payables_version_1 import utils +from codat_sync_for_payables_version_1._hooks import HookContext +from codat_sync_for_payables_version_1.models import errors, operations, shared +from codat_sync_for_payables_version_1.types import BaseModel, OptionalNullable, UNSET +from typing import Any, Optional, Union, cast + + +class PaymentMethods(BaseSDK): + r"""Get, create, and update Payment methods.""" + + def get( + self, + *, + request: Union[ + operations.GetPaymentMethodRequest, + operations.GetPaymentMethodRequestTypedDict, + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.PaymentMethod]: + r"""Get payment method + + The *Get payment method* endpoint returns a single payment method for a given `paymentMethodId`. + + [Payment methods](https://docs.codat.io/sync-for-payables-api#/schemas/PaymentMethod) are used to pay a Bill. Payment Methods are referenced on [Bill Payments](https://docs.codat.io/sync-for-payables-api#/schemas/BillPayment) and [Payments](https://docs.codat.io/sync-for-payables-api#/schemas/Payment). + + Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=paymentMethods) for integrations that support getting a specific payment method. + + Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/sync-for-payables-api#/operations/refresh-company-data). + + + :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.GetPaymentMethodRequest) + request = cast(operations.GetPaymentMethodRequest, request) + + req = self.build_request( + method="GET", + path="/companies/{companyId}/data/paymentMethods/{paymentMethodId}", + 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-payment-method", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=[ + "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[shared.PaymentMethod]) + if utils.match_response( + http_res, + ["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 get_async( + self, + *, + request: Union[ + operations.GetPaymentMethodRequest, + operations.GetPaymentMethodRequestTypedDict, + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.PaymentMethod]: + r"""Get payment method + + The *Get payment method* endpoint returns a single payment method for a given `paymentMethodId`. + + [Payment methods](https://docs.codat.io/sync-for-payables-api#/schemas/PaymentMethod) are used to pay a Bill. Payment Methods are referenced on [Bill Payments](https://docs.codat.io/sync-for-payables-api#/schemas/BillPayment) and [Payments](https://docs.codat.io/sync-for-payables-api#/schemas/Payment). + + Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=paymentMethods) for integrations that support getting a specific payment method. + + Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/sync-for-payables-api#/operations/refresh-company-data). + + + :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.GetPaymentMethodRequest) + request = cast(operations.GetPaymentMethodRequest, request) + + req = self.build_request_async( + method="GET", + path="/companies/{companyId}/data/paymentMethods/{paymentMethodId}", + 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-payment-method", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=[ + "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[shared.PaymentMethod]) + if utils.match_response( + http_res, + ["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 list( + self, + *, + request: Union[ + operations.ListPaymentMethodsRequest, + operations.ListPaymentMethodsRequestTypedDict, + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.PaymentMethods]: + r"""List payment methods + + The *List payment methods* endpoint returns a list of [payment methods](https://docs.codat.io/sync-for-payables-api#/schemas/PaymentMethod) for a given company's connection. + + [Payment methods](https://docs.codat.io/sync-for-payables-api#/schemas/PaymentMethod) are used to pay a Bill. Payment Methods are referenced on [Bill Payments](https://docs.codat.io/sync-for-payables-api#/schemas/BillPayment) and [Payments](https://docs.codat.io/sync-for-payables-api#/schemas/Payment). + + Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/sync-for-payables-api#/operations/refresh-company-data). + + + :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.ListPaymentMethodsRequest) + request = cast(operations.ListPaymentMethodsRequest, request) + + req = self.build_request( + method="GET", + path="/companies/{companyId}/data/paymentMethods", + 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="list-payment-methods", + 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[shared.PaymentMethods]) + 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 list_async( + self, + *, + request: Union[ + operations.ListPaymentMethodsRequest, + operations.ListPaymentMethodsRequestTypedDict, + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.PaymentMethods]: + r"""List payment methods + + The *List payment methods* endpoint returns a list of [payment methods](https://docs.codat.io/sync-for-payables-api#/schemas/PaymentMethod) for a given company's connection. + + [Payment methods](https://docs.codat.io/sync-for-payables-api#/schemas/PaymentMethod) are used to pay a Bill. Payment Methods are referenced on [Bill Payments](https://docs.codat.io/sync-for-payables-api#/schemas/BillPayment) and [Payments](https://docs.codat.io/sync-for-payables-api#/schemas/Payment). + + Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/sync-for-payables-api#/operations/refresh-company-data). + + + :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.ListPaymentMethodsRequest) + request = cast(operations.ListPaymentMethodsRequest, request) + + req = self.build_request_async( + method="GET", + path="/companies/{companyId}/data/paymentMethods", + 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="list-payment-methods", + 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[shared.PaymentMethods]) + 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, + ) diff --git a/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/push_operations.py b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/push_operations.py new file mode 100644 index 000000000..e97c602c5 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/push_operations.py @@ -0,0 +1,434 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from .basesdk import BaseSDK +from codat_sync_for_payables_version_1 import utils +from codat_sync_for_payables_version_1._hooks import HookContext +from codat_sync_for_payables_version_1.models import errors, operations, shared +from codat_sync_for_payables_version_1.types import BaseModel, OptionalNullable, UNSET +from typing import Any, Optional, Union, cast + + +class PushOperations(BaseSDK): + r"""View historic push operations.""" + + def get( + self, + *, + request: Union[ + operations.GetPushOperationRequest, + operations.GetPushOperationRequestTypedDict, + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.PushOperation]: + r"""Get push operation + + Retrieve push operation. + + :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.GetPushOperationRequest) + request = cast(operations.GetPushOperationRequest, request) + + req = self.build_request( + method="GET", + path="/companies/{companyId}/push/{pushOperationKey}", + 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-push-operation", + 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.PushOperation]) + 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_async( + self, + *, + request: Union[ + operations.GetPushOperationRequest, + operations.GetPushOperationRequestTypedDict, + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.PushOperation]: + r"""Get push operation + + Retrieve push operation. + + :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.GetPushOperationRequest) + request = cast(operations.GetPushOperationRequest, request) + + req = self.build_request_async( + method="GET", + path="/companies/{companyId}/push/{pushOperationKey}", + 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-push-operation", + 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.PushOperation]) + 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, + *, + request: Union[ + operations.ListPushOperationsRequest, + operations.ListPushOperationsRequestTypedDict, + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.PushOperations]: + r"""List push operations + + List push operation records. + + :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.ListPushOperationsRequest) + request = cast(operations.ListPushOperationsRequest, request) + + req = self.build_request( + method="GET", + path="/companies/{companyId}/push", + 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="list-push-operations", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=[ + "400", + "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.PushOperations]) + if utils.match_response( + http_res, + ["400", "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 list_async( + self, + *, + request: Union[ + operations.ListPushOperationsRequest, + operations.ListPushOperationsRequestTypedDict, + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.PushOperations]: + r"""List push operations + + List push operation records. + + :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.ListPushOperationsRequest) + request = cast(operations.ListPushOperationsRequest, request) + + req = self.build_request_async( + method="GET", + path="/companies/{companyId}/push", + 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="list-push-operations", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=[ + "400", + "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.PushOperations]) + if utils.match_response( + http_res, + ["400", "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, + ) diff --git a/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/py.typed b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/py.typed new file mode 100644 index 000000000..3e38f1a92 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/py.typed @@ -0,0 +1 @@ +# Marker file for PEP 561. The package enables type hints. diff --git a/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/sdk.py b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/sdk.py new file mode 100644 index 000000000..a4a6179b7 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/sdk.py @@ -0,0 +1,185 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from .basesdk import BaseSDK +from .httpclient import AsyncHttpClient, HttpClient +from .sdkconfiguration import SDKConfiguration +from .utils.logger import Logger, get_default_logger +from .utils.retries import RetryConfig +from codat_sync_for_payables_version_1 import utils +from codat_sync_for_payables_version_1._hooks import SDKHooks +from codat_sync_for_payables_version_1.accounts import Accounts +from codat_sync_for_payables_version_1.bank_accounts import BankAccounts +from codat_sync_for_payables_version_1.bill_credit_notes import BillCreditNotes +from codat_sync_for_payables_version_1.bill_payments import BillPayments +from codat_sync_for_payables_version_1.bills import Bills +from codat_sync_for_payables_version_1.companies import Companies +from codat_sync_for_payables_version_1.company_info import CompanyInfo +from codat_sync_for_payables_version_1.connections import Connections +from codat_sync_for_payables_version_1.journal_entries import JournalEntries +from codat_sync_for_payables_version_1.journals import Journals +from codat_sync_for_payables_version_1.manage_data import ManageData +from codat_sync_for_payables_version_1.models import shared +from codat_sync_for_payables_version_1.payment_methods import PaymentMethods +from codat_sync_for_payables_version_1.push_operations import PushOperations +from codat_sync_for_payables_version_1.suppliers import Suppliers +from codat_sync_for_payables_version_1.tax_rates import TaxRates +from codat_sync_for_payables_version_1.tracking_categories import TrackingCategories +from codat_sync_for_payables_version_1.types import OptionalNullable, UNSET +import httpx +from typing import Callable, Dict, Optional, Union + + +class CodatSyncPayables(BaseSDK): + r"""Sync for Payables: The API for Sync for Payables. + + Sync for Payables is an API and a set of supporting tools built to help integrate with your customers' accounting software, and keep their supplier information, invoices, and payments in sync. + + [Explore product](https://docs.codat.io/payables/overview) | [See OpenAPI spec](https://github.com/codatio/oas) + + --- + + ## Endpoints + + | Endpoints | Description | + | :- |:- | + | Companies | Create and manage your SMB users' companies. | + | Connections | Create new and manage existing data connections for a company. | + | Accounts | Get, create, and update Accounts. | + | Bank accounts | Get, create, and update Bank accounts. | + | Bills | Get, create, and update Bills. | + | Bill credit notes | Get, create, and update Bill credit notes. | + | Bill payments | Get, create, and update Bill payments. | + | Journals | Get, create, and update Journals. | + | Journal entries | Get, create, and update Journal entries. | + | Payment methods | Get, create, and update Payment methods. | + | Suppliers | Get, create, and update Suppliers. | + | Tax rates | Get, create, and update Tax rates. | + | Tracking categories | Get, create, and update Tracking categories. | + | Company info | View company profile from the source platform. | + | Push operations | View historic push operations. | + | Manage data | Control how data is retrieved from an integration. | + + """ + + companies: Companies + r"""Create and manage your SMB users' companies.""" + connections: Connections + r"""Create new and manage existing data connections for a company.""" + bills: Bills + r"""Get, create, and update Bills.""" + bank_accounts: BankAccounts + r"""Get, create, and update Bank accounts.""" + bill_credit_notes: BillCreditNotes + r"""Get, create, and update Bill credit notes.""" + bill_payments: BillPayments + r"""Get, create, and update Bill payments.""" + accounts: Accounts + r"""Get, create, and update Accounts.""" + journal_entries: JournalEntries + r"""Get, create, and update Journal entries.""" + journals: Journals + r"""Get, create, and update Journals.""" + suppliers: Suppliers + r"""Get, create, and update Suppliers.""" + manage_data: ManageData + r"""Control how data is retrieved from an integration.""" + company_info: CompanyInfo + r"""View company profile from the source platform.""" + payment_methods: PaymentMethods + r"""Get, create, and update Payment methods.""" + tax_rates: TaxRates + r"""Get, create, and update Tax rates.""" + tracking_categories: TrackingCategories + r"""Get, create, and update Tracking categories.""" + push_operations: PushOperations + r"""View historic push operations.""" + + def __init__( + self, + security: Union[shared.Security, Callable[[], shared.Security]], + server_idx: Optional[int] = None, + server_url: Optional[str] = None, + url_params: Optional[Dict[str, str]] = None, + client: Optional[HttpClient] = None, + async_client: Optional[AsyncHttpClient] = None, + retry_config: OptionalNullable[RetryConfig] = UNSET, + timeout_ms: Optional[int] = None, + debug_logger: Optional[Logger] = None, + ) -> None: + r"""Instantiates the SDK configuring it with the provided parameters. + + :param security: The security details required for authentication + :param server_idx: The index of the server to use for all methods + :param server_url: The server URL to use for all methods + :param url_params: Parameters to optionally template the server URL with + :param client: The HTTP client to use for all synchronous methods + :param async_client: The Async HTTP client to use for all asynchronous methods + :param retry_config: The retry configuration to use for all supported methods + :param timeout_ms: Optional request timeout applied to each operation in milliseconds + """ + if client is None: + client = httpx.Client() + + assert issubclass( + type(client), HttpClient + ), "The provided client must implement the HttpClient protocol." + + if async_client is None: + async_client = httpx.AsyncClient() + + if debug_logger is None: + debug_logger = get_default_logger() + + assert issubclass( + type(async_client), AsyncHttpClient + ), "The provided async_client must implement the AsyncHttpClient protocol." + + if server_url is not None: + if url_params is not None: + server_url = utils.template_url(server_url, url_params) + + BaseSDK.__init__( + self, + SDKConfiguration( + client=client, + async_client=async_client, + security=security, + server_url=server_url, + server_idx=server_idx, + retry_config=retry_config, + timeout_ms=timeout_ms, + debug_logger=debug_logger, + ), + ) + + hooks = SDKHooks() + + current_server_url, *_ = self.sdk_configuration.get_server_details() + server_url, self.sdk_configuration.client = hooks.sdk_init( + current_server_url, self.sdk_configuration.client + ) + if current_server_url != server_url: + self.sdk_configuration.server_url = server_url + + # pylint: disable=protected-access + self.sdk_configuration.__dict__["_hooks"] = hooks + + self._init_sdks() + + def _init_sdks(self): + self.companies = Companies(self.sdk_configuration) + self.connections = Connections(self.sdk_configuration) + self.bills = Bills(self.sdk_configuration) + self.bank_accounts = BankAccounts(self.sdk_configuration) + self.bill_credit_notes = BillCreditNotes(self.sdk_configuration) + self.bill_payments = BillPayments(self.sdk_configuration) + self.accounts = Accounts(self.sdk_configuration) + self.journal_entries = JournalEntries(self.sdk_configuration) + self.journals = Journals(self.sdk_configuration) + self.suppliers = Suppliers(self.sdk_configuration) + self.manage_data = ManageData(self.sdk_configuration) + self.company_info = CompanyInfo(self.sdk_configuration) + self.payment_methods = PaymentMethods(self.sdk_configuration) + self.tax_rates = TaxRates(self.sdk_configuration) + self.tracking_categories = TrackingCategories(self.sdk_configuration) + self.push_operations = PushOperations(self.sdk_configuration) diff --git a/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/sdkconfiguration.py b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/sdkconfiguration.py new file mode 100644 index 000000000..71f41c17f --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/sdkconfiguration.py @@ -0,0 +1,50 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from ._hooks import SDKHooks +from .httpclient import AsyncHttpClient, HttpClient +from .utils import Logger, RetryConfig, remove_suffix +from codat_sync_for_payables_version_1.models import shared +from codat_sync_for_payables_version_1.types import OptionalNullable, UNSET +from dataclasses import dataclass +from pydantic import Field +from typing import Callable, Dict, Optional, Tuple, Union + + +SERVERS = [ + "https://api.codat.io", + # Production +] +"""Contains the list of servers available to the SDK""" + + +@dataclass +class SDKConfiguration: + client: HttpClient + async_client: AsyncHttpClient + debug_logger: Logger + security: Optional[Union[shared.Security, Callable[[], shared.Security]]] = None + server_url: Optional[str] = "" + server_idx: Optional[int] = 0 + language: str = "python" + openapi_doc_version: str = "3.0.0" + sdk_version: str = "3.2.1" + gen_version: str = "2.438.15" + user_agent: str = ( + "speakeasy-sdk/python 3.2.1 2.438.15 3.0.0 codat-sync-for-payables-version-1" + ) + retry_config: OptionalNullable[RetryConfig] = Field(default_factory=lambda: UNSET) + timeout_ms: Optional[int] = None + + def __post_init__(self): + self._hooks = SDKHooks() + + def get_server_details(self) -> Tuple[str, Dict[str, str]]: + if self.server_url is not None and self.server_url: + return remove_suffix(self.server_url, "/"), {} + if self.server_idx is None: + self.server_idx = 0 + + return SERVERS[self.server_idx], {} + + def get_hooks(self) -> SDKHooks: + return self._hooks diff --git a/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/suppliers.py b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/suppliers.py new file mode 100644 index 000000000..a6cc0f218 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/suppliers.py @@ -0,0 +1,1160 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from .basesdk import BaseSDK +from codat_sync_for_payables_version_1 import utils +from codat_sync_for_payables_version_1._hooks import HookContext +from codat_sync_for_payables_version_1.models import errors, operations, shared +from codat_sync_for_payables_version_1.types import BaseModel, OptionalNullable, UNSET +from typing import Any, Optional, Union, cast + + +class Suppliers(BaseSDK): + r"""Get, create, and update Suppliers.""" + + def create( + self, + *, + request: Union[ + operations.CreateSupplierRequest, operations.CreateSupplierRequestTypedDict + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.CreateSupplierResponse]: + r"""Create supplier + + The *Create supplier* endpoint creates a new [supplier](https://docs.codat.io/sync-for-payables-api#/schemas/Supplier) for a given company's connection. + + [Suppliers](https://docs.codat.io/sync-for-payables-api#/schemas/Supplier) are people or organizations that provide something, such as a product or service. + + **Integration-specific behaviour** + + Required data may vary by integration. To see what data to post, first call [Get create/update supplier model](https://docs.codat.io/sync-for-payables-api#/operations/get-create-update-suppliers-model). + + Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=suppliers) for integrations that support creating a supplier. + + + :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.CreateSupplierRequest) + request = cast(operations.CreateSupplierRequest, request) + + req = self.build_request( + method="POST", + path="/companies/{companyId}/connections/{connectionId}/push/suppliers", + 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.supplier, True, True, "json", OptionalNullable[shared.Supplier] + ), + 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-supplier", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=[ + "400", + "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.CreateSupplierResponse] + ) + if utils.match_response( + http_res, + ["400", "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 create_async( + self, + *, + request: Union[ + operations.CreateSupplierRequest, operations.CreateSupplierRequestTypedDict + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.CreateSupplierResponse]: + r"""Create supplier + + The *Create supplier* endpoint creates a new [supplier](https://docs.codat.io/sync-for-payables-api#/schemas/Supplier) for a given company's connection. + + [Suppliers](https://docs.codat.io/sync-for-payables-api#/schemas/Supplier) are people or organizations that provide something, such as a product or service. + + **Integration-specific behaviour** + + Required data may vary by integration. To see what data to post, first call [Get create/update supplier model](https://docs.codat.io/sync-for-payables-api#/operations/get-create-update-suppliers-model). + + Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=suppliers) for integrations that support creating a supplier. + + + :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.CreateSupplierRequest) + request = cast(operations.CreateSupplierRequest, request) + + req = self.build_request_async( + method="POST", + path="/companies/{companyId}/connections/{connectionId}/push/suppliers", + 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.supplier, True, True, "json", OptionalNullable[shared.Supplier] + ), + 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-supplier", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=[ + "400", + "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.CreateSupplierResponse] + ) + if utils.match_response( + http_res, + ["400", "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( + self, + *, + request: Union[ + operations.GetSupplierRequest, operations.GetSupplierRequestTypedDict + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.Supplier]: + r"""Get supplier + + The *Get supplier* endpoint returns a single supplier for a given `supplierId`. + + [Suppliers](https://docs.codat.io/sync-for-payables-api#/schemas/Supplier) are people or organizations that provide something, such as a product or service. + + Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=suppliers) for integrations that support getting a specific supplier. + + Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/sync-for-payables-api#/operations/refresh-company-data). + + + :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.GetSupplierRequest) + request = cast(operations.GetSupplierRequest, request) + + req = self.build_request( + method="GET", + path="/companies/{companyId}/data/suppliers/{supplierId}", + 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-supplier", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=[ + "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[shared.Supplier]) + if utils.match_response( + http_res, + ["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 get_async( + self, + *, + request: Union[ + operations.GetSupplierRequest, operations.GetSupplierRequestTypedDict + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.Supplier]: + r"""Get supplier + + The *Get supplier* endpoint returns a single supplier for a given `supplierId`. + + [Suppliers](https://docs.codat.io/sync-for-payables-api#/schemas/Supplier) are people or organizations that provide something, such as a product or service. + + Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=suppliers) for integrations that support getting a specific supplier. + + Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/sync-for-payables-api#/operations/refresh-company-data). + + + :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.GetSupplierRequest) + request = cast(operations.GetSupplierRequest, request) + + req = self.build_request_async( + method="GET", + path="/companies/{companyId}/data/suppliers/{supplierId}", + 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-supplier", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=[ + "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[shared.Supplier]) + if utils.match_response( + http_res, + ["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 get_create_update_model( + self, + *, + request: Union[ + operations.GetCreateUpdateSupplierModelRequest, + operations.GetCreateUpdateSupplierModelRequestTypedDict, + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.PushOption]: + r"""Get create/update supplier model + + The *Get create/update supplier model* endpoint returns the expected data for the request payload when creating and updating a [supplier](https://docs.codat.io/sync-for-payables-api#/schemas/Supplier) for a given company and integration. + + [Suppliers](https://docs.codat.io/sync-for-payables-api#/schemas/Supplier) are people or organizations that provide something, such as a product or service. + + **Integration-specific behaviour** + + See the *response examples* for integration-specific indicative models. + + Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=suppliers) for integrations that support creating and updating a supplier. + + + :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.GetCreateUpdateSupplierModelRequest + ) + request = cast(operations.GetCreateUpdateSupplierModelRequest, request) + + req = self.build_request( + method="GET", + path="/companies/{companyId}/connections/{connectionId}/options/suppliers", + 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-update-supplier-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_update_model_async( + self, + *, + request: Union[ + operations.GetCreateUpdateSupplierModelRequest, + operations.GetCreateUpdateSupplierModelRequestTypedDict, + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.PushOption]: + r"""Get create/update supplier model + + The *Get create/update supplier model* endpoint returns the expected data for the request payload when creating and updating a [supplier](https://docs.codat.io/sync-for-payables-api#/schemas/Supplier) for a given company and integration. + + [Suppliers](https://docs.codat.io/sync-for-payables-api#/schemas/Supplier) are people or organizations that provide something, such as a product or service. + + **Integration-specific behaviour** + + See the *response examples* for integration-specific indicative models. + + Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=suppliers) for integrations that support creating and updating a supplier. + + + :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.GetCreateUpdateSupplierModelRequest + ) + request = cast(operations.GetCreateUpdateSupplierModelRequest, request) + + req = self.build_request_async( + method="GET", + path="/companies/{companyId}/connections/{connectionId}/options/suppliers", + 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-update-supplier-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 list( + self, + *, + request: Union[ + operations.ListSuppliersRequest, operations.ListSuppliersRequestTypedDict + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.Suppliers]: + r"""List suppliers + + The *List suppliers* endpoint returns a list of [suppliers](https://docs.codat.io/sync-for-payables-api#/schemas/Supplier) for a given company's connection. + + [Suppliers](https://docs.codat.io/sync-for-payables-api#/schemas/Supplier) are people or organizations that provide something, such as a product or service. + + :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.ListSuppliersRequest) + request = cast(operations.ListSuppliersRequest, request) + + req = self.build_request( + method="GET", + path="/companies/{companyId}/data/suppliers", + 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="list-suppliers", + 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[shared.Suppliers]) + 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 list_async( + self, + *, + request: Union[ + operations.ListSuppliersRequest, operations.ListSuppliersRequestTypedDict + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.Suppliers]: + r"""List suppliers + + The *List suppliers* endpoint returns a list of [suppliers](https://docs.codat.io/sync-for-payables-api#/schemas/Supplier) for a given company's connection. + + [Suppliers](https://docs.codat.io/sync-for-payables-api#/schemas/Supplier) are people or organizations that provide something, such as a product or service. + + :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.ListSuppliersRequest) + request = cast(operations.ListSuppliersRequest, request) + + req = self.build_request_async( + method="GET", + path="/companies/{companyId}/data/suppliers", + 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="list-suppliers", + 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[shared.Suppliers]) + 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 update( + self, + *, + request: Union[ + operations.UpdateSupplierRequest, operations.UpdateSupplierRequestTypedDict + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.UpdateSupplierResponse]: + r"""Update supplier + + The *Update supplier* endpoint updates an existing [supplier](https://docs.codat.io/sync-for-payables-api#/schemas/Supplier) for a given company's connection. + + [Suppliers](https://docs.codat.io/sync-for-payables-api#/schemas/Supplier) are people or organizations that provide something, such as a product or service. + + **Integration-specific behaviour** + + Required data may vary by integration. To see what data to post, first call [Get create/update supplier model](https://docs.codat.io/sync-for-payables-api#/operations/get-create-update-suppliers-model). + + Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=suppliers) for integrations that support creating a supplier. + + + :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.UpdateSupplierRequest) + request = cast(operations.UpdateSupplierRequest, request) + + req = self.build_request( + method="PUT", + path="/companies/{companyId}/connections/{connectionId}/push/suppliers/{supplierId}", + 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.supplier, True, True, "json", OptionalNullable[shared.Supplier] + ), + 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="update-supplier", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=[ + "400", + "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.UpdateSupplierResponse] + ) + if utils.match_response( + http_res, + ["400", "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 update_async( + self, + *, + request: Union[ + operations.UpdateSupplierRequest, operations.UpdateSupplierRequestTypedDict + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.UpdateSupplierResponse]: + r"""Update supplier + + The *Update supplier* endpoint updates an existing [supplier](https://docs.codat.io/sync-for-payables-api#/schemas/Supplier) for a given company's connection. + + [Suppliers](https://docs.codat.io/sync-for-payables-api#/schemas/Supplier) are people or organizations that provide something, such as a product or service. + + **Integration-specific behaviour** + + Required data may vary by integration. To see what data to post, first call [Get create/update supplier model](https://docs.codat.io/sync-for-payables-api#/operations/get-create-update-suppliers-model). + + Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=suppliers) for integrations that support creating a supplier. + + + :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.UpdateSupplierRequest) + request = cast(operations.UpdateSupplierRequest, request) + + req = self.build_request_async( + method="PUT", + path="/companies/{companyId}/connections/{connectionId}/push/suppliers/{supplierId}", + 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.supplier, True, True, "json", OptionalNullable[shared.Supplier] + ), + 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="update-supplier", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=[ + "400", + "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.UpdateSupplierResponse] + ) + if utils.match_response( + http_res, + ["400", "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, + ) diff --git a/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/tax_rates.py b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/tax_rates.py new file mode 100644 index 000000000..73495d47e --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/tax_rates.py @@ -0,0 +1,458 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from .basesdk import BaseSDK +from codat_sync_for_payables_version_1 import utils +from codat_sync_for_payables_version_1._hooks import HookContext +from codat_sync_for_payables_version_1.models import errors, operations, shared +from codat_sync_for_payables_version_1.types import BaseModel, OptionalNullable, UNSET +from typing import Any, Optional, Union, cast + + +class TaxRates(BaseSDK): + r"""Get, create, and update Tax rates.""" + + def get( + self, + *, + request: Union[ + operations.GetTaxRateRequest, operations.GetTaxRateRequestTypedDict + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.TaxRate]: + r"""Get tax rate + + The *Get tax rate* endpoint returns a single tax rate for a given `taxRateId`. + + [Tax rates](https://docs.codat.io/sync-for-payables-api#/schemas/TaxRate) are a set of taxes and associated rates within the SMB's accounting software. + + Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=taxRates) for integrations that support getting a specific tax rate. + + Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/sync-for-payables-api#/operations/refresh-company-data). + + + :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.GetTaxRateRequest) + request = cast(operations.GetTaxRateRequest, request) + + req = self.build_request( + method="GET", + path="/companies/{companyId}/data/taxRates/{taxRateId}", + 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-tax-rate", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=[ + "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[shared.TaxRate]) + if utils.match_response( + http_res, + ["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 get_async( + self, + *, + request: Union[ + operations.GetTaxRateRequest, operations.GetTaxRateRequestTypedDict + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.TaxRate]: + r"""Get tax rate + + The *Get tax rate* endpoint returns a single tax rate for a given `taxRateId`. + + [Tax rates](https://docs.codat.io/sync-for-payables-api#/schemas/TaxRate) are a set of taxes and associated rates within the SMB's accounting software. + + Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=taxRates) for integrations that support getting a specific tax rate. + + Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/sync-for-payables-api#/operations/refresh-company-data). + + + :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.GetTaxRateRequest) + request = cast(operations.GetTaxRateRequest, request) + + req = self.build_request_async( + method="GET", + path="/companies/{companyId}/data/taxRates/{taxRateId}", + 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-tax-rate", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=[ + "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[shared.TaxRate]) + if utils.match_response( + http_res, + ["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 list( + self, + *, + request: Union[ + operations.ListTaxRatesRequest, operations.ListTaxRatesRequestTypedDict + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.TaxRates]: + r"""List all tax rates + + The *List tax rates* endpoint returns a list of [tax rates](https://docs.codat.io/sync-for-payables-api#/schemas/TaxRate) for a given company's connection. + + [Tax rates](https://docs.codat.io/sync-for-payables-api#/schemas/TaxRate) are a set of taxes and associated rates within the SMB's accounting software. + + Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/sync-for-payables-api#/operations/refresh-company-data). + + + :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.ListTaxRatesRequest) + request = cast(operations.ListTaxRatesRequest, request) + + req = self.build_request( + method="GET", + path="/companies/{companyId}/data/taxRates", + 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="list-tax-rates", + 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[shared.TaxRates]) + 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 list_async( + self, + *, + request: Union[ + operations.ListTaxRatesRequest, operations.ListTaxRatesRequestTypedDict + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.TaxRates]: + r"""List all tax rates + + The *List tax rates* endpoint returns a list of [tax rates](https://docs.codat.io/sync-for-payables-api#/schemas/TaxRate) for a given company's connection. + + [Tax rates](https://docs.codat.io/sync-for-payables-api#/schemas/TaxRate) are a set of taxes and associated rates within the SMB's accounting software. + + Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/sync-for-payables-api#/operations/refresh-company-data). + + + :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.ListTaxRatesRequest) + request = cast(operations.ListTaxRatesRequest, request) + + req = self.build_request_async( + method="GET", + path="/companies/{companyId}/data/taxRates", + 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="list-tax-rates", + 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[shared.TaxRates]) + 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, + ) diff --git a/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/tracking_categories.py b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/tracking_categories.py new file mode 100644 index 000000000..caa0a2724 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/tracking_categories.py @@ -0,0 +1,470 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from .basesdk import BaseSDK +from codat_sync_for_payables_version_1 import utils +from codat_sync_for_payables_version_1._hooks import HookContext +from codat_sync_for_payables_version_1.models import errors, operations, shared +from codat_sync_for_payables_version_1.types import BaseModel, OptionalNullable, UNSET +from typing import Any, Optional, Union, cast + + +class TrackingCategories(BaseSDK): + r"""Get, create, and update Tracking categories.""" + + def get( + self, + *, + request: Union[ + operations.GetTrackingCategoryRequest, + operations.GetTrackingCategoryRequestTypedDict, + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.TrackingCategoryTree]: + r"""Get tracking categories + + The *Get tracking category* endpoint returns a single tracking category for a given `trackingCategoryId`. + + [Tracking categories](https://docs.codat.io/sync-for-payables-api#/schemas/TrackingCategory) are used to monitor cost centres and control budgets that sit outside the standard set of accounts. + + Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=trackingCategories) for integrations that support getting a specific tracking category. + + Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/sync-for-payables-api#/operations/refresh-company-data). + + + :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.GetTrackingCategoryRequest) + request = cast(operations.GetTrackingCategoryRequest, request) + + req = self.build_request( + method="GET", + path="/companies/{companyId}/data/trackingCategories/{trackingCategoryId}", + 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-tracking-category", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=[ + "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[shared.TrackingCategoryTree] + ) + if utils.match_response( + http_res, + ["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 get_async( + self, + *, + request: Union[ + operations.GetTrackingCategoryRequest, + operations.GetTrackingCategoryRequestTypedDict, + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.TrackingCategoryTree]: + r"""Get tracking categories + + The *Get tracking category* endpoint returns a single tracking category for a given `trackingCategoryId`. + + [Tracking categories](https://docs.codat.io/sync-for-payables-api#/schemas/TrackingCategory) are used to monitor cost centres and control budgets that sit outside the standard set of accounts. + + Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=trackingCategories) for integrations that support getting a specific tracking category. + + Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/sync-for-payables-api#/operations/refresh-company-data). + + + :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.GetTrackingCategoryRequest) + request = cast(operations.GetTrackingCategoryRequest, request) + + req = self.build_request_async( + method="GET", + path="/companies/{companyId}/data/trackingCategories/{trackingCategoryId}", + 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-tracking-category", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=[ + "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[shared.TrackingCategoryTree] + ) + if utils.match_response( + http_res, + ["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 list( + self, + *, + request: Union[ + operations.ListTrackingCategoriesRequest, + operations.ListTrackingCategoriesRequestTypedDict, + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.TrackingCategories]: + r"""List tracking categories + + The *List tracking categories* endpoint returns a list of [tracking categories](https://docs.codat.io/sync-for-payables-api#/schemas/TrackingCategory) for a given company's connection. + + [Tracking categories](https://docs.codat.io/sync-for-payables-api#/schemas/TrackingCategory) are used to monitor cost centres and control budgets that sit outside the standard set of accounts. + + Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/sync-for-payables-api#/operations/refresh-company-data). + + + :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.ListTrackingCategoriesRequest) + request = cast(operations.ListTrackingCategoriesRequest, request) + + req = self.build_request( + method="GET", + path="/companies/{companyId}/data/trackingCategories", + 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="list-tracking-categories", + 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[shared.TrackingCategories] + ) + 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 list_async( + self, + *, + request: Union[ + operations.ListTrackingCategoriesRequest, + operations.ListTrackingCategoriesRequestTypedDict, + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + ) -> Optional[shared.TrackingCategories]: + r"""List tracking categories + + The *List tracking categories* endpoint returns a list of [tracking categories](https://docs.codat.io/sync-for-payables-api#/schemas/TrackingCategory) for a given company's connection. + + [Tracking categories](https://docs.codat.io/sync-for-payables-api#/schemas/TrackingCategory) are used to monitor cost centres and control budgets that sit outside the standard set of accounts. + + Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/sync-for-payables-api#/operations/refresh-company-data). + + + :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.ListTrackingCategoriesRequest) + request = cast(operations.ListTrackingCategoriesRequest, request) + + req = self.build_request_async( + method="GET", + path="/companies/{companyId}/data/trackingCategories", + 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="list-tracking-categories", + 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[shared.TrackingCategories] + ) + 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, + ) diff --git a/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/types/__init__.py b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/types/__init__.py new file mode 100644 index 000000000..fc76fe0c5 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/types/__init__.py @@ -0,0 +1,21 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from .basemodel import ( + BaseModel, + Nullable, + OptionalNullable, + UnrecognizedInt, + UnrecognizedStr, + UNSET, + UNSET_SENTINEL, +) + +__all__ = [ + "BaseModel", + "Nullable", + "OptionalNullable", + "UnrecognizedInt", + "UnrecognizedStr", + "UNSET", + "UNSET_SENTINEL", +] diff --git a/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/types/basemodel.py b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/types/basemodel.py new file mode 100644 index 000000000..a6187efa6 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/types/basemodel.py @@ -0,0 +1,39 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from pydantic import ConfigDict, model_serializer +from pydantic import BaseModel as PydanticBaseModel +from typing import TYPE_CHECKING, Literal, Optional, TypeVar, Union, NewType +from typing_extensions import TypeAliasType, TypeAlias + + +class BaseModel(PydanticBaseModel): + model_config = ConfigDict( + populate_by_name=True, arbitrary_types_allowed=True, protected_namespaces=() + ) + + +class Unset(BaseModel): + @model_serializer(mode="plain") + def serialize_model(self): + return UNSET_SENTINEL + + def __bool__(self) -> Literal[False]: + return False + + +UNSET = Unset() +UNSET_SENTINEL = "~?~unset~?~sentinel~?~" + + +T = TypeVar("T") +if TYPE_CHECKING: + Nullable: TypeAlias = Union[T, None] + OptionalNullable: TypeAlias = Union[Optional[Nullable[T]], Unset] +else: + Nullable = TypeAliasType("Nullable", Union[T, None], type_params=(T,)) + OptionalNullable = TypeAliasType( + "OptionalNullable", Union[Optional[Nullable[T]], Unset], type_params=(T,) + ) + +UnrecognizedInt = NewType("UnrecognizedInt", int) +UnrecognizedStr = NewType("UnrecognizedStr", str) diff --git a/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/utils/__init__.py b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/utils/__init__.py new file mode 100644 index 000000000..26d51ae8f --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/utils/__init__.py @@ -0,0 +1,97 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from .annotations import get_discriminator +from .enums import OpenEnumMeta +from .headers import get_headers, get_response_headers +from .metadata import ( + FieldMetadata, + find_metadata, + FormMetadata, + HeaderMetadata, + MultipartFormMetadata, + PathParamMetadata, + QueryParamMetadata, + RequestMetadata, + SecurityMetadata, +) +from .queryparams import get_query_params +from .retries import BackoffStrategy, Retries, retry, retry_async, RetryConfig +from .requestbodies import serialize_request_body, SerializedRequestBody +from .security import get_security +from .serializers import ( + get_pydantic_model, + marshal_json, + unmarshal, + unmarshal_json, + serialize_decimal, + serialize_float, + serialize_int, + stream_to_text, + stream_to_text_async, + stream_to_bytes, + stream_to_bytes_async, + validate_const, + validate_decimal, + validate_float, + validate_int, + validate_open_enum, +) +from .url import generate_url, template_url, remove_suffix +from .values import ( + get_global_from_env, + match_content_type, + match_status_codes, + match_response, +) +from .logger import Logger, get_body_content, get_default_logger + +__all__ = [ + "BackoffStrategy", + "FieldMetadata", + "find_metadata", + "FormMetadata", + "generate_url", + "get_body_content", + "get_default_logger", + "get_discriminator", + "get_global_from_env", + "get_headers", + "get_pydantic_model", + "get_query_params", + "get_response_headers", + "get_security", + "HeaderMetadata", + "Logger", + "marshal_json", + "match_content_type", + "match_status_codes", + "match_response", + "MultipartFormMetadata", + "OpenEnumMeta", + "PathParamMetadata", + "QueryParamMetadata", + "remove_suffix", + "Retries", + "retry", + "retry_async", + "RetryConfig", + "RequestMetadata", + "SecurityMetadata", + "serialize_decimal", + "serialize_float", + "serialize_int", + "serialize_request_body", + "SerializedRequestBody", + "stream_to_text", + "stream_to_text_async", + "stream_to_bytes", + "stream_to_bytes_async", + "template_url", + "unmarshal", + "unmarshal_json", + "validate_decimal", + "validate_const", + "validate_float", + "validate_int", + "validate_open_enum", +] diff --git a/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/utils/annotations.py b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/utils/annotations.py new file mode 100644 index 000000000..5b3bbb027 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/utils/annotations.py @@ -0,0 +1,30 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from enum import Enum +from typing import Any + +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 + + if hasattr(model, fieldname): + attr = getattr(model, fieldname) + + if isinstance(attr, Enum): + return f'{attr.value}' + + return f'{attr}' + + fieldname = fieldname.upper() + if hasattr(model, fieldname): + attr = getattr(model, fieldname) + + if isinstance(attr, Enum): + return f'{attr.value}' + + return f'{attr}' + + raise ValueError(f'Could not find discriminator field {fieldname} in {model}') diff --git a/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/utils/enums.py b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/utils/enums.py new file mode 100644 index 000000000..c650b10cb --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/utils/enums.py @@ -0,0 +1,34 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +import enum + + +class OpenEnumMeta(enum.EnumMeta): + def __call__( + cls, value, names=None, *, module=None, qualname=None, type=None, start=1 + ): + # The `type` kwarg also happens to be a built-in that pylint flags as + # redeclared. Safe to ignore this lint rule with this scope. + # pylint: disable=redefined-builtin + + if names is not None: + return super().__call__( + value, + names=names, + module=module, + qualname=qualname, + type=type, + start=start, + ) + + try: + return super().__call__( + value, + names=names, # pyright: ignore[reportArgumentType] + module=module, + qualname=qualname, + type=type, + start=start, + ) + except ValueError: + return value diff --git a/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/utils/eventstreaming.py b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/utils/eventstreaming.py new file mode 100644 index 000000000..553b386b3 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/utils/eventstreaming.py @@ -0,0 +1,178 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +import re +import json +from typing import Callable, TypeVar, Optional, Generator, AsyncGenerator, Tuple +import httpx + +T = TypeVar("T") + + +class ServerEvent: + id: Optional[str] = None + event: Optional[str] = None + data: Optional[str] = None + retry: Optional[int] = None + + +MESSAGE_BOUNDARIES = [ + b"\r\n\r\n", + b"\n\n", + b"\r\r", +] + + +async def stream_events_async( + response: httpx.Response, + decoder: Callable[[str], T], + sentinel: Optional[str] = None, +) -> AsyncGenerator[T, None]: + buffer = bytearray() + position = 0 + discard = False + async for chunk in response.aiter_bytes(): + # We've encountered the sentinel value and should no longer process + # incoming data. Instead we throw new data away until the server closes + # the connection. + if discard: + continue + + buffer += chunk + for i in range(position, len(buffer)): + char = buffer[i : i + 1] + seq: Optional[bytes] = None + if char in [b"\r", b"\n"]: + for boundary in MESSAGE_BOUNDARIES: + seq = _peek_sequence(i, buffer, boundary) + if seq is not None: + break + if seq is None: + continue + + block = buffer[position:i] + position = i + len(seq) + event, discard = _parse_event(block, decoder, sentinel) + if event is not None: + yield event + + if position > 0: + buffer = buffer[position:] + position = 0 + + event, discard = _parse_event(buffer, decoder, sentinel) + if event is not None: + yield event + + +def stream_events( + response: httpx.Response, + decoder: Callable[[str], T], + sentinel: Optional[str] = None, +) -> Generator[T, None, None]: + buffer = bytearray() + position = 0 + discard = False + for chunk in response.iter_bytes(): + # We've encountered the sentinel value and should no longer process + # incoming data. Instead we throw new data away until the server closes + # the connection. + if discard: + continue + + buffer += chunk + for i in range(position, len(buffer)): + char = buffer[i : i + 1] + seq: Optional[bytes] = None + if char in [b"\r", b"\n"]: + for boundary in MESSAGE_BOUNDARIES: + seq = _peek_sequence(i, buffer, boundary) + if seq is not None: + break + if seq is None: + continue + + block = buffer[position:i] + position = i + len(seq) + event, discard = _parse_event(block, decoder, sentinel) + if event is not None: + yield event + + if position > 0: + buffer = buffer[position:] + position = 0 + + event, discard = _parse_event(buffer, decoder, sentinel) + if event is not None: + yield event + + +def _parse_event( + raw: bytearray, decoder: Callable[[str], T], sentinel: Optional[str] = None +) -> Tuple[Optional[T], bool]: + block = raw.decode() + lines = re.split(r"\r?\n|\r", block) + publish = False + event = ServerEvent() + data = "" + for line in lines: + if not line: + continue + + delim = line.find(":") + if delim <= 0: + continue + + field = line[0:delim] + value = line[delim + 1 :] if delim < len(line) - 1 else "" + if len(value) and value[0] == " ": + value = value[1:] + + if field == "event": + event.event = value + publish = True + elif field == "data": + data += value + "\n" + publish = True + elif field == "id": + event.id = value + publish = True + elif field == "retry": + event.retry = int(value) if value.isdigit() else None + publish = True + + if sentinel and data == f"{sentinel}\n": + return None, True + + if data: + data = data[:-1] + event.data = data + + data_is_primitive = ( + data.isnumeric() or data == "true" or data == "false" or data == "null" + ) + data_is_json = ( + data.startswith("{") or data.startswith("[") or data.startswith('"') + ) + + if data_is_primitive or data_is_json: + try: + event.data = json.loads(data) + except Exception: + pass + + out = None + if publish: + out = decoder(json.dumps(event.__dict__)) + + return out, False + + +def _peek_sequence(position: int, buffer: bytearray, sequence: bytes): + if len(sequence) > (len(buffer) - position): + return None + + for i, seq in enumerate(sequence): + if buffer[position + i] != seq: + return None + + return sequence diff --git a/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/utils/forms.py b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/utils/forms.py new file mode 100644 index 000000000..9f5a731e9 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/utils/forms.py @@ -0,0 +1,208 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from typing import ( + Any, + Dict, + get_type_hints, + List, + Tuple, +) +from pydantic import BaseModel +from pydantic.fields import FieldInfo + +from .serializers import marshal_json + +from .metadata import ( + FormMetadata, + MultipartFormMetadata, + find_field_metadata, +) +from .values import _is_set, _val_to_string + + +def _populate_form( + field_name: str, + explode: bool, + obj: Any, + delimiter: str, + form: Dict[str, List[str]], +): + if not _is_set(obj): + return form + + if isinstance(obj, BaseModel): + items = [] + + obj_fields: Dict[str, FieldInfo] = obj.__class__.model_fields + for name in obj_fields: + obj_field = obj_fields[name] + obj_field_name = obj_field.alias if obj_field.alias is not None else name + if obj_field_name == "": + continue + + val = getattr(obj, name) + if not _is_set(val): + continue + + if explode: + form[obj_field_name] = [_val_to_string(val)] + else: + items.append(f"{obj_field_name}{delimiter}{_val_to_string(val)}") + + if len(items) > 0: + form[field_name] = [delimiter.join(items)] + elif isinstance(obj, Dict): + items = [] + for key, value in obj.items(): + if not _is_set(value): + continue + + if explode: + form[key] = [_val_to_string(value)] + else: + items.append(f"{key}{delimiter}{_val_to_string(value)}") + + if len(items) > 0: + form[field_name] = [delimiter.join(items)] + elif isinstance(obj, List): + items = [] + + for value in obj: + if not _is_set(value): + continue + + if explode: + if not field_name in form: + form[field_name] = [] + form[field_name].append(_val_to_string(value)) + else: + items.append(_val_to_string(value)) + + if len(items) > 0: + form[field_name] = [delimiter.join([str(item) for item in items])] + else: + form[field_name] = [_val_to_string(obj)] + + return form + + +def serialize_multipart_form( + media_type: str, request: Any +) -> Tuple[str, Dict[str, Any], Dict[str, Any]]: + form: Dict[str, Any] = {} + files: Dict[str, Any] = {} + + if not isinstance(request, BaseModel): + raise TypeError("invalid request body type") + + request_fields: Dict[str, FieldInfo] = request.__class__.model_fields + request_field_types = get_type_hints(request.__class__) + + for name in request_fields: + field = request_fields[name] + + val = getattr(request, name) + if not _is_set(val): + continue + + field_metadata = find_field_metadata(field, MultipartFormMetadata) + if not field_metadata: + continue + + f_name = field.alias if field.alias is not None else name + + if field_metadata.file: + file_fields: Dict[str, FieldInfo] = val.__class__.model_fields + + file_name = "" + field_name = "" + content = None + content_type = None + + for file_field_name in file_fields: + file_field = file_fields[file_field_name] + + file_metadata = find_field_metadata(file_field, MultipartFormMetadata) + if file_metadata is None: + continue + + if file_metadata.content: + content = getattr(val, file_field_name, None) + elif file_field_name == "content_type": + content_type = getattr(val, file_field_name, None) + else: + field_name = ( + file_field.alias + if file_field.alias is not None + else file_field_name + ) + file_name = getattr(val, file_field_name) + + if field_name == "" or file_name == "" or content is None: + raise ValueError("invalid multipart/form-data file") + + if content_type is not None: + files[field_name] = (file_name, content, content_type) + else: + files[field_name] = (file_name, content) + elif field_metadata.json: + files[f_name] = ( + None, + marshal_json(val, request_field_types[name]), + "application/json", + ) + else: + if isinstance(val, List): + values = [] + + for value in val: + if not _is_set(value): + continue + values.append(_val_to_string(value)) + + form[f_name + "[]"] = values + else: + form[f_name] = _val_to_string(val) + return media_type, form, files + + +def serialize_form_data(data: Any) -> Dict[str, Any]: + form: Dict[str, List[str]] = {} + + if isinstance(data, BaseModel): + data_fields: Dict[str, FieldInfo] = data.__class__.model_fields + data_field_types = get_type_hints(data.__class__) + for name in data_fields: + field = data_fields[name] + + val = getattr(data, name) + if not _is_set(val): + continue + + metadata = find_field_metadata(field, FormMetadata) + if metadata is None: + continue + + f_name = field.alias if field.alias is not None else name + + if metadata.json: + form[f_name] = [marshal_json(val, data_field_types[name])] + else: + if metadata.style == "form": + _populate_form( + f_name, + metadata.explode, + val, + ",", + form, + ) + else: + raise ValueError(f"Invalid form style for field {name}") + elif isinstance(data, Dict): + for key, value in data.items(): + if _is_set(value): + form[key] = [_val_to_string(value)] + else: + raise TypeError(f"Invalid request body type {type(data)} for form data") + + return form diff --git a/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/utils/headers.py b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/utils/headers.py new file mode 100644 index 000000000..37864cbbb --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/utils/headers.py @@ -0,0 +1,136 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from typing import ( + Any, + Dict, + List, + Optional, +) +from httpx import Headers +from pydantic import BaseModel +from pydantic.fields import FieldInfo + +from .metadata import ( + HeaderMetadata, + find_field_metadata, +) + +from .values import _is_set, _populate_from_globals, _val_to_string + + +def get_headers(headers_params: Any, gbls: Optional[Any] = None) -> Dict[str, str]: + headers: Dict[str, str] = {} + + globals_already_populated = [] + if _is_set(headers_params): + globals_already_populated = _populate_headers(headers_params, gbls, headers, []) + if _is_set(gbls): + _populate_headers(gbls, None, headers, globals_already_populated) + + return headers + + +def _populate_headers( + headers_params: Any, + gbls: Any, + header_values: Dict[str, str], + skip_fields: List[str], +) -> List[str]: + globals_already_populated: List[str] = [] + + if not isinstance(headers_params, BaseModel): + return globals_already_populated + + param_fields: Dict[str, FieldInfo] = headers_params.__class__.model_fields + for name in param_fields: + if name in skip_fields: + continue + + field = param_fields[name] + f_name = field.alias if field.alias is not None else name + + metadata = find_field_metadata(field, HeaderMetadata) + if metadata is None: + continue + + value, global_found = _populate_from_globals( + name, getattr(headers_params, name), HeaderMetadata, gbls + ) + if global_found: + globals_already_populated.append(name) + value = _serialize_header(metadata.explode, value) + + if value != "": + header_values[f_name] = value + + return globals_already_populated + + +def _serialize_header(explode: bool, obj: Any) -> str: + if not _is_set(obj): + return "" + + if isinstance(obj, BaseModel): + items = [] + obj_fields: Dict[str, FieldInfo] = obj.__class__.model_fields + for name in obj_fields: + obj_field = obj_fields[name] + obj_param_metadata = find_field_metadata(obj_field, HeaderMetadata) + + if not obj_param_metadata: + continue + + f_name = obj_field.alias if obj_field.alias is not None else name + + val = getattr(obj, name) + if not _is_set(val): + continue + + if explode: + items.append(f"{f_name}={_val_to_string(val)}") + else: + items.append(f_name) + items.append(_val_to_string(val)) + + if len(items) > 0: + return ",".join(items) + elif isinstance(obj, Dict): + items = [] + + for key, value in obj.items(): + if not _is_set(value): + continue + + if explode: + items.append(f"{key}={_val_to_string(value)}") + else: + items.append(key) + items.append(_val_to_string(value)) + + if len(items) > 0: + return ",".join([str(item) for item in items]) + elif isinstance(obj, List): + items = [] + + for value in obj: + if not _is_set(value): + continue + + items.append(_val_to_string(value)) + + if len(items) > 0: + return ",".join(items) + elif _is_set(obj): + return f"{_val_to_string(obj)}" + + return "" + + +def get_response_headers(headers: Headers) -> Dict[str, List[str]]: + res: Dict[str, List[str]] = {} + for k, v in headers.items(): + if not k in res: + res[k] = [] + + res[k].append(v) + return res diff --git a/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/utils/logger.py b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/utils/logger.py new file mode 100644 index 000000000..b661aff65 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/utils/logger.py @@ -0,0 +1,22 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +import httpx +from typing import Any, Protocol + + +class Logger(Protocol): + def debug(self, msg: str, *args: Any, **kwargs: Any) -> None: + pass + + +class NoOpLogger: + def debug(self, msg: str, *args: Any, **kwargs: Any) -> None: + pass + + +def get_body_content(req: httpx.Request) -> str: + return "" if not hasattr(req, "_content") else str(req.content) + + +def get_default_logger() -> Logger: + return NoOpLogger() diff --git a/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/utils/metadata.py b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/utils/metadata.py new file mode 100644 index 000000000..173b3e5ce --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/utils/metadata.py @@ -0,0 +1,118 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from typing import Optional, Type, TypeVar, Union +from dataclasses import dataclass +from pydantic.fields import FieldInfo + + +T = TypeVar("T") + + +@dataclass +class SecurityMetadata: + option: bool = False + scheme: bool = False + scheme_type: Optional[str] = None + sub_type: Optional[str] = None + field_name: Optional[str] = None + + def get_field_name(self, default: str) -> str: + return self.field_name or default + + +@dataclass +class ParamMetadata: + serialization: Optional[str] = None + style: str = "simple" + explode: bool = False + + +@dataclass +class PathParamMetadata(ParamMetadata): + pass + + +@dataclass +class QueryParamMetadata(ParamMetadata): + style: str = "form" + explode: bool = True + + +@dataclass +class HeaderMetadata(ParamMetadata): + pass + + +@dataclass +class RequestMetadata: + media_type: str = "application/octet-stream" + + +@dataclass +class MultipartFormMetadata: + file: bool = False + content: bool = False + json: bool = False + + +@dataclass +class FormMetadata: + json: bool = False + style: str = "form" + explode: bool = True + + +class FieldMetadata: + security: Optional[SecurityMetadata] = None + path: Optional[PathParamMetadata] = None + query: Optional[QueryParamMetadata] = None + header: Optional[HeaderMetadata] = None + request: Optional[RequestMetadata] = None + form: Optional[FormMetadata] = None + multipart: Optional[MultipartFormMetadata] = None + + def __init__( + self, + security: Optional[SecurityMetadata] = None, + path: Optional[Union[PathParamMetadata, bool]] = None, + query: Optional[Union[QueryParamMetadata, bool]] = None, + header: Optional[Union[HeaderMetadata, bool]] = None, + request: Optional[Union[RequestMetadata, bool]] = None, + form: Optional[Union[FormMetadata, bool]] = None, + multipart: Optional[Union[MultipartFormMetadata, bool]] = None, + ): + self.security = security + self.path = PathParamMetadata() if isinstance(path, bool) else path + self.query = QueryParamMetadata() if isinstance(query, bool) else query + self.header = HeaderMetadata() if isinstance(header, bool) else header + self.request = RequestMetadata() if isinstance(request, bool) else request + self.form = FormMetadata() if isinstance(form, bool) else form + self.multipart = ( + MultipartFormMetadata() if isinstance(multipart, bool) else multipart + ) + + +def find_field_metadata(field_info: FieldInfo, metadata_type: Type[T]) -> Optional[T]: + metadata = find_metadata(field_info, FieldMetadata) + if not metadata: + return None + + fields = metadata.__dict__ + + for field in fields: + if isinstance(fields[field], metadata_type): + return fields[field] + + return None + + +def find_metadata(field_info: FieldInfo, metadata_type: Type[T]) -> Optional[T]: + metadata = field_info.metadata + if not metadata: + return None + + for md in metadata: + if isinstance(md, metadata_type): + return md + + return None diff --git a/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/utils/queryparams.py b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/utils/queryparams.py new file mode 100644 index 000000000..37a6e7f9a --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/utils/queryparams.py @@ -0,0 +1,205 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from typing import ( + Any, + Dict, + get_type_hints, + List, + Optional, +) + +from pydantic import BaseModel +from pydantic.fields import FieldInfo + +from .metadata import ( + QueryParamMetadata, + find_field_metadata, +) +from .values import ( + _get_serialized_params, + _is_set, + _populate_from_globals, + _val_to_string, +) +from .forms import _populate_form + + +def get_query_params( + query_params: Any, + gbls: Optional[Any] = None, +) -> Dict[str, List[str]]: + params: Dict[str, List[str]] = {} + + globals_already_populated = _populate_query_params(query_params, gbls, params, []) + if _is_set(gbls): + _populate_query_params(gbls, None, params, globals_already_populated) + + return params + + +def _populate_query_params( + query_params: Any, + gbls: Any, + query_param_values: Dict[str, List[str]], + skip_fields: List[str], +) -> List[str]: + globals_already_populated: List[str] = [] + + if not isinstance(query_params, BaseModel): + return globals_already_populated + + param_fields: Dict[str, FieldInfo] = query_params.__class__.model_fields + param_field_types = get_type_hints(query_params.__class__) + for name in param_fields: + if name in skip_fields: + continue + + field = param_fields[name] + + metadata = find_field_metadata(field, QueryParamMetadata) + if not metadata: + continue + + value = getattr(query_params, name) if _is_set(query_params) else None + + value, global_found = _populate_from_globals( + name, value, QueryParamMetadata, gbls + ) + if global_found: + globals_already_populated.append(name) + + f_name = field.alias if field.alias is not None else name + serialization = metadata.serialization + if serialization is not None: + serialized_parms = _get_serialized_params( + metadata, f_name, value, param_field_types[name] + ) + for key, value in serialized_parms.items(): + if key in query_param_values: + query_param_values[key].extend(value) + else: + query_param_values[key] = [value] + else: + style = metadata.style + if style == "deepObject": + _populate_deep_object_query_params(f_name, value, query_param_values) + elif style == "form": + _populate_delimited_query_params( + metadata, f_name, value, ",", query_param_values + ) + elif style == "pipeDelimited": + _populate_delimited_query_params( + metadata, f_name, value, "|", query_param_values + ) + else: + raise NotImplementedError( + f"query param style {style} not yet supported" + ) + + return globals_already_populated + + +def _populate_deep_object_query_params( + field_name: str, + obj: Any, + params: Dict[str, List[str]], +): + if not _is_set(obj): + return + + if isinstance(obj, BaseModel): + _populate_deep_object_query_params_basemodel(field_name, obj, params) + elif isinstance(obj, Dict): + _populate_deep_object_query_params_dict(field_name, obj, params) + + +def _populate_deep_object_query_params_basemodel( + prior_params_key: str, + obj: Any, + params: Dict[str, List[str]], +): + if not _is_set(obj) or not isinstance(obj, BaseModel): + return + + obj_fields: Dict[str, FieldInfo] = obj.__class__.model_fields + for name in obj_fields: + obj_field = obj_fields[name] + + f_name = obj_field.alias if obj_field.alias is not None else name + + params_key = f"{prior_params_key}[{f_name}]" + + obj_param_metadata = find_field_metadata(obj_field, QueryParamMetadata) + if not _is_set(obj_param_metadata): + continue + + obj_val = getattr(obj, name) + if not _is_set(obj_val): + continue + + if isinstance(obj_val, BaseModel): + _populate_deep_object_query_params_basemodel(params_key, obj_val, params) + elif isinstance(obj_val, Dict): + _populate_deep_object_query_params_dict(params_key, obj_val, params) + elif isinstance(obj_val, List): + _populate_deep_object_query_params_list(params_key, obj_val, params) + else: + params[params_key] = [_val_to_string(obj_val)] + + +def _populate_deep_object_query_params_dict( + prior_params_key: str, + value: Dict, + params: Dict[str, List[str]], +): + if not _is_set(value): + return + + for key, val in value.items(): + if not _is_set(val): + continue + + params_key = f"{prior_params_key}[{key}]" + + if isinstance(val, BaseModel): + _populate_deep_object_query_params_basemodel(params_key, val, params) + elif isinstance(val, Dict): + _populate_deep_object_query_params_dict(params_key, val, params) + elif isinstance(val, List): + _populate_deep_object_query_params_list(params_key, val, params) + else: + params[params_key] = [_val_to_string(val)] + + +def _populate_deep_object_query_params_list( + params_key: str, + value: List, + params: Dict[str, List[str]], +): + if not _is_set(value): + return + + for val in value: + if not _is_set(val): + continue + + if params.get(params_key) is None: + params[params_key] = [] + + params[params_key].append(_val_to_string(val)) + + +def _populate_delimited_query_params( + metadata: QueryParamMetadata, + field_name: str, + obj: Any, + delimiter: str, + query_param_values: Dict[str, List[str]], +): + _populate_form( + field_name, + metadata.explode, + obj, + delimiter, + query_param_values, + ) diff --git a/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/utils/requestbodies.py b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/utils/requestbodies.py new file mode 100644 index 000000000..4f586ae79 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/utils/requestbodies.py @@ -0,0 +1,66 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +import io +from dataclasses import dataclass +import re +from typing import ( + Any, + Optional, +) + +from .forms import serialize_form_data, serialize_multipart_form + +from .serializers import marshal_json + +SERIALIZATION_METHOD_TO_CONTENT_TYPE = { + "json": "application/json", + "form": "application/x-www-form-urlencoded", + "multipart": "multipart/form-data", + "raw": "application/octet-stream", + "string": "text/plain", +} + + +@dataclass +class SerializedRequestBody: + media_type: str + content: Optional[Any] = None + data: Optional[Any] = None + files: Optional[Any] = None + + +def serialize_request_body( + request_body: Any, + nullable: bool, + optional: bool, + serialization_method: str, + request_body_type, +) -> Optional[SerializedRequestBody]: + if request_body is None: + if not nullable and optional: + return None + + media_type = SERIALIZATION_METHOD_TO_CONTENT_TYPE[serialization_method] + + serialized_request_body = SerializedRequestBody(media_type) + + if re.match(r"(application|text)\/.*?\+*json.*", media_type) is not None: + serialized_request_body.content = marshal_json(request_body, request_body_type) + elif re.match(r"multipart\/.*", media_type) is not None: + ( + serialized_request_body.media_type, + serialized_request_body.data, + serialized_request_body.files, + ) = serialize_multipart_form(media_type, request_body) + elif re.match(r"application\/x-www-form-urlencoded.*", media_type) is not None: + serialized_request_body.data = serialize_form_data(request_body) + elif isinstance(request_body, (bytes, bytearray, io.BytesIO, io.BufferedReader)): + serialized_request_body.content = request_body + elif isinstance(request_body, str): + serialized_request_body.content = request_body + else: + raise TypeError( + f"invalid request body type {type(request_body)} for mediaType {media_type}" + ) + + return serialized_request_body diff --git a/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/utils/retries.py b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/utils/retries.py new file mode 100644 index 000000000..4d6086716 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/utils/retries.py @@ -0,0 +1,217 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +import asyncio +import random +import time +from typing import List + +import httpx + + +class BackoffStrategy: + initial_interval: int + max_interval: int + exponent: float + max_elapsed_time: int + + def __init__( + self, + initial_interval: int, + max_interval: int, + exponent: float, + max_elapsed_time: int, + ): + self.initial_interval = initial_interval + self.max_interval = max_interval + self.exponent = exponent + self.max_elapsed_time = max_elapsed_time + + +class RetryConfig: + strategy: str + backoff: BackoffStrategy + retry_connection_errors: bool + + def __init__( + self, strategy: str, backoff: BackoffStrategy, retry_connection_errors: bool + ): + self.strategy = strategy + self.backoff = backoff + self.retry_connection_errors = retry_connection_errors + + +class Retries: + config: RetryConfig + status_codes: List[str] + + def __init__(self, config: RetryConfig, status_codes: List[str]): + self.config = config + self.status_codes = status_codes + + +class TemporaryError(Exception): + response: httpx.Response + + def __init__(self, response: httpx.Response): + self.response = response + + +class PermanentError(Exception): + inner: Exception + + def __init__(self, inner: Exception): + self.inner = inner + + +def retry(func, retries: Retries): + if retries.config.strategy == "backoff": + + def do_request() -> httpx.Response: + res: httpx.Response + try: + res = func() + + for code in retries.status_codes: + if "X" in code.upper(): + code_range = int(code[0]) + + status_major = res.status_code / 100 + + if code_range <= status_major < code_range + 1: + raise TemporaryError(res) + else: + parsed_code = int(code) + + if res.status_code == parsed_code: + raise TemporaryError(res) + except httpx.ConnectError as exception: + if retries.config.retry_connection_errors: + raise + + raise PermanentError(exception) from exception + except httpx.TimeoutException as exception: + if retries.config.retry_connection_errors: + raise + + raise PermanentError(exception) from exception + except TemporaryError: + raise + except Exception as exception: + raise PermanentError(exception) from exception + + return res + + return retry_with_backoff( + do_request, + retries.config.backoff.initial_interval, + retries.config.backoff.max_interval, + retries.config.backoff.exponent, + retries.config.backoff.max_elapsed_time, + ) + + return func() + + +async def retry_async(func, retries: Retries): + if retries.config.strategy == "backoff": + + async def do_request() -> httpx.Response: + res: httpx.Response + try: + res = await func() + + for code in retries.status_codes: + if "X" in code.upper(): + code_range = int(code[0]) + + status_major = res.status_code / 100 + + if code_range <= status_major < code_range + 1: + raise TemporaryError(res) + else: + parsed_code = int(code) + + if res.status_code == parsed_code: + raise TemporaryError(res) + except httpx.ConnectError as exception: + if retries.config.retry_connection_errors: + raise + + raise PermanentError(exception) from exception + except httpx.TimeoutException as exception: + if retries.config.retry_connection_errors: + raise + + raise PermanentError(exception) from exception + except TemporaryError: + raise + except Exception as exception: + raise PermanentError(exception) from exception + + return res + + return await retry_with_backoff_async( + do_request, + retries.config.backoff.initial_interval, + retries.config.backoff.max_interval, + retries.config.backoff.exponent, + retries.config.backoff.max_elapsed_time, + ) + + return await func() + + +def retry_with_backoff( + func, + initial_interval=500, + max_interval=60000, + exponent=1.5, + max_elapsed_time=3600000, +): + start = round(time.time() * 1000) + retries = 0 + + while True: + try: + return func() + except PermanentError as exception: + raise exception.inner + except Exception as exception: # pylint: disable=broad-exception-caught + now = round(time.time() * 1000) + if now - start > max_elapsed_time: + if isinstance(exception, TemporaryError): + return exception.response + + raise + sleep = (initial_interval / 1000) * exponent**retries + random.uniform(0, 1) + sleep = min(sleep, max_interval / 1000) + time.sleep(sleep) + retries += 1 + + +async def retry_with_backoff_async( + func, + initial_interval=500, + max_interval=60000, + exponent=1.5, + max_elapsed_time=3600000, +): + start = round(time.time() * 1000) + retries = 0 + + while True: + try: + return await func() + except PermanentError as exception: + raise exception.inner + except Exception as exception: # pylint: disable=broad-exception-caught + now = round(time.time() * 1000) + if now - start > max_elapsed_time: + if isinstance(exception, TemporaryError): + return exception.response + + raise + sleep = (initial_interval / 1000) * exponent**retries + random.uniform(0, 1) + sleep = min(sleep, max_interval / 1000) + await asyncio.sleep(sleep) + retries += 1 diff --git a/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/utils/security.py b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/utils/security.py new file mode 100644 index 000000000..295a3f400 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/utils/security.py @@ -0,0 +1,174 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +import base64 +from typing import ( + Any, + Dict, + List, + Tuple, +) +from pydantic import BaseModel +from pydantic.fields import FieldInfo + +from .metadata import ( + SecurityMetadata, + find_field_metadata, +) + + +def get_security(security: Any) -> Tuple[Dict[str, str], Dict[str, List[str]]]: + headers: Dict[str, str] = {} + query_params: Dict[str, List[str]] = {} + + if security is None: + return headers, query_params + + if not isinstance(security, BaseModel): + raise TypeError("security must be a pydantic model") + + sec_fields: Dict[str, FieldInfo] = security.__class__.model_fields + for name in sec_fields: + sec_field = sec_fields[name] + + value = getattr(security, name) + if value is None: + continue + + metadata = find_field_metadata(sec_field, SecurityMetadata) + if metadata is None: + continue + if metadata.option: + _parse_security_option(headers, query_params, value) + return headers, query_params + if metadata.scheme: + # Special case for basic auth or custom auth which could be a flattened model + if metadata.sub_type in ["basic", "custom"] and not isinstance( + value, BaseModel + ): + _parse_security_scheme(headers, query_params, metadata, name, security) + else: + _parse_security_scheme(headers, query_params, metadata, name, value) + + return headers, query_params + + +def _parse_security_option( + headers: Dict[str, str], query_params: Dict[str, List[str]], option: Any +): + if not isinstance(option, BaseModel): + raise TypeError("security option must be a pydantic model") + + opt_fields: Dict[str, FieldInfo] = option.__class__.model_fields + for name in opt_fields: + opt_field = opt_fields[name] + + metadata = find_field_metadata(opt_field, SecurityMetadata) + if metadata is None or not metadata.scheme: + continue + _parse_security_scheme( + headers, query_params, metadata, name, getattr(option, name) + ) + + +def _parse_security_scheme( + headers: Dict[str, str], + query_params: Dict[str, List[str]], + scheme_metadata: SecurityMetadata, + field_name: str, + scheme: Any, +): + scheme_type = scheme_metadata.scheme_type + sub_type = scheme_metadata.sub_type + + if isinstance(scheme, BaseModel): + if scheme_type == "http": + if sub_type == "basic": + _parse_basic_auth_scheme(headers, scheme) + return + if sub_type == "custom": + return + + scheme_fields: Dict[str, FieldInfo] = scheme.__class__.model_fields + for name in scheme_fields: + scheme_field = scheme_fields[name] + + metadata = find_field_metadata(scheme_field, SecurityMetadata) + if metadata is None or metadata.field_name is None: + continue + + value = getattr(scheme, name) + + _parse_security_scheme_value( + headers, query_params, scheme_metadata, metadata, name, value + ) + else: + _parse_security_scheme_value( + headers, query_params, scheme_metadata, scheme_metadata, field_name, scheme + ) + + +def _parse_security_scheme_value( + headers: Dict[str, str], + query_params: Dict[str, List[str]], + scheme_metadata: SecurityMetadata, + security_metadata: SecurityMetadata, + field_name: str, + value: Any, +): + scheme_type = scheme_metadata.scheme_type + sub_type = scheme_metadata.sub_type + + header_name = security_metadata.get_field_name(field_name) + + if scheme_type == "apiKey": + if sub_type == "header": + headers[header_name] = value + elif sub_type == "query": + query_params[header_name] = [value] + else: + raise ValueError("sub type {sub_type} not supported") + elif scheme_type == "openIdConnect": + headers[header_name] = _apply_bearer(value) + elif scheme_type == "oauth2": + if sub_type != "client_credentials": + headers[header_name] = _apply_bearer(value) + elif scheme_type == "http": + if sub_type == "bearer": + headers[header_name] = _apply_bearer(value) + elif sub_type == "custom": + return + else: + raise ValueError("sub type {sub_type} not supported") + else: + raise ValueError("scheme type {scheme_type} not supported") + + +def _apply_bearer(token: str) -> str: + return token.lower().startswith("bearer ") and token or f"Bearer {token}" + + +def _parse_basic_auth_scheme(headers: Dict[str, str], scheme: Any): + username = "" + password = "" + + if not isinstance(scheme, BaseModel): + raise TypeError("basic auth scheme must be a pydantic model") + + scheme_fields: Dict[str, FieldInfo] = scheme.__class__.model_fields + for name in scheme_fields: + scheme_field = scheme_fields[name] + + metadata = find_field_metadata(scheme_field, SecurityMetadata) + if metadata is None or metadata.field_name is None: + continue + + field_name = metadata.field_name + value = getattr(scheme, name) + + if field_name == "username": + username = value + if field_name == "password": + password = value + + data = f"{username}:{password}".encode() + headers["Authorization"] = f"Basic {base64.b64encode(data).decode()}" diff --git a/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/utils/serializers.py b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/utils/serializers.py new file mode 100644 index 000000000..c5eb36597 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/utils/serializers.py @@ -0,0 +1,215 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from decimal import Decimal +import json +from typing import Any, Dict, List, Union, get_args +import httpx +from typing_extensions import get_origin +from pydantic import ConfigDict, create_model +from pydantic_core import from_json +from typing_inspect import is_optional_type + +from ..types.basemodel import BaseModel, Nullable, OptionalNullable, Unset + + +def serialize_decimal(as_str: bool): + def serialize(d): + if is_optional_type(type(d)) and d is None: + return None + if isinstance(d, Unset): + return d + + if not isinstance(d, Decimal): + raise ValueError("Expected Decimal object") + + return str(d) if as_str else float(d) + + return serialize + + +def validate_decimal(d): + if d is None: + return None + + if isinstance(d, (Decimal, Unset)): + return d + + if not isinstance(d, (str, int, float)): + raise ValueError("Expected string, int or float") + + return Decimal(str(d)) + + +def serialize_float(as_str: bool): + def serialize(f): + if is_optional_type(type(f)) and f is None: + return None + if isinstance(f, Unset): + return f + + if not isinstance(f, float): + raise ValueError("Expected float") + + return str(f) if as_str else f + + return serialize + + +def validate_float(f): + if f is None: + return None + + if isinstance(f, (float, Unset)): + return f + + if not isinstance(f, str): + raise ValueError("Expected string") + + return float(f) + + +def serialize_int(as_str: bool): + def serialize(i): + if is_optional_type(type(i)) and i is None: + return None + if isinstance(i, Unset): + return i + + if not isinstance(i, int): + raise ValueError("Expected int") + + return str(i) if as_str else i + + return serialize + + +def validate_int(b): + if b is None: + return None + + if isinstance(b, (int, Unset)): + return b + + if not isinstance(b, str): + raise ValueError("Expected string") + + return int(b) + + +def validate_open_enum(is_int: bool): + def validate(e): + if e is None: + return None + + if isinstance(e, Unset): + return e + + if is_int: + if not isinstance(e, int): + raise ValueError("Expected int") + else: + if not isinstance(e, str): + raise ValueError("Expected string") + + return e + + return validate + + +def validate_const(v): + def validate(c): + if is_optional_type(type(c)) and c is None: + return None + + if v != c: + raise ValueError(f"Expected {v}") + + return c + + return validate + + +def unmarshal_json(raw, typ: Any) -> Any: + return unmarshal(from_json(raw), typ) + + +def unmarshal(val, typ: Any) -> Any: + unmarshaller = create_model( + "Unmarshaller", + body=(typ, ...), + __config__=ConfigDict(populate_by_name=True, arbitrary_types_allowed=True), + ) + + m = unmarshaller(body=val) + + # pyright: ignore[reportAttributeAccessIssue] + return m.body # type: ignore + + +def marshal_json(val, typ): + if is_nullable(typ) and val is None: + return "null" + + marshaller = create_model( + "Marshaller", + body=(typ, ...), + __config__=ConfigDict(populate_by_name=True, arbitrary_types_allowed=True), + ) + + m = marshaller(body=val) + + d = m.model_dump(by_alias=True, mode="json", exclude_none=True) + + if len(d) == 0: + return "" + + return json.dumps(d[next(iter(d))], separators=(",", ":"), sort_keys=True) + + +def is_nullable(field): + origin = get_origin(field) + if origin is Nullable or origin is OptionalNullable: + return True + + if not origin is Union or type(None) not in get_args(field): + return False + + for arg in get_args(field): + if get_origin(arg) is Nullable or get_origin(arg) is OptionalNullable: + return True + + return False + + +def stream_to_text(stream: httpx.Response) -> str: + return "".join(stream.iter_text()) + + +async def stream_to_text_async(stream: httpx.Response) -> str: + return "".join([chunk async for chunk in stream.aiter_text()]) + + +def stream_to_bytes(stream: httpx.Response) -> bytes: + return stream.content + + +async def stream_to_bytes_async(stream: httpx.Response) -> bytes: + return await stream.aread() + + +def get_pydantic_model(data: Any, typ: Any) -> Any: + if not _contains_pydantic_model(data): + return unmarshal(data, typ) + + return data + + +def _contains_pydantic_model(data: Any) -> bool: + if isinstance(data, BaseModel): + return True + if isinstance(data, List): + return any(_contains_pydantic_model(item) for item in data) + if isinstance(data, Dict): + return any(_contains_pydantic_model(value) for value in data.values()) + + return False diff --git a/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/utils/url.py b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/utils/url.py new file mode 100644 index 000000000..c78ccbae4 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/utils/url.py @@ -0,0 +1,155 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from decimal import Decimal +from typing import ( + Any, + Dict, + get_type_hints, + List, + Optional, + Union, + get_args, + get_origin, +) +from pydantic import BaseModel +from pydantic.fields import FieldInfo + +from .metadata import ( + PathParamMetadata, + find_field_metadata, +) +from .values import ( + _get_serialized_params, + _is_set, + _populate_from_globals, + _val_to_string, +) + + +def generate_url( + server_url: str, + path: str, + path_params: Any, + gbls: Optional[Any] = None, +) -> str: + path_param_values: Dict[str, str] = {} + + globals_already_populated = _populate_path_params( + path_params, gbls, path_param_values, [] + ) + if _is_set(gbls): + _populate_path_params(gbls, None, path_param_values, globals_already_populated) + + for key, value in path_param_values.items(): + path = path.replace("{" + key + "}", value, 1) + + return remove_suffix(server_url, "/") + path + + +def _populate_path_params( + path_params: Any, + gbls: Any, + path_param_values: Dict[str, str], + skip_fields: List[str], +) -> List[str]: + globals_already_populated: List[str] = [] + + if not isinstance(path_params, BaseModel): + return globals_already_populated + + path_param_fields: Dict[str, FieldInfo] = path_params.__class__.model_fields + path_param_field_types = get_type_hints(path_params.__class__) + for name in path_param_fields: + if name in skip_fields: + continue + + field = path_param_fields[name] + + param_metadata = find_field_metadata(field, PathParamMetadata) + if param_metadata is None: + continue + + param = getattr(path_params, name) if _is_set(path_params) else None + param, global_found = _populate_from_globals( + name, param, PathParamMetadata, gbls + ) + if global_found: + globals_already_populated.append(name) + + if not _is_set(param): + continue + + f_name = field.alias if field.alias is not None else name + serialization = param_metadata.serialization + if serialization is not None: + serialized_params = _get_serialized_params( + param_metadata, f_name, param, path_param_field_types[name] + ) + for key, value in serialized_params.items(): + path_param_values[key] = value + else: + pp_vals: List[str] = [] + if param_metadata.style == "simple": + if isinstance(param, List): + for pp_val in param: + if not _is_set(pp_val): + continue + pp_vals.append(_val_to_string(pp_val)) + path_param_values[f_name] = ",".join(pp_vals) + elif isinstance(param, Dict): + for pp_key in param: + if not _is_set(param[pp_key]): + continue + if param_metadata.explode: + pp_vals.append(f"{pp_key}={_val_to_string(param[pp_key])}") + else: + pp_vals.append(f"{pp_key},{_val_to_string(param[pp_key])}") + path_param_values[f_name] = ",".join(pp_vals) + elif not isinstance(param, (str, int, float, complex, bool, Decimal)): + param_fields: Dict[str, FieldInfo] = param.__class__.model_fields + for name in param_fields: + param_field = param_fields[name] + + param_value_metadata = find_field_metadata( + param_field, PathParamMetadata + ) + if param_value_metadata is None: + continue + + param_name = ( + param_field.alias if param_field.alias is not None else name + ) + + param_field_val = getattr(param, name) + if not _is_set(param_field_val): + continue + if param_metadata.explode: + pp_vals.append( + f"{param_name}={_val_to_string(param_field_val)}" + ) + else: + pp_vals.append( + f"{param_name},{_val_to_string(param_field_val)}" + ) + path_param_values[f_name] = ",".join(pp_vals) + elif _is_set(param): + path_param_values[f_name] = _val_to_string(param) + + return globals_already_populated + + +def is_optional(field): + return get_origin(field) is Union and type(None) in get_args(field) + + +def template_url(url_with_params: str, params: Dict[str, str]) -> str: + for key, value in params.items(): + url_with_params = url_with_params.replace("{" + key + "}", value) + + return url_with_params + + +def remove_suffix(input_string, suffix): + if suffix and input_string.endswith(suffix): + return input_string[: -len(suffix)] + return input_string diff --git a/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/utils/values.py b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/utils/values.py new file mode 100644 index 000000000..2b4b68321 --- /dev/null +++ b/previous-versions/sync-for-payables-version-1/src/codat_sync_for_payables_version_1/utils/values.py @@ -0,0 +1,134 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from datetime import datetime +from enum import Enum +from email.message import Message +import os +from typing import Any, Callable, Dict, List, Optional, Tuple, TypeVar, Union + +from httpx import Response +from pydantic import BaseModel +from pydantic.fields import FieldInfo + +from ..types.basemodel import Unset + +from .serializers import marshal_json + +from .metadata import ParamMetadata, find_field_metadata + + +def match_content_type(content_type: str, pattern: str) -> bool: + if pattern in (content_type, "*", "*/*"): + return True + + msg = Message() + msg["content-type"] = content_type + media_type = msg.get_content_type() + + if media_type == pattern: + return True + + parts = media_type.split("/") + if len(parts) == 2: + if pattern in (f"{parts[0]}/*", f"*/{parts[1]}"): + return True + + return False + + +def match_status_codes(status_codes: List[str], status_code: int) -> bool: + if "default" in status_codes: + return True + + for code in status_codes: + if code == str(status_code): + return True + + if code.endswith("XX") and code.startswith(str(status_code)[:1]): + return True + return False + + +T = TypeVar("T") + + +def get_global_from_env( + value: Optional[T], env_key: str, type_cast: Callable[[str], T] +) -> Optional[T]: + if value is not None: + return value + env_value = os.getenv(env_key) + if env_value is not None: + try: + return type_cast(env_value) + except ValueError: + pass + return None + + +def match_response( + response: Response, code: Union[str, List[str]], content_type: str +) -> bool: + codes = code if isinstance(code, list) else [code] + return match_status_codes(codes, response.status_code) and match_content_type( + response.headers.get("content-type", "application/octet-stream"), content_type + ) + + +def _populate_from_globals( + param_name: str, value: Any, param_metadata_type: type, gbls: Any +) -> Tuple[Any, bool]: + if gbls is None: + return value, False + + if not isinstance(gbls, BaseModel): + raise TypeError("globals must be a pydantic model") + + global_fields: Dict[str, FieldInfo] = gbls.__class__.model_fields + found = False + for name in global_fields: + field = global_fields[name] + if name is not param_name: + continue + + found = True + + if value is not None: + return value, True + + global_value = getattr(gbls, name) + + param_metadata = find_field_metadata(field, param_metadata_type) + if param_metadata is None: + return value, True + + return global_value, True + + return value, found + + +def _val_to_string(val) -> str: + if isinstance(val, bool): + return str(val).lower() + if isinstance(val, datetime): + return str(val.isoformat().replace("+00:00", "Z")) + if isinstance(val, Enum): + return str(val.value) + + return str(val) + + +def _get_serialized_params( + metadata: ParamMetadata, field_name: str, obj: Any, typ: type +) -> Dict[str, str]: + params: Dict[str, str] = {} + + serialization = metadata.serialization + if serialization == "json": + params[field_name] = marshal_json(obj, typ) + + return params + + +def _is_set(value: Any) -> bool: + return value is not None and not isinstance(value, Unset) diff --git a/previous-versions/sync-for-payables-version-1/src/codatsyncpayables/__init__.py b/previous-versions/sync-for-payables-version-1/src/codatsyncpayables/__init__.py deleted file mode 100644 index e6c0deeb6..000000000 --- a/previous-versions/sync-for-payables-version-1/src/codatsyncpayables/__init__.py +++ /dev/null @@ -1,4 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from .sdk import * -from .sdkconfiguration import * diff --git a/previous-versions/sync-for-payables-version-1/src/codatsyncpayables/bills.py b/previous-versions/sync-for-payables-version-1/src/codatsyncpayables/bills.py deleted file mode 100644 index cb20d300b..000000000 --- a/previous-versions/sync-for-payables-version-1/src/codatsyncpayables/bills.py +++ /dev/null @@ -1,76 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from .sdkconfiguration import SDKConfiguration -from codatsyncpayables import utils -from codatsyncpayables.models import errors, operations, shared -from typing import Optional - -class Bills: - r"""Bills""" - sdk_configuration: SDKConfiguration - - def __init__(self, sdk_config: SDKConfiguration) -> None: - self.sdk_configuration = sdk_config - - - - def list(self, request: operations.ListBillsRequest, retries: Optional[utils.RetryConfig] = None) -> operations.ListBillsResponse: - r"""List bills - The *List bills* endpoint returns a list of [bills](https://docs.codat.io/sync-for-payables-api#/schemas/Bill) for a given company's connection. - - By default, the endpoint will return all bills irrespective of payment status. To filter outstanding bills use the `outstandingBills=true` query parameter to return all unpaid and partially paid bills. - - [Bills](https://docs.codat.io/sync-for-payables-api#/schemas/Bill) are invoices that represent the SMB's financial obligations to their supplier for a purchase of goods or services. - """ - base_url = utils.template_url(*self.sdk_configuration.get_server_details()) - - url = utils.generate_url(operations.ListBillsRequest, base_url, '/companies/{companyId}/connection/{connectionId}/payables/bills', request) - headers = {} - query_params = utils.get_query_params(operations.ListBillsRequest, request) - headers['Accept'] = 'application/json' - headers['user-agent'] = self.sdk_configuration.user_agent - - if callable(self.sdk_configuration.security): - client = utils.configure_security_client(self.sdk_configuration.client, self.sdk_configuration.security()) - else: - client = utils.configure_security_client(self.sdk_configuration.client, self.sdk_configuration.security) - - global_retry_config = self.sdk_configuration.retry_config - retry_config = retries - if retry_config is None: - if global_retry_config: - retry_config = global_retry_config - else: - retry_config = utils.RetryConfig('backoff', utils.BackoffStrategy(500, 60000, 1.5, 3600000), True) - - def do_request(): - return client.request('GET', url, params=query_params, headers=headers) - - http_res = utils.retry(do_request, utils.Retries(retry_config, [ - '408', - '429', - '5XX' - ])) - content_type = http_res.headers.get('Content-Type') - - res = operations.ListBillsResponse(status_code=http_res.status_code, content_type=content_type, raw_response=http_res) - - if http_res.status_code == 200: - if utils.match_content_type(content_type, 'application/json'): - out = utils.unmarshal_json(http_res.text, Optional[shared.Bills]) - res.bills = out - else: - raise errors.SDKError(f'unknown content-type received: {content_type}', http_res.status_code, http_res.text, http_res) - elif http_res.status_code in [400, 401, 402, 403, 404, 409, 429, 500, 503]: - if utils.match_content_type(content_type, 'application/json'): - out = utils.unmarshal_json(http_res.text, errors.ErrorMessage) - out.raw_response = http_res - raise out - else: - raise errors.SDKError(f'unknown content-type received: {content_type}', http_res.status_code, http_res.text, http_res) - elif http_res.status_code >= 400 and http_res.status_code < 500 or http_res.status_code >= 500 and http_res.status_code < 600: - raise errors.SDKError('API error occurred', http_res.status_code, http_res.text, http_res) - - return res - - \ No newline at end of file diff --git a/previous-versions/sync-for-payables-version-1/src/codatsyncpayables/companies.py b/previous-versions/sync-for-payables-version-1/src/codatsyncpayables/companies.py deleted file mode 100644 index b636a78a1..000000000 --- a/previous-versions/sync-for-payables-version-1/src/codatsyncpayables/companies.py +++ /dev/null @@ -1,316 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from .sdkconfiguration import SDKConfiguration -from codatsyncpayables import utils -from codatsyncpayables.models import errors, operations, shared -from typing import Optional - -class Companies: - r"""Create and manage your Codat companies.""" - sdk_configuration: SDKConfiguration - - def __init__(self, sdk_config: SDKConfiguration) -> None: - self.sdk_configuration = sdk_config - - - - def create(self, request: Optional[shared.CompanyRequestBody], retries: Optional[utils.RetryConfig] = None) -> operations.CreateCompanyResponse: - r"""Create company - Use the *Create company* endpoint to create a new [company](https://docs.codat.io/sync-for-payables-api#/schemas/Company) that represents your customer in Codat. - - A [company](https://docs.codat.io/sync-for-payables-api#/schemas/Company) represents a business sharing access to their data. - Each company can have multiple [connections](https://docs.codat.io/sync-for-payables-api#/schemas/Connection) to different data sources, such as one connection to Xero for accounting data, two connections to Plaid for two bank accounts, and a connection to Zettle for POS data. - - If forbidden characters (see `name` pattern) are present in the request, a company will be created with the forbidden characters removed. For example, `Company (Codat[1])` with be created as `Company Codat1`. - """ - base_url = utils.template_url(*self.sdk_configuration.get_server_details()) - - url = base_url + '/companies' - headers = {} - req_content_type, data, form = utils.serialize_request_body(request, Optional[shared.CompanyRequestBody], "request", False, True, 'json') - if req_content_type not in ('multipart/form-data', 'multipart/mixed'): - headers['content-type'] = req_content_type - headers['Accept'] = 'application/json' - headers['user-agent'] = self.sdk_configuration.user_agent - - if callable(self.sdk_configuration.security): - client = utils.configure_security_client(self.sdk_configuration.client, self.sdk_configuration.security()) - else: - client = utils.configure_security_client(self.sdk_configuration.client, self.sdk_configuration.security) - - global_retry_config = self.sdk_configuration.retry_config - retry_config = retries - if retry_config is None: - if global_retry_config: - retry_config = global_retry_config - else: - retry_config = utils.RetryConfig('backoff', utils.BackoffStrategy(500, 60000, 1.5, 3600000), True) - - def do_request(): - return client.request('POST', url, data=data, files=form, headers=headers) - - http_res = utils.retry(do_request, utils.Retries(retry_config, [ - '408', - '429', - '5XX' - ])) - content_type = http_res.headers.get('Content-Type') - - res = operations.CreateCompanyResponse(status_code=http_res.status_code, content_type=content_type, raw_response=http_res) - - if http_res.status_code == 200: - if utils.match_content_type(content_type, 'application/json'): - out = utils.unmarshal_json(http_res.text, Optional[shared.Company]) - res.company = out - else: - raise errors.SDKError(f'unknown content-type received: {content_type}', http_res.status_code, http_res.text, http_res) - elif http_res.status_code in [400, 401, 402, 403, 429, 500, 503]: - if utils.match_content_type(content_type, 'application/json'): - out = utils.unmarshal_json(http_res.text, errors.ErrorMessage) - out.raw_response = http_res - raise out - else: - raise errors.SDKError(f'unknown content-type received: {content_type}', http_res.status_code, http_res.text, http_res) - elif http_res.status_code >= 400 and http_res.status_code < 500 or http_res.status_code >= 500 and http_res.status_code < 600: - raise errors.SDKError('API error occurred', http_res.status_code, http_res.text, http_res) - - return res - - - - def delete(self, request: operations.DeleteCompanyRequest, retries: Optional[utils.RetryConfig] = None) -> operations.DeleteCompanyResponse: - r"""Delete a company - The *Delete company* endpoint permanently deletes a [company](https://docs.codat.io/sync-for-payables-api#/schemas/Company), its [connections](https://docs.codat.io/sync-for-payables-api#/schemas/Connection) and any cached data. This operation is irreversible. - - A [company](https://docs.codat.io/sync-for-payables-api#/schemas/Company) represents a business sharing access to their data. - Each company can have multiple [connections](https://docs.codat.io/sync-for-payables-api#/schemas/Connection) to different data sources, such as one connection to Xero for accounting data, two connections to Plaid for two bank accounts, and a connection to Zettle for POS data. - """ - base_url = utils.template_url(*self.sdk_configuration.get_server_details()) - - url = utils.generate_url(operations.DeleteCompanyRequest, base_url, '/companies/{companyId}', request) - headers = {} - headers['Accept'] = 'application/json' - headers['user-agent'] = self.sdk_configuration.user_agent - - if callable(self.sdk_configuration.security): - client = utils.configure_security_client(self.sdk_configuration.client, self.sdk_configuration.security()) - else: - client = utils.configure_security_client(self.sdk_configuration.client, self.sdk_configuration.security) - - global_retry_config = self.sdk_configuration.retry_config - retry_config = retries - if retry_config is None: - if global_retry_config: - retry_config = global_retry_config - else: - retry_config = utils.RetryConfig('backoff', utils.BackoffStrategy(500, 60000, 1.5, 3600000), True) - - def do_request(): - return client.request('DELETE', url, headers=headers) - - http_res = utils.retry(do_request, utils.Retries(retry_config, [ - '408', - '429', - '5XX' - ])) - content_type = http_res.headers.get('Content-Type') - - res = operations.DeleteCompanyResponse(status_code=http_res.status_code, content_type=content_type, raw_response=http_res) - - if http_res.status_code == 204: - pass - elif http_res.status_code in [401, 402, 403, 404, 429, 500, 503]: - if utils.match_content_type(content_type, 'application/json'): - out = utils.unmarshal_json(http_res.text, errors.ErrorMessage) - out.raw_response = http_res - raise out - else: - raise errors.SDKError(f'unknown content-type received: {content_type}', http_res.status_code, http_res.text, http_res) - elif http_res.status_code >= 400 and http_res.status_code < 500 or http_res.status_code >= 500 and http_res.status_code < 600: - raise errors.SDKError('API error occurred', http_res.status_code, http_res.text, http_res) - - return res - - - - def get(self, request: operations.GetCompanyRequest, retries: Optional[utils.RetryConfig] = None) -> operations.GetCompanyResponse: - r"""Get company - The *Get company* endpoint returns a single company for a given `companyId`. - - A [company](https://docs.codat.io/sync-for-payables-api#/schemas/Company) represents a business sharing access to their data. - Each company can have multiple [connections](https://docs.codat.io/sync-for-payables-api#/schemas/Connection) to different data sources, such as one connection to Xero for accounting data, two connections to Plaid for two bank accounts, and a connection to Zettle for POS data. - """ - base_url = utils.template_url(*self.sdk_configuration.get_server_details()) - - url = utils.generate_url(operations.GetCompanyRequest, base_url, '/companies/{companyId}', request) - headers = {} - headers['Accept'] = 'application/json' - headers['user-agent'] = self.sdk_configuration.user_agent - - if callable(self.sdk_configuration.security): - client = utils.configure_security_client(self.sdk_configuration.client, self.sdk_configuration.security()) - else: - client = utils.configure_security_client(self.sdk_configuration.client, self.sdk_configuration.security) - - global_retry_config = self.sdk_configuration.retry_config - retry_config = retries - if retry_config is None: - if global_retry_config: - retry_config = global_retry_config - else: - retry_config = utils.RetryConfig('backoff', utils.BackoffStrategy(500, 60000, 1.5, 3600000), True) - - def do_request(): - return client.request('GET', url, headers=headers) - - http_res = utils.retry(do_request, utils.Retries(retry_config, [ - '408', - '429', - '5XX' - ])) - content_type = http_res.headers.get('Content-Type') - - res = operations.GetCompanyResponse(status_code=http_res.status_code, content_type=content_type, raw_response=http_res) - - if http_res.status_code == 200: - if utils.match_content_type(content_type, 'application/json'): - out = utils.unmarshal_json(http_res.text, Optional[shared.Company]) - res.company = out - else: - raise errors.SDKError(f'unknown content-type received: {content_type}', http_res.status_code, http_res.text, http_res) - elif http_res.status_code in [401, 402, 403, 404, 429, 500, 503]: - if utils.match_content_type(content_type, 'application/json'): - out = utils.unmarshal_json(http_res.text, errors.ErrorMessage) - out.raw_response = http_res - raise out - else: - raise errors.SDKError(f'unknown content-type received: {content_type}', http_res.status_code, http_res.text, http_res) - elif http_res.status_code >= 400 and http_res.status_code < 500 or http_res.status_code >= 500 and http_res.status_code < 600: - raise errors.SDKError('API error occurred', http_res.status_code, http_res.text, http_res) - - return res - - - - def list(self, request: operations.ListCompaniesRequest, retries: Optional[utils.RetryConfig] = None) -> operations.ListCompaniesResponse: - r"""List companies - The *List companies* endpoint returns a list of [companies] associated to your instances. - - A [company](https://docs.codat.io/sync-for-payables-api#/schemas/Company) represents a business sharing access to their data. - Each company can have multiple [connections](https://docs.codat.io/sync-for-payables-api#/schemas/Connection) to different data sources, such as one connection to Xero for accounting data, two connections to Plaid for two bank accounts, and a connection to Zettle for POS data. - """ - base_url = utils.template_url(*self.sdk_configuration.get_server_details()) - - url = base_url + '/companies' - headers = {} - query_params = utils.get_query_params(operations.ListCompaniesRequest, request) - headers['Accept'] = 'application/json' - headers['user-agent'] = self.sdk_configuration.user_agent - - if callable(self.sdk_configuration.security): - client = utils.configure_security_client(self.sdk_configuration.client, self.sdk_configuration.security()) - else: - client = utils.configure_security_client(self.sdk_configuration.client, self.sdk_configuration.security) - - global_retry_config = self.sdk_configuration.retry_config - retry_config = retries - if retry_config is None: - if global_retry_config: - retry_config = global_retry_config - else: - retry_config = utils.RetryConfig('backoff', utils.BackoffStrategy(500, 60000, 1.5, 3600000), True) - - def do_request(): - return client.request('GET', url, params=query_params, headers=headers) - - http_res = utils.retry(do_request, utils.Retries(retry_config, [ - '408', - '429', - '5XX' - ])) - content_type = http_res.headers.get('Content-Type') - - res = operations.ListCompaniesResponse(status_code=http_res.status_code, content_type=content_type, raw_response=http_res) - - if http_res.status_code == 200: - if utils.match_content_type(content_type, 'application/json'): - out = utils.unmarshal_json(http_res.text, Optional[shared.Companies]) - res.companies = out - else: - raise errors.SDKError(f'unknown content-type received: {content_type}', http_res.status_code, http_res.text, http_res) - elif http_res.status_code in [400, 401, 402, 403, 404, 429, 500, 503]: - if utils.match_content_type(content_type, 'application/json'): - out = utils.unmarshal_json(http_res.text, errors.ErrorMessage) - out.raw_response = http_res - raise out - else: - raise errors.SDKError(f'unknown content-type received: {content_type}', http_res.status_code, http_res.text, http_res) - elif http_res.status_code >= 400 and http_res.status_code < 500 or http_res.status_code >= 500 and http_res.status_code < 600: - raise errors.SDKError('API error occurred', http_res.status_code, http_res.text, http_res) - - return res - - - - def update(self, request: operations.UpdateCompanyRequest, retries: Optional[utils.RetryConfig] = None) -> operations.UpdateCompanyResponse: - r"""Update company - Use the *Update company* endpoint to update both the name and description of the company. - If you use [groups](https://docs.codat.io/sync-for-payables-api#/schemas/Group) to manage a set of companies, use the [Add company](https://docs.codat.io/sync-for-payables-api#/operations/add-company-to-group) or [Remove company](https://docs.codat.io/sync-for-payables-api#/operations/remove-company-from-group) endpoints to add or remove a company from a group. - - A [company](https://docs.codat.io/sync-for-payables-api#/schemas/Company) represents a business sharing access to their data. - Each company can have multiple [connections](https://docs.codat.io/sync-for-payables-api#/schemas/Connection) to different data sources, such as one connection to Xero for accounting data, two connections to Plaid for two bank accounts, and a connection to Zettle for POS data. - """ - base_url = utils.template_url(*self.sdk_configuration.get_server_details()) - - url = utils.generate_url(operations.UpdateCompanyRequest, base_url, '/companies/{companyId}', request) - headers = {} - req_content_type, data, form = utils.serialize_request_body(request, operations.UpdateCompanyRequest, "company_request_body", False, True, 'json') - if req_content_type not in ('multipart/form-data', 'multipart/mixed'): - headers['content-type'] = req_content_type - headers['Accept'] = 'application/json' - headers['user-agent'] = self.sdk_configuration.user_agent - - if callable(self.sdk_configuration.security): - client = utils.configure_security_client(self.sdk_configuration.client, self.sdk_configuration.security()) - else: - client = utils.configure_security_client(self.sdk_configuration.client, self.sdk_configuration.security) - - global_retry_config = self.sdk_configuration.retry_config - retry_config = retries - if retry_config is None: - if global_retry_config: - retry_config = global_retry_config - else: - retry_config = utils.RetryConfig('backoff', utils.BackoffStrategy(500, 60000, 1.5, 3600000), True) - - def do_request(): - return client.request('PUT', url, data=data, files=form, headers=headers) - - http_res = utils.retry(do_request, utils.Retries(retry_config, [ - '408', - '429', - '5XX' - ])) - content_type = http_res.headers.get('Content-Type') - - res = operations.UpdateCompanyResponse(status_code=http_res.status_code, content_type=content_type, raw_response=http_res) - - if http_res.status_code == 200: - if utils.match_content_type(content_type, 'application/json'): - out = utils.unmarshal_json(http_res.text, Optional[shared.Company]) - res.company = out - else: - raise errors.SDKError(f'unknown content-type received: {content_type}', http_res.status_code, http_res.text, http_res) - elif http_res.status_code in [401, 402, 403, 404, 429, 500, 503]: - if utils.match_content_type(content_type, 'application/json'): - out = utils.unmarshal_json(http_res.text, errors.ErrorMessage) - out.raw_response = http_res - raise out - else: - raise errors.SDKError(f'unknown content-type received: {content_type}', http_res.status_code, http_res.text, http_res) - elif http_res.status_code >= 400 and http_res.status_code < 500 or http_res.status_code >= 500 and http_res.status_code < 600: - raise errors.SDKError('API error occurred', http_res.status_code, http_res.text, http_res) - - return res - - \ No newline at end of file diff --git a/previous-versions/sync-for-payables-version-1/src/codatsyncpayables/connections.py b/previous-versions/sync-for-payables-version-1/src/codatsyncpayables/connections.py deleted file mode 100644 index 61dd061a3..000000000 --- a/previous-versions/sync-for-payables-version-1/src/codatsyncpayables/connections.py +++ /dev/null @@ -1,301 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from .sdkconfiguration import SDKConfiguration -from codatsyncpayables import utils -from codatsyncpayables.models import errors, operations, shared -from typing import Optional - -class Connections: - r"""Manage your companies' data connections.""" - sdk_configuration: SDKConfiguration - - def __init__(self, sdk_config: SDKConfiguration) -> None: - self.sdk_configuration = sdk_config - - - - def create(self, request: operations.CreateConnectionRequest, retries: Optional[utils.RetryConfig] = None) -> operations.CreateConnectionResponse: - r"""Create connection - Creates a connection for the company by providing a valid `platformKey`. - - Use the [List Integrations](https://docs.codat.io/sync-for-payables-api#/operations/list-integrations) endpoint to access valid platform keys. - """ - base_url = utils.template_url(*self.sdk_configuration.get_server_details()) - - url = utils.generate_url(operations.CreateConnectionRequest, base_url, '/companies/{companyId}/connections', request) - headers = {} - req_content_type, data, form = utils.serialize_request_body(request, operations.CreateConnectionRequest, "request_body", False, True, 'json') - if req_content_type not in ('multipart/form-data', 'multipart/mixed'): - headers['content-type'] = req_content_type - headers['Accept'] = 'application/json' - headers['user-agent'] = self.sdk_configuration.user_agent - - if callable(self.sdk_configuration.security): - client = utils.configure_security_client(self.sdk_configuration.client, self.sdk_configuration.security()) - else: - client = utils.configure_security_client(self.sdk_configuration.client, self.sdk_configuration.security) - - global_retry_config = self.sdk_configuration.retry_config - retry_config = retries - if retry_config is None: - if global_retry_config: - retry_config = global_retry_config - else: - retry_config = utils.RetryConfig('backoff', utils.BackoffStrategy(500, 60000, 1.5, 3600000), True) - - def do_request(): - return client.request('POST', url, data=data, files=form, headers=headers) - - http_res = utils.retry(do_request, utils.Retries(retry_config, [ - '408', - '429', - '5XX' - ])) - content_type = http_res.headers.get('Content-Type') - - res = operations.CreateConnectionResponse(status_code=http_res.status_code, content_type=content_type, raw_response=http_res) - - if http_res.status_code == 200: - if utils.match_content_type(content_type, 'application/json'): - out = utils.unmarshal_json(http_res.text, Optional[shared.Connection]) - res.connection = out - else: - raise errors.SDKError(f'unknown content-type received: {content_type}', http_res.status_code, http_res.text, http_res) - elif http_res.status_code in [401, 402, 403, 404, 429, 500, 503]: - if utils.match_content_type(content_type, 'application/json'): - out = utils.unmarshal_json(http_res.text, errors.ErrorMessage) - out.raw_response = http_res - raise out - else: - raise errors.SDKError(f'unknown content-type received: {content_type}', http_res.status_code, http_res.text, http_res) - elif http_res.status_code >= 400 and http_res.status_code < 500 or http_res.status_code >= 500 and http_res.status_code < 600: - raise errors.SDKError('API error occurred', http_res.status_code, http_res.text, http_res) - - return res - - - - def delete(self, request: operations.DeleteConnectionRequest, retries: Optional[utils.RetryConfig] = None) -> operations.DeleteConnectionResponse: - r"""Delete connection - Revoke and remove a connection from a company. - This operation is not reversible. The end user would need to reauthorize a new data connection if you wish to view new data for this company. - """ - base_url = utils.template_url(*self.sdk_configuration.get_server_details()) - - url = utils.generate_url(operations.DeleteConnectionRequest, base_url, '/companies/{companyId}/connections/{connectionId}', request) - headers = {} - headers['Accept'] = 'application/json' - headers['user-agent'] = self.sdk_configuration.user_agent - - if callable(self.sdk_configuration.security): - client = utils.configure_security_client(self.sdk_configuration.client, self.sdk_configuration.security()) - else: - client = utils.configure_security_client(self.sdk_configuration.client, self.sdk_configuration.security) - - global_retry_config = self.sdk_configuration.retry_config - retry_config = retries - if retry_config is None: - if global_retry_config: - retry_config = global_retry_config - else: - retry_config = utils.RetryConfig('backoff', utils.BackoffStrategy(500, 60000, 1.5, 3600000), True) - - def do_request(): - return client.request('DELETE', url, headers=headers) - - http_res = utils.retry(do_request, utils.Retries(retry_config, [ - '408', - '429', - '5XX' - ])) - content_type = http_res.headers.get('Content-Type') - - res = operations.DeleteConnectionResponse(status_code=http_res.status_code, content_type=content_type, raw_response=http_res) - - if http_res.status_code == 200: - pass - elif http_res.status_code in [401, 402, 403, 404, 429, 500, 503]: - if utils.match_content_type(content_type, 'application/json'): - out = utils.unmarshal_json(http_res.text, errors.ErrorMessage) - out.raw_response = http_res - raise out - else: - raise errors.SDKError(f'unknown content-type received: {content_type}', http_res.status_code, http_res.text, http_res) - elif http_res.status_code >= 400 and http_res.status_code < 500 or http_res.status_code >= 500 and http_res.status_code < 600: - raise errors.SDKError('API error occurred', http_res.status_code, http_res.text, http_res) - - return res - - - - def get(self, request: operations.GetConnectionRequest, retries: Optional[utils.RetryConfig] = None) -> operations.GetConnectionResponse: - r"""Get connection - Returns a specific connection for a company when valid identifiers are provided. If the identifiers are for a deleted company and/or connection, a not found response is returned. - """ - base_url = utils.template_url(*self.sdk_configuration.get_server_details()) - - url = utils.generate_url(operations.GetConnectionRequest, base_url, '/companies/{companyId}/connections/{connectionId}', request) - headers = {} - headers['Accept'] = 'application/json' - headers['user-agent'] = self.sdk_configuration.user_agent - - if callable(self.sdk_configuration.security): - client = utils.configure_security_client(self.sdk_configuration.client, self.sdk_configuration.security()) - else: - client = utils.configure_security_client(self.sdk_configuration.client, self.sdk_configuration.security) - - global_retry_config = self.sdk_configuration.retry_config - retry_config = retries - if retry_config is None: - if global_retry_config: - retry_config = global_retry_config - else: - retry_config = utils.RetryConfig('backoff', utils.BackoffStrategy(500, 60000, 1.5, 3600000), True) - - def do_request(): - return client.request('GET', url, headers=headers) - - http_res = utils.retry(do_request, utils.Retries(retry_config, [ - '408', - '429', - '5XX' - ])) - content_type = http_res.headers.get('Content-Type') - - res = operations.GetConnectionResponse(status_code=http_res.status_code, content_type=content_type, raw_response=http_res) - - if http_res.status_code == 200: - if utils.match_content_type(content_type, 'application/json'): - out = utils.unmarshal_json(http_res.text, Optional[shared.Connection]) - res.connection = out - else: - raise errors.SDKError(f'unknown content-type received: {content_type}', http_res.status_code, http_res.text, http_res) - elif http_res.status_code in [401, 402, 403, 404, 429, 500, 503]: - if utils.match_content_type(content_type, 'application/json'): - out = utils.unmarshal_json(http_res.text, errors.ErrorMessage) - out.raw_response = http_res - raise out - else: - raise errors.SDKError(f'unknown content-type received: {content_type}', http_res.status_code, http_res.text, http_res) - elif http_res.status_code >= 400 and http_res.status_code < 500 or http_res.status_code >= 500 and http_res.status_code < 600: - raise errors.SDKError('API error occurred', http_res.status_code, http_res.text, http_res) - - return res - - - - def list(self, request: operations.ListConnectionsRequest, retries: Optional[utils.RetryConfig] = None) -> operations.ListConnectionsResponse: - r"""List connections - List the connections for a company. - """ - base_url = utils.template_url(*self.sdk_configuration.get_server_details()) - - url = utils.generate_url(operations.ListConnectionsRequest, base_url, '/companies/{companyId}/connections', request) - headers = {} - query_params = utils.get_query_params(operations.ListConnectionsRequest, request) - headers['Accept'] = 'application/json' - headers['user-agent'] = self.sdk_configuration.user_agent - - if callable(self.sdk_configuration.security): - client = utils.configure_security_client(self.sdk_configuration.client, self.sdk_configuration.security()) - else: - client = utils.configure_security_client(self.sdk_configuration.client, self.sdk_configuration.security) - - global_retry_config = self.sdk_configuration.retry_config - retry_config = retries - if retry_config is None: - if global_retry_config: - retry_config = global_retry_config - else: - retry_config = utils.RetryConfig('backoff', utils.BackoffStrategy(500, 60000, 1.5, 3600000), True) - - def do_request(): - return client.request('GET', url, params=query_params, headers=headers) - - http_res = utils.retry(do_request, utils.Retries(retry_config, [ - '408', - '429', - '5XX' - ])) - content_type = http_res.headers.get('Content-Type') - - res = operations.ListConnectionsResponse(status_code=http_res.status_code, content_type=content_type, raw_response=http_res) - - if http_res.status_code == 200: - if utils.match_content_type(content_type, 'application/json'): - out = utils.unmarshal_json(http_res.text, Optional[shared.Connections]) - res.connections = out - else: - raise errors.SDKError(f'unknown content-type received: {content_type}', http_res.status_code, http_res.text, http_res) - elif http_res.status_code in [400, 401, 402, 403, 404, 429, 500, 503]: - if utils.match_content_type(content_type, 'application/json'): - out = utils.unmarshal_json(http_res.text, errors.ErrorMessage) - out.raw_response = http_res - raise out - else: - raise errors.SDKError(f'unknown content-type received: {content_type}', http_res.status_code, http_res.text, http_res) - elif http_res.status_code >= 400 and http_res.status_code < 500 or http_res.status_code >= 500 and http_res.status_code < 600: - raise errors.SDKError('API error occurred', http_res.status_code, http_res.text, http_res) - - return res - - - - def unlink(self, request: operations.UnlinkConnectionRequest, retries: Optional[utils.RetryConfig] = None) -> operations.UnlinkConnectionResponse: - r"""Unlink connection - This allows you to deauthorize a connection, without deleting it from Codat. This means you can still view any data that has previously been pulled into Codat, and also lets you re-authorize in future if your customer wishes to resume sharing their data. - """ - base_url = utils.template_url(*self.sdk_configuration.get_server_details()) - - url = utils.generate_url(operations.UnlinkConnectionRequest, base_url, '/companies/{companyId}/connections/{connectionId}', request) - headers = {} - req_content_type, data, form = utils.serialize_request_body(request, operations.UnlinkConnectionRequest, "request_body", False, True, 'json') - if req_content_type not in ('multipart/form-data', 'multipart/mixed'): - headers['content-type'] = req_content_type - headers['Accept'] = 'application/json' - headers['user-agent'] = self.sdk_configuration.user_agent - - if callable(self.sdk_configuration.security): - client = utils.configure_security_client(self.sdk_configuration.client, self.sdk_configuration.security()) - else: - client = utils.configure_security_client(self.sdk_configuration.client, self.sdk_configuration.security) - - global_retry_config = self.sdk_configuration.retry_config - retry_config = retries - if retry_config is None: - if global_retry_config: - retry_config = global_retry_config - else: - retry_config = utils.RetryConfig('backoff', utils.BackoffStrategy(500, 60000, 1.5, 3600000), True) - - def do_request(): - return client.request('PATCH', url, data=data, files=form, headers=headers) - - http_res = utils.retry(do_request, utils.Retries(retry_config, [ - '408', - '429', - '5XX' - ])) - content_type = http_res.headers.get('Content-Type') - - res = operations.UnlinkConnectionResponse(status_code=http_res.status_code, content_type=content_type, raw_response=http_res) - - if http_res.status_code == 200: - if utils.match_content_type(content_type, 'application/json'): - out = utils.unmarshal_json(http_res.text, Optional[shared.Connection]) - res.connection = out - else: - raise errors.SDKError(f'unknown content-type received: {content_type}', http_res.status_code, http_res.text, http_res) - elif http_res.status_code in [401, 402, 403, 404, 429, 500, 503]: - if utils.match_content_type(content_type, 'application/json'): - out = utils.unmarshal_json(http_res.text, errors.ErrorMessage) - out.raw_response = http_res - raise out - else: - raise errors.SDKError(f'unknown content-type received: {content_type}', http_res.status_code, http_res.text, http_res) - elif http_res.status_code >= 400 and http_res.status_code < 500 or http_res.status_code >= 500 and http_res.status_code < 600: - raise errors.SDKError('API error occurred', http_res.status_code, http_res.text, http_res) - - return res - - \ No newline at end of file diff --git a/previous-versions/sync-for-payables-version-1/src/codatsyncpayables/models/__init__.py b/previous-versions/sync-for-payables-version-1/src/codatsyncpayables/models/__init__.py deleted file mode 100644 index 722bb9982..000000000 --- a/previous-versions/sync-for-payables-version-1/src/codatsyncpayables/models/__init__.py +++ /dev/null @@ -1,4 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - - -# package diff --git a/previous-versions/sync-for-payables-version-1/src/codatsyncpayables/models/errors/__init__.py b/previous-versions/sync-for-payables-version-1/src/codatsyncpayables/models/errors/__init__.py deleted file mode 100644 index bf15fd116..000000000 --- a/previous-versions/sync-for-payables-version-1/src/codatsyncpayables/models/errors/__init__.py +++ /dev/null @@ -1,6 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from .errormessage import * -from .sdkerror import * - -__all__ = ["ErrorMessage","SDKError"] diff --git a/previous-versions/sync-for-payables-version-1/src/codatsyncpayables/models/errors/errormessage.py b/previous-versions/sync-for-payables-version-1/src/codatsyncpayables/models/errors/errormessage.py deleted file mode 100644 index 1f086ea56..000000000 --- a/previous-versions/sync-for-payables-version-1/src/codatsyncpayables/models/errors/errormessage.py +++ /dev/null @@ -1,34 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -import dataclasses -from ...models.shared import errorvalidation as shared_errorvalidation -from codatsyncpayables import utils -from dataclasses_json import Undefined, dataclass_json -from typing import Optional - - -@dataclass_json(undefined=Undefined.EXCLUDE) - -@dataclasses.dataclass -class ErrorMessage(Exception): - r"""The request made is not valid.""" - UNSET='__SPEAKEASY_UNSET__' - can_be_retried: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('canBeRetried'), 'exclude': lambda f: f is None }}) - r"""`True` if the error occurred transiently and can be retried.""" - correlation_id: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('correlationId'), 'exclude': lambda f: f is None }}) - r"""Unique identifier used to propagate to all downstream services and determine the source of the error.""" - detailed_error_code: Optional[int] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('detailedErrorCode'), 'exclude': lambda f: f is None }}) - r"""Machine readable error code used to automate processes based on the code returned.""" - error: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('error'), 'exclude': lambda f: f is None }}) - r"""A brief description of the error.""" - service: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('service'), 'exclude': lambda f: f is None }}) - r"""Codat's service the returned the error.""" - status_code: Optional[int] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('statusCode'), 'exclude': lambda f: f is None }}) - r"""The HTTP status code returned by the error.""" - validation: Optional[shared_errorvalidation.ErrorValidation] = dataclasses.field(default=UNSET, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('validation'), 'exclude': lambda f: f is ErrorMessage.UNSET }}) - r"""A human-readable object describing validation decisions Codat has made. If an operation has failed because of validation errors, they will be detailed here.""" - - - def __str__(self) -> str: - return utils.marshal_json(self, type(self)) diff --git a/previous-versions/sync-for-payables-version-1/src/codatsyncpayables/models/errors/sdkerror.py b/previous-versions/sync-for-payables-version-1/src/codatsyncpayables/models/errors/sdkerror.py deleted file mode 100644 index 6bb02bbd6..000000000 --- a/previous-versions/sync-for-payables-version-1/src/codatsyncpayables/models/errors/sdkerror.py +++ /dev/null @@ -1,24 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -import requests as requests_http - - -class SDKError(Exception): - """Represents an error returned by the API.""" - message: str - status_code: int - body: str - raw_response: requests_http.Response - - def __init__(self, message: str, status_code: int, body: str, raw_response: requests_http.Response): - self.message = message - self.status_code = status_code - self.body = body - self.raw_response = raw_response - - def __str__(self): - body = '' - if len(self.body) > 0: - body = f'\n{self.body}' - - return f'{self.message}: Status {self.status_code}{body}' diff --git a/previous-versions/sync-for-payables-version-1/src/codatsyncpayables/models/operations/__init__.py b/previous-versions/sync-for-payables-version-1/src/codatsyncpayables/models/operations/__init__.py deleted file mode 100644 index 8fde14239..000000000 --- a/previous-versions/sync-for-payables-version-1/src/codatsyncpayables/models/operations/__init__.py +++ /dev/null @@ -1,15 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from .create_company import * -from .create_connection import * -from .delete_company import * -from .delete_connection import * -from .get_company import * -from .get_connection import * -from .list_bills import * -from .list_companies import * -from .list_connections import * -from .unlink_connection import * -from .update_company import * - -__all__ = ["CreateCompanyResponse","CreateConnectionRequest","CreateConnectionRequestBody","CreateConnectionResponse","DeleteCompanyRequest","DeleteCompanyResponse","DeleteConnectionRequest","DeleteConnectionResponse","GetCompanyRequest","GetCompanyResponse","GetConnectionRequest","GetConnectionResponse","ListBillsRequest","ListBillsResponse","ListCompaniesRequest","ListCompaniesResponse","ListConnectionsRequest","ListConnectionsResponse","UnlinkConnectionRequest","UnlinkConnectionResponse","UnlinkConnectionUpdateConnection","UpdateCompanyRequest","UpdateCompanyResponse"] diff --git a/previous-versions/sync-for-payables-version-1/src/codatsyncpayables/models/operations/create_company.py b/previous-versions/sync-for-payables-version-1/src/codatsyncpayables/models/operations/create_company.py deleted file mode 100644 index d7751fcaf..000000000 --- a/previous-versions/sync-for-payables-version-1/src/codatsyncpayables/models/operations/create_company.py +++ /dev/null @@ -1,21 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -import dataclasses -import requests as requests_http -from ...models.shared import company as shared_company -from typing import Optional - - -@dataclasses.dataclass -class CreateCompanyResponse: - content_type: str = dataclasses.field() - r"""HTTP response content type for this operation""" - status_code: int = dataclasses.field() - r"""HTTP response status code for this operation""" - raw_response: requests_http.Response = dataclasses.field() - r"""Raw HTTP response; suitable for custom response parsing""" - company: Optional[shared_company.Company] = dataclasses.field(default=None) - r"""OK""" - - diff --git a/previous-versions/sync-for-payables-version-1/src/codatsyncpayables/models/operations/create_connection.py b/previous-versions/sync-for-payables-version-1/src/codatsyncpayables/models/operations/create_connection.py deleted file mode 100644 index b44a098df..000000000 --- a/previous-versions/sync-for-payables-version-1/src/codatsyncpayables/models/operations/create_connection.py +++ /dev/null @@ -1,41 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -import dataclasses -import requests as requests_http -from ...models.shared import connection as shared_connection -from codatsyncpayables import utils -from dataclasses_json import Undefined, dataclass_json -from typing import Optional - - -@dataclass_json(undefined=Undefined.EXCLUDE) -@dataclasses.dataclass -class CreateConnectionRequestBody: - platform_key: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('platformKey'), 'exclude': lambda f: f is None }}) - r"""A unique 4-letter key to represent a platform in each integration. View [accounting](https://docs.codat.io/integrations/accounting/overview#platform-keys), [banking](https://docs.codat.io/integrations/banking/overview#platform-keys), and [commerce](https://docs.codat.io/integrations/commerce/overview#platform-keys) platform keys.""" - - - - -@dataclasses.dataclass -class CreateConnectionRequest: - company_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'companyId', 'style': 'simple', 'explode': False }}) - r"""Unique identifier for a company.""" - request_body: Optional[CreateConnectionRequestBody] = dataclasses.field(default=None, metadata={'request': { 'media_type': 'application/json' }}) - - - - -@dataclasses.dataclass -class CreateConnectionResponse: - content_type: str = dataclasses.field() - r"""HTTP response content type for this operation""" - status_code: int = dataclasses.field() - r"""HTTP response status code for this operation""" - raw_response: requests_http.Response = dataclasses.field() - r"""Raw HTTP response; suitable for custom response parsing""" - connection: Optional[shared_connection.Connection] = dataclasses.field(default=None) - r"""OK""" - - diff --git a/previous-versions/sync-for-payables-version-1/src/codatsyncpayables/models/operations/delete_company.py b/previous-versions/sync-for-payables-version-1/src/codatsyncpayables/models/operations/delete_company.py deleted file mode 100644 index e544df054..000000000 --- a/previous-versions/sync-for-payables-version-1/src/codatsyncpayables/models/operations/delete_company.py +++ /dev/null @@ -1,25 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -import dataclasses -import requests as requests_http - - -@dataclasses.dataclass -class DeleteCompanyRequest: - company_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'companyId', 'style': 'simple', 'explode': False }}) - r"""Unique identifier for a company.""" - - - - -@dataclasses.dataclass -class DeleteCompanyResponse: - content_type: str = dataclasses.field() - r"""HTTP response content type for this operation""" - status_code: int = dataclasses.field() - r"""HTTP response status code for this operation""" - raw_response: requests_http.Response = dataclasses.field() - r"""Raw HTTP response; suitable for custom response parsing""" - - diff --git a/previous-versions/sync-for-payables-version-1/src/codatsyncpayables/models/operations/delete_connection.py b/previous-versions/sync-for-payables-version-1/src/codatsyncpayables/models/operations/delete_connection.py deleted file mode 100644 index f6a77abb5..000000000 --- a/previous-versions/sync-for-payables-version-1/src/codatsyncpayables/models/operations/delete_connection.py +++ /dev/null @@ -1,27 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -import dataclasses -import requests as requests_http - - -@dataclasses.dataclass -class DeleteConnectionRequest: - company_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'companyId', 'style': 'simple', 'explode': False }}) - r"""Unique identifier for a company.""" - connection_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'connectionId', 'style': 'simple', 'explode': False }}) - r"""Unique identifier for a connection.""" - - - - -@dataclasses.dataclass -class DeleteConnectionResponse: - content_type: str = dataclasses.field() - r"""HTTP response content type for this operation""" - status_code: int = dataclasses.field() - r"""HTTP response status code for this operation""" - raw_response: requests_http.Response = dataclasses.field() - r"""Raw HTTP response; suitable for custom response parsing""" - - diff --git a/previous-versions/sync-for-payables-version-1/src/codatsyncpayables/models/operations/get_company.py b/previous-versions/sync-for-payables-version-1/src/codatsyncpayables/models/operations/get_company.py deleted file mode 100644 index 65e6aba22..000000000 --- a/previous-versions/sync-for-payables-version-1/src/codatsyncpayables/models/operations/get_company.py +++ /dev/null @@ -1,29 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -import dataclasses -import requests as requests_http -from ...models.shared import company as shared_company -from typing import Optional - - -@dataclasses.dataclass -class GetCompanyRequest: - company_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'companyId', 'style': 'simple', 'explode': False }}) - r"""Unique identifier for a company.""" - - - - -@dataclasses.dataclass -class GetCompanyResponse: - content_type: str = dataclasses.field() - r"""HTTP response content type for this operation""" - status_code: int = dataclasses.field() - r"""HTTP response status code for this operation""" - raw_response: requests_http.Response = dataclasses.field() - r"""Raw HTTP response; suitable for custom response parsing""" - company: Optional[shared_company.Company] = dataclasses.field(default=None) - r"""OK""" - - diff --git a/previous-versions/sync-for-payables-version-1/src/codatsyncpayables/models/operations/get_connection.py b/previous-versions/sync-for-payables-version-1/src/codatsyncpayables/models/operations/get_connection.py deleted file mode 100644 index 083a24ed2..000000000 --- a/previous-versions/sync-for-payables-version-1/src/codatsyncpayables/models/operations/get_connection.py +++ /dev/null @@ -1,31 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -import dataclasses -import requests as requests_http -from ...models.shared import connection as shared_connection -from typing import Optional - - -@dataclasses.dataclass -class GetConnectionRequest: - company_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'companyId', 'style': 'simple', 'explode': False }}) - r"""Unique identifier for a company.""" - connection_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'connectionId', 'style': 'simple', 'explode': False }}) - r"""Unique identifier for a connection.""" - - - - -@dataclasses.dataclass -class GetConnectionResponse: - content_type: str = dataclasses.field() - r"""HTTP response content type for this operation""" - status_code: int = dataclasses.field() - r"""HTTP response status code for this operation""" - raw_response: requests_http.Response = dataclasses.field() - r"""Raw HTTP response; suitable for custom response parsing""" - connection: Optional[shared_connection.Connection] = dataclasses.field(default=None) - r"""OK""" - - diff --git a/previous-versions/sync-for-payables-version-1/src/codatsyncpayables/models/operations/list_bills.py b/previous-versions/sync-for-payables-version-1/src/codatsyncpayables/models/operations/list_bills.py deleted file mode 100644 index b88ab7920..000000000 --- a/previous-versions/sync-for-payables-version-1/src/codatsyncpayables/models/operations/list_bills.py +++ /dev/null @@ -1,40 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -import dataclasses -import requests as requests_http -from ...models.shared import bills as shared_bills -from ...models.shared import billstatus as shared_billstatus -from typing import List, Optional - - -@dataclasses.dataclass -class ListBillsRequest: - company_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'companyId', 'style': 'simple', 'explode': False }}) - r"""Unique identifier for a company.""" - connection_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'connectionId', 'style': 'simple', 'explode': False }}) - r"""Unique identifier for a connection.""" - page: Optional[int] = dataclasses.field(default=1, metadata={'query_param': { 'field_name': 'page', 'style': 'form', 'explode': True }}) - r"""Page number. [Read more](https://docs.codat.io/using-the-api/paging).""" - page_size: Optional[int] = dataclasses.field(default=100, metadata={'query_param': { 'field_name': 'pageSize', 'style': 'form', 'explode': True }}) - r"""Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging).""" - source_modified_date: Optional[str] = dataclasses.field(default=None, metadata={'query_param': { 'field_name': 'sourceModifiedDate', 'style': 'form', 'explode': True }}) - r"""Filter bills by `sourceModifiedDate` to return bills that have changed after a specified date.""" - status: Optional[List[shared_billstatus.BillStatus]] = dataclasses.field(default=None, metadata={'query_param': { 'field_name': 'status', 'style': 'form', 'explode': False }}) - r"""Filter bills by `status`.""" - - - - -@dataclasses.dataclass -class ListBillsResponse: - content_type: str = dataclasses.field() - r"""HTTP response content type for this operation""" - status_code: int = dataclasses.field() - r"""HTTP response status code for this operation""" - raw_response: requests_http.Response = dataclasses.field() - r"""Raw HTTP response; suitable for custom response parsing""" - bills: Optional[shared_bills.Bills] = dataclasses.field(default=None) - r"""Success""" - - diff --git a/previous-versions/sync-for-payables-version-1/src/codatsyncpayables/models/operations/list_companies.py b/previous-versions/sync-for-payables-version-1/src/codatsyncpayables/models/operations/list_companies.py deleted file mode 100644 index 41f52fdfb..000000000 --- a/previous-versions/sync-for-payables-version-1/src/codatsyncpayables/models/operations/list_companies.py +++ /dev/null @@ -1,35 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -import dataclasses -import requests as requests_http -from ...models.shared import companies as shared_companies -from typing import Optional - - -@dataclasses.dataclass -class ListCompaniesRequest: - order_by: Optional[str] = dataclasses.field(default=None, metadata={'query_param': { 'field_name': 'orderBy', 'style': 'form', 'explode': True }}) - r"""Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results).""" - page: Optional[int] = dataclasses.field(default=1, metadata={'query_param': { 'field_name': 'page', 'style': 'form', 'explode': True }}) - r"""Page number. [Read more](https://docs.codat.io/using-the-api/paging).""" - page_size: Optional[int] = dataclasses.field(default=100, metadata={'query_param': { 'field_name': 'pageSize', 'style': 'form', 'explode': True }}) - r"""Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging).""" - query: Optional[str] = dataclasses.field(default=None, metadata={'query_param': { 'field_name': 'query', 'style': 'form', 'explode': True }}) - r"""Codat query string. [Read more](https://docs.codat.io/using-the-api/querying).""" - - - - -@dataclasses.dataclass -class ListCompaniesResponse: - content_type: str = dataclasses.field() - r"""HTTP response content type for this operation""" - status_code: int = dataclasses.field() - r"""HTTP response status code for this operation""" - raw_response: requests_http.Response = dataclasses.field() - r"""Raw HTTP response; suitable for custom response parsing""" - companies: Optional[shared_companies.Companies] = dataclasses.field(default=None) - r"""OK""" - - diff --git a/previous-versions/sync-for-payables-version-1/src/codatsyncpayables/models/operations/list_connections.py b/previous-versions/sync-for-payables-version-1/src/codatsyncpayables/models/operations/list_connections.py deleted file mode 100644 index e4665b548..000000000 --- a/previous-versions/sync-for-payables-version-1/src/codatsyncpayables/models/operations/list_connections.py +++ /dev/null @@ -1,37 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -import dataclasses -import requests as requests_http -from ...models.shared import connections as shared_connections -from typing import Optional - - -@dataclasses.dataclass -class ListConnectionsRequest: - company_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'companyId', 'style': 'simple', 'explode': False }}) - r"""Unique identifier for a company.""" - order_by: Optional[str] = dataclasses.field(default=None, metadata={'query_param': { 'field_name': 'orderBy', 'style': 'form', 'explode': True }}) - r"""Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results).""" - page: Optional[int] = dataclasses.field(default=1, metadata={'query_param': { 'field_name': 'page', 'style': 'form', 'explode': True }}) - r"""Page number. [Read more](https://docs.codat.io/using-the-api/paging).""" - page_size: Optional[int] = dataclasses.field(default=100, metadata={'query_param': { 'field_name': 'pageSize', 'style': 'form', 'explode': True }}) - r"""Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging).""" - query: Optional[str] = dataclasses.field(default=None, metadata={'query_param': { 'field_name': 'query', 'style': 'form', 'explode': True }}) - r"""Codat query string. [Read more](https://docs.codat.io/using-the-api/querying).""" - - - - -@dataclasses.dataclass -class ListConnectionsResponse: - content_type: str = dataclasses.field() - r"""HTTP response content type for this operation""" - status_code: int = dataclasses.field() - r"""HTTP response status code for this operation""" - raw_response: requests_http.Response = dataclasses.field() - r"""Raw HTTP response; suitable for custom response parsing""" - connections: Optional[shared_connections.Connections] = dataclasses.field(default=None) - r"""OK""" - - diff --git a/previous-versions/sync-for-payables-version-1/src/codatsyncpayables/models/operations/unlink_connection.py b/previous-versions/sync-for-payables-version-1/src/codatsyncpayables/models/operations/unlink_connection.py deleted file mode 100644 index 081c3d17e..000000000 --- a/previous-versions/sync-for-payables-version-1/src/codatsyncpayables/models/operations/unlink_connection.py +++ /dev/null @@ -1,44 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -import dataclasses -import requests as requests_http -from ...models.shared import connection as shared_connection -from ...models.shared import dataconnectionstatus as shared_dataconnectionstatus -from codatsyncpayables import utils -from dataclasses_json import Undefined, dataclass_json -from typing import Optional - - -@dataclass_json(undefined=Undefined.EXCLUDE) -@dataclasses.dataclass -class UnlinkConnectionUpdateConnection: - status: Optional[shared_dataconnectionstatus.DataConnectionStatus] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('status'), 'exclude': lambda f: f is None }}) - r"""The current authorization status of the data connection.""" - - - - -@dataclasses.dataclass -class UnlinkConnectionRequest: - company_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'companyId', 'style': 'simple', 'explode': False }}) - r"""Unique identifier for a company.""" - connection_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'connectionId', 'style': 'simple', 'explode': False }}) - r"""Unique identifier for a connection.""" - request_body: Optional[UnlinkConnectionUpdateConnection] = dataclasses.field(default=None, metadata={'request': { 'media_type': 'application/json' }}) - - - - -@dataclasses.dataclass -class UnlinkConnectionResponse: - content_type: str = dataclasses.field() - r"""HTTP response content type for this operation""" - status_code: int = dataclasses.field() - r"""HTTP response status code for this operation""" - raw_response: requests_http.Response = dataclasses.field() - r"""Raw HTTP response; suitable for custom response parsing""" - connection: Optional[shared_connection.Connection] = dataclasses.field(default=None) - r"""OK""" - - diff --git a/previous-versions/sync-for-payables-version-1/src/codatsyncpayables/models/operations/update_company.py b/previous-versions/sync-for-payables-version-1/src/codatsyncpayables/models/operations/update_company.py deleted file mode 100644 index 4eae4a4d0..000000000 --- a/previous-versions/sync-for-payables-version-1/src/codatsyncpayables/models/operations/update_company.py +++ /dev/null @@ -1,31 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -import dataclasses -import requests as requests_http -from ...models.shared import company as shared_company -from ...models.shared import companyrequestbody as shared_companyrequestbody -from typing import Optional - - -@dataclasses.dataclass -class UpdateCompanyRequest: - company_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'companyId', 'style': 'simple', 'explode': False }}) - r"""Unique identifier for a company.""" - company_request_body: Optional[shared_companyrequestbody.CompanyRequestBody] = dataclasses.field(default=None, metadata={'request': { 'media_type': 'application/json' }}) - - - - -@dataclasses.dataclass -class UpdateCompanyResponse: - content_type: str = dataclasses.field() - r"""HTTP response content type for this operation""" - status_code: int = dataclasses.field() - r"""HTTP response status code for this operation""" - raw_response: requests_http.Response = dataclasses.field() - r"""Raw HTTP response; suitable for custom response parsing""" - company: Optional[shared_company.Company] = dataclasses.field(default=None) - r"""OK""" - - diff --git a/previous-versions/sync-for-payables-version-1/src/codatsyncpayables/models/shared/__init__.py b/previous-versions/sync-for-payables-version-1/src/codatsyncpayables/models/shared/__init__.py deleted file mode 100644 index 5166d1111..000000000 --- a/previous-versions/sync-for-payables-version-1/src/codatsyncpayables/models/shared/__init__.py +++ /dev/null @@ -1,28 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from .bill import * -from .billeventpayload import * -from .billeventwebhook import * -from .billlineitem import * -from .bills import * -from .billstatus import * -from .clientratelimitreachedwebhook import * -from .clientratelimitreachedwebhookdata import * -from .clientratelimitresetwebhook import * -from .clientratelimitresetwebhookdata import * -from .companies import * -from .company import * -from .companyrequestbody import * -from .connection import * -from .connections import * -from .dataconnectionerror import * -from .dataconnectionstatus import * -from .errorvalidation import * -from .errorvalidationitem import * -from .halref import * -from .items import * -from .links import * -from .security import * -from .supplierref import * - -__all__ = ["AccountReference","Bill","BillEventPayload","BillEventWebhook","BillLineItem","BillStatus","Bills","ClientRateLimitReachedWebhook","ClientRateLimitReachedWebhookData","ClientRateLimitResetWebhook","ClientRateLimitResetWebhookData","Companies","Company","CompanyRequestBody","Connection","Connections","DataConnectionError","DataConnectionStatus","ErrorValidation","ErrorValidationItem","GroupReference","HalRef","Items","Links","Security","SourceType","SupplierRef","TaxRateReference"] diff --git a/previous-versions/sync-for-payables-version-1/src/codatsyncpayables/models/shared/bill.py b/previous-versions/sync-for-payables-version-1/src/codatsyncpayables/models/shared/bill.py deleted file mode 100644 index f220566b9..000000000 --- a/previous-versions/sync-for-payables-version-1/src/codatsyncpayables/models/shared/bill.py +++ /dev/null @@ -1,46 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -import dataclasses -from .billlineitem import BillLineItem -from .billstatus import BillStatus -from .supplierref import SupplierRef -from codatsyncpayables import utils -from dataclasses_json import Undefined, dataclass_json -from decimal import Decimal -from typing import List, Optional - - -@dataclass_json(undefined=Undefined.EXCLUDE) -@dataclasses.dataclass -class Bill: - r"""Bills are invoices that represent the SMB's financial obligations to their supplier for a purchase of goods or services.""" - UNSET='__SPEAKEASY_UNSET__' - amount_due: Optional[Decimal] = dataclasses.field(default=UNSET, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('amountDue'), 'encoder': utils.decimalencoder(True, False), 'decoder': utils.decimaldecoder, 'exclude': lambda f: f is Bill.UNSET }}) - r"""Amount outstanding on the bill.""" - currency: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('currency'), 'exclude': lambda f: f is None }}) - r"""The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. - - ## Unknown currencies - - In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. - - There are only a very small number of edge cases where this currency code is returned by the Codat system. - """ - due_date: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('dueDate'), 'exclude': lambda f: f is None }}) - id: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('id'), 'exclude': lambda f: f is None }}) - r"""Identifier for the bill, unique for the company in the accounting platform.""" - issue_date: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('issueDate'), 'exclude': lambda f: f is None }}) - line_items: Optional[List[BillLineItem]] = dataclasses.field(default=UNSET, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('lineItems'), 'exclude': lambda f: f is Bill.UNSET }}) - r"""Array of Bill line items.""" - reference: Optional[str] = dataclasses.field(default=UNSET, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('reference'), 'exclude': lambda f: f is Bill.UNSET }}) - r"""User-friendly reference for the bill.""" - source_modified_date: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('sourceModifiedDate'), 'exclude': lambda f: f is None }}) - status: Optional[BillStatus] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('status'), 'exclude': lambda f: f is None }}) - r"""Current state of the bill.""" - supplier_ref: Optional[SupplierRef] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('supplierRef'), 'exclude': lambda f: f is None }}) - r"""Reference to the supplier the record relates to.""" - total_amount: Optional[Decimal] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('totalAmount'), 'encoder': utils.decimalencoder(True, False), 'decoder': utils.decimaldecoder, 'exclude': lambda f: f is None }}) - r"""Amount of the bill, including tax.""" - - diff --git a/previous-versions/sync-for-payables-version-1/src/codatsyncpayables/models/shared/billeventpayload.py b/previous-versions/sync-for-payables-version-1/src/codatsyncpayables/models/shared/billeventpayload.py deleted file mode 100644 index 7bf2d342b..000000000 --- a/previous-versions/sync-for-payables-version-1/src/codatsyncpayables/models/shared/billeventpayload.py +++ /dev/null @@ -1,24 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -import dataclasses -from .bill import Bill -from codatsyncpayables import utils -from dataclasses_json import Undefined, dataclass_json -from typing import Optional - - -@dataclass_json(undefined=Undefined.EXCLUDE) -@dataclasses.dataclass -class BillEventPayload: - UNSET='__SPEAKEASY_UNSET__' - bill: Optional[Bill] = dataclasses.field(default=UNSET, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('bill'), 'exclude': lambda f: f is BillEventPayload.UNSET }}) - r"""Bills are invoices that represent the SMB's financial obligations to their supplier for a purchase of goods or services.""" - company_id: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('companyId'), 'exclude': lambda f: f is None }}) - r"""Unique identifier for your SMB in Codat.""" - connection_id: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('connectionId'), 'exclude': lambda f: f is None }}) - r"""Unique identifier for a company's data connection.""" - push_operation_key: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('pushOperationKey'), 'exclude': lambda f: f is None }}) - r"""Unique identifier for the push operation.""" - - diff --git a/previous-versions/sync-for-payables-version-1/src/codatsyncpayables/models/shared/billeventwebhook.py b/previous-versions/sync-for-payables-version-1/src/codatsyncpayables/models/shared/billeventwebhook.py deleted file mode 100644 index 292a80557..000000000 --- a/previous-versions/sync-for-payables-version-1/src/codatsyncpayables/models/shared/billeventwebhook.py +++ /dev/null @@ -1,22 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -import dataclasses -from .billeventpayload import BillEventPayload -from codatsyncpayables import utils -from dataclasses_json import Undefined, dataclass_json -from typing import Optional - - -@dataclass_json(undefined=Undefined.EXCLUDE) -@dataclasses.dataclass -class BillEventWebhook: - created_date: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('createdDate'), 'exclude': lambda f: f is None }}) - r"""The datetime in UTC of when the webhook event was produced by Codat.""" - id: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('id'), 'exclude': lambda f: f is None }}) - r"""Unique identifier of the bill event.""" - payload: Optional[BillEventPayload] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('payload'), 'exclude': lambda f: f is None }}) - type: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('type'), 'exclude': lambda f: f is None }}) - r"""Type of webhook event.""" - - diff --git a/previous-versions/sync-for-payables-version-1/src/codatsyncpayables/models/shared/billlineitem.py b/previous-versions/sync-for-payables-version-1/src/codatsyncpayables/models/shared/billlineitem.py deleted file mode 100644 index 4acf2f5ff..000000000 --- a/previous-versions/sync-for-payables-version-1/src/codatsyncpayables/models/shared/billlineitem.py +++ /dev/null @@ -1,56 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -import dataclasses -from codatsyncpayables import utils -from dataclasses_json import Undefined, dataclass_json -from decimal import Decimal -from typing import Optional - - -@dataclass_json(undefined=Undefined.EXCLUDE) -@dataclasses.dataclass -class AccountReference: - r"""Reference to the account to which the line item is linked.""" - id: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('id'), 'exclude': lambda f: f is None }}) - r"""'id' from the Accounts data type.""" - name: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('name'), 'exclude': lambda f: f is None }}) - r"""'name' from the Accounts data type.""" - - - - -@dataclass_json(undefined=Undefined.EXCLUDE) -@dataclasses.dataclass -class TaxRateReference: - r"""Reference to the tax rate to which the line item is linked.""" - effective_tax_rate: Optional[Decimal] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('effectiveTaxRate'), 'encoder': utils.decimalencoder(True, False), 'decoder': utils.decimaldecoder, 'exclude': lambda f: f is None }}) - r"""Applicable tax rate.""" - id: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('id'), 'exclude': lambda f: f is None }}) - r"""Unique identifier for the tax rate in the accounting platform.""" - name: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('name'), 'exclude': lambda f: f is None }}) - r"""Name of the tax rate in the accounting platform.""" - - - - -@dataclass_json(undefined=Undefined.EXCLUDE) -@dataclasses.dataclass -class BillLineItem: - UNSET='__SPEAKEASY_UNSET__' - quantity: Decimal = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('quantity'), 'encoder': utils.decimalencoder(False, False), 'decoder': utils.decimaldecoder }}) - r"""Number of units of goods or services received.""" - account_ref: Optional[AccountReference] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('accountRef'), 'exclude': lambda f: f is None }}) - r"""Reference to the account to which the line item is linked.""" - description: Optional[str] = dataclasses.field(default=UNSET, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('description'), 'exclude': lambda f: f is BillLineItem.UNSET }}) - r"""Friendly name of the goods or services received.""" - tax_amount: Optional[Decimal] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('taxAmount'), 'encoder': utils.decimalencoder(True, False), 'decoder': utils.decimaldecoder, 'exclude': lambda f: f is None }}) - r"""Amount of tax applied to the line item.""" - tax_rate_ref: Optional[TaxRateReference] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('taxRateRef'), 'exclude': lambda f: f is None }}) - r"""Reference to the tax rate to which the line item is linked.""" - total_amount: Optional[Decimal] = dataclasses.field(default=UNSET, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('totalAmount'), 'encoder': utils.decimalencoder(True, False), 'decoder': utils.decimaldecoder, 'exclude': lambda f: f is BillLineItem.UNSET }}) - r"""Total amount of the line, including tax.""" - unit_amount: Optional[Decimal] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('unitAmount'), 'encoder': utils.decimalencoder(True, False), 'decoder': utils.decimaldecoder, 'exclude': lambda f: f is None }}) - r"""Unit price of the goods or service.""" - - diff --git a/previous-versions/sync-for-payables-version-1/src/codatsyncpayables/models/shared/bills.py b/previous-versions/sync-for-payables-version-1/src/codatsyncpayables/models/shared/bills.py deleted file mode 100644 index 49a0e5ff0..000000000 --- a/previous-versions/sync-for-payables-version-1/src/codatsyncpayables/models/shared/bills.py +++ /dev/null @@ -1,24 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -import dataclasses -from .bill import Bill -from .links import Links -from codatsyncpayables import utils -from dataclasses_json import Undefined, dataclass_json -from typing import List, Optional - - -@dataclass_json(undefined=Undefined.EXCLUDE) -@dataclasses.dataclass -class Bills: - links: Links = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('_links') }}) - page_number: int = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('pageNumber') }}) - r"""Current page number.""" - page_size: int = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('pageSize') }}) - r"""Number of items to return in results array.""" - total_results: int = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('totalResults') }}) - r"""Total number of items.""" - results: Optional[List[Bill]] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('results'), 'exclude': lambda f: f is None }}) - - diff --git a/previous-versions/sync-for-payables-version-1/src/codatsyncpayables/models/shared/billstatus.py b/previous-versions/sync-for-payables-version-1/src/codatsyncpayables/models/shared/billstatus.py deleted file mode 100644 index e3345892c..000000000 --- a/previous-versions/sync-for-payables-version-1/src/codatsyncpayables/models/shared/billstatus.py +++ /dev/null @@ -1,13 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -from enum import Enum - -class BillStatus(str, Enum): - r"""Current state of the bill.""" - UNKNOWN = 'Unknown' - OPEN = 'Open' - PARTIALLY_PAID = 'PartiallyPaid' - PAID = 'Paid' - VOID = 'Void' - DRAFT = 'Draft' diff --git a/previous-versions/sync-for-payables-version-1/src/codatsyncpayables/models/shared/clientratelimitreachedwebhook.py b/previous-versions/sync-for-payables-version-1/src/codatsyncpayables/models/shared/clientratelimitreachedwebhook.py deleted file mode 100644 index 0187a4ddd..000000000 --- a/previous-versions/sync-for-payables-version-1/src/codatsyncpayables/models/shared/clientratelimitreachedwebhook.py +++ /dev/null @@ -1,29 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -import dataclasses -from .clientratelimitreachedwebhookdata import ClientRateLimitReachedWebhookData -from codatsyncpayables import utils -from dataclasses_json import Undefined, dataclass_json -from typing import Optional - - -@dataclass_json(undefined=Undefined.EXCLUDE) -@dataclasses.dataclass -class ClientRateLimitReachedWebhook: - r"""Webhook request body for a client that has reached their rate limit.""" - alert_id: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('AlertId'), 'exclude': lambda f: f is None }}) - r"""Unique identifier of the webhook event.""" - client_id: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('ClientId'), 'exclude': lambda f: f is None }}) - r"""Unique identifier for your client in Codat.""" - client_name: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('ClientName'), 'exclude': lambda f: f is None }}) - r"""Name of your client in Codat.""" - data: Optional[ClientRateLimitReachedWebhookData] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('Data'), 'exclude': lambda f: f is None }}) - message: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('Message'), 'exclude': lambda f: f is None }}) - r"""A human readable message about the webhook.""" - rule_id: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('RuleId'), 'exclude': lambda f: f is None }}) - r"""Unique identifier for the rule.""" - rule_type: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('RuleType'), 'exclude': lambda f: f is None }}) - r"""The type of rule.""" - - diff --git a/previous-versions/sync-for-payables-version-1/src/codatsyncpayables/models/shared/clientratelimitreachedwebhookdata.py b/previous-versions/sync-for-payables-version-1/src/codatsyncpayables/models/shared/clientratelimitreachedwebhookdata.py deleted file mode 100644 index a7701e321..000000000 --- a/previous-versions/sync-for-payables-version-1/src/codatsyncpayables/models/shared/clientratelimitreachedwebhookdata.py +++ /dev/null @@ -1,37 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -import dataclasses -from codatsyncpayables import utils -from dataclasses_json import Undefined, dataclass_json -from typing import Optional - - -@dataclass_json(undefined=Undefined.EXCLUDE) -@dataclasses.dataclass -class ClientRateLimitReachedWebhookData: - daily_quota: Optional[int] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('DailyQuota'), 'exclude': lambda f: f is None }}) - r"""The number of available requests per day.""" - expires_utc: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('ExpiresUtc'), 'exclude': lambda f: f is 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: - - ``` - 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. - """ - - diff --git a/previous-versions/sync-for-payables-version-1/src/codatsyncpayables/models/shared/clientratelimitresetwebhook.py b/previous-versions/sync-for-payables-version-1/src/codatsyncpayables/models/shared/clientratelimitresetwebhook.py deleted file mode 100644 index 72ea74238..000000000 --- a/previous-versions/sync-for-payables-version-1/src/codatsyncpayables/models/shared/clientratelimitresetwebhook.py +++ /dev/null @@ -1,29 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -import dataclasses -from .clientratelimitresetwebhookdata import ClientRateLimitResetWebhookData -from codatsyncpayables import utils -from dataclasses_json import Undefined, dataclass_json -from typing import Optional - - -@dataclass_json(undefined=Undefined.EXCLUDE) -@dataclasses.dataclass -class ClientRateLimitResetWebhook: - r"""Webhook request body for a client that has had their rate limit reset.""" - alert_id: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('AlertId'), 'exclude': lambda f: f is None }}) - r"""Unique identifier of the webhook event.""" - client_id: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('ClientId'), 'exclude': lambda f: f is None }}) - r"""Unique identifier for your client in Codat.""" - client_name: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('ClientName'), 'exclude': lambda f: f is None }}) - r"""Name of your client in Codat.""" - data: Optional[ClientRateLimitResetWebhookData] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('Data'), 'exclude': lambda f: f is None }}) - message: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('Message'), 'exclude': lambda f: f is None }}) - r"""A human readable message about the webhook.""" - rule_id: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('RuleId'), 'exclude': lambda f: f is None }}) - r"""Unique identifier for the rule.""" - rule_type: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('RuleType'), 'exclude': lambda f: f is None }}) - r"""The type of rule.""" - - diff --git a/previous-versions/sync-for-payables-version-1/src/codatsyncpayables/models/shared/clientratelimitresetwebhookdata.py b/previous-versions/sync-for-payables-version-1/src/codatsyncpayables/models/shared/clientratelimitresetwebhookdata.py deleted file mode 100644 index a52ad72a3..000000000 --- a/previous-versions/sync-for-payables-version-1/src/codatsyncpayables/models/shared/clientratelimitresetwebhookdata.py +++ /dev/null @@ -1,42 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -import dataclasses -from codatsyncpayables import utils -from dataclasses_json import Undefined, dataclass_json -from typing import Optional - - -@dataclass_json(undefined=Undefined.EXCLUDE) -@dataclasses.dataclass -class ClientRateLimitResetWebhookData: - UNSET='__SPEAKEASY_UNSET__' - daily_quota: Optional[int] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('DailyQuota'), 'exclude': lambda f: f is None }}) - r"""The number of available requests per day.""" - expires_utc: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('ExpiresUtc'), 'exclude': lambda f: f is 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: - - ``` - 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. - """ - quota_remaining: Optional[int] = dataclasses.field(default=UNSET, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('QuotaRemaining'), 'exclude': lambda f: f is ClientRateLimitResetWebhookData.UNSET }}) - r"""Total number of request remaining for your client.""" - reset_reason: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('ResetReason'), 'exclude': lambda f: f is None }}) - r"""The reason for your rate limit quota being reset.""" - - diff --git a/previous-versions/sync-for-payables-version-1/src/codatsyncpayables/models/shared/companies.py b/previous-versions/sync-for-payables-version-1/src/codatsyncpayables/models/shared/companies.py deleted file mode 100644 index e35f16927..000000000 --- a/previous-versions/sync-for-payables-version-1/src/codatsyncpayables/models/shared/companies.py +++ /dev/null @@ -1,24 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -import dataclasses -from .company import Company -from .links import Links -from codatsyncpayables import utils -from dataclasses_json import Undefined, dataclass_json -from typing import List, Optional - - -@dataclass_json(undefined=Undefined.EXCLUDE) -@dataclasses.dataclass -class Companies: - links: Links = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('_links') }}) - page_number: int = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('pageNumber') }}) - r"""Current page number.""" - page_size: int = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('pageSize') }}) - r"""Number of items to return in results array.""" - total_results: int = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('totalResults') }}) - r"""Total number of items.""" - results: Optional[List[Company]] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('results'), 'exclude': lambda f: f is None }}) - - diff --git a/previous-versions/sync-for-payables-version-1/src/codatsyncpayables/models/shared/company.py b/previous-versions/sync-for-payables-version-1/src/codatsyncpayables/models/shared/company.py deleted file mode 100644 index e8375ddac..000000000 --- a/previous-versions/sync-for-payables-version-1/src/codatsyncpayables/models/shared/company.py +++ /dev/null @@ -1,90 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -import dataclasses -from .connection import Connection -from codatsyncpayables import utils -from dataclasses_json import Undefined, dataclass_json -from typing import List, Optional - - -@dataclass_json(undefined=Undefined.EXCLUDE) -@dataclasses.dataclass -class GroupReference: - id: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('id'), 'exclude': lambda f: f is None }}) - r"""Unique identifier for the group.""" - - - - -@dataclass_json(undefined=Undefined.EXCLUDE) -@dataclasses.dataclass -class Company: - r"""In Codat, a company represents a business sharing access to their data. Each company can have multiple [connections](https://docs.codat.io/sync-for-payables-api#/schemas/Connection) to different data sources such as one connection to [Xero](https://docs.codat.io/integrations/accounting/xero/accounting-xero) for accounting data, two connections to [Plaid](https://docs.codat.io/integrations/banking/plaid/banking-plaid) for two bank accounts and a connection to [Zettle](https://docs.codat.io/integrations/commerce/zettle/commerce-zettle) for POS data. - - Typically each company is one of your customers. - - When you create a company, you can specify a `name` and we will automatically generate a unique `id` for the company. You can also add a `description` to store any additional information about the company. - """ - id: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('id') }}) - r"""Unique identifier for your SMB in Codat.""" - name: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('name') }}) - r"""The name of the company""" - redirect: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('redirect') }}) - r"""The `redirect` [Link URL](https://docs.codat.io/auth-flow/authorize-hosted-link) enabling the customer to start their auth flow journey for the company.""" - created: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('created'), 'exclude': lambda f: f is 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: - - ``` - 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. - """ - created_by_user_name: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('createdByUserName'), 'exclude': lambda f: f is None }}) - r"""Name of user that created the company in Codat.""" - data_connections: Optional[List[Connection]] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('dataConnections'), 'exclude': lambda f: f is None }}) - description: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('description'), 'exclude': lambda f: f is None }}) - r"""Additional information about the company. This can be used to store foreign IDs, references, etc.""" - groups: Optional[List[GroupReference]] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('groups'), 'exclude': lambda f: f is None }}) - r"""An array of groups the company has been assigned to.""" - last_sync: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('lastSync'), 'exclude': lambda f: f is 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: - - ``` - 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. - """ - platform: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('platform'), 'exclude': lambda f: f is None }}) - r"""`platformKeys` name used when creating the company. - - Deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. - """ - - diff --git a/previous-versions/sync-for-payables-version-1/src/codatsyncpayables/models/shared/companyrequestbody.py b/previous-versions/sync-for-payables-version-1/src/codatsyncpayables/models/shared/companyrequestbody.py deleted file mode 100644 index 16ec72dcd..000000000 --- a/previous-versions/sync-for-payables-version-1/src/codatsyncpayables/models/shared/companyrequestbody.py +++ /dev/null @@ -1,21 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -import dataclasses -from .items import Items -from codatsyncpayables import utils -from dataclasses_json import Undefined, dataclass_json -from typing import List, Optional - - -@dataclass_json(undefined=Undefined.EXCLUDE) -@dataclasses.dataclass -class CompanyRequestBody: - name: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('name') }}) - r"""Name of company being connected.""" - description: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('description'), 'exclude': lambda f: f is None }}) - r"""Additional information about the company. This can be used to store foreign IDs, references, etc.""" - groups: Optional[List[Items]] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('groups'), 'exclude': lambda f: f is None }}) - r"""Reference to the groups that the company is assigned to.""" - - diff --git a/previous-versions/sync-for-payables-version-1/src/codatsyncpayables/models/shared/connection.py b/previous-versions/sync-for-payables-version-1/src/codatsyncpayables/models/shared/connection.py deleted file mode 100644 index 5b82cacf8..000000000 --- a/previous-versions/sync-for-payables-version-1/src/codatsyncpayables/models/shared/connection.py +++ /dev/null @@ -1,99 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -import dataclasses -from .dataconnectionerror import DataConnectionError -from .dataconnectionstatus import DataConnectionStatus -from codatsyncpayables import utils -from dataclasses_json import Undefined, dataclass_json -from enum import Enum -from typing import Any, Dict, List, Optional - -class SourceType(str, Enum): - r"""The type of platform of the connection.""" - ACCOUNTING = 'Accounting' - BANKING = 'Banking' - BANK_FEED = 'BankFeed' - COMMERCE = 'Commerce' - EXPENSE = 'Expense' - OTHER = 'Other' - UNKNOWN = 'Unknown' - - -@dataclass_json(undefined=Undefined.EXCLUDE) -@dataclasses.dataclass -class Connection: - r"""A connection represents a [company's](https://docs.codat.io/sync-for-payables-api#/schemas/Company) connection to a data source and allows you to synchronize data (pull and/or push) with that source. - - A company can have multiple data connections depending on the type of data source it is connecting to. For example, a single company can link to: - - - [Accounting data](https://docs.codat.io/accounting-api/overview) - 1 active connection. - - [Banking data](https://docs.codat.io/banking-api/overview) - Multiple active connections. - - [Commerce data](https://docs.codat.io/commerce-api/overview) - Multiple active connections. - Any combination of accounting, banking, and commerce data connections is allowed. - - Before you can use a data connection to pull or push data, the company must grant you access to their business data by [linking the connection](https://docs.codat.io/auth-flow/overview). - """ - created: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('created') }}) - 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: - - ``` - 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. - """ - id: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('id') }}) - r"""Unique identifier for a company's data connection.""" - integration_id: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('integrationId') }}) - r"""A Codat ID representing the integration.""" - integration_key: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('integrationKey') }}) - r"""A unique four-character ID that identifies the platform of the company's data connection. This ensures continuity if the platform changes its name in the future.""" - link_url: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('linkUrl') }}) - r"""The link URL your customers can use to authorize access to their business application.""" - platform_name: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('platformName') }}) - r"""Name of integration connected to company.""" - source_id: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('sourceId') }}) - r"""A source-specific ID used to distinguish between different sources originating from the same data connection. In general, a data connection is a single data source. However, for TrueLayer, `sourceId` is associated with a specific bank and has a many-to-one relationship with the `integrationId`.""" - source_type: SourceType = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('sourceType') }}) - r"""The type of platform of the connection.""" - status: DataConnectionStatus = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('status') }}) - r"""The current authorization status of the data connection.""" - additional_properties: Optional[Any] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('additionalProperties'), 'exclude': lambda f: f is None }}) - connection_info: Optional[Dict[str, str]] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('connectionInfo'), 'exclude': lambda f: f is None }}) - data_connection_errors: Optional[List[DataConnectionError]] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('dataConnectionErrors'), 'exclude': lambda f: f is None }}) - last_sync: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('lastSync'), 'exclude': lambda f: f is 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: - - ``` - 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. - """ - - diff --git a/previous-versions/sync-for-payables-version-1/src/codatsyncpayables/models/shared/connections.py b/previous-versions/sync-for-payables-version-1/src/codatsyncpayables/models/shared/connections.py deleted file mode 100644 index c30a6629d..000000000 --- a/previous-versions/sync-for-payables-version-1/src/codatsyncpayables/models/shared/connections.py +++ /dev/null @@ -1,24 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -import dataclasses -from .connection import Connection -from .links import Links -from codatsyncpayables import utils -from dataclasses_json import Undefined, dataclass_json -from typing import List, Optional - - -@dataclass_json(undefined=Undefined.EXCLUDE) -@dataclasses.dataclass -class Connections: - links: Links = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('_links') }}) - page_number: int = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('pageNumber') }}) - r"""Current page number.""" - page_size: int = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('pageSize') }}) - r"""Number of items to return in results array.""" - total_results: int = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('totalResults') }}) - r"""Total number of items.""" - results: Optional[List[Connection]] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('results'), 'exclude': lambda f: f is None }}) - - diff --git a/previous-versions/sync-for-payables-version-1/src/codatsyncpayables/models/shared/dataconnectionerror.py b/previous-versions/sync-for-payables-version-1/src/codatsyncpayables/models/shared/dataconnectionerror.py deleted file mode 100644 index a17225597..000000000 --- a/previous-versions/sync-for-payables-version-1/src/codatsyncpayables/models/shared/dataconnectionerror.py +++ /dev/null @@ -1,41 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -import dataclasses -from codatsyncpayables import utils -from dataclasses_json import Undefined, dataclass_json -from typing import Optional - - -@dataclass_json(undefined=Undefined.EXCLUDE) -@dataclasses.dataclass -class DataConnectionError: - error_message: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('errorMessage'), 'exclude': lambda f: f is None }}) - r"""A brief message about the error.""" - errored_on_utc: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('erroredOnUtc'), 'exclude': lambda f: f is 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: - - ``` - 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. - """ - status_code: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('statusCode'), 'exclude': lambda f: f is None }}) - r"""The HTTP status code returned by the error.""" - status_text: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('statusText'), 'exclude': lambda f: f is None }}) - r"""A non-numeric status code/text.""" - - diff --git a/previous-versions/sync-for-payables-version-1/src/codatsyncpayables/models/shared/dataconnectionstatus.py b/previous-versions/sync-for-payables-version-1/src/codatsyncpayables/models/shared/dataconnectionstatus.py deleted file mode 100644 index 377013d42..000000000 --- a/previous-versions/sync-for-payables-version-1/src/codatsyncpayables/models/shared/dataconnectionstatus.py +++ /dev/null @@ -1,11 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -from enum import Enum - -class DataConnectionStatus(str, Enum): - r"""The current authorization status of the data connection.""" - PENDING_AUTH = 'PendingAuth' - LINKED = 'Linked' - UNLINKED = 'Unlinked' - DEAUTHORIZED = 'Deauthorized' diff --git a/previous-versions/sync-for-payables-version-1/src/codatsyncpayables/models/shared/errorvalidation.py b/previous-versions/sync-for-payables-version-1/src/codatsyncpayables/models/shared/errorvalidation.py deleted file mode 100644 index 8dcf38010..000000000 --- a/previous-versions/sync-for-payables-version-1/src/codatsyncpayables/models/shared/errorvalidation.py +++ /dev/null @@ -1,19 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -import dataclasses -from .errorvalidationitem import ErrorValidationItem -from codatsyncpayables import utils -from dataclasses_json import Undefined, dataclass_json -from typing import List, Optional - - -@dataclass_json(undefined=Undefined.EXCLUDE) -@dataclasses.dataclass -class ErrorValidation: - r"""A human-readable object describing validation decisions Codat has made. If an operation has failed because of validation errors, they will be detailed here.""" - UNSET='__SPEAKEASY_UNSET__' - errors: Optional[List[ErrorValidationItem]] = dataclasses.field(default=UNSET, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('errors'), 'exclude': lambda f: f is ErrorValidation.UNSET }}) - warnings: Optional[List[ErrorValidationItem]] = dataclasses.field(default=UNSET, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('warnings'), 'exclude': lambda f: f is ErrorValidation.UNSET }}) - - diff --git a/previous-versions/sync-for-payables-version-1/src/codatsyncpayables/models/shared/errorvalidationitem.py b/previous-versions/sync-for-payables-version-1/src/codatsyncpayables/models/shared/errorvalidationitem.py deleted file mode 100644 index 954f301d8..000000000 --- a/previous-versions/sync-for-payables-version-1/src/codatsyncpayables/models/shared/errorvalidationitem.py +++ /dev/null @@ -1,21 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -import dataclasses -from codatsyncpayables import utils -from dataclasses_json import Undefined, dataclass_json -from typing import Optional - - -@dataclass_json(undefined=Undefined.EXCLUDE) -@dataclasses.dataclass -class ErrorValidationItem: - UNSET='__SPEAKEASY_UNSET__' - item_id: Optional[str] = dataclasses.field(default=UNSET, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('itemId'), 'exclude': lambda f: f is ErrorValidationItem.UNSET }}) - r"""Unique identifier for a validation item.""" - message: Optional[str] = dataclasses.field(default=UNSET, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('message'), 'exclude': lambda f: f is ErrorValidationItem.UNSET }}) - r"""A message outlining validation item's issue.""" - validator_name: Optional[str] = dataclasses.field(default=UNSET, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('validatorName'), 'exclude': lambda f: f is ErrorValidationItem.UNSET }}) - r"""Name of validator.""" - - diff --git a/previous-versions/sync-for-payables-version-1/src/codatsyncpayables/models/shared/halref.py b/previous-versions/sync-for-payables-version-1/src/codatsyncpayables/models/shared/halref.py deleted file mode 100644 index ae19c231e..000000000 --- a/previous-versions/sync-for-payables-version-1/src/codatsyncpayables/models/shared/halref.py +++ /dev/null @@ -1,16 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -import dataclasses -from codatsyncpayables import utils -from dataclasses_json import Undefined, dataclass_json -from typing import Optional - - -@dataclass_json(undefined=Undefined.EXCLUDE) -@dataclasses.dataclass -class HalRef: - href: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('href'), 'exclude': lambda f: f is None }}) - r"""Uri hypertext reference.""" - - diff --git a/previous-versions/sync-for-payables-version-1/src/codatsyncpayables/models/shared/items.py b/previous-versions/sync-for-payables-version-1/src/codatsyncpayables/models/shared/items.py deleted file mode 100644 index b2627a390..000000000 --- a/previous-versions/sync-for-payables-version-1/src/codatsyncpayables/models/shared/items.py +++ /dev/null @@ -1,16 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -import dataclasses -from codatsyncpayables import utils -from dataclasses_json import Undefined, dataclass_json -from typing import Optional - - -@dataclass_json(undefined=Undefined.EXCLUDE) -@dataclasses.dataclass -class Items: - id: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('id'), 'exclude': lambda f: f is None }}) - r"""Unique identifier for the group.""" - - diff --git a/previous-versions/sync-for-payables-version-1/src/codatsyncpayables/models/shared/links.py b/previous-versions/sync-for-payables-version-1/src/codatsyncpayables/models/shared/links.py deleted file mode 100644 index b9b702512..000000000 --- a/previous-versions/sync-for-payables-version-1/src/codatsyncpayables/models/shared/links.py +++ /dev/null @@ -1,19 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -import dataclasses -from .halref import HalRef -from codatsyncpayables import utils -from dataclasses_json import Undefined, dataclass_json -from typing import Optional - - -@dataclass_json(undefined=Undefined.EXCLUDE) -@dataclasses.dataclass -class Links: - current: HalRef = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('current') }}) - self_: HalRef = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('self') }}) - next: Optional[HalRef] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('next'), 'exclude': lambda f: f is None }}) - previous: Optional[HalRef] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('previous'), 'exclude': lambda f: f is None }}) - - diff --git a/previous-versions/sync-for-payables-version-1/src/codatsyncpayables/models/shared/security.py b/previous-versions/sync-for-payables-version-1/src/codatsyncpayables/models/shared/security.py deleted file mode 100644 index 1d57f5faa..000000000 --- a/previous-versions/sync-for-payables-version-1/src/codatsyncpayables/models/shared/security.py +++ /dev/null @@ -1,11 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -import dataclasses - - -@dataclasses.dataclass -class Security: - auth_header: str = dataclasses.field(metadata={'security': { 'scheme': True, 'type': 'apiKey', 'sub_type': 'header', 'field_name': 'Authorization' }}) - - diff --git a/previous-versions/sync-for-payables-version-1/src/codatsyncpayables/models/shared/supplierref.py b/previous-versions/sync-for-payables-version-1/src/codatsyncpayables/models/shared/supplierref.py deleted file mode 100644 index 242357bf8..000000000 --- a/previous-versions/sync-for-payables-version-1/src/codatsyncpayables/models/shared/supplierref.py +++ /dev/null @@ -1,20 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -import dataclasses -from codatsyncpayables import utils -from dataclasses_json import Undefined, dataclass_json -from typing import Optional - - -@dataclass_json(undefined=Undefined.EXCLUDE) -@dataclasses.dataclass -class SupplierRef: - r"""Reference to the supplier the record relates to.""" - UNSET='__SPEAKEASY_UNSET__' - id: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('id') }}) - r"""The supplier's unique ID""" - supplier_name: Optional[str] = dataclasses.field(default=UNSET, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('supplierName'), 'exclude': lambda f: f is SupplierRef.UNSET }}) - r"""The supplier's name""" - - diff --git a/previous-versions/sync-for-payables-version-1/src/codatsyncpayables/models/webhooks/__init__.py b/previous-versions/sync-for-payables-version-1/src/codatsyncpayables/models/webhooks/__init__.py deleted file mode 100644 index 1a29cd759..000000000 --- a/previous-versions/sync-for-payables-version-1/src/codatsyncpayables/models/webhooks/__init__.py +++ /dev/null @@ -1,9 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from .client_rate_limit_reached import * -from .client_rate_limit_reset import * -from .payables_bill_created import * -from .payables_bill_deleted import * -from .payables_bill_updated import * - -__all__ = ["ClientRateLimitReachedResponse","ClientRateLimitResetResponse","PayablesBillCreatedResponse","PayablesBillDeletedResponse","PayablesBillUpdatedResponse"] diff --git a/previous-versions/sync-for-payables-version-1/src/codatsyncpayables/models/webhooks/client_rate_limit_reached.py b/previous-versions/sync-for-payables-version-1/src/codatsyncpayables/models/webhooks/client_rate_limit_reached.py deleted file mode 100644 index 6f8ec4867..000000000 --- a/previous-versions/sync-for-payables-version-1/src/codatsyncpayables/models/webhooks/client_rate_limit_reached.py +++ /dev/null @@ -1,17 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -import dataclasses -import requests as requests_http - - -@dataclasses.dataclass -class ClientRateLimitReachedResponse: - content_type: str = dataclasses.field() - r"""HTTP response content type for this operation""" - status_code: int = dataclasses.field() - r"""HTTP response status code for this operation""" - raw_response: requests_http.Response = dataclasses.field() - r"""Raw HTTP response; suitable for custom response parsing""" - - diff --git a/previous-versions/sync-for-payables-version-1/src/codatsyncpayables/models/webhooks/client_rate_limit_reset.py b/previous-versions/sync-for-payables-version-1/src/codatsyncpayables/models/webhooks/client_rate_limit_reset.py deleted file mode 100644 index ecc722470..000000000 --- a/previous-versions/sync-for-payables-version-1/src/codatsyncpayables/models/webhooks/client_rate_limit_reset.py +++ /dev/null @@ -1,17 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -import dataclasses -import requests as requests_http - - -@dataclasses.dataclass -class ClientRateLimitResetResponse: - content_type: str = dataclasses.field() - r"""HTTP response content type for this operation""" - status_code: int = dataclasses.field() - r"""HTTP response status code for this operation""" - raw_response: requests_http.Response = dataclasses.field() - r"""Raw HTTP response; suitable for custom response parsing""" - - diff --git a/previous-versions/sync-for-payables-version-1/src/codatsyncpayables/models/webhooks/payables_bill_created.py b/previous-versions/sync-for-payables-version-1/src/codatsyncpayables/models/webhooks/payables_bill_created.py deleted file mode 100644 index daf4ce27f..000000000 --- a/previous-versions/sync-for-payables-version-1/src/codatsyncpayables/models/webhooks/payables_bill_created.py +++ /dev/null @@ -1,17 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -import dataclasses -import requests as requests_http - - -@dataclasses.dataclass -class PayablesBillCreatedResponse: - content_type: str = dataclasses.field() - r"""HTTP response content type for this operation""" - status_code: int = dataclasses.field() - r"""HTTP response status code for this operation""" - raw_response: requests_http.Response = dataclasses.field() - r"""Raw HTTP response; suitable for custom response parsing""" - - diff --git a/previous-versions/sync-for-payables-version-1/src/codatsyncpayables/models/webhooks/payables_bill_deleted.py b/previous-versions/sync-for-payables-version-1/src/codatsyncpayables/models/webhooks/payables_bill_deleted.py deleted file mode 100644 index 295d38796..000000000 --- a/previous-versions/sync-for-payables-version-1/src/codatsyncpayables/models/webhooks/payables_bill_deleted.py +++ /dev/null @@ -1,17 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -import dataclasses -import requests as requests_http - - -@dataclasses.dataclass -class PayablesBillDeletedResponse: - content_type: str = dataclasses.field() - r"""HTTP response content type for this operation""" - status_code: int = dataclasses.field() - r"""HTTP response status code for this operation""" - raw_response: requests_http.Response = dataclasses.field() - r"""Raw HTTP response; suitable for custom response parsing""" - - diff --git a/previous-versions/sync-for-payables-version-1/src/codatsyncpayables/models/webhooks/payables_bill_updated.py b/previous-versions/sync-for-payables-version-1/src/codatsyncpayables/models/webhooks/payables_bill_updated.py deleted file mode 100644 index b8b54fb1a..000000000 --- a/previous-versions/sync-for-payables-version-1/src/codatsyncpayables/models/webhooks/payables_bill_updated.py +++ /dev/null @@ -1,17 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from __future__ import annotations -import dataclasses -import requests as requests_http - - -@dataclasses.dataclass -class PayablesBillUpdatedResponse: - content_type: str = dataclasses.field() - r"""HTTP response content type for this operation""" - status_code: int = dataclasses.field() - r"""HTTP response status code for this operation""" - raw_response: requests_http.Response = dataclasses.field() - r"""Raw HTTP response; suitable for custom response parsing""" - - diff --git a/previous-versions/sync-for-payables-version-1/src/codatsyncpayables/sdk.py b/previous-versions/sync-for-payables-version-1/src/codatsyncpayables/sdk.py deleted file mode 100644 index 71da1aaf6..000000000 --- a/previous-versions/sync-for-payables-version-1/src/codatsyncpayables/sdk.py +++ /dev/null @@ -1,88 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -import requests as requests_http -from .bills import Bills -from .companies import Companies -from .connections import Connections -from .sdkconfiguration import SDKConfiguration -from codatsyncpayables import utils -from codatsyncpayables.models import shared -from typing import Callable, Dict, Union - -class CodatSyncPayables: - r"""Sync for Payables: The API for Sync for Payables. - - Sync for Payables is an API and a set of supporting tools built to help integrate with your customers' accounting software, and keep their supplier information, invoices, and payments in sync. - - [Explore product](https://docs.codat.io/payables/overview) | [See OpenAPI spec](https://github.com/codatio/oas) - - --- - - ## Endpoints - - | Endpoints | Description | - |:---------------------|:-----------------------------------------------------------------------------------------------------------| - | Companies | Create and manage your SMB users' companies. | - | Connections | Create new and manage existing data connections for a company. | - | Accounts | Get, create, and update Accounts | - | Bills | Get, create, and update Bills | - | Bill credit notes | Get, create, and update Bill credit notes | - | Bill payments | Get, create, and update Bill payments | - | Journals | Get, create, and update Journals | - | Journal entries | Get, create, and update Journal entries | - | Payment methods | Get, create, and update Payment methods | - | Suppliers | Get, create, and update Suppliers | - | Tax rates | Get, create, and update Tax rates | - | Tracking categories | Get, create, and update Tracking categories | - | Push operations | View historic push operations | - | Company info | View company profile from the source platform. | - | Manage data | Control how data is retrieved from an integration. | - """ - companies: Companies - r"""Create and manage your Codat companies.""" - bills: Bills - r"""Bills""" - connections: Connections - r"""Manage your companies' data connections.""" - - sdk_configuration: SDKConfiguration - - def __init__(self, - security: Union[shared.Security,Callable[[], shared.Security]] = None, - server_idx: int = None, - server_url: str = None, - url_params: Dict[str, str] = None, - client: requests_http.Session = None, - retry_config: utils.RetryConfig = None - ) -> None: - """Instantiates the SDK configuring it with the provided parameters. - - :param security: The security details required for authentication - :type security: Union[shared.Security,Callable[[], shared.Security]] - :param server_idx: The index of the server to use for all operations - :type server_idx: int - :param server_url: The server URL to use for all operations - :type server_url: str - :param url_params: Parameters to optionally template the server URL with - :type url_params: Dict[str, str] - :param client: The requests.Session HTTP client to use for all operations - :type client: requests_http.Session - :param retry_config: The utils.RetryConfig to use globally - :type retry_config: utils.RetryConfig - """ - if client is None: - client = requests_http.Session() - - if server_url is not None: - if url_params is not None: - server_url = utils.template_url(server_url, url_params) - - self.sdk_configuration = SDKConfiguration(client, security, server_url, server_idx, retry_config=retry_config) - - self._init_sdks() - - def _init_sdks(self): - self.companies = Companies(self.sdk_configuration) - self.bills = Bills(self.sdk_configuration) - self.connections = Connections(self.sdk_configuration) - \ No newline at end of file diff --git a/previous-versions/sync-for-payables-version-1/src/codatsyncpayables/sdkconfiguration.py b/previous-versions/sync-for-payables-version-1/src/codatsyncpayables/sdkconfiguration.py deleted file mode 100644 index b688e573e..000000000 --- a/previous-versions/sync-for-payables-version-1/src/codatsyncpayables/sdkconfiguration.py +++ /dev/null @@ -1,37 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - - -import requests as requests_http -from .utils import utils -from .utils.retries import RetryConfig -from codatsyncpayables.models import shared -from dataclasses import dataclass -from typing import Callable, Dict, Tuple, Union - - -SERVERS = [ - 'https://api.codat.io', - # Production -] -"""Contains the list of servers available to the SDK""" - -@dataclass -class SDKConfiguration: - client: requests_http.Session - security: Union[shared.Security,Callable[[], shared.Security]] = None - server_url: str = '' - server_idx: int = 0 - language: str = 'python' - openapi_doc_version: str = '3.0.0' - sdk_version: str = '3.2.0' - gen_version: str = '2.257.2' - user_agent: str = 'speakeasy-sdk/python 3.2.0 2.257.2 3.0.0 codat-sync-for-payables' - retry_config: RetryConfig = None - - def get_server_details(self) -> Tuple[str, Dict[str, str]]: - if self.server_url: - return utils.remove_suffix(self.server_url, '/'), {} - if self.server_idx is None: - self.server_idx = 0 - - return SERVERS[self.server_idx], {} diff --git a/previous-versions/sync-for-payables-version-1/src/codatsyncpayables/utils/__init__.py b/previous-versions/sync-for-payables-version-1/src/codatsyncpayables/utils/__init__.py deleted file mode 100644 index 94b739857..000000000 --- a/previous-versions/sync-for-payables-version-1/src/codatsyncpayables/utils/__init__.py +++ /dev/null @@ -1,4 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -from .retries import * -from .utils import * diff --git a/previous-versions/sync-for-payables-version-1/src/codatsyncpayables/utils/retries.py b/previous-versions/sync-for-payables-version-1/src/codatsyncpayables/utils/retries.py deleted file mode 100644 index 8eba09407..000000000 --- a/previous-versions/sync-for-payables-version-1/src/codatsyncpayables/utils/retries.py +++ /dev/null @@ -1,120 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -import random -import time -from typing import List - -import requests - - -class BackoffStrategy: - initial_interval: int - max_interval: int - exponent: float - max_elapsed_time: int - - def __init__(self, initial_interval: int, max_interval: int, exponent: float, max_elapsed_time: int): - self.initial_interval = initial_interval - self.max_interval = max_interval - self.exponent = exponent - self.max_elapsed_time = max_elapsed_time - - -class RetryConfig: - strategy: str - backoff: BackoffStrategy - retry_connection_errors: bool - - def __init__(self, strategy: str, backoff: BackoffStrategy, retry_connection_errors: bool): - self.strategy = strategy - self.backoff = backoff - self.retry_connection_errors = retry_connection_errors - - -class Retries: - config: RetryConfig - status_codes: List[str] - - def __init__(self, config: RetryConfig, status_codes: List[str]): - self.config = config - self.status_codes = status_codes - - -class TemporaryError(Exception): - response: requests.Response - - def __init__(self, response: requests.Response): - self.response = response - - -class PermanentError(Exception): - inner: Exception - - def __init__(self, inner: Exception): - self.inner = inner - - -def retry(func, retries: Retries): - if retries.config.strategy == 'backoff': - def do_request(): - res: requests.Response - try: - res = func() - - for code in retries.status_codes: - if "X" in code.upper(): - code_range = int(code[0]) - - status_major = res.status_code / 100 - - if status_major >= code_range and status_major < code_range + 1: - raise TemporaryError(res) - else: - parsed_code = int(code) - - if res.status_code == parsed_code: - raise TemporaryError(res) - except requests.exceptions.ConnectionError as exception: - if retries.config.config.retry_connection_errors: - raise - - raise PermanentError(exception) from exception - except requests.exceptions.Timeout as exception: - if retries.config.config.retry_connection_errors: - raise - - raise PermanentError(exception) from exception - except TemporaryError: - raise - except Exception as exception: - raise PermanentError(exception) from exception - - return res - - return retry_with_backoff(do_request, retries.config.backoff.initial_interval, retries.config.backoff.max_interval, retries.config.backoff.exponent, retries.config.backoff.max_elapsed_time) - - return func() - - -def retry_with_backoff(func, initial_interval=500, max_interval=60000, exponent=1.5, max_elapsed_time=3600000): - start = round(time.time()*1000) - retries = 0 - - while True: - try: - return func() - except PermanentError as exception: - raise exception.inner - except Exception as exception: # pylint: disable=broad-exception-caught - now = round(time.time()*1000) - if now - start > max_elapsed_time: - if isinstance(exception, TemporaryError): - return exception.response - - raise - sleep = ((initial_interval/1000) * - exponent**retries + random.uniform(0, 1)) - if sleep > max_interval/1000: - sleep = max_interval/1000 - time.sleep(sleep) - retries += 1 diff --git a/previous-versions/sync-for-payables-version-1/src/codatsyncpayables/utils/utils.py b/previous-versions/sync-for-payables-version-1/src/codatsyncpayables/utils/utils.py deleted file mode 100644 index 52434025e..000000000 --- a/previous-versions/sync-for-payables-version-1/src/codatsyncpayables/utils/utils.py +++ /dev/null @@ -1,897 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -import base64 -import json -import re -import sys -from dataclasses import Field, dataclass, fields, is_dataclass, make_dataclass -from datetime import date, datetime -from decimal import Decimal -from email.message import Message -from enum import Enum -from typing import (Any, Callable, Dict, List, Optional, Tuple, Union, - get_args, get_origin) -from xmlrpc.client import boolean -from typing_inspect import is_optional_type -import dateutil.parser -import requests -from dataclasses_json import DataClassJsonMixin - - -class SecurityClient: - client: requests.Session - query_params: Dict[str, str] = {} - - def __init__(self, client: requests.Session): - self.client = client - - def request(self, method, url, **kwargs): - params = kwargs.get('params', {}) - kwargs["params"] = {**self.query_params, **params} - - return self.client.request(method, url, **kwargs) - - -def configure_security_client(client: requests.Session, security: dataclass): - client = SecurityClient(client) - - if security is None: - return client - - sec_fields: Tuple[Field, ...] = fields(security) - for sec_field in sec_fields: - value = getattr(security, sec_field.name) - if value is None: - continue - - metadata = sec_field.metadata.get('security') - if metadata is None: - continue - if metadata.get('option'): - _parse_security_option(client, value) - return client - if metadata.get('scheme'): - # Special case for basic auth which could be a flattened struct - if metadata.get("sub_type") == "basic" and not is_dataclass(value): - _parse_security_scheme(client, metadata, security) - else: - _parse_security_scheme(client, metadata, value) - - return client - - -def _parse_security_option(client: SecurityClient, option: dataclass): - opt_fields: Tuple[Field, ...] = fields(option) - for opt_field in opt_fields: - metadata = opt_field.metadata.get('security') - if metadata is None or metadata.get('scheme') is None: - continue - _parse_security_scheme( - client, metadata, getattr(option, opt_field.name)) - - -def _parse_security_scheme(client: SecurityClient, scheme_metadata: Dict, scheme: any): - scheme_type = scheme_metadata.get('type') - sub_type = scheme_metadata.get('sub_type') - - if is_dataclass(scheme): - if scheme_type == 'http' and sub_type == 'basic': - _parse_basic_auth_scheme(client, scheme) - return - - scheme_fields: Tuple[Field, ...] = fields(scheme) - for scheme_field in scheme_fields: - metadata = scheme_field.metadata.get('security') - if metadata is None or metadata.get('field_name') is None: - continue - - value = getattr(scheme, scheme_field.name) - - _parse_security_scheme_value( - client, scheme_metadata, metadata, value) - else: - _parse_security_scheme_value( - client, scheme_metadata, scheme_metadata, scheme) - - -def _parse_security_scheme_value(client: SecurityClient, scheme_metadata: Dict, security_metadata: Dict, value: any): - scheme_type = scheme_metadata.get('type') - sub_type = scheme_metadata.get('sub_type') - - header_name = security_metadata.get('field_name') - - if scheme_type == "apiKey": - if sub_type == 'header': - client.client.headers[header_name] = value - elif sub_type == 'query': - client.query_params[header_name] = value - elif sub_type == 'cookie': - client.client.cookies[header_name] = value - else: - raise Exception('not supported') - elif scheme_type == "openIdConnect": - client.client.headers[header_name] = _apply_bearer(value) - elif scheme_type == 'oauth2': - client.client.headers[header_name] = _apply_bearer(value) - elif scheme_type == 'http': - if sub_type == 'bearer': - client.client.headers[header_name] = _apply_bearer(value) - else: - raise Exception('not supported') - else: - raise Exception('not supported') - - -def _apply_bearer(token: str) -> str: - return token.lower().startswith('bearer ') and token or f'Bearer {token}' - - -def _parse_basic_auth_scheme(client: SecurityClient, scheme: dataclass): - username = "" - password = "" - - scheme_fields: Tuple[Field, ...] = fields(scheme) - for scheme_field in scheme_fields: - metadata = scheme_field.metadata.get('security') - if metadata is None or metadata.get('field_name') is None: - continue - - field_name = metadata.get('field_name') - value = getattr(scheme, scheme_field.name) - - if field_name == 'username': - username = value - if field_name == 'password': - password = value - - data = f'{username}:{password}'.encode() - client.client.headers['Authorization'] = f'Basic {base64.b64encode(data).decode()}' - - -def generate_url(clazz: type, server_url: str, path: str, path_params: dataclass, - gbls: Dict[str, Dict[str, Dict[str, Any]]] = None) -> str: - path_param_fields: Tuple[Field, ...] = fields(clazz) - for field in path_param_fields: - request_metadata = field.metadata.get('request') - if request_metadata is not None: - continue - - param_metadata = field.metadata.get('path_param') - if param_metadata is None: - continue - - param = getattr( - path_params, field.name) if path_params is not None else None - param = _populate_from_globals( - field.name, param, 'pathParam', gbls) - - if param is None: - continue - - f_name = param_metadata.get("field_name", field.name) - serialization = param_metadata.get('serialization', '') - if serialization != '': - serialized_params = _get_serialized_params( - param_metadata, field.type, f_name, param) - for key, value in serialized_params.items(): - path = path.replace( - '{' + key + '}', value, 1) - else: - if param_metadata.get('style', 'simple') == 'simple': - if isinstance(param, List): - pp_vals: List[str] = [] - for pp_val in param: - if pp_val is None: - continue - pp_vals.append(_val_to_string(pp_val)) - path = path.replace( - '{' + param_metadata.get('field_name', field.name) + '}', ",".join(pp_vals), 1) - elif isinstance(param, Dict): - pp_vals: List[str] = [] - for pp_key in param: - if param[pp_key] is None: - continue - if param_metadata.get('explode'): - pp_vals.append( - f"{pp_key}={_val_to_string(param[pp_key])}") - else: - pp_vals.append( - f"{pp_key},{_val_to_string(param[pp_key])}") - path = path.replace( - '{' + param_metadata.get('field_name', field.name) + '}', ",".join(pp_vals), 1) - elif not isinstance(param, (str, int, float, complex, bool, Decimal)): - pp_vals: List[str] = [] - param_fields: Tuple[Field, ...] = fields(param) - for param_field in param_fields: - param_value_metadata = param_field.metadata.get( - 'path_param') - if not param_value_metadata: - continue - - parm_name = param_value_metadata.get( - 'field_name', field.name) - - param_field_val = getattr(param, param_field.name) - if param_field_val is None: - continue - if param_metadata.get('explode'): - pp_vals.append( - f"{parm_name}={_val_to_string(param_field_val)}") - else: - pp_vals.append( - f"{parm_name},{_val_to_string(param_field_val)}") - path = path.replace( - '{' + param_metadata.get('field_name', field.name) + '}', ",".join(pp_vals), 1) - else: - path = path.replace( - '{' + param_metadata.get('field_name', field.name) + '}', _val_to_string(param), 1) - - return remove_suffix(server_url, '/') + path - - -def is_optional(field): - return get_origin(field) is Union and type(None) in get_args(field) - - -def template_url(url_with_params: str, params: Dict[str, str]) -> str: - for key, value in params.items(): - url_with_params = url_with_params.replace( - '{' + key + '}', value) - - return url_with_params - - -def get_query_params(clazz: type, query_params: dataclass, gbls: Dict[str, Dict[str, Dict[str, Any]]] = None) -> Dict[ - str, List[str]]: - params: Dict[str, List[str]] = {} - - param_fields: Tuple[Field, ...] = fields(clazz) - for field in param_fields: - request_metadata = field.metadata.get('request') - if request_metadata is not None: - continue - - metadata = field.metadata.get('query_param') - if not metadata: - continue - - param_name = field.name - value = getattr( - query_params, param_name) if query_params is not None else None - - value = _populate_from_globals(param_name, value, 'queryParam', gbls) - - f_name = metadata.get("field_name") - serialization = metadata.get('serialization', '') - if serialization != '': - serialized_parms = _get_serialized_params(metadata, field.type, f_name, value) - for key, value in serialized_parms.items(): - if key in params: - params[key].extend(value) - else: - params[key] = [value] - else: - style = metadata.get('style', 'form') - if style == 'deepObject': - params = {**params, **_get_deep_object_query_params( - metadata, f_name, value)} - elif style == 'form': - params = {**params, **_get_delimited_query_params( - metadata, f_name, value, ",")} - elif style == 'pipeDelimited': - params = {**params, **_get_delimited_query_params( - metadata, f_name, value, "|")} - else: - raise Exception('not yet implemented') - return params - - -def get_headers(headers_params: dataclass) -> Dict[str, str]: - if headers_params is None: - return {} - - headers: Dict[str, str] = {} - - param_fields: Tuple[Field, ...] = fields(headers_params) - for field in param_fields: - metadata = field.metadata.get('header') - if not metadata: - continue - - value = _serialize_header(metadata.get( - 'explode', False), getattr(headers_params, field.name)) - - if value != '': - headers[metadata.get('field_name', field.name)] = value - - return headers - - -def _get_serialized_params(metadata: Dict, field_type: type, field_name: str, obj: any) -> Dict[str, str]: - params: Dict[str, str] = {} - - serialization = metadata.get('serialization', '') - if serialization == 'json': - params[metadata.get("field_name", field_name)] = marshal_json(obj, field_type) - - return params - - -def _get_deep_object_query_params(metadata: Dict, field_name: str, obj: any) -> Dict[str, List[str]]: - params: Dict[str, List[str]] = {} - - if obj is None: - return params - - if is_dataclass(obj): - obj_fields: Tuple[Field, ...] = fields(obj) - for obj_field in obj_fields: - obj_param_metadata = obj_field.metadata.get('query_param') - if not obj_param_metadata: - continue - - obj_val = getattr(obj, obj_field.name) - if obj_val is None: - continue - - if isinstance(obj_val, List): - for val in obj_val: - if val is None: - continue - - if params.get( - f'{metadata.get("field_name", field_name)}[{obj_param_metadata.get("field_name", obj_field.name)}]') is None: - params[ - f'{metadata.get("field_name", field_name)}[{obj_param_metadata.get("field_name", obj_field.name)}]'] = [ - ] - - params[ - f'{metadata.get("field_name", field_name)}[{obj_param_metadata.get("field_name", obj_field.name)}]'].append( - _val_to_string(val)) - else: - params[ - f'{metadata.get("field_name", field_name)}[{obj_param_metadata.get("field_name", obj_field.name)}]'] = [ - _val_to_string(obj_val)] - elif isinstance(obj, Dict): - for key, value in obj.items(): - if value is None: - continue - - if isinstance(value, List): - for val in value: - if val is None: - continue - - if params.get(f'{metadata.get("field_name", field_name)}[{key}]') is None: - params[f'{metadata.get("field_name", field_name)}[{key}]'] = [ - ] - - params[ - f'{metadata.get("field_name", field_name)}[{key}]'].append(_val_to_string(val)) - else: - params[f'{metadata.get("field_name", field_name)}[{key}]'] = [ - _val_to_string(value)] - return params - - -def _get_query_param_field_name(obj_field: Field) -> str: - obj_param_metadata = obj_field.metadata.get('query_param') - - if not obj_param_metadata: - return "" - - return obj_param_metadata.get("field_name", obj_field.name) - - -def _get_delimited_query_params(metadata: Dict, field_name: str, obj: any, delimiter: str) -> Dict[ - str, List[str]]: - return _populate_form(field_name, metadata.get("explode", True), obj, _get_query_param_field_name, delimiter) - - -SERIALIZATION_METHOD_TO_CONTENT_TYPE = { - 'json': 'application/json', - 'form': 'application/x-www-form-urlencoded', - 'multipart': 'multipart/form-data', - 'raw': 'application/octet-stream', - 'string': 'text/plain', -} - - -def serialize_request_body(request: dataclass, request_type: type, request_field_name: str, nullable: bool, optional: bool, serialization_method: str, encoder=None) -> Tuple[ - str, any, any]: - if request is None: - if not nullable and optional: - return None, None, None - - if not is_dataclass(request) or not hasattr(request, request_field_name): - return serialize_content_type(request_field_name, request_type, SERIALIZATION_METHOD_TO_CONTENT_TYPE[serialization_method], - request, encoder) - - request_val = getattr(request, request_field_name) - - if request_val is None: - if not nullable and optional: - return None, None, None - - request_fields: Tuple[Field, ...] = fields(request) - request_metadata = None - - for field in request_fields: - if field.name == request_field_name: - request_metadata = field.metadata.get('request') - break - - if request_metadata is None: - raise Exception('invalid request type') - - return serialize_content_type(request_field_name, request_type, request_metadata.get('media_type', 'application/octet-stream'), - request_val) - - -def serialize_content_type(field_name: str, request_type: any, media_type: str, request: dataclass, encoder=None) -> Tuple[str, any, List[List[any]]]: - if re.match(r'(application|text)\/.*?\+*json.*', media_type) is not None: - return media_type, marshal_json(request, request_type, encoder), None - if re.match(r'multipart\/.*', media_type) is not None: - return serialize_multipart_form(media_type, request) - if re.match(r'application\/x-www-form-urlencoded.*', media_type) is not None: - return media_type, serialize_form_data(field_name, request), None - if isinstance(request, (bytes, bytearray)): - return media_type, request, None - if isinstance(request, str): - return media_type, request, None - - raise Exception( - f"invalid request body type {type(request)} for mediaType {media_type}") - - -def serialize_multipart_form(media_type: str, request: dataclass) -> Tuple[str, any, List[List[any]]]: - form: List[List[any]] = [] - request_fields = fields(request) - - for field in request_fields: - val = getattr(request, field.name) - if val is None: - continue - - field_metadata = field.metadata.get('multipart_form') - if not field_metadata: - continue - - if field_metadata.get("file") is True: - file_fields = fields(val) - - file_name = "" - field_name = "" - content = bytes() - - for file_field in file_fields: - file_metadata = file_field.metadata.get('multipart_form') - if file_metadata is None: - continue - - if file_metadata.get("content") is True: - content = getattr(val, file_field.name) - else: - field_name = file_metadata.get( - "field_name", file_field.name) - file_name = getattr(val, file_field.name) - if field_name == "" or file_name == "" or content == bytes(): - raise Exception('invalid multipart/form-data file') - - form.append([field_name, [file_name, content]]) - elif field_metadata.get("json") is True: - to_append = [field_metadata.get("field_name", field.name), [ - None, marshal_json(val, field.type), "application/json"]] - form.append(to_append) - else: - field_name = field_metadata.get( - "field_name", field.name) - if isinstance(val, List): - for value in val: - if value is None: - continue - form.append( - [field_name + "[]", [None, _val_to_string(value)]]) - else: - form.append([field_name, [None, _val_to_string(val)]]) - return media_type, None, form - - -def serialize_dict(original: Dict, explode: bool, field_name, existing: Optional[Dict[str, List[str]]]) -> Dict[ - str, List[str]]: - if existing is None: - existing = [] - - if explode is True: - for key, val in original.items(): - if key not in existing: - existing[key] = [] - existing[key].append(val) - else: - temp = [] - for key, val in original.items(): - temp.append(str(key)) - temp.append(str(val)) - if field_name not in existing: - existing[field_name] = [] - existing[field_name].append(",".join(temp)) - return existing - - -def serialize_form_data(field_name: str, data: dataclass) -> Dict[str, any]: - form: Dict[str, List[str]] = {} - - if is_dataclass(data): - for field in fields(data): - val = getattr(data, field.name) - if val is None: - continue - - metadata = field.metadata.get('form') - if metadata is None: - continue - - field_name = metadata.get('field_name', field.name) - - if metadata.get('json'): - form[field_name] = [marshal_json(val, field.type)] - else: - if metadata.get('style', 'form') == 'form': - form = {**form, **_populate_form( - field_name, metadata.get('explode', True), val, _get_form_field_name, ",")} - else: - raise Exception( - f'Invalid form style for field {field.name}') - elif isinstance(data, Dict): - for key, value in data.items(): - form[key] = [_val_to_string(value)] - else: - raise Exception(f'Invalid request body type for field {field_name}') - - return form - - -def _get_form_field_name(obj_field: Field) -> str: - obj_param_metadata = obj_field.metadata.get('form') - - if not obj_param_metadata: - return "" - - return obj_param_metadata.get("field_name", obj_field.name) - - -def _populate_form(field_name: str, explode: boolean, obj: any, get_field_name_func: Callable, delimiter: str) -> \ - Dict[str, List[str]]: - params: Dict[str, List[str]] = {} - - if obj is None: - return params - - if is_dataclass(obj): - items = [] - - obj_fields: Tuple[Field, ...] = fields(obj) - for obj_field in obj_fields: - obj_field_name = get_field_name_func(obj_field) - if obj_field_name == '': - continue - - val = getattr(obj, obj_field.name) - if val is None: - continue - - if explode: - params[obj_field_name] = [_val_to_string(val)] - else: - items.append( - f'{obj_field_name}{delimiter}{_val_to_string(val)}') - - if len(items) > 0: - params[field_name] = [delimiter.join(items)] - elif isinstance(obj, Dict): - items = [] - for key, value in obj.items(): - if value is None: - continue - - if explode: - params[key] = _val_to_string(value) - else: - items.append(f'{key}{delimiter}{_val_to_string(value)}') - - if len(items) > 0: - params[field_name] = [delimiter.join(items)] - elif isinstance(obj, List): - items = [] - - for value in obj: - if value is None: - continue - - if explode: - if not field_name in params: - params[field_name] = [] - params[field_name].append(_val_to_string(value)) - else: - items.append(_val_to_string(value)) - - if len(items) > 0: - params[field_name] = [delimiter.join( - [str(item) for item in items])] - else: - params[field_name] = [_val_to_string(obj)] - - return params - - -def _serialize_header(explode: bool, obj: any) -> str: - if obj is None: - return '' - - if is_dataclass(obj): - items = [] - obj_fields: Tuple[Field, ...] = fields(obj) - for obj_field in obj_fields: - obj_param_metadata = obj_field.metadata.get('header') - - if not obj_param_metadata: - continue - - obj_field_name = obj_param_metadata.get( - 'field_name', obj_field.name) - if obj_field_name == '': - continue - - val = getattr(obj, obj_field.name) - if val is None: - continue - - if explode: - items.append( - f'{obj_field_name}={_val_to_string(val)}') - else: - items.append(obj_field_name) - items.append(_val_to_string(val)) - - if len(items) > 0: - return ','.join(items) - elif isinstance(obj, Dict): - items = [] - - for key, value in obj.items(): - if value is None: - continue - - if explode: - items.append(f'{key}={_val_to_string(value)}') - else: - items.append(key) - items.append(_val_to_string(value)) - - if len(items) > 0: - return ','.join([str(item) for item in items]) - elif isinstance(obj, List): - items = [] - - for value in obj: - if value is None: - continue - - items.append(_val_to_string(value)) - - if len(items) > 0: - return ','.join(items) - else: - return f'{_val_to_string(obj)}' - - return '' - - -def unmarshal_json(data, typ, decoder=None): - unmarshal = make_dataclass('Unmarshal', [('res', typ)], - bases=(DataClassJsonMixin,)) - json_dict = json.loads(data) - try: - out = unmarshal.from_dict({"res": json_dict}) - except AttributeError as attr_err: - raise AttributeError( - f'unable to unmarshal {data} as {typ} - {attr_err}') from attr_err - - return out.res if decoder is None else decoder(out.res) - - -def marshal_json(val, typ, encoder=None): - if not is_optional_type(typ) and val is None: - raise ValueError(f"Could not marshal None into non-optional type: {typ}") - - marshal = make_dataclass('Marshal', [('res', typ)], - bases=(DataClassJsonMixin,)) - marshaller = marshal(res=val) - json_dict = marshaller.to_dict() - val = json_dict["res"] if encoder is None else encoder(json_dict["res"]) - - return json.dumps(val, separators=(',', ':'), sort_keys=True) - - -def match_content_type(content_type: str, pattern: str) -> boolean: - if pattern in (content_type, "*", "*/*"): - return True - - msg = Message() - msg['content-type'] = content_type - media_type = msg.get_content_type() - - if media_type == pattern: - return True - - parts = media_type.split("/") - if len(parts) == 2: - if pattern in (f'{parts[0]}/*', f'*/{parts[1]}'): - return True - - return False - - -def datetimeisoformat(optional: bool): - def isoformatoptional(val): - if optional and val is None: - return None - return _val_to_string(val) - - return isoformatoptional - - -def dateisoformat(optional: bool): - def isoformatoptional(val): - if optional and val is None: - return None - return date.isoformat(val) - - return isoformatoptional - - -def datefromisoformat(date_str: str): - return dateutil.parser.parse(date_str).date() - - -def bigintencoder(optional: bool): - def bigintencode(val: int): - if optional and val is None: - return None - return str(val) - - return bigintencode - - -def bigintdecoder(val): - if isinstance(val, float): - raise ValueError(f"{val} is a float") - return int(val) - - -def decimalencoder(optional: bool, as_str: bool): - def decimalencode(val: Decimal): - if optional and val is None: - return None - - if as_str: - return str(val) - - return float(val) - - return decimalencode - - -def decimaldecoder(val): - return Decimal(str(val)) - - -def map_encoder(optional: bool, value_encoder: Callable): - def map_encode(val: Dict): - if optional and val is None: - return None - - encoded = {} - for key, value in val.items(): - encoded[key] = value_encoder(value) - - return encoded - - return map_encode - - -def map_decoder(value_decoder: Callable): - def map_decode(val: Dict): - decoded = {} - for key, value in val.items(): - decoded[key] = value_decoder(value) - - return decoded - - return map_decode - - -def list_encoder(optional: bool, value_encoder: Callable): - def list_encode(val: List): - if optional and val is None: - return None - - encoded = [] - for value in val: - encoded.append(value_encoder(value)) - - return encoded - - return list_encode - - -def list_decoder(value_decoder: Callable): - def list_decode(val: List): - decoded = [] - for value in val: - decoded.append(value_decoder(value)) - - return decoded - - return list_decode - -def union_encoder(all_encoders: Dict[str, Callable]): - def selective_encoder(val: any): - if type(val) in all_encoders: - return all_encoders[type(val)](val) - return val - return selective_encoder - -def union_decoder(all_decoders: List[Callable]): - def selective_decoder(val: any): - decoded = val - for decoder in all_decoders: - try: - decoded = decoder(val) - break - except (TypeError, ValueError): - continue - return decoded - return selective_decoder - -def get_field_name(name): - def override(_, _field_name=name): - return _field_name - - return override - - -def _val_to_string(val): - if isinstance(val, bool): - return str(val).lower() - if isinstance(val, datetime): - return val.isoformat().replace('+00:00', 'Z') - if isinstance(val, Enum): - return str(val.value) - - return str(val) - - -def _populate_from_globals(param_name: str, value: any, param_type: str, gbls: Dict[str, Dict[str, Dict[str, Any]]]): - if value is None and gbls is not None: - if 'parameters' in gbls: - if param_type in gbls['parameters']: - if param_name in gbls['parameters'][param_type]: - global_value = gbls['parameters'][param_type][param_name] - if global_value is not None: - value = global_value - - return value - - -def decoder_with_discriminator(field_name): - def decode_fx(obj): - kls = getattr(sys.modules['sdk.models.shared'], obj[field_name]) - return unmarshal_json(json.dumps(obj), kls) - return decode_fx - - -def remove_suffix(input_string, suffix): - if suffix and input_string.endswith(suffix): - return input_string[:-len(suffix)] - return input_string diff --git a/previous-versions/sync-for-payables-version-1/tests/helpers.py b/previous-versions/sync-for-payables-version-1/tests/helpers.py deleted file mode 100644 index b3d095040..000000000 --- a/previous-versions/sync-for-payables-version-1/tests/helpers.py +++ /dev/null @@ -1,61 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" - -import re - - -def sort_query_parameters(url): - parts = url.split("?") - - if len(parts) == 1: - return url - - query = parts[1] - params = query.split("&") - - params.sort(key=lambda x: x.split('=')[0]) - - return parts[0] + "?" + "&".join(params) - - -def sort_serialized_maps(inp: any, regex: str, delim: str): - - def sort_map(m): - entire_match = m.group(0) - - groups = m.groups() - - for group in groups: - pairs = [] - if '=' in group: - pairs = group.split(delim) - - pairs.sort(key=lambda x: x.split('=')[0]) - else: - values = group.split(delim) - - if len(values) == 1: - pairs = values - else: - pairs = [''] * int(len(values)/2) - # loop though every 2nd item - for i in range(0, len(values), 2): - pairs[int(i/2)] = values[i] + delim + values[i+1] - - pairs.sort(key=lambda x: x.split(delim)[0]) - - entire_match = entire_match.replace(group, delim.join(pairs)) - - return entire_match - - if isinstance(inp, str): - return re.sub(regex, sort_map, inp) - elif isinstance(inp, list): - for i, v in enumerate(inp): - inp[i] = sort_serialized_maps(v, regex, delim) - return inp - elif isinstance(inp, dict): - for k, v in inp.items(): - inp[k] = sort_serialized_maps(v, regex, delim) - return inp - else: - raise Exception("Unsupported type")