Package: codat-lending
LendingLending helps you make smarter credit decisions on small businesses by enabling you to pull your customers' latest data from the operating systems they are already using. You can use that data for automating decisioning and surfacing new insights on the customer, all via one API.SDK Installationpipinstallcodat-lendingExample UsageSDK Example UsageExampleimportcodatlendingfromcodatlending.modelsimportshareds=codatlending.CodatLending(security=shared.Security(auth_header="Basic BASE_64_ENCODED(API_KEY)",),)req=shared.CompanyRequestBody(name='Bank of Dave',description='Requested early access to the new financing scheme.',)res=s.companies.create(req)ifres.companyisnotNone:# handle responsepassAvailable Resources and Operationscompaniescreate- Create companydelete- Delete a companyget- Get companylist- List companiesupdate- Update companyconnectionscreate- Create connectiondelete- Delete connectionget- Get connectionlist- List connectionsunlink- Unlink connectiontransactions.account_transactionsget- Get account transactionlist- List account transactionstransactions.direct_costsdownload_attachment- Download direct cost attachmentget- Get direct costget_attachment- Get direct cost attachmentlist- List direct costslist_attachments- List direct cost attachmentstransactions.transfersget- Get transferlist- List transferstransactions.journal_entriesget- Get journal entrylist- List journal entriestransactions.journalsget- Get journallist- List journalsaccounting_bank_datalist_transactions- List bank account transactionsaccounting_bank_data.accountsget- Get bank accountlist- List bank accountsbanking.account_balanceslist- List account balancesbanking.accountsget- Get accountlist- List accountsbanking.transaction_categoriesget- Get transaction categorylist- List transaction categoriesbanking.transactionsget- Get bank transactionlist- List transactionsbanking.categorized_statementget- Get categorized bank statementaccounts_payable.billsdownload_attachment- Download bill attachmentget- Get billget_attachment- Get bill attachmentlist- List billslist_attachments- List bill attachmentsaccounts_payable.suppliersdownload_attachment- Download supplier attachmentget- Get supplierget_attachment- Get supplier attachmentlist- List supplierslist_attachments- List supplier attachmentsaccounts_payable.bill_credit_notesget- Get bill credit notelist- List bill credit notesaccounts_payable.bill_paymentsget- Get bill paymentlist- List bill paymentssales.customersget- Get customerlist- List customerssales.disputesget- Get disputelist- List disputessales.locationsget- Get locationlist- List locationssales.ordersget- Get orderlist- List orderssales.payment_methodsget- Get payment methodlist- List payment methodssales.paymentsget- Get paymentlist- List paymentssales.product_categoriesget- Get product categorylist- List product categoriessales.productsget- Get productlist- List productssales.transactionsget- Get transactionlist- List transactionssales.metricsget_customer_retention- Get customer retention metricsget_lifetime_value- Get lifetime value metricsget_revenue- Get commerce revenue metricssales.reportsget_orders- Get orders reportget_refunds- Get refunds reportcompany_infoget_accounting_profile- Get company accounting profileget_commerce_profile- Get company commerce profileaccounts_receivable.customersdownload_attachment- Download customer attachmentget- Get customerget_attachment- Get customer attachmentlist- List customerslist_attachments- List customer attachmentsaccounts_receivable.direct_incomesdownload_attachment- Download direct income attachmentget- Get direct incomeget_attachment- Get direct income attachmentlist- List direct incomeslist_attachments- List direct income attachmentsaccounts_receivable.invoicesdownload_attachment- Download invoice attachmentdownload_pdf- Get invoice as PDFget- Get invoiceget_attachment- Get invoice attachmentlist- List invoiceslist_attachments- List invoice attachmentslist_reconciled- List reconciled invoicesaccounts_receivable.credit_notesget- Get credit notelist- List credit notesaccounts_receivable.paymentsget- Get paymentlist- List paymentsaccounts_receivable.reportsget_aged_creditors- Aged creditors reportget_aged_debtors- Aged debtors reportis_aged_creditors_available- Aged creditors report availableis_aged_debtors_available- Aged debtors report availablefile_uploaddownload- Download all files for a companylist_uploaded- List all files uploaded by a companyupload- Upload files for a companyloan_writeback.bank_accountscreate- Create bank accountget_create_update_model- Get create/update bank account modelloan_writeback.bank_transactionscreate- Create bank account transactionsget_create_model- Get create bank account transactions modelloan_writeback.accountscreate- Create accountget_create_model- Get create account modelloan_writeback.direct_costscreate- Create direct costget_create_model- Get create direct cost modelloan_writeback.paymentscreate- Create paymentget_create_model- Get create payment modelloan_writeback.supplierscreate- Create supplierget_create_update_model- Get create/update supplier modelloan_writeback.transferscreate- Create transferget_create_model- Get create transfer modelloan_writeback.create_operationsget- Get create operationlist- List create operationsfinancial_statements.accountsget- Get accountlist- List accountsfinancial_statements.balance_sheetget- Get balance sheetget_categorized_accounts- Get categorized balance sheet statementfinancial_statements.cash_flowget- Get cash flow statementfinancial_statements.profit_and_lossget- Get profit and lossget_categorized_accounts- Get categorized profit and loss statementmanage_dataget_status- Get data statusmanage_data.refreshall_data_types- Refresh all datadata_type- Refresh data typemanage_data.pull_operationsget- Get pull operationlist- List pull operationsliabilitiesgenerate_loan_summary- Generate loan summaries reportgenerate_loan_transactions- Generate loan transactions reportget_loan_summary- Get loan summarieslist_loan_transactions- List loan transactionsdata_integritydetails- List data integrity detailsstatus- Get data integrity statussummaries- Get data integrity summariesexcel_reportsdownload- Download Excel reportgenerate- Generate Excel reportget_status- Get Excel report statusRetriesSome of the endpoints in this SDK support retries. If you use the SDK without any configuration, it will fall back to the default retry strategy provided by the API. However, the default retry strategy can be overridden on a per-operation basis, or across the entire SDK.To change the default retry strategy for a single API call, simply provide aRetryConfigobject to the call:importcodatlendingfromcodatlending.modelsimportsharedfromcodatlending.utilsimportBackoffStrategy,RetryConfigs=codatlending.CodatLending(security=shared.Security(auth_header="Basic BASE_64_ENCODED(API_KEY)",),)req=shared.CompanyRequestBody(name='Bank of Dave',description='Requested early access to the new financing scheme.',)res=s.companies.create(req,RetryConfig('backoff',BackoffStrategy(1,50,1.1,100),False))ifres.companyisnotNone:# handle responsepassIf you'd like to override the default retry strategy for all operations that support retries, you can use theretry_configoptional parameter when initializing the SDK:importcodatlendingfromcodatlending.modelsimportsharedfromcodatlending.utilsimportBackoffStrategy,RetryConfigs=codatlending.CodatLending(retry_config=RetryConfig('backoff',BackoffStrategy(1,50,1.1,100),False)security=shared.Security(auth_header="Basic BASE_64_ENCODED(API_KEY)",),)req=shared.CompanyRequestBody(name='Bank of Dave',description='Requested early access to the new financing scheme.',)res=s.companies.create(req)ifres.companyisnotNone:# handle responsepassError HandlingHandling errors in this SDK should largely match your expectations.  All operations return a response object or raise an error.  If Error objects are specified in your OpenAPI Spec, the SDK will raise the appropriate Error type.Error ObjectStatus CodeContent Typeerrors.ErrorMessage400,401,402,403,429,500,503application/jsonerrors.SDKError4x-5xx/Exampleimportcodatlendingfromcodatlending.modelsimporterrors,shareds=codatlending.CodatLending(security=shared.Security(auth_header="Basic BASE_64_ENCODED(API_KEY)",),)req=shared.CompanyRequestBody(name='Bank of Dave',description='Requested early access to the new financing scheme.',)res=Nonetry:res=s.companies.create(req)excepterrors.ErrorMessagease:# handle exceptionraise(e)excepterrors.SDKErrorase:# handle exceptionraise(e)ifres.companyisnotNone:# handle responsepassServer SelectionSelect Server by IndexYou can override the default server globally by passing a server index to theserver_idx: intoptional parameter when initializing the SDK client instance. The selected server will then be used as the default on the operations that use it. This table lists the indexes associated with the available servers:#ServerVariables0https://api.codat.ioNoneExampleimportcodatlendingfromcodatlending.modelsimportshareds=codatlending.CodatLending(server_idx=0,security=shared.Security(auth_header="Basic BASE_64_ENCODED(API_KEY)",),)req=shared.CompanyRequestBody(name='Bank of Dave',description='Requested early access to the new financing scheme.',)res=s.companies.create(req)ifres.companyisnotNone:# handle responsepassOverride Server URL Per-ClientThe default server can also be overridden globally by passing a URL to theserver_url: stroptional parameter when initializing the SDK client instance. For example:importcodatlendingfromcodatlending.modelsimportshareds=codatlending.CodatLending(server_url="https://api.codat.io",security=shared.Security(auth_header="Basic BASE_64_ENCODED(API_KEY)",),)req=shared.CompanyRequestBody(name='Bank of Dave',description='Requested early access to the new financing scheme.',)res=s.companies.create(req)ifres.companyisnotNone:# handle responsepassCustom HTTP ClientThe Python SDK makes API calls using therequestsHTTP library.  In order to provide a convenient way to configure timeouts, cookies, proxies, custom headers, and other low-level configuration, you can initialize the SDK client with a customrequests.Sessionobject.For example, you could specify a header for every request that this sdk makes as follows:importcodatlendingimportrequestshttp_client=requests.Session()http_client.headers.update({'x-custom-header':'someValue'})s=codatlending.CodatLending(client:http_client)AuthenticationPer-Client Security SchemesThis SDK supports the following security scheme globally:NameTypeSchemeauth_headerapiKeyAPI keyYou can set the security parameters through thesecurityoptional parameter when initializing the SDK client instance. For example:importcodatlendingfromcodatlending.modelsimportshareds=codatlending.CodatLending(security=shared.Security(auth_header="Basic BASE_64_ENCODED(API_KEY)",),)req=shared.CompanyRequestBody(name='Bank of Dave',description='Requested early access to the new financing scheme.',)res=s.companies.create(req)ifres.companyisnotNone:# handle responsepassSupportIf you encounter any challenges while utilizing our SDKs, please don't hesitate to reach out for assistance.
You can raise any issues by contacting your dedicated Codat representative or reaching out to oursupport team.
We're here to help ensure a smooth experience for you.Library generated bySpeakeasy