From 02f5b60c5a4784945a6be9f43c6d293222cdc501 Mon Sep 17 00:00:00 2001 From: speakeasybot Date: Fri, 1 Sep 2023 16:48:34 +0000 Subject: [PATCH] ci: regenerated with OpenAPI Doc 3.0.0, Speakeay CLI 1.77.1 --- sync-for-payables/.gitattributes | 2 + sync-for-payables/.gitignore | 6 + sync-for-payables/RELEASES.md | 11 + sync-for-payables/USAGE.md | 67 + .../models/operations/createaccountrequest.md | 11 + .../operations/createaccountresponse.md | 12 + .../operations/createbillcreditnoterequest.md | 11 + .../createbillcreditnoteresponse.md | 12 + .../operations/createbillpaymentrequest.md | 11 + .../operations/createbillpaymentresponse.md | 12 + .../models/operations/createbillrequest.md | 11 + .../models/operations/createbillresponse.md | 12 + .../operations/createcompanyresponse.md | 12 + .../operations/createconnectionrequest.md | 9 + .../operations/createconnectionrequestbody.md | 8 + .../operations/createconnectionresponse.md | 12 + .../operations/createjournalentryrequest.md | 11 + .../operations/createjournalentryresponse.md | 12 + .../models/operations/createjournalrequest.md | 11 + .../operations/createjournalresponse.md | 12 + .../operations/createsupplierrequest.md | 11 + .../operations/createsupplierresponse.md | 12 + .../models/operations/deletecompanyrequest.md | 8 + .../operations/deletecompanyresponse.md | 11 + .../operations/deleteconnectionrequest.md | 9 + .../operations/deleteconnectionresponse.md | 11 + .../downloadbillattachmentrequest.md | 11 + .../downloadbillattachmentresponse.md | 12 + .../models/operations/getaccountrequest.md | 9 + .../models/operations/getaccountresponse.md | 12 + .../operations/getbillattachmentrequest.md | 11 + .../operations/getbillattachmentresponse.md | 12 + .../operations/getbillcreditnoterequest.md | 9 + .../operations/getbillcreditnoteresponse.md | 12 + .../operations/getbillpaymentsrequest.md | 9 + .../operations/getbillpaymentsresponse.md | 12 + .../docs/models/operations/getbillrequest.md | 9 + .../docs/models/operations/getbillresponse.md | 12 + .../models/operations/getcompanyrequest.md | 8 + .../models/operations/getcompanyresponse.md | 12 + .../models/operations/getconnectionrequest.md | 9 + .../operations/getconnectionresponse.md | 12 + .../getcreateaccountmodelrequest.md | 9 + .../getcreateaccountmodelresponse.md | 12 + .../getcreatebillpaymentmodelrequest.md | 9 + .../getcreatebillpaymentmodelresponse.md | 12 + .../getcreatejournalentrymodelrequest.md | 9 + .../getcreatejournalentrymodelresponse.md | 12 + .../getcreatejournalmodelrequest.md | 9 + .../getcreatejournalmodelresponse.md | 12 + ...tcreateupdatebillcreditnotemodelrequest.md | 9 + ...createupdatebillcreditnotemodelresponse.md | 12 + .../getcreateupdatebillmodelrequest.md | 9 + .../getcreateupdatebillmodelresponse.md | 12 + .../getcreateupdatesuppliermodelrequest.md | 9 + .../getcreateupdatesuppliermodelresponse.md | 12 + .../models/operations/getdatastatusrequest.md | 8 + .../operations/getdatastatusresponse.md | 12 + .../models/operations/getjournalrequest.md | 9 + .../models/operations/getjournalresponse.md | 12 + .../operations/getpaymentmethodrequest.md | 9 + .../operations/getpaymentmethodresponse.md | 12 + .../operations/getpulloperationrequest.md | 9 + .../operations/getpulloperationresponse.md | 12 + .../operations/getpushoperationrequest.md | 9 + .../operations/getpushoperationresponse.md | 12 + .../models/operations/getsupplierrequest.md | 9 + .../models/operations/getsupplierresponse.md | 12 + .../models/operations/gettaxraterequest.md | 9 + .../models/operations/gettaxrateresponse.md | 12 + .../operations/gettrackingcategoryrequest.md | 9 + .../operations/gettrackingcategoryresponse.md | 12 + .../models/operations/listaccountsrequest.md | 12 + .../models/operations/listaccountsresponse.md | 12 + .../operations/listbillattachmentsrequest.md | 10 + .../operations/listbillattachmentsresponse.md | 12 + .../operations/listbillcreditnotesrequest.md | 12 + .../operations/listbillcreditnotesresponse.md | 12 + .../operations/listbillpaymentsrequest.md | 12 + .../operations/listbillpaymentsresponse.md | 12 + .../models/operations/listbillsrequest.md | 12 + .../models/operations/listbillsresponse.md | 12 + .../models/operations/listcompaniesrequest.md | 11 + .../operations/listcompaniesresponse.md | 12 + .../operations/listconnectionsrequest.md | 12 + .../operations/listconnectionsresponse.md | 12 + .../models/operations/listjournalsrequest.md | 12 + .../models/operations/listjournalsresponse.md | 12 + .../operations/listpaymentmethodsrequest.md | 12 + .../operations/listpaymentmethodsresponse.md | 12 + .../operations/listpulloperationsrequest.md | 12 + .../operations/listpulloperationsresponse.md | 12 + .../operations/listpushoperationsrequest.md | 12 + .../operations/listpushoperationsresponse.md | 12 + .../models/operations/listsuppliersrequest.md | 12 + .../operations/listsuppliersresponse.md | 12 + .../models/operations/listtaxratesrequest.md | 12 + .../models/operations/listtaxratesresponse.md | 12 + .../listtrackingcategoriesrequest.md | 12 + .../listtrackingcategoriesresponse.md | 12 + .../operations/refreshalldatatypesrequest.md | 8 + .../operations/refreshalldatatypesresponse.md | 11 + .../operations/refreshdatatyperequest.md | 10 + .../operations/refreshdatatyperesponse.md | 12 + .../operations/unlinkconnectionrequest.md | 10 + .../operations/unlinkconnectionrequestbody.md | 8 + .../operations/unlinkconnectionresponse.md | 12 + .../operations/updatebillcreditnoterequest.md | 13 + .../updatebillcreditnoteresponse.md | 12 + .../models/operations/updatebillrequest.md | 13 + .../models/operations/updatebillresponse.md | 12 + .../models/operations/updatecompanyrequest.md | 9 + .../operations/updatecompanyresponse.md | 12 + .../operations/updatesupplierrequest.md | 13 + .../operations/updatesupplierresponse.md | 12 + .../operations/uploadbillattachmentrequest.md | 11 + .../uploadbillattachmentrequestbody.md | 9 + .../uploadbillattachmentresponse.md | 11 + .../docs/models/shared/account.md | 51 + .../models/shared/accountingaddresstype.md | 12 + .../docs/models/shared/accountref.md | 11 + .../docs/models/shared/accounts.md | 14 + .../docs/models/shared/accountstatus.md | 13 + .../docs/models/shared/accounttype.md | 15 + .../shared/accountvaliddatatypelinks.md | 50 + .../docs/models/shared/attachment.md | 34 + .../docs/models/shared/attachments.md | 10 + sync-for-payables/docs/models/shared/bill.md | 48 + .../docs/models/shared/billcreditnote.md | 46 + .../models/shared/billcreditnotelineitem.md | 20 + .../billcreditnotelineitemitemreference.md | 11 + .../shared/billcreditnotelineitemtracking.md | 14 + ...llcreditnotelineitemtrackingcustomerref.md | 9 + ...illcreditnotelineitemtrackingprojectref.md | 9 + .../docs/models/shared/billcreditnotes.md | 14 + .../models/shared/billcreditnotestatus.md | 15 + .../docs/models/shared/billedtotype.md | 11 + .../docs/models/shared/billlineitem.md | 21 + .../docs/models/shared/billpayment.md | 174 +++ .../models/shared/billpaymentallocation.md | 9 + .../shared/billpaymentallocationallocation.md | 11 + .../docs/models/shared/billpaymentline.md | 10 + .../docs/models/shared/billpaymentlinelink.md | 11 + .../models/shared/billpaymentlinelinktype.md | 19 + .../docs/models/shared/billpayments.md | 14 + .../shared/billpurchaseorderreference.md | 9 + sync-for-payables/docs/models/shared/bills.md | 14 + .../docs/models/shared/billstatus.md | 15 + .../models/shared/billsupplementaldata.md | 12 + .../docs/models/shared/billwithholdingtax.md | 9 + .../docs/models/shared/companies.md | 14 + .../docs/models/shared/company.md | 22 + .../docs/models/shared/companyrequestbody.md | 9 + .../docs/models/shared/connection.md | 31 + .../docs/models/shared/connections.md | 14 + .../models/shared/connectionsourcetype.md | 14 + .../models/shared/createaccountresponse.md | 23 + .../shared/createbillcreditnoteresponse.md | 23 + .../shared/createbillpaymentresponse.md | 23 + .../docs/models/shared/createbillresponse.md | 23 + .../shared/createjournalentryresponse.md | 23 + .../models/shared/createjournalresponse.md | 23 + .../models/shared/createsupplierresponse.md | 23 + .../docs/models/shared/dataconnectionerror.md | 11 + .../models/shared/dataconnectionstatus.md | 13 + .../docs/models/shared/datastatus.md | 14 + .../docs/models/shared/datatype.md | 51 + .../docs/models/shared/errormessage.md | 15 + .../docs/models/shared/halref.md | 8 + .../docs/models/shared/itemref.md | 11 + sync-for-payables/docs/models/shared/items.md | 9 + .../docs/models/shared/itemsallocation.md | 11 + .../docs/models/shared/journal.md | 42 + .../docs/models/shared/journalentry.md | 42 + .../shared/journalentryrecordreference.md | 13 + .../docs/models/shared/journalline.md | 12 + .../docs/models/shared/journallinetracking.md | 10 + .../docs/models/shared/journalref.md | 11 + .../docs/models/shared/journals.md | 14 + .../docs/models/shared/journalstatus.md | 12 + sync-for-payables/docs/models/shared/links.md | 11 + .../docs/models/shared/metadata.md | 8 + .../models/shared/paymentallocationpayment.md | 15 + .../docs/models/shared/paymentmethod.md | 20 + .../docs/models/shared/paymentmethods.md | 14 + .../docs/models/shared/paymentmethodstatus.md | 12 + .../docs/models/shared/paymentmethodtype.md | 16 + .../docs/models/shared/pulloperation.md | 19 + .../docs/models/shared/pulloperations.md | 14 + .../docs/models/shared/pulloperationstatus.md | 30 + .../docs/models/shared/pushchangetype.md | 12 + .../docs/models/shared/pushfieldvalidation.md | 10 + .../docs/models/shared/pushoperation.md | 22 + .../docs/models/shared/pushoperationchange.md | 10 + .../docs/models/shared/pushoperationref.md | 9 + .../docs/models/shared/pushoperations.md | 14 + .../docs/models/shared/pushoperationstatus.md | 13 + .../docs/models/shared/pushoption.md | 16 + .../docs/models/shared/pushoptionchoice.md | 12 + .../docs/models/shared/pushoptionproperty.md | 14 + .../docs/models/shared/pushoptiontype.md | 15 + .../docs/models/shared/pushvalidationinfo.md | 9 + .../docs/models/shared/recordref.md | 13 + .../docs/models/shared/security.md | 8 + .../docs/models/shared/status.md | 12 + .../docs/models/shared/supplementaldata.md | 12 + .../docs/models/shared/supplier.md | 27 + .../docs/models/shared/supplieraddresses.md | 14 + .../docs/models/shared/supplierref.md | 11 + .../docs/models/shared/suppliers.md | 14 + .../docs/models/shared/supplierstatus.md | 12 + .../docs/models/shared/taxrate.md | 39 + .../docs/models/shared/taxratecomponent.md | 12 + .../docs/models/shared/taxrateref.md | 21 + .../docs/models/shared/taxrates.md | 14 + .../docs/models/shared/taxratestatus.md | 15 + .../docs/models/shared/tracking.md | 14 + .../docs/models/shared/trackingcategories.md | 14 + .../docs/models/shared/trackingcategory.md | 143 +++ .../docs/models/shared/trackingcategoryref.md | 13 + .../models/shared/trackingcategorytree.md | 17 + .../docs/models/shared/trackingcustomerref.md | 9 + .../docs/models/shared/trackingprojectref.md | 9 + .../shared/updatebillcreditnoteresponse.md | 23 + .../docs/models/shared/updatebillresponse.md | 23 + .../models/shared/updatesupplierresponse.md | 23 + .../docs/models/shared/validation.md | 11 + .../docs/models/shared/validationitem.md | 10 + .../models/shared/validdatatypelinksitems.md | 50 + .../docs/models/shared/withholdingtaxitems.md | 9 + .../docs/models/utils/retryconfig.md | 24 + .../docs/sdks/accounts/README.md | 240 ++++ .../docs/sdks/billcreditnotes/README.md | 760 ++++++++++++ .../docs/sdks/billpayments/README.md | 275 +++++ sync-for-payables/docs/sdks/bills/README.md | 1074 +++++++++++++++++ .../docs/sdks/codatsyncpayables/README.md | 12 + .../docs/sdks/companies/README.md | 221 ++++ .../docs/sdks/connections/README.md | 224 ++++ .../docs/sdks/journalentries/README.md | 221 ++++ .../docs/sdks/journals/README.md | 221 ++++ .../docs/sdks/managedata/README.md | 221 ++++ .../docs/sdks/paymentmethods/README.md | 105 ++ .../docs/sdks/pushoperations/README.md | 93 ++ .../docs/sdks/suppliers/README.md | 342 ++++++ .../docs/sdks/taxrates/README.md | 105 ++ .../docs/sdks/trackingcategories/README.md | 105 ++ sync-for-payables/files.gen | 421 +++++++ sync-for-payables/gen.yaml | 19 +- sync-for-payables/pylintrc | 643 ++++++++++ sync-for-payables/setup.py | 42 + .../src/codatsyncpayables/__init__.py | 4 + .../src/codatsyncpayables/accounts.py | 226 ++++ .../codatsyncpayables/bill_credit_notes.py | 283 +++++ .../src/codatsyncpayables/bill_payments.py | 226 ++++ .../src/codatsyncpayables/bills.py | 489 ++++++++ .../src/codatsyncpayables/companies.py | 245 ++++ .../src/codatsyncpayables/connections.py | 246 ++++ .../src/codatsyncpayables/journal_entries.py | 125 ++ .../src/codatsyncpayables/journals.py | 226 ++++ .../src/codatsyncpayables/manage_data.py | 244 ++++ .../src/codatsyncpayables/models/__init__.py | 2 + .../models/errors/__init__.py | 4 + .../models/errors/sdkerror.py | 24 + .../models/operations/__init__.py | 60 + .../models/operations/create_account.py | 34 + .../models/operations/create_bill.py | 34 + .../operations/create_bill_credit_note.py | 34 + .../models/operations/create_bill_payment.py | 34 + .../models/operations/create_company.py | 22 + .../models/operations/create_connection.py | 42 + .../models/operations/create_journal.py | 34 + .../models/operations/create_journal_entry.py | 34 + .../models/operations/create_supplier.py | 34 + .../models/operations/delete_company.py | 27 + .../models/operations/delete_connection.py | 28 + .../operations/download_bill_attachment.py | 34 + .../models/operations/get_account.py | 32 + .../models/operations/get_bill.py | 32 + .../models/operations/get_bill_attachment.py | 35 + .../models/operations/get_bill_credit_note.py | 31 + .../models/operations/get_bill_payments.py | 31 + .../models/operations/get_company.py | 30 + .../models/operations/get_connection.py | 31 + .../operations/get_create_account_model.py | 31 + .../get_create_billpayment_model.py | 31 + .../operations/get_create_journal_model.py | 31 + .../get_create_journalentry_model.py | 31 + .../get_create_update_bill_model.py | 31 + .../get_create_update_billcreditnote_model.py | 31 + .../get_create_update_supplier_model.py | 31 + .../models/operations/get_data_status.py | 30 + .../models/operations/get_journal.py | 31 + .../models/operations/get_payment_method.py | 31 + .../models/operations/get_pull_operation.py | 32 + .../models/operations/get_push_operation.py | 32 + .../models/operations/get_supplier.py | 32 + .../models/operations/get_tax_rate.py | 31 + .../operations/get_tracking_category.py | 31 + .../models/operations/list_accounts.py | 38 + .../operations/list_bill_attachments.py | 33 + .../operations/list_bill_credit_notes.py | 38 + .../models/operations/list_bill_payments.py | 38 + .../models/operations/list_bills.py | 38 + .../models/operations/list_companies.py | 37 + .../models/operations/list_connections.py | 38 + .../models/operations/list_journals.py | 38 + .../models/operations/list_payment_methods.py | 38 + .../models/operations/list_pull_operations.py | 38 + .../models/operations/list_push_operations.py | 38 + .../models/operations/list_suppliers.py | 38 + .../models/operations/list_tax_rates.py | 38 + .../operations/list_tracking_categories.py | 38 + .../operations/refresh_all_data_types.py | 27 + .../models/operations/refresh_data_type.py | 35 + .../models/operations/unlink_connection.py | 43 + .../models/operations/update_bill.py | 38 + .../operations/update_bill_credit_note.py | 37 + .../models/operations/update_company.py | 32 + .../models/operations/update_supplier.py | 38 + .../operations/upload_bill_attachment.py | 40 + .../models/shared/__init__.py | 98 ++ .../models/shared/account.py | 141 +++ .../models/shared/accountingaddresstype.py | 10 + .../models/shared/accountref.py | 20 + .../models/shared/accounts.py | 23 + .../models/shared/accountstatus.py | 11 + .../models/shared/accounttype.py | 13 + .../models/shared/attachment.py | 69 ++ .../models/shared/attachments.py | 18 + .../codatsyncpayables/models/shared/bill.py | 222 ++++ .../models/shared/billcreditnote.py | 152 +++ .../models/shared/billcreditnotelineitem.py | 107 ++ .../models/shared/billcreditnotes.py | 23 + .../models/shared/billcreditnotestatus.py | 13 + .../models/shared/billedtotype.py | 10 + .../models/shared/billlineitem.py | 59 + .../models/shared/billpayment.py | 222 ++++ .../models/shared/billpaymentline.py | 40 + .../models/shared/billpaymentlinelink.py | 53 + .../models/shared/billpaymentlinelinktype.py | 17 + .../models/shared/billpayments.py | 23 + .../codatsyncpayables/models/shared/bills.py | 23 + .../models/shared/billstatus.py | 13 + .../models/shared/companies.py | 23 + .../models/shared/company.py | 76 ++ .../models/shared/companyrequestbody.py | 19 + .../models/shared/connection.py | 96 ++ .../models/shared/connections.py | 23 + .../models/shared/createaccountresponse.py | 112 ++ .../shared/createbillcreditnoteresponse.py | 100 ++ .../shared/createbillpaymentresponse.py | 234 ++++ .../models/shared/createbillresponse.py | 103 ++ .../shared/createjournalentryresponse.py | 106 ++ .../models/shared/createjournalresponse.py | 106 ++ .../models/shared/createsupplierresponse.py | 89 ++ .../models/shared/dataconnectionerror.py | 39 + .../models/shared/dataconnectionstatus.py | 11 + .../models/shared/datastatus.py | 41 + .../models/shared/datatype.py | 49 + .../models/shared/errormessage.py | 22 + .../codatsyncpayables/models/shared/halref.py | 16 + .../models/shared/itemref.py | 20 + .../codatsyncpayables/models/shared/items.py | 85 ++ .../models/shared/journal.py | 82 ++ .../models/shared/journalentry.py | 142 +++ .../models/shared/journalline.py | 37 + .../models/shared/journalref.py | 20 + .../models/shared/journals.py | 23 + .../models/shared/journalstatus.py | 10 + .../codatsyncpayables/models/shared/links.py | 20 + .../models/shared/metadata.py | 17 + .../models/shared/paymentallocationpayment.py | 83 ++ .../models/shared/paymentmethod.py | 35 + .../models/shared/paymentmethods.py | 23 + .../models/shared/paymentmethodstatus.py | 10 + .../models/shared/paymentmethodtype.py | 14 + .../models/shared/pulloperation.py | 72 ++ .../models/shared/pulloperations.py | 23 + .../models/shared/pushchangetype.py | 11 + .../models/shared/pushfieldvalidation.py | 18 + .../models/shared/pushoperation.py | 81 ++ .../models/shared/pushoperationchange.py | 20 + .../models/shared/pushoperationref.py | 19 + .../models/shared/pushoperations.py | 23 + .../models/shared/pushoperationstatus.py | 11 + .../models/shared/pushoption.py | 27 + .../models/shared/pushoptionchoice.py | 22 + .../models/shared/pushoptionproperty.py | 25 + .../models/shared/pushoptiontype.py | 14 + .../models/shared/pushvalidationinfo.py | 18 + .../models/shared/recordref.py | 23 + .../models/shared/security.py | 12 + .../codatsyncpayables/models/shared/status.py | 10 + .../models/shared/supplementaldata.py | 20 + .../models/shared/supplier.py | 75 ++ .../models/shared/supplierref.py | 20 + .../models/shared/suppliers.py | 23 + .../models/shared/supplierstatus.py | 10 + .../models/shared/taxrate.py | 61 + .../models/shared/taxratecomponent.py | 22 + .../models/shared/taxrateref.py | 32 + .../models/shared/taxrates.py | 23 + .../models/shared/taxratestatus.py | 14 + .../models/shared/tracking.py | 45 + .../models/shared/trackingcategories.py | 23 + .../models/shared/trackingcategory.py | 157 +++ .../models/shared/trackingcategoryref.py | 21 + .../models/shared/trackingcategorytree.py | 31 + .../shared/updatebillcreditnoteresponse.py | 100 ++ .../models/shared/updatebillresponse.py | 103 ++ .../models/shared/updatesupplierresponse.py | 89 ++ .../models/shared/validation.py | 19 + .../models/shared/validationitem.py | 18 + .../models/shared/validdatatypelinksitems.py | 60 + .../models/shared/withholdingtaxitems.py | 16 + .../src/codatsyncpayables/payment_methods.py | 116 ++ .../src/codatsyncpayables/push_operations.py | 106 ++ .../src/codatsyncpayables/sdk.py | 108 ++ .../src/codatsyncpayables/sdkconfiguration.py | 30 + .../src/codatsyncpayables/suppliers.py | 283 +++++ .../src/codatsyncpayables/tax_rates.py | 116 ++ .../codatsyncpayables/tracking_categories.py | 116 ++ .../src/codatsyncpayables/utils/__init__.py | 4 + .../src/codatsyncpayables/utils/retries.py | 119 ++ .../src/codatsyncpayables/utils/utils.py | 764 ++++++++++++ 425 files changed, 19651 insertions(+), 5 deletions(-) create mode 100755 sync-for-payables/.gitattributes create mode 100755 sync-for-payables/.gitignore create mode 100644 sync-for-payables/RELEASES.md create mode 100755 sync-for-payables/USAGE.md create mode 100755 sync-for-payables/docs/models/operations/createaccountrequest.md create mode 100755 sync-for-payables/docs/models/operations/createaccountresponse.md create mode 100755 sync-for-payables/docs/models/operations/createbillcreditnoterequest.md create mode 100755 sync-for-payables/docs/models/operations/createbillcreditnoteresponse.md create mode 100755 sync-for-payables/docs/models/operations/createbillpaymentrequest.md create mode 100755 sync-for-payables/docs/models/operations/createbillpaymentresponse.md create mode 100755 sync-for-payables/docs/models/operations/createbillrequest.md create mode 100755 sync-for-payables/docs/models/operations/createbillresponse.md create mode 100755 sync-for-payables/docs/models/operations/createcompanyresponse.md create mode 100755 sync-for-payables/docs/models/operations/createconnectionrequest.md create mode 100755 sync-for-payables/docs/models/operations/createconnectionrequestbody.md create mode 100755 sync-for-payables/docs/models/operations/createconnectionresponse.md create mode 100755 sync-for-payables/docs/models/operations/createjournalentryrequest.md create mode 100755 sync-for-payables/docs/models/operations/createjournalentryresponse.md create mode 100755 sync-for-payables/docs/models/operations/createjournalrequest.md create mode 100755 sync-for-payables/docs/models/operations/createjournalresponse.md create mode 100755 sync-for-payables/docs/models/operations/createsupplierrequest.md create mode 100755 sync-for-payables/docs/models/operations/createsupplierresponse.md create mode 100755 sync-for-payables/docs/models/operations/deletecompanyrequest.md create mode 100755 sync-for-payables/docs/models/operations/deletecompanyresponse.md create mode 100755 sync-for-payables/docs/models/operations/deleteconnectionrequest.md create mode 100755 sync-for-payables/docs/models/operations/deleteconnectionresponse.md create mode 100755 sync-for-payables/docs/models/operations/downloadbillattachmentrequest.md create mode 100755 sync-for-payables/docs/models/operations/downloadbillattachmentresponse.md create mode 100755 sync-for-payables/docs/models/operations/getaccountrequest.md create mode 100755 sync-for-payables/docs/models/operations/getaccountresponse.md create mode 100755 sync-for-payables/docs/models/operations/getbillattachmentrequest.md create mode 100755 sync-for-payables/docs/models/operations/getbillattachmentresponse.md create mode 100755 sync-for-payables/docs/models/operations/getbillcreditnoterequest.md create mode 100755 sync-for-payables/docs/models/operations/getbillcreditnoteresponse.md create mode 100755 sync-for-payables/docs/models/operations/getbillpaymentsrequest.md create mode 100755 sync-for-payables/docs/models/operations/getbillpaymentsresponse.md create mode 100755 sync-for-payables/docs/models/operations/getbillrequest.md create mode 100755 sync-for-payables/docs/models/operations/getbillresponse.md create mode 100755 sync-for-payables/docs/models/operations/getcompanyrequest.md create mode 100755 sync-for-payables/docs/models/operations/getcompanyresponse.md create mode 100755 sync-for-payables/docs/models/operations/getconnectionrequest.md create mode 100755 sync-for-payables/docs/models/operations/getconnectionresponse.md create mode 100755 sync-for-payables/docs/models/operations/getcreateaccountmodelrequest.md create mode 100755 sync-for-payables/docs/models/operations/getcreateaccountmodelresponse.md create mode 100755 sync-for-payables/docs/models/operations/getcreatebillpaymentmodelrequest.md create mode 100755 sync-for-payables/docs/models/operations/getcreatebillpaymentmodelresponse.md create mode 100755 sync-for-payables/docs/models/operations/getcreatejournalentrymodelrequest.md create mode 100755 sync-for-payables/docs/models/operations/getcreatejournalentrymodelresponse.md create mode 100755 sync-for-payables/docs/models/operations/getcreatejournalmodelrequest.md create mode 100755 sync-for-payables/docs/models/operations/getcreatejournalmodelresponse.md create mode 100755 sync-for-payables/docs/models/operations/getcreateupdatebillcreditnotemodelrequest.md create mode 100755 sync-for-payables/docs/models/operations/getcreateupdatebillcreditnotemodelresponse.md create mode 100755 sync-for-payables/docs/models/operations/getcreateupdatebillmodelrequest.md create mode 100755 sync-for-payables/docs/models/operations/getcreateupdatebillmodelresponse.md create mode 100755 sync-for-payables/docs/models/operations/getcreateupdatesuppliermodelrequest.md create mode 100755 sync-for-payables/docs/models/operations/getcreateupdatesuppliermodelresponse.md create mode 100755 sync-for-payables/docs/models/operations/getdatastatusrequest.md create mode 100755 sync-for-payables/docs/models/operations/getdatastatusresponse.md create mode 100755 sync-for-payables/docs/models/operations/getjournalrequest.md create mode 100755 sync-for-payables/docs/models/operations/getjournalresponse.md create mode 100755 sync-for-payables/docs/models/operations/getpaymentmethodrequest.md create mode 100755 sync-for-payables/docs/models/operations/getpaymentmethodresponse.md create mode 100755 sync-for-payables/docs/models/operations/getpulloperationrequest.md create mode 100755 sync-for-payables/docs/models/operations/getpulloperationresponse.md create mode 100755 sync-for-payables/docs/models/operations/getpushoperationrequest.md create mode 100755 sync-for-payables/docs/models/operations/getpushoperationresponse.md create mode 100755 sync-for-payables/docs/models/operations/getsupplierrequest.md create mode 100755 sync-for-payables/docs/models/operations/getsupplierresponse.md create mode 100755 sync-for-payables/docs/models/operations/gettaxraterequest.md create mode 100755 sync-for-payables/docs/models/operations/gettaxrateresponse.md create mode 100755 sync-for-payables/docs/models/operations/gettrackingcategoryrequest.md create mode 100755 sync-for-payables/docs/models/operations/gettrackingcategoryresponse.md create mode 100755 sync-for-payables/docs/models/operations/listaccountsrequest.md create mode 100755 sync-for-payables/docs/models/operations/listaccountsresponse.md create mode 100755 sync-for-payables/docs/models/operations/listbillattachmentsrequest.md create mode 100755 sync-for-payables/docs/models/operations/listbillattachmentsresponse.md create mode 100755 sync-for-payables/docs/models/operations/listbillcreditnotesrequest.md create mode 100755 sync-for-payables/docs/models/operations/listbillcreditnotesresponse.md create mode 100755 sync-for-payables/docs/models/operations/listbillpaymentsrequest.md create mode 100755 sync-for-payables/docs/models/operations/listbillpaymentsresponse.md create mode 100755 sync-for-payables/docs/models/operations/listbillsrequest.md create mode 100755 sync-for-payables/docs/models/operations/listbillsresponse.md create mode 100755 sync-for-payables/docs/models/operations/listcompaniesrequest.md create mode 100755 sync-for-payables/docs/models/operations/listcompaniesresponse.md create mode 100755 sync-for-payables/docs/models/operations/listconnectionsrequest.md create mode 100755 sync-for-payables/docs/models/operations/listconnectionsresponse.md create mode 100755 sync-for-payables/docs/models/operations/listjournalsrequest.md create mode 100755 sync-for-payables/docs/models/operations/listjournalsresponse.md create mode 100755 sync-for-payables/docs/models/operations/listpaymentmethodsrequest.md create mode 100755 sync-for-payables/docs/models/operations/listpaymentmethodsresponse.md create mode 100755 sync-for-payables/docs/models/operations/listpulloperationsrequest.md create mode 100755 sync-for-payables/docs/models/operations/listpulloperationsresponse.md create mode 100755 sync-for-payables/docs/models/operations/listpushoperationsrequest.md create mode 100755 sync-for-payables/docs/models/operations/listpushoperationsresponse.md create mode 100755 sync-for-payables/docs/models/operations/listsuppliersrequest.md create mode 100755 sync-for-payables/docs/models/operations/listsuppliersresponse.md create mode 100755 sync-for-payables/docs/models/operations/listtaxratesrequest.md create mode 100755 sync-for-payables/docs/models/operations/listtaxratesresponse.md create mode 100755 sync-for-payables/docs/models/operations/listtrackingcategoriesrequest.md create mode 100755 sync-for-payables/docs/models/operations/listtrackingcategoriesresponse.md create mode 100755 sync-for-payables/docs/models/operations/refreshalldatatypesrequest.md create mode 100755 sync-for-payables/docs/models/operations/refreshalldatatypesresponse.md create mode 100755 sync-for-payables/docs/models/operations/refreshdatatyperequest.md create mode 100755 sync-for-payables/docs/models/operations/refreshdatatyperesponse.md create mode 100755 sync-for-payables/docs/models/operations/unlinkconnectionrequest.md create mode 100755 sync-for-payables/docs/models/operations/unlinkconnectionrequestbody.md create mode 100755 sync-for-payables/docs/models/operations/unlinkconnectionresponse.md create mode 100755 sync-for-payables/docs/models/operations/updatebillcreditnoterequest.md create mode 100755 sync-for-payables/docs/models/operations/updatebillcreditnoteresponse.md create mode 100755 sync-for-payables/docs/models/operations/updatebillrequest.md create mode 100755 sync-for-payables/docs/models/operations/updatebillresponse.md create mode 100755 sync-for-payables/docs/models/operations/updatecompanyrequest.md create mode 100755 sync-for-payables/docs/models/operations/updatecompanyresponse.md create mode 100755 sync-for-payables/docs/models/operations/updatesupplierrequest.md create mode 100755 sync-for-payables/docs/models/operations/updatesupplierresponse.md create mode 100755 sync-for-payables/docs/models/operations/uploadbillattachmentrequest.md create mode 100755 sync-for-payables/docs/models/operations/uploadbillattachmentrequestbody.md create mode 100755 sync-for-payables/docs/models/operations/uploadbillattachmentresponse.md create mode 100755 sync-for-payables/docs/models/shared/account.md create mode 100755 sync-for-payables/docs/models/shared/accountingaddresstype.md create mode 100755 sync-for-payables/docs/models/shared/accountref.md create mode 100755 sync-for-payables/docs/models/shared/accounts.md create mode 100755 sync-for-payables/docs/models/shared/accountstatus.md create mode 100755 sync-for-payables/docs/models/shared/accounttype.md create mode 100755 sync-for-payables/docs/models/shared/accountvaliddatatypelinks.md create mode 100755 sync-for-payables/docs/models/shared/attachment.md create mode 100755 sync-for-payables/docs/models/shared/attachments.md create mode 100755 sync-for-payables/docs/models/shared/bill.md create mode 100755 sync-for-payables/docs/models/shared/billcreditnote.md create mode 100755 sync-for-payables/docs/models/shared/billcreditnotelineitem.md create mode 100755 sync-for-payables/docs/models/shared/billcreditnotelineitemitemreference.md create mode 100755 sync-for-payables/docs/models/shared/billcreditnotelineitemtracking.md create mode 100755 sync-for-payables/docs/models/shared/billcreditnotelineitemtrackingcustomerref.md create mode 100755 sync-for-payables/docs/models/shared/billcreditnotelineitemtrackingprojectref.md create mode 100755 sync-for-payables/docs/models/shared/billcreditnotes.md create mode 100755 sync-for-payables/docs/models/shared/billcreditnotestatus.md create mode 100755 sync-for-payables/docs/models/shared/billedtotype.md create mode 100755 sync-for-payables/docs/models/shared/billlineitem.md create mode 100755 sync-for-payables/docs/models/shared/billpayment.md create mode 100755 sync-for-payables/docs/models/shared/billpaymentallocation.md create mode 100755 sync-for-payables/docs/models/shared/billpaymentallocationallocation.md create mode 100755 sync-for-payables/docs/models/shared/billpaymentline.md create mode 100755 sync-for-payables/docs/models/shared/billpaymentlinelink.md create mode 100755 sync-for-payables/docs/models/shared/billpaymentlinelinktype.md create mode 100755 sync-for-payables/docs/models/shared/billpayments.md create mode 100755 sync-for-payables/docs/models/shared/billpurchaseorderreference.md create mode 100755 sync-for-payables/docs/models/shared/bills.md create mode 100755 sync-for-payables/docs/models/shared/billstatus.md create mode 100755 sync-for-payables/docs/models/shared/billsupplementaldata.md create mode 100755 sync-for-payables/docs/models/shared/billwithholdingtax.md create mode 100755 sync-for-payables/docs/models/shared/companies.md create mode 100755 sync-for-payables/docs/models/shared/company.md create mode 100755 sync-for-payables/docs/models/shared/companyrequestbody.md create mode 100755 sync-for-payables/docs/models/shared/connection.md create mode 100755 sync-for-payables/docs/models/shared/connections.md create mode 100755 sync-for-payables/docs/models/shared/connectionsourcetype.md create mode 100755 sync-for-payables/docs/models/shared/createaccountresponse.md create mode 100755 sync-for-payables/docs/models/shared/createbillcreditnoteresponse.md create mode 100755 sync-for-payables/docs/models/shared/createbillpaymentresponse.md create mode 100755 sync-for-payables/docs/models/shared/createbillresponse.md create mode 100755 sync-for-payables/docs/models/shared/createjournalentryresponse.md create mode 100755 sync-for-payables/docs/models/shared/createjournalresponse.md create mode 100755 sync-for-payables/docs/models/shared/createsupplierresponse.md create mode 100755 sync-for-payables/docs/models/shared/dataconnectionerror.md create mode 100755 sync-for-payables/docs/models/shared/dataconnectionstatus.md create mode 100755 sync-for-payables/docs/models/shared/datastatus.md create mode 100755 sync-for-payables/docs/models/shared/datatype.md create mode 100755 sync-for-payables/docs/models/shared/errormessage.md create mode 100755 sync-for-payables/docs/models/shared/halref.md create mode 100755 sync-for-payables/docs/models/shared/itemref.md create mode 100755 sync-for-payables/docs/models/shared/items.md create mode 100755 sync-for-payables/docs/models/shared/itemsallocation.md create mode 100755 sync-for-payables/docs/models/shared/journal.md create mode 100755 sync-for-payables/docs/models/shared/journalentry.md create mode 100755 sync-for-payables/docs/models/shared/journalentryrecordreference.md create mode 100755 sync-for-payables/docs/models/shared/journalline.md create mode 100755 sync-for-payables/docs/models/shared/journallinetracking.md create mode 100755 sync-for-payables/docs/models/shared/journalref.md create mode 100755 sync-for-payables/docs/models/shared/journals.md create mode 100755 sync-for-payables/docs/models/shared/journalstatus.md create mode 100755 sync-for-payables/docs/models/shared/links.md create mode 100755 sync-for-payables/docs/models/shared/metadata.md create mode 100755 sync-for-payables/docs/models/shared/paymentallocationpayment.md create mode 100755 sync-for-payables/docs/models/shared/paymentmethod.md create mode 100755 sync-for-payables/docs/models/shared/paymentmethods.md create mode 100755 sync-for-payables/docs/models/shared/paymentmethodstatus.md create mode 100755 sync-for-payables/docs/models/shared/paymentmethodtype.md create mode 100755 sync-for-payables/docs/models/shared/pulloperation.md create mode 100755 sync-for-payables/docs/models/shared/pulloperations.md create mode 100755 sync-for-payables/docs/models/shared/pulloperationstatus.md create mode 100755 sync-for-payables/docs/models/shared/pushchangetype.md create mode 100755 sync-for-payables/docs/models/shared/pushfieldvalidation.md create mode 100755 sync-for-payables/docs/models/shared/pushoperation.md create mode 100755 sync-for-payables/docs/models/shared/pushoperationchange.md create mode 100755 sync-for-payables/docs/models/shared/pushoperationref.md create mode 100755 sync-for-payables/docs/models/shared/pushoperations.md create mode 100755 sync-for-payables/docs/models/shared/pushoperationstatus.md create mode 100755 sync-for-payables/docs/models/shared/pushoption.md create mode 100755 sync-for-payables/docs/models/shared/pushoptionchoice.md create mode 100755 sync-for-payables/docs/models/shared/pushoptionproperty.md create mode 100755 sync-for-payables/docs/models/shared/pushoptiontype.md create mode 100755 sync-for-payables/docs/models/shared/pushvalidationinfo.md create mode 100755 sync-for-payables/docs/models/shared/recordref.md create mode 100755 sync-for-payables/docs/models/shared/security.md create mode 100755 sync-for-payables/docs/models/shared/status.md create mode 100755 sync-for-payables/docs/models/shared/supplementaldata.md create mode 100755 sync-for-payables/docs/models/shared/supplier.md create mode 100755 sync-for-payables/docs/models/shared/supplieraddresses.md create mode 100755 sync-for-payables/docs/models/shared/supplierref.md create mode 100755 sync-for-payables/docs/models/shared/suppliers.md create mode 100755 sync-for-payables/docs/models/shared/supplierstatus.md create mode 100755 sync-for-payables/docs/models/shared/taxrate.md create mode 100755 sync-for-payables/docs/models/shared/taxratecomponent.md create mode 100755 sync-for-payables/docs/models/shared/taxrateref.md create mode 100755 sync-for-payables/docs/models/shared/taxrates.md create mode 100755 sync-for-payables/docs/models/shared/taxratestatus.md create mode 100755 sync-for-payables/docs/models/shared/tracking.md create mode 100755 sync-for-payables/docs/models/shared/trackingcategories.md create mode 100755 sync-for-payables/docs/models/shared/trackingcategory.md create mode 100755 sync-for-payables/docs/models/shared/trackingcategoryref.md create mode 100755 sync-for-payables/docs/models/shared/trackingcategorytree.md create mode 100755 sync-for-payables/docs/models/shared/trackingcustomerref.md create mode 100755 sync-for-payables/docs/models/shared/trackingprojectref.md create mode 100755 sync-for-payables/docs/models/shared/updatebillcreditnoteresponse.md create mode 100755 sync-for-payables/docs/models/shared/updatebillresponse.md create mode 100755 sync-for-payables/docs/models/shared/updatesupplierresponse.md create mode 100755 sync-for-payables/docs/models/shared/validation.md create mode 100755 sync-for-payables/docs/models/shared/validationitem.md create mode 100755 sync-for-payables/docs/models/shared/validdatatypelinksitems.md create mode 100755 sync-for-payables/docs/models/shared/withholdingtaxitems.md create mode 100755 sync-for-payables/docs/models/utils/retryconfig.md create mode 100755 sync-for-payables/docs/sdks/accounts/README.md create mode 100755 sync-for-payables/docs/sdks/billcreditnotes/README.md create mode 100755 sync-for-payables/docs/sdks/billpayments/README.md create mode 100755 sync-for-payables/docs/sdks/bills/README.md create mode 100755 sync-for-payables/docs/sdks/codatsyncpayables/README.md create mode 100755 sync-for-payables/docs/sdks/companies/README.md create mode 100755 sync-for-payables/docs/sdks/connections/README.md create mode 100755 sync-for-payables/docs/sdks/journalentries/README.md create mode 100755 sync-for-payables/docs/sdks/journals/README.md create mode 100755 sync-for-payables/docs/sdks/managedata/README.md create mode 100755 sync-for-payables/docs/sdks/paymentmethods/README.md create mode 100755 sync-for-payables/docs/sdks/pushoperations/README.md create mode 100755 sync-for-payables/docs/sdks/suppliers/README.md create mode 100755 sync-for-payables/docs/sdks/taxrates/README.md create mode 100755 sync-for-payables/docs/sdks/trackingcategories/README.md create mode 100755 sync-for-payables/files.gen create mode 100755 sync-for-payables/pylintrc create mode 100755 sync-for-payables/setup.py create mode 100755 sync-for-payables/src/codatsyncpayables/__init__.py create mode 100755 sync-for-payables/src/codatsyncpayables/accounts.py create mode 100755 sync-for-payables/src/codatsyncpayables/bill_credit_notes.py create mode 100755 sync-for-payables/src/codatsyncpayables/bill_payments.py create mode 100755 sync-for-payables/src/codatsyncpayables/bills.py create mode 100755 sync-for-payables/src/codatsyncpayables/companies.py create mode 100755 sync-for-payables/src/codatsyncpayables/connections.py create mode 100755 sync-for-payables/src/codatsyncpayables/journal_entries.py create mode 100755 sync-for-payables/src/codatsyncpayables/journals.py create mode 100755 sync-for-payables/src/codatsyncpayables/manage_data.py create mode 100755 sync-for-payables/src/codatsyncpayables/models/__init__.py create mode 100755 sync-for-payables/src/codatsyncpayables/models/errors/__init__.py create mode 100755 sync-for-payables/src/codatsyncpayables/models/errors/sdkerror.py create mode 100755 sync-for-payables/src/codatsyncpayables/models/operations/__init__.py create mode 100755 sync-for-payables/src/codatsyncpayables/models/operations/create_account.py create mode 100755 sync-for-payables/src/codatsyncpayables/models/operations/create_bill.py create mode 100755 sync-for-payables/src/codatsyncpayables/models/operations/create_bill_credit_note.py create mode 100755 sync-for-payables/src/codatsyncpayables/models/operations/create_bill_payment.py create mode 100755 sync-for-payables/src/codatsyncpayables/models/operations/create_company.py create mode 100755 sync-for-payables/src/codatsyncpayables/models/operations/create_connection.py create mode 100755 sync-for-payables/src/codatsyncpayables/models/operations/create_journal.py create mode 100755 sync-for-payables/src/codatsyncpayables/models/operations/create_journal_entry.py create mode 100755 sync-for-payables/src/codatsyncpayables/models/operations/create_supplier.py create mode 100755 sync-for-payables/src/codatsyncpayables/models/operations/delete_company.py create mode 100755 sync-for-payables/src/codatsyncpayables/models/operations/delete_connection.py create mode 100755 sync-for-payables/src/codatsyncpayables/models/operations/download_bill_attachment.py create mode 100755 sync-for-payables/src/codatsyncpayables/models/operations/get_account.py create mode 100755 sync-for-payables/src/codatsyncpayables/models/operations/get_bill.py create mode 100755 sync-for-payables/src/codatsyncpayables/models/operations/get_bill_attachment.py create mode 100755 sync-for-payables/src/codatsyncpayables/models/operations/get_bill_credit_note.py create mode 100755 sync-for-payables/src/codatsyncpayables/models/operations/get_bill_payments.py create mode 100755 sync-for-payables/src/codatsyncpayables/models/operations/get_company.py create mode 100755 sync-for-payables/src/codatsyncpayables/models/operations/get_connection.py create mode 100755 sync-for-payables/src/codatsyncpayables/models/operations/get_create_account_model.py create mode 100755 sync-for-payables/src/codatsyncpayables/models/operations/get_create_billpayment_model.py create mode 100755 sync-for-payables/src/codatsyncpayables/models/operations/get_create_journal_model.py create mode 100755 sync-for-payables/src/codatsyncpayables/models/operations/get_create_journalentry_model.py create mode 100755 sync-for-payables/src/codatsyncpayables/models/operations/get_create_update_bill_model.py create mode 100755 sync-for-payables/src/codatsyncpayables/models/operations/get_create_update_billcreditnote_model.py create mode 100755 sync-for-payables/src/codatsyncpayables/models/operations/get_create_update_supplier_model.py create mode 100755 sync-for-payables/src/codatsyncpayables/models/operations/get_data_status.py create mode 100755 sync-for-payables/src/codatsyncpayables/models/operations/get_journal.py create mode 100755 sync-for-payables/src/codatsyncpayables/models/operations/get_payment_method.py create mode 100755 sync-for-payables/src/codatsyncpayables/models/operations/get_pull_operation.py create mode 100755 sync-for-payables/src/codatsyncpayables/models/operations/get_push_operation.py create mode 100755 sync-for-payables/src/codatsyncpayables/models/operations/get_supplier.py create mode 100755 sync-for-payables/src/codatsyncpayables/models/operations/get_tax_rate.py create mode 100755 sync-for-payables/src/codatsyncpayables/models/operations/get_tracking_category.py create mode 100755 sync-for-payables/src/codatsyncpayables/models/operations/list_accounts.py create mode 100755 sync-for-payables/src/codatsyncpayables/models/operations/list_bill_attachments.py create mode 100755 sync-for-payables/src/codatsyncpayables/models/operations/list_bill_credit_notes.py create mode 100755 sync-for-payables/src/codatsyncpayables/models/operations/list_bill_payments.py create mode 100755 sync-for-payables/src/codatsyncpayables/models/operations/list_bills.py create mode 100755 sync-for-payables/src/codatsyncpayables/models/operations/list_companies.py create mode 100755 sync-for-payables/src/codatsyncpayables/models/operations/list_connections.py create mode 100755 sync-for-payables/src/codatsyncpayables/models/operations/list_journals.py create mode 100755 sync-for-payables/src/codatsyncpayables/models/operations/list_payment_methods.py create mode 100755 sync-for-payables/src/codatsyncpayables/models/operations/list_pull_operations.py create mode 100755 sync-for-payables/src/codatsyncpayables/models/operations/list_push_operations.py create mode 100755 sync-for-payables/src/codatsyncpayables/models/operations/list_suppliers.py create mode 100755 sync-for-payables/src/codatsyncpayables/models/operations/list_tax_rates.py create mode 100755 sync-for-payables/src/codatsyncpayables/models/operations/list_tracking_categories.py create mode 100755 sync-for-payables/src/codatsyncpayables/models/operations/refresh_all_data_types.py create mode 100755 sync-for-payables/src/codatsyncpayables/models/operations/refresh_data_type.py create mode 100755 sync-for-payables/src/codatsyncpayables/models/operations/unlink_connection.py create mode 100755 sync-for-payables/src/codatsyncpayables/models/operations/update_bill.py create mode 100755 sync-for-payables/src/codatsyncpayables/models/operations/update_bill_credit_note.py create mode 100755 sync-for-payables/src/codatsyncpayables/models/operations/update_company.py create mode 100755 sync-for-payables/src/codatsyncpayables/models/operations/update_supplier.py create mode 100755 sync-for-payables/src/codatsyncpayables/models/operations/upload_bill_attachment.py create mode 100755 sync-for-payables/src/codatsyncpayables/models/shared/__init__.py create mode 100755 sync-for-payables/src/codatsyncpayables/models/shared/account.py create mode 100755 sync-for-payables/src/codatsyncpayables/models/shared/accountingaddresstype.py create mode 100755 sync-for-payables/src/codatsyncpayables/models/shared/accountref.py create mode 100755 sync-for-payables/src/codatsyncpayables/models/shared/accounts.py create mode 100755 sync-for-payables/src/codatsyncpayables/models/shared/accountstatus.py create mode 100755 sync-for-payables/src/codatsyncpayables/models/shared/accounttype.py create mode 100755 sync-for-payables/src/codatsyncpayables/models/shared/attachment.py create mode 100755 sync-for-payables/src/codatsyncpayables/models/shared/attachments.py create mode 100755 sync-for-payables/src/codatsyncpayables/models/shared/bill.py create mode 100755 sync-for-payables/src/codatsyncpayables/models/shared/billcreditnote.py create mode 100755 sync-for-payables/src/codatsyncpayables/models/shared/billcreditnotelineitem.py create mode 100755 sync-for-payables/src/codatsyncpayables/models/shared/billcreditnotes.py create mode 100755 sync-for-payables/src/codatsyncpayables/models/shared/billcreditnotestatus.py create mode 100755 sync-for-payables/src/codatsyncpayables/models/shared/billedtotype.py create mode 100755 sync-for-payables/src/codatsyncpayables/models/shared/billlineitem.py create mode 100755 sync-for-payables/src/codatsyncpayables/models/shared/billpayment.py create mode 100755 sync-for-payables/src/codatsyncpayables/models/shared/billpaymentline.py create mode 100755 sync-for-payables/src/codatsyncpayables/models/shared/billpaymentlinelink.py create mode 100755 sync-for-payables/src/codatsyncpayables/models/shared/billpaymentlinelinktype.py create mode 100755 sync-for-payables/src/codatsyncpayables/models/shared/billpayments.py create mode 100755 sync-for-payables/src/codatsyncpayables/models/shared/bills.py create mode 100755 sync-for-payables/src/codatsyncpayables/models/shared/billstatus.py create mode 100755 sync-for-payables/src/codatsyncpayables/models/shared/companies.py create mode 100755 sync-for-payables/src/codatsyncpayables/models/shared/company.py create mode 100755 sync-for-payables/src/codatsyncpayables/models/shared/companyrequestbody.py create mode 100755 sync-for-payables/src/codatsyncpayables/models/shared/connection.py create mode 100755 sync-for-payables/src/codatsyncpayables/models/shared/connections.py create mode 100755 sync-for-payables/src/codatsyncpayables/models/shared/createaccountresponse.py create mode 100755 sync-for-payables/src/codatsyncpayables/models/shared/createbillcreditnoteresponse.py create mode 100755 sync-for-payables/src/codatsyncpayables/models/shared/createbillpaymentresponse.py create mode 100755 sync-for-payables/src/codatsyncpayables/models/shared/createbillresponse.py create mode 100755 sync-for-payables/src/codatsyncpayables/models/shared/createjournalentryresponse.py create mode 100755 sync-for-payables/src/codatsyncpayables/models/shared/createjournalresponse.py create mode 100755 sync-for-payables/src/codatsyncpayables/models/shared/createsupplierresponse.py create mode 100755 sync-for-payables/src/codatsyncpayables/models/shared/dataconnectionerror.py create mode 100755 sync-for-payables/src/codatsyncpayables/models/shared/dataconnectionstatus.py create mode 100755 sync-for-payables/src/codatsyncpayables/models/shared/datastatus.py create mode 100755 sync-for-payables/src/codatsyncpayables/models/shared/datatype.py create mode 100755 sync-for-payables/src/codatsyncpayables/models/shared/errormessage.py create mode 100755 sync-for-payables/src/codatsyncpayables/models/shared/halref.py create mode 100755 sync-for-payables/src/codatsyncpayables/models/shared/itemref.py create mode 100755 sync-for-payables/src/codatsyncpayables/models/shared/items.py create mode 100755 sync-for-payables/src/codatsyncpayables/models/shared/journal.py create mode 100755 sync-for-payables/src/codatsyncpayables/models/shared/journalentry.py create mode 100755 sync-for-payables/src/codatsyncpayables/models/shared/journalline.py create mode 100755 sync-for-payables/src/codatsyncpayables/models/shared/journalref.py create mode 100755 sync-for-payables/src/codatsyncpayables/models/shared/journals.py create mode 100755 sync-for-payables/src/codatsyncpayables/models/shared/journalstatus.py create mode 100755 sync-for-payables/src/codatsyncpayables/models/shared/links.py create mode 100755 sync-for-payables/src/codatsyncpayables/models/shared/metadata.py create mode 100755 sync-for-payables/src/codatsyncpayables/models/shared/paymentallocationpayment.py create mode 100755 sync-for-payables/src/codatsyncpayables/models/shared/paymentmethod.py create mode 100755 sync-for-payables/src/codatsyncpayables/models/shared/paymentmethods.py create mode 100755 sync-for-payables/src/codatsyncpayables/models/shared/paymentmethodstatus.py create mode 100755 sync-for-payables/src/codatsyncpayables/models/shared/paymentmethodtype.py create mode 100755 sync-for-payables/src/codatsyncpayables/models/shared/pulloperation.py create mode 100755 sync-for-payables/src/codatsyncpayables/models/shared/pulloperations.py create mode 100755 sync-for-payables/src/codatsyncpayables/models/shared/pushchangetype.py create mode 100755 sync-for-payables/src/codatsyncpayables/models/shared/pushfieldvalidation.py create mode 100755 sync-for-payables/src/codatsyncpayables/models/shared/pushoperation.py create mode 100755 sync-for-payables/src/codatsyncpayables/models/shared/pushoperationchange.py create mode 100755 sync-for-payables/src/codatsyncpayables/models/shared/pushoperationref.py create mode 100755 sync-for-payables/src/codatsyncpayables/models/shared/pushoperations.py create mode 100755 sync-for-payables/src/codatsyncpayables/models/shared/pushoperationstatus.py create mode 100755 sync-for-payables/src/codatsyncpayables/models/shared/pushoption.py create mode 100755 sync-for-payables/src/codatsyncpayables/models/shared/pushoptionchoice.py create mode 100755 sync-for-payables/src/codatsyncpayables/models/shared/pushoptionproperty.py create mode 100755 sync-for-payables/src/codatsyncpayables/models/shared/pushoptiontype.py create mode 100755 sync-for-payables/src/codatsyncpayables/models/shared/pushvalidationinfo.py create mode 100755 sync-for-payables/src/codatsyncpayables/models/shared/recordref.py create mode 100755 sync-for-payables/src/codatsyncpayables/models/shared/security.py create mode 100755 sync-for-payables/src/codatsyncpayables/models/shared/status.py create mode 100755 sync-for-payables/src/codatsyncpayables/models/shared/supplementaldata.py create mode 100755 sync-for-payables/src/codatsyncpayables/models/shared/supplier.py create mode 100755 sync-for-payables/src/codatsyncpayables/models/shared/supplierref.py create mode 100755 sync-for-payables/src/codatsyncpayables/models/shared/suppliers.py create mode 100755 sync-for-payables/src/codatsyncpayables/models/shared/supplierstatus.py create mode 100755 sync-for-payables/src/codatsyncpayables/models/shared/taxrate.py create mode 100755 sync-for-payables/src/codatsyncpayables/models/shared/taxratecomponent.py create mode 100755 sync-for-payables/src/codatsyncpayables/models/shared/taxrateref.py create mode 100755 sync-for-payables/src/codatsyncpayables/models/shared/taxrates.py create mode 100755 sync-for-payables/src/codatsyncpayables/models/shared/taxratestatus.py create mode 100755 sync-for-payables/src/codatsyncpayables/models/shared/tracking.py create mode 100755 sync-for-payables/src/codatsyncpayables/models/shared/trackingcategories.py create mode 100755 sync-for-payables/src/codatsyncpayables/models/shared/trackingcategory.py create mode 100755 sync-for-payables/src/codatsyncpayables/models/shared/trackingcategoryref.py create mode 100755 sync-for-payables/src/codatsyncpayables/models/shared/trackingcategorytree.py create mode 100755 sync-for-payables/src/codatsyncpayables/models/shared/updatebillcreditnoteresponse.py create mode 100755 sync-for-payables/src/codatsyncpayables/models/shared/updatebillresponse.py create mode 100755 sync-for-payables/src/codatsyncpayables/models/shared/updatesupplierresponse.py create mode 100755 sync-for-payables/src/codatsyncpayables/models/shared/validation.py create mode 100755 sync-for-payables/src/codatsyncpayables/models/shared/validationitem.py create mode 100755 sync-for-payables/src/codatsyncpayables/models/shared/validdatatypelinksitems.py create mode 100755 sync-for-payables/src/codatsyncpayables/models/shared/withholdingtaxitems.py create mode 100755 sync-for-payables/src/codatsyncpayables/payment_methods.py create mode 100755 sync-for-payables/src/codatsyncpayables/push_operations.py create mode 100755 sync-for-payables/src/codatsyncpayables/sdk.py create mode 100755 sync-for-payables/src/codatsyncpayables/sdkconfiguration.py create mode 100755 sync-for-payables/src/codatsyncpayables/suppliers.py create mode 100755 sync-for-payables/src/codatsyncpayables/tax_rates.py create mode 100755 sync-for-payables/src/codatsyncpayables/tracking_categories.py create mode 100755 sync-for-payables/src/codatsyncpayables/utils/__init__.py create mode 100755 sync-for-payables/src/codatsyncpayables/utils/retries.py create mode 100755 sync-for-payables/src/codatsyncpayables/utils/utils.py diff --git a/sync-for-payables/.gitattributes b/sync-for-payables/.gitattributes new file mode 100755 index 000000000..4d75d5900 --- /dev/null +++ b/sync-for-payables/.gitattributes @@ -0,0 +1,2 @@ +# This allows generated code to be indexed correctly +*.py linguist-generated=false \ No newline at end of file diff --git a/sync-for-payables/.gitignore b/sync-for-payables/.gitignore new file mode 100755 index 000000000..3cdf33802 --- /dev/null +++ b/sync-for-payables/.gitignore @@ -0,0 +1,6 @@ +venv/ +src/*.egg-info/ +__pycache__/ +.pytest_cache/ +.python-version +.DS_Store diff --git a/sync-for-payables/RELEASES.md b/sync-for-payables/RELEASES.md new file mode 100644 index 000000000..6a1e8d45c --- /dev/null +++ b/sync-for-payables/RELEASES.md @@ -0,0 +1,11 @@ + + +## 2023-09-01 16:48:10 +### Changes +Based on: +- OpenAPI Doc 3.0.0 https://raw.githubusercontent.com/codatio/oas/main/yaml/Codat-Sync-Payables.yaml +- Speakeasy CLI 1.77.1 (2.91.4) https://github.com/speakeasy-api/speakeasy +### Generated +- [python v0.1.0] sync-for-payables +### Releases +- [PyPI v0.1.0] https://pypi.org/project/codat-sync-for-payables/0.1.0 - sync-for-payables \ No newline at end of file diff --git a/sync-for-payables/USAGE.md b/sync-for-payables/USAGE.md new file mode 100755 index 000000000..515d54f5a --- /dev/null +++ b/sync-for-payables/USAGE.md @@ -0,0 +1,67 @@ + + + +```python +import codatsyncpayables +from codatsyncpayables.models import operations, shared + +s = codatsyncpayables.CodatSyncPayables( + security=shared.Security( + auth_header="Basic BASE_64_ENCODED(API_KEY)", + ), +) + +req = operations.CreateAccountRequest( + account=shared.Account( + currency='USD', + current_balance=0, + description='Invoices the business has issued but has not yet collected payment on.', + fully_qualified_category='Asset.Current', + fully_qualified_name='Fixed Asset', + id='1b6266d1-1e44-46c5-8eb5-a8f98e03124e', + is_bank_account=False, + metadata=shared.Metadata( + is_deleted=False, + ), + modified_date='2022-10-23T00:00:00.000Z', + name='Accounts Receivable', + nominal_code='610', + source_modified_date='2022-10-23T00:00:00.000Z', + status=shared.AccountStatus.ACTIVE, + type=shared.AccountType.ASSET, + valid_datatype_links=[ + shared.AccountValidDataTypeLinks( + links=[ + 'corrupti', + 'illum', + 'vel', + 'error', + ], + property='deserunt', + ), + shared.AccountValidDataTypeLinks( + links=[ + 'iure', + 'magnam', + ], + property='debitis', + ), + shared.AccountValidDataTypeLinks( + links=[ + 'delectus', + ], + property='tempora', + ), + ], + ), + company_id='8a210b68-6988-11ed-a1eb-0242ac120002', + connection_id='2e9d2c44-f675-40ba-8049-353bfcb5e171', + timeout_in_minutes=383441, +) + +res = s.accounts.create(req) + +if res.create_account_response is not None: + # handle response +``` + \ No newline at end of file diff --git a/sync-for-payables/docs/models/operations/createaccountrequest.md b/sync-for-payables/docs/models/operations/createaccountrequest.md new file mode 100755 index 000000000..f212e4aba --- /dev/null +++ b/sync-for-payables/docs/models/operations/createaccountrequest.md @@ -0,0 +1,11 @@ +# CreateAccountRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | +| `account` | [Optional[shared.Account]](../../models/shared/account.md) | :heavy_minus_sign: | N/A | | +| `company_id` | *str* | :heavy_check_mark: | N/A | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `connection_id` | *str* | :heavy_check_mark: | N/A | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | +| `timeout_in_minutes` | *Optional[int]* | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/sync-for-payables/docs/models/operations/createaccountresponse.md b/sync-for-payables/docs/models/operations/createaccountresponse.md new file mode 100755 index 000000000..146716ba1 --- /dev/null +++ b/sync-for-payables/docs/models/operations/createaccountresponse.md @@ -0,0 +1,12 @@ +# CreateAccountResponse + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | +| `content_type` | *str* | :heavy_check_mark: | N/A | +| `create_account_response` | [Optional[shared.CreateAccountResponse]](../../models/shared/createaccountresponse.md) | :heavy_minus_sign: | Success | +| `error_message` | [Optional[shared.ErrorMessage]](../../models/shared/errormessage.md) | :heavy_minus_sign: | The request made is not valid. | +| `status_code` | *int* | :heavy_check_mark: | N/A | +| `raw_response` | [requests.Response](https://requests.readthedocs.io/en/latest/api/#requests.Response) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/sync-for-payables/docs/models/operations/createbillcreditnoterequest.md b/sync-for-payables/docs/models/operations/createbillcreditnoterequest.md new file mode 100755 index 000000000..b465013a6 --- /dev/null +++ b/sync-for-payables/docs/models/operations/createbillcreditnoterequest.md @@ -0,0 +1,11 @@ +# CreateBillCreditNoteRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | +| `bill_credit_note` | [Optional[shared.BillCreditNote]](../../models/shared/billcreditnote.md) | :heavy_minus_sign: | N/A | | +| `company_id` | *str* | :heavy_check_mark: | N/A | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `connection_id` | *str* | :heavy_check_mark: | N/A | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | +| `timeout_in_minutes` | *Optional[int]* | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/sync-for-payables/docs/models/operations/createbillcreditnoteresponse.md b/sync-for-payables/docs/models/operations/createbillcreditnoteresponse.md new file mode 100755 index 000000000..8621d1a49 --- /dev/null +++ b/sync-for-payables/docs/models/operations/createbillcreditnoteresponse.md @@ -0,0 +1,12 @@ +# CreateBillCreditNoteResponse + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | +| `content_type` | *str* | :heavy_check_mark: | N/A | +| `create_bill_credit_note_response` | [Optional[shared.CreateBillCreditNoteResponse]](../../models/shared/createbillcreditnoteresponse.md) | :heavy_minus_sign: | Success | +| `error_message` | [Optional[shared.ErrorMessage]](../../models/shared/errormessage.md) | :heavy_minus_sign: | The request made is not valid. | +| `status_code` | *int* | :heavy_check_mark: | N/A | +| `raw_response` | [requests.Response](https://requests.readthedocs.io/en/latest/api/#requests.Response) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/sync-for-payables/docs/models/operations/createbillpaymentrequest.md b/sync-for-payables/docs/models/operations/createbillpaymentrequest.md new file mode 100755 index 000000000..53bb9ca4d --- /dev/null +++ b/sync-for-payables/docs/models/operations/createbillpaymentrequest.md @@ -0,0 +1,11 @@ +# CreateBillPaymentRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | +| `bill_payment` | [Optional[shared.BillPayment]](../../models/shared/billpayment.md) | :heavy_minus_sign: | N/A | | +| `company_id` | *str* | :heavy_check_mark: | N/A | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `connection_id` | *str* | :heavy_check_mark: | N/A | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | +| `timeout_in_minutes` | *Optional[int]* | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/sync-for-payables/docs/models/operations/createbillpaymentresponse.md b/sync-for-payables/docs/models/operations/createbillpaymentresponse.md new file mode 100755 index 000000000..400ee9f0a --- /dev/null +++ b/sync-for-payables/docs/models/operations/createbillpaymentresponse.md @@ -0,0 +1,12 @@ +# CreateBillPaymentResponse + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | +| `content_type` | *str* | :heavy_check_mark: | N/A | +| `create_bill_payment_response` | [Optional[shared.CreateBillPaymentResponse]](../../models/shared/createbillpaymentresponse.md) | :heavy_minus_sign: | Success | +| `error_message` | [Optional[shared.ErrorMessage]](../../models/shared/errormessage.md) | :heavy_minus_sign: | The request made is not valid. | +| `status_code` | *int* | :heavy_check_mark: | N/A | +| `raw_response` | [requests.Response](https://requests.readthedocs.io/en/latest/api/#requests.Response) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/sync-for-payables/docs/models/operations/createbillrequest.md b/sync-for-payables/docs/models/operations/createbillrequest.md new file mode 100755 index 000000000..6a779374c --- /dev/null +++ b/sync-for-payables/docs/models/operations/createbillrequest.md @@ -0,0 +1,11 @@ +# CreateBillRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | +| `bill` | [Optional[shared.Bill]](../../models/shared/bill.md) | :heavy_minus_sign: | N/A | | +| `company_id` | *str* | :heavy_check_mark: | N/A | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `connection_id` | *str* | :heavy_check_mark: | N/A | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | +| `timeout_in_minutes` | *Optional[int]* | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/sync-for-payables/docs/models/operations/createbillresponse.md b/sync-for-payables/docs/models/operations/createbillresponse.md new file mode 100755 index 000000000..d67e1ae4c --- /dev/null +++ b/sync-for-payables/docs/models/operations/createbillresponse.md @@ -0,0 +1,12 @@ +# CreateBillResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | +| `content_type` | *str* | :heavy_check_mark: | N/A | +| `create_bill_response` | [Optional[shared.CreateBillResponse]](../../models/shared/createbillresponse.md) | :heavy_minus_sign: | Success | +| `error_message` | [Optional[shared.ErrorMessage]](../../models/shared/errormessage.md) | :heavy_minus_sign: | The request made is not valid. | +| `status_code` | *int* | :heavy_check_mark: | N/A | +| `raw_response` | [requests.Response](https://requests.readthedocs.io/en/latest/api/#requests.Response) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/sync-for-payables/docs/models/operations/createcompanyresponse.md b/sync-for-payables/docs/models/operations/createcompanyresponse.md new file mode 100755 index 000000000..ea59de39f --- /dev/null +++ b/sync-for-payables/docs/models/operations/createcompanyresponse.md @@ -0,0 +1,12 @@ +# CreateCompanyResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | +| `company` | [Optional[shared.Company]](../../models/shared/company.md) | :heavy_minus_sign: | OK | +| `content_type` | *str* | :heavy_check_mark: | N/A | +| `error_message` | [Optional[shared.ErrorMessage]](../../models/shared/errormessage.md) | :heavy_minus_sign: | The request made is not valid. | +| `status_code` | *int* | :heavy_check_mark: | N/A | +| `raw_response` | [requests.Response](https://requests.readthedocs.io/en/latest/api/#requests.Response) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/sync-for-payables/docs/models/operations/createconnectionrequest.md b/sync-for-payables/docs/models/operations/createconnectionrequest.md new file mode 100755 index 000000000..775111c5e --- /dev/null +++ b/sync-for-payables/docs/models/operations/createconnectionrequest.md @@ -0,0 +1,9 @@ +# CreateConnectionRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | +| `request_body` | [Optional[CreateConnectionRequestBody]](../../models/operations/createconnectionrequestbody.md) | :heavy_minus_sign: | N/A | | +| `company_id` | *str* | :heavy_check_mark: | N/A | 8a210b68-6988-11ed-a1eb-0242ac120002 | \ No newline at end of file diff --git a/sync-for-payables/docs/models/operations/createconnectionrequestbody.md b/sync-for-payables/docs/models/operations/createconnectionrequestbody.md new file mode 100755 index 000000000..510a6b3b0 --- /dev/null +++ b/sync-for-payables/docs/models/operations/createconnectionrequestbody.md @@ -0,0 +1,8 @@ +# CreateConnectionRequestBody + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `platform_key` | *Optional[str]* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/sync-for-payables/docs/models/operations/createconnectionresponse.md b/sync-for-payables/docs/models/operations/createconnectionresponse.md new file mode 100755 index 000000000..5aa8726d9 --- /dev/null +++ b/sync-for-payables/docs/models/operations/createconnectionresponse.md @@ -0,0 +1,12 @@ +# CreateConnectionResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | +| `connection` | [Optional[shared.Connection]](../../models/shared/connection.md) | :heavy_minus_sign: | OK | +| `content_type` | *str* | :heavy_check_mark: | N/A | +| `error_message` | [Optional[shared.ErrorMessage]](../../models/shared/errormessage.md) | :heavy_minus_sign: | Your API request was not properly authorized. | +| `status_code` | *int* | :heavy_check_mark: | N/A | +| `raw_response` | [requests.Response](https://requests.readthedocs.io/en/latest/api/#requests.Response) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/sync-for-payables/docs/models/operations/createjournalentryrequest.md b/sync-for-payables/docs/models/operations/createjournalentryrequest.md new file mode 100755 index 000000000..aab47295b --- /dev/null +++ b/sync-for-payables/docs/models/operations/createjournalentryrequest.md @@ -0,0 +1,11 @@ +# CreateJournalEntryRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | +| `journal_entry` | [Optional[shared.JournalEntry]](../../models/shared/journalentry.md) | :heavy_minus_sign: | N/A | | +| `company_id` | *str* | :heavy_check_mark: | N/A | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `connection_id` | *str* | :heavy_check_mark: | N/A | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | +| `timeout_in_minutes` | *Optional[int]* | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/sync-for-payables/docs/models/operations/createjournalentryresponse.md b/sync-for-payables/docs/models/operations/createjournalentryresponse.md new file mode 100755 index 000000000..959a2f902 --- /dev/null +++ b/sync-for-payables/docs/models/operations/createjournalentryresponse.md @@ -0,0 +1,12 @@ +# CreateJournalEntryResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | +| `content_type` | *str* | :heavy_check_mark: | N/A | +| `create_journal_entry_response` | [Optional[shared.CreateJournalEntryResponse]](../../models/shared/createjournalentryresponse.md) | :heavy_minus_sign: | Success | +| `error_message` | [Optional[shared.ErrorMessage]](../../models/shared/errormessage.md) | :heavy_minus_sign: | The request made is not valid. | +| `status_code` | *int* | :heavy_check_mark: | N/A | +| `raw_response` | [requests.Response](https://requests.readthedocs.io/en/latest/api/#requests.Response) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/sync-for-payables/docs/models/operations/createjournalrequest.md b/sync-for-payables/docs/models/operations/createjournalrequest.md new file mode 100755 index 000000000..d29bb915f --- /dev/null +++ b/sync-for-payables/docs/models/operations/createjournalrequest.md @@ -0,0 +1,11 @@ +# CreateJournalRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | +| `journal` | [Optional[shared.Journal]](../../models/shared/journal.md) | :heavy_minus_sign: | N/A | | +| `company_id` | *str* | :heavy_check_mark: | N/A | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `connection_id` | *str* | :heavy_check_mark: | N/A | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | +| `timeout_in_minutes` | *Optional[int]* | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/sync-for-payables/docs/models/operations/createjournalresponse.md b/sync-for-payables/docs/models/operations/createjournalresponse.md new file mode 100755 index 000000000..f3a82d4d0 --- /dev/null +++ b/sync-for-payables/docs/models/operations/createjournalresponse.md @@ -0,0 +1,12 @@ +# CreateJournalResponse + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | +| `content_type` | *str* | :heavy_check_mark: | N/A | +| `create_journal_response` | [Optional[shared.CreateJournalResponse]](../../models/shared/createjournalresponse.md) | :heavy_minus_sign: | Success | +| `error_message` | [Optional[shared.ErrorMessage]](../../models/shared/errormessage.md) | :heavy_minus_sign: | The request made is not valid. | +| `status_code` | *int* | :heavy_check_mark: | N/A | +| `raw_response` | [requests.Response](https://requests.readthedocs.io/en/latest/api/#requests.Response) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/sync-for-payables/docs/models/operations/createsupplierrequest.md b/sync-for-payables/docs/models/operations/createsupplierrequest.md new file mode 100755 index 000000000..68149bdfb --- /dev/null +++ b/sync-for-payables/docs/models/operations/createsupplierrequest.md @@ -0,0 +1,11 @@ +# CreateSupplierRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | +| `supplier` | [Optional[shared.Supplier]](../../models/shared/supplier.md) | :heavy_minus_sign: | N/A | | +| `company_id` | *str* | :heavy_check_mark: | N/A | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `connection_id` | *str* | :heavy_check_mark: | N/A | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | +| `timeout_in_minutes` | *Optional[int]* | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/sync-for-payables/docs/models/operations/createsupplierresponse.md b/sync-for-payables/docs/models/operations/createsupplierresponse.md new file mode 100755 index 000000000..499202b3b --- /dev/null +++ b/sync-for-payables/docs/models/operations/createsupplierresponse.md @@ -0,0 +1,12 @@ +# CreateSupplierResponse + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | +| `content_type` | *str* | :heavy_check_mark: | N/A | +| `create_supplier_response` | [Optional[shared.CreateSupplierResponse]](../../models/shared/createsupplierresponse.md) | :heavy_minus_sign: | Success | +| `error_message` | [Optional[shared.ErrorMessage]](../../models/shared/errormessage.md) | :heavy_minus_sign: | The request made is not valid. | +| `status_code` | *int* | :heavy_check_mark: | N/A | +| `raw_response` | [requests.Response](https://requests.readthedocs.io/en/latest/api/#requests.Response) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/sync-for-payables/docs/models/operations/deletecompanyrequest.md b/sync-for-payables/docs/models/operations/deletecompanyrequest.md new file mode 100755 index 000000000..268537e13 --- /dev/null +++ b/sync-for-payables/docs/models/operations/deletecompanyrequest.md @@ -0,0 +1,8 @@ +# DeleteCompanyRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | +| `company_id` | *str* | :heavy_check_mark: | N/A | 8a210b68-6988-11ed-a1eb-0242ac120002 | \ No newline at end of file diff --git a/sync-for-payables/docs/models/operations/deletecompanyresponse.md b/sync-for-payables/docs/models/operations/deletecompanyresponse.md new file mode 100755 index 000000000..ee9fe7cd3 --- /dev/null +++ b/sync-for-payables/docs/models/operations/deletecompanyresponse.md @@ -0,0 +1,11 @@ +# DeleteCompanyResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | +| `content_type` | *str* | :heavy_check_mark: | N/A | +| `error_message` | [Optional[shared.ErrorMessage]](../../models/shared/errormessage.md) | :heavy_minus_sign: | Your API request was not properly authorized. | +| `status_code` | *int* | :heavy_check_mark: | N/A | +| `raw_response` | [requests.Response](https://requests.readthedocs.io/en/latest/api/#requests.Response) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/sync-for-payables/docs/models/operations/deleteconnectionrequest.md b/sync-for-payables/docs/models/operations/deleteconnectionrequest.md new file mode 100755 index 000000000..2cab8bf4a --- /dev/null +++ b/sync-for-payables/docs/models/operations/deleteconnectionrequest.md @@ -0,0 +1,9 @@ +# DeleteConnectionRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | +| `company_id` | *str* | :heavy_check_mark: | N/A | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `connection_id` | *str* | :heavy_check_mark: | N/A | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | \ No newline at end of file diff --git a/sync-for-payables/docs/models/operations/deleteconnectionresponse.md b/sync-for-payables/docs/models/operations/deleteconnectionresponse.md new file mode 100755 index 000000000..973be81b3 --- /dev/null +++ b/sync-for-payables/docs/models/operations/deleteconnectionresponse.md @@ -0,0 +1,11 @@ +# DeleteConnectionResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | +| `content_type` | *str* | :heavy_check_mark: | N/A | +| `error_message` | [Optional[shared.ErrorMessage]](../../models/shared/errormessage.md) | :heavy_minus_sign: | Your API request was not properly authorized. | +| `status_code` | *int* | :heavy_check_mark: | N/A | +| `raw_response` | [requests.Response](https://requests.readthedocs.io/en/latest/api/#requests.Response) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/sync-for-payables/docs/models/operations/downloadbillattachmentrequest.md b/sync-for-payables/docs/models/operations/downloadbillattachmentrequest.md new file mode 100755 index 000000000..6e2e5196f --- /dev/null +++ b/sync-for-payables/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: | N/A | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `connection_id` | *str* | :heavy_check_mark: | N/A | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | \ No newline at end of file diff --git a/sync-for-payables/docs/models/operations/downloadbillattachmentresponse.md b/sync-for-payables/docs/models/operations/downloadbillattachmentresponse.md new file mode 100755 index 000000000..1a5b512ba --- /dev/null +++ b/sync-for-payables/docs/models/operations/downloadbillattachmentresponse.md @@ -0,0 +1,12 @@ +# DownloadBillAttachmentResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | +| `content_type` | *str* | :heavy_check_mark: | N/A | +| `data` | *Optional[bytes]* | :heavy_minus_sign: | Success | +| `error_message` | [Optional[shared.ErrorMessage]](../../models/shared/errormessage.md) | :heavy_minus_sign: | Your API request was not properly authorized. | +| `status_code` | *int* | :heavy_check_mark: | N/A | +| `raw_response` | [requests.Response](https://requests.readthedocs.io/en/latest/api/#requests.Response) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/sync-for-payables/docs/models/operations/getaccountrequest.md b/sync-for-payables/docs/models/operations/getaccountrequest.md new file mode 100755 index 000000000..5aec9860c --- /dev/null +++ b/sync-for-payables/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: | N/A | 8a210b68-6988-11ed-a1eb-0242ac120002 | \ No newline at end of file diff --git a/sync-for-payables/docs/models/operations/getaccountresponse.md b/sync-for-payables/docs/models/operations/getaccountresponse.md new file mode 100755 index 000000000..b9f53ec86 --- /dev/null +++ b/sync-for-payables/docs/models/operations/getaccountresponse.md @@ -0,0 +1,12 @@ +# GetAccountResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | +| `account` | [Optional[shared.Account]](../../models/shared/account.md) | :heavy_minus_sign: | Success | +| `content_type` | *str* | :heavy_check_mark: | N/A | +| `error_message` | [Optional[shared.ErrorMessage]](../../models/shared/errormessage.md) | :heavy_minus_sign: | Your API request was not properly authorized. | +| `status_code` | *int* | :heavy_check_mark: | N/A | +| `raw_response` | [requests.Response](https://requests.readthedocs.io/en/latest/api/#requests.Response) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/sync-for-payables/docs/models/operations/getbillattachmentrequest.md b/sync-for-payables/docs/models/operations/getbillattachmentrequest.md new file mode 100755 index 000000000..58173a8af --- /dev/null +++ b/sync-for-payables/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: | N/A | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `connection_id` | *str* | :heavy_check_mark: | N/A | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | \ No newline at end of file diff --git a/sync-for-payables/docs/models/operations/getbillattachmentresponse.md b/sync-for-payables/docs/models/operations/getbillattachmentresponse.md new file mode 100755 index 000000000..b6a56c06c --- /dev/null +++ b/sync-for-payables/docs/models/operations/getbillattachmentresponse.md @@ -0,0 +1,12 @@ +# GetBillAttachmentResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | +| `attachment` | [Optional[shared.Attachment]](../../models/shared/attachment.md) | :heavy_minus_sign: | Success | +| `content_type` | *str* | :heavy_check_mark: | N/A | +| `error_message` | [Optional[shared.ErrorMessage]](../../models/shared/errormessage.md) | :heavy_minus_sign: | Your API request was not properly authorized. | +| `status_code` | *int* | :heavy_check_mark: | N/A | +| `raw_response` | [requests.Response](https://requests.readthedocs.io/en/latest/api/#requests.Response) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/sync-for-payables/docs/models/operations/getbillcreditnoterequest.md b/sync-for-payables/docs/models/operations/getbillcreditnoterequest.md new file mode 100755 index 000000000..dd07e884e --- /dev/null +++ b/sync-for-payables/docs/models/operations/getbillcreditnoterequest.md @@ -0,0 +1,9 @@ +# GetBillCreditNoteRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | +| `bill_credit_note_id` | *str* | :heavy_check_mark: | N/A | | +| `company_id` | *str* | :heavy_check_mark: | N/A | 8a210b68-6988-11ed-a1eb-0242ac120002 | \ No newline at end of file diff --git a/sync-for-payables/docs/models/operations/getbillcreditnoteresponse.md b/sync-for-payables/docs/models/operations/getbillcreditnoteresponse.md new file mode 100755 index 000000000..7afbe9ee7 --- /dev/null +++ b/sync-for-payables/docs/models/operations/getbillcreditnoteresponse.md @@ -0,0 +1,12 @@ +# GetBillCreditNoteResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | +| `bill_credit_note` | [Optional[shared.BillCreditNote]](../../models/shared/billcreditnote.md) | :heavy_minus_sign: | Success | +| `content_type` | *str* | :heavy_check_mark: | N/A | +| `error_message` | [Optional[shared.ErrorMessage]](../../models/shared/errormessage.md) | :heavy_minus_sign: | Your API request was not properly authorized. | +| `status_code` | *int* | :heavy_check_mark: | N/A | +| `raw_response` | [requests.Response](https://requests.readthedocs.io/en/latest/api/#requests.Response) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/sync-for-payables/docs/models/operations/getbillpaymentsrequest.md b/sync-for-payables/docs/models/operations/getbillpaymentsrequest.md new file mode 100755 index 000000000..4b4faa96d --- /dev/null +++ b/sync-for-payables/docs/models/operations/getbillpaymentsrequest.md @@ -0,0 +1,9 @@ +# GetBillPaymentsRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | +| `bill_payment_id` | *str* | :heavy_check_mark: | N/A | | +| `company_id` | *str* | :heavy_check_mark: | N/A | 8a210b68-6988-11ed-a1eb-0242ac120002 | \ No newline at end of file diff --git a/sync-for-payables/docs/models/operations/getbillpaymentsresponse.md b/sync-for-payables/docs/models/operations/getbillpaymentsresponse.md new file mode 100755 index 000000000..d2cb02105 --- /dev/null +++ b/sync-for-payables/docs/models/operations/getbillpaymentsresponse.md @@ -0,0 +1,12 @@ +# GetBillPaymentsResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | +| `bill_payment` | [Optional[shared.BillPayment]](../../models/shared/billpayment.md) | :heavy_minus_sign: | Success | +| `content_type` | *str* | :heavy_check_mark: | N/A | +| `error_message` | [Optional[shared.ErrorMessage]](../../models/shared/errormessage.md) | :heavy_minus_sign: | Your API request was not properly authorized. | +| `status_code` | *int* | :heavy_check_mark: | N/A | +| `raw_response` | [requests.Response](https://requests.readthedocs.io/en/latest/api/#requests.Response) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/sync-for-payables/docs/models/operations/getbillrequest.md b/sync-for-payables/docs/models/operations/getbillrequest.md new file mode 100755 index 000000000..4da84bbff --- /dev/null +++ b/sync-for-payables/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: | N/A | 8a210b68-6988-11ed-a1eb-0242ac120002 | \ No newline at end of file diff --git a/sync-for-payables/docs/models/operations/getbillresponse.md b/sync-for-payables/docs/models/operations/getbillresponse.md new file mode 100755 index 000000000..7d1fffeab --- /dev/null +++ b/sync-for-payables/docs/models/operations/getbillresponse.md @@ -0,0 +1,12 @@ +# GetBillResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | +| `bill` | [Optional[shared.Bill]](../../models/shared/bill.md) | :heavy_minus_sign: | Success | +| `content_type` | *str* | :heavy_check_mark: | N/A | +| `error_message` | [Optional[shared.ErrorMessage]](../../models/shared/errormessage.md) | :heavy_minus_sign: | Your API request was not properly authorized. | +| `status_code` | *int* | :heavy_check_mark: | N/A | +| `raw_response` | [requests.Response](https://requests.readthedocs.io/en/latest/api/#requests.Response) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/sync-for-payables/docs/models/operations/getcompanyrequest.md b/sync-for-payables/docs/models/operations/getcompanyrequest.md new file mode 100755 index 000000000..4c9629ab6 --- /dev/null +++ b/sync-for-payables/docs/models/operations/getcompanyrequest.md @@ -0,0 +1,8 @@ +# GetCompanyRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | +| `company_id` | *str* | :heavy_check_mark: | N/A | 8a210b68-6988-11ed-a1eb-0242ac120002 | \ No newline at end of file diff --git a/sync-for-payables/docs/models/operations/getcompanyresponse.md b/sync-for-payables/docs/models/operations/getcompanyresponse.md new file mode 100755 index 000000000..a0c0a41b1 --- /dev/null +++ b/sync-for-payables/docs/models/operations/getcompanyresponse.md @@ -0,0 +1,12 @@ +# GetCompanyResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | +| `company` | [Optional[shared.Company]](../../models/shared/company.md) | :heavy_minus_sign: | OK | +| `content_type` | *str* | :heavy_check_mark: | N/A | +| `error_message` | [Optional[shared.ErrorMessage]](../../models/shared/errormessage.md) | :heavy_minus_sign: | Your API request was not properly authorized. | +| `status_code` | *int* | :heavy_check_mark: | N/A | +| `raw_response` | [requests.Response](https://requests.readthedocs.io/en/latest/api/#requests.Response) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/sync-for-payables/docs/models/operations/getconnectionrequest.md b/sync-for-payables/docs/models/operations/getconnectionrequest.md new file mode 100755 index 000000000..d9d6f6c13 --- /dev/null +++ b/sync-for-payables/docs/models/operations/getconnectionrequest.md @@ -0,0 +1,9 @@ +# GetConnectionRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | +| `company_id` | *str* | :heavy_check_mark: | N/A | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `connection_id` | *str* | :heavy_check_mark: | N/A | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | \ No newline at end of file diff --git a/sync-for-payables/docs/models/operations/getconnectionresponse.md b/sync-for-payables/docs/models/operations/getconnectionresponse.md new file mode 100755 index 000000000..32fb66433 --- /dev/null +++ b/sync-for-payables/docs/models/operations/getconnectionresponse.md @@ -0,0 +1,12 @@ +# GetConnectionResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | +| `connection` | [Optional[shared.Connection]](../../models/shared/connection.md) | :heavy_minus_sign: | OK | +| `content_type` | *str* | :heavy_check_mark: | N/A | +| `error_message` | [Optional[shared.ErrorMessage]](../../models/shared/errormessage.md) | :heavy_minus_sign: | Your API request was not properly authorized. | +| `status_code` | *int* | :heavy_check_mark: | N/A | +| `raw_response` | [requests.Response](https://requests.readthedocs.io/en/latest/api/#requests.Response) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/sync-for-payables/docs/models/operations/getcreateaccountmodelrequest.md b/sync-for-payables/docs/models/operations/getcreateaccountmodelrequest.md new file mode 100755 index 000000000..9963a88df --- /dev/null +++ b/sync-for-payables/docs/models/operations/getcreateaccountmodelrequest.md @@ -0,0 +1,9 @@ +# GetCreateAccountModelRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | +| `company_id` | *str* | :heavy_check_mark: | N/A | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `connection_id` | *str* | :heavy_check_mark: | N/A | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | \ No newline at end of file diff --git a/sync-for-payables/docs/models/operations/getcreateaccountmodelresponse.md b/sync-for-payables/docs/models/operations/getcreateaccountmodelresponse.md new file mode 100755 index 000000000..8e0e46950 --- /dev/null +++ b/sync-for-payables/docs/models/operations/getcreateaccountmodelresponse.md @@ -0,0 +1,12 @@ +# GetCreateAccountModelResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | +| `content_type` | *str* | :heavy_check_mark: | N/A | +| `error_message` | [Optional[shared.ErrorMessage]](../../models/shared/errormessage.md) | :heavy_minus_sign: | Your API request was not properly authorized. | +| `push_option` | [Optional[shared.PushOption]](../../models/shared/pushoption.md) | :heavy_minus_sign: | OK | +| `status_code` | *int* | :heavy_check_mark: | N/A | +| `raw_response` | [requests.Response](https://requests.readthedocs.io/en/latest/api/#requests.Response) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/sync-for-payables/docs/models/operations/getcreatebillpaymentmodelrequest.md b/sync-for-payables/docs/models/operations/getcreatebillpaymentmodelrequest.md new file mode 100755 index 000000000..93a5155b3 --- /dev/null +++ b/sync-for-payables/docs/models/operations/getcreatebillpaymentmodelrequest.md @@ -0,0 +1,9 @@ +# GetCreateBillPaymentModelRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | +| `company_id` | *str* | :heavy_check_mark: | N/A | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `connection_id` | *str* | :heavy_check_mark: | N/A | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | \ No newline at end of file diff --git a/sync-for-payables/docs/models/operations/getcreatebillpaymentmodelresponse.md b/sync-for-payables/docs/models/operations/getcreatebillpaymentmodelresponse.md new file mode 100755 index 000000000..99b7940a5 --- /dev/null +++ b/sync-for-payables/docs/models/operations/getcreatebillpaymentmodelresponse.md @@ -0,0 +1,12 @@ +# GetCreateBillPaymentModelResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | +| `content_type` | *str* | :heavy_check_mark: | N/A | +| `error_message` | [Optional[shared.ErrorMessage]](../../models/shared/errormessage.md) | :heavy_minus_sign: | Your API request was not properly authorized. | +| `push_option` | [Optional[shared.PushOption]](../../models/shared/pushoption.md) | :heavy_minus_sign: | OK | +| `status_code` | *int* | :heavy_check_mark: | N/A | +| `raw_response` | [requests.Response](https://requests.readthedocs.io/en/latest/api/#requests.Response) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/sync-for-payables/docs/models/operations/getcreatejournalentrymodelrequest.md b/sync-for-payables/docs/models/operations/getcreatejournalentrymodelrequest.md new file mode 100755 index 000000000..aa6181c76 --- /dev/null +++ b/sync-for-payables/docs/models/operations/getcreatejournalentrymodelrequest.md @@ -0,0 +1,9 @@ +# GetCreateJournalEntryModelRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | +| `company_id` | *str* | :heavy_check_mark: | N/A | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `connection_id` | *str* | :heavy_check_mark: | N/A | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | \ No newline at end of file diff --git a/sync-for-payables/docs/models/operations/getcreatejournalentrymodelresponse.md b/sync-for-payables/docs/models/operations/getcreatejournalentrymodelresponse.md new file mode 100755 index 000000000..df4d4baff --- /dev/null +++ b/sync-for-payables/docs/models/operations/getcreatejournalentrymodelresponse.md @@ -0,0 +1,12 @@ +# GetCreateJournalEntryModelResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | +| `content_type` | *str* | :heavy_check_mark: | N/A | +| `error_message` | [Optional[shared.ErrorMessage]](../../models/shared/errormessage.md) | :heavy_minus_sign: | Your API request was not properly authorized. | +| `push_option` | [Optional[shared.PushOption]](../../models/shared/pushoption.md) | :heavy_minus_sign: | OK | +| `status_code` | *int* | :heavy_check_mark: | N/A | +| `raw_response` | [requests.Response](https://requests.readthedocs.io/en/latest/api/#requests.Response) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/sync-for-payables/docs/models/operations/getcreatejournalmodelrequest.md b/sync-for-payables/docs/models/operations/getcreatejournalmodelrequest.md new file mode 100755 index 000000000..65de8ae3b --- /dev/null +++ b/sync-for-payables/docs/models/operations/getcreatejournalmodelrequest.md @@ -0,0 +1,9 @@ +# GetCreateJournalModelRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | +| `company_id` | *str* | :heavy_check_mark: | N/A | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `connection_id` | *str* | :heavy_check_mark: | N/A | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | \ No newline at end of file diff --git a/sync-for-payables/docs/models/operations/getcreatejournalmodelresponse.md b/sync-for-payables/docs/models/operations/getcreatejournalmodelresponse.md new file mode 100755 index 000000000..88b5cd73c --- /dev/null +++ b/sync-for-payables/docs/models/operations/getcreatejournalmodelresponse.md @@ -0,0 +1,12 @@ +# GetCreateJournalModelResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | +| `content_type` | *str* | :heavy_check_mark: | N/A | +| `error_message` | [Optional[shared.ErrorMessage]](../../models/shared/errormessage.md) | :heavy_minus_sign: | Your API request was not properly authorized. | +| `push_option` | [Optional[shared.PushOption]](../../models/shared/pushoption.md) | :heavy_minus_sign: | OK | +| `status_code` | *int* | :heavy_check_mark: | N/A | +| `raw_response` | [requests.Response](https://requests.readthedocs.io/en/latest/api/#requests.Response) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/sync-for-payables/docs/models/operations/getcreateupdatebillcreditnotemodelrequest.md b/sync-for-payables/docs/models/operations/getcreateupdatebillcreditnotemodelrequest.md new file mode 100755 index 000000000..dc0a8b190 --- /dev/null +++ b/sync-for-payables/docs/models/operations/getcreateupdatebillcreditnotemodelrequest.md @@ -0,0 +1,9 @@ +# GetCreateUpdateBillCreditNoteModelRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | +| `company_id` | *str* | :heavy_check_mark: | N/A | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `connection_id` | *str* | :heavy_check_mark: | N/A | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | \ No newline at end of file diff --git a/sync-for-payables/docs/models/operations/getcreateupdatebillcreditnotemodelresponse.md b/sync-for-payables/docs/models/operations/getcreateupdatebillcreditnotemodelresponse.md new file mode 100755 index 000000000..ea425c40a --- /dev/null +++ b/sync-for-payables/docs/models/operations/getcreateupdatebillcreditnotemodelresponse.md @@ -0,0 +1,12 @@ +# GetCreateUpdateBillCreditNoteModelResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | +| `content_type` | *str* | :heavy_check_mark: | N/A | +| `error_message` | [Optional[shared.ErrorMessage]](../../models/shared/errormessage.md) | :heavy_minus_sign: | Your API request was not properly authorized. | +| `push_option` | [Optional[shared.PushOption]](../../models/shared/pushoption.md) | :heavy_minus_sign: | OK | +| `status_code` | *int* | :heavy_check_mark: | N/A | +| `raw_response` | [requests.Response](https://requests.readthedocs.io/en/latest/api/#requests.Response) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/sync-for-payables/docs/models/operations/getcreateupdatebillmodelrequest.md b/sync-for-payables/docs/models/operations/getcreateupdatebillmodelrequest.md new file mode 100755 index 000000000..45b3cff04 --- /dev/null +++ b/sync-for-payables/docs/models/operations/getcreateupdatebillmodelrequest.md @@ -0,0 +1,9 @@ +# GetCreateUpdateBillModelRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | +| `company_id` | *str* | :heavy_check_mark: | N/A | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `connection_id` | *str* | :heavy_check_mark: | N/A | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | \ No newline at end of file diff --git a/sync-for-payables/docs/models/operations/getcreateupdatebillmodelresponse.md b/sync-for-payables/docs/models/operations/getcreateupdatebillmodelresponse.md new file mode 100755 index 000000000..f344bfc1d --- /dev/null +++ b/sync-for-payables/docs/models/operations/getcreateupdatebillmodelresponse.md @@ -0,0 +1,12 @@ +# GetCreateUpdateBillModelResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | +| `content_type` | *str* | :heavy_check_mark: | N/A | +| `error_message` | [Optional[shared.ErrorMessage]](../../models/shared/errormessage.md) | :heavy_minus_sign: | Your API request was not properly authorized. | +| `push_option` | [Optional[shared.PushOption]](../../models/shared/pushoption.md) | :heavy_minus_sign: | OK | +| `status_code` | *int* | :heavy_check_mark: | N/A | +| `raw_response` | [requests.Response](https://requests.readthedocs.io/en/latest/api/#requests.Response) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/sync-for-payables/docs/models/operations/getcreateupdatesuppliermodelrequest.md b/sync-for-payables/docs/models/operations/getcreateupdatesuppliermodelrequest.md new file mode 100755 index 000000000..fb09d1f2d --- /dev/null +++ b/sync-for-payables/docs/models/operations/getcreateupdatesuppliermodelrequest.md @@ -0,0 +1,9 @@ +# GetCreateUpdateSupplierModelRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | +| `company_id` | *str* | :heavy_check_mark: | N/A | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `connection_id` | *str* | :heavy_check_mark: | N/A | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | \ No newline at end of file diff --git a/sync-for-payables/docs/models/operations/getcreateupdatesuppliermodelresponse.md b/sync-for-payables/docs/models/operations/getcreateupdatesuppliermodelresponse.md new file mode 100755 index 000000000..09bd45d6d --- /dev/null +++ b/sync-for-payables/docs/models/operations/getcreateupdatesuppliermodelresponse.md @@ -0,0 +1,12 @@ +# GetCreateUpdateSupplierModelResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | +| `content_type` | *str* | :heavy_check_mark: | N/A | +| `error_message` | [Optional[shared.ErrorMessage]](../../models/shared/errormessage.md) | :heavy_minus_sign: | Your API request was not properly authorized. | +| `push_option` | [Optional[shared.PushOption]](../../models/shared/pushoption.md) | :heavy_minus_sign: | OK | +| `status_code` | *int* | :heavy_check_mark: | N/A | +| `raw_response` | [requests.Response](https://requests.readthedocs.io/en/latest/api/#requests.Response) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/sync-for-payables/docs/models/operations/getdatastatusrequest.md b/sync-for-payables/docs/models/operations/getdatastatusrequest.md new file mode 100755 index 000000000..8ee7b2510 --- /dev/null +++ b/sync-for-payables/docs/models/operations/getdatastatusrequest.md @@ -0,0 +1,8 @@ +# GetDataStatusRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | +| `company_id` | *str* | :heavy_check_mark: | N/A | 8a210b68-6988-11ed-a1eb-0242ac120002 | \ No newline at end of file diff --git a/sync-for-payables/docs/models/operations/getdatastatusresponse.md b/sync-for-payables/docs/models/operations/getdatastatusresponse.md new file mode 100755 index 000000000..9ffc60fec --- /dev/null +++ b/sync-for-payables/docs/models/operations/getdatastatusresponse.md @@ -0,0 +1,12 @@ +# GetDataStatusResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | +| `content_type` | *str* | :heavy_check_mark: | N/A | +| `data_status_response` | dict[str, [shared.DataStatus](../../models/shared/datastatus.md)] | :heavy_minus_sign: | OK | +| `error_message` | [Optional[shared.ErrorMessage]](../../models/shared/errormessage.md) | :heavy_minus_sign: | Your API request was not properly authorized. | +| `status_code` | *int* | :heavy_check_mark: | N/A | +| `raw_response` | [requests.Response](https://requests.readthedocs.io/en/latest/api/#requests.Response) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/sync-for-payables/docs/models/operations/getjournalrequest.md b/sync-for-payables/docs/models/operations/getjournalrequest.md new file mode 100755 index 000000000..a64b3b411 --- /dev/null +++ b/sync-for-payables/docs/models/operations/getjournalrequest.md @@ -0,0 +1,9 @@ +# GetJournalRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | +| `company_id` | *str* | :heavy_check_mark: | N/A | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `journal_id` | *str* | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/sync-for-payables/docs/models/operations/getjournalresponse.md b/sync-for-payables/docs/models/operations/getjournalresponse.md new file mode 100755 index 000000000..ca7114ac5 --- /dev/null +++ b/sync-for-payables/docs/models/operations/getjournalresponse.md @@ -0,0 +1,12 @@ +# GetJournalResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | +| `content_type` | *str* | :heavy_check_mark: | N/A | +| `error_message` | [Optional[shared.ErrorMessage]](../../models/shared/errormessage.md) | :heavy_minus_sign: | Your API request was not properly authorized. | +| `journal` | [Optional[shared.Journal]](../../models/shared/journal.md) | :heavy_minus_sign: | Success | +| `status_code` | *int* | :heavy_check_mark: | N/A | +| `raw_response` | [requests.Response](https://requests.readthedocs.io/en/latest/api/#requests.Response) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/sync-for-payables/docs/models/operations/getpaymentmethodrequest.md b/sync-for-payables/docs/models/operations/getpaymentmethodrequest.md new file mode 100755 index 000000000..bc8abab68 --- /dev/null +++ b/sync-for-payables/docs/models/operations/getpaymentmethodrequest.md @@ -0,0 +1,9 @@ +# GetPaymentMethodRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | +| `company_id` | *str* | :heavy_check_mark: | N/A | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `payment_method_id` | *str* | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/sync-for-payables/docs/models/operations/getpaymentmethodresponse.md b/sync-for-payables/docs/models/operations/getpaymentmethodresponse.md new file mode 100755 index 000000000..0f3212bd0 --- /dev/null +++ b/sync-for-payables/docs/models/operations/getpaymentmethodresponse.md @@ -0,0 +1,12 @@ +# GetPaymentMethodResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | +| `content_type` | *str* | :heavy_check_mark: | N/A | +| `error_message` | [Optional[shared.ErrorMessage]](../../models/shared/errormessage.md) | :heavy_minus_sign: | Your API request was not properly authorized. | +| `payment_method` | [Optional[shared.PaymentMethod]](../../models/shared/paymentmethod.md) | :heavy_minus_sign: | Success | +| `status_code` | *int* | :heavy_check_mark: | N/A | +| `raw_response` | [requests.Response](https://requests.readthedocs.io/en/latest/api/#requests.Response) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/sync-for-payables/docs/models/operations/getpulloperationrequest.md b/sync-for-payables/docs/models/operations/getpulloperationrequest.md new file mode 100755 index 000000000..a965477f9 --- /dev/null +++ b/sync-for-payables/docs/models/operations/getpulloperationrequest.md @@ -0,0 +1,9 @@ +# GetPullOperationRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------- | ----------------------------------------- | ----------------------------------------- | ----------------------------------------- | ----------------------------------------- | +| `company_id` | *str* | :heavy_check_mark: | N/A | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `dataset_id` | *str* | :heavy_check_mark: | Unique ID of a dataset or pull operation. | eaed9f0f-e77b-4bc9-a58f-ab8b4b99ab18 | \ No newline at end of file diff --git a/sync-for-payables/docs/models/operations/getpulloperationresponse.md b/sync-for-payables/docs/models/operations/getpulloperationresponse.md new file mode 100755 index 000000000..1527d9f32 --- /dev/null +++ b/sync-for-payables/docs/models/operations/getpulloperationresponse.md @@ -0,0 +1,12 @@ +# GetPullOperationResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | +| `content_type` | *str* | :heavy_check_mark: | N/A | +| `error_message` | [Optional[shared.ErrorMessage]](../../models/shared/errormessage.md) | :heavy_minus_sign: | Your API request was not properly authorized. | +| `pull_operation` | [Optional[shared.PullOperation]](../../models/shared/pulloperation.md) | :heavy_minus_sign: | OK | +| `status_code` | *int* | :heavy_check_mark: | N/A | +| `raw_response` | [requests.Response](https://requests.readthedocs.io/en/latest/api/#requests.Response) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/sync-for-payables/docs/models/operations/getpushoperationrequest.md b/sync-for-payables/docs/models/operations/getpushoperationrequest.md new file mode 100755 index 000000000..8a7e2f877 --- /dev/null +++ b/sync-for-payables/docs/models/operations/getpushoperationrequest.md @@ -0,0 +1,9 @@ +# GetPushOperationRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | +| `company_id` | *str* | :heavy_check_mark: | N/A | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `push_operation_key` | *str* | :heavy_check_mark: | Push operation key. | | \ No newline at end of file diff --git a/sync-for-payables/docs/models/operations/getpushoperationresponse.md b/sync-for-payables/docs/models/operations/getpushoperationresponse.md new file mode 100755 index 000000000..0477eb0ec --- /dev/null +++ b/sync-for-payables/docs/models/operations/getpushoperationresponse.md @@ -0,0 +1,12 @@ +# GetPushOperationResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | +| `content_type` | *str* | :heavy_check_mark: | N/A | +| `error_message` | [Optional[shared.ErrorMessage]](../../models/shared/errormessage.md) | :heavy_minus_sign: | Your API request was not properly authorized. | +| `push_operation` | [Optional[shared.PushOperation]](../../models/shared/pushoperation.md) | :heavy_minus_sign: | OK | +| `status_code` | *int* | :heavy_check_mark: | N/A | +| `raw_response` | [requests.Response](https://requests.readthedocs.io/en/latest/api/#requests.Response) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/sync-for-payables/docs/models/operations/getsupplierrequest.md b/sync-for-payables/docs/models/operations/getsupplierrequest.md new file mode 100755 index 000000000..d11501fc0 --- /dev/null +++ b/sync-for-payables/docs/models/operations/getsupplierrequest.md @@ -0,0 +1,9 @@ +# GetSupplierRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | +| `company_id` | *str* | :heavy_check_mark: | N/A | 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/sync-for-payables/docs/models/operations/getsupplierresponse.md b/sync-for-payables/docs/models/operations/getsupplierresponse.md new file mode 100755 index 000000000..298bff3cb --- /dev/null +++ b/sync-for-payables/docs/models/operations/getsupplierresponse.md @@ -0,0 +1,12 @@ +# GetSupplierResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | +| `content_type` | *str* | :heavy_check_mark: | N/A | +| `error_message` | [Optional[shared.ErrorMessage]](../../models/shared/errormessage.md) | :heavy_minus_sign: | Your API request was not properly authorized. | +| `status_code` | *int* | :heavy_check_mark: | N/A | +| `raw_response` | [requests.Response](https://requests.readthedocs.io/en/latest/api/#requests.Response) | :heavy_minus_sign: | N/A | +| `supplier` | [Optional[shared.Supplier]](../../models/shared/supplier.md) | :heavy_minus_sign: | Success | \ No newline at end of file diff --git a/sync-for-payables/docs/models/operations/gettaxraterequest.md b/sync-for-payables/docs/models/operations/gettaxraterequest.md new file mode 100755 index 000000000..f62035cd4 --- /dev/null +++ b/sync-for-payables/docs/models/operations/gettaxraterequest.md @@ -0,0 +1,9 @@ +# GetTaxRateRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | +| `company_id` | *str* | :heavy_check_mark: | N/A | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `tax_rate_id` | *str* | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/sync-for-payables/docs/models/operations/gettaxrateresponse.md b/sync-for-payables/docs/models/operations/gettaxrateresponse.md new file mode 100755 index 000000000..85a7ab052 --- /dev/null +++ b/sync-for-payables/docs/models/operations/gettaxrateresponse.md @@ -0,0 +1,12 @@ +# GetTaxRateResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | +| `content_type` | *str* | :heavy_check_mark: | N/A | +| `error_message` | [Optional[shared.ErrorMessage]](../../models/shared/errormessage.md) | :heavy_minus_sign: | Your API request was not properly authorized. | +| `status_code` | *int* | :heavy_check_mark: | N/A | +| `raw_response` | [requests.Response](https://requests.readthedocs.io/en/latest/api/#requests.Response) | :heavy_minus_sign: | N/A | +| `tax_rate` | [Optional[shared.TaxRate]](../../models/shared/taxrate.md) | :heavy_minus_sign: | Success | \ No newline at end of file diff --git a/sync-for-payables/docs/models/operations/gettrackingcategoryrequest.md b/sync-for-payables/docs/models/operations/gettrackingcategoryrequest.md new file mode 100755 index 000000000..37325af20 --- /dev/null +++ b/sync-for-payables/docs/models/operations/gettrackingcategoryrequest.md @@ -0,0 +1,9 @@ +# GetTrackingCategoryRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | +| `company_id` | *str* | :heavy_check_mark: | N/A | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `tracking_category_id` | *str* | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/sync-for-payables/docs/models/operations/gettrackingcategoryresponse.md b/sync-for-payables/docs/models/operations/gettrackingcategoryresponse.md new file mode 100755 index 000000000..90d35c4e0 --- /dev/null +++ b/sync-for-payables/docs/models/operations/gettrackingcategoryresponse.md @@ -0,0 +1,12 @@ +# GetTrackingCategoryResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | +| `content_type` | *str* | :heavy_check_mark: | N/A | +| `error_message` | [Optional[shared.ErrorMessage]](../../models/shared/errormessage.md) | :heavy_minus_sign: | Your API request was not properly authorized. | +| `status_code` | *int* | :heavy_check_mark: | N/A | +| `raw_response` | [requests.Response](https://requests.readthedocs.io/en/latest/api/#requests.Response) | :heavy_minus_sign: | N/A | +| `tracking_category_tree` | [Optional[shared.TrackingCategoryTree]](../../models/shared/trackingcategorytree.md) | :heavy_minus_sign: | Success | \ No newline at end of file diff --git a/sync-for-payables/docs/models/operations/listaccountsrequest.md b/sync-for-payables/docs/models/operations/listaccountsrequest.md new file mode 100755 index 000000000..6d98befb9 --- /dev/null +++ b/sync-for-payables/docs/models/operations/listaccountsrequest.md @@ -0,0 +1,12 @@ +# ListAccountsRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | +| `company_id` | *str* | :heavy_check_mark: | N/A | 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). | | \ No newline at end of file diff --git a/sync-for-payables/docs/models/operations/listaccountsresponse.md b/sync-for-payables/docs/models/operations/listaccountsresponse.md new file mode 100755 index 000000000..9f8e57872 --- /dev/null +++ b/sync-for-payables/docs/models/operations/listaccountsresponse.md @@ -0,0 +1,12 @@ +# ListAccountsResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | +| `accounts` | [Optional[shared.Accounts]](../../models/shared/accounts.md) | :heavy_minus_sign: | Success | +| `content_type` | *str* | :heavy_check_mark: | N/A | +| `error_message` | [Optional[shared.ErrorMessage]](../../models/shared/errormessage.md) | :heavy_minus_sign: | Your `query` parameter was not correctly formed | +| `status_code` | *int* | :heavy_check_mark: | N/A | +| `raw_response` | [requests.Response](https://requests.readthedocs.io/en/latest/api/#requests.Response) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/sync-for-payables/docs/models/operations/listbillattachmentsrequest.md b/sync-for-payables/docs/models/operations/listbillattachmentsrequest.md new file mode 100755 index 000000000..8f212222e --- /dev/null +++ b/sync-for-payables/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: | N/A | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `connection_id` | *str* | :heavy_check_mark: | N/A | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | \ No newline at end of file diff --git a/sync-for-payables/docs/models/operations/listbillattachmentsresponse.md b/sync-for-payables/docs/models/operations/listbillattachmentsresponse.md new file mode 100755 index 000000000..012ac06da --- /dev/null +++ b/sync-for-payables/docs/models/operations/listbillattachmentsresponse.md @@ -0,0 +1,12 @@ +# ListBillAttachmentsResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | +| `attachments` | [Optional[shared.Attachments]](../../models/shared/attachments.md) | :heavy_minus_sign: | Success | +| `content_type` | *str* | :heavy_check_mark: | N/A | +| `error_message` | [Optional[shared.ErrorMessage]](../../models/shared/errormessage.md) | :heavy_minus_sign: | Your API request was not properly authorized. | +| `status_code` | *int* | :heavy_check_mark: | N/A | +| `raw_response` | [requests.Response](https://requests.readthedocs.io/en/latest/api/#requests.Response) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/sync-for-payables/docs/models/operations/listbillcreditnotesrequest.md b/sync-for-payables/docs/models/operations/listbillcreditnotesrequest.md new file mode 100755 index 000000000..604c176d0 --- /dev/null +++ b/sync-for-payables/docs/models/operations/listbillcreditnotesrequest.md @@ -0,0 +1,12 @@ +# ListBillCreditNotesRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | +| `company_id` | *str* | :heavy_check_mark: | N/A | 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). | | \ No newline at end of file diff --git a/sync-for-payables/docs/models/operations/listbillcreditnotesresponse.md b/sync-for-payables/docs/models/operations/listbillcreditnotesresponse.md new file mode 100755 index 000000000..50c8c31e0 --- /dev/null +++ b/sync-for-payables/docs/models/operations/listbillcreditnotesresponse.md @@ -0,0 +1,12 @@ +# ListBillCreditNotesResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | +| `bill_credit_notes` | [Optional[shared.BillCreditNotes]](../../models/shared/billcreditnotes.md) | :heavy_minus_sign: | Success | +| `content_type` | *str* | :heavy_check_mark: | N/A | +| `error_message` | [Optional[shared.ErrorMessage]](../../models/shared/errormessage.md) | :heavy_minus_sign: | Your `query` parameter was not correctly formed | +| `status_code` | *int* | :heavy_check_mark: | N/A | +| `raw_response` | [requests.Response](https://requests.readthedocs.io/en/latest/api/#requests.Response) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/sync-for-payables/docs/models/operations/listbillpaymentsrequest.md b/sync-for-payables/docs/models/operations/listbillpaymentsrequest.md new file mode 100755 index 000000000..863795276 --- /dev/null +++ b/sync-for-payables/docs/models/operations/listbillpaymentsrequest.md @@ -0,0 +1,12 @@ +# ListBillPaymentsRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | +| `company_id` | *str* | :heavy_check_mark: | N/A | 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). | | \ No newline at end of file diff --git a/sync-for-payables/docs/models/operations/listbillpaymentsresponse.md b/sync-for-payables/docs/models/operations/listbillpaymentsresponse.md new file mode 100755 index 000000000..fb78d3c5b --- /dev/null +++ b/sync-for-payables/docs/models/operations/listbillpaymentsresponse.md @@ -0,0 +1,12 @@ +# ListBillPaymentsResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | +| `bill_payments` | [Optional[shared.BillPayments]](../../models/shared/billpayments.md) | :heavy_minus_sign: | Success | +| `content_type` | *str* | :heavy_check_mark: | N/A | +| `error_message` | [Optional[shared.ErrorMessage]](../../models/shared/errormessage.md) | :heavy_minus_sign: | Your `query` parameter was not correctly formed | +| `status_code` | *int* | :heavy_check_mark: | N/A | +| `raw_response` | [requests.Response](https://requests.readthedocs.io/en/latest/api/#requests.Response) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/sync-for-payables/docs/models/operations/listbillsrequest.md b/sync-for-payables/docs/models/operations/listbillsrequest.md new file mode 100755 index 000000000..e6a708731 --- /dev/null +++ b/sync-for-payables/docs/models/operations/listbillsrequest.md @@ -0,0 +1,12 @@ +# ListBillsRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | +| `company_id` | *str* | :heavy_check_mark: | N/A | 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). | | \ No newline at end of file diff --git a/sync-for-payables/docs/models/operations/listbillsresponse.md b/sync-for-payables/docs/models/operations/listbillsresponse.md new file mode 100755 index 000000000..60a6804a5 --- /dev/null +++ b/sync-for-payables/docs/models/operations/listbillsresponse.md @@ -0,0 +1,12 @@ +# ListBillsResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | +| `bills` | [Optional[shared.Bills]](../../models/shared/bills.md) | :heavy_minus_sign: | Success | +| `content_type` | *str* | :heavy_check_mark: | N/A | +| `error_message` | [Optional[shared.ErrorMessage]](../../models/shared/errormessage.md) | :heavy_minus_sign: | Your `query` parameter was not correctly formed | +| `status_code` | *int* | :heavy_check_mark: | N/A | +| `raw_response` | [requests.Response](https://requests.readthedocs.io/en/latest/api/#requests.Response) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/sync-for-payables/docs/models/operations/listcompaniesrequest.md b/sync-for-payables/docs/models/operations/listcompaniesrequest.md new file mode 100755 index 000000000..8dfaf69d5 --- /dev/null +++ b/sync-for-payables/docs/models/operations/listcompaniesrequest.md @@ -0,0 +1,11 @@ +# ListCompaniesRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | +| `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 diff --git a/sync-for-payables/docs/models/operations/listcompaniesresponse.md b/sync-for-payables/docs/models/operations/listcompaniesresponse.md new file mode 100755 index 000000000..506ed1fa1 --- /dev/null +++ b/sync-for-payables/docs/models/operations/listcompaniesresponse.md @@ -0,0 +1,12 @@ +# ListCompaniesResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | +| `companies` | [Optional[shared.Companies]](../../models/shared/companies.md) | :heavy_minus_sign: | OK | +| `content_type` | *str* | :heavy_check_mark: | N/A | +| `error_message` | [Optional[shared.ErrorMessage]](../../models/shared/errormessage.md) | :heavy_minus_sign: | Your `query` parameter was not correctly formed | +| `status_code` | *int* | :heavy_check_mark: | N/A | +| `raw_response` | [requests.Response](https://requests.readthedocs.io/en/latest/api/#requests.Response) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/sync-for-payables/docs/models/operations/listconnectionsrequest.md b/sync-for-payables/docs/models/operations/listconnectionsrequest.md new file mode 100755 index 000000000..1cdcf0879 --- /dev/null +++ b/sync-for-payables/docs/models/operations/listconnectionsrequest.md @@ -0,0 +1,12 @@ +# ListConnectionsRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | +| `company_id` | *str* | :heavy_check_mark: | N/A | 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). | | \ No newline at end of file diff --git a/sync-for-payables/docs/models/operations/listconnectionsresponse.md b/sync-for-payables/docs/models/operations/listconnectionsresponse.md new file mode 100755 index 000000000..68f439c07 --- /dev/null +++ b/sync-for-payables/docs/models/operations/listconnectionsresponse.md @@ -0,0 +1,12 @@ +# ListConnectionsResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | +| `connections` | [Optional[shared.Connections]](../../models/shared/connections.md) | :heavy_minus_sign: | OK | +| `content_type` | *str* | :heavy_check_mark: | N/A | +| `error_message` | [Optional[shared.ErrorMessage]](../../models/shared/errormessage.md) | :heavy_minus_sign: | Your `query` parameter was not correctly formed | +| `status_code` | *int* | :heavy_check_mark: | N/A | +| `raw_response` | [requests.Response](https://requests.readthedocs.io/en/latest/api/#requests.Response) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/sync-for-payables/docs/models/operations/listjournalsrequest.md b/sync-for-payables/docs/models/operations/listjournalsrequest.md new file mode 100755 index 000000000..966254ec9 --- /dev/null +++ b/sync-for-payables/docs/models/operations/listjournalsrequest.md @@ -0,0 +1,12 @@ +# ListJournalsRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | +| `company_id` | *str* | :heavy_check_mark: | N/A | 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). | | \ No newline at end of file diff --git a/sync-for-payables/docs/models/operations/listjournalsresponse.md b/sync-for-payables/docs/models/operations/listjournalsresponse.md new file mode 100755 index 000000000..82931e7a0 --- /dev/null +++ b/sync-for-payables/docs/models/operations/listjournalsresponse.md @@ -0,0 +1,12 @@ +# ListJournalsResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | +| `content_type` | *str* | :heavy_check_mark: | N/A | +| `error_message` | [Optional[shared.ErrorMessage]](../../models/shared/errormessage.md) | :heavy_minus_sign: | Your `query` parameter was not correctly formed | +| `journals` | [Optional[shared.Journals]](../../models/shared/journals.md) | :heavy_minus_sign: | Success | +| `status_code` | *int* | :heavy_check_mark: | N/A | +| `raw_response` | [requests.Response](https://requests.readthedocs.io/en/latest/api/#requests.Response) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/sync-for-payables/docs/models/operations/listpaymentmethodsrequest.md b/sync-for-payables/docs/models/operations/listpaymentmethodsrequest.md new file mode 100755 index 000000000..f164f2071 --- /dev/null +++ b/sync-for-payables/docs/models/operations/listpaymentmethodsrequest.md @@ -0,0 +1,12 @@ +# ListPaymentMethodsRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | +| `company_id` | *str* | :heavy_check_mark: | N/A | 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). | | \ No newline at end of file diff --git a/sync-for-payables/docs/models/operations/listpaymentmethodsresponse.md b/sync-for-payables/docs/models/operations/listpaymentmethodsresponse.md new file mode 100755 index 000000000..a3dcb7679 --- /dev/null +++ b/sync-for-payables/docs/models/operations/listpaymentmethodsresponse.md @@ -0,0 +1,12 @@ +# ListPaymentMethodsResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | +| `content_type` | *str* | :heavy_check_mark: | N/A | +| `error_message` | [Optional[shared.ErrorMessage]](../../models/shared/errormessage.md) | :heavy_minus_sign: | Your `query` parameter was not correctly formed | +| `payment_methods` | [Optional[shared.PaymentMethods]](../../models/shared/paymentmethods.md) | :heavy_minus_sign: | Success | +| `status_code` | *int* | :heavy_check_mark: | N/A | +| `raw_response` | [requests.Response](https://requests.readthedocs.io/en/latest/api/#requests.Response) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/sync-for-payables/docs/models/operations/listpulloperationsrequest.md b/sync-for-payables/docs/models/operations/listpulloperationsrequest.md new file mode 100755 index 000000000..d5a4b553d --- /dev/null +++ b/sync-for-payables/docs/models/operations/listpulloperationsrequest.md @@ -0,0 +1,12 @@ +# ListPullOperationsRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | +| `company_id` | *str* | :heavy_check_mark: | N/A | 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). | | \ No newline at end of file diff --git a/sync-for-payables/docs/models/operations/listpulloperationsresponse.md b/sync-for-payables/docs/models/operations/listpulloperationsresponse.md new file mode 100755 index 000000000..23240bd20 --- /dev/null +++ b/sync-for-payables/docs/models/operations/listpulloperationsresponse.md @@ -0,0 +1,12 @@ +# ListPullOperationsResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | +| `content_type` | *str* | :heavy_check_mark: | N/A | +| `error_message` | [Optional[shared.ErrorMessage]](../../models/shared/errormessage.md) | :heavy_minus_sign: | Your `query` parameter was not correctly formed | +| `pull_operations` | [Optional[shared.PullOperations]](../../models/shared/pulloperations.md) | :heavy_minus_sign: | OK | +| `status_code` | *int* | :heavy_check_mark: | N/A | +| `raw_response` | [requests.Response](https://requests.readthedocs.io/en/latest/api/#requests.Response) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/sync-for-payables/docs/models/operations/listpushoperationsrequest.md b/sync-for-payables/docs/models/operations/listpushoperationsrequest.md new file mode 100755 index 000000000..bb6141c76 --- /dev/null +++ b/sync-for-payables/docs/models/operations/listpushoperationsrequest.md @@ -0,0 +1,12 @@ +# ListPushOperationsRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | +| `company_id` | *str* | :heavy_check_mark: | N/A | 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). | | \ No newline at end of file diff --git a/sync-for-payables/docs/models/operations/listpushoperationsresponse.md b/sync-for-payables/docs/models/operations/listpushoperationsresponse.md new file mode 100755 index 000000000..db6720eea --- /dev/null +++ b/sync-for-payables/docs/models/operations/listpushoperationsresponse.md @@ -0,0 +1,12 @@ +# ListPushOperationsResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | +| `content_type` | *str* | :heavy_check_mark: | N/A | +| `error_message` | [Optional[shared.ErrorMessage]](../../models/shared/errormessage.md) | :heavy_minus_sign: | Your `query` parameter was not correctly formed | +| `push_operations` | [Optional[shared.PushOperations]](../../models/shared/pushoperations.md) | :heavy_minus_sign: | OK | +| `status_code` | *int* | :heavy_check_mark: | N/A | +| `raw_response` | [requests.Response](https://requests.readthedocs.io/en/latest/api/#requests.Response) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/sync-for-payables/docs/models/operations/listsuppliersrequest.md b/sync-for-payables/docs/models/operations/listsuppliersrequest.md new file mode 100755 index 000000000..251721c9d --- /dev/null +++ b/sync-for-payables/docs/models/operations/listsuppliersrequest.md @@ -0,0 +1,12 @@ +# ListSuppliersRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | +| `company_id` | *str* | :heavy_check_mark: | N/A | 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). | | \ No newline at end of file diff --git a/sync-for-payables/docs/models/operations/listsuppliersresponse.md b/sync-for-payables/docs/models/operations/listsuppliersresponse.md new file mode 100755 index 000000000..d0bc9c436 --- /dev/null +++ b/sync-for-payables/docs/models/operations/listsuppliersresponse.md @@ -0,0 +1,12 @@ +# ListSuppliersResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | +| `content_type` | *str* | :heavy_check_mark: | N/A | +| `error_message` | [Optional[shared.ErrorMessage]](../../models/shared/errormessage.md) | :heavy_minus_sign: | Your `query` parameter was not correctly formed | +| `status_code` | *int* | :heavy_check_mark: | N/A | +| `raw_response` | [requests.Response](https://requests.readthedocs.io/en/latest/api/#requests.Response) | :heavy_minus_sign: | N/A | +| `suppliers` | [Optional[shared.Suppliers]](../../models/shared/suppliers.md) | :heavy_minus_sign: | Success | \ No newline at end of file diff --git a/sync-for-payables/docs/models/operations/listtaxratesrequest.md b/sync-for-payables/docs/models/operations/listtaxratesrequest.md new file mode 100755 index 000000000..82deb55a0 --- /dev/null +++ b/sync-for-payables/docs/models/operations/listtaxratesrequest.md @@ -0,0 +1,12 @@ +# ListTaxRatesRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | +| `company_id` | *str* | :heavy_check_mark: | N/A | 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). | | \ No newline at end of file diff --git a/sync-for-payables/docs/models/operations/listtaxratesresponse.md b/sync-for-payables/docs/models/operations/listtaxratesresponse.md new file mode 100755 index 000000000..c69404905 --- /dev/null +++ b/sync-for-payables/docs/models/operations/listtaxratesresponse.md @@ -0,0 +1,12 @@ +# ListTaxRatesResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | +| `content_type` | *str* | :heavy_check_mark: | N/A | +| `error_message` | [Optional[shared.ErrorMessage]](../../models/shared/errormessage.md) | :heavy_minus_sign: | Your `query` parameter was not correctly formed | +| `status_code` | *int* | :heavy_check_mark: | N/A | +| `raw_response` | [requests.Response](https://requests.readthedocs.io/en/latest/api/#requests.Response) | :heavy_minus_sign: | N/A | +| `tax_rates` | [Optional[shared.TaxRates]](../../models/shared/taxrates.md) | :heavy_minus_sign: | Success | \ No newline at end of file diff --git a/sync-for-payables/docs/models/operations/listtrackingcategoriesrequest.md b/sync-for-payables/docs/models/operations/listtrackingcategoriesrequest.md new file mode 100755 index 000000000..6ccfdf2ff --- /dev/null +++ b/sync-for-payables/docs/models/operations/listtrackingcategoriesrequest.md @@ -0,0 +1,12 @@ +# ListTrackingCategoriesRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | +| `company_id` | *str* | :heavy_check_mark: | N/A | 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). | | \ No newline at end of file diff --git a/sync-for-payables/docs/models/operations/listtrackingcategoriesresponse.md b/sync-for-payables/docs/models/operations/listtrackingcategoriesresponse.md new file mode 100755 index 000000000..60f28a160 --- /dev/null +++ b/sync-for-payables/docs/models/operations/listtrackingcategoriesresponse.md @@ -0,0 +1,12 @@ +# ListTrackingCategoriesResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | +| `content_type` | *str* | :heavy_check_mark: | N/A | +| `error_message` | [Optional[shared.ErrorMessage]](../../models/shared/errormessage.md) | :heavy_minus_sign: | Your `query` parameter was not correctly formed | +| `status_code` | *int* | :heavy_check_mark: | N/A | +| `raw_response` | [requests.Response](https://requests.readthedocs.io/en/latest/api/#requests.Response) | :heavy_minus_sign: | N/A | +| `tracking_categories` | [Optional[shared.TrackingCategories]](../../models/shared/trackingcategories.md) | :heavy_minus_sign: | Success | \ No newline at end of file diff --git a/sync-for-payables/docs/models/operations/refreshalldatatypesrequest.md b/sync-for-payables/docs/models/operations/refreshalldatatypesrequest.md new file mode 100755 index 000000000..33fb640ed --- /dev/null +++ b/sync-for-payables/docs/models/operations/refreshalldatatypesrequest.md @@ -0,0 +1,8 @@ +# RefreshAllDataTypesRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | +| `company_id` | *str* | :heavy_check_mark: | N/A | 8a210b68-6988-11ed-a1eb-0242ac120002 | \ No newline at end of file diff --git a/sync-for-payables/docs/models/operations/refreshalldatatypesresponse.md b/sync-for-payables/docs/models/operations/refreshalldatatypesresponse.md new file mode 100755 index 000000000..22a543959 --- /dev/null +++ b/sync-for-payables/docs/models/operations/refreshalldatatypesresponse.md @@ -0,0 +1,11 @@ +# RefreshAllDataTypesResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | +| `content_type` | *str* | :heavy_check_mark: | N/A | +| `error_message` | [Optional[shared.ErrorMessage]](../../models/shared/errormessage.md) | :heavy_minus_sign: | Your API request was not properly authorized. | +| `status_code` | *int* | :heavy_check_mark: | N/A | +| `raw_response` | [requests.Response](https://requests.readthedocs.io/en/latest/api/#requests.Response) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/sync-for-payables/docs/models/operations/refreshdatatyperequest.md b/sync-for-payables/docs/models/operations/refreshdatatyperequest.md new file mode 100755 index 000000000..cbefc996f --- /dev/null +++ b/sync-for-payables/docs/models/operations/refreshdatatyperequest.md @@ -0,0 +1,10 @@ +# RefreshDataTypeRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | +| `company_id` | *str* | :heavy_check_mark: | N/A | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `connection_id` | *Optional[str]* | :heavy_minus_sign: | Optionally, provide a data connection id to only queue pull operations on that connection. | | +| `data_type` | [shared.DataType](../../models/shared/datatype.md) | :heavy_check_mark: | The key of a Codat data type | invoices | \ No newline at end of file diff --git a/sync-for-payables/docs/models/operations/refreshdatatyperesponse.md b/sync-for-payables/docs/models/operations/refreshdatatyperesponse.md new file mode 100755 index 000000000..73215c3bd --- /dev/null +++ b/sync-for-payables/docs/models/operations/refreshdatatyperesponse.md @@ -0,0 +1,12 @@ +# RefreshDataTypeResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | +| `content_type` | *str* | :heavy_check_mark: | N/A | +| `error_message` | [Optional[shared.ErrorMessage]](../../models/shared/errormessage.md) | :heavy_minus_sign: | Your API request was not properly authorized. | +| `pull_operation` | [Optional[shared.PullOperation]](../../models/shared/pulloperation.md) | :heavy_minus_sign: | OK | +| `status_code` | *int* | :heavy_check_mark: | N/A | +| `raw_response` | [requests.Response](https://requests.readthedocs.io/en/latest/api/#requests.Response) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/sync-for-payables/docs/models/operations/unlinkconnectionrequest.md b/sync-for-payables/docs/models/operations/unlinkconnectionrequest.md new file mode 100755 index 000000000..2ed1d78dc --- /dev/null +++ b/sync-for-payables/docs/models/operations/unlinkconnectionrequest.md @@ -0,0 +1,10 @@ +# UnlinkConnectionRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | +| `request_body` | [Optional[UnlinkConnectionRequestBody]](../../models/operations/unlinkconnectionrequestbody.md) | :heavy_minus_sign: | N/A | | +| `company_id` | *str* | :heavy_check_mark: | N/A | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `connection_id` | *str* | :heavy_check_mark: | N/A | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | \ No newline at end of file diff --git a/sync-for-payables/docs/models/operations/unlinkconnectionrequestbody.md b/sync-for-payables/docs/models/operations/unlinkconnectionrequestbody.md new file mode 100755 index 000000000..276bf1330 --- /dev/null +++ b/sync-for-payables/docs/models/operations/unlinkconnectionrequestbody.md @@ -0,0 +1,8 @@ +# UnlinkConnectionRequestBody + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `status` | *Optional[str]* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/sync-for-payables/docs/models/operations/unlinkconnectionresponse.md b/sync-for-payables/docs/models/operations/unlinkconnectionresponse.md new file mode 100755 index 000000000..ced538908 --- /dev/null +++ b/sync-for-payables/docs/models/operations/unlinkconnectionresponse.md @@ -0,0 +1,12 @@ +# UnlinkConnectionResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | +| `connection` | [Optional[shared.Connection]](../../models/shared/connection.md) | :heavy_minus_sign: | OK | +| `content_type` | *str* | :heavy_check_mark: | N/A | +| `error_message` | [Optional[shared.ErrorMessage]](../../models/shared/errormessage.md) | :heavy_minus_sign: | Your API request was not properly authorized. | +| `status_code` | *int* | :heavy_check_mark: | N/A | +| `raw_response` | [requests.Response](https://requests.readthedocs.io/en/latest/api/#requests.Response) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/sync-for-payables/docs/models/operations/updatebillcreditnoterequest.md b/sync-for-payables/docs/models/operations/updatebillcreditnoterequest.md new file mode 100755 index 000000000..08c51ee02 --- /dev/null +++ b/sync-for-payables/docs/models/operations/updatebillcreditnoterequest.md @@ -0,0 +1,13 @@ +# UpdateBillCreditNoteRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `bill_credit_note` | [Optional[shared.BillCreditNote]](../../models/shared/billcreditnote.md) | :heavy_minus_sign: | N/A | | +| `bill_credit_note_id` | *str* | :heavy_check_mark: | N/A | | +| `company_id` | *str* | :heavy_check_mark: | N/A | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `connection_id` | *str* | :heavy_check_mark: | N/A | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | +| `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 platform, 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: | N/A | | \ No newline at end of file diff --git a/sync-for-payables/docs/models/operations/updatebillcreditnoteresponse.md b/sync-for-payables/docs/models/operations/updatebillcreditnoteresponse.md new file mode 100755 index 000000000..7b71cd72c --- /dev/null +++ b/sync-for-payables/docs/models/operations/updatebillcreditnoteresponse.md @@ -0,0 +1,12 @@ +# UpdateBillCreditNoteResponse + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | +| `content_type` | *str* | :heavy_check_mark: | N/A | +| `error_message` | [Optional[shared.ErrorMessage]](../../models/shared/errormessage.md) | :heavy_minus_sign: | The request made is not valid. | +| `status_code` | *int* | :heavy_check_mark: | N/A | +| `raw_response` | [requests.Response](https://requests.readthedocs.io/en/latest/api/#requests.Response) | :heavy_minus_sign: | N/A | +| `update_bill_credit_note_response` | [Optional[shared.UpdateBillCreditNoteResponse]](../../models/shared/updatebillcreditnoteresponse.md) | :heavy_minus_sign: | Success | \ No newline at end of file diff --git a/sync-for-payables/docs/models/operations/updatebillrequest.md b/sync-for-payables/docs/models/operations/updatebillrequest.md new file mode 100755 index 000000000..5b8799df2 --- /dev/null +++ b/sync-for-payables/docs/models/operations/updatebillrequest.md @@ -0,0 +1,13 @@ +# UpdateBillRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `bill` | [Optional[shared.Bill]](../../models/shared/bill.md) | :heavy_minus_sign: | N/A | | +| `bill_id` | *str* | :heavy_check_mark: | Unique identifier for a bill | 13d946f0-c5d5-42bc-b092-97ece17923ab | +| `company_id` | *str* | :heavy_check_mark: | N/A | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `connection_id` | *str* | :heavy_check_mark: | N/A | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | +| `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 platform, 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: | N/A | | \ No newline at end of file diff --git a/sync-for-payables/docs/models/operations/updatebillresponse.md b/sync-for-payables/docs/models/operations/updatebillresponse.md new file mode 100755 index 000000000..0d0fac5c3 --- /dev/null +++ b/sync-for-payables/docs/models/operations/updatebillresponse.md @@ -0,0 +1,12 @@ +# UpdateBillResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | +| `content_type` | *str* | :heavy_check_mark: | N/A | +| `error_message` | [Optional[shared.ErrorMessage]](../../models/shared/errormessage.md) | :heavy_minus_sign: | The request made is not valid. | +| `status_code` | *int* | :heavy_check_mark: | N/A | +| `raw_response` | [requests.Response](https://requests.readthedocs.io/en/latest/api/#requests.Response) | :heavy_minus_sign: | N/A | +| `update_bill_response` | [Optional[shared.UpdateBillResponse]](../../models/shared/updatebillresponse.md) | :heavy_minus_sign: | Success | \ No newline at end of file diff --git a/sync-for-payables/docs/models/operations/updatecompanyrequest.md b/sync-for-payables/docs/models/operations/updatecompanyrequest.md new file mode 100755 index 000000000..697f00528 --- /dev/null +++ b/sync-for-payables/docs/models/operations/updatecompanyrequest.md @@ -0,0 +1,9 @@ +# UpdateCompanyRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | +| `company_request_body` | [Optional[shared.CompanyRequestBody]](../../models/shared/companyrequestbody.md) | :heavy_minus_sign: | N/A | | +| `company_id` | *str* | :heavy_check_mark: | N/A | 8a210b68-6988-11ed-a1eb-0242ac120002 | \ No newline at end of file diff --git a/sync-for-payables/docs/models/operations/updatecompanyresponse.md b/sync-for-payables/docs/models/operations/updatecompanyresponse.md new file mode 100755 index 000000000..9b9c51eef --- /dev/null +++ b/sync-for-payables/docs/models/operations/updatecompanyresponse.md @@ -0,0 +1,12 @@ +# UpdateCompanyResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | +| `company` | [Optional[shared.Company]](../../models/shared/company.md) | :heavy_minus_sign: | OK | +| `content_type` | *str* | :heavy_check_mark: | N/A | +| `error_message` | [Optional[shared.ErrorMessage]](../../models/shared/errormessage.md) | :heavy_minus_sign: | Your API request was not properly authorized. | +| `status_code` | *int* | :heavy_check_mark: | N/A | +| `raw_response` | [requests.Response](https://requests.readthedocs.io/en/latest/api/#requests.Response) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/sync-for-payables/docs/models/operations/updatesupplierrequest.md b/sync-for-payables/docs/models/operations/updatesupplierrequest.md new file mode 100755 index 000000000..ec967e233 --- /dev/null +++ b/sync-for-payables/docs/models/operations/updatesupplierrequest.md @@ -0,0 +1,13 @@ +# UpdateSupplierRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `supplier` | [Optional[shared.Supplier]](../../models/shared/supplier.md) | :heavy_minus_sign: | N/A | | +| `company_id` | *str* | :heavy_check_mark: | N/A | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `connection_id` | *str* | :heavy_check_mark: | N/A | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | +| `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 platform, 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. | | +| `supplier_id` | *str* | :heavy_check_mark: | Unique identifier for a supplier | | +| `timeout_in_minutes` | *Optional[int]* | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/sync-for-payables/docs/models/operations/updatesupplierresponse.md b/sync-for-payables/docs/models/operations/updatesupplierresponse.md new file mode 100755 index 000000000..ac9a2fd4f --- /dev/null +++ b/sync-for-payables/docs/models/operations/updatesupplierresponse.md @@ -0,0 +1,12 @@ +# UpdateSupplierResponse + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | +| `content_type` | *str* | :heavy_check_mark: | N/A | +| `error_message` | [Optional[shared.ErrorMessage]](../../models/shared/errormessage.md) | :heavy_minus_sign: | The request made is not valid. | +| `status_code` | *int* | :heavy_check_mark: | N/A | +| `raw_response` | [requests.Response](https://requests.readthedocs.io/en/latest/api/#requests.Response) | :heavy_minus_sign: | N/A | +| `update_supplier_response` | [Optional[shared.UpdateSupplierResponse]](../../models/shared/updatesupplierresponse.md) | :heavy_minus_sign: | Success | \ No newline at end of file diff --git a/sync-for-payables/docs/models/operations/uploadbillattachmentrequest.md b/sync-for-payables/docs/models/operations/uploadbillattachmentrequest.md new file mode 100755 index 000000000..411b77d07 --- /dev/null +++ b/sync-for-payables/docs/models/operations/uploadbillattachmentrequest.md @@ -0,0 +1,11 @@ +# UploadBillAttachmentRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | +| `request_body` | [Optional[UploadBillAttachmentRequestBody]](../../models/operations/uploadbillattachmentrequestbody.md) | :heavy_minus_sign: | N/A | | +| `bill_id` | *str* | :heavy_check_mark: | Unique identifier for a bill | 13d946f0-c5d5-42bc-b092-97ece17923ab | +| `company_id` | *str* | :heavy_check_mark: | N/A | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `connection_id` | *str* | :heavy_check_mark: | N/A | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | \ No newline at end of file diff --git a/sync-for-payables/docs/models/operations/uploadbillattachmentrequestbody.md b/sync-for-payables/docs/models/operations/uploadbillattachmentrequestbody.md new file mode 100755 index 000000000..6b5939aac --- /dev/null +++ b/sync-for-payables/docs/models/operations/uploadbillattachmentrequestbody.md @@ -0,0 +1,9 @@ +# UploadBillAttachmentRequestBody + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `content` | *bytes* | :heavy_check_mark: | N/A | +| `request_body` | *str* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/sync-for-payables/docs/models/operations/uploadbillattachmentresponse.md b/sync-for-payables/docs/models/operations/uploadbillattachmentresponse.md new file mode 100755 index 000000000..a43068be5 --- /dev/null +++ b/sync-for-payables/docs/models/operations/uploadbillattachmentresponse.md @@ -0,0 +1,11 @@ +# UploadBillAttachmentResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | +| `content_type` | *str* | :heavy_check_mark: | N/A | +| `error_message` | [Optional[shared.ErrorMessage]](../../models/shared/errormessage.md) | :heavy_minus_sign: | Your API request was not properly authorized. | +| `status_code` | *int* | :heavy_check_mark: | N/A | +| `raw_response` | [requests.Response](https://requests.readthedocs.io/en/latest/api/#requests.Response) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/sync-for-payables/docs/models/shared/account.md b/sync-for-payables/docs/models/shared/account.md new file mode 100755 index 000000000..9dd0c38eb --- /dev/null +++ b/sync-for-payables/docs/models/shared/account.md @@ -0,0 +1,51 @@ +# 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/accounting-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` | *Optional[float]* | :heavy_minus_sign: | Current balance in the account. | 0 | +| `description` | *Optional[str]* | :heavy_minus_sign: | Description for the account. | Invoices the business has issued but has not yet collected payment on. | +| `fully_qualified_category` | *Optional[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` | *Optional[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[Metadata]](../../models/shared/metadata.md) | :heavy_minus_sign: | N/A | | +| `modified_date` | *Optional[str]* | :heavy_minus_sign: | N/A | 2022-10-23T00:00:00.000Z | +| `name` | *Optional[str]* | :heavy_minus_sign: | Name of the account. | Accounts Receivable | +| `nominal_code` | *Optional[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-23T00:00:00.000Z | +| `status` | [Optional[AccountStatus]](../../models/shared/accountstatus.md) | :heavy_minus_sign: | Status of the account | Active | +| `type` | [Optional[AccountType]](../../models/shared/accounttype.md) | :heavy_minus_sign: | Type of account | Asset | +| `valid_datatype_links` | list[[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](/accounting-api#/schemas/ValidDataTypeLinks). | | \ No newline at end of file diff --git a/sync-for-payables/docs/models/shared/accountingaddresstype.md b/sync-for-payables/docs/models/shared/accountingaddresstype.md new file mode 100755 index 000000000..ab6961bcd --- /dev/null +++ b/sync-for-payables/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/sync-for-payables/docs/models/shared/accountref.md b/sync-for-payables/docs/models/shared/accountref.md new file mode 100755 index 000000000..167b8047c --- /dev/null +++ b/sync-for-payables/docs/models/shared/accountref.md @@ -0,0 +1,11 @@ +# AccountRef + +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 + +| Field | Type | Required | Description | +| ----------------------------------- | ----------------------------------- | ----------------------------------- | ----------------------------------- | +| `id` | *Optional[str]* | :heavy_minus_sign: | 'id' from the Accounts data type. | +| `name` | *Optional[str]* | :heavy_minus_sign: | 'name' from the Accounts data type. | \ No newline at end of file diff --git a/sync-for-payables/docs/models/shared/accounts.md b/sync-for-payables/docs/models/shared/accounts.md new file mode 100755 index 000000000..b75102877 --- /dev/null +++ b/sync-for-payables/docs/models/shared/accounts.md @@ -0,0 +1,14 @@ +# Accounts + +Success + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------- | ----------------------------------------------- | ----------------------------------------------- | ----------------------------------------------- | +| `links` | [Links](../../models/shared/links.md) | :heavy_check_mark: | N/A | +| `page_number` | *int* | :heavy_check_mark: | N/A | +| `page_size` | *int* | :heavy_check_mark: | N/A | +| `results` | list[[Account](../../models/shared/account.md)] | :heavy_minus_sign: | N/A | +| `total_results` | *int* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/sync-for-payables/docs/models/shared/accountstatus.md b/sync-for-payables/docs/models/shared/accountstatus.md new file mode 100755 index 000000000..bd4cf2f26 --- /dev/null +++ b/sync-for-payables/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/sync-for-payables/docs/models/shared/accounttype.md b/sync-for-payables/docs/models/shared/accounttype.md new file mode 100755 index 000000000..f9c49f991 --- /dev/null +++ b/sync-for-payables/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/sync-for-payables/docs/models/shared/accountvaliddatatypelinks.md b/sync-for-payables/docs/models/shared/accountvaliddatatypelinks.md new file mode 100755 index 000000000..682687d7a --- /dev/null +++ b/sync-for-payables/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` | *Optional[str]* | :heavy_minus_sign: | The property from the account that can be linked. | \ No newline at end of file diff --git a/sync-for-payables/docs/models/shared/attachment.md b/sync-for-payables/docs/models/shared/attachment.md new file mode 100755 index 000000000..4c1b0de1c --- /dev/null +++ b/sync-for-payables/docs/models/shared/attachment.md @@ -0,0 +1,34 @@ +# 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 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 | + +View the coverage for accounts in the Data coverage explorer. + + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `content_type` | *Optional[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-23T00:00:00.000Z | +| `file_size` | *Optional[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 platform. | | +| `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 platform allows this. | | +| `modified_date` | *Optional[str]* | :heavy_minus_sign: | N/A | 2022-10-23T00:00:00.000Z | +| `name` | *Optional[str]* | :heavy_minus_sign: | Name of the attachment file. | | +| `source_modified_date` | *Optional[str]* | :heavy_minus_sign: | N/A | 2022-10-23T00:00:00.000Z | \ No newline at end of file diff --git a/sync-for-payables/docs/models/shared/attachments.md b/sync-for-payables/docs/models/shared/attachments.md new file mode 100755 index 000000000..6c2c43ec8 --- /dev/null +++ b/sync-for-payables/docs/models/shared/attachments.md @@ -0,0 +1,10 @@ +# Attachments + +Success + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | +| `attachments` | list[[Attachment](../../models/shared/attachment.md)] | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/sync-for-payables/docs/models/shared/bill.md b/sync-for-payables/docs/models/shared/bill.md new file mode 100755 index 000000000..c1efc5df8 --- /dev/null +++ b/sync-for-payables/docs/models/shared/bill.md @@ -0,0 +1,48 @@ +# Bill + +> **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/accounting-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 platforms 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/accounting-api#/schemas/DirectCost) data model. + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `amount_due` | *Optional[float]* | :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` | *Optional[float]* | :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 platform, it will be available from Codat with the same precision (up to a maximum of 9 decimal places).

For accounting platforms 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 \| | | +| `due_date` | *Optional[str]* | :heavy_minus_sign: | N/A | 2022-10-23T00:00:00.000Z | +| `id` | *Optional[str]* | :heavy_minus_sign: | Identifier for the bill, unique for the company in the accounting platform. | | +| `issue_date` | *str* | :heavy_check_mark: | N/A | 2022-10-23T00:00:00.000Z | +| `line_items` | list[[BillLineItem](../../models/shared/billlineitem.md)] | :heavy_minus_sign: | Array of Bill line items. | | +| `metadata` | [Optional[Metadata]](../../models/shared/metadata.md) | :heavy_minus_sign: | N/A | | +| `modified_date` | *Optional[str]* | :heavy_minus_sign: | N/A | 2022-10-23T00:00:00.000Z | +| `note` | *Optional[str]* | :heavy_minus_sign: | Any private, company notes about the bill, such as payment information. | | +| `payment_allocations` | list[[BillPaymentAllocation](../../models/shared/billpaymentallocation.md)] | :heavy_minus_sign: | An array of payment allocations. | | +| `purchase_order_refs` | list[[BillPurchaseOrderReference](../../models/shared/billpurchaseorderreference.md)] | :heavy_minus_sign: | N/A | | +| `reference` | *Optional[str]* | :heavy_minus_sign: | User-friendly reference for the bill. | | +| `source_modified_date` | *Optional[str]* | :heavy_minus_sign: | N/A | 2022-10-23T00:00:00.000Z | +| `status` | [BillStatus](../../models/shared/billstatus.md) | :heavy_check_mark: | Current state of the bill. | | +| `sub_total` | *float* | :heavy_check_mark: | Total amount of the bill, excluding any taxes. | | +| `supplemental_data` | [Optional[BillSupplementalData]](../../models/shared/billsupplementaldata.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 platform. [Learn more](https://docs.codat.io/using-the-api/additional-data) about supplemental data. | | +| `supplier_ref` | [Optional[SupplierRef]](../../models/shared/supplierref.md) | :heavy_minus_sign: | Reference to the supplier the record relates to. | | +| `tax_amount` | *float* | :heavy_check_mark: | Amount of tax on the bill. | | +| `total_amount` | *float* | :heavy_check_mark: | Amount of the bill, including tax. | | +| `withholding_tax` | list[[BillWithholdingTax](../../models/shared/billwithholdingtax.md)] | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/sync-for-payables/docs/models/shared/billcreditnote.md b/sync-for-payables/docs/models/shared/billcreditnote.md new file mode 100755 index 000000000..e07b1a8ff --- /dev/null +++ b/sync-for-payables/docs/models/shared/billcreditnote.md @@ -0,0 +1,46 @@ +# 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/accounting-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/accounting-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/accounting-api#/schemas/Bill). +* The supplier that issued the bill credit note. + + +## 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-23T00:00:00.000Z | +| `bill_credit_note_number` | *Optional[str]* | :heavy_minus_sign: | Friendly reference for the bill credit note. | 91fe2a83-e161-4c21-929d-c5c10c4b07e5 | +| `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` | *Optional[float]* | :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 platform, it will be available from Codat with the same precision (up to a maximum of 9 decimal places).

For accounting platforms 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 \| | | +| `discount_percentage` | *float* | :heavy_check_mark: | Percentage rate of any discount applied to the bill credit note. | 0 | +| `id` | *Optional[str]* | :heavy_minus_sign: | Identifier for the bill credit note that is unique to a company in the accounting platform. | 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-23T00:00:00.000Z | +| `line_items` | list[[BillCreditNoteLineItem](../../models/shared/billcreditnotelineitem.md)] | :heavy_minus_sign: | An array of line | | +| `metadata` | [Optional[Metadata]](../../models/shared/metadata.md) | :heavy_minus_sign: | N/A | | +| `modified_date` | *Optional[str]* | :heavy_minus_sign: | N/A | 2022-10-23T00:00:00.000Z | +| `note` | *Optional[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[[Items](../../models/shared/items.md)] | :heavy_minus_sign: | An array of payment allocations. | | +| `remaining_credit` | *Optional[float]* | :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-23T00:00:00.000Z | +| `status` | [BillCreditNoteStatus](../../models/shared/billcreditnotestatus.md) | :heavy_check_mark: | Current state of the bill credit note | Paid | +| `sub_total` | *float* | :heavy_check_mark: | Total amount of the bill credit note, including discounts but excluding tax. | 805.78 | +| `supplemental_data` | [Optional[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 platform. [Learn more](https://docs.codat.io/using-the-api/additional-data) about supplemental data. | | +| `supplier_ref` | [Optional[SupplierRef]](../../models/shared/supplierref.md) | :heavy_minus_sign: | Reference to the supplier the record relates to. | | +| `total_amount` | *float* | :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` | *float* | :heavy_check_mark: | Total value of any discounts applied. | 0 | +| `total_tax_amount` | *float* | :heavy_check_mark: | Amount of tax included in the bill credit note. | 0 | +| `withholding_tax` | list[[WithholdingTaxitems](../../models/shared/withholdingtaxitems.md)] | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/sync-for-payables/docs/models/shared/billcreditnotelineitem.md b/sync-for-payables/docs/models/shared/billcreditnotelineitem.md new file mode 100755 index 000000000..227c72b63 --- /dev/null +++ b/sync-for-payables/docs/models/shared/billcreditnotelineitem.md @@ -0,0 +1,20 @@ +# BillCreditNoteLineItem + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `account_ref` | [Optional[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` | *Optional[str]* | :heavy_minus_sign: | Friendly name of each line item. For example, the goods or service for which credit has been received. | +| `discount_amount` | *Optional[float]* | :heavy_minus_sign: | Value of any discounts applied. | +| `discount_percentage` | *Optional[float]* | :heavy_minus_sign: | Percentage rate of any discount applied to the line item. | +| `item_ref` | [Optional[BillCreditNoteLineItemItemReference]](../../models/shared/billcreditnotelineitemitemreference.md) | :heavy_minus_sign: | Reference to the item the line is linked to. | +| `quantity` | *float* | :heavy_check_mark: | Number of units of the goods or service for which credit has been received. | +| `sub_total` | *Optional[float]* | :heavy_minus_sign: | Amount of credit associated with the line item, including discounts but excluding tax. | +| `tax_amount` | *Optional[float]* | :heavy_minus_sign: | Amount of tax associated with the line item. | +| `tax_rate_ref` | [Optional[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` | *Optional[float]* | :heavy_minus_sign: | Total amount of the line item, including discounts and tax. | +| `tracking` | [Optional[BillCreditNoteLineItemTracking]](../../models/shared/billcreditnotelineitemtracking.md) | :heavy_minus_sign: | Categories, and a project and customer, against which the item is tracked. | +| ~~`tracking_category_refs`~~ | list[[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_amount` | *float* | :heavy_check_mark: | Unit price of the goods or service. | \ No newline at end of file diff --git a/sync-for-payables/docs/models/shared/billcreditnotelineitemitemreference.md b/sync-for-payables/docs/models/shared/billcreditnotelineitemitemreference.md new file mode 100755 index 000000000..aa9e225c3 --- /dev/null +++ b/sync-for-payables/docs/models/shared/billcreditnotelineitemitemreference.md @@ -0,0 +1,11 @@ +# BillCreditNoteLineItemItemReference + +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 platform. | +| `name` | *Optional[str]* | :heavy_minus_sign: | Name of the item in the accounting platform. | \ No newline at end of file diff --git a/sync-for-payables/docs/models/shared/billcreditnotelineitemtracking.md b/sync-for-payables/docs/models/shared/billcreditnotelineitemtracking.md new file mode 100755 index 000000000..68d244a98 --- /dev/null +++ b/sync-for-payables/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[[TrackingCategoryRef](../../models/shared/trackingcategoryref.md)] | :heavy_check_mark: | N/A | +| `customer_ref` | [Optional[BillCreditNoteLineItemTrackingCustomerRef]](../../models/shared/billcreditnotelineitemtrackingcustomerref.md) | :heavy_minus_sign: | N/A | +| `is_billed_to` | [BilledToType](../../models/shared/billedtotype.md) | :heavy_check_mark: | N/A | +| `is_rebilled_to` | [BilledToType](../../models/shared/billedtotype.md) | :heavy_check_mark: | N/A | +| `project_ref` | [Optional[BillCreditNoteLineItemTrackingProjectRef]](../../models/shared/billcreditnotelineitemtrackingprojectref.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/sync-for-payables/docs/models/shared/billcreditnotelineitemtrackingcustomerref.md b/sync-for-payables/docs/models/shared/billcreditnotelineitemtrackingcustomerref.md new file mode 100755 index 000000000..1b4257445 --- /dev/null +++ b/sync-for-payables/docs/models/shared/billcreditnotelineitemtrackingcustomerref.md @@ -0,0 +1,9 @@ +# BillCreditNoteLineItemTrackingCustomerRef + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------ | ------------------------------------------ | ------------------------------------------ | ------------------------------------------ | +| `company_name` | *Optional[str]* | :heavy_minus_sign: | `customerName` from the Customer data type | +| `id` | *str* | :heavy_check_mark: | `id` from the Customers data type | \ No newline at end of file diff --git a/sync-for-payables/docs/models/shared/billcreditnotelineitemtrackingprojectref.md b/sync-for-payables/docs/models/shared/billcreditnotelineitemtrackingprojectref.md new file mode 100755 index 000000000..922aa48ff --- /dev/null +++ b/sync-for-payables/docs/models/shared/billcreditnotelineitemtrackingprojectref.md @@ -0,0 +1,9 @@ +# BillCreditNoteLineItemTrackingProjectRef + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `id` | *str* | :heavy_check_mark: | N/A | +| `name` | *Optional[str]* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/sync-for-payables/docs/models/shared/billcreditnotes.md b/sync-for-payables/docs/models/shared/billcreditnotes.md new file mode 100755 index 000000000..5f5476a5c --- /dev/null +++ b/sync-for-payables/docs/models/shared/billcreditnotes.md @@ -0,0 +1,14 @@ +# BillCreditNotes + +Success + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------- | ------------------------------------------------------------- | ------------------------------------------------------------- | ------------------------------------------------------------- | +| `links` | [Links](../../models/shared/links.md) | :heavy_check_mark: | N/A | +| `page_number` | *int* | :heavy_check_mark: | N/A | +| `page_size` | *int* | :heavy_check_mark: | N/A | +| `results` | list[[BillCreditNote](../../models/shared/billcreditnote.md)] | :heavy_minus_sign: | N/A | +| `total_results` | *int* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/sync-for-payables/docs/models/shared/billcreditnotestatus.md b/sync-for-payables/docs/models/shared/billcreditnotestatus.md new file mode 100755 index 000000000..d741e549d --- /dev/null +++ b/sync-for-payables/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/sync-for-payables/docs/models/shared/billedtotype.md b/sync-for-payables/docs/models/shared/billedtotype.md new file mode 100755 index 000000000..3b49db591 --- /dev/null +++ b/sync-for-payables/docs/models/shared/billedtotype.md @@ -0,0 +1,11 @@ +# BilledToType + + +## Values + +| Name | Value | +| ---------------- | ---------------- | +| `UNKNOWN` | Unknown | +| `NOT_APPLICABLE` | NotApplicable | +| `CUSTOMER` | Customer | +| `PROJECT` | Project | \ No newline at end of file diff --git a/sync-for-payables/docs/models/shared/billlineitem.md b/sync-for-payables/docs/models/shared/billlineitem.md new file mode 100755 index 000000000..c349a269c --- /dev/null +++ b/sync-for-payables/docs/models/shared/billlineitem.md @@ -0,0 +1,21 @@ +# BillLineItem + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `account_ref` | [Optional[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` | *Optional[str]* | :heavy_minus_sign: | Friendly name of the goods or services received. | +| `discount_amount` | *Optional[float]* | :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` | *Optional[float]* | :heavy_minus_sign: | N/A | +| `is_direct_cost` | *Optional[bool]* | :heavy_minus_sign: | N/A | +| `item_ref` | [Optional[ItemRef]](../../models/shared/itemref.md) | :heavy_minus_sign: | Reference to the item the line is linked to. | +| `quantity` | *float* | :heavy_check_mark: | Number of units of goods or services received. | +| `sub_total` | *Optional[float]* | :heavy_minus_sign: | Amount of the line, inclusive of discounts but exclusive of tax. | +| `tax_amount` | *Optional[float]* | :heavy_minus_sign: | Amount of tax for the line. | +| `tax_rate_ref` | [Optional[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` | *Optional[float]* | :heavy_minus_sign: | Total amount of the line, including tax. | +| `tracking` | [Optional[Tracking]](../../models/shared/tracking.md) | :heavy_minus_sign: | Categories, and a project and customer, against which the item is tracked. | +| `tracking_category_refs` | list[[TrackingCategoryRef](../../models/shared/trackingcategoryref.md)] | :heavy_minus_sign: | Collection of categories against which this item is tracked. | +| `unit_amount` | *float* | :heavy_check_mark: | Price of each unit of goods or services. | \ No newline at end of file diff --git a/sync-for-payables/docs/models/shared/billpayment.md b/sync-for-payables/docs/models/shared/billpayment.md new file mode 100755 index 000000000..b68054e92 --- /dev/null +++ b/sync-for-payables/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/accounting-api#/schemas/Payment) for the accounts receivable equivalent of Bill payments, which covers [invoices](https://docs.codat.io/accounting-api#/schemas/Invoice) and [credit notes](https://docs.codat.io/accounting-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/accounting-api#/schemas/Bill) and [credit notes against bills](https://docs.codat.io/accounting-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 package, 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 platforms 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/accounting-api#/schemas/DirectCost) data model. + +Bill payments is a child data type of [account transactions](https://docs.codat.io/accounting-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 packages 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 | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `account_ref` | [Optional[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` | *Optional[float]* | :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 platform, it will be available from Codat with the same precision (up to a maximum of 9 decimal places).

For accounting platforms 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 \| | | +| `date_` | *str* | :heavy_check_mark: | N/A | 2022-10-23T00:00:00.000Z | +| `id` | *Optional[str]* | :heavy_minus_sign: | Identifier for the bill payment, unique for the company in the accounting platform. | 3d5a8e00-d108-4045-8823-7f342676cffa | +| `lines` | list[[BillPaymentLine](../../models/shared/billpaymentline.md)] | :heavy_minus_sign: | An array of bill payment lines. | | +| `metadata` | [Optional[Metadata]](../../models/shared/metadata.md) | :heavy_minus_sign: | N/A | | +| `modified_date` | *Optional[str]* | :heavy_minus_sign: | N/A | 2022-10-23T00:00:00.000Z | +| `note` | *Optional[str]* | :heavy_minus_sign: | Additional information associated with the payment. | Bill Payment against bill c13e37b6-dfaa-4894-b3be-9fe97bda9f44 | +| `payment_method_ref` | *Optional[Any]* | :heavy_minus_sign: | N/A | | +| `reference` | *Optional[str]* | :heavy_minus_sign: | Additional information associated with the payment. | | +| `source_modified_date` | *Optional[str]* | :heavy_minus_sign: | N/A | 2022-10-23T00:00:00.000Z | +| `supplemental_data` | [Optional[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 platform. [Learn more](https://docs.codat.io/using-the-api/additional-data) about supplemental data. | | +| `supplier_ref` | [Optional[SupplierRef]](../../models/shared/supplierref.md) | :heavy_minus_sign: | N/A | | +| `total_amount` | *Optional[float]* | :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/sync-for-payables/docs/models/shared/billpaymentallocation.md b/sync-for-payables/docs/models/shared/billpaymentallocation.md new file mode 100755 index 000000000..7d45ae096 --- /dev/null +++ b/sync-for-payables/docs/models/shared/billpaymentallocation.md @@ -0,0 +1,9 @@ +# BillPaymentAllocation + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | +| `allocation` | [BillPaymentAllocationAllocation](../../models/shared/billpaymentallocationallocation.md) | :heavy_check_mark: | N/A | +| `payment` | [PaymentAllocationPayment](../../models/shared/paymentallocationpayment.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/sync-for-payables/docs/models/shared/billpaymentallocationallocation.md b/sync-for-payables/docs/models/shared/billpaymentallocationallocation.md new file mode 100755 index 000000000..8dcf326ba --- /dev/null +++ b/sync-for-payables/docs/models/shared/billpaymentallocationallocation.md @@ -0,0 +1,11 @@ +# BillPaymentAllocationAllocation + + +## 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-23T00:00:00.000Z | +| `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` | *Optional[float]* | :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 platform, it will be available from Codat with the same precision (up to a maximum of 9 decimal places).

For accounting platforms 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 \| | | +| `total_amount` | *Optional[float]* | :heavy_minus_sign: | The total amount that has been allocated. | | \ No newline at end of file diff --git a/sync-for-payables/docs/models/shared/billpaymentline.md b/sync-for-payables/docs/models/shared/billpaymentline.md new file mode 100755 index 000000000..7548a4682 --- /dev/null +++ b/sync-for-payables/docs/models/shared/billpaymentline.md @@ -0,0 +1,10 @@ +# BillPaymentLine + + +## 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-23T00:00:00.000Z | +| `amount` | *float* | :heavy_check_mark: | Amount in the bill payment currency. | | +| `links` | list[[BillPaymentLineLink](../../models/shared/billpaymentlinelink.md)] | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/sync-for-payables/docs/models/shared/billpaymentlinelink.md b/sync-for-payables/docs/models/shared/billpaymentlinelink.md new file mode 100755 index 000000000..2e91fbc78 --- /dev/null +++ b/sync-for-payables/docs/models/shared/billpaymentlinelink.md @@ -0,0 +1,11 @@ +# BillPaymentLineLink + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `amount` | *Optional[float]* | :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` | *Optional[float]* | :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 platform, it will be available from Codat with the same precision (up to a maximum of 9 decimal places).

For accounting platforms 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 \| | +| `id` | *Optional[str]* | :heavy_minus_sign: | Unique identifier of the transaction represented by the link. | +| `type` | [BillPaymentLineLinkType](../../models/shared/billpaymentlinelinktype.md) | :heavy_check_mark: | Types of links to bill payment lines. | \ No newline at end of file diff --git a/sync-for-payables/docs/models/shared/billpaymentlinelinktype.md b/sync-for-payables/docs/models/shared/billpaymentlinelinktype.md new file mode 100755 index 000000000..2f099d0a9 --- /dev/null +++ b/sync-for-payables/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/sync-for-payables/docs/models/shared/billpayments.md b/sync-for-payables/docs/models/shared/billpayments.md new file mode 100755 index 000000000..18b2cc4b9 --- /dev/null +++ b/sync-for-payables/docs/models/shared/billpayments.md @@ -0,0 +1,14 @@ +# BillPayments + +Success + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | +| `links` | [Links](../../models/shared/links.md) | :heavy_check_mark: | N/A | +| `page_number` | *int* | :heavy_check_mark: | N/A | +| `page_size` | *int* | :heavy_check_mark: | N/A | +| `results` | list[[BillPayment](../../models/shared/billpayment.md)] | :heavy_minus_sign: | N/A | +| `total_results` | *int* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/sync-for-payables/docs/models/shared/billpurchaseorderreference.md b/sync-for-payables/docs/models/shared/billpurchaseorderreference.md new file mode 100755 index 000000000..0a79f98c9 --- /dev/null +++ b/sync-for-payables/docs/models/shared/billpurchaseorderreference.md @@ -0,0 +1,9 @@ +# BillPurchaseOrderReference + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | +| `id` | *Optional[str]* | :heavy_minus_sign: | Identifier for the purchase order, unique for the company in the accounting platform. | +| `purchase_order_number` | *Optional[str]* | :heavy_minus_sign: | Friendly reference for the purchase order, commonly generated by the accounting platform. | \ No newline at end of file diff --git a/sync-for-payables/docs/models/shared/bills.md b/sync-for-payables/docs/models/shared/bills.md new file mode 100755 index 000000000..4e633e5b6 --- /dev/null +++ b/sync-for-payables/docs/models/shared/bills.md @@ -0,0 +1,14 @@ +# Bills + +Success + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------- | ----------------------------------------- | ----------------------------------------- | ----------------------------------------- | +| `links` | [Links](../../models/shared/links.md) | :heavy_check_mark: | N/A | +| `page_number` | *int* | :heavy_check_mark: | N/A | +| `page_size` | *int* | :heavy_check_mark: | N/A | +| `results` | list[[Bill](../../models/shared/bill.md)] | :heavy_minus_sign: | N/A | +| `total_results` | *int* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/sync-for-payables/docs/models/shared/billstatus.md b/sync-for-payables/docs/models/shared/billstatus.md new file mode 100755 index 000000000..ca6f368d6 --- /dev/null +++ b/sync-for-payables/docs/models/shared/billstatus.md @@ -0,0 +1,15 @@ +# BillStatus + +Current state of the bill. + + +## Values + +| Name | Value | +| ---------------- | ---------------- | +| `UNKNOWN` | Unknown | +| `OPEN` | Open | +| `PARTIALLY_PAID` | PartiallyPaid | +| `PAID` | Paid | +| `VOID` | Void | +| `DRAFT` | Draft | \ No newline at end of file diff --git a/sync-for-payables/docs/models/shared/billsupplementaldata.md b/sync-for-payables/docs/models/shared/billsupplementaldata.md new file mode 100755 index 000000000..736ce1cda --- /dev/null +++ b/sync-for-payables/docs/models/shared/billsupplementaldata.md @@ -0,0 +1,12 @@ +# BillSupplementalData + +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 platform. [Learn more](https://docs.codat.io/using-the-api/additional-data) 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/sync-for-payables/docs/models/shared/billwithholdingtax.md b/sync-for-payables/docs/models/shared/billwithholdingtax.md new file mode 100755 index 000000000..a2b842658 --- /dev/null +++ b/sync-for-payables/docs/models/shared/billwithholdingtax.md @@ -0,0 +1,9 @@ +# BillWithholdingTax + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `amount` | *float* | :heavy_check_mark: | N/A | +| `name` | *str* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/sync-for-payables/docs/models/shared/companies.md b/sync-for-payables/docs/models/shared/companies.md new file mode 100755 index 000000000..621899fbb --- /dev/null +++ b/sync-for-payables/docs/models/shared/companies.md @@ -0,0 +1,14 @@ +# Companies + +OK + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------- | ----------------------------------------------- | ----------------------------------------------- | ----------------------------------------------- | +| `links` | [Links](../../models/shared/links.md) | :heavy_check_mark: | N/A | +| `page_number` | *int* | :heavy_check_mark: | N/A | +| `page_size` | *int* | :heavy_check_mark: | N/A | +| `results` | list[[Company](../../models/shared/company.md)] | :heavy_minus_sign: | N/A | +| `total_results` | *int* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/sync-for-payables/docs/models/shared/company.md b/sync-for-payables/docs/models/shared/company.md new file mode 100755 index 000000000..b510ea5dd --- /dev/null +++ b/sync-for-payables/docs/models/shared/company.md @@ -0,0 +1,22 @@ +# Company + +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. + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `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-23T00:00:00.000Z | +| `created_by_user_name` | *Optional[str]* | :heavy_minus_sign: | N/A | | +| `data_connections` | list[[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. | +| `id` | *str* | :heavy_check_mark: | Unique identifier for your SMB in Codat. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `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-23T00:00:00.000Z | +| `name` | *str* | :heavy_check_mark: | The name of the company | Codat Ltd. | +| ~~`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. | Xero | +| `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 | \ No newline at end of file diff --git a/sync-for-payables/docs/models/shared/companyrequestbody.md b/sync-for-payables/docs/models/shared/companyrequestbody.md new file mode 100755 index 000000000..339e136ce --- /dev/null +++ b/sync-for-payables/docs/models/shared/companyrequestbody.md @@ -0,0 +1,9 @@ +# CompanyRequestBody + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | +| `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. | +| `name` | *str* | :heavy_check_mark: | Name of company being connected. | Bank of Dave | \ No newline at end of file diff --git a/sync-for-payables/docs/models/shared/connection.md b/sync-for-payables/docs/models/shared/connection.md new file mode 100755 index 000000000..ebee43853 --- /dev/null +++ b/sync-for-payables/docs/models/shared/connection.md @@ -0,0 +1,31 @@ +# Connection + +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). + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `additional_properties` | *Optional[Any]* | :heavy_minus_sign: | N/A | | +| `connection_info` | dict[str, *str*] | :heavy_minus_sign: | N/A | | +| `created` | *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-23T00:00:00.000Z | +| `data_connection_errors` | list[[DataConnectionError](../../models/shared/dataconnectionerror.md)] | :heavy_minus_sign: | N/A | | +| `id` | *str* | :heavy_check_mark: | Unique identifier for a company's data connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | +| `integration_id` | *str* | :heavy_check_mark: | A Codat ID representing the integration. | fd321cb6-7963-4506-b873-e99593a45e30 | +| `integration_key` | *str* | :heavy_check_mark: | 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. | | +| `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-23T00:00:00.000Z | +| `link_url` | *str* | :heavy_check_mark: | N/A | https://link-api.codat.io/companies/86bd88cb-44ab-4dfb-b32f-87b19b14287f/connections/2e2eb431-c1fa-4dc9-93fa-d29781c12bcd/start | +| `platform_name` | *str* | :heavy_check_mark: | N/A | | +| `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` | [ConnectionSourceType](../../models/shared/connectionsourcetype.md) | :heavy_check_mark: | The type of platform of the connection. | Accounting | +| `status` | [DataConnectionStatus](../../models/shared/dataconnectionstatus.md) | :heavy_check_mark: | The current authorization status of the data connection. | | \ No newline at end of file diff --git a/sync-for-payables/docs/models/shared/connections.md b/sync-for-payables/docs/models/shared/connections.md new file mode 100755 index 000000000..ba1135508 --- /dev/null +++ b/sync-for-payables/docs/models/shared/connections.md @@ -0,0 +1,14 @@ +# Connections + +OK + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | +| `links` | [Links](../../models/shared/links.md) | :heavy_check_mark: | N/A | +| `page_number` | *int* | :heavy_check_mark: | N/A | +| `page_size` | *int* | :heavy_check_mark: | N/A | +| `results` | list[[Connection](../../models/shared/connection.md)] | :heavy_minus_sign: | N/A | +| `total_results` | *int* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/sync-for-payables/docs/models/shared/connectionsourcetype.md b/sync-for-payables/docs/models/shared/connectionsourcetype.md new file mode 100755 index 000000000..85e691690 --- /dev/null +++ b/sync-for-payables/docs/models/shared/connectionsourcetype.md @@ -0,0 +1,14 @@ +# ConnectionSourceType + +The type of platform of the connection. + + +## Values + +| Name | Value | +| ------------ | ------------ | +| `ACCOUNTING` | Accounting | +| `BANKING` | Banking | +| `COMMERCE` | Commerce | +| `OTHER` | Other | +| `UNKNOWN` | Unknown | \ No newline at end of file diff --git a/sync-for-payables/docs/models/shared/createaccountresponse.md b/sync-for-payables/docs/models/shared/createaccountresponse.md new file mode 100755 index 000000000..5c85a35eb --- /dev/null +++ b/sync-for-payables/docs/models/shared/createaccountresponse.md @@ -0,0 +1,23 @@ +# CreateAccountResponse + +Success + + +## Fields + +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `changes` | list[[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. | | +| `company_id` | *str* | :heavy_check_mark: | Unique identifier for your SMB in Codat. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `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-23T00:00:00.000Z | +| `data` | [Optional[Account]](../../models/shared/account.md) | :heavy_minus_sign: | > **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/accounting-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. | | +| `data_connection_key` | *str* | :heavy_check_mark: | Unique identifier for a company's data connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | +| `data_type` | [Optional[DataType]](../../models/shared/datatype.md) | :heavy_minus_sign: | Available Data types | invoices | +| `error_message` | *Optional[str]* | :heavy_minus_sign: | N/A | | +| `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-23T00:00:00.000Z | +| `status` | [PushOperationStatus](../../models/shared/pushoperationstatus.md) | :heavy_check_mark: | The status of the push operation. | | +| `status_code` | *int* | :heavy_check_mark: | N/A | | +| `timeout_in_minutes` | *Optional[int]* | :heavy_minus_sign: | N/A | | +| ~~`timeout_in_seconds`~~ | *Optional[int]* | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible. | | +| `validation` | [Optional[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/sync-for-payables/docs/models/shared/createbillcreditnoteresponse.md b/sync-for-payables/docs/models/shared/createbillcreditnoteresponse.md new file mode 100755 index 000000000..9dc752f3a --- /dev/null +++ b/sync-for-payables/docs/models/shared/createbillcreditnoteresponse.md @@ -0,0 +1,23 @@ +# CreateBillCreditNoteResponse + +Success + + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `changes` | list[[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. | | +| `company_id` | *str* | :heavy_check_mark: | Unique identifier for your SMB in Codat. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `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-23T00:00:00.000Z | +| `data` | [Optional[BillCreditNote]](../../models/shared/billcreditnote.md) | :heavy_minus_sign: | > **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/accounting-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/accounting-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/accounting-api#/schemas/Bill).
* The supplier that issued the bill credit note. | | +| `data_connection_key` | *str* | :heavy_check_mark: | Unique identifier for a company's data connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | +| `data_type` | [Optional[DataType]](../../models/shared/datatype.md) | :heavy_minus_sign: | Available Data types | invoices | +| `error_message` | *Optional[str]* | :heavy_minus_sign: | N/A | | +| `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-23T00:00:00.000Z | +| `status` | [PushOperationStatus](../../models/shared/pushoperationstatus.md) | :heavy_check_mark: | The status of the push operation. | | +| `status_code` | *int* | :heavy_check_mark: | N/A | | +| `timeout_in_minutes` | *Optional[int]* | :heavy_minus_sign: | N/A | | +| ~~`timeout_in_seconds`~~ | *Optional[int]* | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible. | | +| `validation` | [Optional[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/sync-for-payables/docs/models/shared/createbillpaymentresponse.md b/sync-for-payables/docs/models/shared/createbillpaymentresponse.md new file mode 100755 index 000000000..d94d98165 --- /dev/null +++ b/sync-for-payables/docs/models/shared/createbillpaymentresponse.md @@ -0,0 +1,23 @@ +# CreateBillPaymentResponse + +Success + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `changes` | list[[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. | | +| `company_id` | *str* | :heavy_check_mark: | Unique identifier for your SMB in Codat. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `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-23T00:00:00.000Z | +| `data` | [Optional[BillPayment]](../../models/shared/billpayment.md) | :heavy_minus_sign: | > **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/accounting-api#/schemas/Payment) for the accounts receivable equivalent of Bill payments, which covers [invoices](https://docs.codat.io/accounting-api#/schemas/Invoice) and [credit notes](https://docs.codat.io/accounting-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/accounting-api#/schemas/Bill) and [credit notes against bills](https://docs.codat.io/accounting-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 package, 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 platforms 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/accounting-api#/schemas/DirectCost) data model.

Bill payments is a child data type of [account transactions](https://docs.codat.io/accounting-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 packages 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.
| | +| `data_connection_key` | *str* | :heavy_check_mark: | Unique identifier for a company's data connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | +| `data_type` | [Optional[DataType]](../../models/shared/datatype.md) | :heavy_minus_sign: | Available Data types | invoices | +| `error_message` | *Optional[str]* | :heavy_minus_sign: | N/A | | +| `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-23T00:00:00.000Z | +| `status` | [PushOperationStatus](../../models/shared/pushoperationstatus.md) | :heavy_check_mark: | The status of the push operation. | | +| `status_code` | *int* | :heavy_check_mark: | N/A | | +| `timeout_in_minutes` | *Optional[int]* | :heavy_minus_sign: | N/A | | +| ~~`timeout_in_seconds`~~ | *Optional[int]* | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible. | | +| `validation` | [Optional[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/sync-for-payables/docs/models/shared/createbillresponse.md b/sync-for-payables/docs/models/shared/createbillresponse.md new file mode 100755 index 000000000..4784edb7b --- /dev/null +++ b/sync-for-payables/docs/models/shared/createbillresponse.md @@ -0,0 +1,23 @@ +# CreateBillResponse + +Success + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `changes` | list[[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. | | +| `company_id` | *str* | :heavy_check_mark: | Unique identifier for your SMB in Codat. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `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-23T00:00:00.000Z | +| `data` | [Optional[Bill]](../../models/shared/bill.md) | :heavy_minus_sign: | > **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/accounting-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 platforms 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/accounting-api#/schemas/DirectCost) data model. | | +| `data_connection_key` | *str* | :heavy_check_mark: | Unique identifier for a company's data connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | +| `data_type` | [Optional[DataType]](../../models/shared/datatype.md) | :heavy_minus_sign: | Available Data types | invoices | +| `error_message` | *Optional[str]* | :heavy_minus_sign: | N/A | | +| `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-23T00:00:00.000Z | +| `status` | [PushOperationStatus](../../models/shared/pushoperationstatus.md) | :heavy_check_mark: | The status of the push operation. | | +| `status_code` | *int* | :heavy_check_mark: | N/A | | +| `timeout_in_minutes` | *Optional[int]* | :heavy_minus_sign: | N/A | | +| ~~`timeout_in_seconds`~~ | *Optional[int]* | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible. | | +| `validation` | [Optional[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/sync-for-payables/docs/models/shared/createjournalentryresponse.md b/sync-for-payables/docs/models/shared/createjournalentryresponse.md new file mode 100755 index 000000000..0f460fa78 --- /dev/null +++ b/sync-for-payables/docs/models/shared/createjournalentryresponse.md @@ -0,0 +1,23 @@ +# CreateJournalEntryResponse + +Success + + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `changes` | list[[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. | | +| `company_id` | *str* | :heavy_check_mark: | Unique identifier for your SMB in Codat. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `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-23T00:00:00.000Z | +| `data` | [Optional[JournalEntry]](../../models/shared/journalentry.md) | :heavy_minus_sign: | > **Language tip:** For the top-level record of a company's financial transactions, refer to the [Journals](https://docs.codat.io/accounting-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/accounting-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. | | +| `data_connection_key` | *str* | :heavy_check_mark: | Unique identifier for a company's data connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | +| `data_type` | [Optional[DataType]](../../models/shared/datatype.md) | :heavy_minus_sign: | Available Data types | invoices | +| `error_message` | *Optional[str]* | :heavy_minus_sign: | N/A | | +| `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-23T00:00:00.000Z | +| `status` | [PushOperationStatus](../../models/shared/pushoperationstatus.md) | :heavy_check_mark: | The status of the push operation. | | +| `status_code` | *int* | :heavy_check_mark: | N/A | | +| `timeout_in_minutes` | *Optional[int]* | :heavy_minus_sign: | N/A | | +| ~~`timeout_in_seconds`~~ | *Optional[int]* | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible. | | +| `validation` | [Optional[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/sync-for-payables/docs/models/shared/createjournalresponse.md b/sync-for-payables/docs/models/shared/createjournalresponse.md new file mode 100755 index 000000000..aef3a0122 --- /dev/null +++ b/sync-for-payables/docs/models/shared/createjournalresponse.md @@ -0,0 +1,23 @@ +# CreateJournalResponse + +Success + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `changes` | list[[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. | | +| `company_id` | *str* | :heavy_check_mark: | Unique identifier for your SMB in Codat. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `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-23T00:00:00.000Z | +| `data` | [Optional[Journal]](../../models/shared/journal.md) | :heavy_minus_sign: | > **Language tip:** For line items, or individual transactions, of a company's financial documents, refer to the [Journal entries](https://docs.codat.io/accounting-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/accounting-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 platform 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.
| | +| `data_connection_key` | *str* | :heavy_check_mark: | Unique identifier for a company's data connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | +| `data_type` | [Optional[DataType]](../../models/shared/datatype.md) | :heavy_minus_sign: | Available Data types | invoices | +| `error_message` | *Optional[str]* | :heavy_minus_sign: | N/A | | +| `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-23T00:00:00.000Z | +| `status` | [PushOperationStatus](../../models/shared/pushoperationstatus.md) | :heavy_check_mark: | The status of the push operation. | | +| `status_code` | *int* | :heavy_check_mark: | N/A | | +| `timeout_in_minutes` | *Optional[int]* | :heavy_minus_sign: | N/A | | +| ~~`timeout_in_seconds`~~ | *Optional[int]* | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible. | | +| `validation` | [Optional[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/sync-for-payables/docs/models/shared/createsupplierresponse.md b/sync-for-payables/docs/models/shared/createsupplierresponse.md new file mode 100755 index 000000000..74317f15f --- /dev/null +++ b/sync-for-payables/docs/models/shared/createsupplierresponse.md @@ -0,0 +1,23 @@ +# CreateSupplierResponse + +Success + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `changes` | list[[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. | | +| `company_id` | *str* | :heavy_check_mark: | Unique identifier for your SMB in Codat. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `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-23T00:00:00.000Z | +| `data` | [Optional[Supplier]](../../models/shared/supplier.md) | :heavy_minus_sign: | > 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/accounting-api#/operations/list-suppliers). Suppliers' data links to accounts payable [bills](https://docs.codat.io/accounting-api#/schemas/Bill). | | +| `data_connection_key` | *str* | :heavy_check_mark: | Unique identifier for a company's data connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | +| `data_type` | [Optional[DataType]](../../models/shared/datatype.md) | :heavy_minus_sign: | Available Data types | invoices | +| `error_message` | *Optional[str]* | :heavy_minus_sign: | N/A | | +| `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-23T00:00:00.000Z | +| `status` | [PushOperationStatus](../../models/shared/pushoperationstatus.md) | :heavy_check_mark: | The status of the push operation. | | +| `status_code` | *int* | :heavy_check_mark: | N/A | | +| `timeout_in_minutes` | *Optional[int]* | :heavy_minus_sign: | N/A | | +| ~~`timeout_in_seconds`~~ | *Optional[int]* | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible. | | +| `validation` | [Optional[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/sync-for-payables/docs/models/shared/dataconnectionerror.md b/sync-for-payables/docs/models/shared/dataconnectionerror.md new file mode 100755 index 000000000..6c85722e1 --- /dev/null +++ b/sync-for-payables/docs/models/shared/dataconnectionerror.md @@ -0,0 +1,11 @@ +# DataConnectionError + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `error_message` | *Optional[str]* | :heavy_minus_sign: | N/A | | +| `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-23T00:00:00.000Z | +| `status_code` | *Optional[str]* | :heavy_minus_sign: | N/A | | +| `status_text` | *Optional[str]* | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/sync-for-payables/docs/models/shared/dataconnectionstatus.md b/sync-for-payables/docs/models/shared/dataconnectionstatus.md new file mode 100755 index 000000000..4e79f5d5a --- /dev/null +++ b/sync-for-payables/docs/models/shared/dataconnectionstatus.md @@ -0,0 +1,13 @@ +# DataConnectionStatus + +The current authorization status of the data connection. + + +## Values + +| Name | Value | +| -------------- | -------------- | +| `PENDING_AUTH` | PendingAuth | +| `LINKED` | Linked | +| `UNLINKED` | Unlinked | +| `DEAUTHORIZED` | Deauthorized | \ No newline at end of file diff --git a/sync-for-payables/docs/models/shared/datastatus.md b/sync-for-payables/docs/models/shared/datastatus.md new file mode 100755 index 000000000..389c2cf54 --- /dev/null +++ b/sync-for-payables/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` | *str* | :heavy_check_mark: | N/A | | +| `data_type` | *str* | :heavy_check_mark: | N/A | | +| `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-23T00:00:00.000Z | +| `latest_successful_sync_id` | *Optional[str]* | :heavy_minus_sign: | N/A | 8220fc90-55b6-47bc-9417-48ac6ea93101 | +| `latest_sync_id` | *Optional[str]* | :heavy_minus_sign: | N/A | ad474a37-2003-478e-baee-9af9f1ec2fe3 | \ No newline at end of file diff --git a/sync-for-payables/docs/models/shared/datatype.md b/sync-for-payables/docs/models/shared/datatype.md new file mode 100755 index 000000000..0e358dc70 --- /dev/null +++ b/sync-for-payables/docs/models/shared/datatype.md @@ -0,0 +1,51 @@ +# 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 | +| `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/sync-for-payables/docs/models/shared/errormessage.md b/sync-for-payables/docs/models/shared/errormessage.md new file mode 100755 index 000000000..b32400646 --- /dev/null +++ b/sync-for-payables/docs/models/shared/errormessage.md @@ -0,0 +1,15 @@ +# ErrorMessage + +Your `query` parameter was not correctly formed + + +## Fields + +| Field | Type | Required | Description | +| --------------------- | --------------------- | --------------------- | --------------------- | +| `can_be_retried` | *Optional[str]* | :heavy_minus_sign: | N/A | +| `correlation_id` | *Optional[str]* | :heavy_minus_sign: | N/A | +| `detailed_error_code` | *Optional[int]* | :heavy_minus_sign: | N/A | +| `error` | *Optional[str]* | :heavy_minus_sign: | N/A | +| `service` | *Optional[str]* | :heavy_minus_sign: | N/A | +| `status_code` | *Optional[int]* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/sync-for-payables/docs/models/shared/halref.md b/sync-for-payables/docs/models/shared/halref.md new file mode 100755 index 000000000..fef2ab2fc --- /dev/null +++ b/sync-for-payables/docs/models/shared/halref.md @@ -0,0 +1,8 @@ +# HalRef + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `href` | *Optional[str]* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/sync-for-payables/docs/models/shared/itemref.md b/sync-for-payables/docs/models/shared/itemref.md new file mode 100755 index 000000000..29f0e145d --- /dev/null +++ b/sync-for-payables/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 platform. | +| `name` | *Optional[str]* | :heavy_minus_sign: | Name of the item in the accounting platform. | \ No newline at end of file diff --git a/sync-for-payables/docs/models/shared/items.md b/sync-for-payables/docs/models/shared/items.md new file mode 100755 index 000000000..1e8d29332 --- /dev/null +++ b/sync-for-payables/docs/models/shared/items.md @@ -0,0 +1,9 @@ +# Items + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | +| `allocation` | [ItemsAllocation](../../models/shared/itemsallocation.md) | :heavy_check_mark: | N/A | +| `payment` | [PaymentAllocationPayment](../../models/shared/paymentallocationpayment.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/sync-for-payables/docs/models/shared/itemsallocation.md b/sync-for-payables/docs/models/shared/itemsallocation.md new file mode 100755 index 000000000..1678c4912 --- /dev/null +++ b/sync-for-payables/docs/models/shared/itemsallocation.md @@ -0,0 +1,11 @@ +# ItemsAllocation + + +## 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-23T00:00:00.000Z | +| `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` | *Optional[float]* | :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 platform, it will be available from Codat with the same precision (up to a maximum of 9 decimal places).

For accounting platforms 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 \| | | +| `total_amount` | *Optional[float]* | :heavy_minus_sign: | The total amount that has been allocated. | | \ No newline at end of file diff --git a/sync-for-payables/docs/models/shared/journal.md b/sync-for-payables/docs/models/shared/journal.md new file mode 100755 index 000000000..5c2fada8e --- /dev/null +++ b/sync-for-payables/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/accounting-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/accounting-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 platform 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-23T00:00:00.000Z | +| `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` | *Optional[str]* | :heavy_minus_sign: | Native journal number or code. | | +| `metadata` | [Optional[Metadata]](../../models/shared/metadata.md) | :heavy_minus_sign: | N/A | | +| `modified_date` | *Optional[str]* | :heavy_minus_sign: | N/A | 2022-10-23T00:00:00.000Z | +| `name` | *Optional[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` | *Optional[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-23T00:00:00.000Z | +| `status` | [Optional[JournalStatus]](../../models/shared/journalstatus.md) | :heavy_minus_sign: | Current journal status. | | +| `type` | *Optional[str]* | :heavy_minus_sign: | The type of the journal. | | \ No newline at end of file diff --git a/sync-for-payables/docs/models/shared/journalentry.md b/sync-for-payables/docs/models/shared/journalentry.md new file mode 100755 index 000000000..efa5243ff --- /dev/null +++ b/sync-for-payables/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/accounting-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/accounting-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-23T00:00:00.000Z | +| `description` | *Optional[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 platform. | | +| `journal_lines` | list[[JournalLine](../../models/shared/journalline.md)] | :heavy_minus_sign: | An array of journal lines. | | +| `journal_ref` | [Optional[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[Metadata]](../../models/shared/metadata.md) | :heavy_minus_sign: | N/A | | +| `modified_date` | *Optional[str]* | :heavy_minus_sign: | N/A | 2022-10-23T00:00:00.000Z | +| `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-23T00:00:00.000Z | +| `record_ref` | [Optional[JournalEntryRecordReference]](../../models/shared/journalentryrecordreference.md) | :heavy_minus_sign: | 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. | | +| `source_modified_date` | *Optional[str]* | :heavy_minus_sign: | N/A | 2022-10-23T00:00:00.000Z | +| `supplemental_data` | [Optional[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 platform. [Learn more](https://docs.codat.io/using-the-api/additional-data) 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-23T00:00:00.000Z | \ No newline at end of file diff --git a/sync-for-payables/docs/models/shared/journalentryrecordreference.md b/sync-for-payables/docs/models/shared/journalentryrecordreference.md new file mode 100755 index 000000000..63e031674 --- /dev/null +++ b/sync-for-payables/docs/models/shared/journalentryrecordreference.md @@ -0,0 +1,13 @@ +# JournalEntryRecordReference + +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/sync-for-payables/docs/models/shared/journalline.md b/sync-for-payables/docs/models/shared/journalline.md new file mode 100755 index 000000000..383211ebb --- /dev/null +++ b/sync-for-payables/docs/models/shared/journalline.md @@ -0,0 +1,12 @@ +# JournalLine + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- | +| `account_ref` | [Optional[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: | Currency for the journal line item. | +| `description` | *Optional[str]* | :heavy_minus_sign: | Description of the journal line item. | +| `net_amount` | *float* | :heavy_check_mark: | Amount for the journal line. Debit entries are considered positive, and credit entries are considered negative. | +| `tracking` | [Optional[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/sync-for-payables/docs/models/shared/journallinetracking.md b/sync-for-payables/docs/models/shared/journallinetracking.md new file mode 100755 index 000000000..29f3d72ca --- /dev/null +++ b/sync-for-payables/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[[RecordRef](../../models/shared/recordref.md)] | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/sync-for-payables/docs/models/shared/journalref.md b/sync-for-payables/docs/models/shared/journalref.md new file mode 100755 index 000000000..d01ed2293 --- /dev/null +++ b/sync-for-payables/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` | *Optional[str]* | :heavy_minus_sign: | Name of journal | \ No newline at end of file diff --git a/sync-for-payables/docs/models/shared/journals.md b/sync-for-payables/docs/models/shared/journals.md new file mode 100755 index 000000000..281db1f21 --- /dev/null +++ b/sync-for-payables/docs/models/shared/journals.md @@ -0,0 +1,14 @@ +# Journals + +Success + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------- | ----------------------------------------------- | ----------------------------------------------- | ----------------------------------------------- | +| `links` | [Links](../../models/shared/links.md) | :heavy_check_mark: | N/A | +| `page_number` | *int* | :heavy_check_mark: | N/A | +| `page_size` | *int* | :heavy_check_mark: | N/A | +| `results` | list[[Journal](../../models/shared/journal.md)] | :heavy_minus_sign: | N/A | +| `total_results` | *int* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/sync-for-payables/docs/models/shared/journalstatus.md b/sync-for-payables/docs/models/shared/journalstatus.md new file mode 100755 index 000000000..c1ebc3837 --- /dev/null +++ b/sync-for-payables/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/sync-for-payables/docs/models/shared/links.md b/sync-for-payables/docs/models/shared/links.md new file mode 100755 index 000000000..7aad1ea5d --- /dev/null +++ b/sync-for-payables/docs/models/shared/links.md @@ -0,0 +1,11 @@ +# Links + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------- | ------------------------------------------------- | ------------------------------------------------- | ------------------------------------------------- | +| `current` | [HalRef](../../models/shared/halref.md) | :heavy_check_mark: | N/A | +| `next` | [Optional[HalRef]](../../models/shared/halref.md) | :heavy_minus_sign: | N/A | +| `previous` | [Optional[HalRef]](../../models/shared/halref.md) | :heavy_minus_sign: | N/A | +| `self_` | [HalRef](../../models/shared/halref.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/sync-for-payables/docs/models/shared/metadata.md b/sync-for-payables/docs/models/shared/metadata.md new file mode 100755 index 000000000..cb411f043 --- /dev/null +++ b/sync-for-payables/docs/models/shared/metadata.md @@ -0,0 +1,8 @@ +# Metadata + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | +| `is_deleted` | *Optional[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/sync-for-payables/docs/models/shared/paymentallocationpayment.md b/sync-for-payables/docs/models/shared/paymentallocationpayment.md new file mode 100755 index 000000000..7c7dab9fc --- /dev/null +++ b/sync-for-payables/docs/models/shared/paymentallocationpayment.md @@ -0,0 +1,15 @@ +# PaymentAllocationPayment + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `account_ref` | [Optional[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` | *Optional[float]* | :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 platform, it will be available from Codat with the same precision (up to a maximum of 9 decimal places).

For accounting platforms 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 \| | | +| `id` | *Optional[str]* | :heavy_minus_sign: | Identifier of the allocated payment. | | +| `note` | *Optional[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-23T00:00:00.000Z | +| `reference` | *Optional[str]* | :heavy_minus_sign: | Reference to the allocated payment. | | +| `total_amount` | *Optional[float]* | :heavy_minus_sign: | Total amount that was paid. | | \ No newline at end of file diff --git a/sync-for-payables/docs/models/shared/paymentmethod.md b/sync-for-payables/docs/models/shared/paymentmethod.md new file mode 100755 index 000000000..ef9d1b268 --- /dev/null +++ b/sync-for-payables/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/accounting-api#/schemas/BillPayment) and [Payments](https://docs.codat.io/accounting-api#/schemas/Payment). + + +## Fields + +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | +| `id` | *Optional[str]* | :heavy_minus_sign: | Unique identifier for the payment method. | | +| `metadata` | [Optional[Metadata]](../../models/shared/metadata.md) | :heavy_minus_sign: | N/A | | +| `modified_date` | *Optional[str]* | :heavy_minus_sign: | N/A | 2022-10-23T00:00:00.000Z | +| `name` | *Optional[str]* | :heavy_minus_sign: | Name of the payment method. | | +| `source_modified_date` | *Optional[str]* | :heavy_minus_sign: | N/A | 2022-10-23T00:00:00.000Z | +| `status` | [Optional[PaymentMethodStatus]](../../models/shared/paymentmethodstatus.md) | :heavy_minus_sign: | Status of the Payment Method. | | +| `type` | [Optional[PaymentMethodType]](../../models/shared/paymentmethodtype.md) | :heavy_minus_sign: | Method of payment. | | \ No newline at end of file diff --git a/sync-for-payables/docs/models/shared/paymentmethods.md b/sync-for-payables/docs/models/shared/paymentmethods.md new file mode 100755 index 000000000..abbd8439c --- /dev/null +++ b/sync-for-payables/docs/models/shared/paymentmethods.md @@ -0,0 +1,14 @@ +# PaymentMethods + +Success + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------- | ----------------------------------------------------------- | ----------------------------------------------------------- | ----------------------------------------------------------- | +| `links` | [Links](../../models/shared/links.md) | :heavy_check_mark: | N/A | +| `page_number` | *int* | :heavy_check_mark: | N/A | +| `page_size` | *int* | :heavy_check_mark: | N/A | +| `results` | list[[PaymentMethod](../../models/shared/paymentmethod.md)] | :heavy_minus_sign: | N/A | +| `total_results` | *int* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/sync-for-payables/docs/models/shared/paymentmethodstatus.md b/sync-for-payables/docs/models/shared/paymentmethodstatus.md new file mode 100755 index 000000000..18014390a --- /dev/null +++ b/sync-for-payables/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/sync-for-payables/docs/models/shared/paymentmethodtype.md b/sync-for-payables/docs/models/shared/paymentmethodtype.md new file mode 100755 index 000000000..e1cf7a3f3 --- /dev/null +++ b/sync-for-payables/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/sync-for-payables/docs/models/shared/pulloperation.md b/sync-for-payables/docs/models/shared/pulloperation.md new file mode 100755 index 000000000..a4f6d0c4b --- /dev/null +++ b/sync-for-payables/docs/models/shared/pulloperation.md @@ -0,0 +1,19 @@ +# 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: | N/A | 22ece347-e5f6-4896-95e0-35a4c7f17023 | +| `connection_id` | *str* | :heavy_check_mark: | N/A | 50830828-7d39-4367-b0eb-5ddb2de5faa5 | +| `data_type` | *str* | :heavy_check_mark: | N/A | | +| `id` | *str* | :heavy_check_mark: | N/A | 943accd0-4247-42d8-865b-363c8629e1da | +| `is_completed` | *bool* | :heavy_check_mark: | N/A | | +| `is_errored` | *bool* | :heavy_check_mark: | N/A | | +| `progress` | *int* | :heavy_check_mark: | N/A | | +| `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-23T00:00:00.000Z | +| `status` | [PullOperationStatus](../../models/shared/pulloperationstatus.md) | :heavy_check_mark: | N/A | Complete | \ No newline at end of file diff --git a/sync-for-payables/docs/models/shared/pulloperations.md b/sync-for-payables/docs/models/shared/pulloperations.md new file mode 100755 index 000000000..497d66e3f --- /dev/null +++ b/sync-for-payables/docs/models/shared/pulloperations.md @@ -0,0 +1,14 @@ +# PullOperations + +OK + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------- | ----------------------------------------------------------- | ----------------------------------------------------------- | ----------------------------------------------------------- | +| `links` | [Links](../../models/shared/links.md) | :heavy_check_mark: | N/A | +| `page_number` | *int* | :heavy_check_mark: | N/A | +| `page_size` | *int* | :heavy_check_mark: | N/A | +| `results` | list[[PullOperation](../../models/shared/pulloperation.md)] | :heavy_minus_sign: | N/A | +| `total_results` | *int* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/sync-for-payables/docs/models/shared/pulloperationstatus.md b/sync-for-payables/docs/models/shared/pulloperationstatus.md new file mode 100755 index 000000000..12b8f9fd5 --- /dev/null +++ b/sync-for-payables/docs/models/shared/pulloperationstatus.md @@ -0,0 +1,30 @@ +# PullOperationStatus + + +## 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 | +| `ROUTING` | Routing | +| `ROUTING_ERROR` | RoutingError | +| `NOT_SUPPORTED` | NotSupported | +| `RATE_LIMIT_ERROR` | RateLimitError | +| `PERMISSIONS_ERROR` | PermissionsError | +| `PREREQUISITE_NOT_MET` | PrerequisiteNotMet | \ No newline at end of file diff --git a/sync-for-payables/docs/models/shared/pushchangetype.md b/sync-for-payables/docs/models/shared/pushchangetype.md new file mode 100755 index 000000000..4818f5d2a --- /dev/null +++ b/sync-for-payables/docs/models/shared/pushchangetype.md @@ -0,0 +1,12 @@ +# PushChangeType + + +## Values + +| Name | Value | +| --------------------- | --------------------- | +| `UNKNOWN` | Unknown | +| `CREATED` | Created | +| `MODIFIED` | Modified | +| `DELETED` | Deleted | +| `ATTACHMENT_UPLOADED` | AttachmentUploaded | \ No newline at end of file diff --git a/sync-for-payables/docs/models/shared/pushfieldvalidation.md b/sync-for-payables/docs/models/shared/pushfieldvalidation.md new file mode 100755 index 000000000..1008b54d5 --- /dev/null +++ b/sync-for-payables/docs/models/shared/pushfieldvalidation.md @@ -0,0 +1,10 @@ +# PushFieldValidation + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `details` | *str* | :heavy_check_mark: | N/A | +| `field` | *Optional[str]* | :heavy_minus_sign: | N/A | +| `ref` | *Optional[str]* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/sync-for-payables/docs/models/shared/pushoperation.md b/sync-for-payables/docs/models/shared/pushoperation.md new file mode 100755 index 000000000..b90de2409 --- /dev/null +++ b/sync-for-payables/docs/models/shared/pushoperation.md @@ -0,0 +1,22 @@ +# PushOperation + +OK + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `changes` | list[[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. | | +| `company_id` | *str* | :heavy_check_mark: | Unique identifier for your SMB in Codat. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `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-23T00:00:00.000Z | +| `data_connection_key` | *str* | :heavy_check_mark: | Unique identifier for a company's data connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | +| `data_type` | [Optional[DataType]](../../models/shared/datatype.md) | :heavy_minus_sign: | Available Data types | invoices | +| `error_message` | *Optional[str]* | :heavy_minus_sign: | N/A | | +| `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-23T00:00:00.000Z | +| `status` | [PushOperationStatus](../../models/shared/pushoperationstatus.md) | :heavy_check_mark: | The status of the push operation. | | +| `status_code` | *int* | :heavy_check_mark: | N/A | | +| `timeout_in_minutes` | *Optional[int]* | :heavy_minus_sign: | N/A | | +| ~~`timeout_in_seconds`~~ | *Optional[int]* | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible. | | +| `validation` | [Optional[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/sync-for-payables/docs/models/shared/pushoperationchange.md b/sync-for-payables/docs/models/shared/pushoperationchange.md new file mode 100755 index 000000000..b57a9c8b9 --- /dev/null +++ b/sync-for-payables/docs/models/shared/pushoperationchange.md @@ -0,0 +1,10 @@ +# PushOperationChange + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------- | --------------------------------------------------------------------- | --------------------------------------------------------------------- | --------------------------------------------------------------------- | +| `attachment_id` | *Optional[str]* | :heavy_minus_sign: | N/A | +| `record_ref` | [Optional[PushOperationRef]](../../models/shared/pushoperationref.md) | :heavy_minus_sign: | N/A | +| `type` | [Optional[PushChangeType]](../../models/shared/pushchangetype.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/sync-for-payables/docs/models/shared/pushoperationref.md b/sync-for-payables/docs/models/shared/pushoperationref.md new file mode 100755 index 000000000..10503c8ee --- /dev/null +++ b/sync-for-payables/docs/models/shared/pushoperationref.md @@ -0,0 +1,9 @@ +# PushOperationRef + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | +| `data_type` | [Optional[DataType]](../../models/shared/datatype.md) | :heavy_minus_sign: | Available Data types | invoices | +| `id` | *Optional[str]* | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/sync-for-payables/docs/models/shared/pushoperations.md b/sync-for-payables/docs/models/shared/pushoperations.md new file mode 100755 index 000000000..4967d37e5 --- /dev/null +++ b/sync-for-payables/docs/models/shared/pushoperations.md @@ -0,0 +1,14 @@ +# PushOperations + +OK + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------- | ----------------------------------------------------------- | ----------------------------------------------------------- | ----------------------------------------------------------- | +| `links` | [Links](../../models/shared/links.md) | :heavy_check_mark: | N/A | +| `page_number` | *int* | :heavy_check_mark: | N/A | +| `page_size` | *int* | :heavy_check_mark: | N/A | +| `results` | list[[PushOperation](../../models/shared/pushoperation.md)] | :heavy_minus_sign: | N/A | +| `total_results` | *int* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/sync-for-payables/docs/models/shared/pushoperationstatus.md b/sync-for-payables/docs/models/shared/pushoperationstatus.md new file mode 100755 index 000000000..4125ba6a3 --- /dev/null +++ b/sync-for-payables/docs/models/shared/pushoperationstatus.md @@ -0,0 +1,13 @@ +# PushOperationStatus + +The 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/sync-for-payables/docs/models/shared/pushoption.md b/sync-for-payables/docs/models/shared/pushoption.md new file mode 100755 index 000000000..5a6b4939e --- /dev/null +++ b/sync-for-payables/docs/models/shared/pushoption.md @@ -0,0 +1,16 @@ +# PushOption + +OK + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | +| `description` | *Optional[str]* | :heavy_minus_sign: | N/A | +| `display_name` | *str* | :heavy_check_mark: | N/A | +| `options` | list[[PushOptionChoice](../../models/shared/pushoptionchoice.md)] | :heavy_minus_sign: | N/A | +| `properties` | dict[str, [PushOptionProperty](../../models/shared/pushoptionproperty.md)] | :heavy_minus_sign: | N/A | +| `required` | *bool* | :heavy_check_mark: | N/A | +| `type` | [PushOptionType](../../models/shared/pushoptiontype.md) | :heavy_check_mark: | N/A | +| `validation` | [Optional[PushValidationInfo]](../../models/shared/pushvalidationinfo.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/sync-for-payables/docs/models/shared/pushoptionchoice.md b/sync-for-payables/docs/models/shared/pushoptionchoice.md new file mode 100755 index 000000000..fe6383d2b --- /dev/null +++ b/sync-for-payables/docs/models/shared/pushoptionchoice.md @@ -0,0 +1,12 @@ +# PushOptionChoice + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------- | ----------------------------------------------------------------- | ----------------------------------------------------------------- | ----------------------------------------------------------------- | +| `description` | *Optional[str]* | :heavy_minus_sign: | N/A | +| `display_name` | *Optional[str]* | :heavy_minus_sign: | N/A | +| `required` | *Optional[bool]* | :heavy_minus_sign: | N/A | +| `type` | [Optional[PushOptionType]](../../models/shared/pushoptiontype.md) | :heavy_minus_sign: | N/A | +| `value` | *Optional[str]* | :heavy_minus_sign: | Allowed value for field. | \ No newline at end of file diff --git a/sync-for-payables/docs/models/shared/pushoptionproperty.md b/sync-for-payables/docs/models/shared/pushoptionproperty.md new file mode 100755 index 000000000..2178375f1 --- /dev/null +++ b/sync-for-payables/docs/models/shared/pushoptionproperty.md @@ -0,0 +1,14 @@ +# PushOptionProperty + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | +| `description` | *str* | :heavy_check_mark: | N/A | +| `display_name` | *str* | :heavy_check_mark: | N/A | +| `options` | list[[PushOptionChoice](../../models/shared/pushoptionchoice.md)] | :heavy_minus_sign: | N/A | +| `properties` | dict[str, [PushOptionProperty](../../models/shared/pushoptionproperty.md)] | :heavy_minus_sign: | N/A | +| `required` | *bool* | :heavy_check_mark: | N/A | +| `type` | [PushOptionType](../../models/shared/pushoptiontype.md) | :heavy_check_mark: | N/A | +| `validation` | [Optional[PushValidationInfo]](../../models/shared/pushvalidationinfo.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/sync-for-payables/docs/models/shared/pushoptiontype.md b/sync-for-payables/docs/models/shared/pushoptiontype.md new file mode 100755 index 000000000..f03b48ce2 --- /dev/null +++ b/sync-for-payables/docs/models/shared/pushoptiontype.md @@ -0,0 +1,15 @@ +# PushOptionType + + +## 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/sync-for-payables/docs/models/shared/pushvalidationinfo.md b/sync-for-payables/docs/models/shared/pushvalidationinfo.md new file mode 100755 index 000000000..9faf9b85f --- /dev/null +++ b/sync-for-payables/docs/models/shared/pushvalidationinfo.md @@ -0,0 +1,9 @@ +# PushValidationInfo + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | +| `information` | list[[PushFieldValidation](../../models/shared/pushfieldvalidation.md)] | :heavy_minus_sign: | N/A | +| `warnings` | list[[PushFieldValidation](../../models/shared/pushfieldvalidation.md)] | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/sync-for-payables/docs/models/shared/recordref.md b/sync-for-payables/docs/models/shared/recordref.md new file mode 100755 index 000000000..02d0111a7 --- /dev/null +++ b/sync-for-payables/docs/models/shared/recordref.md @@ -0,0 +1,13 @@ +# RecordRef + +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/sync-for-payables/docs/models/shared/security.md b/sync-for-payables/docs/models/shared/security.md new file mode 100755 index 000000000..2b68bd0e7 --- /dev/null +++ b/sync-for-payables/docs/models/shared/security.md @@ -0,0 +1,8 @@ +# Security + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------ | ------------------------------ | ------------------------------ | ------------------------------ | ------------------------------ | +| `auth_header` | *str* | :heavy_check_mark: | N/A | Basic BASE_64_ENCODED(API_KEY) | \ No newline at end of file diff --git a/sync-for-payables/docs/models/shared/status.md b/sync-for-payables/docs/models/shared/status.md new file mode 100755 index 000000000..8d413a2b2 --- /dev/null +++ b/sync-for-payables/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/sync-for-payables/docs/models/shared/supplementaldata.md b/sync-for-payables/docs/models/shared/supplementaldata.md new file mode 100755 index 000000000..2a938b3cf --- /dev/null +++ b/sync-for-payables/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 platform. [Learn more](https://docs.codat.io/using-the-api/additional-data) 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/sync-for-payables/docs/models/shared/supplier.md b/sync-for-payables/docs/models/shared/supplier.md new file mode 100755 index 000000000..a468223a3 --- /dev/null +++ b/sync-for-payables/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/accounting-api#/operations/list-suppliers). Suppliers' data links to accounts payable [bills](https://docs.codat.io/accounting-api#/schemas/Bill). + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `addresses` | list[[SupplierAddresses](../../models/shared/supplieraddresses.md)] | :heavy_minus_sign: | An array of Addresses. | | +| `contact_name` | *Optional[str]* | :heavy_minus_sign: | Name of the main contact for the supplier. | | +| `default_currency` | *Optional[str]* | :heavy_minus_sign: | Default currency the supplier's transactional data is recorded in. | | +| `email_address` | *Optional[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 platform. | | +| `metadata` | [Optional[Metadata]](../../models/shared/metadata.md) | :heavy_minus_sign: | N/A | | +| `modified_date` | *Optional[str]* | :heavy_minus_sign: | N/A | 2022-10-23T00:00:00.000Z | +| `phone` | *Optional[str]* | :heavy_minus_sign: | Phone number that the supplier may be contacted on. | +44 25691 154789 | +| `registration_number` | *Optional[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-23T00:00:00.000Z | +| `status` | [SupplierStatus](../../models/shared/supplierstatus.md) | :heavy_check_mark: | Status of the supplier. | | +| `supplemental_data` | [Optional[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 platform. [Learn more](https://docs.codat.io/using-the-api/additional-data) about supplemental data. | | +| `supplier_name` | *Optional[str]* | :heavy_minus_sign: | Name of the supplier as recorded in the accounting system, typically the company name. | | +| `tax_number` | *Optional[str]* | :heavy_minus_sign: | Supplier's company tax number. | | \ No newline at end of file diff --git a/sync-for-payables/docs/models/shared/supplieraddresses.md b/sync-for-payables/docs/models/shared/supplieraddresses.md new file mode 100755 index 000000000..3c909b291 --- /dev/null +++ b/sync-for-payables/docs/models/shared/supplieraddresses.md @@ -0,0 +1,14 @@ +# SupplierAddresses + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------- | --------------------------------------------------------------------- | --------------------------------------------------------------------- | --------------------------------------------------------------------- | +| `city` | *Optional[str]* | :heavy_minus_sign: | City of the customer address. | +| `country` | *Optional[str]* | :heavy_minus_sign: | Country of the customer address. | +| `line1` | *Optional[str]* | :heavy_minus_sign: | Line 1 of the customer address. | +| `line2` | *Optional[str]* | :heavy_minus_sign: | Line 2 of the customer address. | +| `postal_code` | *Optional[str]* | :heavy_minus_sign: | Postal code or zip code. | +| `region` | *Optional[str]* | :heavy_minus_sign: | Region of the customer address. | +| `type` | [AccountingAddressType](../../models/shared/accountingaddresstype.md) | :heavy_check_mark: | The type of the address | \ No newline at end of file diff --git a/sync-for-payables/docs/models/shared/supplierref.md b/sync-for-payables/docs/models/shared/supplierref.md new file mode 100755 index 000000000..a8824b5f9 --- /dev/null +++ b/sync-for-payables/docs/models/shared/supplierref.md @@ -0,0 +1,11 @@ +# SupplierRef + +Reference to the supplier the record relates to. + + +## Fields + +| 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 diff --git a/sync-for-payables/docs/models/shared/suppliers.md b/sync-for-payables/docs/models/shared/suppliers.md new file mode 100755 index 000000000..88c7249aa --- /dev/null +++ b/sync-for-payables/docs/models/shared/suppliers.md @@ -0,0 +1,14 @@ +# Suppliers + +Success + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------- | ------------------------------------------------- | ------------------------------------------------- | ------------------------------------------------- | +| `links` | [Links](../../models/shared/links.md) | :heavy_check_mark: | N/A | +| `page_number` | *int* | :heavy_check_mark: | N/A | +| `page_size` | *int* | :heavy_check_mark: | N/A | +| `results` | list[[Supplier](../../models/shared/supplier.md)] | :heavy_minus_sign: | N/A | +| `total_results` | *int* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/sync-for-payables/docs/models/shared/supplierstatus.md b/sync-for-payables/docs/models/shared/supplierstatus.md new file mode 100755 index 000000000..0374ea9e0 --- /dev/null +++ b/sync-for-payables/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/sync-for-payables/docs/models/shared/taxrate.md b/sync-for-payables/docs/models/shared/taxrate.md new file mode 100755 index 000000000..ba75029e4 --- /dev/null +++ b/sync-for-payables/docs/models/shared/taxrate.md @@ -0,0 +1,39 @@ +# 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 package. 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` | *Optional[str]* | :heavy_minus_sign: | Code for the tax rate from the accounting platform. | | +| `components` | list[[TaxRateComponent](../../models/shared/taxratecomponent.md)] | :heavy_minus_sign: | N/A | | +| `effective_tax_rate` | *Optional[float]* | :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 platform. | | +| `metadata` | [Optional[Metadata]](../../models/shared/metadata.md) | :heavy_minus_sign: | N/A | | +| `modified_date` | *Optional[str]* | :heavy_minus_sign: | N/A | 2022-10-23T00:00:00.000Z | +| `name` | *Optional[str]* | :heavy_minus_sign: | Codat-augmented name of the tax rate in the accounting platform. | | +| `source_modified_date` | *Optional[str]* | :heavy_minus_sign: | N/A | 2022-10-23T00:00:00.000Z | +| `status` | [Optional[TaxRateStatus]](../../models/shared/taxratestatus.md) | :heavy_minus_sign: | Status of the tax rate in the accounting platform.
- `Active` - An active tax rate in use by a company.
- `Archived` - A tax rate that has been archived or is inactive in the accounting platform.
- `Unknown` - Where the status of the tax rate cannot be determined from the underlying platform. | | +| `total_tax_rate` | *Optional[float]* | :heavy_minus_sign: | Total (not compounded) sum of the components of a tax rate. | | +| `valid_datatype_links` | list[[ValidDatatypeLinksitems](../../models/shared/validdatatypelinksitems.md)] | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/sync-for-payables/docs/models/shared/taxratecomponent.md b/sync-for-payables/docs/models/shared/taxratecomponent.md new file mode 100755 index 000000000..148878a7e --- /dev/null +++ b/sync-for-payables/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` | *Optional[str]* | :heavy_minus_sign: | Name of the tax rate component. | +| `rate` | *Optional[float]* | :heavy_minus_sign: | The rate of the tax rate component, usually a percentage. | \ No newline at end of file diff --git a/sync-for-payables/docs/models/shared/taxrateref.md b/sync-for-payables/docs/models/shared/taxrateref.md new file mode 100755 index 000000000..22e79fc30 --- /dev/null +++ b/sync-for-payables/docs/models/shared/taxrateref.md @@ -0,0 +1,21 @@ +# TaxRateRef + +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 + +| Field | Type | Required | Description | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `effective_tax_rate` | *Optional[float]* | :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 diff --git a/sync-for-payables/docs/models/shared/taxrates.md b/sync-for-payables/docs/models/shared/taxrates.md new file mode 100755 index 000000000..39ab1328f --- /dev/null +++ b/sync-for-payables/docs/models/shared/taxrates.md @@ -0,0 +1,14 @@ +# TaxRates + +Success + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------- | ----------------------------------------------- | ----------------------------------------------- | ----------------------------------------------- | +| `links` | [Links](../../models/shared/links.md) | :heavy_check_mark: | N/A | +| `page_number` | *int* | :heavy_check_mark: | N/A | +| `page_size` | *int* | :heavy_check_mark: | N/A | +| `results` | list[[TaxRate](../../models/shared/taxrate.md)] | :heavy_minus_sign: | N/A | +| `total_results` | *int* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/sync-for-payables/docs/models/shared/taxratestatus.md b/sync-for-payables/docs/models/shared/taxratestatus.md new file mode 100755 index 000000000..00bfb202b --- /dev/null +++ b/sync-for-payables/docs/models/shared/taxratestatus.md @@ -0,0 +1,15 @@ +# TaxRateStatus + +Status of the tax rate in the accounting platform. +- `Active` - An active tax rate in use by a company. +- `Archived` - A tax rate that has been archived or is inactive in the accounting platform. +- `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/sync-for-payables/docs/models/shared/tracking.md b/sync-for-payables/docs/models/shared/tracking.md new file mode 100755 index 000000000..788899368 --- /dev/null +++ b/sync-for-payables/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[[TrackingCategoryRef](../../models/shared/trackingcategoryref.md)] | :heavy_check_mark: | N/A | +| `customer_ref` | [Optional[TrackingCustomerRef]](../../models/shared/trackingcustomerref.md) | :heavy_minus_sign: | N/A | +| `is_billed_to` | [BilledToType](../../models/shared/billedtotype.md) | :heavy_check_mark: | N/A | +| `is_rebilled_to` | [BilledToType](../../models/shared/billedtotype.md) | :heavy_check_mark: | N/A | +| `project_ref` | [Optional[TrackingProjectRef]](../../models/shared/trackingprojectref.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/sync-for-payables/docs/models/shared/trackingcategories.md b/sync-for-payables/docs/models/shared/trackingcategories.md new file mode 100755 index 000000000..091e6623c --- /dev/null +++ b/sync-for-payables/docs/models/shared/trackingcategories.md @@ -0,0 +1,14 @@ +# TrackingCategories + +Success + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------- | ----------------------------------------------------------------- | ----------------------------------------------------------------- | ----------------------------------------------------------------- | +| `links` | [Links](../../models/shared/links.md) | :heavy_check_mark: | N/A | +| `page_number` | *int* | :heavy_check_mark: | N/A | +| `page_size` | *int* | :heavy_check_mark: | N/A | +| `results` | list[[TrackingCategory](../../models/shared/trackingcategory.md)] | :heavy_minus_sign: | N/A | +| `total_results` | *int* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/sync-for-payables/docs/models/shared/trackingcategory.md b/sync-for-payables/docs/models/shared/trackingcategory.md new file mode 100755 index 000000000..2762dcc7a --- /dev/null +++ b/sync-for-payables/docs/models/shared/trackingcategory.md @@ -0,0 +1,143 @@ +# 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 platforms. 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` | *Optional[str]* | :heavy_minus_sign: | The identifier for the item, unique per tracking category | | +| `modified_date` | *Optional[str]* | :heavy_minus_sign: | N/A | 2022-10-23T00:00:00.000Z | +| `name` | *Optional[str]* | :heavy_minus_sign: | The name of the tracking category | | +| `parent_id` | *Optional[str]* | :heavy_minus_sign: | The identifier for this item's immediate parent | | +| `source_modified_date` | *Optional[str]* | :heavy_minus_sign: | N/A | 2022-10-23T00:00:00.000Z | +| `status` | [Optional[Status]](../../models/shared/status.md) | :heavy_minus_sign: | Current state of the tracking category. | | \ No newline at end of file diff --git a/sync-for-payables/docs/models/shared/trackingcategoryref.md b/sync-for-payables/docs/models/shared/trackingcategoryref.md new file mode 100755 index 000000000..c07926a39 --- /dev/null +++ b/sync-for-payables/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: | N/A | +| `name` | *Optional[str]* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/sync-for-payables/docs/models/shared/trackingcategorytree.md b/sync-for-payables/docs/models/shared/trackingcategorytree.md new file mode 100755 index 000000000..f9b0266ca --- /dev/null +++ b/sync-for-payables/docs/models/shared/trackingcategorytree.md @@ -0,0 +1,17 @@ +# 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` | *Optional[str]* | :heavy_minus_sign: | The identifier for the item, unique per tracking category | | +| `modified_date` | *Optional[str]* | :heavy_minus_sign: | N/A | 2022-10-23T00:00:00.000Z | +| `name` | *Optional[str]* | :heavy_minus_sign: | The name of the tracking category | | +| `parent_id` | *Optional[str]* | :heavy_minus_sign: | The identifier for this item's immediate parent | | +| `source_modified_date` | *Optional[str]* | :heavy_minus_sign: | N/A | 2022-10-23T00:00:00.000Z | +| `status` | [Optional[Status]](../../models/shared/status.md) | :heavy_minus_sign: | Current state of the tracking category. | | +| `sub_categories` | list[[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/sync-for-payables/docs/models/shared/trackingcustomerref.md b/sync-for-payables/docs/models/shared/trackingcustomerref.md new file mode 100755 index 000000000..555c81a76 --- /dev/null +++ b/sync-for-payables/docs/models/shared/trackingcustomerref.md @@ -0,0 +1,9 @@ +# TrackingCustomerRef + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------ | ------------------------------------------ | ------------------------------------------ | ------------------------------------------ | +| `company_name` | *Optional[str]* | :heavy_minus_sign: | `customerName` from the Customer data type | +| `id` | *str* | :heavy_check_mark: | `id` from the Customers data type | \ No newline at end of file diff --git a/sync-for-payables/docs/models/shared/trackingprojectref.md b/sync-for-payables/docs/models/shared/trackingprojectref.md new file mode 100755 index 000000000..11fb273da --- /dev/null +++ b/sync-for-payables/docs/models/shared/trackingprojectref.md @@ -0,0 +1,9 @@ +# TrackingProjectRef + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `id` | *str* | :heavy_check_mark: | N/A | +| `name` | *Optional[str]* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/sync-for-payables/docs/models/shared/updatebillcreditnoteresponse.md b/sync-for-payables/docs/models/shared/updatebillcreditnoteresponse.md new file mode 100755 index 000000000..6a83daee8 --- /dev/null +++ b/sync-for-payables/docs/models/shared/updatebillcreditnoteresponse.md @@ -0,0 +1,23 @@ +# UpdateBillCreditNoteResponse + +Success + + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `changes` | list[[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. | | +| `company_id` | *str* | :heavy_check_mark: | Unique identifier for your SMB in Codat. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `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-23T00:00:00.000Z | +| `data` | [Optional[BillCreditNote]](../../models/shared/billcreditnote.md) | :heavy_minus_sign: | > **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/accounting-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/accounting-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/accounting-api#/schemas/Bill).
* The supplier that issued the bill credit note. | | +| `data_connection_key` | *str* | :heavy_check_mark: | Unique identifier for a company's data connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | +| `data_type` | [Optional[DataType]](../../models/shared/datatype.md) | :heavy_minus_sign: | Available Data types | invoices | +| `error_message` | *Optional[str]* | :heavy_minus_sign: | N/A | | +| `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-23T00:00:00.000Z | +| `status` | [PushOperationStatus](../../models/shared/pushoperationstatus.md) | :heavy_check_mark: | The status of the push operation. | | +| `status_code` | *int* | :heavy_check_mark: | N/A | | +| `timeout_in_minutes` | *Optional[int]* | :heavy_minus_sign: | N/A | | +| ~~`timeout_in_seconds`~~ | *Optional[int]* | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible. | | +| `validation` | [Optional[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/sync-for-payables/docs/models/shared/updatebillresponse.md b/sync-for-payables/docs/models/shared/updatebillresponse.md new file mode 100755 index 000000000..f13949a34 --- /dev/null +++ b/sync-for-payables/docs/models/shared/updatebillresponse.md @@ -0,0 +1,23 @@ +# UpdateBillResponse + +Success + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `changes` | list[[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. | | +| `company_id` | *str* | :heavy_check_mark: | Unique identifier for your SMB in Codat. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `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-23T00:00:00.000Z | +| `data` | [Optional[Bill]](../../models/shared/bill.md) | :heavy_minus_sign: | > **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/accounting-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 platforms 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/accounting-api#/schemas/DirectCost) data model. | | +| `data_connection_key` | *str* | :heavy_check_mark: | Unique identifier for a company's data connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | +| `data_type` | [Optional[DataType]](../../models/shared/datatype.md) | :heavy_minus_sign: | Available Data types | invoices | +| `error_message` | *Optional[str]* | :heavy_minus_sign: | N/A | | +| `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-23T00:00:00.000Z | +| `status` | [PushOperationStatus](../../models/shared/pushoperationstatus.md) | :heavy_check_mark: | The status of the push operation. | | +| `status_code` | *int* | :heavy_check_mark: | N/A | | +| `timeout_in_minutes` | *Optional[int]* | :heavy_minus_sign: | N/A | | +| ~~`timeout_in_seconds`~~ | *Optional[int]* | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible. | | +| `validation` | [Optional[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/sync-for-payables/docs/models/shared/updatesupplierresponse.md b/sync-for-payables/docs/models/shared/updatesupplierresponse.md new file mode 100755 index 000000000..5ef1f757c --- /dev/null +++ b/sync-for-payables/docs/models/shared/updatesupplierresponse.md @@ -0,0 +1,23 @@ +# UpdateSupplierResponse + +Success + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `changes` | list[[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. | | +| `company_id` | *str* | :heavy_check_mark: | Unique identifier for your SMB in Codat. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `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-23T00:00:00.000Z | +| `data` | [Optional[Supplier]](../../models/shared/supplier.md) | :heavy_minus_sign: | > 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/accounting-api#/operations/list-suppliers). Suppliers' data links to accounts payable [bills](https://docs.codat.io/accounting-api#/schemas/Bill). | | +| `data_connection_key` | *str* | :heavy_check_mark: | Unique identifier for a company's data connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | +| `data_type` | [Optional[DataType]](../../models/shared/datatype.md) | :heavy_minus_sign: | Available Data types | invoices | +| `error_message` | *Optional[str]* | :heavy_minus_sign: | N/A | | +| `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-23T00:00:00.000Z | +| `status` | [PushOperationStatus](../../models/shared/pushoperationstatus.md) | :heavy_check_mark: | The status of the push operation. | | +| `status_code` | *int* | :heavy_check_mark: | N/A | | +| `timeout_in_minutes` | *Optional[int]* | :heavy_minus_sign: | N/A | | +| ~~`timeout_in_seconds`~~ | *Optional[int]* | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible. | | +| `validation` | [Optional[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/sync-for-payables/docs/models/shared/validation.md b/sync-for-payables/docs/models/shared/validation.md new file mode 100755 index 000000000..196cb46c2 --- /dev/null +++ b/sync-for-payables/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[[ValidationItem](../../models/shared/validationitem.md)] | :heavy_minus_sign: | N/A | +| `warnings` | list[[ValidationItem](../../models/shared/validationitem.md)] | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/sync-for-payables/docs/models/shared/validationitem.md b/sync-for-payables/docs/models/shared/validationitem.md new file mode 100755 index 000000000..f3fb8b302 --- /dev/null +++ b/sync-for-payables/docs/models/shared/validationitem.md @@ -0,0 +1,10 @@ +# ValidationItem + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `item_id` | *Optional[str]* | :heavy_minus_sign: | N/A | +| `message` | *Optional[str]* | :heavy_minus_sign: | N/A | +| `validator_name` | *Optional[str]* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/sync-for-payables/docs/models/shared/validdatatypelinksitems.md b/sync-for-payables/docs/models/shared/validdatatypelinksitems.md new file mode 100755 index 000000000..e1bdc1bc2 --- /dev/null +++ b/sync-for-payables/docs/models/shared/validdatatypelinksitems.md @@ -0,0 +1,50 @@ +# ValidDatatypeLinksitems + +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` | *Optional[str]* | :heavy_minus_sign: | The property from the account that can be linked. | \ No newline at end of file diff --git a/sync-for-payables/docs/models/shared/withholdingtaxitems.md b/sync-for-payables/docs/models/shared/withholdingtaxitems.md new file mode 100755 index 000000000..6f338896d --- /dev/null +++ b/sync-for-payables/docs/models/shared/withholdingtaxitems.md @@ -0,0 +1,9 @@ +# WithholdingTaxitems + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `amount` | *float* | :heavy_check_mark: | N/A | +| `name` | *str* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/sync-for-payables/docs/models/utils/retryconfig.md b/sync-for-payables/docs/models/utils/retryconfig.md new file mode 100755 index 000000000..69dd549ec --- /dev/null +++ b/sync-for-payables/docs/models/utils/retryconfig.md @@ -0,0 +1,24 @@ +# RetryConfig + +Allows customizing the default retry configuration. Only usable with methods that mention they support retries. + +## Fields + +| Name | Type | Description | Example | +| ------------------------- | ----------------------------------- | --------------------------------------- | --------- | +| `strategy` | `*str*` | The retry strategy to use. | `backoff` | +| `backoff` | [BackoffStrategy](#backoffstrategy) | Configuration for the backoff strategy. | | +| `retry_connection_errors` | `*bool*` | Whether to retry on connection errors. | `true` | + +## BackoffStrategy + +The backoff strategy allows retrying a request with an exponential backoff between each retry. + +### Fields + +| Name | Type | Description | Example | +| ------------------ | --------- | ----------------------------------------- | -------- | +| `initial_interval` | `*int*` | The initial interval in milliseconds. | `500` | +| `max_interval` | `*int*` | The maximum interval in milliseconds. | `60000` | +| `exponent` | `*float*` | The exponent to use for the backoff. | `1.5` | +| `max_elapsed_time` | `*int*` | The maximum elapsed time in milliseconds. | `300000` | \ No newline at end of file diff --git a/sync-for-payables/docs/sdks/accounts/README.md b/sync-for-payables/docs/sdks/accounts/README.md new file mode 100755 index 000000000..602df7295 --- /dev/null +++ b/sync-for-payables/docs/sdks/accounts/README.md @@ -0,0 +1,240 @@ +# accounts + +## Overview + +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 +import codatsyncpayables +from codatsyncpayables.models import operations, shared + +s = codatsyncpayables.CodatSyncPayables( + security=shared.Security( + auth_header="Basic BASE_64_ENCODED(API_KEY)", + ), +) + +req = operations.CreateAccountRequest( + account=shared.Account( + currency='USD', + current_balance=0, + description='Invoices the business has issued but has not yet collected payment on.', + fully_qualified_category='Asset.Current', + fully_qualified_name='Fixed Asset', + id='1b6266d1-1e44-46c5-8eb5-a8f98e03124e', + is_bank_account=False, + metadata=shared.Metadata( + is_deleted=False, + ), + modified_date='2022-10-23T00:00:00.000Z', + name='Accounts Receivable', + nominal_code='610', + source_modified_date='2022-10-23T00:00:00.000Z', + status=shared.AccountStatus.ACTIVE, + type=shared.AccountType.ASSET, + valid_datatype_links=[ + shared.AccountValidDataTypeLinks( + links=[ + 'nisi', + 'recusandae', + 'temporibus', + ], + property='ab', + ), + shared.AccountValidDataTypeLinks( + links=[ + 'veritatis', + 'deserunt', + ], + property='perferendis', + ), + ], + ), + company_id='8a210b68-6988-11ed-a1eb-0242ac120002', + connection_id='2e9d2c44-f675-40ba-8049-353bfcb5e171', + timeout_in_minutes=368241, +) + +res = s.accounts.create(req) + +if res.create_account_response is not None: + # handle response +``` + +### 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 + +**[operations.CreateAccountResponse](../../models/operations/createaccountresponse.md)** + + +## 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 +import codatsyncpayables +from codatsyncpayables.models import operations, shared + +s = codatsyncpayables.CodatSyncPayables( + security=shared.Security( + auth_header="Basic BASE_64_ENCODED(API_KEY)", + ), +) + +req = operations.GetAccountRequest( + account_id='repellendus', + company_id='8a210b68-6988-11ed-a1eb-0242ac120002', +) + +res = s.accounts.get(req) + +if res.account is not None: + # handle response +``` + +### 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 + +**[operations.GetAccountResponse](../../models/operations/getaccountresponse.md)** + + +## 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 +import codatsyncpayables +from codatsyncpayables.models import operations, shared + +s = codatsyncpayables.CodatSyncPayables( + security=shared.Security( + auth_header="Basic BASE_64_ENCODED(API_KEY)", + ), +) + +req = operations.GetCreateAccountModelRequest( + company_id='8a210b68-6988-11ed-a1eb-0242ac120002', + connection_id='2e9d2c44-f675-40ba-8049-353bfcb5e171', +) + +res = s.accounts.get_create_model(req) + +if res.push_option is not None: + # handle response +``` + +### 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 + +**[operations.GetCreateAccountModelResponse](../../models/operations/getcreateaccountmodelresponse.md)** + + +## 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 +import codatsyncpayables +from codatsyncpayables.models import operations, shared + +s = codatsyncpayables.CodatSyncPayables( + security=shared.Security( + auth_header="Basic BASE_64_ENCODED(API_KEY)", + ), +) + +req = operations.ListAccountsRequest( + company_id='8a210b68-6988-11ed-a1eb-0242ac120002', + order_by='-modifiedDate', + page=1, + page_size=100, + query='sapiente', +) + +res = s.accounts.list(req) + +if res.accounts is not None: + # handle response +``` + +### 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 + +**[operations.ListAccountsResponse](../../models/operations/listaccountsresponse.md)** + diff --git a/sync-for-payables/docs/sdks/billcreditnotes/README.md b/sync-for-payables/docs/sdks/billcreditnotes/README.md new file mode 100755 index 000000000..b217ffde6 --- /dev/null +++ b/sync-for-payables/docs/sdks/billcreditnotes/README.md @@ -0,0 +1,760 @@ +# bill_credit_notes + +## Overview + +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 +import codatsyncpayables +from codatsyncpayables.models import operations, shared + +s = codatsyncpayables.CodatSyncPayables( + security=shared.Security( + auth_header="Basic BASE_64_ENCODED(API_KEY)", + ), +) + +req = operations.CreateBillCreditNoteRequest( + bill_credit_note=shared.BillCreditNote( + allocated_on_date='2022-10-23T00:00:00.000Z', + bill_credit_note_number='91fe2a83-e161-4c21-929d-c5c10c4b07e5', + currency='GBP', + currency_rate=8700.13, + discount_percentage=0, + id='1509398f-98e2-436d-8a5d-c042e0c74ffc', + issue_date='2022-10-23T00:00:00.000Z', + line_items=[ + shared.BillCreditNoteLineItem( + account_ref=shared.AccountRef( + id='7cc78ca1-ba92-48fc-8167-42cb73920592', + name='Curtis Morissette', + ), + description='saepe', + discount_amount=6818.2, + discount_percentage=4499.5, + item_ref=shared.BillCreditNoteLineItemItemReference( + id='596eb10f-aaa2-4352-8595-5907aff1a3a2', + name='Shaun McCullough', + ), + quantity=4663.11, + sub_total=4746.97, + tax_amount=2444.25, + tax_rate_ref=shared.TaxRateRef( + effective_tax_rate=6235.1, + id='251aa52c-3f5a-4d01-9da1-ffe78f097b00', + name='Mrs. April Wuckert', + ), + total_amount=4808.94, + tracking=shared.BillCreditNoteLineItemTracking( + category_refs=[ + shared.TrackingCategoryRef( + id='b5e6e13b-99d4-488e-9e91-e450ad2abd44', + name='Beth McGlynn Sr.', + ), + ], + customer_ref=shared.BillCreditNoteLineItemTrackingCustomerRef( + company_name='assumenda', + id='502a94bb-4f63-4c96-9e9a-3efa77dfb14c', + ), + is_billed_to=shared.BilledToType.PROJECT, + is_rebilled_to=shared.BilledToType.NOT_APPLICABLE, + project_ref=shared.BillCreditNoteLineItemTrackingProjectRef( + id='6ae395ef-b9ba-488f-ba66-997074ba4469', + name='Duane Thiel II', + ), + ), + tracking_category_refs=[ + shared.TrackingCategoryRef( + id='959890af-a563-4e25-96fe-4c8b711e5b7f', + name='Louis Turner Sr.', + ), + ], + unit_amount=5083.15, + ), + shared.BillCreditNoteLineItem( + account_ref=shared.AccountRef( + id='921cddc6-9260-41fb-976b-0d5f0d30c5fb', + name='Ernest Hayes', + ), + description='eaque', + discount_amount=3389.85, + discount_percentage=1999.96, + item_ref=shared.BillCreditNoteLineItemItemReference( + id='202c73d5-fe9b-490c-a890-9b3fe49a8d9c', + name='Toby Hahn', + ), + quantity=2123.9, + sub_total=2098.43, + tax_amount=2224.43, + tax_rate_ref=shared.TaxRateRef( + effective_tax_rate=1861.93, + id='3f9b77f3-a410-4067-8ebf-69280d1ba77a', + name='Arturo Treutel', + ), + total_amount=4694.97, + tracking=shared.BillCreditNoteLineItemTracking( + category_refs=[ + shared.TrackingCategoryRef( + id='7ae4203c-e5e6-4a95-98a0-d446ce2af7a7', + name='Rosalie White', + ), + ], + customer_ref=shared.BillCreditNoteLineItemTrackingCustomerRef( + company_name='accusamus', + id='453f870b-326b-45a7-b429-cdb1a8422bb6', + ), + is_billed_to=shared.BilledToType.NOT_APPLICABLE, + is_rebilled_to=shared.BilledToType.CUSTOMER, + project_ref=shared.BillCreditNoteLineItemTrackingProjectRef( + id='d2322715-bf0c-4bb1-a31b-8b90f3443a11', + name='Miss Billie Ward', + ), + ), + tracking_category_refs=[ + shared.TrackingCategoryRef( + id='f4b92187-9fce-4953-b73e-f7fbc7abd74d', + name='Earl Mosciski DVM', + ), + shared.TrackingCategoryRef( + id='5d2cff7c-70a4-4562-ad43-6813f16d9f5f', + name='Elbert Jenkins', + ), + shared.TrackingCategoryRef( + id='56146c3e-250f-4b00-8c42-e141aac366c8', + name='Drew Hoeger I', + ), + shared.TrackingCategoryRef( + id='42907474-778a-47bd-866d-28c10ab3cdca', + name='Ms. Ruby Hintz II', + ), + ], + unit_amount=8920.5, + ), + shared.BillCreditNoteLineItem( + account_ref=shared.AccountRef( + id='523c7e0b-c717-48e4-b96f-2a70c688282a', + name='Randall Lindgren', + ), + description='nisi', + discount_amount=1470.14, + discount_percentage=9564.06, + item_ref=shared.BillCreditNoteLineItemItemReference( + id='222e9817-ee17-4cbe-a1e6-b7b95bc0ab3c', + name='Elizabeth Schinner', + ), + quantity=2328.65, + sub_total=4581.39, + tax_amount=5034.27, + tax_rate_ref=shared.TaxRateRef( + effective_tax_rate=5909.84, + id='fd871f99-dd2e-4fd1-a1aa-6f1e674bdb04', + name='Samuel Hermiston', + ), + total_amount=3917.74, + tracking=shared.BillCreditNoteLineItemTracking( + category_refs=[ + shared.TrackingCategoryRef( + id='82d68ea1-9f1d-4170-9133-9d08086a1840', + name='Toni Fritsch', + ), + ], + customer_ref=shared.BillCreditNoteLineItemTrackingCustomerRef( + company_name='voluptas', + id='071f93f5-f064-42da-87af-515cc413aa63', + ), + is_billed_to=shared.BilledToType.CUSTOMER, + is_rebilled_to=shared.BilledToType.CUSTOMER, + project_ref=shared.BillCreditNoteLineItemTrackingProjectRef( + id='e8d67864-dbb6-475f-95e6-0b375ed4f6fb', + name='Dr. Terence Gulgowski', + ), + ), + tracking_category_refs=[ + shared.TrackingCategoryRef( + id='317fe35b-60eb-41ea-8265-55ba3c28744e', + name='Dustin Ferry', + ), + ], + unit_amount=5553.61, + ), + shared.BillCreditNoteLineItem( + account_ref=shared.AccountRef( + id='f3a8d8f5-c0b2-4f2f-b7b1-94a276b26916', + name='Rogelio Bins V', + ), + description='maiores', + discount_amount=2748.23, + discount_percentage=1484.78, + item_ref=shared.BillCreditNoteLineItemItemReference( + id='94e3698f-447f-4603-a8b4-45e80ca55efd', + name='Deborah Turcotte', + ), + quantity=4461.35, + sub_total=8892.34, + tax_amount=1046.27, + tax_rate_ref=shared.TaxRateRef( + effective_tax_rate=5124.52, + id='58b6a89f-be3a-45aa-8e48-24d0ab407508', + name='Ms. Lamar Hessel', + ), + total_amount=1536.27, + tracking=shared.BillCreditNoteLineItemTracking( + category_refs=[ + shared.TrackingCategoryRef( + id='65e904f3-b119-44b8-abf6-03a79f9dfe0a', + name='Ron Schulist', + ), + ], + customer_ref=shared.BillCreditNoteLineItemTrackingCustomerRef( + company_name='mollitia', + id='50ce187f-86bc-4173-9689-eee9526f8d98', + ), + is_billed_to=shared.BilledToType.NOT_APPLICABLE, + is_rebilled_to=shared.BilledToType.PROJECT, + project_ref=shared.BillCreditNoteLineItemTrackingProjectRef( + id='881ead4f-0e10-4125-a3f9-4e29e973e922', + name='Leo Kiehn II', + ), + ), + tracking_category_refs=[ + shared.TrackingCategoryRef( + id='e3e06080-7e2b-46e3-ab88-45f0597a60ff', + name='Alberta Harber', + ), + shared.TrackingCategoryRef( + id='31e94764-a3e8-465e-b956-f9251a5a9da6', + name='Ruth Zulauf', + ), + shared.TrackingCategoryRef( + id='7bfaad4f-9efc-41b4-912c-1032648dc2f6', + name='Cathy Breitenberg', + ), + ], + unit_amount=9364.69, + ), + ], + metadata=shared.Metadata( + is_deleted=False, + ), + modified_date='2022-10-23T00:00:00.000Z', + note='Bill Credit Note with 1 line items, totaling 805.78', + payment_allocations=[ + shared.Items( + allocation=shared.ItemsAllocation( + allocated_on_date='2022-10-23T00:00:00.000Z', + currency='GBP', + currency_rate=9358.33, + total_amount=5962.11, + ), + payment=shared.PaymentAllocationPayment( + account_ref=shared.AccountRef( + id='fe6c632c-a3ae-4d01-9799-6312fde04771', + name='Tamara Lang', + ), + currency='USD', + currency_rate=999.58, + id='d0174763-60a1-45db-aa66-0659a1adeaab', + note='ad', + paid_on_date='2022-10-23T00:00:00.000Z', + reference='enim', + total_amount=1104.77, + ), + ), + shared.Items( + allocation=shared.ItemsAllocation( + allocated_on_date='2022-10-23T00:00:00.000Z', + currency='USD', + currency_rate=7758.03, + total_amount=4053.73, + ), + payment=shared.PaymentAllocationPayment( + account_ref=shared.AccountRef( + id='45b08b61-891b-4aa0-be1a-de008e6f8c5f', + name='Marion Aufderhar', + ), + currency='EUR', + currency_rate=8427.77, + id='b5a34181-4301-4042-9813-d5208ece7e25', + note='nesciunt', + paid_on_date='2022-10-23T00:00:00.000Z', + reference='eum', + total_amount=4269.43, + ), + ), + shared.Items( + allocation=shared.ItemsAllocation( + allocated_on_date='2022-10-23T00:00:00.000Z', + currency='GBP', + currency_rate=3494.4, + total_amount=704.1, + ), + payment=shared.PaymentAllocationPayment( + account_ref=shared.AccountRef( + id='c6c6e205-e16d-4eab-bfec-9578a6458427', + name='Lee Larkin IV', + ), + currency='EUR', + currency_rate=1173.8, + id='62309fb0-9299-421a-afb9-f58c4d86e68e', + note='modi', + paid_on_date='2022-10-23T00:00:00.000Z', + reference='vero', + total_amount=329.01, + ), + ), + shared.Items( + allocation=shared.ItemsAllocation( + allocated_on_date='2022-10-23T00:00:00.000Z', + currency='USD', + currency_rate=13.83, + total_amount=938.94, + ), + payment=shared.PaymentAllocationPayment( + account_ref=shared.AccountRef( + id='3f59da75-7a59-4ecf-af66-ef1caa3383c2', + name='Lamar Reichert', + ), + currency='USD', + currency_rate=1940.23, + id='73c8d72f-64d1-4db1-b2c4-310661e96349', + note='earum', + paid_on_date='2022-10-23T00:00:00.000Z', + reference='impedit', + total_amount=9758.84, + ), + ), + ], + remaining_credit=0, + source_modified_date='2022-10-23T00:00:00.000Z', + status=shared.BillCreditNoteStatus.PAID, + sub_total=805.78, + supplemental_data=shared.SupplementalData( + content={ + "alias": { + "itaque": 'velit', + "laborum": 'non', + }, + "dolor": { + "sit": 'doloremque', + "consequatur": 'officia', + }, + "recusandae": { + "quidem": 'voluptas', + "facilis": 'placeat', + }, + "perspiciatis": { + "deleniti": 'a', + "voluptate": 'ullam', + "unde": 'necessitatibus', + }, + }, + ), + supplier_ref=shared.SupplierRef( + id='ac55a974-1d31-4135-a965-bb8a72026114', + supplier_name='neque', + ), + total_amount=805.78, + total_discount=0, + total_tax_amount=0, + withholding_tax=[ + shared.WithholdingTaxitems( + amount=9323.94, + name='Tracy Mills', + ), + shared.WithholdingTaxitems( + amount=8028.94, + name='Marilyn Heaney', + ), + ], + ), + company_id='8a210b68-6988-11ed-a1eb-0242ac120002', + connection_id='2e9d2c44-f675-40ba-8049-353bfcb5e171', + timeout_in_minutes=115661, +) + +res = s.bill_credit_notes.create(req) + +if res.create_bill_credit_note_response is not None: + # handle response +``` + +### 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 + +**[operations.CreateBillCreditNoteResponse](../../models/operations/createbillcreditnoteresponse.md)** + + +## 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 +import codatsyncpayables +from codatsyncpayables.models import operations, shared + +s = codatsyncpayables.CodatSyncPayables( + security=shared.Security( + auth_header="Basic BASE_64_ENCODED(API_KEY)", + ), +) + +req = operations.GetBillCreditNoteRequest( + bill_credit_note_id='id', + company_id='8a210b68-6988-11ed-a1eb-0242ac120002', +) + +res = s.bill_credit_notes.get(req) + +if res.bill_credit_note is not None: + # handle response +``` + +### 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 + +**[operations.GetBillCreditNoteResponse](../../models/operations/getbillcreditnoteresponse.md)** + + +## 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 +import codatsyncpayables +from codatsyncpayables.models import operations, shared + +s = codatsyncpayables.CodatSyncPayables( + security=shared.Security( + auth_header="Basic BASE_64_ENCODED(API_KEY)", + ), +) + +req = operations.GetCreateUpdateBillCreditNoteModelRequest( + company_id='8a210b68-6988-11ed-a1eb-0242ac120002', + connection_id='2e9d2c44-f675-40ba-8049-353bfcb5e171', +) + +res = s.bill_credit_notes.get_create_update_model(req) + +if res.push_option is not None: + # handle response +``` + +### 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 + +**[operations.GetCreateUpdateBillCreditNoteModelResponse](../../models/operations/getcreateupdatebillcreditnotemodelresponse.md)** + + +## 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 +import codatsyncpayables +from codatsyncpayables.models import operations, shared + +s = codatsyncpayables.CodatSyncPayables( + security=shared.Security( + auth_header="Basic BASE_64_ENCODED(API_KEY)", + ), +) + +req = operations.ListBillCreditNotesRequest( + company_id='8a210b68-6988-11ed-a1eb-0242ac120002', + order_by='-modifiedDate', + page=1, + page_size=100, + query='libero', +) + +res = s.bill_credit_notes.list(req) + +if res.bill_credit_notes is not None: + # handle response +``` + +### 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 + +**[operations.ListBillCreditNotesResponse](../../models/operations/listbillcreditnotesresponse.md)** + + +## 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 +import codatsyncpayables +from codatsyncpayables.models import operations, shared + +s = codatsyncpayables.CodatSyncPayables( + security=shared.Security( + auth_header="Basic BASE_64_ENCODED(API_KEY)", + ), +) + +req = operations.UpdateBillCreditNoteRequest( + bill_credit_note=shared.BillCreditNote( + allocated_on_date='2022-10-23T00:00:00.000Z', + bill_credit_note_number='91fe2a83-e161-4c21-929d-c5c10c4b07e5', + currency='USD', + currency_rate=5546.03, + discount_percentage=0, + id='1509398f-98e2-436d-8a5d-c042e0c74ffc', + issue_date='2022-10-23T00:00:00.000Z', + line_items=[ + shared.BillCreditNoteLineItem( + account_ref=shared.AccountRef( + id='70e1084c-b067-42d1-ad87-9eeb9665b85e', + name='Mr. Jonathon Swaniawski', + ), + description='fuga', + discount_amount=9195.08, + discount_percentage=340.7, + item_ref=shared.BillCreditNoteLineItemItemReference( + id='be2d7822-59e3-4ea4-b519-7f92443da7ce', + name='Phyllis Quitzon', + ), + quantity=3262.69, + sub_total=8095.94, + tax_amount=3165.42, + tax_rate_ref=shared.TaxRateRef( + effective_tax_rate=2040.72, + id='7c6454ef-b0b3-4489-ac3c-a5acfbe2fd57', + name='Viola Hane', + ), + total_amount=5678.46, + tracking=shared.BillCreditNoteLineItemTracking( + category_refs=[ + shared.TrackingCategoryRef( + id='9177deac-646e-4cb5-b340-9e3eb1e5a2b1', + name='Ms. Kelley Rogahn', + ), + ], + customer_ref=shared.BillCreditNoteLineItemTrackingCustomerRef( + company_name='veritatis', + id='16db9954-5fc9-45fa-8897-0e189dbb30fc', + ), + is_billed_to=shared.BilledToType.CUSTOMER, + is_rebilled_to=shared.BilledToType.UNKNOWN, + project_ref=shared.BillCreditNoteLineItemTrackingProjectRef( + id='3ea055b1-97cd-444e-af52-d82d3513bb6f', + name='Mattie Raynor', + ), + ), + tracking_category_refs=[ + shared.TrackingCategoryRef( + id='bcdb35ff-2e4b-4275-b7a8-cd9e7319c177', + name='Leon Collier', + ), + shared.TrackingCategoryRef( + id='77b114ee-b52f-4f78-9fc3-7814d4c98e0c', + name='Candice Rath', + ), + ], + unit_amount=9222.99, + ), + ], + metadata=shared.Metadata( + is_deleted=False, + ), + modified_date='2022-10-23T00:00:00.000Z', + note='Bill Credit Note with 1 line items, totaling 805.78', + payment_allocations=[ + shared.Items( + allocation=shared.ItemsAllocation( + allocated_on_date='2022-10-23T00:00:00.000Z', + currency='EUR', + currency_rate=6293.77, + total_amount=8339.82, + ), + payment=shared.PaymentAllocationPayment( + account_ref=shared.AccountRef( + id='636c6005-03d8-4bb3-9180-f739ae9e057e', + name='Johnnie Baumbach', + ), + currency='GBP', + currency_rate=5200.81, + id='10331f39-81d4-4c70-8b60-7f3c93c73b9d', + note='officia', + paid_on_date='2022-10-23T00:00:00.000Z', + reference='tenetur', + total_amount=1339.49, + ), + ), + shared.Items( + allocation=shared.ItemsAllocation( + allocated_on_date='2022-10-23T00:00:00.000Z', + currency='EUR', + currency_rate=8483.46, + total_amount=6707.62, + ), + payment=shared.PaymentAllocationPayment( + account_ref=shared.AccountRef( + id='7e23f225-7411-4faf-8b75-44e472e80285', + name='Marguerite Hansen', + ), + currency='GBP', + currency_rate=2667.88, + id='63a7d575-f140-40e7-a4ad-7334ec1b781b', + note='amet', + paid_on_date='2022-10-23T00:00:00.000Z', + reference='fuga', + total_amount=53.1, + ), + ), + ], + remaining_credit=0, + source_modified_date='2022-10-23T00:00:00.000Z', + status=shared.BillCreditNoteStatus.PAID, + sub_total=805.78, + supplemental_data=shared.SupplementalData( + content={ + "quos": { + "repellendus": 'veritatis', + "quae": 'eaque', + "saepe": 'delectus', + }, + }, + ), + supplier_ref=shared.SupplierRef( + id='ada200ef-0422-4eb2-964c-f9ab8366c723', + supplier_name='reiciendis', + ), + total_amount=805.78, + total_discount=0, + total_tax_amount=0, + withholding_tax=[ + shared.WithholdingTaxitems( + amount=8611.23, + name='Mrs. Luther Torp', + ), + shared.WithholdingTaxitems( + amount=9248.4, + name='Kyle Leffler', + ), + shared.WithholdingTaxitems( + amount=7868.6, + name='Dr. Shari Roob Sr.', + ), + shared.WithholdingTaxitems( + amount=3178.98, + name='Ian Auer', + ), + ], + ), + bill_credit_note_id='a', + company_id='8a210b68-6988-11ed-a1eb-0242ac120002', + connection_id='2e9d2c44-f675-40ba-8049-353bfcb5e171', + force_update=False, + timeout_in_minutes=615058, +) + +res = s.bill_credit_notes.update(req) + +if res.update_bill_credit_note_response is not None: + # handle response +``` + +### 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 + +**[operations.UpdateBillCreditNoteResponse](../../models/operations/updatebillcreditnoteresponse.md)** + diff --git a/sync-for-payables/docs/sdks/billpayments/README.md b/sync-for-payables/docs/sdks/billpayments/README.md new file mode 100755 index 000000000..38128251e --- /dev/null +++ b/sync-for-payables/docs/sdks/billpayments/README.md @@ -0,0 +1,275 @@ +# bill_payments + +## Overview + +Bill payments + +### Available Operations + +* [create](#create) - Create bill payments +* [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 +import codatsyncpayables +from codatsyncpayables.models import operations, shared + +s = codatsyncpayables.CodatSyncPayables( + security=shared.Security( + auth_header="Basic BASE_64_ENCODED(API_KEY)", + ), +) + +req = operations.CreateBillPaymentRequest( + bill_payment=shared.BillPayment( + account_ref=shared.AccountRef( + id='18544ec4-2def-4cce-8f19-77773e63562a', + name='Ms. Verna Gislason', + ), + currency='GBP', + currency_rate=3314.52, + date_='2022-10-23T00:00:00.000Z', + id='3d5a8e00-d108-4045-8823-7f342676cffa', + lines=[ + shared.BillPaymentLine( + allocated_on_date='2022-10-23T00:00:00.000Z', + amount=3071.73, + links=[ + shared.BillPaymentLineLink( + amount=9847.73, + currency_rate=8518.09, + id='af313a1f-5fd9-4425-9c0b-36f25ea944f3', + type=shared.BillPaymentLineLinkType.REFUND, + ), + shared.BillPaymentLineLink( + amount=4483.86, + currency_rate=3296.51, + id='6c11f6c3-7a51-4262-8383-5bbc05a23a45', + type=shared.BillPaymentLineLinkType.MANUAL_JOURNAL, + ), + shared.BillPaymentLineLink( + amount=9322.5, + currency_rate=9555.69, + id='c5fde10a-0ce2-4169-a510-019c6dc5e347', + type=shared.BillPaymentLineLinkType.OTHER, + ), + ], + ), + ], + metadata=shared.Metadata( + is_deleted=False, + ), + modified_date='2022-10-23T00:00:00.000Z', + note='Bill Payment against bill c13e37b6-dfaa-4894-b3be-9fe97bda9f44', + payment_method_ref='odio', + reference='natus', + source_modified_date='2022-10-23T00:00:00.000Z', + supplemental_data=shared.SupplementalData( + content={ + "doloribus": { + "quidem": 'itaque', + "laboriosam": 'unde', + "modi": 'perspiciatis', + }, + "hic": { + "aspernatur": 'libero', + "nam": 'incidunt', + "recusandae": 'quod', + }, + "id": { + "autem": 'quo', + "nesciunt": 'illum', + "nemo": 'illum', + "facilis": 'non', + }, + }, + ), + supplier_ref=shared.SupplierRef( + id='adebd5da-ea4c-4506-a8aa-94c02644cf5e', + supplier_name='unde', + ), + total_amount=1329.54, + ), + company_id='8a210b68-6988-11ed-a1eb-0242ac120002', + connection_id='2e9d2c44-f675-40ba-8049-353bfcb5e171', + timeout_in_minutes=860311, +) + +res = s.bill_payments.create(req) + +if res.create_bill_payment_response is not None: + # handle response +``` + +### 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 + +**[operations.CreateBillPaymentResponse](../../models/operations/createbillpaymentresponse.md)** + + +## 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 customer 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 +import codatsyncpayables +from codatsyncpayables.models import operations, shared + +s = codatsyncpayables.CodatSyncPayables( + security=shared.Security( + auth_header="Basic BASE_64_ENCODED(API_KEY)", + ), +) + +req = operations.GetBillPaymentsRequest( + bill_payment_id='error', + company_id='8a210b68-6988-11ed-a1eb-0242ac120002', +) + +res = s.bill_payments.get(req) + +if res.bill_payment is not None: + # handle response +``` + +### 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 + +**[operations.GetBillPaymentsResponse](../../models/operations/getbillpaymentsresponse.md)** + + +## 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 customer 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 +import codatsyncpayables +from codatsyncpayables.models import operations, shared + +s = codatsyncpayables.CodatSyncPayables( + security=shared.Security( + auth_header="Basic BASE_64_ENCODED(API_KEY)", + ), +) + +req = operations.GetCreateBillPaymentModelRequest( + company_id='8a210b68-6988-11ed-a1eb-0242ac120002', + connection_id='2e9d2c44-f675-40ba-8049-353bfcb5e171', +) + +res = s.bill_payments.get_create_model(req) + +if res.push_option is not None: + # handle response +``` + +### 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 + +**[operations.GetCreateBillPaymentModelResponse](../../models/operations/getcreatebillpaymentmodelresponse.md)** + + +## 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 customer 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 +import codatsyncpayables +from codatsyncpayables.models import operations, shared + +s = codatsyncpayables.CodatSyncPayables( + security=shared.Security( + auth_header="Basic BASE_64_ENCODED(API_KEY)", + ), +) + +req = operations.ListBillPaymentsRequest( + company_id='8a210b68-6988-11ed-a1eb-0242ac120002', + order_by='-modifiedDate', + page=1, + page_size=100, + query='mollitia', +) + +res = s.bill_payments.list(req) + +if res.bill_payments is not None: + # handle response +``` + +### 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 + +**[operations.ListBillPaymentsResponse](../../models/operations/listbillpaymentsresponse.md)** + diff --git a/sync-for-payables/docs/sdks/bills/README.md b/sync-for-payables/docs/sdks/bills/README.md new file mode 100755 index 000000000..a1dfa4972 --- /dev/null +++ b/sync-for-payables/docs/sdks/bills/README.md @@ -0,0 +1,1074 @@ +# bills + +## Overview + +Bills + +### Available Operations + +* [create](#create) - Create bill +* [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 + +## 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 +import codatsyncpayables +from codatsyncpayables.models import operations, shared + +s = codatsyncpayables.CodatSyncPayables( + security=shared.Security( + auth_header="Basic BASE_64_ENCODED(API_KEY)", + ), +) + +req = operations.CreateBillRequest( + bill=shared.Bill( + amount_due=2986.13, + currency='USD', + currency_rate=4609.09, + due_date='2022-10-23T00:00:00.000Z', + id='adc1ac60-0dec-4001-ac80-2e2ec09ff8f0', + issue_date='2022-10-23T00:00:00.000Z', + line_items=[ + shared.BillLineItem( + account_ref=shared.AccountRef( + id='16ff3477-c13e-4902-8141-25b0960a6681', + name='Amy Murray', + ), + description='magni', + discount_amount=6463.29, + discount_percentage=9650.95, + is_direct_cost=False, + item_ref=shared.ItemRef( + id='923c5949-f83f-4350-8f87-6ffb901c6ecb', + name='Joel Von', + ), + quantity=1940.58, + sub_total=7581.94, + tax_amount=9928.87, + tax_rate_ref=shared.TaxRateRef( + effective_tax_rate=4598.75, + id='89ffafed-a53e-45ae-ae0a-c184c2b9c247', + name='Isaac Lowe', + ), + total_amount=2271.56, + tracking=shared.Tracking( + category_refs=[ + shared.TrackingCategoryRef( + id='40e1942f-32e5-4505-9756-f5d56d0bd0af', + name='Elena Zieme I', + ), + shared.TrackingCategoryRef( + id='db4f62cb-a3f8-4941-aebc-0b80a6924d3b', + name='Eloise Rowe', + ), + shared.TrackingCategoryRef( + id='c8f89501-0f5d-4d3d-afa1-804e54c82f16', + name='Rex Ernser', + ), + ], + customer_ref=shared.TrackingCustomerRef( + company_name='cumque', + id='8873e484-380b-41f6-b8ca-275a60a04c49', + ), + is_billed_to=shared.BilledToType.NOT_APPLICABLE, + is_rebilled_to=shared.BilledToType.PROJECT, + project_ref=shared.TrackingProjectRef( + id='c699171b-51c1-4bdb-9cf4-b888ebdfc4cc', + name='Lynn Marks', + ), + ), + tracking_category_refs=[ + shared.TrackingCategoryRef( + id='7fc0b2dc-e108-473e-82b0-06d678878ba8', + name='Kay Bradtke', + ), + shared.TrackingCategoryRef( + id='8208c54f-efa9-4c95-b2ea-c5565d307cfe', + name='Hugh Carroll III', + ), + shared.TrackingCategoryRef( + id='e2813fa4-a41c-4480-93f2-132af03102d5', + name='Danielle Willms', + ), + shared.TrackingCategoryRef( + id='c6f18bf9-621a-46a4-b77a-87ee3e4be752', + name='Gilbert Hayes', + ), + ], + unit_amount=2848.85, + ), + shared.BillLineItem( + account_ref=shared.AccountRef( + id='418e3bb9-1c8d-4975-a0e8-419d8f84f144', + name='Ms. Jimmy Turcotte', + ), + description='facere', + discount_amount=7890.16, + discount_percentage=7690.47, + is_direct_cost=False, + item_ref=shared.ItemRef( + id='4aa5f3ca-bd90-45a9-b2e0-56728227b2d3', + name='Bobbie Greenfelder MD', + ), + quantity=9565.45, + sub_total=4630.5, + tax_amount=6671.69, + tax_rate_ref=shared.TaxRateRef( + effective_tax_rate=3073.06, + id='fa87cf53-5a6f-4ae5-8ebf-60c321f023b7', + name='Paulette Dibbert', + ), + total_amount=4939.45, + tracking=shared.Tracking( + category_refs=[ + shared.TrackingCategoryRef( + id='e1a0cc8d-f79f-40a3-96d9-0c364b7c15df', + name='Hubert Russel V', + ), + shared.TrackingCategoryRef( + id='8b1c4ee2-c8c6-4ce6-91fe-eb1c7cbdb6ee', + name='Jessie Hahn', + ), + shared.TrackingCategoryRef( + id='8ba25317-747d-4c91-9ad2-caf5dd6723dc', + name='Shawna Heller', + ), + shared.TrackingCategoryRef( + id='2f3a6b70-0878-4756-943f-5a6c98b55554', + name='Naomi Bauch', + ), + ], + customer_ref=shared.TrackingCustomerRef( + company_name='doloremque', + id='bcacc6cb-d6b5-4f3e-8909-304f926bad25', + ), + is_billed_to=shared.BilledToType.NOT_APPLICABLE, + is_rebilled_to=shared.BilledToType.UNKNOWN, + project_ref=shared.TrackingProjectRef( + id='819b474b-0ed2-40e5-a248-fff639a910ab', + name='Salvatore Paucek', + ), + ), + tracking_category_refs=[ + shared.TrackingCategoryRef( + id='676696e1-ec00-4221-b335-d89acb3ecfda', + name='Ellis Balistreri', + ), + ], + unit_amount=3075.32, + ), + shared.BillLineItem( + account_ref=shared.AccountRef( + id='9ef03004-978a-461f-a1cf-20688f77c1ff', + name='Jared Blick', + ), + description='fuga', + discount_amount=665.96, + discount_percentage=4057.89, + is_direct_cost=False, + item_ref=shared.ItemRef( + id='3f2a3c80-a97f-4f33-8cdd-f857a9e61876', + name='Marc O'Connell Sr.', + ), + quantity=8600.27, + sub_total=1665.42, + tax_amount=6180.73, + tax_rate_ref=shared.TaxRateRef( + effective_tax_rate=8511.99, + id='fc94d6fe-cd79-4939-8066-a6d2d0003553', + name='Billie Schmitt', + ), + total_amount=390.47, + tracking=shared.Tracking( + category_refs=[ + shared.TrackingCategoryRef( + id='6fa21e91-52cb-4311-9167-b8e3c8db0340', + name='Levi Johns', + ), + shared.TrackingCategoryRef( + id='64ffd455-906d-4126-bd48-e935c2c9e81f', + name='Elizabeth Roberts', + ), + shared.TrackingCategoryRef( + id='e43202d7-2165-4765-8664-1870d9d21f9a', + name='Miss Michael Ferry', + ), + ], + customer_ref=shared.TrackingCustomerRef( + company_name='debitis', + id='cc11a083-6429-4068-b850-2a55e7f73bc8', + ), + is_billed_to=shared.BilledToType.NOT_APPLICABLE, + is_rebilled_to=shared.BilledToType.NOT_APPLICABLE, + project_ref=shared.TrackingProjectRef( + id='e320a319-f4ba-4df9-87c9-a867bc424266', + name='Mrs. Geraldine Lueilwitz', + ), + ), + tracking_category_refs=[ + shared.TrackingCategoryRef( + id='ca8ef51f-cb4c-4593-ac12-cdaad0ec7afe', + name='Robin Strosin PhD', + ), + shared.TrackingCategoryRef( + id='f448a47f-9390-4c58-8809-83dabf9ef3ff', + name='Levi Mohr', + ), + shared.TrackingCategoryRef( + id='f079af4d-3572-44cd-b0f4-d281187d5684', + name='Eloise Stoltenberg', + ), + shared.TrackingCategoryRef( + id='85a9065e-628b-4dfc-a032-b6c879923b7e', + name='Rosa Hand', + ), + ], + unit_amount=9897.65, + ), + ], + metadata=shared.Metadata( + is_deleted=False, + ), + modified_date='2022-10-23T00:00:00.000Z', + note='deserunt', + payment_allocations=[ + shared.BillPaymentAllocation( + allocation=shared.BillPaymentAllocationAllocation( + allocated_on_date='2022-10-23T00:00:00.000Z', + currency='GBP', + currency_rate=7733.55, + total_amount=4013.88, + ), + payment=shared.PaymentAllocationPayment( + account_ref=shared.AccountRef( + id='891f82ce-1157-4172-b053-77dcfa89df97', + name='Tasha Dickinson', + ), + currency='USD', + currency_rate=5228.24, + id='6092e9c3-ddc5-4f11-9dea-1026d541a4d1', + note='omnis', + paid_on_date='2022-10-23T00:00:00.000Z', + reference='sapiente', + total_amount=8876, + ), + ), + shared.BillPaymentAllocation( + allocation=shared.BillPaymentAllocationAllocation( + allocated_on_date='2022-10-23T00:00:00.000Z', + currency='GBP', + currency_rate=1127.51, + total_amount=4878.39, + ), + payment=shared.PaymentAllocationPayment( + account_ref=shared.AccountRef( + id='80bccc0d-bbdd-4b48-8708-fb4e391e6bc1', + name='Vickie Sauer', + ), + currency='GBP', + currency_rate=9365.18, + id='54599ea3-4226-40e9-b200-ce78a1bd8fb7', + note='culpa', + paid_on_date='2022-10-23T00:00:00.000Z', + reference='fuga', + total_amount=1175.46, + ), + ), + shared.BillPaymentAllocation( + allocation=shared.BillPaymentAllocationAllocation( + allocated_on_date='2022-10-23T00:00:00.000Z', + currency='USD', + currency_rate=7574.38, + total_amount=8855.23, + ), + payment=shared.PaymentAllocationPayment( + account_ref=shared.AccountRef( + id='723d4097-fa30-4e9a-b725-b29122030d83', + name='Dan Nolan', + ), + currency='USD', + currency_rate=4938.65, + id='99d22e8c-1f84-4938-a5fd-c42c876c2c2d', + note='delectus', + paid_on_date='2022-10-23T00:00:00.000Z', + reference='aliquam', + total_amount=7579.62, + ), + ), + shared.BillPaymentAllocation( + allocation=shared.BillPaymentAllocationAllocation( + allocated_on_date='2022-10-23T00:00:00.000Z', + currency='EUR', + currency_rate=756.1, + total_amount=7513.47, + ), + payment=shared.PaymentAllocationPayment( + account_ref=shared.AccountRef( + id='76230f84-1fb1-4bd2-bfdb-14db6be5a685', + name='Luther Leuschke', + ), + currency='GBP', + currency_rate=6715.68, + id='e20da16f-c2b2-471a-a89c-57e854e90439', + note='quibusdam', + paid_on_date='2022-10-23T00:00:00.000Z', + reference='consequuntur', + total_amount=1594.69, + ), + ), + ], + purchase_order_refs=[ + shared.BillPurchaseOrderReference( + id='65694624-0708-44f7-ab37-cef02225194d', + purchase_order_number='quidem', + ), + shared.BillPurchaseOrderReference( + id='55410adc-669a-4f90-a26c-7cdc981f0689', + purchase_order_number='corrupti', + ), + ], + reference='quae', + source_modified_date='2022-10-23T00:00:00.000Z', + status=shared.BillStatus.PARTIALLY_PAID, + sub_total=7304.37, + supplemental_data=shared.BillSupplementalData( + content={ + "amet": { + "minus": 'hic', + }, + "similique": { + "consectetur": 'labore', + "laudantium": 'cumque', + "adipisci": 'veritatis', + }, + "nam": { + "magnam": 'aperiam', + "ducimus": 'itaque', + "necessitatibus": 'numquam', + "doloribus": 'eligendi', + }, + }, + ), + supplier_ref=shared.SupplierRef( + id='f0c42b78-f156-4263-98a0-dc766324ccb0', + supplier_name='ea', + ), + tax_amount=7713.21, + total_amount=5184.32, + withholding_tax=[ + shared.BillWithholdingTax( + amount=6651.83, + name='Mr. Louise Sipes', + ), + shared.BillWithholdingTax( + amount=1364.32, + name='Miss Victor Kuhlman', + ), + shared.BillWithholdingTax( + amount=8196.9, + name='Courtney Conroy', + ), + shared.BillWithholdingTax( + amount=8506.28, + name='Kirk Heidenreich', + ), + ], + ), + company_id='8a210b68-6988-11ed-a1eb-0242ac120002', + connection_id='2e9d2c44-f675-40ba-8049-353bfcb5e171', + timeout_in_minutes=704665, +) + +res = s.bills.create(req) + +if res.create_bill_response is not None: + # handle response +``` + +### 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 + +**[operations.CreateBillResponse](../../models/operations/createbillresponse.md)** + + +## 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 +import codatsyncpayables +from codatsyncpayables.models import operations, shared + +s = codatsyncpayables.CodatSyncPayables( + security=shared.Security( + auth_header="Basic BASE_64_ENCODED(API_KEY)", + ), +) + +req = operations.DownloadBillAttachmentRequest( + attachment_id='8a210b68-6988-11ed-a1eb-0242ac120002', + bill_id='EILBDVJVNUAGVKRQ', + company_id='8a210b68-6988-11ed-a1eb-0242ac120002', + connection_id='2e9d2c44-f675-40ba-8049-353bfcb5e171', +) + +res = s.bills.download_attachment(req) + +if res.data is not None: + # handle response +``` + +### 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 + +**[operations.DownloadBillAttachmentResponse](../../models/operations/downloadbillattachmentresponse.md)** + + +## 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 +import codatsyncpayables +from codatsyncpayables.models import operations, shared + +s = codatsyncpayables.CodatSyncPayables( + security=shared.Security( + auth_header="Basic BASE_64_ENCODED(API_KEY)", + ), +) + +req = operations.GetBillRequest( + bill_id='EILBDVJVNUAGVKRQ', + company_id='8a210b68-6988-11ed-a1eb-0242ac120002', +) + +res = s.bills.get(req) + +if res.bill is not None: + # handle response +``` + +### Parameters + +| 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. | + + +### Response + +**[operations.GetBillResponse](../../models/operations/getbillresponse.md)** + + +## 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 + +s = codatsyncpayables.CodatSyncPayables( + security=shared.Security( + auth_header="Basic BASE_64_ENCODED(API_KEY)", + ), +) + +req = operations.GetBillAttachmentRequest( + attachment_id='8a210b68-6988-11ed-a1eb-0242ac120002', + bill_id='13d946f0-c5d5-42bc-b092-97ece17923ab', + company_id='8a210b68-6988-11ed-a1eb-0242ac120002', + connection_id='2e9d2c44-f675-40ba-8049-353bfcb5e171', +) + +res = s.bills.get_attachment(req) + +if res.attachment is not None: + # handle response +``` + +### 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 + +**[operations.GetBillAttachmentResponse](../../models/operations/getbillattachmentresponse.md)** + + +## 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 +import codatsyncpayables +from codatsyncpayables.models import operations, shared + +s = codatsyncpayables.CodatSyncPayables( + security=shared.Security( + auth_header="Basic BASE_64_ENCODED(API_KEY)", + ), +) + +req = operations.GetCreateUpdateBillModelRequest( + company_id='8a210b68-6988-11ed-a1eb-0242ac120002', + connection_id='2e9d2c44-f675-40ba-8049-353bfcb5e171', +) + +res = s.bills.get_create_update_model(req) + +if res.push_option is not None: + # handle response +``` + +### 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 + +**[operations.GetCreateUpdateBillModelResponse](../../models/operations/getcreateupdatebillmodelresponse.md)** + + +## 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. + +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 +import codatsyncpayables +from codatsyncpayables.models import operations, shared + +s = codatsyncpayables.CodatSyncPayables( + security=shared.Security( + auth_header="Basic BASE_64_ENCODED(API_KEY)", + ), +) + +req = operations.ListBillsRequest( + company_id='8a210b68-6988-11ed-a1eb-0242ac120002', + order_by='-modifiedDate', + page=1, + page_size=100, + query='dolore', +) + +res = s.bills.list(req) + +if res.bills is not None: + # handle response +``` + +### Parameters + +| Parameter | Type | Required | Description | +| -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | +| `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 + +**[operations.ListBillsResponse](../../models/operations/listbillsresponse.md)** + + +## 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. + +Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=bills) for integrations that support listing bill attachments. + + +### Example Usage + +```python +import codatsyncpayables +from codatsyncpayables.models import operations, shared + +s = codatsyncpayables.CodatSyncPayables( + security=shared.Security( + auth_header="Basic BASE_64_ENCODED(API_KEY)", + ), +) + +req = operations.ListBillAttachmentsRequest( + bill_id='EILBDVJVNUAGVKRQ', + company_id='8a210b68-6988-11ed-a1eb-0242ac120002', + connection_id='2e9d2c44-f675-40ba-8049-353bfcb5e171', +) + +res = s.bills.list_attachments(req) + +if res.attachments is not None: + # handle response +``` + +### 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.ListBillAttachmentsResponse](../../models/operations/listbillattachmentsresponse.md)** + + +## 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 +import codatsyncpayables +from codatsyncpayables.models import operations, shared + +s = codatsyncpayables.CodatSyncPayables( + security=shared.Security( + auth_header="Basic BASE_64_ENCODED(API_KEY)", + ), +) + +req = operations.UpdateBillRequest( + bill=shared.Bill( + amount_due=7053.07, + currency='USD', + currency_rate=3656.76, + due_date='2022-10-23T00:00:00.000Z', + id='693352f7-4533-4994-978d-e3b6e9389f5a', + issue_date='2022-10-23T00:00:00.000Z', + line_items=[ + shared.BillLineItem( + account_ref=shared.AccountRef( + id='7f662550-a283-482a-8483-afd2315bba65', + name='Debra Kerluke', + ), + description='quae', + discount_amount=4090.21, + discount_percentage=9891.22, + is_direct_cost=False, + item_ref=shared.ItemRef( + id='5bf6ae59-1bc8-4bde-b361-2b63c205fda8', + name='Sarah Kuhn', + ), + quantity=6839.8, + sub_total=4359.31, + tax_amount=5383.68, + tax_rate_ref=shared.TaxRateRef( + effective_tax_rate=6382.19, + id='9a35d086-b6f6-46fe-b020-e9f443b4257b', + name='Marshall Daugherty', + ), + total_amount=8301.97, + tracking=shared.Tracking( + category_refs=[ + shared.TrackingCategoryRef( + id='da6a61ef-a219-4825-8fd0-a9eba47f7d3e', + name='Thomas Hahn', + ), + shared.TrackingCategoryRef( + id='40d6a183-1c87-4adf-996f-df1ad837ae80', + name='Ms. Terry Runolfsson', + ), + shared.TrackingCategoryRef( + id='95ba9986-78fa-43f6-9699-1af388ce0361', + name='Eva Gleichner', + ), + ], + customer_ref=shared.TrackingCustomerRef( + company_name='voluptate', + id='977a0ef2-f536-4028-afee-f934152ed7e2', + ), + is_billed_to=shared.BilledToType.NOT_APPLICABLE, + is_rebilled_to=shared.BilledToType.UNKNOWN, + project_ref=shared.TrackingProjectRef( + id='f4c157de-aa71-470f-845a-ccf667aaf9bb', + name='Laurence Blick', + ), + ), + tracking_category_refs=[ + shared.TrackingCategoryRef( + id='e431d6bf-5c83-48fb-b8c2-0cb67fc4b425', + name='Perry Mayert', + ), + shared.TrackingCategoryRef( + id='234c9f7b-79df-4eb7-ba5c-38d4baf91e50', + name='Olive Windler', + ), + shared.TrackingCategoryRef( + id='0a54b475-f16f-456d-b85a-3c4ac631b99e', + name='Ella Runolfsdottir', + ), + shared.TrackingCategoryRef( + id='8f9fdb94-10f6-43bb-b817-837b01afdd78', + name='Chester Daugherty IV', + ), + ], + unit_amount=6138.48, + ), + shared.BillLineItem( + account_ref=shared.AccountRef( + id='eb44873f-5033-4f19-9bf1-25ce4152eab9', + name='Lionel Klocko', + ), + description='odit', + discount_amount=1383.06, + discount_percentage=2593.74, + is_direct_cost=False, + item_ref=shared.ItemRef( + id='a6a0e123-b784-47ec-99e1-f67f3c4cce4b', + name='Angel Kris', + ), + quantity=4001.45, + sub_total=9961.01, + tax_amount=9570.32, + tax_rate_ref=shared.TaxRateRef( + effective_tax_rate=2322.09, + id='c5747501-357e-444f-91f8-b084c3197e19', + name='Rosie Conroy', + ), + total_amount=3088.66, + tracking=shared.Tracking( + category_refs=[ + shared.TrackingCategoryRef( + id='7f94874c-2d5c-4c49-b223-3e66bd8fe5d0', + name='Jeannette Mante', + ), + shared.TrackingCategoryRef( + id='ef203873-2059-40cc-8109-6400313b3e50', + name='Debbie Windler', + ), + ], + customer_ref=shared.TrackingCustomerRef( + company_name='maiores', + id='e72dc407-7d0c-4c3f-808e-fc15ceb4d6e1', + ), + is_billed_to=shared.BilledToType.PROJECT, + is_rebilled_to=shared.BilledToType.CUSTOMER, + project_ref=shared.TrackingProjectRef( + id='e0f75aed-f2ac-4ab5-8b99-1c926ddb5894', + name='Joyce Terry', + ), + ), + tracking_category_refs=[ + shared.TrackingCategoryRef( + id='1cbe6d95-02f0-4ea9-b0b6-9f7ac2f72f88', + name='Karen Barrows I', + ), + ], + unit_amount=5776.22, + ), + shared.BillLineItem( + account_ref=shared.AccountRef( + id='11608207-888e-4c66-983b-fe9659eb40ec', + name='Loretta Wehner', + ), + description='nihil', + discount_amount=3452.7, + discount_percentage=7023.39, + is_direct_cost=False, + item_ref=shared.ItemRef( + id='0b532a4d-a37c-4baa-b445-2c4842c9b2ad', + name='Rose Stoltenberg', + ), + quantity=8968.11, + sub_total=5316.06, + tax_amount=981.23, + tax_rate_ref=shared.TaxRateRef( + effective_tax_rate=6493.73, + id='88f44445-73fe-4cd4-b353-f63c8209379a', + name='Reginald McClure', + ), + total_amount=3210.07, + tracking=shared.Tracking( + category_refs=[ + shared.TrackingCategoryRef( + id='bcf79da1-8a78-422b-b958-94e6861adb55', + name='Nick Torp', + ), + shared.TrackingCategoryRef( + id='751c9fe8-f750-42bf-9c34-50841f176445', + name='Wendy Kling', + ), + shared.TrackingCategoryRef( + id='3fb27e21-f862-4657-b36f-c6b9f587ce52', + name='Brooke Jacobs', + ), + shared.TrackingCategoryRef( + id='41a8312e-5047-4b4c-a1cc-b423abcdc91f', + name='Rex Rau', + ), + ], + customer_ref=shared.TrackingCustomerRef( + company_name='totam', + id='8e71f6c4-8252-4d77-b1e7-fd074009ef8d', + ), + is_billed_to=shared.BilledToType.UNKNOWN, + is_rebilled_to=shared.BilledToType.CUSTOMER, + project_ref=shared.TrackingProjectRef( + id='de1dd709-7b5d-4a08-857f-a6c78a216e19', + name='Pablo Wilkinson', + ), + ), + tracking_category_refs=[ + shared.TrackingCategoryRef( + id='61914981-40b6-44ff-8ae1-70ef03b5f37e', + name='Angie O'Hara', + ), + shared.TrackingCategoryRef( + id='85559667-32aa-45dc-b668-2cb70f8cfd5f', + name='Brent Weber MD', + ), + shared.TrackingCategoryRef( + id='9a9f7484-6e2c-4330-9db0-536d9e75ca00', + name='Lana Hauck', + ), + ], + unit_amount=1500.91, + ), + ], + metadata=shared.Metadata( + is_deleted=False, + ), + modified_date='2022-10-23T00:00:00.000Z', + note='et', + payment_allocations=[ + shared.BillPaymentAllocation( + allocation=shared.BillPaymentAllocationAllocation( + allocated_on_date='2022-10-23T00:00:00.000Z', + currency='GBP', + currency_rate=3322.37, + total_amount=6650.82, + ), + payment=shared.PaymentAllocationPayment( + account_ref=shared.AccountRef( + id='8bf92f97-428a-4d9a-9f8b-f8221125359d', + name='Guy Feest', + ), + currency='EUR', + currency_rate=4820.62, + id='a79cd72c-d248-44da-a172-9f2ac41ef572', + note='quis', + paid_on_date='2022-10-23T00:00:00.000Z', + reference='dicta', + total_amount=1158.49, + ), + ), + ], + purchase_order_refs=[ + shared.BillPurchaseOrderReference( + id='9ac1e41d-8a23-4c23-a34f-2dfa4a197f6d', + purchase_order_number='recusandae', + ), + shared.BillPurchaseOrderReference( + id='922151fe-1712-4099-853e-9f543d854439', + purchase_order_number='accusamus', + ), + ], + reference='voluptates', + source_modified_date='2022-10-23T00:00:00.000Z', + status=shared.BillStatus.UNKNOWN, + sub_total=2805.9, + supplemental_data=shared.BillSupplementalData( + content={ + "laboriosam": { + "tempora": 'aliquam', + }, + "dolorem": { + "impedit": 'architecto', + "minima": 'magnam', + "vitae": 'quos', + }, + }, + ), + supplier_ref=shared.SupplierRef( + id='8c2f56e8-5da7-4832-aabd-617c3b0d51a4', + supplier_name='ut', + ), + tax_amount=6942.92, + total_amount=9852.65, + withholding_tax=[ + shared.BillWithholdingTax( + amount=1013.18, + name='Doug Stiedemann', + ), + ], + ), + bill_id='13d946f0-c5d5-42bc-b092-97ece17923ab', + company_id='8a210b68-6988-11ed-a1eb-0242ac120002', + connection_id='2e9d2c44-f675-40ba-8049-353bfcb5e171', + force_update=False, + timeout_in_minutes=434330, +) + +res = s.bills.update(req) + +if res.update_bill_response is not None: + # handle response +``` + +### 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 + +**[operations.UpdateBillResponse](../../models/operations/updatebillresponse.md)** + + +## 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 +import codatsyncpayables +from codatsyncpayables.models import operations, shared + +s = codatsyncpayables.CodatSyncPayables( + security=shared.Security( + auth_header="Basic BASE_64_ENCODED(API_KEY)", + ), +) + +req = operations.UploadBillAttachmentRequest( + request_body=operations.UploadBillAttachmentRequestBody( + content='temporibus'.encode(), + request_body='incidunt', + ), + bill_id='9wg4lep4ush5cxs79pl8sozmsndbaukll3ind4g7buqbm1h2', + company_id='8a210b68-6988-11ed-a1eb-0242ac120002', + connection_id='2e9d2c44-f675-40ba-8049-353bfcb5e171', +) + +res = s.bills.upload_attachment(req) + +if res.status_code == 200: + # handle response +``` + +### 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. | + + +### Response + +**[operations.UploadBillAttachmentResponse](../../models/operations/uploadbillattachmentresponse.md)** + diff --git a/sync-for-payables/docs/sdks/codatsyncpayables/README.md b/sync-for-payables/docs/sdks/codatsyncpayables/README.md new file mode 100755 index 000000000..a14bddee2 --- /dev/null +++ b/sync-for-payables/docs/sdks/codatsyncpayables/README.md @@ -0,0 +1,12 @@ +# CodatSyncPayables SDK + +## Overview + +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. + +[Read More...](https://docs.codat.io/payables/overview) + +### Available Operations + diff --git a/sync-for-payables/docs/sdks/companies/README.md b/sync-for-payables/docs/sdks/companies/README.md new file mode 100755 index 000000000..76ce8a1c2 --- /dev/null +++ b/sync-for-payables/docs/sdks/companies/README.md @@ -0,0 +1,221 @@ +# companies + +## Overview + +Create and manage your Codat companies. + +### Available Operations + +* [create](#create) - Create company +* [delete](#delete) - Delete a company +* [get](#get) - Get company +* [list](#list) - List companies +* [update](#update) - Update company + +## create + +Creates a new company that can be used to assign connections to. + +If forbidden characters (see `name` pattern) are present in the request, a company will be created with the forbidden characters removed. For example, `Company (Codat[1])` with be created as `Company Codat1`. + + + +### Example Usage + +```python +import codatsyncpayables +from codatsyncpayables.models import shared + +s = codatsyncpayables.CodatSyncPayables( + security=shared.Security( + auth_header="Basic BASE_64_ENCODED(API_KEY)", + ), +) + +req = shared.CompanyRequestBody( + description='Requested early access to the new financing scheme.', + name='Bank of Dave', +) + +res = s.companies.create(req) + +if res.company is not None: + # handle response +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | +| `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)** + + +## delete + + +Permanently deletes a company, its connections and any cached data. This operation is irreversible. If the company ID does not exist an error is returned. + +### Example Usage + +```python +import codatsyncpayables +from codatsyncpayables.models import operations, shared + +s = codatsyncpayables.CodatSyncPayables( + security=shared.Security( + auth_header="Basic BASE_64_ENCODED(API_KEY)", + ), +) + +req = operations.DeleteCompanyRequest( + company_id='8a210b68-6988-11ed-a1eb-0242ac120002', +) + +res = s.companies.delete(req) + +if res.status_code == 200: + # handle response +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | +| `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)** + + +## get + +Returns the company for a valid identifier. If the identifier is for a deleted company, a not found response is returned. + +### Example Usage + +```python +import codatsyncpayables +from codatsyncpayables.models import operations, shared + +s = codatsyncpayables.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) + +if res.company is not None: + # handle response +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | +| `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)** + + +## list + +Returns a list of your companies. The company schema contains a list of [connections](https://docs.codat.io/sync-for-payables-api#/schemas/Connection) related to the company. + +### Example Usage + +```python +import codatsyncpayables +from codatsyncpayables.models import operations, shared + +s = codatsyncpayables.CodatSyncPayables( + security=shared.Security( + auth_header="Basic BASE_64_ENCODED(API_KEY)", + ), +) + +req = operations.ListCompaniesRequest( + order_by='-modifiedDate', + page=1, + page_size=100, + query='alias', +) + +res = s.companies.list(req) + +if res.companies is not None: + # handle response +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | +| `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)** + + +## update + +Updates both the name and description of the company. + +### Example Usage + +```python +import codatsyncpayables +from codatsyncpayables.models import operations, shared + +s = codatsyncpayables.CodatSyncPayables( + security=shared.Security( + auth_header="Basic BASE_64_ENCODED(API_KEY)", + ), +) + +req = operations.UpdateCompanyRequest( + company_request_body=shared.CompanyRequestBody( + description='Requested early access to the new financing scheme.', + name='Bank of Dave', + ), + company_id='8a210b68-6988-11ed-a1eb-0242ac120002', +) + +res = s.companies.update(req) + +if res.company is not None: + # handle response +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | +| `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)** + diff --git a/sync-for-payables/docs/sdks/connections/README.md b/sync-for-payables/docs/sdks/connections/README.md new file mode 100755 index 000000000..73d871765 --- /dev/null +++ b/sync-for-payables/docs/sdks/connections/README.md @@ -0,0 +1,224 @@ +# connections + +## Overview + +Manage your companies' data connections. + +### Available Operations + +* [create](#create) - Create connection +* [delete](#delete) - Delete connection +* [get](#get) - Get connection +* [list](#list) - List connections +* [unlink](#unlink) - Unlink connection + +## create + +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. + +### Example Usage + +```python +import codatsyncpayables +from codatsyncpayables.models import operations, shared + +s = codatsyncpayables.CodatSyncPayables( + security=shared.Security( + auth_header="Basic BASE_64_ENCODED(API_KEY)", + ), +) + +req = operations.CreateConnectionRequest( + request_body=operations.CreateConnectionRequestBody( + platform_key='laudantium', + ), + company_id='8a210b68-6988-11ed-a1eb-0242ac120002', +) + +res = s.connections.create(req) + +if res.connection is not None: + # handle response +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | +| `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)** + + +## delete + +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. + +### Example Usage + +```python +import codatsyncpayables +from codatsyncpayables.models import operations, shared + +s = codatsyncpayables.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', +) + +res = s.connections.delete(req) + +if res.status_code == 200: + # handle response +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | +| `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)** + + +## get + +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. + +### Example Usage + +```python +import codatsyncpayables +from codatsyncpayables.models import operations, shared + +s = codatsyncpayables.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) + +if res.connection is not None: + # handle response +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | +| `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)** + + +## list + +List the connections for a company. + +### Example Usage + +```python +import codatsyncpayables +from codatsyncpayables.models import operations, shared + +s = codatsyncpayables.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, + query='qui', +) + +res = s.connections.list(req) + +if res.connections is not None: + # handle response +``` + +### Parameters + +| Parameter | Type | Required | Description | +| -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | +| `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)** + + +## unlink + +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. + +### Example Usage + +```python +import codatsyncpayables +from codatsyncpayables.models import operations, shared + +s = codatsyncpayables.CodatSyncPayables( + security=shared.Security( + auth_header="Basic BASE_64_ENCODED(API_KEY)", + ), +) + +req = operations.UnlinkConnectionRequest( + request_body=operations.UnlinkConnectionRequestBody( + status='libero', + ), + company_id='8a210b68-6988-11ed-a1eb-0242ac120002', + connection_id='2e9d2c44-f675-40ba-8049-353bfcb5e171', +) + +res = s.connections.unlink(req) + +if res.connection is not None: + # handle response +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | +| `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)** + diff --git a/sync-for-payables/docs/sdks/journalentries/README.md b/sync-for-payables/docs/sdks/journalentries/README.md new file mode 100755 index 000000000..85683ff2b --- /dev/null +++ b/sync-for-payables/docs/sdks/journalentries/README.md @@ -0,0 +1,221 @@ +# journal_entries + +## Overview + +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 +import codatsyncpayables +from codatsyncpayables.models import operations, shared + +s = codatsyncpayables.CodatSyncPayables( + security=shared.Security( + auth_header="Basic BASE_64_ENCODED(API_KEY)", + ), +) + +req = operations.CreateJournalEntryRequest( + journal_entry=shared.JournalEntry( + created_on='2022-10-23T00:00:00.000Z', + description='nam', + id='dc41ff5d-4e2a-4e4f-b5cb-35d17638f1ed', + journal_lines=[ + shared.JournalLine( + account_ref=shared.AccountRef( + id='78359ecc-5cb8-460f-8cd5-80ba73810e4f', + name='Don Hagenes', + ), + currency='magni', + description='excepturi', + net_amount=4576.85, + tracking=shared.JournalLineTracking( + record_refs=[ + shared.RecordRef( + data_type='transfer', + id='3b1dd3bb-ce24-47b7-a84e-ff50126d71cf', + ), + shared.RecordRef( + data_type='transfer', + id='bd0eb74b-8421-4953-b44b-d3c43159d33e', + ), + shared.RecordRef( + data_type='invoice', + id='953c0011-3986-43aa-81e6-c31cc2f1fcb5', + ), + shared.RecordRef( + data_type='journalEntry', + id='c9a41ffb-e9cb-4d79-9ee6-5e076cc7abf6', + ), + ], + ), + ), + shared.JournalLine( + account_ref=shared.AccountRef( + id='16ea5c71-6419-434b-90f2-e09d19d2fc2f', + name='Merle Cormier Jr.', + ), + currency='nemo', + description='provident', + net_amount=2529.57, + tracking=shared.JournalLineTracking( + record_refs=[ + shared.RecordRef( + data_type='accountTransaction', + id='935d237a-72f9-4084-9d6a-ed4aecb7537c', + ), + shared.RecordRef( + data_type='transfer', + id='9222c9ff-5749-41aa-bfa2-e761f0ca4d45', + ), + ], + ), + ), + shared.JournalLine( + account_ref=shared.AccountRef( + id='6ef1031e-6899-4f0c-a001-e22cd55cc058', + name='Hattie Botsford', + ), + currency='possimus', + description='nihil', + net_amount=3758.77, + tracking=shared.JournalLineTracking( + record_refs=[ + shared.RecordRef( + data_type='accountTransaction', + id='71fc820c-65b0-437b-b8e0-cc885187e4de', + ), + shared.RecordRef( + data_type='journalEntry', + id='4af28c5d-ddb4-46aa-9cfd-6d828da01319', + ), + shared.RecordRef( + data_type='journalEntry', + id='12964664-5c1d-481f-a904-2f569b7aff0e', + ), + shared.RecordRef( + data_type='accountTransaction', + id='2216cbe0-71bc-4163-a279-a3b084da9925', + ), + ], + ), + ), + ], + journal_ref=shared.JournalRef( + id='7d04f408-47a7-442d-8449-6cbdeecf6b99', + name='Wilbert Jerde', + ), + metadata=shared.Metadata( + is_deleted=False, + ), + modified_date='2022-10-23T00:00:00.000Z', + posted_on='2022-10-23T00:00:00.000Z', + record_ref=shared.JournalEntryRecordReference( + data_type='transfer', + id='bfdf55c2-94c0-460b-86a1-287764eef6d0', + ), + source_modified_date='2022-10-23T00:00:00.000Z', + supplemental_data=shared.SupplementalData( + content={ + "temporibus": { + "itaque": 'nulla', + "excepturi": 'quod', + }, + "in": { + "temporibus": 'temporibus', + }, + }, + ), + updated_on='2022-10-23T00:00:00.000Z', + ), + company_id='8a210b68-6988-11ed-a1eb-0242ac120002', + connection_id='2e9d2c44-f675-40ba-8049-353bfcb5e171', + timeout_in_minutes=247927, +) + +res = s.journal_entries.create(req) + +if res.create_journal_entry_response is not None: + # handle response +``` + +### 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 + +**[operations.CreateJournalEntryResponse](../../models/operations/createjournalentryresponse.md)** + + +## 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 +import codatsyncpayables +from codatsyncpayables.models import operations, shared + +s = codatsyncpayables.CodatSyncPayables( + security=shared.Security( + auth_header="Basic BASE_64_ENCODED(API_KEY)", + ), +) + +req = operations.GetCreateJournalEntryModelRequest( + company_id='8a210b68-6988-11ed-a1eb-0242ac120002', + connection_id='2e9d2c44-f675-40ba-8049-353bfcb5e171', +) + +res = s.journal_entries.get_create_model(req) + +if res.push_option is not None: + # handle response +``` + +### 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 + +**[operations.GetCreateJournalEntryModelResponse](../../models/operations/getcreatejournalentrymodelresponse.md)** + diff --git a/sync-for-payables/docs/sdks/journals/README.md b/sync-for-payables/docs/sdks/journals/README.md new file mode 100755 index 000000000..c001d53e1 --- /dev/null +++ b/sync-for-payables/docs/sdks/journals/README.md @@ -0,0 +1,221 @@ +# journals + +## Overview + +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 +import codatsyncpayables +from codatsyncpayables.models import operations, shared + +s = codatsyncpayables.CodatSyncPayables( + security=shared.Security( + auth_header="Basic BASE_64_ENCODED(API_KEY)", + ), +) + +req = operations.CreateJournalRequest( + journal=shared.Journal( + created_on='2022-10-23T00:00:00.000Z', + has_children=False, + id='571509a8-e870-4d3c-9a1f-9c242c7b66a1', + journal_code='reiciendis', + metadata=shared.Metadata( + is_deleted=False, + ), + modified_date='2022-10-23T00:00:00.000Z', + name='Sadie Kulas', + parent_id='repellat', + source_modified_date='2022-10-23T00:00:00.000Z', + status=shared.JournalStatus.ARCHIVED, + type='ea', + ), + company_id='8a210b68-6988-11ed-a1eb-0242ac120002', + connection_id='2e9d2c44-f675-40ba-8049-353bfcb5e171', + timeout_in_minutes=477222, +) + +res = s.journals.create(req) + +if res.create_journal_response is not None: + # handle response +``` + +### 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 + +**[operations.CreateJournalResponse](../../models/operations/createjournalresponse.md)** + + +## 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 +import codatsyncpayables +from codatsyncpayables.models import operations, shared + +s = codatsyncpayables.CodatSyncPayables( + security=shared.Security( + auth_header="Basic BASE_64_ENCODED(API_KEY)", + ), +) + +req = operations.GetJournalRequest( + company_id='8a210b68-6988-11ed-a1eb-0242ac120002', + journal_id='vitae', +) + +res = s.journals.get(req) + +if res.journal is not None: + # handle response +``` + +### 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 + +**[operations.GetJournalResponse](../../models/operations/getjournalresponse.md)** + + +## 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 +import codatsyncpayables +from codatsyncpayables.models import operations, shared + +s = codatsyncpayables.CodatSyncPayables( + security=shared.Security( + auth_header="Basic BASE_64_ENCODED(API_KEY)", + ), +) + +req = operations.GetCreateJournalModelRequest( + company_id='8a210b68-6988-11ed-a1eb-0242ac120002', + connection_id='2e9d2c44-f675-40ba-8049-353bfcb5e171', +) + +res = s.journals.get_create_model(req) + +if res.push_option is not None: + # handle response +``` + +### 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 + +**[operations.GetCreateJournalModelResponse](../../models/operations/getcreatejournalmodelresponse.md)** + + +## 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 +import codatsyncpayables +from codatsyncpayables.models import operations, shared + +s = codatsyncpayables.CodatSyncPayables( + security=shared.Security( + auth_header="Basic BASE_64_ENCODED(API_KEY)", + ), +) + +req = operations.ListJournalsRequest( + company_id='8a210b68-6988-11ed-a1eb-0242ac120002', + order_by='-modifiedDate', + page=1, + page_size=100, + query='excepturi', +) + +res = s.journals.list(req) + +if res.journals is not None: + # handle response +``` + +### 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 + +**[operations.ListJournalsResponse](../../models/operations/listjournalsresponse.md)** + diff --git a/sync-for-payables/docs/sdks/managedata/README.md b/sync-for-payables/docs/sdks/managedata/README.md new file mode 100755 index 000000000..24c6444ce --- /dev/null +++ b/sync-for-payables/docs/sdks/managedata/README.md @@ -0,0 +1,221 @@ +# manage_data + +## Overview + +Asynchronously retrieve data from an integration to refresh data in Codat. + +### 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 +import codatsyncpayables +from codatsyncpayables.models import operations, shared + +s = codatsyncpayables.CodatSyncPayables( + security=shared.Security( + auth_header="Basic BASE_64_ENCODED(API_KEY)", + ), +) + +req = operations.GetDataStatusRequest( + company_id='8a210b68-6988-11ed-a1eb-0242ac120002', +) + +res = s.manage_data.get(req) + +if res.data_status_response is not None: + # handle response +``` + +### 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.GetDataStatusResponse](../../models/operations/getdatastatusresponse.md)** + + +## get_pull_operation + +Retrieve information about a single dataset or pull operation. + +### Example Usage + +```python +import codatsyncpayables +from codatsyncpayables.models import operations, shared + +s = codatsyncpayables.CodatSyncPayables( + security=shared.Security( + auth_header="Basic BASE_64_ENCODED(API_KEY)", + ), +) + +req = operations.GetPullOperationRequest( + company_id='8a210b68-6988-11ed-a1eb-0242ac120002', + dataset_id='eaed9f0f-e77b-4bc9-a58f-ab8b4b99ab18', +) + +res = s.manage_data.get_pull_operation(req) + +if res.pull_operation is not None: + # handle response +``` + +### 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 + +**[operations.GetPullOperationResponse](../../models/operations/getpulloperationresponse.md)** + + +## list_pull_operations + +Gets the pull operation history (datasets) for a given company. + +### Example Usage + +```python +import codatsyncpayables +from codatsyncpayables.models import operations, shared + +s = codatsyncpayables.CodatSyncPayables( + security=shared.Security( + auth_header="Basic BASE_64_ENCODED(API_KEY)", + ), +) + +req = operations.ListPullOperationsRequest( + company_id='8a210b68-6988-11ed-a1eb-0242ac120002', + order_by='-modifiedDate', + page=1, + page_size=100, + query='voluptatum', +) + +res = s.manage_data.list_pull_operations(req) + +if res.pull_operations is not None: + # handle response +``` + +### 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 + +**[operations.ListPullOperationsResponse](../../models/operations/listpulloperationsresponse.md)** + + +## 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 +import codatsyncpayables +from codatsyncpayables.models import operations, shared + +s = codatsyncpayables.CodatSyncPayables( + security=shared.Security( + auth_header="Basic BASE_64_ENCODED(API_KEY)", + ), +) + +req = operations.RefreshAllDataTypesRequest( + company_id='8a210b68-6988-11ed-a1eb-0242ac120002', +) + +res = s.manage_data.refresh_all_data_types(req) + +if res.status_code == 200: + # handle response +``` + +### 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. | + + +### Response + +**[operations.RefreshAllDataTypesResponse](../../models/operations/refreshalldatatypesresponse.md)** + + +## 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 +import codatsyncpayables +from codatsyncpayables.models import operations, shared + +s = codatsyncpayables.CodatSyncPayables( + security=shared.Security( + auth_header="Basic BASE_64_ENCODED(API_KEY)", + ), +) + +req = operations.RefreshDataTypeRequest( + company_id='8a210b68-6988-11ed-a1eb-0242ac120002', + connection_id='90f42a4b-b438-4d85-b260-591d745e3c20', + data_type=shared.DataType.INVOICES, +) + +res = s.manage_data.refresh_data_type(req) + +if res.pull_operation is not None: + # handle response +``` + +### 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 + +**[operations.RefreshDataTypeResponse](../../models/operations/refreshdatatyperesponse.md)** + diff --git a/sync-for-payables/docs/sdks/paymentmethods/README.md b/sync-for-payables/docs/sdks/paymentmethods/README.md new file mode 100755 index 000000000..ecd589e2f --- /dev/null +++ b/sync-for-payables/docs/sdks/paymentmethods/README.md @@ -0,0 +1,105 @@ +# payment_methods + +## Overview + +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 +import codatsyncpayables +from codatsyncpayables.models import operations, shared + +s = codatsyncpayables.CodatSyncPayables( + security=shared.Security( + auth_header="Basic BASE_64_ENCODED(API_KEY)", + ), +) + +req = operations.GetPaymentMethodRequest( + company_id='8a210b68-6988-11ed-a1eb-0242ac120002', + payment_method_id='veniam', +) + +res = s.payment_methods.get(req) + +if res.payment_method is not None: + # handle response +``` + +### 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 + +**[operations.GetPaymentMethodResponse](../../models/operations/getpaymentmethodresponse.md)** + + +## 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 +import codatsyncpayables +from codatsyncpayables.models import operations, shared + +s = codatsyncpayables.CodatSyncPayables( + security=shared.Security( + auth_header="Basic BASE_64_ENCODED(API_KEY)", + ), +) + +req = operations.ListPaymentMethodsRequest( + company_id='8a210b68-6988-11ed-a1eb-0242ac120002', + order_by='-modifiedDate', + page=1, + page_size=100, + query='sint', +) + +res = s.payment_methods.list(req) + +if res.payment_methods is not None: + # handle response +``` + +### 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 + +**[operations.ListPaymentMethodsResponse](../../models/operations/listpaymentmethodsresponse.md)** + diff --git a/sync-for-payables/docs/sdks/pushoperations/README.md b/sync-for-payables/docs/sdks/pushoperations/README.md new file mode 100755 index 000000000..303008f8c --- /dev/null +++ b/sync-for-payables/docs/sdks/pushoperations/README.md @@ -0,0 +1,93 @@ +# push_operations + +## Overview + +Access create, update and delete operations made to an SMB's data connection. + +### Available Operations + +* [get](#get) - Get push operation +* [list](#list) - List push operations + +## get + +Retrieve push operation. + +### Example Usage + +```python +import codatsyncpayables +from codatsyncpayables.models import operations, shared + +s = codatsyncpayables.CodatSyncPayables( + security=shared.Security( + auth_header="Basic BASE_64_ENCODED(API_KEY)", + ), +) + +req = operations.GetPushOperationRequest( + company_id='8a210b68-6988-11ed-a1eb-0242ac120002', + push_operation_key='c9c3f567-e0e2-4527-a5b1-d62fcdace1f0', +) + +res = s.push_operations.get(req) + +if res.push_operation is not None: + # handle response +``` + +### 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 + +**[operations.GetPushOperationResponse](../../models/operations/getpushoperationresponse.md)** + + +## list + +List push operation records. + +### Example Usage + +```python +import codatsyncpayables +from codatsyncpayables.models import operations, shared + +s = codatsyncpayables.CodatSyncPayables( + security=shared.Security( + auth_header="Basic BASE_64_ENCODED(API_KEY)", + ), +) + +req = operations.ListPushOperationsRequest( + company_id='8a210b68-6988-11ed-a1eb-0242ac120002', + order_by='-modifiedDate', + page=1, + page_size=100, + query='sunt', +) + +res = s.push_operations.list(req) + +if res.push_operations is not None: + # handle response +``` + +### 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 + +**[operations.ListPushOperationsResponse](../../models/operations/listpushoperationsresponse.md)** + diff --git a/sync-for-payables/docs/sdks/suppliers/README.md b/sync-for-payables/docs/sdks/suppliers/README.md new file mode 100755 index 000000000..cb1f8acfd --- /dev/null +++ b/sync-for-payables/docs/sdks/suppliers/README.md @@ -0,0 +1,342 @@ +# suppliers + +## Overview + +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 +import codatsyncpayables +from codatsyncpayables.models import operations, shared + +s = codatsyncpayables.CodatSyncPayables( + security=shared.Security( + auth_header="Basic BASE_64_ENCODED(API_KEY)", + ), +) + +req = operations.CreateSupplierRequest( + supplier=shared.Supplier( + addresses=[ + shared.SupplierAddresses( + city='South Pollyshire', + country='Cayman Islands', + line1='aspernatur', + line2='sequi', + postal_code='85913-7808', + region='inventore', + type=shared.AccountingAddressType.BILLING, + ), + ], + contact_name='quibusdam', + default_currency='excepturi', + email_address='nostrum', + id='9f439e39-266c-4bd9-9f7a-a2b24113695d', + metadata=shared.Metadata( + is_deleted=False, + ), + modified_date='2022-10-23T00:00:00.000Z', + phone='01224 658 999', + registration_number='nisi', + source_modified_date='2022-10-23T00:00:00.000Z', + status=shared.SupplierStatus.ACTIVE, + supplemental_data=shared.SupplementalData( + content={ + "repellat": { + "eligendi": 'quaerat', + "veniam": 'perspiciatis', + "commodi": 'dolores', + "dicta": 'molestiae', + }, + "maxime": { + "molestias": 'quam', + }, + "molestiae": { + "voluptate": 'eum', + "consectetur": 'velit', + }, + }, + ), + supplier_name='tempora', + tax_number='aspernatur', + ), + company_id='8a210b68-6988-11ed-a1eb-0242ac120002', + connection_id='2e9d2c44-f675-40ba-8049-353bfcb5e171', + timeout_in_minutes=323569, +) + +res = s.suppliers.create(req) + +if res.create_supplier_response is not None: + # handle response +``` + +### 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 + +**[operations.CreateSupplierResponse](../../models/operations/createsupplierresponse.md)** + + +## 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 +import codatsyncpayables +from codatsyncpayables.models import operations, shared + +s = codatsyncpayables.CodatSyncPayables( + security=shared.Security( + auth_header="Basic BASE_64_ENCODED(API_KEY)", + ), +) + +req = operations.GetSupplierRequest( + company_id='8a210b68-6988-11ed-a1eb-0242ac120002', + supplier_id='incidunt', +) + +res = s.suppliers.get(req) + +if res.supplier is not None: + # handle response +``` + +### 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 + +**[operations.GetSupplierResponse](../../models/operations/getsupplierresponse.md)** + + +## 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 +import codatsyncpayables +from codatsyncpayables.models import operations, shared + +s = codatsyncpayables.CodatSyncPayables( + security=shared.Security( + auth_header="Basic BASE_64_ENCODED(API_KEY)", + ), +) + +req = operations.GetCreateUpdateSupplierModelRequest( + company_id='8a210b68-6988-11ed-a1eb-0242ac120002', + connection_id='2e9d2c44-f675-40ba-8049-353bfcb5e171', +) + +res = s.suppliers.get_create_update_model(req) + +if res.push_option is not None: + # handle response +``` + +### 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 + +**[operations.GetCreateUpdateSupplierModelResponse](../../models/operations/getcreateupdatesuppliermodelresponse.md)** + + +## 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. + +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 +import codatsyncpayables +from codatsyncpayables.models import operations, shared + +s = codatsyncpayables.CodatSyncPayables( + security=shared.Security( + auth_header="Basic BASE_64_ENCODED(API_KEY)", + ), +) + +req = operations.ListSuppliersRequest( + company_id='8a210b68-6988-11ed-a1eb-0242ac120002', + order_by='-modifiedDate', + page=1, + page_size=100, + query='alias', +) + +res = s.suppliers.list(req) + +if res.suppliers is not None: + # handle response +``` + +### 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 + +**[operations.ListSuppliersResponse](../../models/operations/listsuppliersresponse.md)** + + +## 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 +import codatsyncpayables +from codatsyncpayables.models import operations, shared + +s = codatsyncpayables.CodatSyncPayables( + security=shared.Security( + auth_header="Basic BASE_64_ENCODED(API_KEY)", + ), +) + +req = operations.UpdateSupplierRequest( + supplier=shared.Supplier( + addresses=[ + shared.SupplierAddresses( + city='Murlworth', + country='Portugal', + line1='minima', + line2='cupiditate', + postal_code='08550', + region='perspiciatis', + type=shared.AccountingAddressType.UNKNOWN, + ), + ], + contact_name='corporis', + default_currency='ullam', + email_address='molestiae', + id='389cedba-c7fd-4a39-994d-66bc2ae48063', + metadata=shared.Metadata( + is_deleted=False, + ), + modified_date='2022-10-23T00:00:00.000Z', + phone='01224 658 999', + registration_number='iste', + source_modified_date='2022-10-23T00:00:00.000Z', + status=shared.SupplierStatus.UNKNOWN, + supplemental_data=shared.SupplementalData( + content={ + "libero": { + "voluptatibus": 'id', + "qui": 'explicabo', + }, + "accusantium": { + "nesciunt": 'commodi', + "molestias": 'atque', + }, + }, + ), + supplier_name='explicabo', + tax_number='totam', + ), + company_id='8a210b68-6988-11ed-a1eb-0242ac120002', + connection_id='2e9d2c44-f675-40ba-8049-353bfcb5e171', + force_update=False, + supplier_id='ipsam', + timeout_in_minutes=367727, +) + +res = s.suppliers.update(req) + +if res.update_supplier_response is not None: + # handle response +``` + +### 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 + +**[operations.UpdateSupplierResponse](../../models/operations/updatesupplierresponse.md)** + diff --git a/sync-for-payables/docs/sdks/taxrates/README.md b/sync-for-payables/docs/sdks/taxrates/README.md new file mode 100755 index 000000000..7421ec91d --- /dev/null +++ b/sync-for-payables/docs/sdks/taxrates/README.md @@ -0,0 +1,105 @@ +# tax_rates + +## Overview + +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 package. + +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 +import codatsyncpayables +from codatsyncpayables.models import operations, shared + +s = codatsyncpayables.CodatSyncPayables( + security=shared.Security( + auth_header="Basic BASE_64_ENCODED(API_KEY)", + ), +) + +req = operations.GetTaxRateRequest( + company_id='8a210b68-6988-11ed-a1eb-0242ac120002', + tax_rate_id='sequi', +) + +res = s.tax_rates.get(req) + +if res.tax_rate is not None: + # handle response +``` + +### 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 + +**[operations.GetTaxRateResponse](../../models/operations/gettaxrateresponse.md)** + + +## 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 package. + +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 +import codatsyncpayables +from codatsyncpayables.models import operations, shared + +s = codatsyncpayables.CodatSyncPayables( + security=shared.Security( + auth_header="Basic BASE_64_ENCODED(API_KEY)", + ), +) + +req = operations.ListTaxRatesRequest( + company_id='8a210b68-6988-11ed-a1eb-0242ac120002', + order_by='-modifiedDate', + page=1, + page_size=100, + query='optio', +) + +res = s.tax_rates.list(req) + +if res.tax_rates is not None: + # handle response +``` + +### 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 + +**[operations.ListTaxRatesResponse](../../models/operations/listtaxratesresponse.md)** + diff --git a/sync-for-payables/docs/sdks/trackingcategories/README.md b/sync-for-payables/docs/sdks/trackingcategories/README.md new file mode 100755 index 000000000..4b313e9ce --- /dev/null +++ b/sync-for-payables/docs/sdks/trackingcategories/README.md @@ -0,0 +1,105 @@ +# tracking_categories + +## Overview + +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 +import codatsyncpayables +from codatsyncpayables.models import operations, shared + +s = codatsyncpayables.CodatSyncPayables( + security=shared.Security( + auth_header="Basic BASE_64_ENCODED(API_KEY)", + ), +) + +req = operations.GetTrackingCategoryRequest( + company_id='8a210b68-6988-11ed-a1eb-0242ac120002', + tracking_category_id='libero', +) + +res = s.tracking_categories.get(req) + +if res.tracking_category_tree is not None: + # handle response +``` + +### 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 + +**[operations.GetTrackingCategoryResponse](../../models/operations/gettrackingcategoryresponse.md)** + + +## 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 +import codatsyncpayables +from codatsyncpayables.models import operations, shared + +s = codatsyncpayables.CodatSyncPayables( + security=shared.Security( + auth_header="Basic BASE_64_ENCODED(API_KEY)", + ), +) + +req = operations.ListTrackingCategoriesRequest( + company_id='8a210b68-6988-11ed-a1eb-0242ac120002', + order_by='-modifiedDate', + page=1, + page_size=100, + query='ab', +) + +res = s.tracking_categories.list(req) + +if res.tracking_categories is not None: + # handle response +``` + +### 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 + +**[operations.ListTrackingCategoriesResponse](../../models/operations/listtrackingcategoriesresponse.md)** + diff --git a/sync-for-payables/files.gen b/sync-for-payables/files.gen new file mode 100755 index 000000000..1c4645d83 --- /dev/null +++ b/sync-for-payables/files.gen @@ -0,0 +1,421 @@ +src/codatsyncpayables/sdkconfiguration.py +src/codatsyncpayables/accounts.py +src/codatsyncpayables/bill_credit_notes.py +src/codatsyncpayables/bill_payments.py +src/codatsyncpayables/bills.py +src/codatsyncpayables/companies.py +src/codatsyncpayables/connections.py +src/codatsyncpayables/journal_entries.py +src/codatsyncpayables/journals.py +src/codatsyncpayables/manage_data.py +src/codatsyncpayables/payment_methods.py +src/codatsyncpayables/push_operations.py +src/codatsyncpayables/suppliers.py +src/codatsyncpayables/tax_rates.py +src/codatsyncpayables/tracking_categories.py +src/codatsyncpayables/sdk.py +pylintrc +setup.py +src/codatsyncpayables/__init__.py +src/codatsyncpayables/models/__init__.py +src/codatsyncpayables/models/errors/sdkerror.py +src/codatsyncpayables/utils/__init__.py +src/codatsyncpayables/utils/retries.py +src/codatsyncpayables/utils/utils.py +src/codatsyncpayables/models/operations/create_account.py +src/codatsyncpayables/models/operations/get_account.py +src/codatsyncpayables/models/operations/get_create_account_model.py +src/codatsyncpayables/models/operations/list_accounts.py +src/codatsyncpayables/models/operations/create_bill_credit_note.py +src/codatsyncpayables/models/operations/get_bill_credit_note.py +src/codatsyncpayables/models/operations/get_create_update_billcreditnote_model.py +src/codatsyncpayables/models/operations/list_bill_credit_notes.py +src/codatsyncpayables/models/operations/update_bill_credit_note.py +src/codatsyncpayables/models/operations/create_bill_payment.py +src/codatsyncpayables/models/operations/get_bill_payments.py +src/codatsyncpayables/models/operations/get_create_billpayment_model.py +src/codatsyncpayables/models/operations/list_bill_payments.py +src/codatsyncpayables/models/operations/create_bill.py +src/codatsyncpayables/models/operations/download_bill_attachment.py +src/codatsyncpayables/models/operations/get_bill.py +src/codatsyncpayables/models/operations/get_bill_attachment.py +src/codatsyncpayables/models/operations/get_create_update_bill_model.py +src/codatsyncpayables/models/operations/list_bills.py +src/codatsyncpayables/models/operations/list_bill_attachments.py +src/codatsyncpayables/models/operations/update_bill.py +src/codatsyncpayables/models/operations/upload_bill_attachment.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/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/operations/create_journal_entry.py +src/codatsyncpayables/models/operations/get_create_journalentry_model.py +src/codatsyncpayables/models/operations/create_journal.py +src/codatsyncpayables/models/operations/get_journal.py +src/codatsyncpayables/models/operations/get_create_journal_model.py +src/codatsyncpayables/models/operations/list_journals.py +src/codatsyncpayables/models/operations/get_data_status.py +src/codatsyncpayables/models/operations/get_pull_operation.py +src/codatsyncpayables/models/operations/list_pull_operations.py +src/codatsyncpayables/models/operations/refresh_all_data_types.py +src/codatsyncpayables/models/operations/refresh_data_type.py +src/codatsyncpayables/models/operations/get_payment_method.py +src/codatsyncpayables/models/operations/list_payment_methods.py +src/codatsyncpayables/models/operations/get_push_operation.py +src/codatsyncpayables/models/operations/list_push_operations.py +src/codatsyncpayables/models/operations/create_supplier.py +src/codatsyncpayables/models/operations/get_supplier.py +src/codatsyncpayables/models/operations/get_create_update_supplier_model.py +src/codatsyncpayables/models/operations/list_suppliers.py +src/codatsyncpayables/models/operations/update_supplier.py +src/codatsyncpayables/models/operations/get_tax_rate.py +src/codatsyncpayables/models/operations/list_tax_rates.py +src/codatsyncpayables/models/operations/get_tracking_category.py +src/codatsyncpayables/models/operations/list_tracking_categories.py +src/codatsyncpayables/models/operations/__init__.py +src/codatsyncpayables/models/shared/errormessage.py +src/codatsyncpayables/models/shared/createaccountresponse.py +src/codatsyncpayables/models/shared/validation.py +src/codatsyncpayables/models/shared/validationitem.py +src/codatsyncpayables/models/shared/pushoperationstatus.py +src/codatsyncpayables/models/shared/datatype.py +src/codatsyncpayables/models/shared/account.py +src/codatsyncpayables/models/shared/accounttype.py +src/codatsyncpayables/models/shared/accountstatus.py +src/codatsyncpayables/models/shared/metadata.py +src/codatsyncpayables/models/shared/pushoperationchange.py +src/codatsyncpayables/models/shared/pushchangetype.py +src/codatsyncpayables/models/shared/pushoperationref.py +src/codatsyncpayables/models/shared/pushoption.py +src/codatsyncpayables/models/shared/pushvalidationinfo.py +src/codatsyncpayables/models/shared/pushfieldvalidation.py +src/codatsyncpayables/models/shared/pushoptiontype.py +src/codatsyncpayables/models/shared/pushoptionproperty.py +src/codatsyncpayables/models/shared/pushoptionchoice.py +src/codatsyncpayables/models/shared/accounts.py +src/codatsyncpayables/models/shared/links.py +src/codatsyncpayables/models/shared/halref.py +src/codatsyncpayables/models/shared/createbillcreditnoteresponse.py +src/codatsyncpayables/models/shared/billcreditnote.py +src/codatsyncpayables/models/shared/withholdingtaxitems.py +src/codatsyncpayables/models/shared/supplierref.py +src/codatsyncpayables/models/shared/supplementaldata.py +src/codatsyncpayables/models/shared/billcreditnotestatus.py +src/codatsyncpayables/models/shared/items.py +src/codatsyncpayables/models/shared/paymentallocationpayment.py +src/codatsyncpayables/models/shared/accountref.py +src/codatsyncpayables/models/shared/billcreditnotelineitem.py +src/codatsyncpayables/models/shared/trackingcategoryref.py +src/codatsyncpayables/models/shared/billedtotype.py +src/codatsyncpayables/models/shared/taxrateref.py +src/codatsyncpayables/models/shared/billcreditnotes.py +src/codatsyncpayables/models/shared/updatebillcreditnoteresponse.py +src/codatsyncpayables/models/shared/createbillpaymentresponse.py +src/codatsyncpayables/models/shared/billpayment.py +src/codatsyncpayables/models/shared/billpaymentline.py +src/codatsyncpayables/models/shared/billpaymentlinelink.py +src/codatsyncpayables/models/shared/billpaymentlinelinktype.py +src/codatsyncpayables/models/shared/billpayments.py +src/codatsyncpayables/models/shared/createbillresponse.py +src/codatsyncpayables/models/shared/bill.py +src/codatsyncpayables/models/shared/billstatus.py +src/codatsyncpayables/models/shared/billlineitem.py +src/codatsyncpayables/models/shared/tracking.py +src/codatsyncpayables/models/shared/itemref.py +src/codatsyncpayables/models/shared/attachment.py +src/codatsyncpayables/models/shared/bills.py +src/codatsyncpayables/models/shared/attachments.py +src/codatsyncpayables/models/shared/updatebillresponse.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/companyrequestbody.py +src/codatsyncpayables/models/shared/companies.py +src/codatsyncpayables/models/shared/connections.py +src/codatsyncpayables/models/shared/createjournalentryresponse.py +src/codatsyncpayables/models/shared/journalentry.py +src/codatsyncpayables/models/shared/journalref.py +src/codatsyncpayables/models/shared/journalline.py +src/codatsyncpayables/models/shared/recordref.py +src/codatsyncpayables/models/shared/createjournalresponse.py +src/codatsyncpayables/models/shared/journal.py +src/codatsyncpayables/models/shared/journalstatus.py +src/codatsyncpayables/models/shared/journals.py +src/codatsyncpayables/models/shared/datastatus.py +src/codatsyncpayables/models/shared/pulloperation.py +src/codatsyncpayables/models/shared/pulloperations.py +src/codatsyncpayables/models/shared/paymentmethod.py +src/codatsyncpayables/models/shared/paymentmethodtype.py +src/codatsyncpayables/models/shared/paymentmethodstatus.py +src/codatsyncpayables/models/shared/paymentmethods.py +src/codatsyncpayables/models/shared/pushoperation.py +src/codatsyncpayables/models/shared/pushoperations.py +src/codatsyncpayables/models/shared/createsupplierresponse.py +src/codatsyncpayables/models/shared/supplier.py +src/codatsyncpayables/models/shared/supplierstatus.py +src/codatsyncpayables/models/shared/accountingaddresstype.py +src/codatsyncpayables/models/shared/suppliers.py +src/codatsyncpayables/models/shared/updatesupplierresponse.py +src/codatsyncpayables/models/shared/taxrate.py +src/codatsyncpayables/models/shared/validdatatypelinksitems.py +src/codatsyncpayables/models/shared/taxratestatus.py +src/codatsyncpayables/models/shared/taxratecomponent.py +src/codatsyncpayables/models/shared/taxrates.py +src/codatsyncpayables/models/shared/trackingcategorytree.py +src/codatsyncpayables/models/shared/status.py +src/codatsyncpayables/models/shared/trackingcategories.py +src/codatsyncpayables/models/shared/trackingcategory.py +src/codatsyncpayables/models/shared/security.py +src/codatsyncpayables/models/shared/__init__.py +src/codatsyncpayables/models/errors/__init__.py +docs/sdks/codatsyncpayables/README.md +docs/models/utils/retryconfig.md +docs/sdks/accounts/README.md +docs/sdks/billcreditnotes/README.md +docs/sdks/billpayments/README.md +docs/sdks/bills/README.md +docs/sdks/companies/README.md +docs/sdks/connections/README.md +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 +USAGE.md +docs/models/operations/createaccountrequest.md +docs/models/operations/createaccountresponse.md +docs/models/operations/getaccountrequest.md +docs/models/operations/getaccountresponse.md +docs/models/operations/getcreateaccountmodelrequest.md +docs/models/operations/getcreateaccountmodelresponse.md +docs/models/operations/listaccountsrequest.md +docs/models/operations/listaccountsresponse.md +docs/models/operations/createbillcreditnoterequest.md +docs/models/operations/createbillcreditnoteresponse.md +docs/models/operations/getbillcreditnoterequest.md +docs/models/operations/getbillcreditnoteresponse.md +docs/models/operations/getcreateupdatebillcreditnotemodelrequest.md +docs/models/operations/getcreateupdatebillcreditnotemodelresponse.md +docs/models/operations/listbillcreditnotesrequest.md +docs/models/operations/listbillcreditnotesresponse.md +docs/models/operations/updatebillcreditnoterequest.md +docs/models/operations/updatebillcreditnoteresponse.md +docs/models/operations/createbillpaymentrequest.md +docs/models/operations/createbillpaymentresponse.md +docs/models/operations/getbillpaymentsrequest.md +docs/models/operations/getbillpaymentsresponse.md +docs/models/operations/getcreatebillpaymentmodelrequest.md +docs/models/operations/getcreatebillpaymentmodelresponse.md +docs/models/operations/listbillpaymentsrequest.md +docs/models/operations/listbillpaymentsresponse.md +docs/models/operations/createbillrequest.md +docs/models/operations/createbillresponse.md +docs/models/operations/downloadbillattachmentrequest.md +docs/models/operations/downloadbillattachmentresponse.md +docs/models/operations/getbillrequest.md +docs/models/operations/getbillresponse.md +docs/models/operations/getbillattachmentrequest.md +docs/models/operations/getbillattachmentresponse.md +docs/models/operations/getcreateupdatebillmodelrequest.md +docs/models/operations/getcreateupdatebillmodelresponse.md +docs/models/operations/listbillsrequest.md +docs/models/operations/listbillsresponse.md +docs/models/operations/listbillattachmentsrequest.md +docs/models/operations/listbillattachmentsresponse.md +docs/models/operations/updatebillrequest.md +docs/models/operations/updatebillresponse.md +docs/models/operations/uploadbillattachmentrequestbody.md +docs/models/operations/uploadbillattachmentrequest.md +docs/models/operations/uploadbillattachmentresponse.md +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/createconnectionrequestbody.md +docs/models/operations/createconnectionrequest.md +docs/models/operations/createconnectionresponse.md +docs/models/operations/deleteconnectionrequest.md +docs/models/operations/deleteconnectionresponse.md +docs/models/operations/getconnectionrequest.md +docs/models/operations/getconnectionresponse.md +docs/models/operations/listconnectionsrequest.md +docs/models/operations/listconnectionsresponse.md +docs/models/operations/unlinkconnectionrequestbody.md +docs/models/operations/unlinkconnectionrequest.md +docs/models/operations/unlinkconnectionresponse.md +docs/models/operations/createjournalentryrequest.md +docs/models/operations/createjournalentryresponse.md +docs/models/operations/getcreatejournalentrymodelrequest.md +docs/models/operations/getcreatejournalentrymodelresponse.md +docs/models/operations/createjournalrequest.md +docs/models/operations/createjournalresponse.md +docs/models/operations/getjournalrequest.md +docs/models/operations/getjournalresponse.md +docs/models/operations/getcreatejournalmodelrequest.md +docs/models/operations/getcreatejournalmodelresponse.md +docs/models/operations/listjournalsrequest.md +docs/models/operations/listjournalsresponse.md +docs/models/operations/getdatastatusrequest.md +docs/models/operations/getdatastatusresponse.md +docs/models/operations/getpulloperationrequest.md +docs/models/operations/getpulloperationresponse.md +docs/models/operations/listpulloperationsrequest.md +docs/models/operations/listpulloperationsresponse.md +docs/models/operations/refreshalldatatypesrequest.md +docs/models/operations/refreshalldatatypesresponse.md +docs/models/operations/refreshdatatyperequest.md +docs/models/operations/refreshdatatyperesponse.md +docs/models/operations/getpaymentmethodrequest.md +docs/models/operations/getpaymentmethodresponse.md +docs/models/operations/listpaymentmethodsrequest.md +docs/models/operations/listpaymentmethodsresponse.md +docs/models/operations/getpushoperationrequest.md +docs/models/operations/getpushoperationresponse.md +docs/models/operations/listpushoperationsrequest.md +docs/models/operations/listpushoperationsresponse.md +docs/models/operations/createsupplierrequest.md +docs/models/operations/createsupplierresponse.md +docs/models/operations/getsupplierrequest.md +docs/models/operations/getsupplierresponse.md +docs/models/operations/getcreateupdatesuppliermodelrequest.md +docs/models/operations/getcreateupdatesuppliermodelresponse.md +docs/models/operations/listsuppliersrequest.md +docs/models/operations/listsuppliersresponse.md +docs/models/operations/updatesupplierrequest.md +docs/models/operations/updatesupplierresponse.md +docs/models/operations/gettaxraterequest.md +docs/models/operations/gettaxrateresponse.md +docs/models/operations/listtaxratesrequest.md +docs/models/operations/listtaxratesresponse.md +docs/models/operations/gettrackingcategoryrequest.md +docs/models/operations/gettrackingcategoryresponse.md +docs/models/operations/listtrackingcategoriesrequest.md +docs/models/operations/listtrackingcategoriesresponse.md +docs/models/shared/errormessage.md +docs/models/shared/createaccountresponse.md +docs/models/shared/validation.md +docs/models/shared/validationitem.md +docs/models/shared/pushoperationstatus.md +docs/models/shared/datatype.md +docs/models/shared/accountvaliddatatypelinks.md +docs/models/shared/account.md +docs/models/shared/accounttype.md +docs/models/shared/accountstatus.md +docs/models/shared/metadata.md +docs/models/shared/pushoperationchange.md +docs/models/shared/pushchangetype.md +docs/models/shared/pushoperationref.md +docs/models/shared/pushoption.md +docs/models/shared/pushvalidationinfo.md +docs/models/shared/pushfieldvalidation.md +docs/models/shared/pushoptiontype.md +docs/models/shared/pushoptionproperty.md +docs/models/shared/pushoptionchoice.md +docs/models/shared/accounts.md +docs/models/shared/links.md +docs/models/shared/halref.md +docs/models/shared/createbillcreditnoteresponse.md +docs/models/shared/billcreditnote.md +docs/models/shared/withholdingtaxitems.md +docs/models/shared/supplierref.md +docs/models/shared/supplementaldata.md +docs/models/shared/billcreditnotestatus.md +docs/models/shared/itemsallocation.md +docs/models/shared/items.md +docs/models/shared/paymentallocationpayment.md +docs/models/shared/accountref.md +docs/models/shared/billcreditnotelineitemitemreference.md +docs/models/shared/billcreditnotelineitemtrackingcustomerref.md +docs/models/shared/billcreditnotelineitemtrackingprojectref.md +docs/models/shared/billcreditnotelineitemtracking.md +docs/models/shared/billcreditnotelineitem.md +docs/models/shared/trackingcategoryref.md +docs/models/shared/billedtotype.md +docs/models/shared/taxrateref.md +docs/models/shared/billcreditnotes.md +docs/models/shared/updatebillcreditnoteresponse.md +docs/models/shared/createbillpaymentresponse.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/createbillresponse.md +docs/models/shared/billpaymentallocationallocation.md +docs/models/shared/billpaymentallocation.md +docs/models/shared/billpurchaseorderreference.md +docs/models/shared/billsupplementaldata.md +docs/models/shared/billwithholdingtax.md +docs/models/shared/bill.md +docs/models/shared/billstatus.md +docs/models/shared/billlineitem.md +docs/models/shared/trackingcustomerref.md +docs/models/shared/trackingprojectref.md +docs/models/shared/tracking.md +docs/models/shared/itemref.md +docs/models/shared/attachment.md +docs/models/shared/bills.md +docs/models/shared/attachments.md +docs/models/shared/updatebillresponse.md +docs/models/shared/company.md +docs/models/shared/connectionsourcetype.md +docs/models/shared/connection.md +docs/models/shared/dataconnectionstatus.md +docs/models/shared/dataconnectionerror.md +docs/models/shared/companyrequestbody.md +docs/models/shared/companies.md +docs/models/shared/connections.md +docs/models/shared/createjournalentryresponse.md +docs/models/shared/journalentryrecordreference.md +docs/models/shared/journalentry.md +docs/models/shared/journalref.md +docs/models/shared/journallinetracking.md +docs/models/shared/journalline.md +docs/models/shared/recordref.md +docs/models/shared/createjournalresponse.md +docs/models/shared/journal.md +docs/models/shared/journalstatus.md +docs/models/shared/journals.md +docs/models/shared/datastatus.md +docs/models/shared/pulloperationstatus.md +docs/models/shared/pulloperation.md +docs/models/shared/pulloperations.md +docs/models/shared/paymentmethod.md +docs/models/shared/paymentmethodtype.md +docs/models/shared/paymentmethodstatus.md +docs/models/shared/paymentmethods.md +docs/models/shared/pushoperation.md +docs/models/shared/pushoperations.md +docs/models/shared/createsupplierresponse.md +docs/models/shared/supplieraddresses.md +docs/models/shared/supplier.md +docs/models/shared/supplierstatus.md +docs/models/shared/accountingaddresstype.md +docs/models/shared/suppliers.md +docs/models/shared/updatesupplierresponse.md +docs/models/shared/taxrate.md +docs/models/shared/validdatatypelinksitems.md +docs/models/shared/taxratestatus.md +docs/models/shared/taxratecomponent.md +docs/models/shared/taxrates.md +docs/models/shared/trackingcategorytree.md +docs/models/shared/status.md +docs/models/shared/trackingcategories.md +docs/models/shared/trackingcategory.md +docs/models/shared/security.md +.gitattributes \ No newline at end of file diff --git a/sync-for-payables/gen.yaml b/sync-for-payables/gen.yaml index 774fe9768..9fbde2a48 100644 --- a/sync-for-payables/gen.yaml +++ b/sync-for-payables/gen.yaml @@ -1,15 +1,24 @@ configVersion: 1.0.0 management: - docChecksum: 853aebc76021ec17db9b1abb7a33f340 - docVersion: 2.1.0 - speakeasyVersion: 1.53.0 - generationVersion: 2.58.0 + docChecksum: b7bf802b6746f134e324836b43a62791 + docVersion: 3.0.0 + speakeasyVersion: 1.77.1 + generationVersion: 2.91.4 generation: sdkClassName: CodatSyncPayables singleTagPerOp: false telemetryEnabled: true +features: + python: + core: 2.85.1 + deprecations: 2.81.1 + examples: 2.81.1 + globalSecurity: 2.81.1 + globalServerURLs: 2.82.0 + nameOverrides: 2.81.1 + retries: 2.81.1 python: - version: 0.0.0 + version: 0.1.0 author: Codat description: Streamline your customers' accounts payable workflow. maxMethodParams: 0 diff --git a/sync-for-payables/pylintrc b/sync-for-payables/pylintrc new file mode 100755 index 000000000..ab6495dd6 --- /dev/null +++ b/sync-for-payables/pylintrc @@ -0,0 +1,643 @@ +[MAIN] + +# Analyse import fallback blocks. This can be used to support both Python 2 and +# 3 compatible code, which means that the block might have code that exists +# only in one or another interpreter, leading to false positives when analysed. +analyse-fallback-blocks=no + +# Clear in-memory caches upon conclusion of linting. Useful if running pylint +# in a server-like mode. +clear-cache-post-run=no + +# Load and enable all available extensions. Use --list-extensions to see a list +# all available extensions. +#enable-all-extensions= + +# In error mode, messages with a category besides ERROR or FATAL are +# suppressed, and no reports are done by default. Error mode is compatible with +# disabling specific errors. +#errors-only= + +# Always return a 0 (non-error) status code, even if lint errors are found. +# This is primarily useful in continuous integration scripts. +#exit-zero= + +# A comma-separated list of package or module names from where C extensions may +# be loaded. Extensions are loading into the active Python interpreter and may +# run arbitrary code. +extension-pkg-allow-list= + +# A comma-separated list of package or module names from where C extensions may +# be loaded. Extensions are loading into the active Python interpreter and may +# run arbitrary code. (This is an alternative name to extension-pkg-allow-list +# for backward compatibility.) +extension-pkg-whitelist= + +# Return non-zero exit code if any of these messages/categories are detected, +# even if score is above --fail-under value. Syntax same as enable. Messages +# specified are enabled, while categories only check already-enabled messages. +fail-on= + +# Specify a score threshold under which the program will exit with error. +fail-under=10 + +# Interpret the stdin as a python script, whose filename needs to be passed as +# the module_or_package argument. +#from-stdin= + +# Files or directories to be skipped. They should be base names, not paths. +ignore=CVS + +# Add files or directories matching the regular expressions patterns to the +# ignore-list. The regex matches against paths and can be in Posix or Windows +# format. Because '\\' represents the directory delimiter on Windows systems, +# it can't be used as an escape character. +ignore-paths= + +# Files or directories matching the regular expression patterns are skipped. +# The regex matches against base names, not paths. The default value ignores +# 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. +ignored-modules= + +# Python code to execute, usually for sys.path manipulation such as +# pygtk.require(). +#init-hook= + +# Use multiple processes to speed up Pylint. Specifying 0 will auto-detect the +# number of processors available to use, and will cap the count on Windows to +# avoid hangs. +jobs=1 + +# Control the amount of potential inferred values when inferring a single +# object. This can help the performance when dealing with large functions or +# complex, nested conditions. +limit-inference-results=100 + +# List of plugins (as comma separated values of python module names) to load, +# usually to register additional checkers. +load-plugins= + +# Pickle collected data for later comparisons. +persistent=yes + +# Minimum Python version to use for version dependent checks. Will default to +# the version used to run pylint. +py-version=3.9 + +# Discover python modules and packages in the file system subtree. +recursive=no + +# When enabled, pylint would attempt to guess common misconfiguration and emit +# user-friendly hints instead of false-positive error messages. +suggestion-mode=yes + +# Allow loading of arbitrary C extensions. Extensions are imported into the +# active Python interpreter and may run arbitrary code. +unsafe-load-any-extension=no + +# In verbose mode, extra non-checker-related info will be displayed. +#verbose= + + +[BASIC] + +# Naming style matching correct argument names. +argument-naming-style=snake_case + +# Regular expression matching correct argument names. Overrides argument- +# naming-style. If left empty, argument names will be checked with the set +# naming style. +#argument-rgx= + +# Naming style matching correct attribute names. +attr-naming-style=snake_case + +# Regular expression matching correct attribute names. Overrides attr-naming- +# style. If left empty, attribute names will be checked with the set naming +# style. +#attr-rgx= + +# Bad variable names which should always be refused, separated by a comma. +bad-names= + +# Bad variable names regexes, separated by a comma. If names match any regex, +# they will always be refused +bad-names-rgxs= + +# Naming style matching correct class attribute names. +class-attribute-naming-style=any + +# Regular expression matching correct class attribute names. Overrides class- +# attribute-naming-style. If left empty, class attribute names will be checked +# with the set naming style. +#class-attribute-rgx= + +# Naming style matching correct class constant names. +class-const-naming-style=UPPER_CASE + +# Regular expression matching correct class constant names. Overrides class- +# const-naming-style. If left empty, class constant names will be checked with +# the set naming style. +#class-const-rgx= + +# Naming style matching correct class names. +class-naming-style=PascalCase + +# Regular expression matching correct class names. Overrides class-naming- +# style. If left empty, class names will be checked with the set naming style. +#class-rgx= + +# Naming style matching correct constant names. +const-naming-style=UPPER_CASE + +# Regular expression matching correct constant names. Overrides const-naming- +# style. If left empty, constant names will be checked with the set naming +# style. +#const-rgx= + +# Minimum line length for functions/classes that require docstrings, shorter +# ones are exempt. +docstring-min-length=-1 + +# Naming style matching correct function names. +function-naming-style=snake_case + +# Regular expression matching correct function names. Overrides function- +# naming-style. If left empty, function names will be checked with the set +# naming style. +#function-rgx= + +# Good variable names which should always be accepted, separated by a comma. +good-names=i, + j, + k, + ex, + Run, + _, + id + +# Good variable names regexes, separated by a comma. If names match any regex, +# they will always be accepted +good-names-rgxs= + +# Include a hint for the correct naming format with invalid-name. +include-naming-hint=no + +# Naming style matching correct inline iteration names. +inlinevar-naming-style=any + +# Regular expression matching correct inline iteration names. Overrides +# inlinevar-naming-style. If left empty, inline iteration names will be checked +# with the set naming style. +#inlinevar-rgx= + +# Naming style matching correct method names. +method-naming-style=snake_case + +# Regular expression matching correct method names. Overrides method-naming- +# style. If left empty, method names will be checked with the set naming style. +#method-rgx= + +# Naming style matching correct module names. +module-naming-style=snake_case + +# Regular expression matching correct module names. Overrides module-naming- +# style. If left empty, module names will be checked with the set naming style. +#module-rgx= + +# Colon-delimited sets of names that determine each other's naming style when +# the name regexes allow several styles. +name-group= + +# Regular expression which should only match function or class names that do +# not require a docstring. +no-docstring-rgx=^_ + +# List of decorators that produce properties, such as abc.abstractproperty. Add +# to this list to register other decorators that produce valid properties. +# These decorators are taken in consideration only for invalid-name. +property-classes=abc.abstractproperty + +# Regular expression matching correct type variable names. If left empty, type +# variable names will be checked with the set naming style. +#typevar-rgx= + +# Naming style matching correct variable names. +variable-naming-style=snake_case + +# Regular expression matching correct variable names. Overrides variable- +# naming-style. If left empty, variable names will be checked with the set +# naming style. +#variable-rgx= + + +[CLASSES] + +# Warn about protected attribute access inside special methods +check-protected-access-in-special-methods=no + +# List of method names used to declare (i.e. assign) instance attributes. +defining-attr-methods=__init__, + __new__, + setUp, + __post_init__ + +# List of member names, which should be excluded from the protected access +# warning. +exclude-protected=_asdict, + _fields, + _replace, + _source, + _make + +# List of valid names for the first argument in a class method. +valid-classmethod-first-arg=cls + +# List of valid names for the first argument in a metaclass class method. +valid-metaclass-classmethod-first-arg=mcs + + +[DESIGN] + +# List of regular expressions of class ancestor names to ignore when counting +# public methods (see R0903) +exclude-too-few-public-methods= + +# List of qualified class names to ignore when counting class parents (see +# R0901) +ignored-parents= + +# Maximum number of arguments for function / method. +max-args=5 + +# Maximum number of attributes for a class (see R0902). +max-attributes=7 + +# Maximum number of boolean expressions in an if statement (see R0916). +max-bool-expr=5 + +# Maximum number of branch for function / method body. +max-branches=12 + +# Maximum number of locals for function / method body. +max-locals=15 + +# Maximum number of parents for a class (see R0901). +max-parents=7 + +# Maximum number of public methods for a class (see R0904). +max-public-methods=25 + +# Maximum number of return / yield for function / method body. +max-returns=6 + +# Maximum number of statements in function / method body. +max-statements=50 + +# Minimum number of public methods for a class (see R0903). +min-public-methods=2 + + +[EXCEPTIONS] + +# Exceptions that will emit a warning when caught. +overgeneral-exceptions=builtins.BaseException,builtins.Exception + + +[FORMAT] + +# Expected format of line ending, e.g. empty (any line ending), LF or CRLF. +expected-line-ending-format= + +# Regexp for a line that is allowed to be longer than the limit. +ignore-long-lines=^\s*(# )??$ + +# Number of spaces of indent required inside a hanging or continued line. +indent-after-paren=4 + +# String used as indentation unit. This is usually " " (4 spaces) or "\t" (1 +# tab). +indent-string=' ' + +# Maximum number of characters on a single line. +max-line-length=100 + +# Maximum number of lines in a module. +max-module-lines=1000 + +# Allow the body of a class to be on the same line as the declaration if body +# contains single statement. +single-line-class-stmt=no + +# Allow the body of an if to be on the same line as the test if there is no +# else. +single-line-if-stmt=no + + +[IMPORTS] + +# List of modules that can be imported at any level, not just the top level +# one. +allow-any-import-level= + +# Allow explicit reexports by alias from a package __init__. +allow-reexport-from-package=no + +# Allow wildcard imports from modules that define __all__. +allow-wildcard-with-all=no + +# Deprecated modules which should not be used, separated by a comma. +deprecated-modules= + +# Output a graph (.gv or any supported image format) of external dependencies +# to the given file (report RP0402 must not be disabled). +ext-import-graph= + +# Output a graph (.gv or any supported image format) of all (i.e. internal and +# external) dependencies to the given file (report RP0402 must not be +# disabled). +import-graph= + +# Output a graph (.gv or any supported image format) of internal dependencies +# to the given file (report RP0402 must not be disabled). +int-import-graph= + +# Force import order to recognize a module as part of the standard +# compatibility libraries. +known-standard-library= + +# Force import order to recognize a module as part of a third party library. +known-third-party=enchant + +# Couples of modules and preferred modules, separated by a comma. +preferred-modules= + + +[LOGGING] + +# The type of string formatting that logging methods do. `old` means using % +# formatting, `new` is for `{}` formatting. +logging-format-style=old + +# Logging modules to check that the string format arguments are in logging +# function parameter format. +logging-modules=logging + + +[MESSAGES CONTROL] + +# Only show warnings with the listed confidence levels. Leave empty to show +# all. Valid levels: HIGH, CONTROL_FLOW, INFERENCE, INFERENCE_FAILURE, +# UNDEFINED. +confidence=HIGH, + CONTROL_FLOW, + INFERENCE, + INFERENCE_FAILURE, + UNDEFINED + +# Disable the message, report, category or checker with the given id(s). You +# can either give multiple identifiers separated by comma (,) or put this +# option multiple times (only on the command line, not in the configuration +# file where it should appear only once). You can also use "--disable=all" to +# disable everything first and then re-enable specific checks. For example, if +# you want to run only the similarities checker, you can use "--disable=all +# --enable=similarities". If you want to run only the classes checker, but have +# no Warning level messages displayed, use "--disable=all --enable=classes +# --disable=W". +disable=raw-checker-failed, + bad-inline-option, + locally-disabled, + file-ignored, + suppressed-message, + useless-suppression, + deprecated-pragma, + use-symbolic-message-instead, + trailing-whitespace, + line-too-long, + missing-class-docstring, + missing-module-docstring, + missing-function-docstring, + too-many-instance-attributes, + wrong-import-order, + too-many-arguments, + broad-exception-raised, + too-few-public-methods, + too-many-branches, + chained-comparison, + duplicate-code, + trailing-newlines, + too-many-public-methods, + too-many-locals, + too-many-lines, + using-constant-test, + too-many-statements, + cyclic-import, + too-many-nested-blocks, + too-many-boolean-expressions, + no-else-raise + +# 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 + + +[METHOD_ARGS] + +# List of qualified names (i.e., library.method) which require a timeout +# parameter e.g. 'requests.api.get,requests.api.post' +timeout-methods=requests.api.delete,requests.api.get,requests.api.head,requests.api.options,requests.api.patch,requests.api.post,requests.api.put,requests.api.request + + +[MISCELLANEOUS] + +# List of note tags to take in consideration, separated by a comma. +notes=FIXME, + XXX, + TODO + +# Regular expression of note tags to take in consideration. +notes-rgx= + + +[REFACTORING] + +# Maximum number of nested blocks for function / method body +max-nested-blocks=5 + +# Complete name of functions that never returns. When checking for +# inconsistent-return-statements if a never returning function is called then +# it will be considered as an explicit return statement and no message will be +# printed. +never-returning-functions=sys.exit,argparse.parse_error + + +[REPORTS] + +# Python expression which should return a score less than or equal to 10. You +# have access to the variables 'fatal', 'error', 'warning', 'refactor', +# 'convention', and 'info' which contain the number of messages in each +# category, as well as 'statement' which is the total number of statements +# analyzed. This score is used by the global evaluation report (RP0004). +evaluation=max(0, 0 if fatal else 10.0 - ((float(5 * error + warning + refactor + convention) / statement) * 10)) + +# Template used to display messages. This is a python new-style format string +# 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. +# mypackage.mymodule.MyReporterClass. +#output-format= + +# Tells whether to display a full report or only the messages. +reports=no + +# Activate the evaluation score. +score=yes + + +[SIMILARITIES] + +# Comments are removed from the similarity computation +ignore-comments=yes + +# Docstrings are removed from the similarity computation +ignore-docstrings=yes + +# Imports are removed from the similarity computation +ignore-imports=yes + +# Signatures are removed from the similarity computation +ignore-signatures=yes + +# Minimum lines number of a similarity. +min-similarity-lines=4 + + +[SPELLING] + +# 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-dict= + +# List of comma separated words that should be considered directives if they +# appear at the beginning of a comment and should not be checked. +spelling-ignore-comment-directives=fmt: on,fmt: off,noqa:,noqa,nosec,isort:skip,mypy: + +# List of comma separated words that should not be checked. +spelling-ignore-words= + +# A path to a file that contains the private dictionary; one word per line. +spelling-private-dict-file= + +# Tells whether to store unknown words to the private dictionary (see the +# --spelling-private-dict-file option) instead of raising a message. +spelling-store-unknown-words=no + + +[STRING] + +# This flag controls whether inconsistent-quotes generates a warning when the +# character used as a quote delimiter is used inconsistently within a module. +check-quote-consistency=no + +# This flag controls whether the implicit-str-concat should generate a warning +# on implicit string concatenation in sequences defined over several lines. +check-str-concat-over-line-jumps=no + + +[TYPECHECK] + +# List of decorators that produce context managers, such as +# contextlib.contextmanager. Add to this list to register other decorators that +# produce valid context managers. +contextmanager-decorators=contextlib.contextmanager + +# List of members which are set dynamically and missed by pylint inference +# system, and so shouldn't trigger E1101 when accessed. Python regular +# expressions are accepted. +generated-members= + +# Tells whether to warn about missing members when the owner of the attribute +# is inferred to be None. +ignore-none=yes + +# This flag controls whether pylint should warn about no-member and similar +# checks whenever an opaque object is returned when inferring. The inference +# can return multiple potential results while evaluating a Python object, but +# some branches might not be evaluated, which results in partial inference. In +# that case, it might be useful to still emit no-member and other checks for +# the rest of the inferred objects. +ignore-on-opaque-inference=yes + +# List of symbolic message names to ignore for Mixin members. +ignored-checks-for-mixins=no-member, + not-async-context-manager, + not-context-manager, + attribute-defined-outside-init + +# List of class names for which member attributes should not be checked (useful +# for classes with dynamically set attributes). This supports the use of +# qualified names. +ignored-classes=optparse.Values,thread._local,_thread._local,argparse.Namespace + +# Show a hint with possible names when a member name was not found. The aspect +# of finding the hint is based on edit distance. +missing-member-hint=yes + +# The minimum edit distance a name should have in order to be considered a +# similar match for a missing member name. +missing-member-hint-distance=1 + +# The total number of similar names that should be taken in consideration when +# showing a hint for a missing member. +missing-member-max-choices=1 + +# Regex pattern to define which classes are considered mixins. +mixin-class-rgx=.*[Mm]ixin + +# List of decorators that change the signature of a decorated function. +signature-mutators= + + +[VARIABLES] + +# List of additional names supposed to be defined in builtins. Remember that +# you should avoid defining new builtins when possible. +additional-builtins= + +# Tells whether unused global variables should be treated as a violation. +allow-global-unused-variables=yes + +# List of names allowed to shadow builtins +allowed-redefined-builtins=id,object + +# List of strings which can identify a callback function by name. A callback +# name must start or end with one of those strings. +callbacks=cb_, + _cb + +# A regular expression matching the name of dummy variables (i.e. expected to +# not be used). +dummy-variables-rgx=_+$|(_[a-zA-Z0-9_]*[a-zA-Z0-9]+?$)|dummy|^ignored_|^unused_ + +# Argument names that match this expression will be ignored. +ignored-argument-names=_.*|^ignored_|^unused_ + +# Tells whether we should check for unused import in __init__ files. +init-import=no + +# List of qualified module names which can have objects that can redefine +# builtins. +redefining-builtins-modules=six.moves,past.builtins,future.builtins,builtins,io diff --git a/sync-for-payables/setup.py b/sync-for-payables/setup.py new file mode 100755 index 000000000..96a93ba0f --- /dev/null +++ b/sync-for-payables/setup.py @@ -0,0 +1,42 @@ +"""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="0.1.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>=2022.12.7", + "charset-normalizer>=2.1.1", + "dataclasses-json>=0.5.12", + "idna>=3.3", + "jsonpath-python>=1.0.6 ", + "marshmallow>=3.17.1", + "marshmallow-enum>=1.5.1", + "mypy-extensions>=0.4.3", + "packaging>=21.3", + "pyparsing>=3.0.9", + "python-dateutil>=2.8.2", + "requests>=2.28.1", + "six>=1.16.0", + "typing-inspect>=0.8.0", + "typing_extensions>=4.3.0", + "urllib3>=1.26.12", + ], + extras_require={ + "dev":["pylint==2.16.2"] + }, + package_dir={'': 'src'}, + python_requires='>=3.9' +) diff --git a/sync-for-payables/src/codatsyncpayables/__init__.py b/sync-for-payables/src/codatsyncpayables/__init__.py new file mode 100755 index 000000000..e6c0deeb6 --- /dev/null +++ b/sync-for-payables/src/codatsyncpayables/__init__.py @@ -0,0 +1,4 @@ +"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" + +from .sdk import * +from .sdkconfiguration import * diff --git a/sync-for-payables/src/codatsyncpayables/accounts.py b/sync-for-payables/src/codatsyncpayables/accounts.py new file mode 100755 index 000000000..0e69d0688 --- /dev/null +++ b/sync-for-payables/src/codatsyncpayables/accounts.py @@ -0,0 +1,226 @@ +"""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 Accounts: + r"""Accounts""" + sdk_configuration: SDKConfiguration + + def __init__(self, sdk_config: SDKConfiguration) -> None: + self.sdk_configuration = sdk_config + + + def create(self, request: operations.CreateAccountRequest, retries: Optional[utils.RetryConfig] = None) -> operations.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. + """ + base_url = utils.template_url(*self.sdk_configuration.get_server_details()) + + url = utils.generate_url(operations.CreateAccountRequest, base_url, '/companies/{companyId}/connections/{connectionId}/push/accounts', request) + headers = {} + req_content_type, data, form = utils.serialize_request_body(request, "account", 'json') + if req_content_type not in ('multipart/form-data', 'multipart/mixed'): + headers['content-type'] = req_content_type + query_params = utils.get_query_params(operations.CreateAccountRequest, request) + headers['Accept'] = 'application/json' + headers['user-agent'] = f'speakeasy-sdk/{self.sdk_configuration.language} {self.sdk_configuration.sdk_version} {self.sdk_configuration.gen_version} {self.sdk_configuration.openapi_doc_version}' + + client = self.sdk_configuration.security_client + + retry_config = retries + if retry_config is None: + retry_config = utils.RetryConfig('backoff', utils.BackoffStrategy(500, 60000, 1.5, 3600000), True) + + def do_request(): + return client.request('POST', url, params=query_params, 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.CreateAccountResponse(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.CreateAccountResponse]) + res.create_account_response = 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, 404, 429]: + if utils.match_content_type(content_type, 'application/json'): + out = utils.unmarshal_json(http_res.text, Optional[shared.ErrorMessage]) + res.error_message = out + else: + raise errors.SDKError(f'unknown content-type received: {content_type}', http_res.status_code, http_res.text, http_res) + + return res + + + def get(self, request: operations.GetAccountRequest, retries: Optional[utils.RetryConfig] = None) -> operations.GetAccountResponse: + 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). + """ + base_url = utils.template_url(*self.sdk_configuration.get_server_details()) + + url = utils.generate_url(operations.GetAccountRequest, base_url, '/companies/{companyId}/data/accounts/{accountId}', request) + headers = {} + headers['Accept'] = 'application/json' + headers['user-agent'] = f'speakeasy-sdk/{self.sdk_configuration.language} {self.sdk_configuration.sdk_version} {self.sdk_configuration.gen_version} {self.sdk_configuration.openapi_doc_version}' + + client = self.sdk_configuration.security_client + + retry_config = retries + if retry_config is None: + 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.GetAccountResponse(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.Account]) + res.account = 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, 404, 409, 429]: + if utils.match_content_type(content_type, 'application/json'): + out = utils.unmarshal_json(http_res.text, Optional[shared.ErrorMessage]) + res.error_message = out + else: + raise errors.SDKError(f'unknown content-type received: {content_type}', http_res.status_code, http_res.text, http_res) + + return res + + + def get_create_model(self, request: operations.GetCreateAccountModelRequest, retries: Optional[utils.RetryConfig] = None) -> operations.GetCreateAccountModelResponse: + 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. + """ + base_url = utils.template_url(*self.sdk_configuration.get_server_details()) + + url = utils.generate_url(operations.GetCreateAccountModelRequest, base_url, '/companies/{companyId}/connections/{connectionId}/options/chartOfAccounts', request) + headers = {} + headers['Accept'] = 'application/json' + headers['user-agent'] = f'speakeasy-sdk/{self.sdk_configuration.language} {self.sdk_configuration.sdk_version} {self.sdk_configuration.gen_version} {self.sdk_configuration.openapi_doc_version}' + + client = self.sdk_configuration.security_client + + retry_config = retries + if retry_config is None: + 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.GetCreateAccountModelResponse(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.PushOption]) + res.push_option = 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, 404, 429]: + if utils.match_content_type(content_type, 'application/json'): + out = utils.unmarshal_json(http_res.text, Optional[shared.ErrorMessage]) + res.error_message = out + else: + raise errors.SDKError(f'unknown content-type received: {content_type}', http_res.status_code, http_res.text, http_res) + + return res + + + def list(self, request: operations.ListAccountsRequest, retries: Optional[utils.RetryConfig] = None) -> operations.ListAccountsResponse: + 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). + """ + base_url = utils.template_url(*self.sdk_configuration.get_server_details()) + + url = utils.generate_url(operations.ListAccountsRequest, base_url, '/companies/{companyId}/data/accounts', request) + headers = {} + query_params = utils.get_query_params(operations.ListAccountsRequest, request) + headers['Accept'] = 'application/json' + headers['user-agent'] = f'speakeasy-sdk/{self.sdk_configuration.language} {self.sdk_configuration.sdk_version} {self.sdk_configuration.gen_version} {self.sdk_configuration.openapi_doc_version}' + + client = self.sdk_configuration.security_client + + retry_config = retries + if retry_config is None: + 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.ListAccountsResponse(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.Accounts]) + res.accounts = 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, 404, 409]: + if utils.match_content_type(content_type, 'application/json'): + out = utils.unmarshal_json(http_res.text, Optional[shared.ErrorMessage]) + res.error_message = out + else: + raise errors.SDKError(f'unknown content-type received: {content_type}', http_res.status_code, http_res.text, http_res) + + return res + + \ No newline at end of file diff --git a/sync-for-payables/src/codatsyncpayables/bill_credit_notes.py b/sync-for-payables/src/codatsyncpayables/bill_credit_notes.py new file mode 100755 index 000000000..0628fff6f --- /dev/null +++ b/sync-for-payables/src/codatsyncpayables/bill_credit_notes.py @@ -0,0 +1,283 @@ +"""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 BillCreditNotes: + r"""Bill credit notes""" + sdk_configuration: SDKConfiguration + + def __init__(self, sdk_config: SDKConfiguration) -> None: + self.sdk_configuration = sdk_config + + + def create(self, request: operations.CreateBillCreditNoteRequest, retries: Optional[utils.RetryConfig] = None) -> operations.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. + """ + base_url = utils.template_url(*self.sdk_configuration.get_server_details()) + + url = utils.generate_url(operations.CreateBillCreditNoteRequest, base_url, '/companies/{companyId}/connections/{connectionId}/push/billCreditNotes', request) + headers = {} + req_content_type, data, form = utils.serialize_request_body(request, "bill_credit_note", 'json') + if req_content_type not in ('multipart/form-data', 'multipart/mixed'): + headers['content-type'] = req_content_type + query_params = utils.get_query_params(operations.CreateBillCreditNoteRequest, request) + headers['Accept'] = 'application/json' + headers['user-agent'] = f'speakeasy-sdk/{self.sdk_configuration.language} {self.sdk_configuration.sdk_version} {self.sdk_configuration.gen_version} {self.sdk_configuration.openapi_doc_version}' + + client = self.sdk_configuration.security_client + + retry_config = retries + if retry_config is None: + retry_config = utils.RetryConfig('backoff', utils.BackoffStrategy(500, 60000, 1.5, 3600000), True) + + def do_request(): + return client.request('POST', url, params=query_params, 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.CreateBillCreditNoteResponse(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.CreateBillCreditNoteResponse]) + res.create_bill_credit_note_response = 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, 404, 429]: + if utils.match_content_type(content_type, 'application/json'): + out = utils.unmarshal_json(http_res.text, Optional[shared.ErrorMessage]) + res.error_message = out + else: + raise errors.SDKError(f'unknown content-type received: {content_type}', http_res.status_code, http_res.text, http_res) + + return res + + + def get(self, request: operations.GetBillCreditNoteRequest, retries: Optional[utils.RetryConfig] = None) -> operations.GetBillCreditNoteResponse: + 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). + """ + base_url = utils.template_url(*self.sdk_configuration.get_server_details()) + + url = utils.generate_url(operations.GetBillCreditNoteRequest, base_url, '/companies/{companyId}/data/billCreditNotes/{billCreditNoteId}', request) + headers = {} + headers['Accept'] = 'application/json' + headers['user-agent'] = f'speakeasy-sdk/{self.sdk_configuration.language} {self.sdk_configuration.sdk_version} {self.sdk_configuration.gen_version} {self.sdk_configuration.openapi_doc_version}' + + client = self.sdk_configuration.security_client + + retry_config = retries + if retry_config is None: + 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.GetBillCreditNoteResponse(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.BillCreditNote]) + res.bill_credit_note = 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, 404, 409, 429]: + if utils.match_content_type(content_type, 'application/json'): + out = utils.unmarshal_json(http_res.text, Optional[shared.ErrorMessage]) + res.error_message = out + else: + raise errors.SDKError(f'unknown content-type received: {content_type}', http_res.status_code, http_res.text, http_res) + + return res + + + def get_create_update_model(self, request: operations.GetCreateUpdateBillCreditNoteModelRequest, retries: Optional[utils.RetryConfig] = None) -> operations.GetCreateUpdateBillCreditNoteModelResponse: + 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. + """ + base_url = utils.template_url(*self.sdk_configuration.get_server_details()) + + url = utils.generate_url(operations.GetCreateUpdateBillCreditNoteModelRequest, base_url, '/companies/{companyId}/connections/{connectionId}/options/billCreditNotes', request) + headers = {} + headers['Accept'] = 'application/json' + headers['user-agent'] = f'speakeasy-sdk/{self.sdk_configuration.language} {self.sdk_configuration.sdk_version} {self.sdk_configuration.gen_version} {self.sdk_configuration.openapi_doc_version}' + + client = self.sdk_configuration.security_client + + retry_config = retries + if retry_config is None: + 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.GetCreateUpdateBillCreditNoteModelResponse(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.PushOption]) + res.push_option = 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, 404, 429]: + if utils.match_content_type(content_type, 'application/json'): + out = utils.unmarshal_json(http_res.text, Optional[shared.ErrorMessage]) + res.error_message = out + else: + raise errors.SDKError(f'unknown content-type received: {content_type}', http_res.status_code, http_res.text, http_res) + + return res + + + def list(self, request: operations.ListBillCreditNotesRequest, retries: Optional[utils.RetryConfig] = None) -> operations.ListBillCreditNotesResponse: + 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). + """ + base_url = utils.template_url(*self.sdk_configuration.get_server_details()) + + url = utils.generate_url(operations.ListBillCreditNotesRequest, base_url, '/companies/{companyId}/data/billCreditNotes', request) + headers = {} + query_params = utils.get_query_params(operations.ListBillCreditNotesRequest, request) + headers['Accept'] = 'application/json' + headers['user-agent'] = f'speakeasy-sdk/{self.sdk_configuration.language} {self.sdk_configuration.sdk_version} {self.sdk_configuration.gen_version} {self.sdk_configuration.openapi_doc_version}' + + client = self.sdk_configuration.security_client + + retry_config = retries + if retry_config is None: + 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.ListBillCreditNotesResponse(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.BillCreditNotes]) + res.bill_credit_notes = 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, 404, 409]: + if utils.match_content_type(content_type, 'application/json'): + out = utils.unmarshal_json(http_res.text, Optional[shared.ErrorMessage]) + res.error_message = out + else: + raise errors.SDKError(f'unknown content-type received: {content_type}', http_res.status_code, http_res.text, http_res) + + return res + + + def update(self, request: operations.UpdateBillCreditNoteRequest, retries: Optional[utils.RetryConfig] = None) -> operations.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. + """ + base_url = utils.template_url(*self.sdk_configuration.get_server_details()) + + url = utils.generate_url(operations.UpdateBillCreditNoteRequest, base_url, '/companies/{companyId}/connections/{connectionId}/push/billCreditNotes/{billCreditNoteId}', request) + headers = {} + req_content_type, data, form = utils.serialize_request_body(request, "bill_credit_note", 'json') + if req_content_type not in ('multipart/form-data', 'multipart/mixed'): + headers['content-type'] = req_content_type + query_params = utils.get_query_params(operations.UpdateBillCreditNoteRequest, request) + headers['Accept'] = 'application/json' + headers['user-agent'] = f'speakeasy-sdk/{self.sdk_configuration.language} {self.sdk_configuration.sdk_version} {self.sdk_configuration.gen_version} {self.sdk_configuration.openapi_doc_version}' + + client = self.sdk_configuration.security_client + + retry_config = retries + if retry_config is None: + retry_config = utils.RetryConfig('backoff', utils.BackoffStrategy(500, 60000, 1.5, 3600000), True) + + def do_request(): + return client.request('PUT', url, params=query_params, 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.UpdateBillCreditNoteResponse(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.UpdateBillCreditNoteResponse]) + res.update_bill_credit_note_response = 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, 404, 429]: + if utils.match_content_type(content_type, 'application/json'): + out = utils.unmarshal_json(http_res.text, Optional[shared.ErrorMessage]) + res.error_message = out + else: + raise errors.SDKError(f'unknown content-type received: {content_type}', http_res.status_code, http_res.text, http_res) + + return res + + \ No newline at end of file diff --git a/sync-for-payables/src/codatsyncpayables/bill_payments.py b/sync-for-payables/src/codatsyncpayables/bill_payments.py new file mode 100755 index 000000000..94f066b2b --- /dev/null +++ b/sync-for-payables/src/codatsyncpayables/bill_payments.py @@ -0,0 +1,226 @@ +"""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 BillPayments: + r"""Bill payments""" + sdk_configuration: SDKConfiguration + + def __init__(self, sdk_config: SDKConfiguration) -> None: + self.sdk_configuration = sdk_config + + + def create(self, request: operations.CreateBillPaymentRequest, retries: Optional[utils.RetryConfig] = None) -> operations.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. + """ + base_url = utils.template_url(*self.sdk_configuration.get_server_details()) + + url = utils.generate_url(operations.CreateBillPaymentRequest, base_url, '/companies/{companyId}/connections/{connectionId}/push/billPayments', request) + headers = {} + req_content_type, data, form = utils.serialize_request_body(request, "bill_payment", 'json') + if req_content_type not in ('multipart/form-data', 'multipart/mixed'): + headers['content-type'] = req_content_type + query_params = utils.get_query_params(operations.CreateBillPaymentRequest, request) + headers['Accept'] = 'application/json' + headers['user-agent'] = f'speakeasy-sdk/{self.sdk_configuration.language} {self.sdk_configuration.sdk_version} {self.sdk_configuration.gen_version} {self.sdk_configuration.openapi_doc_version}' + + client = self.sdk_configuration.security_client + + retry_config = retries + if retry_config is None: + retry_config = utils.RetryConfig('backoff', utils.BackoffStrategy(500, 60000, 1.5, 3600000), True) + + def do_request(): + return client.request('POST', url, params=query_params, 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.CreateBillPaymentResponse(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.CreateBillPaymentResponse]) + res.create_bill_payment_response = 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, 404, 429]: + if utils.match_content_type(content_type, 'application/json'): + out = utils.unmarshal_json(http_res.text, Optional[shared.ErrorMessage]) + res.error_message = out + else: + raise errors.SDKError(f'unknown content-type received: {content_type}', http_res.status_code, http_res.text, http_res) + + return res + + + def get(self, request: operations.GetBillPaymentsRequest, retries: Optional[utils.RetryConfig] = None) -> operations.GetBillPaymentsResponse: + 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 customer 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). + """ + base_url = utils.template_url(*self.sdk_configuration.get_server_details()) + + url = utils.generate_url(operations.GetBillPaymentsRequest, base_url, '/companies/{companyId}/data/billPayments/{billPaymentId}', request) + headers = {} + headers['Accept'] = 'application/json' + headers['user-agent'] = f'speakeasy-sdk/{self.sdk_configuration.language} {self.sdk_configuration.sdk_version} {self.sdk_configuration.gen_version} {self.sdk_configuration.openapi_doc_version}' + + client = self.sdk_configuration.security_client + + retry_config = retries + if retry_config is None: + 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.GetBillPaymentsResponse(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.BillPayment]) + res.bill_payment = 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, 404, 409, 429]: + if utils.match_content_type(content_type, 'application/json'): + out = utils.unmarshal_json(http_res.text, Optional[shared.ErrorMessage]) + res.error_message = out + else: + raise errors.SDKError(f'unknown content-type received: {content_type}', http_res.status_code, http_res.text, http_res) + + return res + + + def get_create_model(self, request: operations.GetCreateBillPaymentModelRequest, retries: Optional[utils.RetryConfig] = None) -> operations.GetCreateBillPaymentModelResponse: + 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 customer 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. + """ + base_url = utils.template_url(*self.sdk_configuration.get_server_details()) + + url = utils.generate_url(operations.GetCreateBillPaymentModelRequest, base_url, '/companies/{companyId}/connections/{connectionId}/options/billPayments', request) + headers = {} + headers['Accept'] = 'application/json' + headers['user-agent'] = f'speakeasy-sdk/{self.sdk_configuration.language} {self.sdk_configuration.sdk_version} {self.sdk_configuration.gen_version} {self.sdk_configuration.openapi_doc_version}' + + client = self.sdk_configuration.security_client + + retry_config = retries + if retry_config is None: + 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.GetCreateBillPaymentModelResponse(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.PushOption]) + res.push_option = 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, 404, 429]: + if utils.match_content_type(content_type, 'application/json'): + out = utils.unmarshal_json(http_res.text, Optional[shared.ErrorMessage]) + res.error_message = out + else: + raise errors.SDKError(f'unknown content-type received: {content_type}', http_res.status_code, http_res.text, http_res) + + return res + + + def list(self, request: operations.ListBillPaymentsRequest, retries: Optional[utils.RetryConfig] = None) -> operations.ListBillPaymentsResponse: + 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 customer 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). + """ + base_url = utils.template_url(*self.sdk_configuration.get_server_details()) + + url = utils.generate_url(operations.ListBillPaymentsRequest, base_url, '/companies/{companyId}/data/billPayments', request) + headers = {} + query_params = utils.get_query_params(operations.ListBillPaymentsRequest, request) + headers['Accept'] = 'application/json' + headers['user-agent'] = f'speakeasy-sdk/{self.sdk_configuration.language} {self.sdk_configuration.sdk_version} {self.sdk_configuration.gen_version} {self.sdk_configuration.openapi_doc_version}' + + client = self.sdk_configuration.security_client + + retry_config = retries + if retry_config is None: + 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.ListBillPaymentsResponse(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.BillPayments]) + res.bill_payments = 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, 404, 409]: + if utils.match_content_type(content_type, 'application/json'): + out = utils.unmarshal_json(http_res.text, Optional[shared.ErrorMessage]) + res.error_message = out + else: + raise errors.SDKError(f'unknown content-type received: {content_type}', http_res.status_code, http_res.text, http_res) + + return res + + \ No newline at end of file diff --git a/sync-for-payables/src/codatsyncpayables/bills.py b/sync-for-payables/src/codatsyncpayables/bills.py new file mode 100755 index 000000000..1d952b9da --- /dev/null +++ b/sync-for-payables/src/codatsyncpayables/bills.py @@ -0,0 +1,489 @@ +"""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 enum import Enum +from typing import Optional + +class DownloadAttachmentAcceptEnum(str, Enum): + APPLICATION_JSON = "application/json" + APPLICATION_OCTET_STREAM = "application/octet-stream" + +class Bills: + r"""Bills""" + sdk_configuration: SDKConfiguration + + def __init__(self, sdk_config: SDKConfiguration) -> None: + self.sdk_configuration = sdk_config + + + def create(self, request: operations.CreateBillRequest, retries: Optional[utils.RetryConfig] = None) -> operations.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. + """ + base_url = utils.template_url(*self.sdk_configuration.get_server_details()) + + url = utils.generate_url(operations.CreateBillRequest, base_url, '/companies/{companyId}/connections/{connectionId}/push/bills', request) + headers = {} + req_content_type, data, form = utils.serialize_request_body(request, "bill", 'json') + if req_content_type not in ('multipart/form-data', 'multipart/mixed'): + headers['content-type'] = req_content_type + query_params = utils.get_query_params(operations.CreateBillRequest, request) + headers['Accept'] = 'application/json' + headers['user-agent'] = f'speakeasy-sdk/{self.sdk_configuration.language} {self.sdk_configuration.sdk_version} {self.sdk_configuration.gen_version} {self.sdk_configuration.openapi_doc_version}' + + client = self.sdk_configuration.security_client + + retry_config = retries + if retry_config is None: + retry_config = utils.RetryConfig('backoff', utils.BackoffStrategy(500, 60000, 1.5, 3600000), True) + + def do_request(): + return client.request('POST', url, params=query_params, 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.CreateBillResponse(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.CreateBillResponse]) + res.create_bill_response = 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, 404, 429]: + if utils.match_content_type(content_type, 'application/json'): + out = utils.unmarshal_json(http_res.text, Optional[shared.ErrorMessage]) + res.error_message = out + else: + raise errors.SDKError(f'unknown content-type received: {content_type}', http_res.status_code, http_res.text, http_res) + + return res + + + def download_attachment(self, request: operations.DownloadBillAttachmentRequest, retries: Optional[utils.RetryConfig] = None, accept_header_override: Optional[DownloadAttachmentAcceptEnum] = None) -> operations.DownloadBillAttachmentResponse: + 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. + """ + base_url = utils.template_url(*self.sdk_configuration.get_server_details()) + + url = utils.generate_url(operations.DownloadBillAttachmentRequest, base_url, '/companies/{companyId}/connections/{connectionId}/data/bills/{billId}/attachments/{attachmentId}/download', request) + headers = {} + if accept_header_override is not None: + headers['Accept'] = accept_header_override.value + else: + headers['Accept'] = 'application/json;q=1, application/octet-stream;q=0' + headers['user-agent'] = f'speakeasy-sdk/{self.sdk_configuration.language} {self.sdk_configuration.sdk_version} {self.sdk_configuration.gen_version} {self.sdk_configuration.openapi_doc_version}' + + client = self.sdk_configuration.security_client + + retry_config = retries + if retry_config is None: + 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.DownloadBillAttachmentResponse(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/octet-stream'): + res.data = http_res.content + 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, 404, 429]: + if utils.match_content_type(content_type, 'application/json'): + out = utils.unmarshal_json(http_res.text, Optional[shared.ErrorMessage]) + res.error_message = out + else: + raise errors.SDKError(f'unknown content-type received: {content_type}', http_res.status_code, http_res.text, http_res) + + return res + + + def get(self, request: operations.GetBillRequest, retries: Optional[utils.RetryConfig] = None) -> operations.GetBillResponse: + 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). + """ + base_url = utils.template_url(*self.sdk_configuration.get_server_details()) + + url = utils.generate_url(operations.GetBillRequest, base_url, '/companies/{companyId}/data/bills/{billId}', request) + headers = {} + headers['Accept'] = 'application/json' + headers['user-agent'] = f'speakeasy-sdk/{self.sdk_configuration.language} {self.sdk_configuration.sdk_version} {self.sdk_configuration.gen_version} {self.sdk_configuration.openapi_doc_version}' + + client = self.sdk_configuration.security_client + + retry_config = retries + if retry_config is None: + 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.GetBillResponse(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.Bill]) + res.bill = 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, 404, 409, 429]: + if utils.match_content_type(content_type, 'application/json'): + out = utils.unmarshal_json(http_res.text, Optional[shared.ErrorMessage]) + res.error_message = out + else: + raise errors.SDKError(f'unknown content-type received: {content_type}', http_res.status_code, http_res.text, http_res) + + return res + + + def get_attachment(self, request: operations.GetBillAttachmentRequest, retries: Optional[utils.RetryConfig] = None) -> operations.GetBillAttachmentResponse: + 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. + """ + base_url = utils.template_url(*self.sdk_configuration.get_server_details()) + + url = utils.generate_url(operations.GetBillAttachmentRequest, base_url, '/companies/{companyId}/connections/{connectionId}/data/bills/{billId}/attachments/{attachmentId}', request) + headers = {} + headers['Accept'] = 'application/json' + headers['user-agent'] = f'speakeasy-sdk/{self.sdk_configuration.language} {self.sdk_configuration.sdk_version} {self.sdk_configuration.gen_version} {self.sdk_configuration.openapi_doc_version}' + + client = self.sdk_configuration.security_client + + retry_config = retries + if retry_config is None: + 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.GetBillAttachmentResponse(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.Attachment]) + res.attachment = 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, 404, 429]: + if utils.match_content_type(content_type, 'application/json'): + out = utils.unmarshal_json(http_res.text, Optional[shared.ErrorMessage]) + res.error_message = out + else: + raise errors.SDKError(f'unknown content-type received: {content_type}', http_res.status_code, http_res.text, http_res) + + return res + + + def get_create_update_model(self, request: operations.GetCreateUpdateBillModelRequest, retries: Optional[utils.RetryConfig] = None) -> operations.GetCreateUpdateBillModelResponse: + 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. + """ + base_url = utils.template_url(*self.sdk_configuration.get_server_details()) + + url = utils.generate_url(operations.GetCreateUpdateBillModelRequest, base_url, '/companies/{companyId}/connections/{connectionId}/options/bills', request) + headers = {} + headers['Accept'] = 'application/json' + headers['user-agent'] = f'speakeasy-sdk/{self.sdk_configuration.language} {self.sdk_configuration.sdk_version} {self.sdk_configuration.gen_version} {self.sdk_configuration.openapi_doc_version}' + + client = self.sdk_configuration.security_client + + retry_config = retries + if retry_config is None: + 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.GetCreateUpdateBillModelResponse(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.PushOption]) + res.push_option = 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, 404, 429]: + if utils.match_content_type(content_type, 'application/json'): + out = utils.unmarshal_json(http_res.text, Optional[shared.ErrorMessage]) + res.error_message = out + else: + raise errors.SDKError(f'unknown content-type received: {content_type}', http_res.status_code, http_res.text, http_res) + + return res + + + 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. + + [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. + + Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/sync-for-payables-api#/operations/refresh-company-data). + """ + base_url = utils.template_url(*self.sdk_configuration.get_server_details()) + + url = utils.generate_url(operations.ListBillsRequest, base_url, '/companies/{companyId}/data/bills', request) + headers = {} + query_params = utils.get_query_params(operations.ListBillsRequest, request) + headers['Accept'] = 'application/json' + headers['user-agent'] = f'speakeasy-sdk/{self.sdk_configuration.language} {self.sdk_configuration.sdk_version} {self.sdk_configuration.gen_version} {self.sdk_configuration.openapi_doc_version}' + + client = self.sdk_configuration.security_client + + retry_config = retries + if retry_config is None: + 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, 404, 409]: + if utils.match_content_type(content_type, 'application/json'): + out = utils.unmarshal_json(http_res.text, Optional[shared.ErrorMessage]) + res.error_message = out + else: + raise errors.SDKError(f'unknown content-type received: {content_type}', http_res.status_code, http_res.text, http_res) + + return res + + + def list_attachments(self, request: operations.ListBillAttachmentsRequest, retries: Optional[utils.RetryConfig] = None) -> operations.ListBillAttachmentsResponse: + 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. + + Check out our [coverage explorer](https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=bills) for integrations that support listing bill attachments. + """ + base_url = utils.template_url(*self.sdk_configuration.get_server_details()) + + url = utils.generate_url(operations.ListBillAttachmentsRequest, base_url, '/companies/{companyId}/connections/{connectionId}/data/bills/{billId}/attachments', request) + headers = {} + headers['Accept'] = 'application/json' + headers['user-agent'] = f'speakeasy-sdk/{self.sdk_configuration.language} {self.sdk_configuration.sdk_version} {self.sdk_configuration.gen_version} {self.sdk_configuration.openapi_doc_version}' + + client = self.sdk_configuration.security_client + + retry_config = retries + if retry_config is None: + 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.ListBillAttachmentsResponse(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.Attachments]) + res.attachments = 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, 404, 429]: + if utils.match_content_type(content_type, 'application/json'): + out = utils.unmarshal_json(http_res.text, Optional[shared.ErrorMessage]) + res.error_message = out + else: + raise errors.SDKError(f'unknown content-type received: {content_type}', http_res.status_code, http_res.text, http_res) + + return res + + + def update(self, request: operations.UpdateBillRequest, retries: Optional[utils.RetryConfig] = None) -> operations.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. + """ + base_url = utils.template_url(*self.sdk_configuration.get_server_details()) + + url = utils.generate_url(operations.UpdateBillRequest, base_url, '/companies/{companyId}/connections/{connectionId}/push/bills/{billId}', request) + headers = {} + req_content_type, data, form = utils.serialize_request_body(request, "bill", 'json') + if req_content_type not in ('multipart/form-data', 'multipart/mixed'): + headers['content-type'] = req_content_type + query_params = utils.get_query_params(operations.UpdateBillRequest, request) + headers['Accept'] = 'application/json' + headers['user-agent'] = f'speakeasy-sdk/{self.sdk_configuration.language} {self.sdk_configuration.sdk_version} {self.sdk_configuration.gen_version} {self.sdk_configuration.openapi_doc_version}' + + client = self.sdk_configuration.security_client + + retry_config = retries + if retry_config is None: + retry_config = utils.RetryConfig('backoff', utils.BackoffStrategy(500, 60000, 1.5, 3600000), True) + + def do_request(): + return client.request('PUT', url, params=query_params, 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.UpdateBillResponse(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.UpdateBillResponse]) + res.update_bill_response = 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, 404, 429]: + if utils.match_content_type(content_type, 'application/json'): + out = utils.unmarshal_json(http_res.text, Optional[shared.ErrorMessage]) + res.error_message = out + else: + raise errors.SDKError(f'unknown content-type received: {content_type}', http_res.status_code, http_res.text, http_res) + + return res + + + def upload_attachment(self, request: operations.UploadBillAttachmentRequest, retries: Optional[utils.RetryConfig] = None) -> operations.UploadBillAttachmentResponse: + 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. + """ + base_url = utils.template_url(*self.sdk_configuration.get_server_details()) + + url = utils.generate_url(operations.UploadBillAttachmentRequest, base_url, '/companies/{companyId}/connections/{connectionId}/push/bills/{billId}/attachments', request) + headers = {} + req_content_type, data, form = utils.serialize_request_body(request, "request_body", 'multipart') + if req_content_type not in ('multipart/form-data', 'multipart/mixed'): + headers['content-type'] = req_content_type + headers['Accept'] = 'application/json' + headers['user-agent'] = f'speakeasy-sdk/{self.sdk_configuration.language} {self.sdk_configuration.sdk_version} {self.sdk_configuration.gen_version} {self.sdk_configuration.openapi_doc_version}' + + client = self.sdk_configuration.security_client + + retry_config = retries + if retry_config is None: + 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.UploadBillAttachmentResponse(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, 404, 429]: + if utils.match_content_type(content_type, 'application/json'): + out = utils.unmarshal_json(http_res.text, Optional[shared.ErrorMessage]) + res.error_message = out + else: + raise errors.SDKError(f'unknown content-type received: {content_type}', http_res.status_code, http_res.text, http_res) + + return res + + \ No newline at end of file diff --git a/sync-for-payables/src/codatsyncpayables/companies.py b/sync-for-payables/src/codatsyncpayables/companies.py new file mode 100755 index 000000000..2d80cfc54 --- /dev/null +++ b/sync-for-payables/src/codatsyncpayables/companies.py @@ -0,0 +1,245 @@ +"""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: shared.CompanyRequestBody, retries: Optional[utils.RetryConfig] = None) -> operations.CreateCompanyResponse: + r"""Create company + Creates a new company that can be used to assign connections to. + + 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, "request", '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'] = f'speakeasy-sdk/{self.sdk_configuration.language} {self.sdk_configuration.sdk_version} {self.sdk_configuration.gen_version} {self.sdk_configuration.openapi_doc_version}' + + client = self.sdk_configuration.security_client + + retry_config = retries + if retry_config is None: + 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, 429]: + if utils.match_content_type(content_type, 'application/json'): + out = utils.unmarshal_json(http_res.text, Optional[shared.ErrorMessage]) + res.error_message = out + else: + raise errors.SDKError(f'unknown content-type received: {content_type}', 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 + Permanently deletes a company, its connections and any cached data. This operation is irreversible. If the company ID does not exist an error is returned. + """ + 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'] = f'speakeasy-sdk/{self.sdk_configuration.language} {self.sdk_configuration.sdk_version} {self.sdk_configuration.gen_version} {self.sdk_configuration.openapi_doc_version}' + + client = self.sdk_configuration.security_client + + retry_config = retries + if retry_config is None: + 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, 404, 429]: + if utils.match_content_type(content_type, 'application/json'): + out = utils.unmarshal_json(http_res.text, Optional[shared.ErrorMessage]) + res.error_message = out + else: + raise errors.SDKError(f'unknown content-type received: {content_type}', 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 + Returns the company for a valid identifier. If the identifier is for a deleted company, a not found response is returned. + """ + 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'] = f'speakeasy-sdk/{self.sdk_configuration.language} {self.sdk_configuration.sdk_version} {self.sdk_configuration.gen_version} {self.sdk_configuration.openapi_doc_version}' + + client = self.sdk_configuration.security_client + + retry_config = retries + if retry_config is None: + 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, 404, 429]: + if utils.match_content_type(content_type, 'application/json'): + out = utils.unmarshal_json(http_res.text, Optional[shared.ErrorMessage]) + res.error_message = out + else: + raise errors.SDKError(f'unknown content-type received: {content_type}', 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 + Returns a list of your companies. The company schema contains a list of [connections](https://docs.codat.io/sync-for-payables-api#/schemas/Connection) related to the company. + """ + 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'] = f'speakeasy-sdk/{self.sdk_configuration.language} {self.sdk_configuration.sdk_version} {self.sdk_configuration.gen_version} {self.sdk_configuration.openapi_doc_version}' + + client = self.sdk_configuration.security_client + + retry_config = retries + if retry_config is None: + 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, 429]: + if utils.match_content_type(content_type, 'application/json'): + out = utils.unmarshal_json(http_res.text, Optional[shared.ErrorMessage]) + res.error_message = out + else: + raise errors.SDKError(f'unknown content-type received: {content_type}', 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 + Updates both the name and description of the company. + """ + 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, "company_request_body", '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'] = f'speakeasy-sdk/{self.sdk_configuration.language} {self.sdk_configuration.sdk_version} {self.sdk_configuration.gen_version} {self.sdk_configuration.openapi_doc_version}' + + client = self.sdk_configuration.security_client + + retry_config = retries + if retry_config is None: + 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, 404, 429]: + if utils.match_content_type(content_type, 'application/json'): + out = utils.unmarshal_json(http_res.text, Optional[shared.ErrorMessage]) + res.error_message = out + else: + raise errors.SDKError(f'unknown content-type received: {content_type}', http_res.status_code, http_res.text, http_res) + + return res + + \ No newline at end of file diff --git a/sync-for-payables/src/codatsyncpayables/connections.py b/sync-for-payables/src/codatsyncpayables/connections.py new file mode 100755 index 000000000..9057131ef --- /dev/null +++ b/sync-for-payables/src/codatsyncpayables/connections.py @@ -0,0 +1,246 @@ +"""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, "request_body", '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'] = f'speakeasy-sdk/{self.sdk_configuration.language} {self.sdk_configuration.sdk_version} {self.sdk_configuration.gen_version} {self.sdk_configuration.openapi_doc_version}' + + client = self.sdk_configuration.security_client + + retry_config = retries + if retry_config is None: + 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, 404, 429]: + if utils.match_content_type(content_type, 'application/json'): + out = utils.unmarshal_json(http_res.text, Optional[shared.ErrorMessage]) + res.error_message = out + else: + raise errors.SDKError(f'unknown content-type received: {content_type}', 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'] = f'speakeasy-sdk/{self.sdk_configuration.language} {self.sdk_configuration.sdk_version} {self.sdk_configuration.gen_version} {self.sdk_configuration.openapi_doc_version}' + + client = self.sdk_configuration.security_client + + retry_config = retries + if retry_config is None: + 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, 404, 429]: + if utils.match_content_type(content_type, 'application/json'): + out = utils.unmarshal_json(http_res.text, Optional[shared.ErrorMessage]) + res.error_message = out + else: + raise errors.SDKError(f'unknown content-type received: {content_type}', 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'] = f'speakeasy-sdk/{self.sdk_configuration.language} {self.sdk_configuration.sdk_version} {self.sdk_configuration.gen_version} {self.sdk_configuration.openapi_doc_version}' + + client = self.sdk_configuration.security_client + + retry_config = retries + if retry_config is None: + 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, 404, 429]: + if utils.match_content_type(content_type, 'application/json'): + out = utils.unmarshal_json(http_res.text, Optional[shared.ErrorMessage]) + res.error_message = out + else: + raise errors.SDKError(f'unknown content-type received: {content_type}', 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'] = f'speakeasy-sdk/{self.sdk_configuration.language} {self.sdk_configuration.sdk_version} {self.sdk_configuration.gen_version} {self.sdk_configuration.openapi_doc_version}' + + client = self.sdk_configuration.security_client + + retry_config = retries + if retry_config is None: + 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, 404, 429]: + if utils.match_content_type(content_type, 'application/json'): + out = utils.unmarshal_json(http_res.text, Optional[shared.ErrorMessage]) + res.error_message = out + else: + raise errors.SDKError(f'unknown content-type received: {content_type}', 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, "request_body", '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'] = f'speakeasy-sdk/{self.sdk_configuration.language} {self.sdk_configuration.sdk_version} {self.sdk_configuration.gen_version} {self.sdk_configuration.openapi_doc_version}' + + client = self.sdk_configuration.security_client + + retry_config = retries + if retry_config is None: + 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, 404, 429]: + if utils.match_content_type(content_type, 'application/json'): + out = utils.unmarshal_json(http_res.text, Optional[shared.ErrorMessage]) + res.error_message = out + else: + raise errors.SDKError(f'unknown content-type received: {content_type}', http_res.status_code, http_res.text, http_res) + + return res + + \ No newline at end of file diff --git a/sync-for-payables/src/codatsyncpayables/journal_entries.py b/sync-for-payables/src/codatsyncpayables/journal_entries.py new file mode 100755 index 000000000..c80f60468 --- /dev/null +++ b/sync-for-payables/src/codatsyncpayables/journal_entries.py @@ -0,0 +1,125 @@ +"""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 JournalEntries: + r"""Journal entries""" + sdk_configuration: SDKConfiguration + + def __init__(self, sdk_config: SDKConfiguration) -> None: + self.sdk_configuration = sdk_config + + + def create(self, request: operations.CreateJournalEntryRequest, retries: Optional[utils.RetryConfig] = None) -> operations.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. + """ + base_url = utils.template_url(*self.sdk_configuration.get_server_details()) + + url = utils.generate_url(operations.CreateJournalEntryRequest, base_url, '/companies/{companyId}/connections/{connectionId}/push/journalEntries', request) + headers = {} + req_content_type, data, form = utils.serialize_request_body(request, "journal_entry", 'json') + if req_content_type not in ('multipart/form-data', 'multipart/mixed'): + headers['content-type'] = req_content_type + query_params = utils.get_query_params(operations.CreateJournalEntryRequest, request) + headers['Accept'] = 'application/json' + headers['user-agent'] = f'speakeasy-sdk/{self.sdk_configuration.language} {self.sdk_configuration.sdk_version} {self.sdk_configuration.gen_version} {self.sdk_configuration.openapi_doc_version}' + + client = self.sdk_configuration.security_client + + retry_config = retries + if retry_config is None: + retry_config = utils.RetryConfig('backoff', utils.BackoffStrategy(500, 60000, 1.5, 3600000), True) + + def do_request(): + return client.request('POST', url, params=query_params, 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.CreateJournalEntryResponse(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.CreateJournalEntryResponse]) + res.create_journal_entry_response = 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, 404, 429]: + if utils.match_content_type(content_type, 'application/json'): + out = utils.unmarshal_json(http_res.text, Optional[shared.ErrorMessage]) + res.error_message = out + else: + raise errors.SDKError(f'unknown content-type received: {content_type}', http_res.status_code, http_res.text, http_res) + + return res + + + def get_create_model(self, request: operations.GetCreateJournalEntryModelRequest, retries: Optional[utils.RetryConfig] = None) -> operations.GetCreateJournalEntryModelResponse: + 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. + """ + base_url = utils.template_url(*self.sdk_configuration.get_server_details()) + + url = utils.generate_url(operations.GetCreateJournalEntryModelRequest, base_url, '/companies/{companyId}/connections/{connectionId}/options/journalEntries', request) + headers = {} + headers['Accept'] = 'application/json' + headers['user-agent'] = f'speakeasy-sdk/{self.sdk_configuration.language} {self.sdk_configuration.sdk_version} {self.sdk_configuration.gen_version} {self.sdk_configuration.openapi_doc_version}' + + client = self.sdk_configuration.security_client + + retry_config = retries + if retry_config is None: + 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.GetCreateJournalEntryModelResponse(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.PushOption]) + res.push_option = 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, 404, 429]: + if utils.match_content_type(content_type, 'application/json'): + out = utils.unmarshal_json(http_res.text, Optional[shared.ErrorMessage]) + res.error_message = out + else: + raise errors.SDKError(f'unknown content-type received: {content_type}', http_res.status_code, http_res.text, http_res) + + return res + + \ No newline at end of file diff --git a/sync-for-payables/src/codatsyncpayables/journals.py b/sync-for-payables/src/codatsyncpayables/journals.py new file mode 100755 index 000000000..d08c3e388 --- /dev/null +++ b/sync-for-payables/src/codatsyncpayables/journals.py @@ -0,0 +1,226 @@ +"""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 Journals: + r"""Journals""" + sdk_configuration: SDKConfiguration + + def __init__(self, sdk_config: SDKConfiguration) -> None: + self.sdk_configuration = sdk_config + + + def create(self, request: operations.CreateJournalRequest, retries: Optional[utils.RetryConfig] = None) -> operations.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. + """ + base_url = utils.template_url(*self.sdk_configuration.get_server_details()) + + url = utils.generate_url(operations.CreateJournalRequest, base_url, '/companies/{companyId}/connections/{connectionId}/push/journals', request) + headers = {} + req_content_type, data, form = utils.serialize_request_body(request, "journal", 'json') + if req_content_type not in ('multipart/form-data', 'multipart/mixed'): + headers['content-type'] = req_content_type + query_params = utils.get_query_params(operations.CreateJournalRequest, request) + headers['Accept'] = 'application/json' + headers['user-agent'] = f'speakeasy-sdk/{self.sdk_configuration.language} {self.sdk_configuration.sdk_version} {self.sdk_configuration.gen_version} {self.sdk_configuration.openapi_doc_version}' + + client = self.sdk_configuration.security_client + + retry_config = retries + if retry_config is None: + retry_config = utils.RetryConfig('backoff', utils.BackoffStrategy(500, 60000, 1.5, 3600000), True) + + def do_request(): + return client.request('POST', url, params=query_params, 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.CreateJournalResponse(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.CreateJournalResponse]) + res.create_journal_response = 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, 404, 429]: + if utils.match_content_type(content_type, 'application/json'): + out = utils.unmarshal_json(http_res.text, Optional[shared.ErrorMessage]) + res.error_message = out + else: + raise errors.SDKError(f'unknown content-type received: {content_type}', http_res.status_code, http_res.text, http_res) + + return res + + + def get(self, request: operations.GetJournalRequest, retries: Optional[utils.RetryConfig] = None) -> operations.GetJournalResponse: + 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). + """ + base_url = utils.template_url(*self.sdk_configuration.get_server_details()) + + url = utils.generate_url(operations.GetJournalRequest, base_url, '/companies/{companyId}/data/journals/{journalId}', request) + headers = {} + headers['Accept'] = 'application/json' + headers['user-agent'] = f'speakeasy-sdk/{self.sdk_configuration.language} {self.sdk_configuration.sdk_version} {self.sdk_configuration.gen_version} {self.sdk_configuration.openapi_doc_version}' + + client = self.sdk_configuration.security_client + + retry_config = retries + if retry_config is None: + 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.GetJournalResponse(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.Journal]) + res.journal = 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, 404, 409, 429]: + if utils.match_content_type(content_type, 'application/json'): + out = utils.unmarshal_json(http_res.text, Optional[shared.ErrorMessage]) + res.error_message = out + else: + raise errors.SDKError(f'unknown content-type received: {content_type}', http_res.status_code, http_res.text, http_res) + + return res + + + def get_create_model(self, request: operations.GetCreateJournalModelRequest, retries: Optional[utils.RetryConfig] = None) -> operations.GetCreateJournalModelResponse: + 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. + """ + base_url = utils.template_url(*self.sdk_configuration.get_server_details()) + + url = utils.generate_url(operations.GetCreateJournalModelRequest, base_url, '/companies/{companyId}/connections/{connectionId}/options/journals', request) + headers = {} + headers['Accept'] = 'application/json' + headers['user-agent'] = f'speakeasy-sdk/{self.sdk_configuration.language} {self.sdk_configuration.sdk_version} {self.sdk_configuration.gen_version} {self.sdk_configuration.openapi_doc_version}' + + client = self.sdk_configuration.security_client + + retry_config = retries + if retry_config is None: + 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.GetCreateJournalModelResponse(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.PushOption]) + res.push_option = 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, 404, 429]: + if utils.match_content_type(content_type, 'application/json'): + out = utils.unmarshal_json(http_res.text, Optional[shared.ErrorMessage]) + res.error_message = out + else: + raise errors.SDKError(f'unknown content-type received: {content_type}', http_res.status_code, http_res.text, http_res) + + return res + + + def list(self, request: operations.ListJournalsRequest, retries: Optional[utils.RetryConfig] = None) -> operations.ListJournalsResponse: + 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). + """ + base_url = utils.template_url(*self.sdk_configuration.get_server_details()) + + url = utils.generate_url(operations.ListJournalsRequest, base_url, '/companies/{companyId}/data/journals', request) + headers = {} + query_params = utils.get_query_params(operations.ListJournalsRequest, request) + headers['Accept'] = 'application/json' + headers['user-agent'] = f'speakeasy-sdk/{self.sdk_configuration.language} {self.sdk_configuration.sdk_version} {self.sdk_configuration.gen_version} {self.sdk_configuration.openapi_doc_version}' + + client = self.sdk_configuration.security_client + + retry_config = retries + if retry_config is None: + 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.ListJournalsResponse(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.Journals]) + res.journals = 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, 404, 409]: + if utils.match_content_type(content_type, 'application/json'): + out = utils.unmarshal_json(http_res.text, Optional[shared.ErrorMessage]) + res.error_message = out + else: + raise errors.SDKError(f'unknown content-type received: {content_type}', http_res.status_code, http_res.text, http_res) + + return res + + \ No newline at end of file diff --git a/sync-for-payables/src/codatsyncpayables/manage_data.py b/sync-for-payables/src/codatsyncpayables/manage_data.py new file mode 100755 index 000000000..088fb61a3 --- /dev/null +++ b/sync-for-payables/src/codatsyncpayables/manage_data.py @@ -0,0 +1,244 @@ +"""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 ManageData: + r"""Asynchronously retrieve data from an integration to refresh data in Codat.""" + sdk_configuration: SDKConfiguration + + def __init__(self, sdk_config: SDKConfiguration) -> None: + self.sdk_configuration = sdk_config + + + def get(self, request: operations.GetDataStatusRequest, retries: Optional[utils.RetryConfig] = None) -> operations.GetDataStatusResponse: + r"""Get data status + Get the state of each data type for a company + """ + base_url = utils.template_url(*self.sdk_configuration.get_server_details()) + + url = utils.generate_url(operations.GetDataStatusRequest, base_url, '/companies/{companyId}/dataStatus', request) + headers = {} + headers['Accept'] = 'application/json' + headers['user-agent'] = f'speakeasy-sdk/{self.sdk_configuration.language} {self.sdk_configuration.sdk_version} {self.sdk_configuration.gen_version} {self.sdk_configuration.openapi_doc_version}' + + client = self.sdk_configuration.security_client + + retry_config = retries + if retry_config is None: + 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.GetDataStatusResponse(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[dict[str, shared.DataStatus]]) + res.data_status_response = 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, 404, 429]: + if utils.match_content_type(content_type, 'application/json'): + out = utils.unmarshal_json(http_res.text, Optional[shared.ErrorMessage]) + res.error_message = out + else: + raise errors.SDKError(f'unknown content-type received: {content_type}', http_res.status_code, http_res.text, http_res) + + return res + + + def get_pull_operation(self, request: operations.GetPullOperationRequest, retries: Optional[utils.RetryConfig] = None) -> operations.GetPullOperationResponse: + r"""Get pull operation + Retrieve information about a single dataset or pull operation. + """ + base_url = utils.template_url(*self.sdk_configuration.get_server_details()) + + url = utils.generate_url(operations.GetPullOperationRequest, base_url, '/companies/{companyId}/data/history/{datasetId}', request) + headers = {} + headers['Accept'] = 'application/json' + headers['user-agent'] = f'speakeasy-sdk/{self.sdk_configuration.language} {self.sdk_configuration.sdk_version} {self.sdk_configuration.gen_version} {self.sdk_configuration.openapi_doc_version}' + + client = self.sdk_configuration.security_client + + retry_config = retries + if retry_config is None: + 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.GetPullOperationResponse(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.PullOperation]) + res.pull_operation = 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, 404, 429]: + if utils.match_content_type(content_type, 'application/json'): + out = utils.unmarshal_json(http_res.text, Optional[shared.ErrorMessage]) + res.error_message = out + else: + raise errors.SDKError(f'unknown content-type received: {content_type}', http_res.status_code, http_res.text, http_res) + + return res + + + def list_pull_operations(self, request: operations.ListPullOperationsRequest, retries: Optional[utils.RetryConfig] = None) -> operations.ListPullOperationsResponse: + r"""List pull operations + Gets the pull operation history (datasets) for a given company. + """ + base_url = utils.template_url(*self.sdk_configuration.get_server_details()) + + url = utils.generate_url(operations.ListPullOperationsRequest, base_url, '/companies/{companyId}/data/history', request) + headers = {} + query_params = utils.get_query_params(operations.ListPullOperationsRequest, request) + headers['Accept'] = 'application/json' + headers['user-agent'] = f'speakeasy-sdk/{self.sdk_configuration.language} {self.sdk_configuration.sdk_version} {self.sdk_configuration.gen_version} {self.sdk_configuration.openapi_doc_version}' + + client = self.sdk_configuration.security_client + + retry_config = retries + if retry_config is None: + 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.ListPullOperationsResponse(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.PullOperations]) + res.pull_operations = 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, 404, 429]: + if utils.match_content_type(content_type, 'application/json'): + out = utils.unmarshal_json(http_res.text, Optional[shared.ErrorMessage]) + res.error_message = out + else: + raise errors.SDKError(f'unknown content-type received: {content_type}', http_res.status_code, http_res.text, http_res) + + return res + + + def refresh_all_data_types(self, request: operations.RefreshAllDataTypesRequest, retries: Optional[utils.RetryConfig] = None) -> operations.RefreshAllDataTypesResponse: + 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`. + """ + base_url = utils.template_url(*self.sdk_configuration.get_server_details()) + + url = utils.generate_url(operations.RefreshAllDataTypesRequest, base_url, '/companies/{companyId}/data/all', request) + headers = {} + headers['Accept'] = 'application/json' + headers['user-agent'] = f'speakeasy-sdk/{self.sdk_configuration.language} {self.sdk_configuration.sdk_version} {self.sdk_configuration.gen_version} {self.sdk_configuration.openapi_doc_version}' + + client = self.sdk_configuration.security_client + + retry_config = retries + if retry_config is None: + retry_config = utils.RetryConfig('backoff', utils.BackoffStrategy(500, 60000, 1.5, 3600000), True) + + def do_request(): + return client.request('POST', 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.RefreshAllDataTypesResponse(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, 404, 429]: + if utils.match_content_type(content_type, 'application/json'): + out = utils.unmarshal_json(http_res.text, Optional[shared.ErrorMessage]) + res.error_message = out + else: + raise errors.SDKError(f'unknown content-type received: {content_type}', http_res.status_code, http_res.text, http_res) + + return res + + + def refresh_data_type(self, request: operations.RefreshDataTypeRequest, retries: Optional[utils.RetryConfig] = None) -> operations.RefreshDataTypeResponse: + 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. + """ + base_url = utils.template_url(*self.sdk_configuration.get_server_details()) + + url = utils.generate_url(operations.RefreshDataTypeRequest, base_url, '/companies/{companyId}/data/queue/{dataType}', request) + headers = {} + query_params = utils.get_query_params(operations.RefreshDataTypeRequest, request) + headers['Accept'] = 'application/json' + headers['user-agent'] = f'speakeasy-sdk/{self.sdk_configuration.language} {self.sdk_configuration.sdk_version} {self.sdk_configuration.gen_version} {self.sdk_configuration.openapi_doc_version}' + + client = self.sdk_configuration.security_client + + retry_config = retries + if retry_config is None: + retry_config = utils.RetryConfig('backoff', utils.BackoffStrategy(500, 60000, 1.5, 3600000), True) + + def do_request(): + return client.request('POST', 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.RefreshDataTypeResponse(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.PullOperation]) + res.pull_operation = 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, 404, 429]: + if utils.match_content_type(content_type, 'application/json'): + out = utils.unmarshal_json(http_res.text, Optional[shared.ErrorMessage]) + res.error_message = out + else: + raise errors.SDKError(f'unknown content-type received: {content_type}', http_res.status_code, http_res.text, http_res) + + return res + + \ No newline at end of file diff --git a/sync-for-payables/src/codatsyncpayables/models/__init__.py b/sync-for-payables/src/codatsyncpayables/models/__init__.py new file mode 100755 index 000000000..889f8adcf --- /dev/null +++ b/sync-for-payables/src/codatsyncpayables/models/__init__.py @@ -0,0 +1,2 @@ +"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" + diff --git a/sync-for-payables/src/codatsyncpayables/models/errors/__init__.py b/sync-for-payables/src/codatsyncpayables/models/errors/__init__.py new file mode 100755 index 000000000..cfd848441 --- /dev/null +++ b/sync-for-payables/src/codatsyncpayables/models/errors/__init__.py @@ -0,0 +1,4 @@ +"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" + +from .sdkerror import SDKError +__all__ = ["SDKError"] diff --git a/sync-for-payables/src/codatsyncpayables/models/errors/sdkerror.py b/sync-for-payables/src/codatsyncpayables/models/errors/sdkerror.py new file mode 100755 index 000000000..6bb02bbd6 --- /dev/null +++ b/sync-for-payables/src/codatsyncpayables/models/errors/sdkerror.py @@ -0,0 +1,24 @@ +"""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/sync-for-payables/src/codatsyncpayables/models/operations/__init__.py b/sync-for-payables/src/codatsyncpayables/models/operations/__init__.py new file mode 100755 index 000000000..f3f394124 --- /dev/null +++ b/sync-for-payables/src/codatsyncpayables/models/operations/__init__.py @@ -0,0 +1,60 @@ +"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" + +from .create_account import * +from .create_bill import * +from .create_bill_credit_note import * +from .create_bill_payment import * +from .create_company import * +from .create_connection import * +from .create_journal import * +from .create_journal_entry import * +from .create_supplier import * +from .delete_company import * +from .delete_connection import * +from .download_bill_attachment import * +from .get_account import * +from .get_bill import * +from .get_bill_attachment import * +from .get_bill_credit_note import * +from .get_bill_payments import * +from .get_company import * +from .get_connection import * +from .get_create_account_model import * +from .get_create_billpayment_model import * +from .get_create_journal_model import * +from .get_create_journalentry_model import * +from .get_create_update_bill_model import * +from .get_create_update_billcreditnote_model import * +from .get_create_update_supplier_model import * +from .get_data_status import * +from .get_journal import * +from .get_payment_method import * +from .get_pull_operation import * +from .get_push_operation import * +from .get_supplier import * +from .get_tax_rate import * +from .get_tracking_category import * +from .list_accounts import * +from .list_bill_attachments import * +from .list_bill_credit_notes import * +from .list_bill_payments import * +from .list_bills import * +from .list_companies import * +from .list_connections import * +from .list_journals import * +from .list_payment_methods import * +from .list_pull_operations import * +from .list_push_operations import * +from .list_suppliers import * +from .list_tax_rates import * +from .list_tracking_categories import * +from .refresh_all_data_types import * +from .refresh_data_type import * +from .unlink_connection import * +from .update_bill import * +from .update_bill_credit_note import * +from .update_company import * +from .update_supplier import * +from .upload_bill_attachment import * + +__all__ = ["CreateAccountRequest","CreateAccountResponse","CreateBillCreditNoteRequest","CreateBillCreditNoteResponse","CreateBillPaymentRequest","CreateBillPaymentResponse","CreateBillRequest","CreateBillResponse","CreateCompanyResponse","CreateConnectionRequest","CreateConnectionRequestBody","CreateConnectionResponse","CreateJournalEntryRequest","CreateJournalEntryResponse","CreateJournalRequest","CreateJournalResponse","CreateSupplierRequest","CreateSupplierResponse","DeleteCompanyRequest","DeleteCompanyResponse","DeleteConnectionRequest","DeleteConnectionResponse","DownloadBillAttachmentRequest","DownloadBillAttachmentResponse","GetAccountRequest","GetAccountResponse","GetBillAttachmentRequest","GetBillAttachmentResponse","GetBillCreditNoteRequest","GetBillCreditNoteResponse","GetBillPaymentsRequest","GetBillPaymentsResponse","GetBillRequest","GetBillResponse","GetCompanyRequest","GetCompanyResponse","GetConnectionRequest","GetConnectionResponse","GetCreateAccountModelRequest","GetCreateAccountModelResponse","GetCreateBillPaymentModelRequest","GetCreateBillPaymentModelResponse","GetCreateJournalEntryModelRequest","GetCreateJournalEntryModelResponse","GetCreateJournalModelRequest","GetCreateJournalModelResponse","GetCreateUpdateBillCreditNoteModelRequest","GetCreateUpdateBillCreditNoteModelResponse","GetCreateUpdateBillModelRequest","GetCreateUpdateBillModelResponse","GetCreateUpdateSupplierModelRequest","GetCreateUpdateSupplierModelResponse","GetDataStatusRequest","GetDataStatusResponse","GetJournalRequest","GetJournalResponse","GetPaymentMethodRequest","GetPaymentMethodResponse","GetPullOperationRequest","GetPullOperationResponse","GetPushOperationRequest","GetPushOperationResponse","GetSupplierRequest","GetSupplierResponse","GetTaxRateRequest","GetTaxRateResponse","GetTrackingCategoryRequest","GetTrackingCategoryResponse","ListAccountsRequest","ListAccountsResponse","ListBillAttachmentsRequest","ListBillAttachmentsResponse","ListBillCreditNotesRequest","ListBillCreditNotesResponse","ListBillPaymentsRequest","ListBillPaymentsResponse","ListBillsRequest","ListBillsResponse","ListCompaniesRequest","ListCompaniesResponse","ListConnectionsRequest","ListConnectionsResponse","ListJournalsRequest","ListJournalsResponse","ListPaymentMethodsRequest","ListPaymentMethodsResponse","ListPullOperationsRequest","ListPullOperationsResponse","ListPushOperationsRequest","ListPushOperationsResponse","ListSuppliersRequest","ListSuppliersResponse","ListTaxRatesRequest","ListTaxRatesResponse","ListTrackingCategoriesRequest","ListTrackingCategoriesResponse","RefreshAllDataTypesRequest","RefreshAllDataTypesResponse","RefreshDataTypeRequest","RefreshDataTypeResponse","UnlinkConnectionRequest","UnlinkConnectionRequestBody","UnlinkConnectionResponse","UpdateBillCreditNoteRequest","UpdateBillCreditNoteResponse","UpdateBillRequest","UpdateBillResponse","UpdateCompanyRequest","UpdateCompanyResponse","UpdateSupplierRequest","UpdateSupplierResponse","UploadBillAttachmentRequest","UploadBillAttachmentRequestBody","UploadBillAttachmentResponse"] diff --git a/sync-for-payables/src/codatsyncpayables/models/operations/create_account.py b/sync-for-payables/src/codatsyncpayables/models/operations/create_account.py new file mode 100755 index 000000000..de86deb4a --- /dev/null +++ b/sync-for-payables/src/codatsyncpayables/models/operations/create_account.py @@ -0,0 +1,34 @@ +"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" + +from __future__ import annotations +import dataclasses +import requests as requests_http +from ..shared import account as shared_account +from ..shared import createaccountresponse as shared_createaccountresponse +from ..shared import errormessage as shared_errormessage +from typing import Optional + + + +@dataclasses.dataclass +class CreateAccountRequest: + company_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'companyId', 'style': 'simple', 'explode': False }}) + connection_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'connectionId', 'style': 'simple', 'explode': False }}) + account: Optional[shared_account.Account] = dataclasses.field(default=None, metadata={'request': { 'media_type': 'application/json' }}) + timeout_in_minutes: Optional[int] = dataclasses.field(default=None, metadata={'query_param': { 'field_name': 'timeoutInMinutes', 'style': 'form', 'explode': True }}) + + + + + +@dataclasses.dataclass +class CreateAccountResponse: + content_type: str = dataclasses.field() + status_code: int = dataclasses.field() + create_account_response: Optional[shared_createaccountresponse.CreateAccountResponse] = dataclasses.field(default=None) + r"""Success""" + error_message: Optional[shared_errormessage.ErrorMessage] = dataclasses.field(default=None) + r"""The request made is not valid.""" + raw_response: Optional[requests_http.Response] = dataclasses.field(default=None) + + diff --git a/sync-for-payables/src/codatsyncpayables/models/operations/create_bill.py b/sync-for-payables/src/codatsyncpayables/models/operations/create_bill.py new file mode 100755 index 000000000..2f92ad295 --- /dev/null +++ b/sync-for-payables/src/codatsyncpayables/models/operations/create_bill.py @@ -0,0 +1,34 @@ +"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" + +from __future__ import annotations +import dataclasses +import requests as requests_http +from ..shared import bill as shared_bill +from ..shared import createbillresponse as shared_createbillresponse +from ..shared import errormessage as shared_errormessage +from typing import Optional + + + +@dataclasses.dataclass +class CreateBillRequest: + company_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'companyId', 'style': 'simple', 'explode': False }}) + connection_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'connectionId', 'style': 'simple', 'explode': False }}) + bill: Optional[shared_bill.Bill] = dataclasses.field(default=None, metadata={'request': { 'media_type': 'application/json' }}) + timeout_in_minutes: Optional[int] = dataclasses.field(default=None, metadata={'query_param': { 'field_name': 'timeoutInMinutes', 'style': 'form', 'explode': True }}) + + + + + +@dataclasses.dataclass +class CreateBillResponse: + content_type: str = dataclasses.field() + status_code: int = dataclasses.field() + create_bill_response: Optional[shared_createbillresponse.CreateBillResponse] = dataclasses.field(default=None) + r"""Success""" + error_message: Optional[shared_errormessage.ErrorMessage] = dataclasses.field(default=None) + r"""The request made is not valid.""" + raw_response: Optional[requests_http.Response] = dataclasses.field(default=None) + + diff --git a/sync-for-payables/src/codatsyncpayables/models/operations/create_bill_credit_note.py b/sync-for-payables/src/codatsyncpayables/models/operations/create_bill_credit_note.py new file mode 100755 index 000000000..f6e327e8d --- /dev/null +++ b/sync-for-payables/src/codatsyncpayables/models/operations/create_bill_credit_note.py @@ -0,0 +1,34 @@ +"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" + +from __future__ import annotations +import dataclasses +import requests as requests_http +from ..shared import billcreditnote as shared_billcreditnote +from ..shared import createbillcreditnoteresponse as shared_createbillcreditnoteresponse +from ..shared import errormessage as shared_errormessage +from typing import Optional + + + +@dataclasses.dataclass +class CreateBillCreditNoteRequest: + company_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'companyId', 'style': 'simple', 'explode': False }}) + connection_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'connectionId', 'style': 'simple', 'explode': False }}) + bill_credit_note: Optional[shared_billcreditnote.BillCreditNote] = dataclasses.field(default=None, metadata={'request': { 'media_type': 'application/json' }}) + timeout_in_minutes: Optional[int] = dataclasses.field(default=None, metadata={'query_param': { 'field_name': 'timeoutInMinutes', 'style': 'form', 'explode': True }}) + + + + + +@dataclasses.dataclass +class CreateBillCreditNoteResponse: + content_type: str = dataclasses.field() + status_code: int = dataclasses.field() + create_bill_credit_note_response: Optional[shared_createbillcreditnoteresponse.CreateBillCreditNoteResponse] = dataclasses.field(default=None) + r"""Success""" + error_message: Optional[shared_errormessage.ErrorMessage] = dataclasses.field(default=None) + r"""The request made is not valid.""" + raw_response: Optional[requests_http.Response] = dataclasses.field(default=None) + + diff --git a/sync-for-payables/src/codatsyncpayables/models/operations/create_bill_payment.py b/sync-for-payables/src/codatsyncpayables/models/operations/create_bill_payment.py new file mode 100755 index 000000000..9de0d5a10 --- /dev/null +++ b/sync-for-payables/src/codatsyncpayables/models/operations/create_bill_payment.py @@ -0,0 +1,34 @@ +"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" + +from __future__ import annotations +import dataclasses +import requests as requests_http +from ..shared import billpayment as shared_billpayment +from ..shared import createbillpaymentresponse as shared_createbillpaymentresponse +from ..shared import errormessage as shared_errormessage +from typing import Optional + + + +@dataclasses.dataclass +class CreateBillPaymentRequest: + company_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'companyId', 'style': 'simple', 'explode': False }}) + connection_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'connectionId', 'style': 'simple', 'explode': False }}) + bill_payment: Optional[shared_billpayment.BillPayment] = dataclasses.field(default=None, metadata={'request': { 'media_type': 'application/json' }}) + timeout_in_minutes: Optional[int] = dataclasses.field(default=None, metadata={'query_param': { 'field_name': 'timeoutInMinutes', 'style': 'form', 'explode': True }}) + + + + + +@dataclasses.dataclass +class CreateBillPaymentResponse: + content_type: str = dataclasses.field() + status_code: int = dataclasses.field() + create_bill_payment_response: Optional[shared_createbillpaymentresponse.CreateBillPaymentResponse] = dataclasses.field(default=None) + r"""Success""" + error_message: Optional[shared_errormessage.ErrorMessage] = dataclasses.field(default=None) + r"""The request made is not valid.""" + raw_response: Optional[requests_http.Response] = dataclasses.field(default=None) + + diff --git a/sync-for-payables/src/codatsyncpayables/models/operations/create_company.py b/sync-for-payables/src/codatsyncpayables/models/operations/create_company.py new file mode 100755 index 000000000..a8a25afd3 --- /dev/null +++ b/sync-for-payables/src/codatsyncpayables/models/operations/create_company.py @@ -0,0 +1,22 @@ +"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" + +from __future__ import annotations +import dataclasses +import requests as requests_http +from ..shared import company as shared_company +from ..shared import errormessage as shared_errormessage +from typing import Optional + + + +@dataclasses.dataclass +class CreateCompanyResponse: + content_type: str = dataclasses.field() + status_code: int = dataclasses.field() + company: Optional[shared_company.Company] = dataclasses.field(default=None) + r"""OK""" + error_message: Optional[shared_errormessage.ErrorMessage] = dataclasses.field(default=None) + r"""The request made is not valid.""" + raw_response: Optional[requests_http.Response] = dataclasses.field(default=None) + + diff --git a/sync-for-payables/src/codatsyncpayables/models/operations/create_connection.py b/sync-for-payables/src/codatsyncpayables/models/operations/create_connection.py new file mode 100755 index 000000000..9860d4e64 --- /dev/null +++ b/sync-for-payables/src/codatsyncpayables/models/operations/create_connection.py @@ -0,0 +1,42 @@ +"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" + +from __future__ import annotations +import dataclasses +import requests as requests_http +from ..shared import connection as shared_connection +from ..shared import errormessage as shared_errormessage +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 }}) + + + + + +@dataclasses.dataclass +class CreateConnectionRequest: + company_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'companyId', 'style': 'simple', 'explode': False }}) + request_body: Optional[CreateConnectionRequestBody] = dataclasses.field(default=None, metadata={'request': { 'media_type': 'application/json' }}) + + + + + +@dataclasses.dataclass +class CreateConnectionResponse: + content_type: str = dataclasses.field() + status_code: int = dataclasses.field() + connection: Optional[shared_connection.Connection] = dataclasses.field(default=None) + r"""OK""" + error_message: Optional[shared_errormessage.ErrorMessage] = dataclasses.field(default=None) + r"""Your API request was not properly authorized.""" + raw_response: Optional[requests_http.Response] = dataclasses.field(default=None) + + diff --git a/sync-for-payables/src/codatsyncpayables/models/operations/create_journal.py b/sync-for-payables/src/codatsyncpayables/models/operations/create_journal.py new file mode 100755 index 000000000..5eac7f6c2 --- /dev/null +++ b/sync-for-payables/src/codatsyncpayables/models/operations/create_journal.py @@ -0,0 +1,34 @@ +"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" + +from __future__ import annotations +import dataclasses +import requests as requests_http +from ..shared import createjournalresponse as shared_createjournalresponse +from ..shared import errormessage as shared_errormessage +from ..shared import journal as shared_journal +from typing import Optional + + + +@dataclasses.dataclass +class CreateJournalRequest: + company_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'companyId', 'style': 'simple', 'explode': False }}) + connection_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'connectionId', 'style': 'simple', 'explode': False }}) + journal: Optional[shared_journal.Journal] = dataclasses.field(default=None, metadata={'request': { 'media_type': 'application/json' }}) + timeout_in_minutes: Optional[int] = dataclasses.field(default=None, metadata={'query_param': { 'field_name': 'timeoutInMinutes', 'style': 'form', 'explode': True }}) + + + + + +@dataclasses.dataclass +class CreateJournalResponse: + content_type: str = dataclasses.field() + status_code: int = dataclasses.field() + create_journal_response: Optional[shared_createjournalresponse.CreateJournalResponse] = dataclasses.field(default=None) + r"""Success""" + error_message: Optional[shared_errormessage.ErrorMessage] = dataclasses.field(default=None) + r"""The request made is not valid.""" + raw_response: Optional[requests_http.Response] = dataclasses.field(default=None) + + diff --git a/sync-for-payables/src/codatsyncpayables/models/operations/create_journal_entry.py b/sync-for-payables/src/codatsyncpayables/models/operations/create_journal_entry.py new file mode 100755 index 000000000..840f0cd65 --- /dev/null +++ b/sync-for-payables/src/codatsyncpayables/models/operations/create_journal_entry.py @@ -0,0 +1,34 @@ +"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" + +from __future__ import annotations +import dataclasses +import requests as requests_http +from ..shared import createjournalentryresponse as shared_createjournalentryresponse +from ..shared import errormessage as shared_errormessage +from ..shared import journalentry as shared_journalentry +from typing import Optional + + + +@dataclasses.dataclass +class CreateJournalEntryRequest: + company_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'companyId', 'style': 'simple', 'explode': False }}) + connection_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'connectionId', 'style': 'simple', 'explode': False }}) + journal_entry: Optional[shared_journalentry.JournalEntry] = dataclasses.field(default=None, metadata={'request': { 'media_type': 'application/json' }}) + timeout_in_minutes: Optional[int] = dataclasses.field(default=None, metadata={'query_param': { 'field_name': 'timeoutInMinutes', 'style': 'form', 'explode': True }}) + + + + + +@dataclasses.dataclass +class CreateJournalEntryResponse: + content_type: str = dataclasses.field() + status_code: int = dataclasses.field() + create_journal_entry_response: Optional[shared_createjournalentryresponse.CreateJournalEntryResponse] = dataclasses.field(default=None) + r"""Success""" + error_message: Optional[shared_errormessage.ErrorMessage] = dataclasses.field(default=None) + r"""The request made is not valid.""" + raw_response: Optional[requests_http.Response] = dataclasses.field(default=None) + + diff --git a/sync-for-payables/src/codatsyncpayables/models/operations/create_supplier.py b/sync-for-payables/src/codatsyncpayables/models/operations/create_supplier.py new file mode 100755 index 000000000..9bdf8f9f4 --- /dev/null +++ b/sync-for-payables/src/codatsyncpayables/models/operations/create_supplier.py @@ -0,0 +1,34 @@ +"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" + +from __future__ import annotations +import dataclasses +import requests as requests_http +from ..shared import createsupplierresponse as shared_createsupplierresponse +from ..shared import errormessage as shared_errormessage +from ..shared import supplier as shared_supplier +from typing import Optional + + + +@dataclasses.dataclass +class CreateSupplierRequest: + company_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'companyId', 'style': 'simple', 'explode': False }}) + connection_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'connectionId', 'style': 'simple', 'explode': False }}) + supplier: Optional[shared_supplier.Supplier] = dataclasses.field(default=None, metadata={'request': { 'media_type': 'application/json' }}) + timeout_in_minutes: Optional[int] = dataclasses.field(default=None, metadata={'query_param': { 'field_name': 'timeoutInMinutes', 'style': 'form', 'explode': True }}) + + + + + +@dataclasses.dataclass +class CreateSupplierResponse: + content_type: str = dataclasses.field() + status_code: int = dataclasses.field() + create_supplier_response: Optional[shared_createsupplierresponse.CreateSupplierResponse] = dataclasses.field(default=None) + r"""Success""" + error_message: Optional[shared_errormessage.ErrorMessage] = dataclasses.field(default=None) + r"""The request made is not valid.""" + raw_response: Optional[requests_http.Response] = dataclasses.field(default=None) + + diff --git a/sync-for-payables/src/codatsyncpayables/models/operations/delete_company.py b/sync-for-payables/src/codatsyncpayables/models/operations/delete_company.py new file mode 100755 index 000000000..b5e6a5b86 --- /dev/null +++ b/sync-for-payables/src/codatsyncpayables/models/operations/delete_company.py @@ -0,0 +1,27 @@ +"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" + +from __future__ import annotations +import dataclasses +import requests as requests_http +from ..shared import errormessage as shared_errormessage +from typing import Optional + + + +@dataclasses.dataclass +class DeleteCompanyRequest: + company_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'companyId', 'style': 'simple', 'explode': False }}) + + + + + +@dataclasses.dataclass +class DeleteCompanyResponse: + content_type: str = dataclasses.field() + status_code: int = dataclasses.field() + error_message: Optional[shared_errormessage.ErrorMessage] = dataclasses.field(default=None) + r"""Your API request was not properly authorized.""" + raw_response: Optional[requests_http.Response] = dataclasses.field(default=None) + + diff --git a/sync-for-payables/src/codatsyncpayables/models/operations/delete_connection.py b/sync-for-payables/src/codatsyncpayables/models/operations/delete_connection.py new file mode 100755 index 000000000..e12219d11 --- /dev/null +++ b/sync-for-payables/src/codatsyncpayables/models/operations/delete_connection.py @@ -0,0 +1,28 @@ +"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" + +from __future__ import annotations +import dataclasses +import requests as requests_http +from ..shared import errormessage as shared_errormessage +from typing import Optional + + + +@dataclasses.dataclass +class DeleteConnectionRequest: + company_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'companyId', 'style': 'simple', 'explode': False }}) + connection_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'connectionId', 'style': 'simple', 'explode': False }}) + + + + + +@dataclasses.dataclass +class DeleteConnectionResponse: + content_type: str = dataclasses.field() + status_code: int = dataclasses.field() + error_message: Optional[shared_errormessage.ErrorMessage] = dataclasses.field(default=None) + r"""Your API request was not properly authorized.""" + raw_response: Optional[requests_http.Response] = dataclasses.field(default=None) + + diff --git a/sync-for-payables/src/codatsyncpayables/models/operations/download_bill_attachment.py b/sync-for-payables/src/codatsyncpayables/models/operations/download_bill_attachment.py new file mode 100755 index 000000000..8bba7091c --- /dev/null +++ b/sync-for-payables/src/codatsyncpayables/models/operations/download_bill_attachment.py @@ -0,0 +1,34 @@ +"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" + +from __future__ import annotations +import dataclasses +import requests as requests_http +from ..shared import errormessage as shared_errormessage +from typing import Optional + + + +@dataclasses.dataclass +class DownloadBillAttachmentRequest: + attachment_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'attachmentId', 'style': 'simple', 'explode': False }}) + r"""Unique identifier for an attachment""" + bill_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'billId', 'style': 'simple', 'explode': False }}) + r"""Unique identifier for a bill""" + company_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'companyId', 'style': 'simple', 'explode': False }}) + connection_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'connectionId', 'style': 'simple', 'explode': False }}) + + + + + +@dataclasses.dataclass +class DownloadBillAttachmentResponse: + content_type: str = dataclasses.field() + status_code: int = dataclasses.field() + data: Optional[bytes] = dataclasses.field(default=None) + r"""Success""" + error_message: Optional[shared_errormessage.ErrorMessage] = dataclasses.field(default=None) + r"""Your API request was not properly authorized.""" + raw_response: Optional[requests_http.Response] = dataclasses.field(default=None) + + diff --git a/sync-for-payables/src/codatsyncpayables/models/operations/get_account.py b/sync-for-payables/src/codatsyncpayables/models/operations/get_account.py new file mode 100755 index 000000000..aba5dc917 --- /dev/null +++ b/sync-for-payables/src/codatsyncpayables/models/operations/get_account.py @@ -0,0 +1,32 @@ +"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" + +from __future__ import annotations +import dataclasses +import requests as requests_http +from ..shared import account as shared_account +from ..shared import errormessage as shared_errormessage +from typing import Optional + + + +@dataclasses.dataclass +class GetAccountRequest: + account_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'accountId', 'style': 'simple', 'explode': False }}) + r"""Unique identifier for an account""" + company_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'companyId', 'style': 'simple', 'explode': False }}) + + + + + +@dataclasses.dataclass +class GetAccountResponse: + content_type: str = dataclasses.field() + status_code: int = dataclasses.field() + account: Optional[shared_account.Account] = dataclasses.field(default=None) + r"""Success""" + error_message: Optional[shared_errormessage.ErrorMessage] = dataclasses.field(default=None) + r"""Your API request was not properly authorized.""" + raw_response: Optional[requests_http.Response] = dataclasses.field(default=None) + + diff --git a/sync-for-payables/src/codatsyncpayables/models/operations/get_bill.py b/sync-for-payables/src/codatsyncpayables/models/operations/get_bill.py new file mode 100755 index 000000000..a0e579d1d --- /dev/null +++ b/sync-for-payables/src/codatsyncpayables/models/operations/get_bill.py @@ -0,0 +1,32 @@ +"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" + +from __future__ import annotations +import dataclasses +import requests as requests_http +from ..shared import bill as shared_bill +from ..shared import errormessage as shared_errormessage +from typing import Optional + + + +@dataclasses.dataclass +class GetBillRequest: + bill_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'billId', 'style': 'simple', 'explode': False }}) + r"""Unique identifier for a bill""" + company_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'companyId', 'style': 'simple', 'explode': False }}) + + + + + +@dataclasses.dataclass +class GetBillResponse: + content_type: str = dataclasses.field() + status_code: int = dataclasses.field() + bill: Optional[shared_bill.Bill] = dataclasses.field(default=None) + r"""Success""" + error_message: Optional[shared_errormessage.ErrorMessage] = dataclasses.field(default=None) + r"""Your API request was not properly authorized.""" + raw_response: Optional[requests_http.Response] = dataclasses.field(default=None) + + diff --git a/sync-for-payables/src/codatsyncpayables/models/operations/get_bill_attachment.py b/sync-for-payables/src/codatsyncpayables/models/operations/get_bill_attachment.py new file mode 100755 index 000000000..7e1360530 --- /dev/null +++ b/sync-for-payables/src/codatsyncpayables/models/operations/get_bill_attachment.py @@ -0,0 +1,35 @@ +"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" + +from __future__ import annotations +import dataclasses +import requests as requests_http +from ..shared import attachment as shared_attachment +from ..shared import errormessage as shared_errormessage +from typing import Optional + + + +@dataclasses.dataclass +class GetBillAttachmentRequest: + attachment_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'attachmentId', 'style': 'simple', 'explode': False }}) + r"""Unique identifier for an attachment""" + bill_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'billId', 'style': 'simple', 'explode': False }}) + r"""Unique identifier for a bill""" + company_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'companyId', 'style': 'simple', 'explode': False }}) + connection_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'connectionId', 'style': 'simple', 'explode': False }}) + + + + + +@dataclasses.dataclass +class GetBillAttachmentResponse: + content_type: str = dataclasses.field() + status_code: int = dataclasses.field() + attachment: Optional[shared_attachment.Attachment] = dataclasses.field(default=None) + r"""Success""" + error_message: Optional[shared_errormessage.ErrorMessage] = dataclasses.field(default=None) + r"""Your API request was not properly authorized.""" + raw_response: Optional[requests_http.Response] = dataclasses.field(default=None) + + diff --git a/sync-for-payables/src/codatsyncpayables/models/operations/get_bill_credit_note.py b/sync-for-payables/src/codatsyncpayables/models/operations/get_bill_credit_note.py new file mode 100755 index 000000000..35bfcd13e --- /dev/null +++ b/sync-for-payables/src/codatsyncpayables/models/operations/get_bill_credit_note.py @@ -0,0 +1,31 @@ +"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" + +from __future__ import annotations +import dataclasses +import requests as requests_http +from ..shared import billcreditnote as shared_billcreditnote +from ..shared import errormessage as shared_errormessage +from typing import Optional + + + +@dataclasses.dataclass +class GetBillCreditNoteRequest: + bill_credit_note_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'billCreditNoteId', 'style': 'simple', 'explode': False }}) + company_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'companyId', 'style': 'simple', 'explode': False }}) + + + + + +@dataclasses.dataclass +class GetBillCreditNoteResponse: + content_type: str = dataclasses.field() + status_code: int = dataclasses.field() + bill_credit_note: Optional[shared_billcreditnote.BillCreditNote] = dataclasses.field(default=None) + r"""Success""" + error_message: Optional[shared_errormessage.ErrorMessage] = dataclasses.field(default=None) + r"""Your API request was not properly authorized.""" + raw_response: Optional[requests_http.Response] = dataclasses.field(default=None) + + diff --git a/sync-for-payables/src/codatsyncpayables/models/operations/get_bill_payments.py b/sync-for-payables/src/codatsyncpayables/models/operations/get_bill_payments.py new file mode 100755 index 000000000..d1d1d43a3 --- /dev/null +++ b/sync-for-payables/src/codatsyncpayables/models/operations/get_bill_payments.py @@ -0,0 +1,31 @@ +"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" + +from __future__ import annotations +import dataclasses +import requests as requests_http +from ..shared import billpayment as shared_billpayment +from ..shared import errormessage as shared_errormessage +from typing import Optional + + + +@dataclasses.dataclass +class GetBillPaymentsRequest: + bill_payment_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'billPaymentId', 'style': 'simple', 'explode': False }}) + company_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'companyId', 'style': 'simple', 'explode': False }}) + + + + + +@dataclasses.dataclass +class GetBillPaymentsResponse: + content_type: str = dataclasses.field() + status_code: int = dataclasses.field() + bill_payment: Optional[shared_billpayment.BillPayment] = dataclasses.field(default=None) + r"""Success""" + error_message: Optional[shared_errormessage.ErrorMessage] = dataclasses.field(default=None) + r"""Your API request was not properly authorized.""" + raw_response: Optional[requests_http.Response] = dataclasses.field(default=None) + + diff --git a/sync-for-payables/src/codatsyncpayables/models/operations/get_company.py b/sync-for-payables/src/codatsyncpayables/models/operations/get_company.py new file mode 100755 index 000000000..b9881123d --- /dev/null +++ b/sync-for-payables/src/codatsyncpayables/models/operations/get_company.py @@ -0,0 +1,30 @@ +"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" + +from __future__ import annotations +import dataclasses +import requests as requests_http +from ..shared import company as shared_company +from ..shared import errormessage as shared_errormessage +from typing import Optional + + + +@dataclasses.dataclass +class GetCompanyRequest: + company_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'companyId', 'style': 'simple', 'explode': False }}) + + + + + +@dataclasses.dataclass +class GetCompanyResponse: + content_type: str = dataclasses.field() + status_code: int = dataclasses.field() + company: Optional[shared_company.Company] = dataclasses.field(default=None) + r"""OK""" + error_message: Optional[shared_errormessage.ErrorMessage] = dataclasses.field(default=None) + r"""Your API request was not properly authorized.""" + raw_response: Optional[requests_http.Response] = dataclasses.field(default=None) + + diff --git a/sync-for-payables/src/codatsyncpayables/models/operations/get_connection.py b/sync-for-payables/src/codatsyncpayables/models/operations/get_connection.py new file mode 100755 index 000000000..af6188ccb --- /dev/null +++ b/sync-for-payables/src/codatsyncpayables/models/operations/get_connection.py @@ -0,0 +1,31 @@ +"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" + +from __future__ import annotations +import dataclasses +import requests as requests_http +from ..shared import connection as shared_connection +from ..shared import errormessage as shared_errormessage +from typing import Optional + + + +@dataclasses.dataclass +class GetConnectionRequest: + company_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'companyId', 'style': 'simple', 'explode': False }}) + connection_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'connectionId', 'style': 'simple', 'explode': False }}) + + + + + +@dataclasses.dataclass +class GetConnectionResponse: + content_type: str = dataclasses.field() + status_code: int = dataclasses.field() + connection: Optional[shared_connection.Connection] = dataclasses.field(default=None) + r"""OK""" + error_message: Optional[shared_errormessage.ErrorMessage] = dataclasses.field(default=None) + r"""Your API request was not properly authorized.""" + raw_response: Optional[requests_http.Response] = dataclasses.field(default=None) + + diff --git a/sync-for-payables/src/codatsyncpayables/models/operations/get_create_account_model.py b/sync-for-payables/src/codatsyncpayables/models/operations/get_create_account_model.py new file mode 100755 index 000000000..fe62ea9a7 --- /dev/null +++ b/sync-for-payables/src/codatsyncpayables/models/operations/get_create_account_model.py @@ -0,0 +1,31 @@ +"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" + +from __future__ import annotations +import dataclasses +import requests as requests_http +from ..shared import errormessage as shared_errormessage +from ..shared import pushoption as shared_pushoption +from typing import Optional + + + +@dataclasses.dataclass +class GetCreateAccountModelRequest: + company_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'companyId', 'style': 'simple', 'explode': False }}) + connection_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'connectionId', 'style': 'simple', 'explode': False }}) + + + + + +@dataclasses.dataclass +class GetCreateAccountModelResponse: + content_type: str = dataclasses.field() + status_code: int = dataclasses.field() + error_message: Optional[shared_errormessage.ErrorMessage] = dataclasses.field(default=None) + r"""Your API request was not properly authorized.""" + push_option: Optional[shared_pushoption.PushOption] = dataclasses.field(default=None) + r"""OK""" + raw_response: Optional[requests_http.Response] = dataclasses.field(default=None) + + diff --git a/sync-for-payables/src/codatsyncpayables/models/operations/get_create_billpayment_model.py b/sync-for-payables/src/codatsyncpayables/models/operations/get_create_billpayment_model.py new file mode 100755 index 000000000..d926f30ba --- /dev/null +++ b/sync-for-payables/src/codatsyncpayables/models/operations/get_create_billpayment_model.py @@ -0,0 +1,31 @@ +"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" + +from __future__ import annotations +import dataclasses +import requests as requests_http +from ..shared import errormessage as shared_errormessage +from ..shared import pushoption as shared_pushoption +from typing import Optional + + + +@dataclasses.dataclass +class GetCreateBillPaymentModelRequest: + company_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'companyId', 'style': 'simple', 'explode': False }}) + connection_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'connectionId', 'style': 'simple', 'explode': False }}) + + + + + +@dataclasses.dataclass +class GetCreateBillPaymentModelResponse: + content_type: str = dataclasses.field() + status_code: int = dataclasses.field() + error_message: Optional[shared_errormessage.ErrorMessage] = dataclasses.field(default=None) + r"""Your API request was not properly authorized.""" + push_option: Optional[shared_pushoption.PushOption] = dataclasses.field(default=None) + r"""OK""" + raw_response: Optional[requests_http.Response] = dataclasses.field(default=None) + + diff --git a/sync-for-payables/src/codatsyncpayables/models/operations/get_create_journal_model.py b/sync-for-payables/src/codatsyncpayables/models/operations/get_create_journal_model.py new file mode 100755 index 000000000..e823647bd --- /dev/null +++ b/sync-for-payables/src/codatsyncpayables/models/operations/get_create_journal_model.py @@ -0,0 +1,31 @@ +"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" + +from __future__ import annotations +import dataclasses +import requests as requests_http +from ..shared import errormessage as shared_errormessage +from ..shared import pushoption as shared_pushoption +from typing import Optional + + + +@dataclasses.dataclass +class GetCreateJournalModelRequest: + company_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'companyId', 'style': 'simple', 'explode': False }}) + connection_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'connectionId', 'style': 'simple', 'explode': False }}) + + + + + +@dataclasses.dataclass +class GetCreateJournalModelResponse: + content_type: str = dataclasses.field() + status_code: int = dataclasses.field() + error_message: Optional[shared_errormessage.ErrorMessage] = dataclasses.field(default=None) + r"""Your API request was not properly authorized.""" + push_option: Optional[shared_pushoption.PushOption] = dataclasses.field(default=None) + r"""OK""" + raw_response: Optional[requests_http.Response] = dataclasses.field(default=None) + + diff --git a/sync-for-payables/src/codatsyncpayables/models/operations/get_create_journalentry_model.py b/sync-for-payables/src/codatsyncpayables/models/operations/get_create_journalentry_model.py new file mode 100755 index 000000000..4a03ef349 --- /dev/null +++ b/sync-for-payables/src/codatsyncpayables/models/operations/get_create_journalentry_model.py @@ -0,0 +1,31 @@ +"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" + +from __future__ import annotations +import dataclasses +import requests as requests_http +from ..shared import errormessage as shared_errormessage +from ..shared import pushoption as shared_pushoption +from typing import Optional + + + +@dataclasses.dataclass +class GetCreateJournalEntryModelRequest: + company_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'companyId', 'style': 'simple', 'explode': False }}) + connection_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'connectionId', 'style': 'simple', 'explode': False }}) + + + + + +@dataclasses.dataclass +class GetCreateJournalEntryModelResponse: + content_type: str = dataclasses.field() + status_code: int = dataclasses.field() + error_message: Optional[shared_errormessage.ErrorMessage] = dataclasses.field(default=None) + r"""Your API request was not properly authorized.""" + push_option: Optional[shared_pushoption.PushOption] = dataclasses.field(default=None) + r"""OK""" + raw_response: Optional[requests_http.Response] = dataclasses.field(default=None) + + diff --git a/sync-for-payables/src/codatsyncpayables/models/operations/get_create_update_bill_model.py b/sync-for-payables/src/codatsyncpayables/models/operations/get_create_update_bill_model.py new file mode 100755 index 000000000..4d086451f --- /dev/null +++ b/sync-for-payables/src/codatsyncpayables/models/operations/get_create_update_bill_model.py @@ -0,0 +1,31 @@ +"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" + +from __future__ import annotations +import dataclasses +import requests as requests_http +from ..shared import errormessage as shared_errormessage +from ..shared import pushoption as shared_pushoption +from typing import Optional + + + +@dataclasses.dataclass +class GetCreateUpdateBillModelRequest: + company_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'companyId', 'style': 'simple', 'explode': False }}) + connection_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'connectionId', 'style': 'simple', 'explode': False }}) + + + + + +@dataclasses.dataclass +class GetCreateUpdateBillModelResponse: + content_type: str = dataclasses.field() + status_code: int = dataclasses.field() + error_message: Optional[shared_errormessage.ErrorMessage] = dataclasses.field(default=None) + r"""Your API request was not properly authorized.""" + push_option: Optional[shared_pushoption.PushOption] = dataclasses.field(default=None) + r"""OK""" + raw_response: Optional[requests_http.Response] = dataclasses.field(default=None) + + diff --git a/sync-for-payables/src/codatsyncpayables/models/operations/get_create_update_billcreditnote_model.py b/sync-for-payables/src/codatsyncpayables/models/operations/get_create_update_billcreditnote_model.py new file mode 100755 index 000000000..b21c9d0c7 --- /dev/null +++ b/sync-for-payables/src/codatsyncpayables/models/operations/get_create_update_billcreditnote_model.py @@ -0,0 +1,31 @@ +"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" + +from __future__ import annotations +import dataclasses +import requests as requests_http +from ..shared import errormessage as shared_errormessage +from ..shared import pushoption as shared_pushoption +from typing import Optional + + + +@dataclasses.dataclass +class GetCreateUpdateBillCreditNoteModelRequest: + company_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'companyId', 'style': 'simple', 'explode': False }}) + connection_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'connectionId', 'style': 'simple', 'explode': False }}) + + + + + +@dataclasses.dataclass +class GetCreateUpdateBillCreditNoteModelResponse: + content_type: str = dataclasses.field() + status_code: int = dataclasses.field() + error_message: Optional[shared_errormessage.ErrorMessage] = dataclasses.field(default=None) + r"""Your API request was not properly authorized.""" + push_option: Optional[shared_pushoption.PushOption] = dataclasses.field(default=None) + r"""OK""" + raw_response: Optional[requests_http.Response] = dataclasses.field(default=None) + + diff --git a/sync-for-payables/src/codatsyncpayables/models/operations/get_create_update_supplier_model.py b/sync-for-payables/src/codatsyncpayables/models/operations/get_create_update_supplier_model.py new file mode 100755 index 000000000..7a61cddfd --- /dev/null +++ b/sync-for-payables/src/codatsyncpayables/models/operations/get_create_update_supplier_model.py @@ -0,0 +1,31 @@ +"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" + +from __future__ import annotations +import dataclasses +import requests as requests_http +from ..shared import errormessage as shared_errormessage +from ..shared import pushoption as shared_pushoption +from typing import Optional + + + +@dataclasses.dataclass +class GetCreateUpdateSupplierModelRequest: + company_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'companyId', 'style': 'simple', 'explode': False }}) + connection_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'connectionId', 'style': 'simple', 'explode': False }}) + + + + + +@dataclasses.dataclass +class GetCreateUpdateSupplierModelResponse: + content_type: str = dataclasses.field() + status_code: int = dataclasses.field() + error_message: Optional[shared_errormessage.ErrorMessage] = dataclasses.field(default=None) + r"""Your API request was not properly authorized.""" + push_option: Optional[shared_pushoption.PushOption] = dataclasses.field(default=None) + r"""OK""" + raw_response: Optional[requests_http.Response] = dataclasses.field(default=None) + + diff --git a/sync-for-payables/src/codatsyncpayables/models/operations/get_data_status.py b/sync-for-payables/src/codatsyncpayables/models/operations/get_data_status.py new file mode 100755 index 000000000..321711a5a --- /dev/null +++ b/sync-for-payables/src/codatsyncpayables/models/operations/get_data_status.py @@ -0,0 +1,30 @@ +"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" + +from __future__ import annotations +import dataclasses +import requests as requests_http +from ..shared import datastatus as shared_datastatus +from ..shared import errormessage as shared_errormessage +from typing import Optional + + + +@dataclasses.dataclass +class GetDataStatusRequest: + company_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'companyId', 'style': 'simple', 'explode': False }}) + + + + + +@dataclasses.dataclass +class GetDataStatusResponse: + content_type: str = dataclasses.field() + status_code: int = dataclasses.field() + data_status_response: Optional[dict[str, shared_datastatus.DataStatus]] = dataclasses.field(default=None) + r"""OK""" + error_message: Optional[shared_errormessage.ErrorMessage] = dataclasses.field(default=None) + r"""Your API request was not properly authorized.""" + raw_response: Optional[requests_http.Response] = dataclasses.field(default=None) + + diff --git a/sync-for-payables/src/codatsyncpayables/models/operations/get_journal.py b/sync-for-payables/src/codatsyncpayables/models/operations/get_journal.py new file mode 100755 index 000000000..44b3dc054 --- /dev/null +++ b/sync-for-payables/src/codatsyncpayables/models/operations/get_journal.py @@ -0,0 +1,31 @@ +"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" + +from __future__ import annotations +import dataclasses +import requests as requests_http +from ..shared import errormessage as shared_errormessage +from ..shared import journal as shared_journal +from typing import Optional + + + +@dataclasses.dataclass +class GetJournalRequest: + company_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'companyId', 'style': 'simple', 'explode': False }}) + journal_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'journalId', 'style': 'simple', 'explode': False }}) + + + + + +@dataclasses.dataclass +class GetJournalResponse: + content_type: str = dataclasses.field() + status_code: int = dataclasses.field() + error_message: Optional[shared_errormessage.ErrorMessage] = dataclasses.field(default=None) + r"""Your API request was not properly authorized.""" + journal: Optional[shared_journal.Journal] = dataclasses.field(default=None) + r"""Success""" + raw_response: Optional[requests_http.Response] = dataclasses.field(default=None) + + diff --git a/sync-for-payables/src/codatsyncpayables/models/operations/get_payment_method.py b/sync-for-payables/src/codatsyncpayables/models/operations/get_payment_method.py new file mode 100755 index 000000000..e26eb73b5 --- /dev/null +++ b/sync-for-payables/src/codatsyncpayables/models/operations/get_payment_method.py @@ -0,0 +1,31 @@ +"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" + +from __future__ import annotations +import dataclasses +import requests as requests_http +from ..shared import errormessage as shared_errormessage +from ..shared import paymentmethod as shared_paymentmethod +from typing import Optional + + + +@dataclasses.dataclass +class GetPaymentMethodRequest: + company_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'companyId', 'style': 'simple', 'explode': False }}) + payment_method_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'paymentMethodId', 'style': 'simple', 'explode': False }}) + + + + + +@dataclasses.dataclass +class GetPaymentMethodResponse: + content_type: str = dataclasses.field() + status_code: int = dataclasses.field() + error_message: Optional[shared_errormessage.ErrorMessage] = dataclasses.field(default=None) + r"""Your API request was not properly authorized.""" + payment_method: Optional[shared_paymentmethod.PaymentMethod] = dataclasses.field(default=None) + r"""Success""" + raw_response: Optional[requests_http.Response] = dataclasses.field(default=None) + + diff --git a/sync-for-payables/src/codatsyncpayables/models/operations/get_pull_operation.py b/sync-for-payables/src/codatsyncpayables/models/operations/get_pull_operation.py new file mode 100755 index 000000000..b671bb1eb --- /dev/null +++ b/sync-for-payables/src/codatsyncpayables/models/operations/get_pull_operation.py @@ -0,0 +1,32 @@ +"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" + +from __future__ import annotations +import dataclasses +import requests as requests_http +from ..shared import errormessage as shared_errormessage +from ..shared import pulloperation as shared_pulloperation +from typing import Optional + + + +@dataclasses.dataclass +class GetPullOperationRequest: + company_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'companyId', 'style': 'simple', 'explode': False }}) + dataset_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'datasetId', 'style': 'simple', 'explode': False }}) + r"""Unique ID of a dataset or pull operation.""" + + + + + +@dataclasses.dataclass +class GetPullOperationResponse: + content_type: str = dataclasses.field() + status_code: int = dataclasses.field() + error_message: Optional[shared_errormessage.ErrorMessage] = dataclasses.field(default=None) + r"""Your API request was not properly authorized.""" + pull_operation: Optional[shared_pulloperation.PullOperation] = dataclasses.field(default=None) + r"""OK""" + raw_response: Optional[requests_http.Response] = dataclasses.field(default=None) + + diff --git a/sync-for-payables/src/codatsyncpayables/models/operations/get_push_operation.py b/sync-for-payables/src/codatsyncpayables/models/operations/get_push_operation.py new file mode 100755 index 000000000..eee46eb05 --- /dev/null +++ b/sync-for-payables/src/codatsyncpayables/models/operations/get_push_operation.py @@ -0,0 +1,32 @@ +"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" + +from __future__ import annotations +import dataclasses +import requests as requests_http +from ..shared import errormessage as shared_errormessage +from ..shared import pushoperation as shared_pushoperation +from typing import Optional + + + +@dataclasses.dataclass +class GetPushOperationRequest: + company_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'companyId', 'style': 'simple', 'explode': False }}) + push_operation_key: str = dataclasses.field(metadata={'path_param': { 'field_name': 'pushOperationKey', 'style': 'simple', 'explode': False }}) + r"""Push operation key.""" + + + + + +@dataclasses.dataclass +class GetPushOperationResponse: + content_type: str = dataclasses.field() + status_code: int = dataclasses.field() + error_message: Optional[shared_errormessage.ErrorMessage] = dataclasses.field(default=None) + r"""Your API request was not properly authorized.""" + push_operation: Optional[shared_pushoperation.PushOperation] = dataclasses.field(default=None) + r"""OK""" + raw_response: Optional[requests_http.Response] = dataclasses.field(default=None) + + diff --git a/sync-for-payables/src/codatsyncpayables/models/operations/get_supplier.py b/sync-for-payables/src/codatsyncpayables/models/operations/get_supplier.py new file mode 100755 index 000000000..0426ef024 --- /dev/null +++ b/sync-for-payables/src/codatsyncpayables/models/operations/get_supplier.py @@ -0,0 +1,32 @@ +"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" + +from __future__ import annotations +import dataclasses +import requests as requests_http +from ..shared import errormessage as shared_errormessage +from ..shared import supplier as shared_supplier +from typing import Optional + + + +@dataclasses.dataclass +class GetSupplierRequest: + company_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'companyId', 'style': 'simple', 'explode': False }}) + supplier_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'supplierId', 'style': 'simple', 'explode': False }}) + r"""Unique identifier for a supplier""" + + + + + +@dataclasses.dataclass +class GetSupplierResponse: + content_type: str = dataclasses.field() + status_code: int = dataclasses.field() + error_message: Optional[shared_errormessage.ErrorMessage] = dataclasses.field(default=None) + r"""Your API request was not properly authorized.""" + raw_response: Optional[requests_http.Response] = dataclasses.field(default=None) + supplier: Optional[shared_supplier.Supplier] = dataclasses.field(default=None) + r"""Success""" + + diff --git a/sync-for-payables/src/codatsyncpayables/models/operations/get_tax_rate.py b/sync-for-payables/src/codatsyncpayables/models/operations/get_tax_rate.py new file mode 100755 index 000000000..81e481e81 --- /dev/null +++ b/sync-for-payables/src/codatsyncpayables/models/operations/get_tax_rate.py @@ -0,0 +1,31 @@ +"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" + +from __future__ import annotations +import dataclasses +import requests as requests_http +from ..shared import errormessage as shared_errormessage +from ..shared import taxrate as shared_taxrate +from typing import Optional + + + +@dataclasses.dataclass +class GetTaxRateRequest: + company_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'companyId', 'style': 'simple', 'explode': False }}) + tax_rate_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'taxRateId', 'style': 'simple', 'explode': False }}) + + + + + +@dataclasses.dataclass +class GetTaxRateResponse: + content_type: str = dataclasses.field() + status_code: int = dataclasses.field() + error_message: Optional[shared_errormessage.ErrorMessage] = dataclasses.field(default=None) + r"""Your API request was not properly authorized.""" + raw_response: Optional[requests_http.Response] = dataclasses.field(default=None) + tax_rate: Optional[shared_taxrate.TaxRate] = dataclasses.field(default=None) + r"""Success""" + + diff --git a/sync-for-payables/src/codatsyncpayables/models/operations/get_tracking_category.py b/sync-for-payables/src/codatsyncpayables/models/operations/get_tracking_category.py new file mode 100755 index 000000000..d1da67cec --- /dev/null +++ b/sync-for-payables/src/codatsyncpayables/models/operations/get_tracking_category.py @@ -0,0 +1,31 @@ +"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" + +from __future__ import annotations +import dataclasses +import requests as requests_http +from ..shared import errormessage as shared_errormessage +from ..shared import trackingcategorytree as shared_trackingcategorytree +from typing import Optional + + + +@dataclasses.dataclass +class GetTrackingCategoryRequest: + company_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'companyId', 'style': 'simple', 'explode': False }}) + tracking_category_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'trackingCategoryId', 'style': 'simple', 'explode': False }}) + + + + + +@dataclasses.dataclass +class GetTrackingCategoryResponse: + content_type: str = dataclasses.field() + status_code: int = dataclasses.field() + error_message: Optional[shared_errormessage.ErrorMessage] = dataclasses.field(default=None) + r"""Your API request was not properly authorized.""" + raw_response: Optional[requests_http.Response] = dataclasses.field(default=None) + tracking_category_tree: Optional[shared_trackingcategorytree.TrackingCategoryTree] = dataclasses.field(default=None) + r"""Success""" + + diff --git a/sync-for-payables/src/codatsyncpayables/models/operations/list_accounts.py b/sync-for-payables/src/codatsyncpayables/models/operations/list_accounts.py new file mode 100755 index 000000000..4e7157fb2 --- /dev/null +++ b/sync-for-payables/src/codatsyncpayables/models/operations/list_accounts.py @@ -0,0 +1,38 @@ +"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" + +from __future__ import annotations +import dataclasses +import requests as requests_http +from ..shared import accounts as shared_accounts +from ..shared import errormessage as shared_errormessage +from typing import Optional + + + +@dataclasses.dataclass +class ListAccountsRequest: + company_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'companyId', 'style': 'simple', 'explode': False }}) + 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=None, 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=None, 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 ListAccountsResponse: + content_type: str = dataclasses.field() + status_code: int = dataclasses.field() + accounts: Optional[shared_accounts.Accounts] = dataclasses.field(default=None) + r"""Success""" + error_message: Optional[shared_errormessage.ErrorMessage] = dataclasses.field(default=None) + r"""Your `query` parameter was not correctly formed""" + raw_response: Optional[requests_http.Response] = dataclasses.field(default=None) + + diff --git a/sync-for-payables/src/codatsyncpayables/models/operations/list_bill_attachments.py b/sync-for-payables/src/codatsyncpayables/models/operations/list_bill_attachments.py new file mode 100755 index 000000000..db6327f42 --- /dev/null +++ b/sync-for-payables/src/codatsyncpayables/models/operations/list_bill_attachments.py @@ -0,0 +1,33 @@ +"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" + +from __future__ import annotations +import dataclasses +import requests as requests_http +from ..shared import attachments as shared_attachments +from ..shared import errormessage as shared_errormessage +from typing import Optional + + + +@dataclasses.dataclass +class ListBillAttachmentsRequest: + bill_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'billId', 'style': 'simple', 'explode': False }}) + r"""Unique identifier for a bill""" + company_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'companyId', 'style': 'simple', 'explode': False }}) + connection_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'connectionId', 'style': 'simple', 'explode': False }}) + + + + + +@dataclasses.dataclass +class ListBillAttachmentsResponse: + content_type: str = dataclasses.field() + status_code: int = dataclasses.field() + attachments: Optional[shared_attachments.Attachments] = dataclasses.field(default=None) + r"""Success""" + error_message: Optional[shared_errormessage.ErrorMessage] = dataclasses.field(default=None) + r"""Your API request was not properly authorized.""" + raw_response: Optional[requests_http.Response] = dataclasses.field(default=None) + + diff --git a/sync-for-payables/src/codatsyncpayables/models/operations/list_bill_credit_notes.py b/sync-for-payables/src/codatsyncpayables/models/operations/list_bill_credit_notes.py new file mode 100755 index 000000000..c4bdb3345 --- /dev/null +++ b/sync-for-payables/src/codatsyncpayables/models/operations/list_bill_credit_notes.py @@ -0,0 +1,38 @@ +"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" + +from __future__ import annotations +import dataclasses +import requests as requests_http +from ..shared import billcreditnotes as shared_billcreditnotes +from ..shared import errormessage as shared_errormessage +from typing import Optional + + + +@dataclasses.dataclass +class ListBillCreditNotesRequest: + company_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'companyId', 'style': 'simple', 'explode': False }}) + 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=None, 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=None, 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 ListBillCreditNotesResponse: + content_type: str = dataclasses.field() + status_code: int = dataclasses.field() + bill_credit_notes: Optional[shared_billcreditnotes.BillCreditNotes] = dataclasses.field(default=None) + r"""Success""" + error_message: Optional[shared_errormessage.ErrorMessage] = dataclasses.field(default=None) + r"""Your `query` parameter was not correctly formed""" + raw_response: Optional[requests_http.Response] = dataclasses.field(default=None) + + diff --git a/sync-for-payables/src/codatsyncpayables/models/operations/list_bill_payments.py b/sync-for-payables/src/codatsyncpayables/models/operations/list_bill_payments.py new file mode 100755 index 000000000..411cf85e9 --- /dev/null +++ b/sync-for-payables/src/codatsyncpayables/models/operations/list_bill_payments.py @@ -0,0 +1,38 @@ +"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" + +from __future__ import annotations +import dataclasses +import requests as requests_http +from ..shared import billpayments as shared_billpayments +from ..shared import errormessage as shared_errormessage +from typing import Optional + + + +@dataclasses.dataclass +class ListBillPaymentsRequest: + company_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'companyId', 'style': 'simple', 'explode': False }}) + 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=None, 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=None, 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 ListBillPaymentsResponse: + content_type: str = dataclasses.field() + status_code: int = dataclasses.field() + bill_payments: Optional[shared_billpayments.BillPayments] = dataclasses.field(default=None) + r"""Success""" + error_message: Optional[shared_errormessage.ErrorMessage] = dataclasses.field(default=None) + r"""Your `query` parameter was not correctly formed""" + raw_response: Optional[requests_http.Response] = dataclasses.field(default=None) + + diff --git a/sync-for-payables/src/codatsyncpayables/models/operations/list_bills.py b/sync-for-payables/src/codatsyncpayables/models/operations/list_bills.py new file mode 100755 index 000000000..0a774c61b --- /dev/null +++ b/sync-for-payables/src/codatsyncpayables/models/operations/list_bills.py @@ -0,0 +1,38 @@ +"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" + +from __future__ import annotations +import dataclasses +import requests as requests_http +from ..shared import bills as shared_bills +from ..shared import errormessage as shared_errormessage +from typing import Optional + + + +@dataclasses.dataclass +class ListBillsRequest: + company_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'companyId', 'style': 'simple', 'explode': False }}) + 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=None, 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=None, 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 ListBillsResponse: + content_type: str = dataclasses.field() + status_code: int = dataclasses.field() + bills: Optional[shared_bills.Bills] = dataclasses.field(default=None) + r"""Success""" + error_message: Optional[shared_errormessage.ErrorMessage] = dataclasses.field(default=None) + r"""Your `query` parameter was not correctly formed""" + raw_response: Optional[requests_http.Response] = dataclasses.field(default=None) + + diff --git a/sync-for-payables/src/codatsyncpayables/models/operations/list_companies.py b/sync-for-payables/src/codatsyncpayables/models/operations/list_companies.py new file mode 100755 index 000000000..bef24c7d7 --- /dev/null +++ b/sync-for-payables/src/codatsyncpayables/models/operations/list_companies.py @@ -0,0 +1,37 @@ +"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" + +from __future__ import annotations +import dataclasses +import requests as requests_http +from ..shared import companies as shared_companies +from ..shared import errormessage as shared_errormessage +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=None, 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=None, 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() + status_code: int = dataclasses.field() + companies: Optional[shared_companies.Companies] = dataclasses.field(default=None) + r"""OK""" + error_message: Optional[shared_errormessage.ErrorMessage] = dataclasses.field(default=None) + r"""Your `query` parameter was not correctly formed""" + raw_response: Optional[requests_http.Response] = dataclasses.field(default=None) + + diff --git a/sync-for-payables/src/codatsyncpayables/models/operations/list_connections.py b/sync-for-payables/src/codatsyncpayables/models/operations/list_connections.py new file mode 100755 index 000000000..a8f988177 --- /dev/null +++ b/sync-for-payables/src/codatsyncpayables/models/operations/list_connections.py @@ -0,0 +1,38 @@ +"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" + +from __future__ import annotations +import dataclasses +import requests as requests_http +from ..shared import connections as shared_connections +from ..shared import errormessage as shared_errormessage +from typing import Optional + + + +@dataclasses.dataclass +class ListConnectionsRequest: + company_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'companyId', 'style': 'simple', 'explode': False }}) + 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=None, 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=None, 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() + status_code: int = dataclasses.field() + connections: Optional[shared_connections.Connections] = dataclasses.field(default=None) + r"""OK""" + error_message: Optional[shared_errormessage.ErrorMessage] = dataclasses.field(default=None) + r"""Your `query` parameter was not correctly formed""" + raw_response: Optional[requests_http.Response] = dataclasses.field(default=None) + + diff --git a/sync-for-payables/src/codatsyncpayables/models/operations/list_journals.py b/sync-for-payables/src/codatsyncpayables/models/operations/list_journals.py new file mode 100755 index 000000000..926e5c4e2 --- /dev/null +++ b/sync-for-payables/src/codatsyncpayables/models/operations/list_journals.py @@ -0,0 +1,38 @@ +"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" + +from __future__ import annotations +import dataclasses +import requests as requests_http +from ..shared import errormessage as shared_errormessage +from ..shared import journals as shared_journals +from typing import Optional + + + +@dataclasses.dataclass +class ListJournalsRequest: + company_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'companyId', 'style': 'simple', 'explode': False }}) + 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=None, 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=None, 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 ListJournalsResponse: + content_type: str = dataclasses.field() + status_code: int = dataclasses.field() + error_message: Optional[shared_errormessage.ErrorMessage] = dataclasses.field(default=None) + r"""Your `query` parameter was not correctly formed""" + journals: Optional[shared_journals.Journals] = dataclasses.field(default=None) + r"""Success""" + raw_response: Optional[requests_http.Response] = dataclasses.field(default=None) + + diff --git a/sync-for-payables/src/codatsyncpayables/models/operations/list_payment_methods.py b/sync-for-payables/src/codatsyncpayables/models/operations/list_payment_methods.py new file mode 100755 index 000000000..ba46b0a39 --- /dev/null +++ b/sync-for-payables/src/codatsyncpayables/models/operations/list_payment_methods.py @@ -0,0 +1,38 @@ +"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" + +from __future__ import annotations +import dataclasses +import requests as requests_http +from ..shared import errormessage as shared_errormessage +from ..shared import paymentmethods as shared_paymentmethods +from typing import Optional + + + +@dataclasses.dataclass +class ListPaymentMethodsRequest: + company_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'companyId', 'style': 'simple', 'explode': False }}) + 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=None, 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=None, 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 ListPaymentMethodsResponse: + content_type: str = dataclasses.field() + status_code: int = dataclasses.field() + error_message: Optional[shared_errormessage.ErrorMessage] = dataclasses.field(default=None) + r"""Your `query` parameter was not correctly formed""" + payment_methods: Optional[shared_paymentmethods.PaymentMethods] = dataclasses.field(default=None) + r"""Success""" + raw_response: Optional[requests_http.Response] = dataclasses.field(default=None) + + diff --git a/sync-for-payables/src/codatsyncpayables/models/operations/list_pull_operations.py b/sync-for-payables/src/codatsyncpayables/models/operations/list_pull_operations.py new file mode 100755 index 000000000..25f30893d --- /dev/null +++ b/sync-for-payables/src/codatsyncpayables/models/operations/list_pull_operations.py @@ -0,0 +1,38 @@ +"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" + +from __future__ import annotations +import dataclasses +import requests as requests_http +from ..shared import errormessage as shared_errormessage +from ..shared import pulloperations as shared_pulloperations +from typing import Optional + + + +@dataclasses.dataclass +class ListPullOperationsRequest: + company_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'companyId', 'style': 'simple', 'explode': False }}) + 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=None, 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=None, 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 ListPullOperationsResponse: + content_type: str = dataclasses.field() + status_code: int = dataclasses.field() + error_message: Optional[shared_errormessage.ErrorMessage] = dataclasses.field(default=None) + r"""Your `query` parameter was not correctly formed""" + pull_operations: Optional[shared_pulloperations.PullOperations] = dataclasses.field(default=None) + r"""OK""" + raw_response: Optional[requests_http.Response] = dataclasses.field(default=None) + + diff --git a/sync-for-payables/src/codatsyncpayables/models/operations/list_push_operations.py b/sync-for-payables/src/codatsyncpayables/models/operations/list_push_operations.py new file mode 100755 index 000000000..ea18d9769 --- /dev/null +++ b/sync-for-payables/src/codatsyncpayables/models/operations/list_push_operations.py @@ -0,0 +1,38 @@ +"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" + +from __future__ import annotations +import dataclasses +import requests as requests_http +from ..shared import errormessage as shared_errormessage +from ..shared import pushoperations as shared_pushoperations +from typing import Optional + + + +@dataclasses.dataclass +class ListPushOperationsRequest: + company_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'companyId', 'style': 'simple', 'explode': False }}) + 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=None, 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=None, 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 ListPushOperationsResponse: + content_type: str = dataclasses.field() + status_code: int = dataclasses.field() + error_message: Optional[shared_errormessage.ErrorMessage] = dataclasses.field(default=None) + r"""Your `query` parameter was not correctly formed""" + push_operations: Optional[shared_pushoperations.PushOperations] = dataclasses.field(default=None) + r"""OK""" + raw_response: Optional[requests_http.Response] = dataclasses.field(default=None) + + diff --git a/sync-for-payables/src/codatsyncpayables/models/operations/list_suppliers.py b/sync-for-payables/src/codatsyncpayables/models/operations/list_suppliers.py new file mode 100755 index 000000000..952e53c2e --- /dev/null +++ b/sync-for-payables/src/codatsyncpayables/models/operations/list_suppliers.py @@ -0,0 +1,38 @@ +"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" + +from __future__ import annotations +import dataclasses +import requests as requests_http +from ..shared import errormessage as shared_errormessage +from ..shared import suppliers as shared_suppliers +from typing import Optional + + + +@dataclasses.dataclass +class ListSuppliersRequest: + company_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'companyId', 'style': 'simple', 'explode': False }}) + 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=None, 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=None, 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 ListSuppliersResponse: + content_type: str = dataclasses.field() + status_code: int = dataclasses.field() + error_message: Optional[shared_errormessage.ErrorMessage] = dataclasses.field(default=None) + r"""Your `query` parameter was not correctly formed""" + raw_response: Optional[requests_http.Response] = dataclasses.field(default=None) + suppliers: Optional[shared_suppliers.Suppliers] = dataclasses.field(default=None) + r"""Success""" + + diff --git a/sync-for-payables/src/codatsyncpayables/models/operations/list_tax_rates.py b/sync-for-payables/src/codatsyncpayables/models/operations/list_tax_rates.py new file mode 100755 index 000000000..2fdeffda2 --- /dev/null +++ b/sync-for-payables/src/codatsyncpayables/models/operations/list_tax_rates.py @@ -0,0 +1,38 @@ +"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" + +from __future__ import annotations +import dataclasses +import requests as requests_http +from ..shared import errormessage as shared_errormessage +from ..shared import taxrates as shared_taxrates +from typing import Optional + + + +@dataclasses.dataclass +class ListTaxRatesRequest: + company_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'companyId', 'style': 'simple', 'explode': False }}) + 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=None, 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=None, 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 ListTaxRatesResponse: + content_type: str = dataclasses.field() + status_code: int = dataclasses.field() + error_message: Optional[shared_errormessage.ErrorMessage] = dataclasses.field(default=None) + r"""Your `query` parameter was not correctly formed""" + raw_response: Optional[requests_http.Response] = dataclasses.field(default=None) + tax_rates: Optional[shared_taxrates.TaxRates] = dataclasses.field(default=None) + r"""Success""" + + diff --git a/sync-for-payables/src/codatsyncpayables/models/operations/list_tracking_categories.py b/sync-for-payables/src/codatsyncpayables/models/operations/list_tracking_categories.py new file mode 100755 index 000000000..2dfa35e5a --- /dev/null +++ b/sync-for-payables/src/codatsyncpayables/models/operations/list_tracking_categories.py @@ -0,0 +1,38 @@ +"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" + +from __future__ import annotations +import dataclasses +import requests as requests_http +from ..shared import errormessage as shared_errormessage +from ..shared import trackingcategories as shared_trackingcategories +from typing import Optional + + + +@dataclasses.dataclass +class ListTrackingCategoriesRequest: + company_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'companyId', 'style': 'simple', 'explode': False }}) + 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=None, 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=None, 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 ListTrackingCategoriesResponse: + content_type: str = dataclasses.field() + status_code: int = dataclasses.field() + error_message: Optional[shared_errormessage.ErrorMessage] = dataclasses.field(default=None) + r"""Your `query` parameter was not correctly formed""" + raw_response: Optional[requests_http.Response] = dataclasses.field(default=None) + tracking_categories: Optional[shared_trackingcategories.TrackingCategories] = dataclasses.field(default=None) + r"""Success""" + + diff --git a/sync-for-payables/src/codatsyncpayables/models/operations/refresh_all_data_types.py b/sync-for-payables/src/codatsyncpayables/models/operations/refresh_all_data_types.py new file mode 100755 index 000000000..1380cf252 --- /dev/null +++ b/sync-for-payables/src/codatsyncpayables/models/operations/refresh_all_data_types.py @@ -0,0 +1,27 @@ +"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" + +from __future__ import annotations +import dataclasses +import requests as requests_http +from ..shared import errormessage as shared_errormessage +from typing import Optional + + + +@dataclasses.dataclass +class RefreshAllDataTypesRequest: + company_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'companyId', 'style': 'simple', 'explode': False }}) + + + + + +@dataclasses.dataclass +class RefreshAllDataTypesResponse: + content_type: str = dataclasses.field() + status_code: int = dataclasses.field() + error_message: Optional[shared_errormessage.ErrorMessage] = dataclasses.field(default=None) + r"""Your API request was not properly authorized.""" + raw_response: Optional[requests_http.Response] = dataclasses.field(default=None) + + diff --git a/sync-for-payables/src/codatsyncpayables/models/operations/refresh_data_type.py b/sync-for-payables/src/codatsyncpayables/models/operations/refresh_data_type.py new file mode 100755 index 000000000..23151273d --- /dev/null +++ b/sync-for-payables/src/codatsyncpayables/models/operations/refresh_data_type.py @@ -0,0 +1,35 @@ +"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" + +from __future__ import annotations +import dataclasses +import requests as requests_http +from ..shared import datatype as shared_datatype +from ..shared import errormessage as shared_errormessage +from ..shared import pulloperation as shared_pulloperation +from typing import Optional + + + +@dataclasses.dataclass +class RefreshDataTypeRequest: + company_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'companyId', 'style': 'simple', 'explode': False }}) + data_type: shared_datatype.DataType = dataclasses.field(metadata={'path_param': { 'field_name': 'dataType', 'style': 'simple', 'explode': False }}) + r"""The key of a Codat data type""" + connection_id: Optional[str] = dataclasses.field(default=None, metadata={'query_param': { 'field_name': 'connectionId', 'style': 'form', 'explode': True }}) + r"""Optionally, provide a data connection id to only queue pull operations on that connection.""" + + + + + +@dataclasses.dataclass +class RefreshDataTypeResponse: + content_type: str = dataclasses.field() + status_code: int = dataclasses.field() + error_message: Optional[shared_errormessage.ErrorMessage] = dataclasses.field(default=None) + r"""Your API request was not properly authorized.""" + pull_operation: Optional[shared_pulloperation.PullOperation] = dataclasses.field(default=None) + r"""OK""" + raw_response: Optional[requests_http.Response] = dataclasses.field(default=None) + + diff --git a/sync-for-payables/src/codatsyncpayables/models/operations/unlink_connection.py b/sync-for-payables/src/codatsyncpayables/models/operations/unlink_connection.py new file mode 100755 index 000000000..b96711fec --- /dev/null +++ b/sync-for-payables/src/codatsyncpayables/models/operations/unlink_connection.py @@ -0,0 +1,43 @@ +"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" + +from __future__ import annotations +import dataclasses +import requests as requests_http +from ..shared import connection as shared_connection +from ..shared import errormessage as shared_errormessage +from codatsyncpayables import utils +from dataclasses_json import Undefined, dataclass_json +from typing import Optional + + +@dataclass_json(undefined=Undefined.EXCLUDE) + +@dataclasses.dataclass +class UnlinkConnectionRequestBody: + status: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('status'), 'exclude': lambda f: f is None }}) + + + + + +@dataclasses.dataclass +class UnlinkConnectionRequest: + company_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'companyId', 'style': 'simple', 'explode': False }}) + connection_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'connectionId', 'style': 'simple', 'explode': False }}) + request_body: Optional[UnlinkConnectionRequestBody] = dataclasses.field(default=None, metadata={'request': { 'media_type': 'application/json' }}) + + + + + +@dataclasses.dataclass +class UnlinkConnectionResponse: + content_type: str = dataclasses.field() + status_code: int = dataclasses.field() + connection: Optional[shared_connection.Connection] = dataclasses.field(default=None) + r"""OK""" + error_message: Optional[shared_errormessage.ErrorMessage] = dataclasses.field(default=None) + r"""Your API request was not properly authorized.""" + raw_response: Optional[requests_http.Response] = dataclasses.field(default=None) + + diff --git a/sync-for-payables/src/codatsyncpayables/models/operations/update_bill.py b/sync-for-payables/src/codatsyncpayables/models/operations/update_bill.py new file mode 100755 index 000000000..acfa795fc --- /dev/null +++ b/sync-for-payables/src/codatsyncpayables/models/operations/update_bill.py @@ -0,0 +1,38 @@ +"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" + +from __future__ import annotations +import dataclasses +import requests as requests_http +from ..shared import bill as shared_bill +from ..shared import errormessage as shared_errormessage +from ..shared import updatebillresponse as shared_updatebillresponse +from typing import Optional + + + +@dataclasses.dataclass +class UpdateBillRequest: + bill_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'billId', 'style': 'simple', 'explode': False }}) + r"""Unique identifier for a bill""" + company_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'companyId', 'style': 'simple', 'explode': False }}) + connection_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'connectionId', 'style': 'simple', 'explode': False }}) + bill: Optional[shared_bill.Bill] = dataclasses.field(default=None, metadata={'request': { 'media_type': 'application/json' }}) + force_update: Optional[bool] = dataclasses.field(default=None, metadata={'query_param': { 'field_name': 'forceUpdate', 'style': 'form', 'explode': True }}) + r"""When updating data in the destination platform Codat checks the `sourceModifiedDate` against the `lastupdated` date from the accounting platform, 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] = dataclasses.field(default=None, metadata={'query_param': { 'field_name': 'timeoutInMinutes', 'style': 'form', 'explode': True }}) + + + + + +@dataclasses.dataclass +class UpdateBillResponse: + content_type: str = dataclasses.field() + status_code: int = dataclasses.field() + error_message: Optional[shared_errormessage.ErrorMessage] = dataclasses.field(default=None) + r"""The request made is not valid.""" + raw_response: Optional[requests_http.Response] = dataclasses.field(default=None) + update_bill_response: Optional[shared_updatebillresponse.UpdateBillResponse] = dataclasses.field(default=None) + r"""Success""" + + diff --git a/sync-for-payables/src/codatsyncpayables/models/operations/update_bill_credit_note.py b/sync-for-payables/src/codatsyncpayables/models/operations/update_bill_credit_note.py new file mode 100755 index 000000000..f0a2b048d --- /dev/null +++ b/sync-for-payables/src/codatsyncpayables/models/operations/update_bill_credit_note.py @@ -0,0 +1,37 @@ +"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" + +from __future__ import annotations +import dataclasses +import requests as requests_http +from ..shared import billcreditnote as shared_billcreditnote +from ..shared import errormessage as shared_errormessage +from ..shared import updatebillcreditnoteresponse as shared_updatebillcreditnoteresponse +from typing import Optional + + + +@dataclasses.dataclass +class UpdateBillCreditNoteRequest: + bill_credit_note_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'billCreditNoteId', 'style': 'simple', 'explode': False }}) + company_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'companyId', 'style': 'simple', 'explode': False }}) + connection_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'connectionId', 'style': 'simple', 'explode': False }}) + bill_credit_note: Optional[shared_billcreditnote.BillCreditNote] = dataclasses.field(default=None, metadata={'request': { 'media_type': 'application/json' }}) + force_update: Optional[bool] = dataclasses.field(default=None, metadata={'query_param': { 'field_name': 'forceUpdate', 'style': 'form', 'explode': True }}) + r"""When updating data in the destination platform Codat checks the `sourceModifiedDate` against the `lastupdated` date from the accounting platform, 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] = dataclasses.field(default=None, metadata={'query_param': { 'field_name': 'timeoutInMinutes', 'style': 'form', 'explode': True }}) + + + + + +@dataclasses.dataclass +class UpdateBillCreditNoteResponse: + content_type: str = dataclasses.field() + status_code: int = dataclasses.field() + error_message: Optional[shared_errormessage.ErrorMessage] = dataclasses.field(default=None) + r"""The request made is not valid.""" + raw_response: Optional[requests_http.Response] = dataclasses.field(default=None) + update_bill_credit_note_response: Optional[shared_updatebillcreditnoteresponse.UpdateBillCreditNoteResponse] = dataclasses.field(default=None) + r"""Success""" + + diff --git a/sync-for-payables/src/codatsyncpayables/models/operations/update_company.py b/sync-for-payables/src/codatsyncpayables/models/operations/update_company.py new file mode 100755 index 000000000..22578dcd0 --- /dev/null +++ b/sync-for-payables/src/codatsyncpayables/models/operations/update_company.py @@ -0,0 +1,32 @@ +"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" + +from __future__ import annotations +import dataclasses +import requests as requests_http +from ..shared import company as shared_company +from ..shared import companyrequestbody as shared_companyrequestbody +from ..shared import errormessage as shared_errormessage +from typing import Optional + + + +@dataclasses.dataclass +class UpdateCompanyRequest: + company_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'companyId', 'style': 'simple', 'explode': False }}) + 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() + status_code: int = dataclasses.field() + company: Optional[shared_company.Company] = dataclasses.field(default=None) + r"""OK""" + error_message: Optional[shared_errormessage.ErrorMessage] = dataclasses.field(default=None) + r"""Your API request was not properly authorized.""" + raw_response: Optional[requests_http.Response] = dataclasses.field(default=None) + + diff --git a/sync-for-payables/src/codatsyncpayables/models/operations/update_supplier.py b/sync-for-payables/src/codatsyncpayables/models/operations/update_supplier.py new file mode 100755 index 000000000..2cc2c53a4 --- /dev/null +++ b/sync-for-payables/src/codatsyncpayables/models/operations/update_supplier.py @@ -0,0 +1,38 @@ +"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" + +from __future__ import annotations +import dataclasses +import requests as requests_http +from ..shared import errormessage as shared_errormessage +from ..shared import supplier as shared_supplier +from ..shared import updatesupplierresponse as shared_updatesupplierresponse +from typing import Optional + + + +@dataclasses.dataclass +class UpdateSupplierRequest: + company_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'companyId', 'style': 'simple', 'explode': False }}) + connection_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'connectionId', 'style': 'simple', 'explode': False }}) + supplier_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'supplierId', 'style': 'simple', 'explode': False }}) + r"""Unique identifier for a supplier""" + force_update: Optional[bool] = dataclasses.field(default=None, metadata={'query_param': { 'field_name': 'forceUpdate', 'style': 'form', 'explode': True }}) + r"""When updating data in the destination platform Codat checks the `sourceModifiedDate` against the `lastupdated` date from the accounting platform, 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.""" + supplier: Optional[shared_supplier.Supplier] = dataclasses.field(default=None, metadata={'request': { 'media_type': 'application/json' }}) + timeout_in_minutes: Optional[int] = dataclasses.field(default=None, metadata={'query_param': { 'field_name': 'timeoutInMinutes', 'style': 'form', 'explode': True }}) + + + + + +@dataclasses.dataclass +class UpdateSupplierResponse: + content_type: str = dataclasses.field() + status_code: int = dataclasses.field() + error_message: Optional[shared_errormessage.ErrorMessage] = dataclasses.field(default=None) + r"""The request made is not valid.""" + raw_response: Optional[requests_http.Response] = dataclasses.field(default=None) + update_supplier_response: Optional[shared_updatesupplierresponse.UpdateSupplierResponse] = dataclasses.field(default=None) + r"""Success""" + + diff --git a/sync-for-payables/src/codatsyncpayables/models/operations/upload_bill_attachment.py b/sync-for-payables/src/codatsyncpayables/models/operations/upload_bill_attachment.py new file mode 100755 index 000000000..16bd4f40f --- /dev/null +++ b/sync-for-payables/src/codatsyncpayables/models/operations/upload_bill_attachment.py @@ -0,0 +1,40 @@ +"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" + +from __future__ import annotations +import dataclasses +import requests as requests_http +from ..shared import errormessage as shared_errormessage +from typing import Optional + + + +@dataclasses.dataclass +class UploadBillAttachmentRequestBody: + content: bytes = dataclasses.field(metadata={'multipart_form': { 'content': True }}) + request_body: str = dataclasses.field(metadata={'multipart_form': { 'field_name': 'requestBody' }}) + + + + + +@dataclasses.dataclass +class UploadBillAttachmentRequest: + bill_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'billId', 'style': 'simple', 'explode': False }}) + r"""Unique identifier for a bill""" + company_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'companyId', 'style': 'simple', 'explode': False }}) + connection_id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'connectionId', 'style': 'simple', 'explode': False }}) + request_body: Optional[UploadBillAttachmentRequestBody] = dataclasses.field(default=None, metadata={'multipart_form': { 'file': True }, 'request': { 'media_type': 'multipart/form-data' }}) + + + + + +@dataclasses.dataclass +class UploadBillAttachmentResponse: + content_type: str = dataclasses.field() + status_code: int = dataclasses.field() + error_message: Optional[shared_errormessage.ErrorMessage] = dataclasses.field(default=None) + r"""Your API request was not properly authorized.""" + raw_response: Optional[requests_http.Response] = dataclasses.field(default=None) + + diff --git a/sync-for-payables/src/codatsyncpayables/models/shared/__init__.py b/sync-for-payables/src/codatsyncpayables/models/shared/__init__.py new file mode 100755 index 000000000..638cfd361 --- /dev/null +++ b/sync-for-payables/src/codatsyncpayables/models/shared/__init__.py @@ -0,0 +1,98 @@ +"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" + +from .account import * +from .accountingaddresstype import * +from .accountref import * +from .accounts import * +from .accountstatus import * +from .accounttype import * +from .attachment import * +from .attachments import * +from .bill import * +from .billcreditnote import * +from .billcreditnotelineitem import * +from .billcreditnotes import * +from .billcreditnotestatus import * +from .billedtotype import * +from .billlineitem import * +from .billpayment import * +from .billpaymentline import * +from .billpaymentlinelink import * +from .billpaymentlinelinktype import * +from .billpayments import * +from .bills import * +from .billstatus import * +from .companies import * +from .company import * +from .companyrequestbody import * +from .connection import * +from .connections import * +from .createaccountresponse import * +from .createbillcreditnoteresponse import * +from .createbillpaymentresponse import * +from .createbillresponse import * +from .createjournalentryresponse import * +from .createjournalresponse import * +from .createsupplierresponse import * +from .dataconnectionerror import * +from .dataconnectionstatus import * +from .datastatus import * +from .datatype import * +from .errormessage import * +from .halref import * +from .itemref import * +from .items import * +from .journal import * +from .journalentry import * +from .journalline import * +from .journalref import * +from .journals import * +from .journalstatus import * +from .links import * +from .metadata import * +from .paymentallocationpayment import * +from .paymentmethod import * +from .paymentmethods import * +from .paymentmethodstatus import * +from .paymentmethodtype import * +from .pulloperation import * +from .pulloperations import * +from .pushchangetype import * +from .pushfieldvalidation import * +from .pushoperation import * +from .pushoperationchange import * +from .pushoperationref import * +from .pushoperations import * +from .pushoperationstatus import * +from .pushoption import * +from .pushoptionchoice import * +from .pushoptionproperty import * +from .pushoptiontype import * +from .pushvalidationinfo import * +from .recordref import * +from .security import * +from .status import * +from .supplementaldata import * +from .supplier import * +from .supplierref import * +from .suppliers import * +from .supplierstatus import * +from .taxrate import * +from .taxratecomponent import * +from .taxrateref import * +from .taxrates import * +from .taxratestatus import * +from .tracking import * +from .trackingcategories import * +from .trackingcategory import * +from .trackingcategoryref import * +from .trackingcategorytree import * +from .updatebillcreditnoteresponse import * +from .updatebillresponse import * +from .updatesupplierresponse import * +from .validation import * +from .validationitem import * +from .validdatatypelinksitems import * +from .withholdingtaxitems import * + +__all__ = ["Account","AccountRef","AccountStatus","AccountType","AccountValidDataTypeLinks","AccountingAddressType","Accounts","Attachment","Attachments","Bill","BillCreditNote","BillCreditNoteLineItem","BillCreditNoteLineItemItemReference","BillCreditNoteLineItemTracking","BillCreditNoteLineItemTrackingCustomerRef","BillCreditNoteLineItemTrackingProjectRef","BillCreditNoteStatus","BillCreditNotes","BillLineItem","BillPayment","BillPaymentAllocation","BillPaymentAllocationAllocation","BillPaymentLine","BillPaymentLineLink","BillPaymentLineLinkType","BillPayments","BillPurchaseOrderReference","BillStatus","BillSupplementalData","BillWithholdingTax","BilledToType","Bills","Companies","Company","CompanyRequestBody","Connection","ConnectionSourceType","Connections","CreateAccountResponse","CreateBillCreditNoteResponse","CreateBillPaymentResponse","CreateBillResponse","CreateJournalEntryResponse","CreateJournalResponse","CreateSupplierResponse","DataConnectionError","DataConnectionStatus","DataStatus","DataType","ErrorMessage","HalRef","ItemRef","Items","ItemsAllocation","Journal","JournalEntry","JournalEntryRecordReference","JournalLine","JournalLineTracking","JournalRef","JournalStatus","Journals","Links","Metadata","PaymentAllocationPayment","PaymentMethod","PaymentMethodStatus","PaymentMethodType","PaymentMethods","PullOperation","PullOperationStatus","PullOperations","PushChangeType","PushFieldValidation","PushOperation","PushOperationChange","PushOperationRef","PushOperationStatus","PushOperations","PushOption","PushOptionChoice","PushOptionProperty","PushOptionType","PushValidationInfo","RecordRef","Security","Status","SupplementalData","Supplier","SupplierAddresses","SupplierRef","SupplierStatus","Suppliers","TaxRate","TaxRateComponent","TaxRateRef","TaxRateStatus","TaxRates","Tracking","TrackingCategories","TrackingCategory","TrackingCategoryRef","TrackingCategoryTree","TrackingCustomerRef","TrackingProjectRef","UpdateBillCreditNoteResponse","UpdateBillResponse","UpdateSupplierResponse","ValidDatatypeLinksitems","Validation","ValidationItem","WithholdingTaxitems"] diff --git a/sync-for-payables/src/codatsyncpayables/models/shared/account.py b/sync-for-payables/src/codatsyncpayables/models/shared/account.py new file mode 100755 index 000000000..7574c5759 --- /dev/null +++ b/sync-for-payables/src/codatsyncpayables/models/shared/account.py @@ -0,0 +1,141 @@ +"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" + +from __future__ import annotations +import dataclasses +from ..shared import accountstatus as shared_accountstatus +from ..shared import accounttype as shared_accounttype +from ..shared import metadata as shared_metadata +from codatsyncpayables import utils +from dataclasses_json import Undefined, dataclass_json +from typing import Optional + + +@dataclass_json(undefined=Undefined.EXCLUDE) + +@dataclasses.dataclass +class AccountValidDataTypeLinks: + 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: Optional[list[str]] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('links'), 'exclude': lambda f: f is None }}) + r"""Supported `dataTypes` that the record can be linked to.""" + property: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('property'), 'exclude': lambda f: f is None }}) + r"""The property from the account that can be linked.""" + + + + +@dataclass_json(undefined=Undefined.EXCLUDE) + +@dataclasses.dataclass +class Account: + 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/accounting-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] = 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. + """ + current_balance: Optional[float] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('currentBalance'), 'exclude': lambda f: f is None }}) + r"""Current balance in the account.""" + description: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('description'), 'exclude': lambda f: f is None }}) + r"""Description for the account.""" + fully_qualified_category: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('fullyQualifiedCategory'), 'exclude': lambda f: f is None }}) + 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: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('fullyQualifiedName'), 'exclude': lambda f: f is None }}) + r"""Full name of the account, for example: + - `Cash On Hand` + - `Rents Held In Trust` + - `Fixed Asset` + """ + 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 account, unique for the company.""" + is_bank_account: Optional[bool] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('isBankAccount'), 'exclude': lambda f: f is None }}) + r"""Confirms whether the account is a bank account or not.""" + metadata: Optional[shared_metadata.Metadata] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('metadata'), 'exclude': lambda f: f is None }}) + modified_date: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('modifiedDate'), 'exclude': lambda f: f is None }}) + 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 account.""" + nominal_code: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('nominalCode'), 'exclude': lambda f: f is None }}) + 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: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('sourceModifiedDate'), 'exclude': lambda f: f is None }}) + status: Optional[shared_accountstatus.AccountStatus] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('status'), 'exclude': lambda f: f is None }}) + r"""Status of the account""" + type: Optional[shared_accounttype.AccountType] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('type'), 'exclude': lambda f: f is None }}) + r"""Type of account""" + valid_datatype_links: Optional[list[AccountValidDataTypeLinks]] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('validDatatypeLinks'), 'exclude': lambda f: f is None }}) + 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](/accounting-api#/schemas/ValidDataTypeLinks).""" + + diff --git a/sync-for-payables/src/codatsyncpayables/models/shared/accountingaddresstype.py b/sync-for-payables/src/codatsyncpayables/models/shared/accountingaddresstype.py new file mode 100755 index 000000000..d8bad9974 --- /dev/null +++ b/sync-for-payables/src/codatsyncpayables/models/shared/accountingaddresstype.py @@ -0,0 +1,10 @@ +"""Code generated by Speakeasy (https://speakeasyapi.dev). 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/sync-for-payables/src/codatsyncpayables/models/shared/accountref.py b/sync-for-payables/src/codatsyncpayables/models/shared/accountref.py new file mode 100755 index 000000000..7c75acf73 --- /dev/null +++ b/sync-for-payables/src/codatsyncpayables/models/shared/accountref.py @@ -0,0 +1,20 @@ +"""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 AccountRef: + 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] = 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.""" + + diff --git a/sync-for-payables/src/codatsyncpayables/models/shared/accounts.py b/sync-for-payables/src/codatsyncpayables/models/shared/accounts.py new file mode 100755 index 000000000..8db631cd2 --- /dev/null +++ b/sync-for-payables/src/codatsyncpayables/models/shared/accounts.py @@ -0,0 +1,23 @@ +"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" + +from __future__ import annotations +import dataclasses +from ..shared import account as shared_account +from ..shared import links as shared_links +from codatsyncpayables import utils +from dataclasses_json import Undefined, dataclass_json +from typing import Optional + + +@dataclass_json(undefined=Undefined.EXCLUDE) + +@dataclasses.dataclass +class Accounts: + r"""Success""" + links: shared_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') }}) + page_size: int = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('pageSize') }}) + total_results: int = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('totalResults') }}) + results: Optional[list[shared_account.Account]] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('results'), 'exclude': lambda f: f is None }}) + + diff --git a/sync-for-payables/src/codatsyncpayables/models/shared/accountstatus.py b/sync-for-payables/src/codatsyncpayables/models/shared/accountstatus.py new file mode 100755 index 000000000..2335b70e5 --- /dev/null +++ b/sync-for-payables/src/codatsyncpayables/models/shared/accountstatus.py @@ -0,0 +1,11 @@ +"""Code generated by Speakeasy (https://speakeasyapi.dev). 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/sync-for-payables/src/codatsyncpayables/models/shared/accounttype.py b/sync-for-payables/src/codatsyncpayables/models/shared/accounttype.py new file mode 100755 index 000000000..0ae490aa0 --- /dev/null +++ b/sync-for-payables/src/codatsyncpayables/models/shared/accounttype.py @@ -0,0 +1,13 @@ +"""Code generated by Speakeasy (https://speakeasyapi.dev). 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/sync-for-payables/src/codatsyncpayables/models/shared/attachment.py b/sync-for-payables/src/codatsyncpayables/models/shared/attachment.py new file mode 100755 index 000000000..80d72f034 --- /dev/null +++ b/sync-for-payables/src/codatsyncpayables/models/shared/attachment.py @@ -0,0 +1,69 @@ +"""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 Attachment: + 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 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 | + + View the coverage for accounts in the Data coverage explorer. + """ + content_type: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('contentType'), 'exclude': lambda f: f is None }}) + 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: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('dateCreated'), '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. + """ + file_size: Optional[int] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('fileSize'), 'exclude': lambda f: f is None }}) + r"""File size in bytes. For example, if this reads **46153**, then the file size is 46kb.""" + 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 attachment, unique for the company in the accounting platform.""" + include_when_sent: Optional[bool] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('includeWhenSent'), 'exclude': lambda f: f is 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 platform allows this.""" + modified_date: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('modifiedDate'), 'exclude': lambda f: f is None }}) + 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 attachment file.""" + 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 }}) + + diff --git a/sync-for-payables/src/codatsyncpayables/models/shared/attachments.py b/sync-for-payables/src/codatsyncpayables/models/shared/attachments.py new file mode 100755 index 000000000..4543bc33c --- /dev/null +++ b/sync-for-payables/src/codatsyncpayables/models/shared/attachments.py @@ -0,0 +1,18 @@ +"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" + +from __future__ import annotations +import dataclasses +from ..shared import attachment as shared_attachment +from codatsyncpayables import utils +from dataclasses_json import Undefined, dataclass_json +from typing import Optional + + +@dataclass_json(undefined=Undefined.EXCLUDE) + +@dataclasses.dataclass +class Attachments: + r"""Success""" + attachments: Optional[list[shared_attachment.Attachment]] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('attachments'), 'exclude': lambda f: f is None }}) + + diff --git a/sync-for-payables/src/codatsyncpayables/models/shared/bill.py b/sync-for-payables/src/codatsyncpayables/models/shared/bill.py new file mode 100755 index 000000000..837aacefd --- /dev/null +++ b/sync-for-payables/src/codatsyncpayables/models/shared/bill.py @@ -0,0 +1,222 @@ +"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" + +from __future__ import annotations +import dataclasses +from ..shared import billlineitem as shared_billlineitem +from ..shared import billstatus as shared_billstatus +from ..shared import metadata as shared_metadata +from ..shared import paymentallocationpayment as shared_paymentallocationpayment +from ..shared import supplierref as shared_supplierref +from codatsyncpayables import utils +from dataclasses_json import Undefined, dataclass_json +from typing import Any, Optional + + +@dataclass_json(undefined=Undefined.EXCLUDE) + +@dataclasses.dataclass +class BillPaymentAllocationAllocation: + allocated_on_date: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('allocatedOnDate'), '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. + """ + 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. + """ + currency_rate: Optional[float] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('currencyRate'), 'exclude': lambda f: f is None }}) + 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 platform, it will be available from Codat with the same precision (up to a maximum of 9 decimal places). + + For accounting platforms 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 | + """ + total_amount: Optional[float] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('totalAmount'), 'exclude': lambda f: f is None }}) + r"""The total amount that has been allocated.""" + + + + +@dataclass_json(undefined=Undefined.EXCLUDE) + +@dataclasses.dataclass +class BillPaymentAllocation: + allocation: BillPaymentAllocationAllocation = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('allocation') }}) + payment: shared_paymentallocationpayment.PaymentAllocationPayment = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('payment') }}) + + + + +@dataclass_json(undefined=Undefined.EXCLUDE) + +@dataclasses.dataclass +class BillPurchaseOrderReference: + 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 purchase order, unique for the company in the accounting platform.""" + purchase_order_number: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('purchaseOrderNumber'), 'exclude': lambda f: f is None }}) + r"""Friendly reference for the purchase order, commonly generated by the accounting platform.""" + + + + +@dataclass_json(undefined=Undefined.EXCLUDE) + +@dataclasses.dataclass +class BillSupplementalData: + 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 platform. [Learn more](https://docs.codat.io/using-the-api/additional-data) about supplemental data. + """ + content: Optional[dict[str, dict[str, Any]]] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('content'), 'exclude': lambda f: f is None }}) + + + + +@dataclass_json(undefined=Undefined.EXCLUDE) + +@dataclasses.dataclass +class BillWithholdingTax: + amount: float = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('amount') }}) + name: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('name') }}) + + + + +@dataclass_json(undefined=Undefined.EXCLUDE) + +@dataclasses.dataclass +class Bill: + 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/accounting-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 platforms 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/accounting-api#/schemas/DirectCost) data model. + """ + issue_date: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('issueDate') }}) + status: shared_billstatus.BillStatus = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('status') }}) + r"""Current state of the bill.""" + sub_total: float = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('subTotal') }}) + r"""Total amount of the bill, excluding any taxes.""" + tax_amount: float = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('taxAmount') }}) + r"""Amount of tax on the bill.""" + total_amount: float = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('totalAmount') }}) + r"""Amount of the bill, including tax.""" + amount_due: Optional[float] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('amountDue'), 'exclude': lambda f: f is None }}) + 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. + """ + currency_rate: Optional[float] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('currencyRate'), 'exclude': lambda f: f is None }}) + 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 platform, it will be available from Codat with the same precision (up to a maximum of 9 decimal places). + + For accounting platforms 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 | + """ + 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.""" + line_items: Optional[list[shared_billlineitem.BillLineItem]] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('lineItems'), 'exclude': lambda f: f is None }}) + r"""Array of Bill line items.""" + metadata: Optional[shared_metadata.Metadata] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('metadata'), 'exclude': lambda f: f is None }}) + modified_date: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('modifiedDate'), 'exclude': lambda f: f is None }}) + note: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('note'), 'exclude': lambda f: f is None }}) + r"""Any private, company notes about the bill, such as payment information.""" + payment_allocations: Optional[list[BillPaymentAllocation]] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('paymentAllocations'), 'exclude': lambda f: f is None }}) + r"""An array of payment allocations.""" + purchase_order_refs: Optional[list[BillPurchaseOrderReference]] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('purchaseOrderRefs'), 'exclude': lambda f: f is None }}) + reference: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('reference'), 'exclude': lambda f: f is None }}) + 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 }}) + supplemental_data: Optional[BillSupplementalData] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('supplementalData'), 'exclude': lambda f: f is 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 platform. [Learn more](https://docs.codat.io/using-the-api/additional-data) about supplemental data. + """ + supplier_ref: Optional[shared_supplierref.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.""" + withholding_tax: Optional[list[BillWithholdingTax]] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('withholdingTax'), 'exclude': lambda f: f is None }}) + + diff --git a/sync-for-payables/src/codatsyncpayables/models/shared/billcreditnote.py b/sync-for-payables/src/codatsyncpayables/models/shared/billcreditnote.py new file mode 100755 index 000000000..eee71289c --- /dev/null +++ b/sync-for-payables/src/codatsyncpayables/models/shared/billcreditnote.py @@ -0,0 +1,152 @@ +"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" + +from __future__ import annotations +import dataclasses +from ..shared import billcreditnotelineitem as shared_billcreditnotelineitem +from ..shared import billcreditnotestatus as shared_billcreditnotestatus +from ..shared import items as shared_items +from ..shared import metadata as shared_metadata +from ..shared import supplementaldata as shared_supplementaldata +from ..shared import supplierref as shared_supplierref +from ..shared import withholdingtaxitems as shared_withholdingtaxitems +from codatsyncpayables import utils +from dataclasses_json import Undefined, dataclass_json +from typing import Optional + + +@dataclass_json(undefined=Undefined.EXCLUDE) + +@dataclasses.dataclass +class BillCreditNote: + 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/accounting-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/accounting-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/accounting-api#/schemas/Bill). + * The supplier that issued the bill credit note. + """ + discount_percentage: float = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('discountPercentage') }}) + r"""Percentage rate of any discount applied to the bill credit note.""" + status: shared_billcreditnotestatus.BillCreditNoteStatus = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('status') }}) + r"""Current state of the bill credit note""" + sub_total: float = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('subTotal') }}) + r"""Total amount of the bill credit note, including discounts but excluding tax.""" + total_amount: float = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('totalAmount') }}) + r"""Total amount of credit that has been applied to the business' account with the supplier, including discounts and tax.""" + total_discount: float = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('totalDiscount') }}) + r"""Total value of any discounts applied.""" + total_tax_amount: float = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('totalTaxAmount') }}) + r"""Amount of tax included in the bill credit note.""" + allocated_on_date: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('allocatedOnDate'), '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. + """ + bill_credit_note_number: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('billCreditNoteNumber'), 'exclude': lambda f: f is None }}) + r"""Friendly reference for the bill credit note.""" + 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. + """ + currency_rate: Optional[float] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('currencyRate'), 'exclude': lambda f: f is None }}) + 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 platform, it will be available from Codat with the same precision (up to a maximum of 9 decimal places). + + For accounting platforms 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 | + """ + 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 credit note that is unique to a 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 }}) + 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: Optional[list[shared_billcreditnotelineitem.BillCreditNoteLineItem]] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('lineItems'), 'exclude': lambda f: f is None }}) + r"""An array of line""" + metadata: Optional[shared_metadata.Metadata] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('metadata'), 'exclude': lambda f: f is None }}) + modified_date: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('modifiedDate'), 'exclude': lambda f: f is None }}) + note: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('note'), 'exclude': lambda f: f is None }}) + r"""Any additional information about the bill credit note.""" + payment_allocations: Optional[list[shared_items.Items]] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('paymentAllocations'), 'exclude': lambda f: f is None }}) + r"""An array of payment allocations.""" + remaining_credit: Optional[float] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('remainingCredit'), 'exclude': lambda f: f is None }}) + r"""Amount of the bill credit note that is still outstanding.""" + 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 }}) + supplemental_data: Optional[shared_supplementaldata.SupplementalData] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('supplementalData'), 'exclude': lambda f: f is 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 platform. [Learn more](https://docs.codat.io/using-the-api/additional-data) about supplemental data. + """ + supplier_ref: Optional[shared_supplierref.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.""" + withholding_tax: Optional[list[shared_withholdingtaxitems.WithholdingTaxitems]] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('withholdingTax'), 'exclude': lambda f: f is None }}) + + diff --git a/sync-for-payables/src/codatsyncpayables/models/shared/billcreditnotelineitem.py b/sync-for-payables/src/codatsyncpayables/models/shared/billcreditnotelineitem.py new file mode 100755 index 000000000..a6f76c3c8 --- /dev/null +++ b/sync-for-payables/src/codatsyncpayables/models/shared/billcreditnotelineitem.py @@ -0,0 +1,107 @@ +"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" + +from __future__ import annotations +import dataclasses +from ..shared import accountref as shared_accountref +from ..shared import billedtotype as shared_billedtotype +from ..shared import taxrateref as shared_taxrateref +from ..shared import trackingcategoryref as shared_trackingcategoryref +from codatsyncpayables import utils +from dataclasses_json import Undefined, dataclass_json +from typing import Optional + + +@dataclass_json(undefined=Undefined.EXCLUDE) + +@dataclasses.dataclass +class BillCreditNoteLineItemItemReference: + r"""Reference to the item the line is linked to.""" + id: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('id') }}) + r"""Unique identifier for the item 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 item in the accounting platform.""" + + + + +@dataclass_json(undefined=Undefined.EXCLUDE) + +@dataclasses.dataclass +class BillCreditNoteLineItemTrackingCustomerRef: + id: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('id') }}) + r"""`id` from the Customers data type""" + company_name: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('companyName'), 'exclude': lambda f: f is None }}) + r"""`customerName` from the Customer data type""" + + + + +@dataclass_json(undefined=Undefined.EXCLUDE) + +@dataclasses.dataclass +class BillCreditNoteLineItemTrackingProjectRef: + id: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('id') }}) + name: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('name'), 'exclude': lambda f: f is None }}) + + + + +@dataclass_json(undefined=Undefined.EXCLUDE) + +@dataclasses.dataclass +class BillCreditNoteLineItemTracking: + r"""Categories, and a project and customer, against which the item is tracked.""" + category_refs: list[shared_trackingcategoryref.TrackingCategoryRef] = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('categoryRefs') }}) + is_billed_to: shared_billedtotype.BilledToType = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('isBilledTo') }}) + is_rebilled_to: shared_billedtotype.BilledToType = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('isRebilledTo') }}) + customer_ref: Optional[BillCreditNoteLineItemTrackingCustomerRef] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('customerRef'), 'exclude': lambda f: f is None }}) + project_ref: Optional[BillCreditNoteLineItemTrackingProjectRef] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('projectRef'), 'exclude': lambda f: f is None }}) + + + + +@dataclass_json(undefined=Undefined.EXCLUDE) + +@dataclasses.dataclass +class BillCreditNoteLineItem: + quantity: float = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('quantity') }}) + r"""Number of units of the goods or service for which credit has been received.""" + unit_amount: float = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('unitAmount') }}) + r"""Unit price of the goods or service.""" + account_ref: Optional[shared_accountref.AccountRef] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('accountRef'), 'exclude': lambda f: f is 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: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('description'), 'exclude': lambda f: f is None }}) + r"""Friendly name of each line item. For example, the goods or service for which credit has been received.""" + discount_amount: Optional[float] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('discountAmount'), 'exclude': lambda f: f is None }}) + r"""Value of any discounts applied.""" + discount_percentage: Optional[float] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('discountPercentage'), 'exclude': lambda f: f is None }}) + r"""Percentage rate of any discount applied to the line item.""" + item_ref: Optional[BillCreditNoteLineItemItemReference] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('itemRef'), 'exclude': lambda f: f is None }}) + r"""Reference to the item the line is linked to.""" + sub_total: Optional[float] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('subTotal'), 'exclude': lambda f: f is None }}) + r"""Amount of credit associated with the line item, including discounts but excluding tax.""" + tax_amount: Optional[float] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('taxAmount'), 'exclude': lambda f: f is None }}) + r"""Amount of tax associated with the line item.""" + tax_rate_ref: Optional[shared_taxrateref.TaxRateRef] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('taxRateRef'), 'exclude': lambda f: f is 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: Optional[float] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('totalAmount'), 'exclude': lambda f: f is None }}) + r"""Total amount of the line item, including discounts and tax.""" + tracking: Optional[BillCreditNoteLineItemTracking] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('tracking'), 'exclude': lambda f: f is None }}) + r"""Categories, and a project and customer, against which the item is tracked.""" + tracking_category_refs: Optional[list[shared_trackingcategoryref.TrackingCategoryRef]] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('trackingCategoryRefs'), 'exclude': lambda f: f is None }}) + r"""Reference to the tracking categories to which the line item is linked. + + Deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. + """ + + diff --git a/sync-for-payables/src/codatsyncpayables/models/shared/billcreditnotes.py b/sync-for-payables/src/codatsyncpayables/models/shared/billcreditnotes.py new file mode 100755 index 000000000..3015987ba --- /dev/null +++ b/sync-for-payables/src/codatsyncpayables/models/shared/billcreditnotes.py @@ -0,0 +1,23 @@ +"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" + +from __future__ import annotations +import dataclasses +from ..shared import billcreditnote as shared_billcreditnote +from ..shared import links as shared_links +from codatsyncpayables import utils +from dataclasses_json import Undefined, dataclass_json +from typing import Optional + + +@dataclass_json(undefined=Undefined.EXCLUDE) + +@dataclasses.dataclass +class BillCreditNotes: + r"""Success""" + links: shared_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') }}) + page_size: int = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('pageSize') }}) + total_results: int = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('totalResults') }}) + results: Optional[list[shared_billcreditnote.BillCreditNote]] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('results'), 'exclude': lambda f: f is None }}) + + diff --git a/sync-for-payables/src/codatsyncpayables/models/shared/billcreditnotestatus.py b/sync-for-payables/src/codatsyncpayables/models/shared/billcreditnotestatus.py new file mode 100755 index 000000000..c1128f790 --- /dev/null +++ b/sync-for-payables/src/codatsyncpayables/models/shared/billcreditnotestatus.py @@ -0,0 +1,13 @@ +"""Code generated by Speakeasy (https://speakeasyapi.dev). 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/sync-for-payables/src/codatsyncpayables/models/shared/billedtotype.py b/sync-for-payables/src/codatsyncpayables/models/shared/billedtotype.py new file mode 100755 index 000000000..7784c4386 --- /dev/null +++ b/sync-for-payables/src/codatsyncpayables/models/shared/billedtotype.py @@ -0,0 +1,10 @@ +"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" + +from __future__ import annotations +from enum import Enum + +class BilledToType(str, Enum): + UNKNOWN = 'Unknown' + NOT_APPLICABLE = 'NotApplicable' + CUSTOMER = 'Customer' + PROJECT = 'Project' diff --git a/sync-for-payables/src/codatsyncpayables/models/shared/billlineitem.py b/sync-for-payables/src/codatsyncpayables/models/shared/billlineitem.py new file mode 100755 index 000000000..e8ca582b1 --- /dev/null +++ b/sync-for-payables/src/codatsyncpayables/models/shared/billlineitem.py @@ -0,0 +1,59 @@ +"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" + +from __future__ import annotations +import dataclasses +from ..shared import accountref as shared_accountref +from ..shared import itemref as shared_itemref +from ..shared import taxrateref as shared_taxrateref +from ..shared import tracking as shared_tracking +from ..shared import trackingcategoryref as shared_trackingcategoryref +from codatsyncpayables import utils +from dataclasses_json import Undefined, dataclass_json +from typing import Optional + + +@dataclass_json(undefined=Undefined.EXCLUDE) + +@dataclasses.dataclass +class BillLineItem: + quantity: float = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('quantity') }}) + r"""Number of units of goods or services received.""" + unit_amount: float = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('unitAmount') }}) + r"""Price of each unit of goods or services.""" + account_ref: Optional[shared_accountref.AccountRef] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('accountRef'), 'exclude': lambda f: f is 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: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('description'), 'exclude': lambda f: f is None }}) + r"""Friendly name of the goods or services received.""" + discount_amount: Optional[float] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('discountAmount'), 'exclude': lambda f: f is None }}) + r"""Numerical value of any discounts applied. + + Do not use to apply discounts in Oracle NetSuite—see Oracle NetSuite integration reference. + """ + discount_percentage: Optional[float] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('discountPercentage'), 'exclude': lambda f: f is None }}) + is_direct_cost: Optional[bool] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('isDirectCost'), 'exclude': lambda f: f is None }}) + item_ref: Optional[shared_itemref.ItemRef] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('itemRef'), 'exclude': lambda f: f is None }}) + r"""Reference to the item the line is linked to.""" + sub_total: Optional[float] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('subTotal'), 'exclude': lambda f: f is None }}) + r"""Amount of the line, inclusive of discounts but exclusive of tax.""" + tax_amount: Optional[float] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('taxAmount'), 'exclude': lambda f: f is None }}) + r"""Amount of tax for the line.""" + tax_rate_ref: Optional[shared_taxrateref.TaxRateRef] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('taxRateRef'), 'exclude': lambda f: f is 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: Optional[float] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('totalAmount'), 'exclude': lambda f: f is None }}) + r"""Total amount of the line, including tax.""" + tracking: Optional[shared_tracking.Tracking] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('tracking'), 'exclude': lambda f: f is None }}) + r"""Categories, and a project and customer, against which the item is tracked.""" + tracking_category_refs: Optional[list[shared_trackingcategoryref.TrackingCategoryRef]] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('trackingCategoryRefs'), 'exclude': lambda f: f is None }}) + r"""Collection of categories against which this item is tracked.""" + + diff --git a/sync-for-payables/src/codatsyncpayables/models/shared/billpayment.py b/sync-for-payables/src/codatsyncpayables/models/shared/billpayment.py new file mode 100755 index 000000000..809e8eaa9 --- /dev/null +++ b/sync-for-payables/src/codatsyncpayables/models/shared/billpayment.py @@ -0,0 +1,222 @@ +"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" + +from __future__ import annotations +import dataclasses +from ..shared import accountref as shared_accountref +from ..shared import billpaymentline as shared_billpaymentline +from ..shared import metadata as shared_metadata +from ..shared import supplementaldata as shared_supplementaldata +from ..shared import supplierref as shared_supplierref +from codatsyncpayables import utils +from dataclasses_json import Undefined, dataclass_json +from typing import Any, Optional + + +@dataclass_json(undefined=Undefined.EXCLUDE) + +@dataclasses.dataclass +class BillPayment: + 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/accounting-api#/schemas/Payment) for the accounts receivable equivalent of Bill payments, which covers [invoices](https://docs.codat.io/accounting-api#/schemas/Invoice) and [credit notes](https://docs.codat.io/accounting-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/accounting-api#/schemas/Bill) and [credit notes against bills](https://docs.codat.io/accounting-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 package, 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 platforms 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/accounting-api#/schemas/DirectCost) data model. + + Bill payments is a child data type of [account transactions](https://docs.codat.io/accounting-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 packages 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 = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('date') }}) + account_ref: Optional[shared_accountref.AccountRef] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('accountRef'), 'exclude': lambda f: f is 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] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('currency'), 'exclude': lambda f: f is None }}) + currency_rate: Optional[float] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('currencyRate'), 'exclude': lambda f: f is None }}) + 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 platform, it will be available from Codat with the same precision (up to a maximum of 9 decimal places). + + For accounting platforms 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 | + """ + 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 payment, unique for the company in the accounting platform.""" + lines: Optional[list[shared_billpaymentline.BillPaymentLine]] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('lines'), 'exclude': lambda f: f is None }}) + r"""An array of bill payment lines.""" + metadata: Optional[shared_metadata.Metadata] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('metadata'), 'exclude': lambda f: f is None }}) + modified_date: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('modifiedDate'), 'exclude': lambda f: f is None }}) + note: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('note'), 'exclude': lambda f: f is None }}) + r"""Additional information associated with the payment.""" + payment_method_ref: Optional[Any] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('paymentMethodRef'), 'exclude': lambda f: f is None }}) + reference: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('reference'), 'exclude': lambda f: f is None }}) + r"""Additional information associated with the payment.""" + 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 }}) + supplemental_data: Optional[shared_supplementaldata.SupplementalData] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('supplementalData'), 'exclude': lambda f: f is 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 platform. [Learn more](https://docs.codat.io/using-the-api/additional-data) about supplemental data. + """ + supplier_ref: Optional[shared_supplierref.SupplierRef] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('supplierRef'), 'exclude': lambda f: f is None }}) + total_amount: Optional[float] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('totalAmount'), 'exclude': lambda f: f is 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.""" + + diff --git a/sync-for-payables/src/codatsyncpayables/models/shared/billpaymentline.py b/sync-for-payables/src/codatsyncpayables/models/shared/billpaymentline.py new file mode 100755 index 000000000..c59c47f8d --- /dev/null +++ b/sync-for-payables/src/codatsyncpayables/models/shared/billpaymentline.py @@ -0,0 +1,40 @@ +"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" + +from __future__ import annotations +import dataclasses +from ..shared import billpaymentlinelink as shared_billpaymentlinelink +from codatsyncpayables import utils +from dataclasses_json import Undefined, dataclass_json +from typing import Optional + + +@dataclass_json(undefined=Undefined.EXCLUDE) + +@dataclasses.dataclass +class BillPaymentLine: + amount: float = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('amount') }}) + r"""Amount in the bill payment currency.""" + allocated_on_date: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('allocatedOnDate'), '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. + """ + links: Optional[list[shared_billpaymentlinelink.BillPaymentLineLink]] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('links'), 'exclude': lambda f: f is None }}) + + diff --git a/sync-for-payables/src/codatsyncpayables/models/shared/billpaymentlinelink.py b/sync-for-payables/src/codatsyncpayables/models/shared/billpaymentlinelink.py new file mode 100755 index 000000000..36bb0ab91 --- /dev/null +++ b/sync-for-payables/src/codatsyncpayables/models/shared/billpaymentlinelink.py @@ -0,0 +1,53 @@ +"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" + +from __future__ import annotations +import dataclasses +from ..shared import billpaymentlinelinktype as shared_billpaymentlinelinktype +from codatsyncpayables import utils +from dataclasses_json import Undefined, dataclass_json +from typing import Optional + + +@dataclass_json(undefined=Undefined.EXCLUDE) + +@dataclasses.dataclass +class BillPaymentLineLink: + type: shared_billpaymentlinelinktype.BillPaymentLineLinkType = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('type') }}) + r"""Types of links to bill payment lines.""" + amount: Optional[float] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('amount'), 'exclude': lambda f: f is None }}) + 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: Optional[float] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('currencyRate'), 'exclude': lambda f: f is None }}) + 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 platform, it will be available from Codat with the same precision (up to a maximum of 9 decimal places). + + For accounting platforms 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 | + """ + 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 transaction represented by the link.""" + + diff --git a/sync-for-payables/src/codatsyncpayables/models/shared/billpaymentlinelinktype.py b/sync-for-payables/src/codatsyncpayables/models/shared/billpaymentlinelinktype.py new file mode 100755 index 000000000..4b9241f66 --- /dev/null +++ b/sync-for-payables/src/codatsyncpayables/models/shared/billpaymentlinelinktype.py @@ -0,0 +1,17 @@ +"""Code generated by Speakeasy (https://speakeasyapi.dev). 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/sync-for-payables/src/codatsyncpayables/models/shared/billpayments.py b/sync-for-payables/src/codatsyncpayables/models/shared/billpayments.py new file mode 100755 index 000000000..14e6fa935 --- /dev/null +++ b/sync-for-payables/src/codatsyncpayables/models/shared/billpayments.py @@ -0,0 +1,23 @@ +"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" + +from __future__ import annotations +import dataclasses +from ..shared import billpayment as shared_billpayment +from ..shared import links as shared_links +from codatsyncpayables import utils +from dataclasses_json import Undefined, dataclass_json +from typing import Optional + + +@dataclass_json(undefined=Undefined.EXCLUDE) + +@dataclasses.dataclass +class BillPayments: + r"""Success""" + links: shared_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') }}) + page_size: int = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('pageSize') }}) + total_results: int = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('totalResults') }}) + results: Optional[list[shared_billpayment.BillPayment]] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('results'), 'exclude': lambda f: f is None }}) + + diff --git a/sync-for-payables/src/codatsyncpayables/models/shared/bills.py b/sync-for-payables/src/codatsyncpayables/models/shared/bills.py new file mode 100755 index 000000000..2e9af7716 --- /dev/null +++ b/sync-for-payables/src/codatsyncpayables/models/shared/bills.py @@ -0,0 +1,23 @@ +"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" + +from __future__ import annotations +import dataclasses +from ..shared import bill as shared_bill +from ..shared import links as shared_links +from codatsyncpayables import utils +from dataclasses_json import Undefined, dataclass_json +from typing import Optional + + +@dataclass_json(undefined=Undefined.EXCLUDE) + +@dataclasses.dataclass +class Bills: + r"""Success""" + links: shared_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') }}) + page_size: int = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('pageSize') }}) + total_results: int = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('totalResults') }}) + results: Optional[list[shared_bill.Bill]] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('results'), 'exclude': lambda f: f is None }}) + + diff --git a/sync-for-payables/src/codatsyncpayables/models/shared/billstatus.py b/sync-for-payables/src/codatsyncpayables/models/shared/billstatus.py new file mode 100755 index 000000000..e3345892c --- /dev/null +++ b/sync-for-payables/src/codatsyncpayables/models/shared/billstatus.py @@ -0,0 +1,13 @@ +"""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/sync-for-payables/src/codatsyncpayables/models/shared/companies.py b/sync-for-payables/src/codatsyncpayables/models/shared/companies.py new file mode 100755 index 000000000..ec28992a7 --- /dev/null +++ b/sync-for-payables/src/codatsyncpayables/models/shared/companies.py @@ -0,0 +1,23 @@ +"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" + +from __future__ import annotations +import dataclasses +from ..shared import company as shared_company +from ..shared import links as shared_links +from codatsyncpayables import utils +from dataclasses_json import Undefined, dataclass_json +from typing import Optional + + +@dataclass_json(undefined=Undefined.EXCLUDE) + +@dataclasses.dataclass +class Companies: + r"""OK""" + links: shared_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') }}) + page_size: int = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('pageSize') }}) + total_results: int = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('totalResults') }}) + results: Optional[list[shared_company.Company]] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('results'), 'exclude': lambda f: f is None }}) + + diff --git a/sync-for-payables/src/codatsyncpayables/models/shared/company.py b/sync-for-payables/src/codatsyncpayables/models/shared/company.py new file mode 100755 index 000000000..4d89e834e --- /dev/null +++ b/sync-for-payables/src/codatsyncpayables/models/shared/company.py @@ -0,0 +1,76 @@ +"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" + +from __future__ import annotations +import dataclasses +from ..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 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 }}) + data_connections: Optional[list[shared_connection.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.""" + 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"""Deprecated field: This will be removed in a future release, please migrate away from it as soon as possible.""" + + diff --git a/sync-for-payables/src/codatsyncpayables/models/shared/companyrequestbody.py b/sync-for-payables/src/codatsyncpayables/models/shared/companyrequestbody.py new file mode 100755 index 000000000..59ae5d565 --- /dev/null +++ b/sync-for-payables/src/codatsyncpayables/models/shared/companyrequestbody.py @@ -0,0 +1,19 @@ +"""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 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.""" + + diff --git a/sync-for-payables/src/codatsyncpayables/models/shared/connection.py b/sync-for-payables/src/codatsyncpayables/models/shared/connection.py new file mode 100755 index 000000000..a60e26725 --- /dev/null +++ b/sync-for-payables/src/codatsyncpayables/models/shared/connection.py @@ -0,0 +1,96 @@ +"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" + +from __future__ import annotations +import dataclasses +from ..shared import dataconnectionerror as shared_dataconnectionerror +from ..shared import dataconnectionstatus as shared_dataconnectionstatus +from codatsyncpayables import utils +from dataclasses_json import Undefined, dataclass_json +from enum import Enum +from typing import Any, Optional + +class ConnectionSourceType(str, Enum): + r"""The type of platform of the connection.""" + ACCOUNTING = 'Accounting' + BANKING = 'Banking' + COMMERCE = 'Commerce' + 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') }}) + platform_name: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('platformName') }}) + 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: ConnectionSourceType = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('sourceType') }}) + r"""The type of platform of the connection.""" + status: shared_dataconnectionstatus.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[shared_dataconnectionerror.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/sync-for-payables/src/codatsyncpayables/models/shared/connections.py b/sync-for-payables/src/codatsyncpayables/models/shared/connections.py new file mode 100755 index 000000000..842d3c471 --- /dev/null +++ b/sync-for-payables/src/codatsyncpayables/models/shared/connections.py @@ -0,0 +1,23 @@ +"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" + +from __future__ import annotations +import dataclasses +from ..shared import connection as shared_connection +from ..shared import links as shared_links +from codatsyncpayables import utils +from dataclasses_json import Undefined, dataclass_json +from typing import Optional + + +@dataclass_json(undefined=Undefined.EXCLUDE) + +@dataclasses.dataclass +class Connections: + r"""OK""" + links: shared_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') }}) + page_size: int = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('pageSize') }}) + total_results: int = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('totalResults') }}) + results: Optional[list[shared_connection.Connection]] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('results'), 'exclude': lambda f: f is None }}) + + diff --git a/sync-for-payables/src/codatsyncpayables/models/shared/createaccountresponse.py b/sync-for-payables/src/codatsyncpayables/models/shared/createaccountresponse.py new file mode 100755 index 000000000..34d750369 --- /dev/null +++ b/sync-for-payables/src/codatsyncpayables/models/shared/createaccountresponse.py @@ -0,0 +1,112 @@ +"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" + +from __future__ import annotations +import dataclasses +from ..shared import account as shared_account +from ..shared import datatype as shared_datatype +from ..shared import pushoperationchange as shared_pushoperationchange +from ..shared import pushoperationstatus as shared_pushoperationstatus +from ..shared import validation as shared_validation +from codatsyncpayables import utils +from dataclasses_json import Undefined, dataclass_json +from typing import Optional + + +@dataclass_json(undefined=Undefined.EXCLUDE) + +@dataclasses.dataclass +class CreateAccountResponse: + r"""Success""" + company_id: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('companyId') }}) + r"""Unique identifier for your SMB in Codat.""" + data_connection_key: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('dataConnectionKey') }}) + r"""Unique identifier for a company's data connection.""" + push_operation_key: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('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: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('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: shared_pushoperationstatus.PushOperationStatus = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('status') }}) + r"""The status of the push operation.""" + status_code: int = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('statusCode') }}) + changes: Optional[list[shared_pushoperationchange.PushOperationChange]] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('changes'), 'exclude': lambda f: f is None }}) + r"""Contains a single entry that communicates which record has changed and the manner in which it changed.""" + completed_on_utc: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('completedOnUtc'), '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. + """ + data: Optional[shared_account.Account] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('data'), 'exclude': lambda f: f is None }}) + 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/accounting-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. + """ + data_type: Optional[shared_datatype.DataType] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('dataType'), 'exclude': lambda f: f is None }}) + r"""Available Data types""" + error_message: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('errorMessage'), 'exclude': lambda f: f is None }}) + timeout_in_minutes: Optional[int] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('timeoutInMinutes'), 'exclude': lambda f: f is None }}) + timeout_in_seconds: Optional[int] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('timeoutInSeconds'), 'exclude': lambda f: f is None }}) + r"""Deprecated field: This will be removed in a future release, please migrate away from it as soon as possible.""" + validation: Optional[shared_validation.Validation] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('validation'), 'exclude': lambda f: f is 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.""" + + diff --git a/sync-for-payables/src/codatsyncpayables/models/shared/createbillcreditnoteresponse.py b/sync-for-payables/src/codatsyncpayables/models/shared/createbillcreditnoteresponse.py new file mode 100755 index 000000000..3ccd2a10b --- /dev/null +++ b/sync-for-payables/src/codatsyncpayables/models/shared/createbillcreditnoteresponse.py @@ -0,0 +1,100 @@ +"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" + +from __future__ import annotations +import dataclasses +from ..shared import billcreditnote as shared_billcreditnote +from ..shared import datatype as shared_datatype +from ..shared import pushoperationchange as shared_pushoperationchange +from ..shared import pushoperationstatus as shared_pushoperationstatus +from ..shared import validation as shared_validation +from codatsyncpayables import utils +from dataclasses_json import Undefined, dataclass_json +from typing import Optional + + +@dataclass_json(undefined=Undefined.EXCLUDE) + +@dataclasses.dataclass +class CreateBillCreditNoteResponse: + r"""Success""" + company_id: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('companyId') }}) + r"""Unique identifier for your SMB in Codat.""" + data_connection_key: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('dataConnectionKey') }}) + r"""Unique identifier for a company's data connection.""" + push_operation_key: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('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: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('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: shared_pushoperationstatus.PushOperationStatus = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('status') }}) + r"""The status of the push operation.""" + status_code: int = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('statusCode') }}) + changes: Optional[list[shared_pushoperationchange.PushOperationChange]] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('changes'), 'exclude': lambda f: f is None }}) + r"""Contains a single entry that communicates which record has changed and the manner in which it changed.""" + completed_on_utc: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('completedOnUtc'), '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. + """ + data: Optional[shared_billcreditnote.BillCreditNote] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('data'), 'exclude': lambda f: f is None }}) + 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/accounting-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/accounting-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/accounting-api#/schemas/Bill). + * The supplier that issued the bill credit note. + """ + data_type: Optional[shared_datatype.DataType] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('dataType'), 'exclude': lambda f: f is None }}) + r"""Available Data types""" + error_message: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('errorMessage'), 'exclude': lambda f: f is None }}) + timeout_in_minutes: Optional[int] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('timeoutInMinutes'), 'exclude': lambda f: f is None }}) + timeout_in_seconds: Optional[int] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('timeoutInSeconds'), 'exclude': lambda f: f is None }}) + r"""Deprecated field: This will be removed in a future release, please migrate away from it as soon as possible.""" + validation: Optional[shared_validation.Validation] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('validation'), 'exclude': lambda f: f is 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.""" + + diff --git a/sync-for-payables/src/codatsyncpayables/models/shared/createbillpaymentresponse.py b/sync-for-payables/src/codatsyncpayables/models/shared/createbillpaymentresponse.py new file mode 100755 index 000000000..be8999169 --- /dev/null +++ b/sync-for-payables/src/codatsyncpayables/models/shared/createbillpaymentresponse.py @@ -0,0 +1,234 @@ +"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" + +from __future__ import annotations +import dataclasses +from ..shared import billpayment as shared_billpayment +from ..shared import datatype as shared_datatype +from ..shared import pushoperationchange as shared_pushoperationchange +from ..shared import pushoperationstatus as shared_pushoperationstatus +from ..shared import validation as shared_validation +from codatsyncpayables import utils +from dataclasses_json import Undefined, dataclass_json +from typing import Optional + + +@dataclass_json(undefined=Undefined.EXCLUDE) + +@dataclasses.dataclass +class CreateBillPaymentResponse: + r"""Success""" + company_id: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('companyId') }}) + r"""Unique identifier for your SMB in Codat.""" + data_connection_key: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('dataConnectionKey') }}) + r"""Unique identifier for a company's data connection.""" + push_operation_key: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('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: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('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: shared_pushoperationstatus.PushOperationStatus = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('status') }}) + r"""The status of the push operation.""" + status_code: int = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('statusCode') }}) + changes: Optional[list[shared_pushoperationchange.PushOperationChange]] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('changes'), 'exclude': lambda f: f is None }}) + r"""Contains a single entry that communicates which record has changed and the manner in which it changed.""" + completed_on_utc: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('completedOnUtc'), '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. + """ + data: Optional[shared_billpayment.BillPayment] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('data'), 'exclude': lambda f: f is None }}) + 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/accounting-api#/schemas/Payment) for the accounts receivable equivalent of Bill payments, which covers [invoices](https://docs.codat.io/accounting-api#/schemas/Invoice) and [credit notes](https://docs.codat.io/accounting-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/accounting-api#/schemas/Bill) and [credit notes against bills](https://docs.codat.io/accounting-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 package, 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 platforms 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/accounting-api#/schemas/DirectCost) data model. + + Bill payments is a child data type of [account transactions](https://docs.codat.io/accounting-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 packages 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. + """ + data_type: Optional[shared_datatype.DataType] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('dataType'), 'exclude': lambda f: f is None }}) + r"""Available Data types""" + error_message: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('errorMessage'), 'exclude': lambda f: f is None }}) + timeout_in_minutes: Optional[int] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('timeoutInMinutes'), 'exclude': lambda f: f is None }}) + timeout_in_seconds: Optional[int] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('timeoutInSeconds'), 'exclude': lambda f: f is None }}) + r"""Deprecated field: This will be removed in a future release, please migrate away from it as soon as possible.""" + validation: Optional[shared_validation.Validation] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('validation'), 'exclude': lambda f: f is 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.""" + + diff --git a/sync-for-payables/src/codatsyncpayables/models/shared/createbillresponse.py b/sync-for-payables/src/codatsyncpayables/models/shared/createbillresponse.py new file mode 100755 index 000000000..23f1ef2e5 --- /dev/null +++ b/sync-for-payables/src/codatsyncpayables/models/shared/createbillresponse.py @@ -0,0 +1,103 @@ +"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" + +from __future__ import annotations +import dataclasses +from ..shared import bill as shared_bill +from ..shared import datatype as shared_datatype +from ..shared import pushoperationchange as shared_pushoperationchange +from ..shared import pushoperationstatus as shared_pushoperationstatus +from ..shared import validation as shared_validation +from codatsyncpayables import utils +from dataclasses_json import Undefined, dataclass_json +from typing import Optional + + +@dataclass_json(undefined=Undefined.EXCLUDE) + +@dataclasses.dataclass +class CreateBillResponse: + r"""Success""" + company_id: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('companyId') }}) + r"""Unique identifier for your SMB in Codat.""" + data_connection_key: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('dataConnectionKey') }}) + r"""Unique identifier for a company's data connection.""" + push_operation_key: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('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: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('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: shared_pushoperationstatus.PushOperationStatus = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('status') }}) + r"""The status of the push operation.""" + status_code: int = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('statusCode') }}) + changes: Optional[list[shared_pushoperationchange.PushOperationChange]] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('changes'), 'exclude': lambda f: f is None }}) + r"""Contains a single entry that communicates which record has changed and the manner in which it changed.""" + completed_on_utc: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('completedOnUtc'), '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. + """ + data: Optional[shared_bill.Bill] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('data'), 'exclude': lambda f: f is None }}) + 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/accounting-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 platforms 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/accounting-api#/schemas/DirectCost) data model. + """ + data_type: Optional[shared_datatype.DataType] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('dataType'), 'exclude': lambda f: f is None }}) + r"""Available Data types""" + error_message: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('errorMessage'), 'exclude': lambda f: f is None }}) + timeout_in_minutes: Optional[int] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('timeoutInMinutes'), 'exclude': lambda f: f is None }}) + timeout_in_seconds: Optional[int] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('timeoutInSeconds'), 'exclude': lambda f: f is None }}) + r"""Deprecated field: This will be removed in a future release, please migrate away from it as soon as possible.""" + validation: Optional[shared_validation.Validation] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('validation'), 'exclude': lambda f: f is 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.""" + + diff --git a/sync-for-payables/src/codatsyncpayables/models/shared/createjournalentryresponse.py b/sync-for-payables/src/codatsyncpayables/models/shared/createjournalentryresponse.py new file mode 100755 index 000000000..b70b6027f --- /dev/null +++ b/sync-for-payables/src/codatsyncpayables/models/shared/createjournalentryresponse.py @@ -0,0 +1,106 @@ +"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" + +from __future__ import annotations +import dataclasses +from ..shared import datatype as shared_datatype +from ..shared import journalentry as shared_journalentry +from ..shared import pushoperationchange as shared_pushoperationchange +from ..shared import pushoperationstatus as shared_pushoperationstatus +from ..shared import validation as shared_validation +from codatsyncpayables import utils +from dataclasses_json import Undefined, dataclass_json +from typing import Optional + + +@dataclass_json(undefined=Undefined.EXCLUDE) + +@dataclasses.dataclass +class CreateJournalEntryResponse: + r"""Success""" + company_id: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('companyId') }}) + r"""Unique identifier for your SMB in Codat.""" + data_connection_key: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('dataConnectionKey') }}) + r"""Unique identifier for a company's data connection.""" + push_operation_key: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('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: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('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: shared_pushoperationstatus.PushOperationStatus = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('status') }}) + r"""The status of the push operation.""" + status_code: int = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('statusCode') }}) + changes: Optional[list[shared_pushoperationchange.PushOperationChange]] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('changes'), 'exclude': lambda f: f is None }}) + r"""Contains a single entry that communicates which record has changed and the manner in which it changed.""" + completed_on_utc: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('completedOnUtc'), '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. + """ + data: Optional[shared_journalentry.JournalEntry] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('data'), 'exclude': lambda f: f is None }}) + r"""> **Language tip:** For the top-level record of a company's financial transactions, refer to the [Journals](https://docs.codat.io/accounting-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/accounting-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. + """ + data_type: Optional[shared_datatype.DataType] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('dataType'), 'exclude': lambda f: f is None }}) + r"""Available Data types""" + error_message: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('errorMessage'), 'exclude': lambda f: f is None }}) + timeout_in_minutes: Optional[int] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('timeoutInMinutes'), 'exclude': lambda f: f is None }}) + timeout_in_seconds: Optional[int] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('timeoutInSeconds'), 'exclude': lambda f: f is None }}) + r"""Deprecated field: This will be removed in a future release, please migrate away from it as soon as possible.""" + validation: Optional[shared_validation.Validation] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('validation'), 'exclude': lambda f: f is 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.""" + + diff --git a/sync-for-payables/src/codatsyncpayables/models/shared/createjournalresponse.py b/sync-for-payables/src/codatsyncpayables/models/shared/createjournalresponse.py new file mode 100755 index 000000000..b88a56d81 --- /dev/null +++ b/sync-for-payables/src/codatsyncpayables/models/shared/createjournalresponse.py @@ -0,0 +1,106 @@ +"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" + +from __future__ import annotations +import dataclasses +from ..shared import datatype as shared_datatype +from ..shared import journal as shared_journal +from ..shared import pushoperationchange as shared_pushoperationchange +from ..shared import pushoperationstatus as shared_pushoperationstatus +from ..shared import validation as shared_validation +from codatsyncpayables import utils +from dataclasses_json import Undefined, dataclass_json +from typing import Optional + + +@dataclass_json(undefined=Undefined.EXCLUDE) + +@dataclasses.dataclass +class CreateJournalResponse: + r"""Success""" + company_id: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('companyId') }}) + r"""Unique identifier for your SMB in Codat.""" + data_connection_key: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('dataConnectionKey') }}) + r"""Unique identifier for a company's data connection.""" + push_operation_key: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('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: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('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: shared_pushoperationstatus.PushOperationStatus = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('status') }}) + r"""The status of the push operation.""" + status_code: int = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('statusCode') }}) + changes: Optional[list[shared_pushoperationchange.PushOperationChange]] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('changes'), 'exclude': lambda f: f is None }}) + r"""Contains a single entry that communicates which record has changed and the manner in which it changed.""" + completed_on_utc: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('completedOnUtc'), '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. + """ + data: Optional[shared_journal.Journal] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('data'), 'exclude': lambda f: f is None }}) + r"""> **Language tip:** For line items, or individual transactions, of a company's financial documents, refer to the [Journal entries](https://docs.codat.io/accounting-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/accounting-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 platform 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. + """ + data_type: Optional[shared_datatype.DataType] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('dataType'), 'exclude': lambda f: f is None }}) + r"""Available Data types""" + error_message: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('errorMessage'), 'exclude': lambda f: f is None }}) + timeout_in_minutes: Optional[int] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('timeoutInMinutes'), 'exclude': lambda f: f is None }}) + timeout_in_seconds: Optional[int] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('timeoutInSeconds'), 'exclude': lambda f: f is None }}) + r"""Deprecated field: This will be removed in a future release, please migrate away from it as soon as possible.""" + validation: Optional[shared_validation.Validation] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('validation'), 'exclude': lambda f: f is 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.""" + + diff --git a/sync-for-payables/src/codatsyncpayables/models/shared/createsupplierresponse.py b/sync-for-payables/src/codatsyncpayables/models/shared/createsupplierresponse.py new file mode 100755 index 000000000..db1169210 --- /dev/null +++ b/sync-for-payables/src/codatsyncpayables/models/shared/createsupplierresponse.py @@ -0,0 +1,89 @@ +"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" + +from __future__ import annotations +import dataclasses +from ..shared import datatype as shared_datatype +from ..shared import pushoperationchange as shared_pushoperationchange +from ..shared import pushoperationstatus as shared_pushoperationstatus +from ..shared import supplier as shared_supplier +from ..shared import validation as shared_validation +from codatsyncpayables import utils +from dataclasses_json import Undefined, dataclass_json +from typing import Optional + + +@dataclass_json(undefined=Undefined.EXCLUDE) + +@dataclasses.dataclass +class CreateSupplierResponse: + r"""Success""" + company_id: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('companyId') }}) + r"""Unique identifier for your SMB in Codat.""" + data_connection_key: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('dataConnectionKey') }}) + r"""Unique identifier for a company's data connection.""" + push_operation_key: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('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: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('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: shared_pushoperationstatus.PushOperationStatus = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('status') }}) + r"""The status of the push operation.""" + status_code: int = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('statusCode') }}) + changes: Optional[list[shared_pushoperationchange.PushOperationChange]] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('changes'), 'exclude': lambda f: f is None }}) + r"""Contains a single entry that communicates which record has changed and the manner in which it changed.""" + completed_on_utc: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('completedOnUtc'), '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. + """ + data: Optional[shared_supplier.Supplier] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('data'), 'exclude': lambda f: f is None }}) + 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/accounting-api#/operations/list-suppliers). Suppliers' data links to accounts payable [bills](https://docs.codat.io/accounting-api#/schemas/Bill). + """ + data_type: Optional[shared_datatype.DataType] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('dataType'), 'exclude': lambda f: f is None }}) + r"""Available Data types""" + error_message: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('errorMessage'), 'exclude': lambda f: f is None }}) + timeout_in_minutes: Optional[int] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('timeoutInMinutes'), 'exclude': lambda f: f is None }}) + timeout_in_seconds: Optional[int] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('timeoutInSeconds'), 'exclude': lambda f: f is None }}) + r"""Deprecated field: This will be removed in a future release, please migrate away from it as soon as possible.""" + validation: Optional[shared_validation.Validation] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('validation'), 'exclude': lambda f: f is 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.""" + + diff --git a/sync-for-payables/src/codatsyncpayables/models/shared/dataconnectionerror.py b/sync-for-payables/src/codatsyncpayables/models/shared/dataconnectionerror.py new file mode 100755 index 000000000..5d07dcc66 --- /dev/null +++ b/sync-for-payables/src/codatsyncpayables/models/shared/dataconnectionerror.py @@ -0,0 +1,39 @@ +"""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: + 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. + """ + error_message: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('errorMessage'), 'exclude': lambda f: f is None }}) + status_code: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('statusCode'), 'exclude': lambda f: f is None }}) + status_text: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('statusText'), 'exclude': lambda f: f is None }}) + + diff --git a/sync-for-payables/src/codatsyncpayables/models/shared/dataconnectionstatus.py b/sync-for-payables/src/codatsyncpayables/models/shared/dataconnectionstatus.py new file mode 100755 index 000000000..377013d42 --- /dev/null +++ b/sync-for-payables/src/codatsyncpayables/models/shared/dataconnectionstatus.py @@ -0,0 +1,11 @@ +"""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/sync-for-payables/src/codatsyncpayables/models/shared/datastatus.py b/sync-for-payables/src/codatsyncpayables/models/shared/datastatus.py new file mode 100755 index 000000000..0758720c6 --- /dev/null +++ b/sync-for-payables/src/codatsyncpayables/models/shared/datastatus.py @@ -0,0 +1,41 @@ +"""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 DataStatus: + r"""Describes the state of data in the Codat cache for a company and data type""" + current_status: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('currentStatus') }}) + data_type: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('dataType') }}) + last_successful_sync: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('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: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('latestSuccessfulSyncId'), 'exclude': lambda f: f is None }}) + latest_sync_id: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('latestSyncId'), 'exclude': lambda f: f is None }}) + + diff --git a/sync-for-payables/src/codatsyncpayables/models/shared/datatype.py b/sync-for-payables/src/codatsyncpayables/models/shared/datatype.py new file mode 100755 index 000000000..ea726125d --- /dev/null +++ b/sync-for-payables/src/codatsyncpayables/models/shared/datatype.py @@ -0,0 +1,49 @@ +"""Code generated by Speakeasy (https://speakeasyapi.dev). 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' + 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/sync-for-payables/src/codatsyncpayables/models/shared/errormessage.py b/sync-for-payables/src/codatsyncpayables/models/shared/errormessage.py new file mode 100755 index 000000000..5537eef90 --- /dev/null +++ b/sync-for-payables/src/codatsyncpayables/models/shared/errormessage.py @@ -0,0 +1,22 @@ +"""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 ErrorMessage: + r"""Your `query` parameter was not correctly formed""" + 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 }}) + correlation_id: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('correlationId'), 'exclude': lambda f: f is None }}) + 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 }}) + error: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('error'), 'exclude': lambda f: f is None }}) + service: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('service'), 'exclude': lambda f: f is None }}) + status_code: Optional[int] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('statusCode'), 'exclude': lambda f: f is None }}) + + diff --git a/sync-for-payables/src/codatsyncpayables/models/shared/halref.py b/sync-for-payables/src/codatsyncpayables/models/shared/halref.py new file mode 100755 index 000000000..fd9494e8f --- /dev/null +++ b/sync-for-payables/src/codatsyncpayables/models/shared/halref.py @@ -0,0 +1,16 @@ +"""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 }}) + + diff --git a/sync-for-payables/src/codatsyncpayables/models/shared/itemref.py b/sync-for-payables/src/codatsyncpayables/models/shared/itemref.py new file mode 100755 index 000000000..972ea12ad --- /dev/null +++ b/sync-for-payables/src/codatsyncpayables/models/shared/itemref.py @@ -0,0 +1,20 @@ +"""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 ItemRef: + r"""Reference to the item the line is linked to.""" + id: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('id') }}) + r"""Unique identifier for the item 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 item in the accounting platform.""" + + diff --git a/sync-for-payables/src/codatsyncpayables/models/shared/items.py b/sync-for-payables/src/codatsyncpayables/models/shared/items.py new file mode 100755 index 000000000..df4daf50d --- /dev/null +++ b/sync-for-payables/src/codatsyncpayables/models/shared/items.py @@ -0,0 +1,85 @@ +"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" + +from __future__ import annotations +import dataclasses +from ..shared import paymentallocationpayment as shared_paymentallocationpayment +from codatsyncpayables import utils +from dataclasses_json import Undefined, dataclass_json +from typing import Optional + + +@dataclass_json(undefined=Undefined.EXCLUDE) + +@dataclasses.dataclass +class ItemsAllocation: + allocated_on_date: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('allocatedOnDate'), '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. + """ + 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. + """ + currency_rate: Optional[float] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('currencyRate'), 'exclude': lambda f: f is None }}) + 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 platform, it will be available from Codat with the same precision (up to a maximum of 9 decimal places). + + For accounting platforms 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 | + """ + total_amount: Optional[float] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('totalAmount'), 'exclude': lambda f: f is None }}) + r"""The total amount that has been allocated.""" + + + + +@dataclass_json(undefined=Undefined.EXCLUDE) + +@dataclasses.dataclass +class Items: + allocation: ItemsAllocation = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('allocation') }}) + payment: shared_paymentallocationpayment.PaymentAllocationPayment = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('payment') }}) + + diff --git a/sync-for-payables/src/codatsyncpayables/models/shared/journal.py b/sync-for-payables/src/codatsyncpayables/models/shared/journal.py new file mode 100755 index 000000000..07af4e1fa --- /dev/null +++ b/sync-for-payables/src/codatsyncpayables/models/shared/journal.py @@ -0,0 +1,82 @@ +"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" + +from __future__ import annotations +import dataclasses +from ..shared import journalstatus as shared_journalstatus +from ..shared import metadata as shared_metadata +from codatsyncpayables import utils +from dataclasses_json import Undefined, dataclass_json +from typing import Optional + + +@dataclass_json(undefined=Undefined.EXCLUDE) + +@dataclasses.dataclass +class Journal: + r"""> **Language tip:** For line items, or individual transactions, of a company's financial documents, refer to the [Journal entries](https://docs.codat.io/accounting-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/accounting-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 platform 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: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('createdOn'), '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. + """ + has_children: Optional[bool] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('hasChildren'), 'exclude': lambda f: f is None }}) + r"""If the journal has child journals, this value is true. If it doesn’t, it is false.""" + id: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('id'), 'exclude': lambda f: f is None }}) + r"""Journal ID.""" + journal_code: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('journalCode'), 'exclude': lambda f: f is None }}) + r"""Native journal number or code.""" + metadata: Optional[shared_metadata.Metadata] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('metadata'), 'exclude': lambda f: f is None }}) + modified_date: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('modifiedDate'), 'exclude': lambda f: f is None }}) + name: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('name'), 'exclude': lambda f: f is None }}) + r"""Journal name. + The maximum length for a journal name is 256 characters. All characters above that number will be truncated. + """ + parent_id: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('parentId'), 'exclude': lambda f: f is None }}) + r"""Parent journal ID. + If the journal is a parent journal, this value is not present. + """ + 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[shared_journalstatus.JournalStatus] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('status'), 'exclude': lambda f: f is None }}) + r"""Current journal status.""" + type: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('type'), 'exclude': lambda f: f is None }}) + r"""The type of the journal.""" + + diff --git a/sync-for-payables/src/codatsyncpayables/models/shared/journalentry.py b/sync-for-payables/src/codatsyncpayables/models/shared/journalentry.py new file mode 100755 index 000000000..374750554 --- /dev/null +++ b/sync-for-payables/src/codatsyncpayables/models/shared/journalentry.py @@ -0,0 +1,142 @@ +"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" + +from __future__ import annotations +import dataclasses +from ..shared import journalline as shared_journalline +from ..shared import journalref as shared_journalref +from ..shared import metadata as shared_metadata +from ..shared import supplementaldata as shared_supplementaldata +from codatsyncpayables import utils +from dataclasses_json import Undefined, dataclass_json +from typing import Optional + + +@dataclass_json(undefined=Undefined.EXCLUDE) + +@dataclasses.dataclass +class JournalEntryRecordReference: + 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: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('dataType'), 'exclude': lambda f: f is None }}) + r"""Allowed name of the 'dataType'.""" + 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' of the underlying record or data type.""" + + + + +@dataclass_json(undefined=Undefined.EXCLUDE) + +@dataclasses.dataclass +class JournalEntry: + r"""> **Language tip:** For the top-level record of a company's financial transactions, refer to the [Journals](https://docs.codat.io/accounting-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/accounting-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: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('createdOn'), '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. + """ + description: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('description'), 'exclude': lambda f: f is None }}) + r"""Optional description of the journal entry.""" + 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 journal entry for the company in the accounting platform.""" + journal_lines: Optional[list[shared_journalline.JournalLine]] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('journalLines'), 'exclude': lambda f: f is None }}) + r"""An array of journal lines.""" + journal_ref: Optional[shared_journalref.JournalRef] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('journalRef'), 'exclude': lambda f: f is None }}) + r"""Links journal entries to the relevant journal in accounting integrations that use multi-book accounting (multiple journals).""" + metadata: Optional[shared_metadata.Metadata] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('metadata'), 'exclude': lambda f: f is None }}) + modified_date: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('modifiedDate'), 'exclude': lambda f: f is None }}) + posted_on: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('postedOn'), '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. + """ + record_ref: Optional[JournalEntryRecordReference] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('recordRef'), 'exclude': lambda f: f is None }}) + 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. + """ + 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 }}) + supplemental_data: Optional[shared_supplementaldata.SupplementalData] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('supplementalData'), 'exclude': lambda f: f is 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 platform. [Learn more](https://docs.codat.io/using-the-api/additional-data) about supplemental data. + """ + updated_on: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('updatedOn'), '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/sync-for-payables/src/codatsyncpayables/models/shared/journalline.py b/sync-for-payables/src/codatsyncpayables/models/shared/journalline.py new file mode 100755 index 000000000..01ca97bf4 --- /dev/null +++ b/sync-for-payables/src/codatsyncpayables/models/shared/journalline.py @@ -0,0 +1,37 @@ +"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" + +from __future__ import annotations +import dataclasses +from ..shared import accountref as shared_accountref +from ..shared import recordref as shared_recordref +from codatsyncpayables import utils +from dataclasses_json import Undefined, dataclass_json +from typing import Optional + + +@dataclass_json(undefined=Undefined.EXCLUDE) + +@dataclasses.dataclass +class JournalLineTracking: + r"""List of record refs associated with the tracking information for the line (eg to a Tracking Category, or customer etc.)""" + record_refs: Optional[list[shared_recordref.RecordRef]] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('recordRefs'), 'exclude': lambda f: f is None }}) + + + + +@dataclass_json(undefined=Undefined.EXCLUDE) + +@dataclasses.dataclass +class JournalLine: + net_amount: float = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('netAmount') }}) + r"""Amount for the journal line. Debit entries are considered positive, and credit entries are considered negative.""" + account_ref: Optional[shared_accountref.AccountRef] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('accountRef'), 'exclude': lambda f: f is 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] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('currency'), 'exclude': lambda f: f is None }}) + r"""Currency for the journal line item.""" + description: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('description'), 'exclude': lambda f: f is None }}) + r"""Description of the journal line item.""" + tracking: Optional[JournalLineTracking] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('tracking'), 'exclude': lambda f: f is None }}) + r"""List of record refs associated with the tracking information for the line (eg to a Tracking Category, or customer etc.)""" + + diff --git a/sync-for-payables/src/codatsyncpayables/models/shared/journalref.py b/sync-for-payables/src/codatsyncpayables/models/shared/journalref.py new file mode 100755 index 000000000..2398e97b5 --- /dev/null +++ b/sync-for-payables/src/codatsyncpayables/models/shared/journalref.py @@ -0,0 +1,20 @@ +"""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 JournalRef: + r"""Links journal entries to the relevant journal in accounting integrations that use multi-book accounting (multiple journals).""" + id: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('id') }}) + r"""GUID of the underlying journal.""" + 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 journal""" + + diff --git a/sync-for-payables/src/codatsyncpayables/models/shared/journals.py b/sync-for-payables/src/codatsyncpayables/models/shared/journals.py new file mode 100755 index 000000000..a4a81f5af --- /dev/null +++ b/sync-for-payables/src/codatsyncpayables/models/shared/journals.py @@ -0,0 +1,23 @@ +"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" + +from __future__ import annotations +import dataclasses +from ..shared import journal as shared_journal +from ..shared import links as shared_links +from codatsyncpayables import utils +from dataclasses_json import Undefined, dataclass_json +from typing import Optional + + +@dataclass_json(undefined=Undefined.EXCLUDE) + +@dataclasses.dataclass +class Journals: + r"""Success""" + links: shared_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') }}) + page_size: int = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('pageSize') }}) + total_results: int = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('totalResults') }}) + results: Optional[list[shared_journal.Journal]] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('results'), 'exclude': lambda f: f is None }}) + + diff --git a/sync-for-payables/src/codatsyncpayables/models/shared/journalstatus.py b/sync-for-payables/src/codatsyncpayables/models/shared/journalstatus.py new file mode 100755 index 000000000..6fbb69944 --- /dev/null +++ b/sync-for-payables/src/codatsyncpayables/models/shared/journalstatus.py @@ -0,0 +1,10 @@ +"""Code generated by Speakeasy (https://speakeasyapi.dev). 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/sync-for-payables/src/codatsyncpayables/models/shared/links.py b/sync-for-payables/src/codatsyncpayables/models/shared/links.py new file mode 100755 index 000000000..27270d1d7 --- /dev/null +++ b/sync-for-payables/src/codatsyncpayables/models/shared/links.py @@ -0,0 +1,20 @@ +"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" + +from __future__ import annotations +import dataclasses +from ..shared import halref as shared_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: shared_halref.HalRef = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('current') }}) + self_: shared_halref.HalRef = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('self') }}) + next: Optional[shared_halref.HalRef] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('next'), 'exclude': lambda f: f is None }}) + previous: Optional[shared_halref.HalRef] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('previous'), 'exclude': lambda f: f is None }}) + + diff --git a/sync-for-payables/src/codatsyncpayables/models/shared/metadata.py b/sync-for-payables/src/codatsyncpayables/models/shared/metadata.py new file mode 100755 index 000000000..987a5a266 --- /dev/null +++ b/sync-for-payables/src/codatsyncpayables/models/shared/metadata.py @@ -0,0 +1,17 @@ +"""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 Metadata: + is_deleted: Optional[bool] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('isDeleted'), 'exclude': lambda f: f is None }}) + r"""Indicates whether the record has been deleted in the third-party system this record originated from.""" + + diff --git a/sync-for-payables/src/codatsyncpayables/models/shared/paymentallocationpayment.py b/sync-for-payables/src/codatsyncpayables/models/shared/paymentallocationpayment.py new file mode 100755 index 000000000..48e50bbdc --- /dev/null +++ b/sync-for-payables/src/codatsyncpayables/models/shared/paymentallocationpayment.py @@ -0,0 +1,83 @@ +"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" + +from __future__ import annotations +import dataclasses +from ..shared import accountref as shared_accountref +from codatsyncpayables import utils +from dataclasses_json import Undefined, dataclass_json +from typing import Optional + + +@dataclass_json(undefined=Undefined.EXCLUDE) + +@dataclasses.dataclass +class PaymentAllocationPayment: + account_ref: Optional[shared_accountref.AccountRef] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('accountRef'), 'exclude': lambda f: f is 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] = 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. + """ + currency_rate: Optional[float] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('currencyRate'), 'exclude': lambda f: f is None }}) + 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 platform, it will be available from Codat with the same precision (up to a maximum of 9 decimal places). + + For accounting platforms 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 | + """ + 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 of the allocated payment.""" + note: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('note'), 'exclude': lambda f: f is None }}) + r"""Notes attached to the allocated payment.""" + paid_on_date: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('paidOnDate'), '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. + """ + reference: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('reference'), 'exclude': lambda f: f is None }}) + r"""Reference to the allocated payment.""" + total_amount: Optional[float] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('totalAmount'), 'exclude': lambda f: f is None }}) + r"""Total amount that was paid.""" + + diff --git a/sync-for-payables/src/codatsyncpayables/models/shared/paymentmethod.py b/sync-for-payables/src/codatsyncpayables/models/shared/paymentmethod.py new file mode 100755 index 000000000..62801d03f --- /dev/null +++ b/sync-for-payables/src/codatsyncpayables/models/shared/paymentmethod.py @@ -0,0 +1,35 @@ +"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" + +from __future__ import annotations +import dataclasses +from ..shared import metadata as shared_metadata +from ..shared import paymentmethodstatus as shared_paymentmethodstatus +from ..shared import paymentmethodtype as shared_paymentmethodtype +from codatsyncpayables import utils +from dataclasses_json import Undefined, dataclass_json +from typing import Optional + + +@dataclass_json(undefined=Undefined.EXCLUDE) + +@dataclasses.dataclass +class PaymentMethod: + 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/accounting-api#/schemas/BillPayment) and [Payments](https://docs.codat.io/accounting-api#/schemas/Payment). + """ + 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 payment method.""" + metadata: Optional[shared_metadata.Metadata] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('metadata'), 'exclude': lambda f: f is None }}) + modified_date: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('modifiedDate'), 'exclude': lambda f: f is None }}) + 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 payment method.""" + 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[shared_paymentmethodstatus.PaymentMethodStatus] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('status'), 'exclude': lambda f: f is None }}) + r"""Status of the Payment Method.""" + type: Optional[shared_paymentmethodtype.PaymentMethodType] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('type'), 'exclude': lambda f: f is None }}) + r"""Method of payment.""" + + diff --git a/sync-for-payables/src/codatsyncpayables/models/shared/paymentmethods.py b/sync-for-payables/src/codatsyncpayables/models/shared/paymentmethods.py new file mode 100755 index 000000000..09dc2e3c4 --- /dev/null +++ b/sync-for-payables/src/codatsyncpayables/models/shared/paymentmethods.py @@ -0,0 +1,23 @@ +"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" + +from __future__ import annotations +import dataclasses +from ..shared import links as shared_links +from ..shared import paymentmethod as shared_paymentmethod +from codatsyncpayables import utils +from dataclasses_json import Undefined, dataclass_json +from typing import Optional + + +@dataclass_json(undefined=Undefined.EXCLUDE) + +@dataclasses.dataclass +class PaymentMethods: + r"""Success""" + links: shared_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') }}) + page_size: int = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('pageSize') }}) + total_results: int = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('totalResults') }}) + results: Optional[list[shared_paymentmethod.PaymentMethod]] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('results'), 'exclude': lambda f: f is None }}) + + diff --git a/sync-for-payables/src/codatsyncpayables/models/shared/paymentmethodstatus.py b/sync-for-payables/src/codatsyncpayables/models/shared/paymentmethodstatus.py new file mode 100755 index 000000000..3c7429158 --- /dev/null +++ b/sync-for-payables/src/codatsyncpayables/models/shared/paymentmethodstatus.py @@ -0,0 +1,10 @@ +"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" + +from __future__ import annotations +from enum import Enum + +class PaymentMethodStatus(str, Enum): + r"""Status of the Payment Method.""" + UNKNOWN = 'Unknown' + ACTIVE = 'Active' + ARCHIVED = 'Archived' diff --git a/sync-for-payables/src/codatsyncpayables/models/shared/paymentmethodtype.py b/sync-for-payables/src/codatsyncpayables/models/shared/paymentmethodtype.py new file mode 100755 index 000000000..21b69b9ad --- /dev/null +++ b/sync-for-payables/src/codatsyncpayables/models/shared/paymentmethodtype.py @@ -0,0 +1,14 @@ +"""Code generated by Speakeasy (https://speakeasyapi.dev). 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/sync-for-payables/src/codatsyncpayables/models/shared/pulloperation.py b/sync-for-payables/src/codatsyncpayables/models/shared/pulloperation.py new file mode 100755 index 000000000..69f3c4f7b --- /dev/null +++ b/sync-for-payables/src/codatsyncpayables/models/shared/pulloperation.py @@ -0,0 +1,72 @@ +"""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 enum import Enum + +class PullOperationStatus(str, Enum): + 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' + ROUTING = 'Routing' + ROUTING_ERROR = 'RoutingError' + NOT_SUPPORTED = 'NotSupported' + RATE_LIMIT_ERROR = 'RateLimitError' + PERMISSIONS_ERROR = 'PermissionsError' + PREREQUISITE_NOT_MET = 'PrerequisiteNotMet' + + +@dataclass_json(undefined=Undefined.EXCLUDE) + +@dataclasses.dataclass +class PullOperation: + r"""Information about a queued, in progress or completed pull operation. + *Formally called `dataset`* + """ + company_id: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('companyId') }}) + connection_id: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('connectionId') }}) + data_type: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('dataType') }}) + id: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('id') }}) + is_completed: bool = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('isCompleted') }}) + is_errored: bool = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('isErrored') }}) + progress: int = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('progress') }}) + requested: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('requested') }}) + 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: PullOperationStatus = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('status') }}) + + diff --git a/sync-for-payables/src/codatsyncpayables/models/shared/pulloperations.py b/sync-for-payables/src/codatsyncpayables/models/shared/pulloperations.py new file mode 100755 index 000000000..4e44506dc --- /dev/null +++ b/sync-for-payables/src/codatsyncpayables/models/shared/pulloperations.py @@ -0,0 +1,23 @@ +"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" + +from __future__ import annotations +import dataclasses +from ..shared import links as shared_links +from ..shared import pulloperation as shared_pulloperation +from codatsyncpayables import utils +from dataclasses_json import Undefined, dataclass_json +from typing import Optional + + +@dataclass_json(undefined=Undefined.EXCLUDE) + +@dataclasses.dataclass +class PullOperations: + r"""OK""" + links: shared_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') }}) + page_size: int = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('pageSize') }}) + total_results: int = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('totalResults') }}) + results: Optional[list[shared_pulloperation.PullOperation]] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('results'), 'exclude': lambda f: f is None }}) + + diff --git a/sync-for-payables/src/codatsyncpayables/models/shared/pushchangetype.py b/sync-for-payables/src/codatsyncpayables/models/shared/pushchangetype.py new file mode 100755 index 000000000..88e1a3ec7 --- /dev/null +++ b/sync-for-payables/src/codatsyncpayables/models/shared/pushchangetype.py @@ -0,0 +1,11 @@ +"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" + +from __future__ import annotations +from enum import Enum + +class PushChangeType(str, Enum): + UNKNOWN = 'Unknown' + CREATED = 'Created' + MODIFIED = 'Modified' + DELETED = 'Deleted' + ATTACHMENT_UPLOADED = 'AttachmentUploaded' diff --git a/sync-for-payables/src/codatsyncpayables/models/shared/pushfieldvalidation.py b/sync-for-payables/src/codatsyncpayables/models/shared/pushfieldvalidation.py new file mode 100755 index 000000000..c63aed826 --- /dev/null +++ b/sync-for-payables/src/codatsyncpayables/models/shared/pushfieldvalidation.py @@ -0,0 +1,18 @@ +"""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 PushFieldValidation: + details: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('details') }}) + field: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('field'), 'exclude': lambda f: f is None }}) + ref: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('ref'), 'exclude': lambda f: f is None }}) + + diff --git a/sync-for-payables/src/codatsyncpayables/models/shared/pushoperation.py b/sync-for-payables/src/codatsyncpayables/models/shared/pushoperation.py new file mode 100755 index 000000000..bcded6f5c --- /dev/null +++ b/sync-for-payables/src/codatsyncpayables/models/shared/pushoperation.py @@ -0,0 +1,81 @@ +"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" + +from __future__ import annotations +import dataclasses +from ..shared import datatype as shared_datatype +from ..shared import pushoperationchange as shared_pushoperationchange +from ..shared import pushoperationstatus as shared_pushoperationstatus +from ..shared import validation as shared_validation +from codatsyncpayables import utils +from dataclasses_json import Undefined, dataclass_json +from typing import Optional + + +@dataclass_json(undefined=Undefined.EXCLUDE) + +@dataclasses.dataclass +class PushOperation: + r"""OK""" + company_id: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('companyId') }}) + r"""Unique identifier for your SMB in Codat.""" + data_connection_key: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('dataConnectionKey') }}) + r"""Unique identifier for a company's data connection.""" + push_operation_key: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('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: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('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: shared_pushoperationstatus.PushOperationStatus = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('status') }}) + r"""The status of the push operation.""" + status_code: int = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('statusCode') }}) + changes: Optional[list[shared_pushoperationchange.PushOperationChange]] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('changes'), 'exclude': lambda f: f is None }}) + r"""Contains a single entry that communicates which record has changed and the manner in which it changed.""" + completed_on_utc: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('completedOnUtc'), '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. + """ + data_type: Optional[shared_datatype.DataType] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('dataType'), 'exclude': lambda f: f is None }}) + r"""Available Data types""" + error_message: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('errorMessage'), 'exclude': lambda f: f is None }}) + timeout_in_minutes: Optional[int] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('timeoutInMinutes'), 'exclude': lambda f: f is None }}) + timeout_in_seconds: Optional[int] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('timeoutInSeconds'), 'exclude': lambda f: f is None }}) + r"""Deprecated field: This will be removed in a future release, please migrate away from it as soon as possible.""" + validation: Optional[shared_validation.Validation] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('validation'), 'exclude': lambda f: f is 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.""" + + diff --git a/sync-for-payables/src/codatsyncpayables/models/shared/pushoperationchange.py b/sync-for-payables/src/codatsyncpayables/models/shared/pushoperationchange.py new file mode 100755 index 000000000..fde5bce8a --- /dev/null +++ b/sync-for-payables/src/codatsyncpayables/models/shared/pushoperationchange.py @@ -0,0 +1,20 @@ +"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" + +from __future__ import annotations +import dataclasses +from ..shared import pushchangetype as shared_pushchangetype +from ..shared import pushoperationref as shared_pushoperationref +from codatsyncpayables import utils +from dataclasses_json import Undefined, dataclass_json +from typing import Optional + + +@dataclass_json(undefined=Undefined.EXCLUDE) + +@dataclasses.dataclass +class PushOperationChange: + attachment_id: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('attachmentId'), 'exclude': lambda f: f is None }}) + record_ref: Optional[shared_pushoperationref.PushOperationRef] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('recordRef'), 'exclude': lambda f: f is None }}) + type: Optional[shared_pushchangetype.PushChangeType] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('type'), 'exclude': lambda f: f is None }}) + + diff --git a/sync-for-payables/src/codatsyncpayables/models/shared/pushoperationref.py b/sync-for-payables/src/codatsyncpayables/models/shared/pushoperationref.py new file mode 100755 index 000000000..3f6904a97 --- /dev/null +++ b/sync-for-payables/src/codatsyncpayables/models/shared/pushoperationref.py @@ -0,0 +1,19 @@ +"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" + +from __future__ import annotations +import dataclasses +from ..shared import datatype as shared_datatype +from codatsyncpayables import utils +from dataclasses_json import Undefined, dataclass_json +from typing import Optional + + +@dataclass_json(undefined=Undefined.EXCLUDE) + +@dataclasses.dataclass +class PushOperationRef: + data_type: Optional[shared_datatype.DataType] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('dataType'), 'exclude': lambda f: f is None }}) + r"""Available Data types""" + id: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('id'), 'exclude': lambda f: f is None }}) + + diff --git a/sync-for-payables/src/codatsyncpayables/models/shared/pushoperations.py b/sync-for-payables/src/codatsyncpayables/models/shared/pushoperations.py new file mode 100755 index 000000000..3400a1f9c --- /dev/null +++ b/sync-for-payables/src/codatsyncpayables/models/shared/pushoperations.py @@ -0,0 +1,23 @@ +"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" + +from __future__ import annotations +import dataclasses +from ..shared import links as shared_links +from ..shared import pushoperation as shared_pushoperation +from codatsyncpayables import utils +from dataclasses_json import Undefined, dataclass_json +from typing import Optional + + +@dataclass_json(undefined=Undefined.EXCLUDE) + +@dataclasses.dataclass +class PushOperations: + r"""OK""" + links: shared_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') }}) + page_size: int = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('pageSize') }}) + total_results: int = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('totalResults') }}) + results: Optional[list[shared_pushoperation.PushOperation]] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('results'), 'exclude': lambda f: f is None }}) + + diff --git a/sync-for-payables/src/codatsyncpayables/models/shared/pushoperationstatus.py b/sync-for-payables/src/codatsyncpayables/models/shared/pushoperationstatus.py new file mode 100755 index 000000000..fc391b0a2 --- /dev/null +++ b/sync-for-payables/src/codatsyncpayables/models/shared/pushoperationstatus.py @@ -0,0 +1,11 @@ +"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" + +from __future__ import annotations +from enum import Enum + +class PushOperationStatus(str, Enum): + r"""The status of the push operation.""" + PENDING = 'Pending' + FAILED = 'Failed' + SUCCESS = 'Success' + TIMED_OUT = 'TimedOut' diff --git a/sync-for-payables/src/codatsyncpayables/models/shared/pushoption.py b/sync-for-payables/src/codatsyncpayables/models/shared/pushoption.py new file mode 100755 index 000000000..22bf329eb --- /dev/null +++ b/sync-for-payables/src/codatsyncpayables/models/shared/pushoption.py @@ -0,0 +1,27 @@ +"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" + +from __future__ import annotations +import dataclasses +from ..shared import pushoptionchoice as shared_pushoptionchoice +from ..shared import pushoptionproperty as shared_pushoptionproperty +from ..shared import pushoptiontype as shared_pushoptiontype +from ..shared import pushvalidationinfo as shared_pushvalidationinfo +from codatsyncpayables import utils +from dataclasses_json import Undefined, dataclass_json +from typing import Optional + + +@dataclass_json(undefined=Undefined.EXCLUDE) + +@dataclasses.dataclass +class PushOption: + r"""OK""" + display_name: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('displayName') }}) + required: bool = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('required') }}) + type: shared_pushoptiontype.PushOptionType = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('type') }}) + description: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('description'), 'exclude': lambda f: f is None }}) + options: Optional[list[shared_pushoptionchoice.PushOptionChoice]] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('options'), 'exclude': lambda f: f is None }}) + properties: Optional[dict[str, shared_pushoptionproperty.PushOptionProperty]] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('properties'), 'exclude': lambda f: f is None }}) + validation: Optional[shared_pushvalidationinfo.PushValidationInfo] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('validation'), 'exclude': lambda f: f is None }}) + + diff --git a/sync-for-payables/src/codatsyncpayables/models/shared/pushoptionchoice.py b/sync-for-payables/src/codatsyncpayables/models/shared/pushoptionchoice.py new file mode 100755 index 000000000..94669647b --- /dev/null +++ b/sync-for-payables/src/codatsyncpayables/models/shared/pushoptionchoice.py @@ -0,0 +1,22 @@ +"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" + +from __future__ import annotations +import dataclasses +from ..shared import pushoptiontype as shared_pushoptiontype +from codatsyncpayables import utils +from dataclasses_json import Undefined, dataclass_json +from typing import Optional + + +@dataclass_json(undefined=Undefined.EXCLUDE) + +@dataclasses.dataclass +class PushOptionChoice: + description: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('description'), 'exclude': lambda f: f is None }}) + display_name: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('displayName'), 'exclude': lambda f: f is None }}) + required: Optional[bool] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('required'), 'exclude': lambda f: f is None }}) + type: Optional[shared_pushoptiontype.PushOptionType] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('type'), 'exclude': lambda f: f is None }}) + value: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('value'), 'exclude': lambda f: f is None }}) + r"""Allowed value for field.""" + + diff --git a/sync-for-payables/src/codatsyncpayables/models/shared/pushoptionproperty.py b/sync-for-payables/src/codatsyncpayables/models/shared/pushoptionproperty.py new file mode 100755 index 000000000..65cfe4f81 --- /dev/null +++ b/sync-for-payables/src/codatsyncpayables/models/shared/pushoptionproperty.py @@ -0,0 +1,25 @@ +"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" + +from __future__ import annotations +import dataclasses +from ..shared import pushoptionchoice as shared_pushoptionchoice +from ..shared import pushoptiontype as shared_pushoptiontype +from ..shared import pushvalidationinfo as shared_pushvalidationinfo +from codatsyncpayables import utils +from dataclasses_json import Undefined, dataclass_json +from typing import Optional + + +@dataclass_json(undefined=Undefined.EXCLUDE) + +@dataclasses.dataclass +class PushOptionProperty: + description: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('description') }}) + display_name: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('displayName') }}) + required: bool = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('required') }}) + type: shared_pushoptiontype.PushOptionType = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('type') }}) + options: Optional[list[shared_pushoptionchoice.PushOptionChoice]] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('options'), 'exclude': lambda f: f is None }}) + properties: Optional[dict[str, PushOptionProperty]] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('properties'), 'exclude': lambda f: f is None }}) + validation: Optional[shared_pushvalidationinfo.PushValidationInfo] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('validation'), 'exclude': lambda f: f is None }}) + + diff --git a/sync-for-payables/src/codatsyncpayables/models/shared/pushoptiontype.py b/sync-for-payables/src/codatsyncpayables/models/shared/pushoptiontype.py new file mode 100755 index 000000000..2de78dadf --- /dev/null +++ b/sync-for-payables/src/codatsyncpayables/models/shared/pushoptiontype.py @@ -0,0 +1,14 @@ +"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" + +from __future__ import annotations +from enum import Enum + +class PushOptionType(str, Enum): + ARRAY = 'Array' + OBJECT = 'Object' + STRING = 'String' + NUMBER = 'Number' + BOOLEAN = 'Boolean' + DATE_TIME = 'DateTime' + FILE = 'File' + MULTI_PART = 'MultiPart' diff --git a/sync-for-payables/src/codatsyncpayables/models/shared/pushvalidationinfo.py b/sync-for-payables/src/codatsyncpayables/models/shared/pushvalidationinfo.py new file mode 100755 index 000000000..6a62be586 --- /dev/null +++ b/sync-for-payables/src/codatsyncpayables/models/shared/pushvalidationinfo.py @@ -0,0 +1,18 @@ +"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" + +from __future__ import annotations +import dataclasses +from ..shared import pushfieldvalidation as shared_pushfieldvalidation +from codatsyncpayables import utils +from dataclasses_json import Undefined, dataclass_json +from typing import Optional + + +@dataclass_json(undefined=Undefined.EXCLUDE) + +@dataclasses.dataclass +class PushValidationInfo: + information: Optional[list[shared_pushfieldvalidation.PushFieldValidation]] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('information'), 'exclude': lambda f: f is None }}) + warnings: Optional[list[shared_pushfieldvalidation.PushFieldValidation]] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('warnings'), 'exclude': lambda f: f is None }}) + + diff --git a/sync-for-payables/src/codatsyncpayables/models/shared/recordref.py b/sync-for-payables/src/codatsyncpayables/models/shared/recordref.py new file mode 100755 index 000000000..7db847dc6 --- /dev/null +++ b/sync-for-payables/src/codatsyncpayables/models/shared/recordref.py @@ -0,0 +1,23 @@ +"""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 RecordRef: + 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: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('dataType'), 'exclude': lambda f: f is None }}) + r"""Allowed name of the 'dataType'.""" + 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' of the underlying record or data type.""" + + diff --git a/sync-for-payables/src/codatsyncpayables/models/shared/security.py b/sync-for-payables/src/codatsyncpayables/models/shared/security.py new file mode 100755 index 000000000..a72246378 --- /dev/null +++ b/sync-for-payables/src/codatsyncpayables/models/shared/security.py @@ -0,0 +1,12 @@ +"""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/sync-for-payables/src/codatsyncpayables/models/shared/status.py b/sync-for-payables/src/codatsyncpayables/models/shared/status.py new file mode 100755 index 000000000..664c2610c --- /dev/null +++ b/sync-for-payables/src/codatsyncpayables/models/shared/status.py @@ -0,0 +1,10 @@ +"""Code generated by Speakeasy (https://speakeasyapi.dev). 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/sync-for-payables/src/codatsyncpayables/models/shared/supplementaldata.py b/sync-for-payables/src/codatsyncpayables/models/shared/supplementaldata.py new file mode 100755 index 000000000..5aa6bb26f --- /dev/null +++ b/sync-for-payables/src/codatsyncpayables/models/shared/supplementaldata.py @@ -0,0 +1,20 @@ +"""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 Any, Optional + + +@dataclass_json(undefined=Undefined.EXCLUDE) + +@dataclasses.dataclass +class SupplementalData: + 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 platform. [Learn more](https://docs.codat.io/using-the-api/additional-data) about supplemental data. + """ + content: Optional[dict[str, dict[str, Any]]] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('content'), 'exclude': lambda f: f is None }}) + + diff --git a/sync-for-payables/src/codatsyncpayables/models/shared/supplier.py b/sync-for-payables/src/codatsyncpayables/models/shared/supplier.py new file mode 100755 index 000000000..cc56728ef --- /dev/null +++ b/sync-for-payables/src/codatsyncpayables/models/shared/supplier.py @@ -0,0 +1,75 @@ +"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" + +from __future__ import annotations +import dataclasses +from ..shared import accountingaddresstype as shared_accountingaddresstype +from ..shared import metadata as shared_metadata +from ..shared import supplementaldata as shared_supplementaldata +from ..shared import supplierstatus as shared_supplierstatus +from codatsyncpayables import utils +from dataclasses_json import Undefined, dataclass_json +from typing import Optional + + +@dataclass_json(undefined=Undefined.EXCLUDE) + +@dataclasses.dataclass +class SupplierAddresses: + type: shared_accountingaddresstype.AccountingAddressType = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('type') }}) + r"""The type of the address""" + city: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('city'), 'exclude': lambda f: f is None }}) + r"""City of the customer address.""" + country: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('country'), 'exclude': lambda f: f is None }}) + r"""Country of the customer address.""" + line1: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('line1'), 'exclude': lambda f: f is None }}) + r"""Line 1 of the customer address.""" + line2: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('line2'), 'exclude': lambda f: f is None }}) + r"""Line 2 of the customer address.""" + postal_code: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('postalCode'), 'exclude': lambda f: f is None }}) + r"""Postal code or zip code.""" + region: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('region'), 'exclude': lambda f: f is None }}) + r"""Region of the customer address.""" + + + + +@dataclass_json(undefined=Undefined.EXCLUDE) + +@dataclasses.dataclass +class Supplier: + 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/accounting-api#/operations/list-suppliers). Suppliers' data links to accounts payable [bills](https://docs.codat.io/accounting-api#/schemas/Bill). + """ + status: shared_supplierstatus.SupplierStatus = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('status') }}) + r"""Status of the supplier.""" + addresses: Optional[list[SupplierAddresses]] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('addresses'), 'exclude': lambda f: f is None }}) + r"""An array of Addresses.""" + contact_name: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('contactName'), 'exclude': lambda f: f is None }}) + r"""Name of the main contact for the supplier.""" + default_currency: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('defaultCurrency'), 'exclude': lambda f: f is None }}) + r"""Default currency the supplier's transactional data is recorded in.""" + email_address: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('emailAddress'), 'exclude': lambda f: f is None }}) + r"""Email address that the supplier may be contacted on.""" + 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 supplier, unique to the company in the accounting platform.""" + metadata: Optional[shared_metadata.Metadata] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('metadata'), 'exclude': lambda f: f is None }}) + modified_date: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('modifiedDate'), 'exclude': lambda f: f is None }}) + phone: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('phone'), 'exclude': lambda f: f is None }}) + r"""Phone number that the supplier may be contacted on.""" + registration_number: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('registrationNumber'), 'exclude': lambda f: f is None }}) + r"""Company number of the supplier. In the UK, this is typically the company registration number issued by Companies House.""" + 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 }}) + supplemental_data: Optional[shared_supplementaldata.SupplementalData] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('supplementalData'), 'exclude': lambda f: f is 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 platform. [Learn more](https://docs.codat.io/using-the-api/additional-data) about supplemental data. + """ + supplier_name: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('supplierName'), 'exclude': lambda f: f is None }}) + r"""Name of the supplier as recorded in the accounting system, typically the company name.""" + tax_number: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('taxNumber'), 'exclude': lambda f: f is None }}) + r"""Supplier's company tax number.""" + + diff --git a/sync-for-payables/src/codatsyncpayables/models/shared/supplierref.py b/sync-for-payables/src/codatsyncpayables/models/shared/supplierref.py new file mode 100755 index 000000000..a2e15a42d --- /dev/null +++ b/sync-for-payables/src/codatsyncpayables/models/shared/supplierref.py @@ -0,0 +1,20 @@ +"""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.""" + 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=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('supplierName'), 'exclude': lambda f: f is None }}) + r"""The supplier's name""" + + diff --git a/sync-for-payables/src/codatsyncpayables/models/shared/suppliers.py b/sync-for-payables/src/codatsyncpayables/models/shared/suppliers.py new file mode 100755 index 000000000..52f8cdb12 --- /dev/null +++ b/sync-for-payables/src/codatsyncpayables/models/shared/suppliers.py @@ -0,0 +1,23 @@ +"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" + +from __future__ import annotations +import dataclasses +from ..shared import links as shared_links +from ..shared import supplier as shared_supplier +from codatsyncpayables import utils +from dataclasses_json import Undefined, dataclass_json +from typing import Optional + + +@dataclass_json(undefined=Undefined.EXCLUDE) + +@dataclasses.dataclass +class Suppliers: + r"""Success""" + links: shared_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') }}) + page_size: int = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('pageSize') }}) + total_results: int = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('totalResults') }}) + results: Optional[list[shared_supplier.Supplier]] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('results'), 'exclude': lambda f: f is None }}) + + diff --git a/sync-for-payables/src/codatsyncpayables/models/shared/supplierstatus.py b/sync-for-payables/src/codatsyncpayables/models/shared/supplierstatus.py new file mode 100755 index 000000000..b30be6a46 --- /dev/null +++ b/sync-for-payables/src/codatsyncpayables/models/shared/supplierstatus.py @@ -0,0 +1,10 @@ +"""Code generated by Speakeasy (https://speakeasyapi.dev). 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/sync-for-payables/src/codatsyncpayables/models/shared/taxrate.py b/sync-for-payables/src/codatsyncpayables/models/shared/taxrate.py new file mode 100755 index 000000000..fc7c62ad2 --- /dev/null +++ b/sync-for-payables/src/codatsyncpayables/models/shared/taxrate.py @@ -0,0 +1,61 @@ +"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" + +from __future__ import annotations +import dataclasses +from ..shared import metadata as shared_metadata +from ..shared import taxratecomponent as shared_taxratecomponent +from ..shared import taxratestatus as shared_taxratestatus +from ..shared import validdatatypelinksitems as shared_validdatatypelinksitems +from codatsyncpayables import utils +from dataclasses_json import Undefined, dataclass_json +from typing import Optional + + +@dataclass_json(undefined=Undefined.EXCLUDE) + +@dataclasses.dataclass +class TaxRate: + 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 package. 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: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('code'), 'exclude': lambda f: f is None }}) + r"""Code for the tax rate from the accounting platform.""" + components: Optional[list[shared_taxratecomponent.TaxRateComponent]] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('components'), 'exclude': lambda f: f is None }}) + effective_tax_rate: Optional[float] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('effectiveTaxRate'), 'exclude': lambda f: f is None }}) + r"""See Effective tax rates description.""" + 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 tax rate, unique for the company in the accounting platform.""" + metadata: Optional[shared_metadata.Metadata] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('metadata'), 'exclude': lambda f: f is None }}) + modified_date: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('modifiedDate'), 'exclude': lambda f: f is None }}) + name: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('name'), 'exclude': lambda f: f is None }}) + r"""Codat-augmented name of the tax rate in the accounting platform.""" + 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[shared_taxratestatus.TaxRateStatus] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('status'), 'exclude': lambda f: f is None }}) + r"""Status of the tax rate in the accounting platform. + - `Active` - An active tax rate in use by a company. + - `Archived` - A tax rate that has been archived or is inactive in the accounting platform. + - `Unknown` - Where the status of the tax rate cannot be determined from the underlying platform. + """ + total_tax_rate: Optional[float] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('totalTaxRate'), 'exclude': lambda f: f is None }}) + r"""Total (not compounded) sum of the components of a tax rate.""" + valid_datatype_links: Optional[list[shared_validdatatypelinksitems.ValidDatatypeLinksitems]] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('validDatatypeLinks'), 'exclude': lambda f: f is None }}) + + diff --git a/sync-for-payables/src/codatsyncpayables/models/shared/taxratecomponent.py b/sync-for-payables/src/codatsyncpayables/models/shared/taxratecomponent.py new file mode 100755 index 000000000..b1de89bae --- /dev/null +++ b/sync-for-payables/src/codatsyncpayables/models/shared/taxratecomponent.py @@ -0,0 +1,22 @@ +"""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 TaxRateComponent: + r"""A tax rate can be made up of multiple sub taxes, often called components of the tax.""" + is_compound: bool = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('isCompound') }}) + r"""A flag to indicate with the tax is calculated using the principle of compounding.""" + 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 component.""" + rate: Optional[float] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('rate'), 'exclude': lambda f: f is None }}) + r"""The rate of the tax rate component, usually a percentage.""" + + diff --git a/sync-for-payables/src/codatsyncpayables/models/shared/taxrateref.py b/sync-for-payables/src/codatsyncpayables/models/shared/taxrateref.py new file mode 100755 index 000000000..d2c36d2db --- /dev/null +++ b/sync-for-payables/src/codatsyncpayables/models/shared/taxrateref.py @@ -0,0 +1,32 @@ +"""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 TaxRateRef: + 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: Optional[float] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('effectiveTaxRate'), '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.""" + + diff --git a/sync-for-payables/src/codatsyncpayables/models/shared/taxrates.py b/sync-for-payables/src/codatsyncpayables/models/shared/taxrates.py new file mode 100755 index 000000000..974a491d0 --- /dev/null +++ b/sync-for-payables/src/codatsyncpayables/models/shared/taxrates.py @@ -0,0 +1,23 @@ +"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" + +from __future__ import annotations +import dataclasses +from ..shared import links as shared_links +from ..shared import taxrate as shared_taxrate +from codatsyncpayables import utils +from dataclasses_json import Undefined, dataclass_json +from typing import Optional + + +@dataclass_json(undefined=Undefined.EXCLUDE) + +@dataclasses.dataclass +class TaxRates: + r"""Success""" + links: shared_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') }}) + page_size: int = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('pageSize') }}) + total_results: int = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('totalResults') }}) + results: Optional[list[shared_taxrate.TaxRate]] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('results'), 'exclude': lambda f: f is None }}) + + diff --git a/sync-for-payables/src/codatsyncpayables/models/shared/taxratestatus.py b/sync-for-payables/src/codatsyncpayables/models/shared/taxratestatus.py new file mode 100755 index 000000000..b4fbbaa40 --- /dev/null +++ b/sync-for-payables/src/codatsyncpayables/models/shared/taxratestatus.py @@ -0,0 +1,14 @@ +"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" + +from __future__ import annotations +from enum import Enum + +class TaxRateStatus(str, Enum): + r"""Status of the tax rate in the accounting platform. + - `Active` - An active tax rate in use by a company. + - `Archived` - A tax rate that has been archived or is inactive in the accounting platform. + - `Unknown` - Where the status of the tax rate cannot be determined from the underlying platform. + """ + UNKNOWN = 'Unknown' + ACTIVE = 'Active' + ARCHIVED = 'Archived' diff --git a/sync-for-payables/src/codatsyncpayables/models/shared/tracking.py b/sync-for-payables/src/codatsyncpayables/models/shared/tracking.py new file mode 100755 index 000000000..2f0066ee2 --- /dev/null +++ b/sync-for-payables/src/codatsyncpayables/models/shared/tracking.py @@ -0,0 +1,45 @@ +"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" + +from __future__ import annotations +import dataclasses +from ..shared import billedtotype as shared_billedtotype +from ..shared import trackingcategoryref as shared_trackingcategoryref +from codatsyncpayables import utils +from dataclasses_json import Undefined, dataclass_json +from typing import Optional + + +@dataclass_json(undefined=Undefined.EXCLUDE) + +@dataclasses.dataclass +class TrackingCustomerRef: + id: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('id') }}) + r"""`id` from the Customers data type""" + company_name: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('companyName'), 'exclude': lambda f: f is None }}) + r"""`customerName` from the Customer data type""" + + + + +@dataclass_json(undefined=Undefined.EXCLUDE) + +@dataclasses.dataclass +class TrackingProjectRef: + id: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('id') }}) + name: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('name'), 'exclude': lambda f: f is None }}) + + + + +@dataclass_json(undefined=Undefined.EXCLUDE) + +@dataclasses.dataclass +class Tracking: + r"""Categories, and a project and customer, against which the item is tracked.""" + category_refs: list[shared_trackingcategoryref.TrackingCategoryRef] = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('categoryRefs') }}) + is_billed_to: shared_billedtotype.BilledToType = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('isBilledTo') }}) + is_rebilled_to: shared_billedtotype.BilledToType = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('isRebilledTo') }}) + customer_ref: Optional[TrackingCustomerRef] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('customerRef'), 'exclude': lambda f: f is None }}) + project_ref: Optional[TrackingProjectRef] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('projectRef'), 'exclude': lambda f: f is None }}) + + diff --git a/sync-for-payables/src/codatsyncpayables/models/shared/trackingcategories.py b/sync-for-payables/src/codatsyncpayables/models/shared/trackingcategories.py new file mode 100755 index 000000000..7b6830af1 --- /dev/null +++ b/sync-for-payables/src/codatsyncpayables/models/shared/trackingcategories.py @@ -0,0 +1,23 @@ +"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" + +from __future__ import annotations +import dataclasses +from ..shared import links as shared_links +from ..shared import trackingcategory as shared_trackingcategory +from codatsyncpayables import utils +from dataclasses_json import Undefined, dataclass_json +from typing import Optional + + +@dataclass_json(undefined=Undefined.EXCLUDE) + +@dataclasses.dataclass +class TrackingCategories: + r"""Success""" + links: shared_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') }}) + page_size: int = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('pageSize') }}) + total_results: int = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('totalResults') }}) + results: Optional[list[shared_trackingcategory.TrackingCategory]] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('results'), 'exclude': lambda f: f is None }}) + + diff --git a/sync-for-payables/src/codatsyncpayables/models/shared/trackingcategory.py b/sync-for-payables/src/codatsyncpayables/models/shared/trackingcategory.py new file mode 100755 index 000000000..195233c07 --- /dev/null +++ b/sync-for-payables/src/codatsyncpayables/models/shared/trackingcategory.py @@ -0,0 +1,157 @@ +"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" + +from __future__ import annotations +import dataclasses +from ..shared import status as shared_status +from codatsyncpayables import utils +from dataclasses_json import Undefined, dataclass_json +from typing import Optional + + +@dataclass_json(undefined=Undefined.EXCLUDE) + +@dataclasses.dataclass +class TrackingCategory: + 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 platforms. 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: Optional[bool] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('hasChildren'), 'exclude': lambda f: f is None }}) + r"""Boolean value indicating whether this category has SubCategories""" + id: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('id'), 'exclude': lambda f: f is None }}) + r"""The identifier for the item, unique per tracking category""" + modified_date: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('modifiedDate'), 'exclude': lambda f: f is None }}) + name: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('name'), 'exclude': lambda f: f is None }}) + r"""The name of the tracking category""" + parent_id: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('parentId'), 'exclude': lambda f: f is None }}) + r"""The identifier for this item's immediate parent""" + 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[shared_status.Status] = 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 tracking category.""" + + diff --git a/sync-for-payables/src/codatsyncpayables/models/shared/trackingcategoryref.py b/sync-for-payables/src/codatsyncpayables/models/shared/trackingcategoryref.py new file mode 100755 index 000000000..df1dbb438 --- /dev/null +++ b/sync-for-payables/src/codatsyncpayables/models/shared/trackingcategoryref.py @@ -0,0 +1,21 @@ +"""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 TrackingCategoryRef: + r"""References a category against which the item is tracked. + + Deprecated class: This will be removed in a future release, please migrate away from it as soon as possible. + """ + id: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('id') }}) + name: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('name'), 'exclude': lambda f: f is None }}) + + diff --git a/sync-for-payables/src/codatsyncpayables/models/shared/trackingcategorytree.py b/sync-for-payables/src/codatsyncpayables/models/shared/trackingcategorytree.py new file mode 100755 index 000000000..2ea1606f1 --- /dev/null +++ b/sync-for-payables/src/codatsyncpayables/models/shared/trackingcategorytree.py @@ -0,0 +1,31 @@ +"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" + +from __future__ import annotations +import dataclasses +from ..shared import status as shared_status +from codatsyncpayables import utils +from dataclasses_json import Undefined, dataclass_json +from typing import Optional + + +@dataclass_json(undefined=Undefined.EXCLUDE) + +@dataclasses.dataclass +class TrackingCategoryTree: + r"""The full structure of a specific tracking category including any child or subcategories.""" + has_children: Optional[bool] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('hasChildren'), 'exclude': lambda f: f is None }}) + r"""Boolean value indicating whether this category has SubCategories""" + id: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('id'), 'exclude': lambda f: f is None }}) + r"""The identifier for the item, unique per tracking category""" + modified_date: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('modifiedDate'), 'exclude': lambda f: f is None }}) + name: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('name'), 'exclude': lambda f: f is None }}) + r"""The name of the tracking category""" + parent_id: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('parentId'), 'exclude': lambda f: f is None }}) + r"""The identifier for this item's immediate parent""" + 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[shared_status.Status] = 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 tracking category.""" + sub_categories: Optional[list[TrackingCategoryTree]] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('subCategories'), 'exclude': lambda f: f is None }}) + r"""A collection of subcategories that are nested beneath this category.""" + + diff --git a/sync-for-payables/src/codatsyncpayables/models/shared/updatebillcreditnoteresponse.py b/sync-for-payables/src/codatsyncpayables/models/shared/updatebillcreditnoteresponse.py new file mode 100755 index 000000000..1882ab90e --- /dev/null +++ b/sync-for-payables/src/codatsyncpayables/models/shared/updatebillcreditnoteresponse.py @@ -0,0 +1,100 @@ +"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" + +from __future__ import annotations +import dataclasses +from ..shared import billcreditnote as shared_billcreditnote +from ..shared import datatype as shared_datatype +from ..shared import pushoperationchange as shared_pushoperationchange +from ..shared import pushoperationstatus as shared_pushoperationstatus +from ..shared import validation as shared_validation +from codatsyncpayables import utils +from dataclasses_json import Undefined, dataclass_json +from typing import Optional + + +@dataclass_json(undefined=Undefined.EXCLUDE) + +@dataclasses.dataclass +class UpdateBillCreditNoteResponse: + r"""Success""" + company_id: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('companyId') }}) + r"""Unique identifier for your SMB in Codat.""" + data_connection_key: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('dataConnectionKey') }}) + r"""Unique identifier for a company's data connection.""" + push_operation_key: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('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: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('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: shared_pushoperationstatus.PushOperationStatus = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('status') }}) + r"""The status of the push operation.""" + status_code: int = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('statusCode') }}) + changes: Optional[list[shared_pushoperationchange.PushOperationChange]] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('changes'), 'exclude': lambda f: f is None }}) + r"""Contains a single entry that communicates which record has changed and the manner in which it changed.""" + completed_on_utc: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('completedOnUtc'), '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. + """ + data: Optional[shared_billcreditnote.BillCreditNote] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('data'), 'exclude': lambda f: f is None }}) + 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/accounting-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/accounting-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/accounting-api#/schemas/Bill). + * The supplier that issued the bill credit note. + """ + data_type: Optional[shared_datatype.DataType] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('dataType'), 'exclude': lambda f: f is None }}) + r"""Available Data types""" + error_message: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('errorMessage'), 'exclude': lambda f: f is None }}) + timeout_in_minutes: Optional[int] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('timeoutInMinutes'), 'exclude': lambda f: f is None }}) + timeout_in_seconds: Optional[int] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('timeoutInSeconds'), 'exclude': lambda f: f is None }}) + r"""Deprecated field: This will be removed in a future release, please migrate away from it as soon as possible.""" + validation: Optional[shared_validation.Validation] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('validation'), 'exclude': lambda f: f is 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.""" + + diff --git a/sync-for-payables/src/codatsyncpayables/models/shared/updatebillresponse.py b/sync-for-payables/src/codatsyncpayables/models/shared/updatebillresponse.py new file mode 100755 index 000000000..6dcabd9dd --- /dev/null +++ b/sync-for-payables/src/codatsyncpayables/models/shared/updatebillresponse.py @@ -0,0 +1,103 @@ +"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" + +from __future__ import annotations +import dataclasses +from ..shared import bill as shared_bill +from ..shared import datatype as shared_datatype +from ..shared import pushoperationchange as shared_pushoperationchange +from ..shared import pushoperationstatus as shared_pushoperationstatus +from ..shared import validation as shared_validation +from codatsyncpayables import utils +from dataclasses_json import Undefined, dataclass_json +from typing import Optional + + +@dataclass_json(undefined=Undefined.EXCLUDE) + +@dataclasses.dataclass +class UpdateBillResponse: + r"""Success""" + company_id: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('companyId') }}) + r"""Unique identifier for your SMB in Codat.""" + data_connection_key: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('dataConnectionKey') }}) + r"""Unique identifier for a company's data connection.""" + push_operation_key: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('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: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('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: shared_pushoperationstatus.PushOperationStatus = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('status') }}) + r"""The status of the push operation.""" + status_code: int = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('statusCode') }}) + changes: Optional[list[shared_pushoperationchange.PushOperationChange]] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('changes'), 'exclude': lambda f: f is None }}) + r"""Contains a single entry that communicates which record has changed and the manner in which it changed.""" + completed_on_utc: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('completedOnUtc'), '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. + """ + data: Optional[shared_bill.Bill] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('data'), 'exclude': lambda f: f is None }}) + 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/accounting-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 platforms 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/accounting-api#/schemas/DirectCost) data model. + """ + data_type: Optional[shared_datatype.DataType] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('dataType'), 'exclude': lambda f: f is None }}) + r"""Available Data types""" + error_message: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('errorMessage'), 'exclude': lambda f: f is None }}) + timeout_in_minutes: Optional[int] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('timeoutInMinutes'), 'exclude': lambda f: f is None }}) + timeout_in_seconds: Optional[int] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('timeoutInSeconds'), 'exclude': lambda f: f is None }}) + r"""Deprecated field: This will be removed in a future release, please migrate away from it as soon as possible.""" + validation: Optional[shared_validation.Validation] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('validation'), 'exclude': lambda f: f is 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.""" + + diff --git a/sync-for-payables/src/codatsyncpayables/models/shared/updatesupplierresponse.py b/sync-for-payables/src/codatsyncpayables/models/shared/updatesupplierresponse.py new file mode 100755 index 000000000..10c96ca95 --- /dev/null +++ b/sync-for-payables/src/codatsyncpayables/models/shared/updatesupplierresponse.py @@ -0,0 +1,89 @@ +"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" + +from __future__ import annotations +import dataclasses +from ..shared import datatype as shared_datatype +from ..shared import pushoperationchange as shared_pushoperationchange +from ..shared import pushoperationstatus as shared_pushoperationstatus +from ..shared import supplier as shared_supplier +from ..shared import validation as shared_validation +from codatsyncpayables import utils +from dataclasses_json import Undefined, dataclass_json +from typing import Optional + + +@dataclass_json(undefined=Undefined.EXCLUDE) + +@dataclasses.dataclass +class UpdateSupplierResponse: + r"""Success""" + company_id: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('companyId') }}) + r"""Unique identifier for your SMB in Codat.""" + data_connection_key: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('dataConnectionKey') }}) + r"""Unique identifier for a company's data connection.""" + push_operation_key: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('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: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('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: shared_pushoperationstatus.PushOperationStatus = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('status') }}) + r"""The status of the push operation.""" + status_code: int = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('statusCode') }}) + changes: Optional[list[shared_pushoperationchange.PushOperationChange]] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('changes'), 'exclude': lambda f: f is None }}) + r"""Contains a single entry that communicates which record has changed and the manner in which it changed.""" + completed_on_utc: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('completedOnUtc'), '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. + """ + data: Optional[shared_supplier.Supplier] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('data'), 'exclude': lambda f: f is None }}) + 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/accounting-api#/operations/list-suppliers). Suppliers' data links to accounts payable [bills](https://docs.codat.io/accounting-api#/schemas/Bill). + """ + data_type: Optional[shared_datatype.DataType] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('dataType'), 'exclude': lambda f: f is None }}) + r"""Available Data types""" + error_message: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('errorMessage'), 'exclude': lambda f: f is None }}) + timeout_in_minutes: Optional[int] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('timeoutInMinutes'), 'exclude': lambda f: f is None }}) + timeout_in_seconds: Optional[int] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('timeoutInSeconds'), 'exclude': lambda f: f is None }}) + r"""Deprecated field: This will be removed in a future release, please migrate away from it as soon as possible.""" + validation: Optional[shared_validation.Validation] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('validation'), 'exclude': lambda f: f is 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.""" + + diff --git a/sync-for-payables/src/codatsyncpayables/models/shared/validation.py b/sync-for-payables/src/codatsyncpayables/models/shared/validation.py new file mode 100755 index 000000000..4d539ccef --- /dev/null +++ b/sync-for-payables/src/codatsyncpayables/models/shared/validation.py @@ -0,0 +1,19 @@ +"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" + +from __future__ import annotations +import dataclasses +from ..shared import validationitem as shared_validationitem +from codatsyncpayables import utils +from dataclasses_json import Undefined, dataclass_json +from typing import Optional + + +@dataclass_json(undefined=Undefined.EXCLUDE) + +@dataclasses.dataclass +class Validation: + 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: Optional[list[shared_validationitem.ValidationItem]] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('errors'), 'exclude': lambda f: f is None }}) + warnings: Optional[list[shared_validationitem.ValidationItem]] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('warnings'), 'exclude': lambda f: f is None }}) + + diff --git a/sync-for-payables/src/codatsyncpayables/models/shared/validationitem.py b/sync-for-payables/src/codatsyncpayables/models/shared/validationitem.py new file mode 100755 index 000000000..e030c3e5e --- /dev/null +++ b/sync-for-payables/src/codatsyncpayables/models/shared/validationitem.py @@ -0,0 +1,18 @@ +"""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 ValidationItem: + item_id: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('itemId'), '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 }}) + validator_name: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('validatorName'), 'exclude': lambda f: f is None }}) + + diff --git a/sync-for-payables/src/codatsyncpayables/models/shared/validdatatypelinksitems.py b/sync-for-payables/src/codatsyncpayables/models/shared/validdatatypelinksitems.py new file mode 100755 index 000000000..78d7d4f87 --- /dev/null +++ b/sync-for-payables/src/codatsyncpayables/models/shared/validdatatypelinksitems.py @@ -0,0 +1,60 @@ +"""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 ValidDatatypeLinksitems: + 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: Optional[list[str]] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('links'), 'exclude': lambda f: f is None }}) + r"""Supported `dataTypes` that the record can be linked to.""" + property: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('property'), 'exclude': lambda f: f is None }}) + r"""The property from the account that can be linked.""" + + diff --git a/sync-for-payables/src/codatsyncpayables/models/shared/withholdingtaxitems.py b/sync-for-payables/src/codatsyncpayables/models/shared/withholdingtaxitems.py new file mode 100755 index 000000000..da59246c0 --- /dev/null +++ b/sync-for-payables/src/codatsyncpayables/models/shared/withholdingtaxitems.py @@ -0,0 +1,16 @@ +"""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 + + +@dataclass_json(undefined=Undefined.EXCLUDE) + +@dataclasses.dataclass +class WithholdingTaxitems: + amount: float = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('amount') }}) + name: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('name') }}) + + diff --git a/sync-for-payables/src/codatsyncpayables/payment_methods.py b/sync-for-payables/src/codatsyncpayables/payment_methods.py new file mode 100755 index 000000000..61d9df65e --- /dev/null +++ b/sync-for-payables/src/codatsyncpayables/payment_methods.py @@ -0,0 +1,116 @@ +"""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 PaymentMethods: + r"""Payment methods""" + sdk_configuration: SDKConfiguration + + def __init__(self, sdk_config: SDKConfiguration) -> None: + self.sdk_configuration = sdk_config + + + def get(self, request: operations.GetPaymentMethodRequest, retries: Optional[utils.RetryConfig] = None) -> operations.GetPaymentMethodResponse: + 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). + """ + base_url = utils.template_url(*self.sdk_configuration.get_server_details()) + + url = utils.generate_url(operations.GetPaymentMethodRequest, base_url, '/companies/{companyId}/data/paymentMethods/{paymentMethodId}', request) + headers = {} + headers['Accept'] = 'application/json' + headers['user-agent'] = f'speakeasy-sdk/{self.sdk_configuration.language} {self.sdk_configuration.sdk_version} {self.sdk_configuration.gen_version} {self.sdk_configuration.openapi_doc_version}' + + client = self.sdk_configuration.security_client + + retry_config = retries + if retry_config is None: + 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.GetPaymentMethodResponse(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.PaymentMethod]) + res.payment_method = 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, 404, 409, 429]: + if utils.match_content_type(content_type, 'application/json'): + out = utils.unmarshal_json(http_res.text, Optional[shared.ErrorMessage]) + res.error_message = out + else: + raise errors.SDKError(f'unknown content-type received: {content_type}', http_res.status_code, http_res.text, http_res) + + return res + + + def list(self, request: operations.ListPaymentMethodsRequest, retries: Optional[utils.RetryConfig] = None) -> operations.ListPaymentMethodsResponse: + 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). + """ + base_url = utils.template_url(*self.sdk_configuration.get_server_details()) + + url = utils.generate_url(operations.ListPaymentMethodsRequest, base_url, '/companies/{companyId}/data/paymentMethods', request) + headers = {} + query_params = utils.get_query_params(operations.ListPaymentMethodsRequest, request) + headers['Accept'] = 'application/json' + headers['user-agent'] = f'speakeasy-sdk/{self.sdk_configuration.language} {self.sdk_configuration.sdk_version} {self.sdk_configuration.gen_version} {self.sdk_configuration.openapi_doc_version}' + + client = self.sdk_configuration.security_client + + retry_config = retries + if retry_config is None: + 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.ListPaymentMethodsResponse(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.PaymentMethods]) + res.payment_methods = 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, 404, 409]: + if utils.match_content_type(content_type, 'application/json'): + out = utils.unmarshal_json(http_res.text, Optional[shared.ErrorMessage]) + res.error_message = out + else: + raise errors.SDKError(f'unknown content-type received: {content_type}', http_res.status_code, http_res.text, http_res) + + return res + + \ No newline at end of file diff --git a/sync-for-payables/src/codatsyncpayables/push_operations.py b/sync-for-payables/src/codatsyncpayables/push_operations.py new file mode 100755 index 000000000..4c665752b --- /dev/null +++ b/sync-for-payables/src/codatsyncpayables/push_operations.py @@ -0,0 +1,106 @@ +"""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 PushOperations: + r"""Access create, update and delete operations made to an SMB's data connection.""" + sdk_configuration: SDKConfiguration + + def __init__(self, sdk_config: SDKConfiguration) -> None: + self.sdk_configuration = sdk_config + + + def get(self, request: operations.GetPushOperationRequest, retries: Optional[utils.RetryConfig] = None) -> operations.GetPushOperationResponse: + r"""Get push operation + Retrieve push operation. + """ + base_url = utils.template_url(*self.sdk_configuration.get_server_details()) + + url = utils.generate_url(operations.GetPushOperationRequest, base_url, '/companies/{companyId}/push/{pushOperationKey}', request) + headers = {} + headers['Accept'] = 'application/json' + headers['user-agent'] = f'speakeasy-sdk/{self.sdk_configuration.language} {self.sdk_configuration.sdk_version} {self.sdk_configuration.gen_version} {self.sdk_configuration.openapi_doc_version}' + + client = self.sdk_configuration.security_client + + retry_config = retries + if retry_config is None: + 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.GetPushOperationResponse(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.PushOperation]) + res.push_operation = 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, 404, 429]: + if utils.match_content_type(content_type, 'application/json'): + out = utils.unmarshal_json(http_res.text, Optional[shared.ErrorMessage]) + res.error_message = out + else: + raise errors.SDKError(f'unknown content-type received: {content_type}', http_res.status_code, http_res.text, http_res) + + return res + + + def list(self, request: operations.ListPushOperationsRequest, retries: Optional[utils.RetryConfig] = None) -> operations.ListPushOperationsResponse: + r"""List push operations + List push operation records. + """ + base_url = utils.template_url(*self.sdk_configuration.get_server_details()) + + url = utils.generate_url(operations.ListPushOperationsRequest, base_url, '/companies/{companyId}/push', request) + headers = {} + query_params = utils.get_query_params(operations.ListPushOperationsRequest, request) + headers['Accept'] = 'application/json' + headers['user-agent'] = f'speakeasy-sdk/{self.sdk_configuration.language} {self.sdk_configuration.sdk_version} {self.sdk_configuration.gen_version} {self.sdk_configuration.openapi_doc_version}' + + client = self.sdk_configuration.security_client + + retry_config = retries + if retry_config is None: + 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.ListPushOperationsResponse(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.PushOperations]) + res.push_operations = 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, 404, 429]: + if utils.match_content_type(content_type, 'application/json'): + out = utils.unmarshal_json(http_res.text, Optional[shared.ErrorMessage]) + res.error_message = out + else: + raise errors.SDKError(f'unknown content-type received: {content_type}', http_res.status_code, http_res.text, http_res) + + return res + + \ No newline at end of file diff --git a/sync-for-payables/src/codatsyncpayables/sdk.py b/sync-for-payables/src/codatsyncpayables/sdk.py new file mode 100755 index 000000000..5420b4b80 --- /dev/null +++ b/sync-for-payables/src/codatsyncpayables/sdk.py @@ -0,0 +1,108 @@ +"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" + +import requests as requests_http +from .accounts import Accounts +from .bill_credit_notes import BillCreditNotes +from .bill_payments import BillPayments +from .bills import Bills +from .companies import Companies +from .connections import Connections +from .journal_entries import JournalEntries +from .journals import Journals +from .manage_data import ManageData +from .payment_methods import PaymentMethods +from .push_operations import PushOperations +from .sdkconfiguration import SDKConfiguration +from .suppliers import Suppliers +from .tax_rates import TaxRates +from .tracking_categories import TrackingCategories +from codatsyncpayables import utils +from codatsyncpayables.models import shared + +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. + + [Read More...](https://docs.codat.io/payables/overview) + """ + accounts: Accounts + r"""Accounts""" + bill_credit_notes: BillCreditNotes + r"""Bill credit notes""" + bill_payments: BillPayments + r"""Bill payments""" + bills: Bills + r"""Bills""" + companies: Companies + r"""Create and manage your Codat companies.""" + connections: Connections + r"""Manage your companies' data connections.""" + journal_entries: JournalEntries + r"""Journal entries""" + journals: Journals + r"""Journals""" + manage_data: ManageData + r"""Asynchronously retrieve data from an integration to refresh data in Codat.""" + payment_methods: PaymentMethods + r"""Payment methods""" + push_operations: PushOperations + r"""Access create, update and delete operations made to an SMB's data connection.""" + suppliers: Suppliers + r"""Suppliers""" + tax_rates: TaxRates + r"""Tax rates""" + tracking_categories: TrackingCategories + r"""Tracking categories""" + + sdk_configuration: SDKConfiguration + + def __init__(self, + security: shared.Security = None, + server_idx: int = None, + server_url: str = None, + url_params: dict[str, str] = None, + client: requests_http.Session = None + ) -> None: + """Instantiates the SDK configuring it with the provided parameters. + + :param security: The security details required for authentication + :type security: 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 + """ + if client is None: + client = requests_http.Session() + + security_client = utils.configure_security_client(client, security) + + 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_client, server_url, server_idx) + + self._init_sdks() + + def _init_sdks(self): + self.accounts = Accounts(self.sdk_configuration) + self.bill_credit_notes = BillCreditNotes(self.sdk_configuration) + self.bill_payments = BillPayments(self.sdk_configuration) + self.bills = Bills(self.sdk_configuration) + self.companies = Companies(self.sdk_configuration) + self.connections = Connections(self.sdk_configuration) + self.journal_entries = JournalEntries(self.sdk_configuration) + self.journals = Journals(self.sdk_configuration) + self.manage_data = ManageData(self.sdk_configuration) + self.payment_methods = PaymentMethods(self.sdk_configuration) + self.push_operations = PushOperations(self.sdk_configuration) + self.suppliers = Suppliers(self.sdk_configuration) + self.tax_rates = TaxRates(self.sdk_configuration) + self.tracking_categories = TrackingCategories(self.sdk_configuration) + \ No newline at end of file diff --git a/sync-for-payables/src/codatsyncpayables/sdkconfiguration.py b/sync-for-payables/src/codatsyncpayables/sdkconfiguration.py new file mode 100755 index 000000000..b76f7c247 --- /dev/null +++ b/sync-for-payables/src/codatsyncpayables/sdkconfiguration.py @@ -0,0 +1,30 @@ +"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" + +import requests +from dataclasses import dataclass + + +SERVERS = [ + 'https://api.codat.io', + # Production +] +"""Contains the list of servers available to the SDK""" + +@dataclass +class SDKConfiguration: + client: requests.Session + security_client: requests.Session + server_url: str = '' + server_idx: int = 0 + language: str = 'python' + openapi_doc_version: str = '3.0.0' + sdk_version: str = '0.1.0' + gen_version: str = '2.91.4' + + def get_server_details(self) -> tuple[str, dict[str, str]]: + if self.server_url: + return self.server_url.removesuffix('/'), {} + if self.server_idx is None: + self.server_idx = 0 + + return SERVERS[self.server_idx], {} diff --git a/sync-for-payables/src/codatsyncpayables/suppliers.py b/sync-for-payables/src/codatsyncpayables/suppliers.py new file mode 100755 index 000000000..1089ea3e2 --- /dev/null +++ b/sync-for-payables/src/codatsyncpayables/suppliers.py @@ -0,0 +1,283 @@ +"""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 Suppliers: + r"""Suppliers""" + sdk_configuration: SDKConfiguration + + def __init__(self, sdk_config: SDKConfiguration) -> None: + self.sdk_configuration = sdk_config + + + def create(self, request: operations.CreateSupplierRequest, retries: Optional[utils.RetryConfig] = None) -> operations.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. + """ + base_url = utils.template_url(*self.sdk_configuration.get_server_details()) + + url = utils.generate_url(operations.CreateSupplierRequest, base_url, '/companies/{companyId}/connections/{connectionId}/push/suppliers', request) + headers = {} + req_content_type, data, form = utils.serialize_request_body(request, "supplier", 'json') + if req_content_type not in ('multipart/form-data', 'multipart/mixed'): + headers['content-type'] = req_content_type + query_params = utils.get_query_params(operations.CreateSupplierRequest, request) + headers['Accept'] = 'application/json' + headers['user-agent'] = f'speakeasy-sdk/{self.sdk_configuration.language} {self.sdk_configuration.sdk_version} {self.sdk_configuration.gen_version} {self.sdk_configuration.openapi_doc_version}' + + client = self.sdk_configuration.security_client + + retry_config = retries + if retry_config is None: + retry_config = utils.RetryConfig('backoff', utils.BackoffStrategy(500, 60000, 1.5, 3600000), True) + + def do_request(): + return client.request('POST', url, params=query_params, 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.CreateSupplierResponse(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.CreateSupplierResponse]) + res.create_supplier_response = 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, 404, 429]: + if utils.match_content_type(content_type, 'application/json'): + out = utils.unmarshal_json(http_res.text, Optional[shared.ErrorMessage]) + res.error_message = out + else: + raise errors.SDKError(f'unknown content-type received: {content_type}', http_res.status_code, http_res.text, http_res) + + return res + + + def get(self, request: operations.GetSupplierRequest, retries: Optional[utils.RetryConfig] = None) -> operations.GetSupplierResponse: + 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). + """ + base_url = utils.template_url(*self.sdk_configuration.get_server_details()) + + url = utils.generate_url(operations.GetSupplierRequest, base_url, '/companies/{companyId}/data/suppliers/{supplierId}', request) + headers = {} + headers['Accept'] = 'application/json' + headers['user-agent'] = f'speakeasy-sdk/{self.sdk_configuration.language} {self.sdk_configuration.sdk_version} {self.sdk_configuration.gen_version} {self.sdk_configuration.openapi_doc_version}' + + client = self.sdk_configuration.security_client + + retry_config = retries + if retry_config is None: + 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.GetSupplierResponse(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.Supplier]) + res.supplier = 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, 404, 409, 429]: + if utils.match_content_type(content_type, 'application/json'): + out = utils.unmarshal_json(http_res.text, Optional[shared.ErrorMessage]) + res.error_message = out + else: + raise errors.SDKError(f'unknown content-type received: {content_type}', http_res.status_code, http_res.text, http_res) + + return res + + + def get_create_update_model(self, request: operations.GetCreateUpdateSupplierModelRequest, retries: Optional[utils.RetryConfig] = None) -> operations.GetCreateUpdateSupplierModelResponse: + 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. + """ + base_url = utils.template_url(*self.sdk_configuration.get_server_details()) + + url = utils.generate_url(operations.GetCreateUpdateSupplierModelRequest, base_url, '/companies/{companyId}/connections/{connectionId}/options/suppliers', request) + headers = {} + headers['Accept'] = 'application/json' + headers['user-agent'] = f'speakeasy-sdk/{self.sdk_configuration.language} {self.sdk_configuration.sdk_version} {self.sdk_configuration.gen_version} {self.sdk_configuration.openapi_doc_version}' + + client = self.sdk_configuration.security_client + + retry_config = retries + if retry_config is None: + 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.GetCreateUpdateSupplierModelResponse(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.PushOption]) + res.push_option = 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, 404, 429]: + if utils.match_content_type(content_type, 'application/json'): + out = utils.unmarshal_json(http_res.text, Optional[shared.ErrorMessage]) + res.error_message = out + else: + raise errors.SDKError(f'unknown content-type received: {content_type}', http_res.status_code, http_res.text, http_res) + + return res + + + def list(self, request: operations.ListSuppliersRequest, retries: Optional[utils.RetryConfig] = None) -> operations.ListSuppliersResponse: + 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. + + Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/sync-for-payables-api#/operations/refresh-company-data). + """ + base_url = utils.template_url(*self.sdk_configuration.get_server_details()) + + url = utils.generate_url(operations.ListSuppliersRequest, base_url, '/companies/{companyId}/data/suppliers', request) + headers = {} + query_params = utils.get_query_params(operations.ListSuppliersRequest, request) + headers['Accept'] = 'application/json' + headers['user-agent'] = f'speakeasy-sdk/{self.sdk_configuration.language} {self.sdk_configuration.sdk_version} {self.sdk_configuration.gen_version} {self.sdk_configuration.openapi_doc_version}' + + client = self.sdk_configuration.security_client + + retry_config = retries + if retry_config is None: + 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.ListSuppliersResponse(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.Suppliers]) + res.suppliers = 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, 404, 409]: + if utils.match_content_type(content_type, 'application/json'): + out = utils.unmarshal_json(http_res.text, Optional[shared.ErrorMessage]) + res.error_message = out + else: + raise errors.SDKError(f'unknown content-type received: {content_type}', http_res.status_code, http_res.text, http_res) + + return res + + + def update(self, request: operations.UpdateSupplierRequest, retries: Optional[utils.RetryConfig] = None) -> operations.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. + """ + base_url = utils.template_url(*self.sdk_configuration.get_server_details()) + + url = utils.generate_url(operations.UpdateSupplierRequest, base_url, '/companies/{companyId}/connections/{connectionId}/push/suppliers/{supplierId}', request) + headers = {} + req_content_type, data, form = utils.serialize_request_body(request, "supplier", 'json') + if req_content_type not in ('multipart/form-data', 'multipart/mixed'): + headers['content-type'] = req_content_type + query_params = utils.get_query_params(operations.UpdateSupplierRequest, request) + headers['Accept'] = 'application/json' + headers['user-agent'] = f'speakeasy-sdk/{self.sdk_configuration.language} {self.sdk_configuration.sdk_version} {self.sdk_configuration.gen_version} {self.sdk_configuration.openapi_doc_version}' + + client = self.sdk_configuration.security_client + + retry_config = retries + if retry_config is None: + retry_config = utils.RetryConfig('backoff', utils.BackoffStrategy(500, 60000, 1.5, 3600000), True) + + def do_request(): + return client.request('PUT', url, params=query_params, 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.UpdateSupplierResponse(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.UpdateSupplierResponse]) + res.update_supplier_response = 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, 404, 429]: + if utils.match_content_type(content_type, 'application/json'): + out = utils.unmarshal_json(http_res.text, Optional[shared.ErrorMessage]) + res.error_message = out + else: + raise errors.SDKError(f'unknown content-type received: {content_type}', http_res.status_code, http_res.text, http_res) + + return res + + \ No newline at end of file diff --git a/sync-for-payables/src/codatsyncpayables/tax_rates.py b/sync-for-payables/src/codatsyncpayables/tax_rates.py new file mode 100755 index 000000000..7dd336c6e --- /dev/null +++ b/sync-for-payables/src/codatsyncpayables/tax_rates.py @@ -0,0 +1,116 @@ +"""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 TaxRates: + r"""Tax rates""" + sdk_configuration: SDKConfiguration + + def __init__(self, sdk_config: SDKConfiguration) -> None: + self.sdk_configuration = sdk_config + + + def get(self, request: operations.GetTaxRateRequest, retries: Optional[utils.RetryConfig] = None) -> operations.GetTaxRateResponse: + 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 package. + + 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). + """ + base_url = utils.template_url(*self.sdk_configuration.get_server_details()) + + url = utils.generate_url(operations.GetTaxRateRequest, base_url, '/companies/{companyId}/data/taxRates/{taxRateId}', request) + headers = {} + headers['Accept'] = 'application/json' + headers['user-agent'] = f'speakeasy-sdk/{self.sdk_configuration.language} {self.sdk_configuration.sdk_version} {self.sdk_configuration.gen_version} {self.sdk_configuration.openapi_doc_version}' + + client = self.sdk_configuration.security_client + + retry_config = retries + if retry_config is None: + 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.GetTaxRateResponse(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.TaxRate]) + res.tax_rate = 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, 404, 409, 429]: + if utils.match_content_type(content_type, 'application/json'): + out = utils.unmarshal_json(http_res.text, Optional[shared.ErrorMessage]) + res.error_message = out + else: + raise errors.SDKError(f'unknown content-type received: {content_type}', http_res.status_code, http_res.text, http_res) + + return res + + + def list(self, request: operations.ListTaxRatesRequest, retries: Optional[utils.RetryConfig] = None) -> operations.ListTaxRatesResponse: + 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 package. + + Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/sync-for-payables-api#/operations/refresh-company-data). + """ + base_url = utils.template_url(*self.sdk_configuration.get_server_details()) + + url = utils.generate_url(operations.ListTaxRatesRequest, base_url, '/companies/{companyId}/data/taxRates', request) + headers = {} + query_params = utils.get_query_params(operations.ListTaxRatesRequest, request) + headers['Accept'] = 'application/json' + headers['user-agent'] = f'speakeasy-sdk/{self.sdk_configuration.language} {self.sdk_configuration.sdk_version} {self.sdk_configuration.gen_version} {self.sdk_configuration.openapi_doc_version}' + + client = self.sdk_configuration.security_client + + retry_config = retries + if retry_config is None: + 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.ListTaxRatesResponse(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.TaxRates]) + res.tax_rates = 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, 404, 409]: + if utils.match_content_type(content_type, 'application/json'): + out = utils.unmarshal_json(http_res.text, Optional[shared.ErrorMessage]) + res.error_message = out + else: + raise errors.SDKError(f'unknown content-type received: {content_type}', http_res.status_code, http_res.text, http_res) + + return res + + \ No newline at end of file diff --git a/sync-for-payables/src/codatsyncpayables/tracking_categories.py b/sync-for-payables/src/codatsyncpayables/tracking_categories.py new file mode 100755 index 000000000..9c67e2667 --- /dev/null +++ b/sync-for-payables/src/codatsyncpayables/tracking_categories.py @@ -0,0 +1,116 @@ +"""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 TrackingCategories: + r"""Tracking categories""" + sdk_configuration: SDKConfiguration + + def __init__(self, sdk_config: SDKConfiguration) -> None: + self.sdk_configuration = sdk_config + + + def get(self, request: operations.GetTrackingCategoryRequest, retries: Optional[utils.RetryConfig] = None) -> operations.GetTrackingCategoryResponse: + 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). + """ + base_url = utils.template_url(*self.sdk_configuration.get_server_details()) + + url = utils.generate_url(operations.GetTrackingCategoryRequest, base_url, '/companies/{companyId}/data/trackingCategories/{trackingCategoryId}', request) + headers = {} + headers['Accept'] = 'application/json' + headers['user-agent'] = f'speakeasy-sdk/{self.sdk_configuration.language} {self.sdk_configuration.sdk_version} {self.sdk_configuration.gen_version} {self.sdk_configuration.openapi_doc_version}' + + client = self.sdk_configuration.security_client + + retry_config = retries + if retry_config is None: + 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.GetTrackingCategoryResponse(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.TrackingCategoryTree]) + res.tracking_category_tree = 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, 404, 409, 429]: + if utils.match_content_type(content_type, 'application/json'): + out = utils.unmarshal_json(http_res.text, Optional[shared.ErrorMessage]) + res.error_message = out + else: + raise errors.SDKError(f'unknown content-type received: {content_type}', http_res.status_code, http_res.text, http_res) + + return res + + + def list(self, request: operations.ListTrackingCategoriesRequest, retries: Optional[utils.RetryConfig] = None) -> operations.ListTrackingCategoriesResponse: + 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). + """ + base_url = utils.template_url(*self.sdk_configuration.get_server_details()) + + url = utils.generate_url(operations.ListTrackingCategoriesRequest, base_url, '/companies/{companyId}/data/trackingCategories', request) + headers = {} + query_params = utils.get_query_params(operations.ListTrackingCategoriesRequest, request) + headers['Accept'] = 'application/json' + headers['user-agent'] = f'speakeasy-sdk/{self.sdk_configuration.language} {self.sdk_configuration.sdk_version} {self.sdk_configuration.gen_version} {self.sdk_configuration.openapi_doc_version}' + + client = self.sdk_configuration.security_client + + retry_config = retries + if retry_config is None: + 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.ListTrackingCategoriesResponse(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.TrackingCategories]) + res.tracking_categories = 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, 404, 409]: + if utils.match_content_type(content_type, 'application/json'): + out = utils.unmarshal_json(http_res.text, Optional[shared.ErrorMessage]) + res.error_message = out + else: + raise errors.SDKError(f'unknown content-type received: {content_type}', http_res.status_code, http_res.text, http_res) + + return res + + \ No newline at end of file diff --git a/sync-for-payables/src/codatsyncpayables/utils/__init__.py b/sync-for-payables/src/codatsyncpayables/utils/__init__.py new file mode 100755 index 000000000..94b739857 --- /dev/null +++ b/sync-for-payables/src/codatsyncpayables/utils/__init__.py @@ -0,0 +1,4 @@ +"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" + +from .retries import * +from .utils import * diff --git a/sync-for-payables/src/codatsyncpayables/utils/retries.py b/sync-for-payables/src/codatsyncpayables/utils/retries.py new file mode 100755 index 000000000..2138c1b5e --- /dev/null +++ b/sync-for-payables/src/codatsyncpayables/utils/retries.py @@ -0,0 +1,119 @@ +"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" + +import random +import time + +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 not retries.config.config.retry_connection_errors: + raise + + raise PermanentError(exception) from exception + except requests.exceptions.Timeout as exception: + if not 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/sync-for-payables/src/codatsyncpayables/utils/utils.py b/sync-for-payables/src/codatsyncpayables/utils/utils.py new file mode 100755 index 000000000..ea9792d0d --- /dev/null +++ b/sync-for-payables/src/codatsyncpayables/utils/utils.py @@ -0,0 +1,764 @@ +"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" + +import base64 +import json +import re +from dataclasses import Field, dataclass, fields, is_dataclass, make_dataclass +from datetime import date, datetime +from email.message import Message +from enum import Enum +from typing import Any, Callable, Optional, Tuple, Union, get_args, get_origin +from xmlrpc.client import boolean + +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] = value + elif scheme_type == 'oauth2': + client.client.headers[header_name] = value + elif scheme_type == 'http': + if sub_type == 'bearer': + client.client.headers[header_name] = value.lower().startswith('bearer ') and value or f'Bearer {value}' + else: + raise Exception('not supported') + else: + raise Exception('not supported') + + +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, 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)): + 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 server_url.removesuffix("/") + 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, 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_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) + + 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_field_name: str, serialization_method: str) -> Tuple[ + str, any, any]: + if request is None: + return None, None, None, None + + if not is_dataclass(request) or not hasattr(request, request_field_name): + return serialize_content_type(request_field_name, SERIALIZATION_METHOD_TO_CONTENT_TYPE[serialization_method], + request) + + request_val = getattr(request, request_field_name) + + 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_metadata.get('media_type', 'application/octet-stream'), + request_val) + + +def serialize_content_type(field_name: str, media_type: str, request: dataclass) -> Tuple[str, any, list[list[any]]]: + if re.match(r'(application|text)\/.*?\+*json.*', media_type) is not None: + return media_type, marshal_json(request), 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), "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)] + 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): + 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}') from attr_err + return out.res + + +def marshal_json(val): + marshal = make_dataclass('Marshal', [('res', type(val))], + bases=(DataClassJsonMixin,)) + marshaller = marshal(res=val) + json_dict = marshaller.to_dict() + return json.dumps(json_dict["res"]) + + +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 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