Package: codat-sync-for-commerce-version-1
Sync for Commerce version 1﻿Embedded accounting integrations for POS and eCommerce platforms.SDK Installationpipinstallcodat-sync-for-commerce-version-1Example UsageSDK Example UsageExampleimportcodatsynccommercefromcodatsynccommerce.modelsimportoperations,shareds=codatsynccommerce.CodatSyncCommerce(security=shared.Security(auth_header="Basic BASE_64_ENCODED(API_KEY)",),)req=operations.GetConfigTextSyncFlowRequest(locale=shared.Locale.EN_US,)res=s.sync_flow_preferences.get_config_text_sync_flow(req)ifres.localization_infoisnotNone:# handle responsepassAvailable Resources and Operationssync_flow_preferencesget_config_text_sync_flow- Retrieve preferences for text fields on sync flowget_sync_flow_url- Retrieve sync flow urlget_visible_accounts- List visible accountsupdate_config_text_sync_flow- Update preferences for text fields on sync flowupdate_visible_accounts_sync_flow- Update the visible accounts on sync flowcompaniesdelete_company- Delete a companyget_company- Get companyupdate_company- Update companyconnectionsdelete_connection- Delete connectionget_connection- Get connectionunlink- Unlink connectionaccounting_bank_accountsget_accounting_bank_account- Get bank accountlist_accounting_bank_accounts- List bank accountscommerce_customersget_commerce_customer- Get customerlist_commerce_customers- List customerscommerce_company_infoget_commerce_company_info- Get company infocommerce_locationsget_commerce_location- Get locationlist_commerce_locations- List locationscommerce_ordersget_commerce_order- Get orderlist_commerce_orders- List orderscommerce_paymentsget_commerce_payment- Get paymentget_method- Get payment methodlist_commerce_payments- List paymentslist_methods- List payment methodscommerce_productsget_commerce_product- Get productlist_commerce_products- List productscommerce_transactionsget_commerce_transaction- Get transactionlist_commerce_transactions- List transactionsaccounting_accountscreate_accounting_account- Create accountget_accounting_account- Get accountlist_accounting_accounts- List accountsaccounting_credit_notescreate_accounting_credit_note- Create credit noteaccounting_customerscreate_accounting_customer- Create customeraccounting_direct_incomescreate_accounting_direct_income- Create direct incomeaccounting_invoicescreate_accounting_invoice- Create invoiceaccounting_journal_entriescreate_accounting_journal_entry- Create journal entryaccounting_paymentscreate_accounting_payment- Create paymentrefresh_dataall- Refresh all databy_data_type- Refresh data typeget_company_data_status- Get data statusget_pull_operation- Get pull operationlist_pull_operations- List pull operationsaccounting_company_infoget_accounting_company_info- Get company inforefresh- Refresh company infopush_dataget_operation- Get push operationlist_operations- List push operationssyncget_sync_status- Get status for a company's syncsrequest_sync- Sync newrequest_sync_for_date_range- Sync rangeconfigurationget_configuration- Retrieve config preferences set for a companyset_configuration- Create or update configurationintegrationsget_integration_branding- Get branding for an integrationlist_integrations- List integrationscompany_managementcreate_company- Create sync for commerce companycreate_connection- Create connectionlist_companies- List companieslist_connections- List data connectionsupdate_connection- Update data connectionRetriesSome 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 a retryConfig object to the call:importcodatsynccommercefromcodatsynccommerce.modelsimportoperations,sharedfromcodatsynccommerce.utilsimportBackoffStrategy,RetryConfigs=codatsynccommerce.CodatSyncCommerce(security=shared.Security(auth_header="Basic BASE_64_ENCODED(API_KEY)",),)req=operations.GetConfigTextSyncFlowRequest(locale=shared.Locale.EN_US,)res=s.sync_flow_preferences.get_config_text_sync_flow(req,RetryConfig('backoff',BackoffStrategy(1,50,1.1,100),False))ifres.localization_infoisnotNone:# handle responsepassIf you'd like to override the default retry strategy for all operations that support retries, you can provide a retryConfig at SDK initialization:importcodatsynccommercefromcodatsynccommerce.modelsimportoperations,sharedfromcodatsynccommerce.utilsimportBackoffStrategy,RetryConfigs=codatsynccommerce.CodatSyncCommerce(retry_config=RetryConfig('backoff',BackoffStrategy(1,50,1.1,100),False)security=shared.Security(auth_header="Basic BASE_64_ENCODED(API_KEY)",),)req=operations.GetConfigTextSyncFlowRequest(locale=shared.Locale.EN_US,)res=s.sync_flow_preferences.get_config_text_sync_flow(req)ifres.localization_infoisnotNone:# 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.ErrorMessage401,402,403,429,500,503application/jsonerrors.SDKError400-600/Exampleimportcodatsynccommercefromcodatsynccommerce.modelsimportoperations,shareds=codatsynccommerce.CodatSyncCommerce(security=shared.Security(auth_header="Basic BASE_64_ENCODED(API_KEY)",),)req=operations.GetConfigTextSyncFlowRequest(locale=shared.Locale.EN_US,)res=Nonetry:res=s.sync_flow_preferences.get_config_text_sync_flow(req)excepterrors.ErrorMessagease:print(e)# handle exceptionraise(e)excepterrors.SDKErrorase:print(e)# handle exceptionraise(e)ifres.localization_infoisnotNone:# 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.ioNoneExampleimportcodatsynccommercefromcodatsynccommerce.modelsimportoperations,shareds=codatsynccommerce.CodatSyncCommerce(server_idx=0,security=shared.Security(auth_header="Basic BASE_64_ENCODED(API_KEY)",),)req=operations.GetConfigTextSyncFlowRequest(locale=shared.Locale.EN_US,)res=s.sync_flow_preferences.get_config_text_sync_flow(req)ifres.localization_infoisnotNone:# 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:importcodatsynccommercefromcodatsynccommerce.modelsimportoperations,shareds=codatsynccommerce.CodatSyncCommerce(server_url="https://api.codat.io",security=shared.Security(auth_header="Basic BASE_64_ENCODED(API_KEY)",),)req=operations.GetConfigTextSyncFlowRequest(locale=shared.Locale.EN_US,)res=s.sync_flow_preferences.get_config_text_sync_flow(req)ifres.localization_infoisnotNone:# handle responsepassCustom HTTP ClientThe Python SDK makes API calls using the (requests)[https://pypi.org/project/requests/] HTTP library.  In order to provide a convenient way to configure timeouts, cookies, proxies, custom headers, and other low-level configuration, you can initialize the SDK client with a customrequests.Sessionobject.For example, you could specify a header for every request that this sdk makes as follows:importcodatsynccommerceimportrequestshttp_client=requests.Session()http_client.headers.update({'x-custom-header':'someValue'})s=codatsynccommerce.CodatSyncCommerce(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:importcodatsynccommercefromcodatsynccommerce.modelsimportoperations,shareds=codatsynccommerce.CodatSyncCommerce(security=shared.Security(auth_header="Basic BASE_64_ENCODED(API_KEY)",),)req=operations.GetConfigTextSyncFlowRequest(locale=shared.Locale.EN_US,)res=s.sync_flow_preferences.get_config_text_sync_flow(req)ifres.localization_infoisnotNone:# 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